Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix vboxsf host mounting. #2986

Merged
merged 2 commits into from
Jul 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ else
$(ISO_BUILD_IMAGE) /usr/bin/make out/minikube.iso
endif

iso_in_docker:
docker run -it --rm --workdir /mnt --volume $(CURDIR):/mnt $(ISO_DOCKER_EXTRA_ARGS) \
--user $(shell id -u):$(shell id -g) --env HOME=/tmp --env IN_DOCKER=1 \
$(ISO_BUILD_IMAGE) /bin/bash

test-iso:
go test -v $(REPOPATH)/test/integration --tags=iso --minikube-args="--iso-url=file://$(shell pwd)/out/buildroot/output/images/rootfs.iso9660"

Expand Down
1 change: 1 addition & 0 deletions deploy/iso/minikube-iso/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ RUN apt-get update \
rsync \
dumb-init \
golang-go \
libpcre3-dev \
&& rm -rf /var/lib/apt/lists/*

RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
Expand Down
5 changes: 3 additions & 2 deletions deploy/iso/minikube-iso/configs/minikube_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ BR2_CCACHE=y
BR2_OPTIMIZE_2=y
BR2_TOOLCHAIN_BUILDROOT_VENDOR="minikube"
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_15=y
BR2_BINUTILS_VERSION_2_30_X=y
BR2_GCC_VERSION_7_X=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
Expand All @@ -18,7 +19,7 @@ BR2_ROOTFS_USERS_TABLES="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/coreos/minikube/use
BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/coreos/minikube/rootfs-overlay"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.14"
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.15"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/coreos/minikube/linux_defconfig"
BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y
Expand All @@ -31,6 +32,7 @@ BR2_PACKAGE_CIFS_UTILS=y
BR2_PACKAGE_E2TOOLS=y
BR2_PACKAGE_NFS_UTILS=y
BR2_PACKAGE_SSHFS=y
BR2_PACKAGE_XFSPROGS=y
BR2_PACKAGE_PARTED=y
BR2_PACKAGE_CA_CERTIFICATES=y
BR2_PACKAGE_CURL=y
Expand All @@ -50,7 +52,6 @@ BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_SYSTEMD_MACHINED=y
BR2_PACKAGE_SYSTEMD_VCONSOLE=y
BR2_PACKAGE_UTIL_LINUX_NSENTER=y
BR2_PACKAGE_XFSPROGS=y
BR2_TARGET_ROOTFS_CPIO_BZIP2=y
BR2_TARGET_ROOTFS_ISO9660=y
BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/coreos/minikube/isolinux.cfg"
Expand Down
1 change: 1 addition & 0 deletions deploy/iso/minikube-iso/package/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ menu "System tools"
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/cni-plugins-bin/Config.in"
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/hv-kvp-daemon/Config.in"
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/gluster/Config.in"
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/vbox-guest/Config.in"
endmenu
4 changes: 1 addition & 3 deletions deploy/iso/minikube-iso/package/cri-tools/cri-tools.hash
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
sha256 e83b5a8ff6fc2c98c3463600e74a86d7dbbea6330f883cd5663cbd59641a8086 v0.2.tar.gz
sha256 2c8e45414d5804628f557171d622ca3e4a55dfc1f2de0cd33bcba98e863342d1 v1.0.0-alpha.0.tar.gz
sha256 688cd566e11f09247e8135ac1ee65e5afb3ea3303c00569c5e1e265e3b2c68f6 v1.0.0-beta.0.tar.gz
sha256 a357c67c891896032865f7a34f7ec330e5a00fe7f20b6d8be50399b91c99a4ac v1.11.1.tar.gz
3 changes: 2 additions & 1 deletion deploy/iso/minikube-iso/package/cri-tools/cri-tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
################################################################################

CRI_TOOLS_VERSION = v1.0.0-beta.0
CRI_TOOLS_VERSION = v1.11.1
CRI_TOOLS_SITE = https://github.com/kubernetes-incubator/cri-tools/archive
CRI_TOOLS_SOURCE = $(CRI_TOOLS_VERSION).tar.gz
CRI_TOOLS_LICENSE = Apache-2.0
Expand All @@ -14,6 +14,7 @@ CRI_TOOLS_GOPATH = $(@D)/_output
CRI_TOOLS_ENV = \
CGO_ENABLED=1 \
GOPATH="$(CRI_TOOLS_GOPATH)" \
GOBIN="$(CRI_TOOLS_GOPATH)/bin" \
PATH=$(CRI_TOOLS_GOPATH)/bin:$(BR_PATH)


Expand Down
1 change: 1 addition & 0 deletions deploy/iso/minikube-iso/package/crio-bin/crio-bin.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ CRIO_BIN_GOPATH = $(@D)/_output
CRIO_BIN_ENV = \
CGO_ENABLED=1 \
GOPATH="$(CRIO_BIN_GOPATH)" \
GOBIN="$(CRIO_BIN_GOPATH)/bin" \
PATH=$(CRIO_BIN_GOPATH)/bin:$(BR_PATH)


Expand Down
1 change: 1 addition & 0 deletions deploy/iso/minikube-iso/package/kpod/kpod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ KPOD_GOPATH = $(@D)/_output
KPOD_BIN_ENV = \
CGO_ENABLED=1 \
GOPATH="$(KPOD_GOPATH)" \
GOBIN="$(KPOD_GOPATH)/bin" \
PATH=$(KPOD_GOPATH)/bin:$(BR_PATH)


Expand Down
5 changes: 5 additions & 0 deletions deploy/iso/minikube-iso/package/vbox-guest/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
config BR2_PACKAGE_VBOX_GUEST
bool "vbox-guest"
default y
depends on BR2_LINUX_KERNEL

3 changes: 3 additions & 0 deletions deploy/iso/minikube-iso/package/vbox-guest/vbox-guest.hash
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# From http://download.virtualbox.org/virtualbox/5.1.30/SHA256SUMS
sha256 96cab2296fb014ce0a16b7b9603b52208b9403c10c1524b44201d3c274e8a821 VirtualBox-5.1.38.tar.bz2
sha256 0e7ee2c78ebf7cd0d3a933d51148bef04a64f64fb27ccf70d59cddf9ca1e517a VBoxGuestAdditions_5.1.38.iso
67 changes: 67 additions & 0 deletions deploy/iso/minikube-iso/package/vbox-guest/vbox-guest.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
################################################################################
#
# VirtualBox Linux Guest Drivers
#
################################################################################

VBOX_GUEST_VERSION = 5.1.38
VBOX_GUEST_SITE = http://download.virtualbox.org/virtualbox/$(VBOX_GUEST_VERSION)
VBOX_GUEST_LICENSE = GPLv2
VBOX_GUEST_LICENSE_FILES = COPYING
VBOX_GUEST_SOURCE = VirtualBox-$(VBOX_GUEST_VERSION).tar.bz2
VBOX_GUEST_EXTRA_DOWNLOADS = http://download.virtualbox.org/virtualbox/${VBOX_GUEST_VERSION}/VBoxGuestAdditions_${VBOX_GUEST_VERSION}.iso

define VBOX_GUEST_EXPORT_MODULES
( cd $(@D)/src/VBox/Additions/linux; ./export_modules modules.tar.gz )
mkdir -p $(@D)/vbox-modules
tar -C $(@D)/vbox-modules -xzf $(@D)/src/VBox/Additions/linux/modules.tar.gz
endef

VBOX_GUEST_POST_EXTRACT_HOOKS += VBOX_GUEST_EXPORT_MODULES

VBOX_GUEST_MODULE_SUBDIRS = vbox-modules/
VBOX_GUEST_MODULE_MAKE_OPTS = KVERSION=$(LINUX_VERSION_PROBED)

define VBOX_GUEST_USERS
- -1 vboxsf -1 - - - - -
endef

define VBOX_GUEST_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 \
$(BR2_EXTERNAL_MINIKUBE_PATH)/package/vbox-guest/vboxservice.service \
$(TARGET_DIR)/usr/lib/systemd/system/vboxservice.service

ln -fs /usr/lib/systemd/system/vboxservice.service \
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/vboxservice.service
endef

define VBOX_GUEST_BUILD_CMDS
7z x -aoa $(BR2_DL_DIR)/vbox-guest/VBoxGuestAdditions_${VBOX_GUEST_VERSION}.iso -ir'!VBoxLinuxAdditions.run' -o"$(@D)"
sh $(@D)/VBoxLinuxAdditions.run --noexec --target $(@D)
tar --overwrite -C $(@D) -xjf $(@D)/VBoxGuestAdditions-amd64.tar.bz2 sbin/VBoxService
tar --overwrite -C $(@D) -xjf $(@D)/VBoxGuestAdditions-amd64.tar.bz2 bin/VBoxControl

$(TARGET_CC) -Wall -O2 -D_GNU_SOURCE -DIN_RING3 \
-I$(@D)/vbox-modules/vboxsf/include \
-I$(@D)/vbox-modules/vboxsf \
-o $(@D)/vbox-modules/mount.vboxsf \
$(@D)/src/VBox/Additions/linux/sharedfolders/vbsfmount.c \
$(@D)/src/VBox/Additions/linux/sharedfolders/mount.vboxsf.c
endef

define VBOX_GUEST_INSTALL_TARGET_CMDS
$(INSTALL) -Dm755 \
$(@D)/vbox-modules/mount.vboxsf \
$(TARGET_DIR)/sbin

$(INSTALL) -Dm755 \
$(@D)/sbin/VBoxService \
$(TARGET_DIR)/sbin

$(INSTALL) -Dm755 \
$(@D)/bin/VBoxControl \
$(TARGET_DIR)/bin
endef

$(eval $(kernel-module))
$(eval $(generic-package))
12 changes: 12 additions & 0 deletions deploy/iso/minikube-iso/package/vbox-guest/vboxservice.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=VirtualBox Guest Service
ConditionVirtualization=oracle

[Service]
ExecStartPre=-/usr/sbin/modprobe vboxguest
ExecStartPre=-/usr/sbin/modprobe vboxvideo
ExecStartPre=-/usr/sbin/modprobe vboxsf
ExecStart=/usr/sbin/VBoxService -f --disable-automount

[Install]
WantedBy=multi-user.target