Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Commit

Permalink
vbox-guest: enable VBoxService for automounting host shares (#27)
Browse files Browse the repository at this point in the history
Fixes #21
  • Loading branch information
Sergiusz Urbaniak authored Sep 27, 2016
1 parent ace8941 commit 2cd98d7
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 5 deletions.
4 changes: 2 additions & 2 deletions board/coreos/minikube/users
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rkt -1 rkt -1 - /home/rkt /bin/bash rkt-admin,wheel -
docker -1 docker -1 =tcuser /home/docker /bin/bash rkt,rkt-admin,wheel -
rkt -1 rkt -1 - /home/rkt /bin/bash rkt-admin,wheel,vboxsf -
docker -1 docker -1 =tcuser /home/docker /bin/bash rkt,rkt-admin,wheel,vboxsf -
2 changes: 1 addition & 1 deletion package/automount/automount.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ define AUTOMOUNT_INSTALL_INIT_SYSTEMD
endef

define AUTOMOUNT_INSTALL_TARGET_CMDS
install -Dm755 \
$(INSTALL) -Dm755 \
$(BR2_EXTERNAL)/package/automount/minikube-automount \
$(TARGET_DIR)/usr/sbin/minikube-automount
endef
Expand Down
1 change: 1 addition & 0 deletions package/vbox-guest/vbox-guest.hash
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
md5 8c2331a718cfc038963c1214c2ba9811 VirtualBox-5.1.6.tar.bz2
# From http://download.virtualbox.org/virtualbox/5.1.6/SHA256SUMS
sha256 2e0112b0d85841587b8f212e6ba8f6c35b31e1cce6b6999497dc917cd37e6911 VirtualBox-5.1.6.tar.bz2
sha256 cbcf9b9b1000e09911b3d20e1efe529aef8a945cf130f6abffc14a39522cc1ed VBoxGuestAdditions_5.1.6.iso
28 changes: 26 additions & 2 deletions package/vbox-guest/vbox-guest.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
################################################################################

VBOX_GUEST_VERSION = 5.1.6
VBOX_GUEST_SOURCE = VirtualBox-$(VBOX_GUEST_VERSION).tar.bz2
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 )
Expand All @@ -21,7 +22,24 @@ 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)/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 $(BR2_DL_DIR)/VBoxGuestAdditions_${VBOX_GUEST_VERSION}.iso -ir'!VBoxLinuxAdditions.run' -o"$(@D)"
sh $(@D)/VBoxLinuxAdditions.run --noexec --target $(@D)
tar -C $(@D) -xjf $(@D)/VBoxGuestAdditions-amd64.tar.bz2 sbin/VBoxService

$(TARGET_CC) -Wall -O2 -D_GNU_SOURCE -DIN_RING3 \
-I$(@D)/vbox-modules/vboxsf/include \
-I$(@D)/vbox-modules/vboxsf \
Expand All @@ -31,7 +49,13 @@ define VBOX_GUEST_BUILD_CMDS
endef

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

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

$(eval $(kernel-module))
Expand Down
12 changes: 12 additions & 0 deletions 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

[Install]
WantedBy=multi-user.target

0 comments on commit 2cd98d7

Please sign in to comment.