commit 7820e0888b64c42a922a118774e8bc2905c94e98 Author: Jose V Beneyto <sepen@crux.nu> Date: Wed Aug 24 16:32:53 2016 +0200 virtualbox: fix modules installation to non-standard location (FS#1323) and improvements diff --git a/virtualbox/.footprint b/virtualbox/.footprint index d9e1768..153adb3 100644 --- a/virtualbox/.footprint +++ b/virtualbox/.footprint @@ -5,13 +5,11 @@ drwxr-xr-x root/root etc/udev/rules.d/ drwxr-xr-x root/root lib/ drwxr-xr-x root/root lib/modules/ drwxr-xr-x root/root lib/modules/<kernel-version>/ -drwxr-xr-x root/root lib/modules/<kernel-version>/kernel/ -drwxr-xr-x root/root lib/modules/<kernel-version>/kernel/drivers/ -drwxr-xr-x root/root lib/modules/<kernel-version>/kernel/drivers/misc/ --rw-r--r-- root/root lib/modules/<kernel-version>/kernel/drivers/misc/vboxdrv.ko --rw-r--r-- root/root lib/modules/<kernel-version>/kernel/drivers/misc/vboxnetadp.ko --rw-r--r-- root/root lib/modules/<kernel-version>/kernel/drivers/misc/vboxnetflt.ko --rw-r--r-- root/root lib/modules/<kernel-version>/kernel/drivers/misc/vboxpci.ko +drwxr-xr-x root/root lib/modules/<kernel-version>/extra/ +-rw-r--r-- root/root lib/modules/<kernel-version>/extra/vboxdrv.ko +-rw-r--r-- root/root lib/modules/<kernel-version>/extra/vboxnetadp.ko +-rw-r--r-- root/root lib/modules/<kernel-version>/extra/vboxnetflt.ko +-rw-r--r-- root/root lib/modules/<kernel-version>/extra/vboxpci.ko drwxr-xr-x root/root usr/ drwxr-xr-x root/root usr/bin/ -rwxr-xr-x root/root usr/bin/virtualbox @@ -1094,7 +1092,6 @@ drwxr-xr-x root/root usr/share/virtualbox/bin/sdk/bindings/xpcom/samples/ drwxr-xr-x root/root usr/share/virtualbox/bin/src/ -rw-r--r-- root/root usr/share/virtualbox/bin/src/Makefile -rwxr-xr-x root/root usr/share/virtualbox/bin/src/build_in_tmp --rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxdrv.ko drwxr-xr-x root/root usr/share/virtualbox/bin/src/vboxdrv/ -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxdrv/.SUPDrv.o.cmd -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxdrv/.SUPDrvGip.o.cmd @@ -1473,7 +1470,6 @@ drwxr-xr-x root/root usr/share/virtualbox/bin/src/vboxdrv/r0drv/linux/ -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxdrv/vboxdrv.mod.o -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxdrv/vboxdrv.o -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxdrv/version-generated.h --rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetadp.ko drwxr-xr-x root/root usr/share/virtualbox/bin/src/vboxnetadp/ -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetadp/.VBoxNetAdp.o.cmd drwxr-xr-x root/root usr/share/virtualbox/bin/src/vboxnetadp/.tmp_versions/ @@ -1482,7 +1478,7 @@ drwxr-xr-x root/root usr/share/virtualbox/bin/src/vboxnetadp/.tmp_versions/ -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetadp/.vboxnetadp.mod.o.cmd -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetadp/.vboxnetadp.o.cmd -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetadp/Makefile --rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetadp/Module.symvers +-rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetadp/Module.symvers (EMPTY) -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetadp/VBoxNetAdp.c -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetadp/VBoxNetAdp.o -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetadp/VBoxNetAdpInternal.h @@ -1568,7 +1564,6 @@ drwxr-xr-x root/root usr/share/virtualbox/bin/src/vboxnetadp/r0drv/linux/ -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetadp/vboxnetadp.mod.o -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetadp/vboxnetadp.o -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetadp/version-generated.h --rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetflt.ko drwxr-xr-x root/root usr/share/virtualbox/bin/src/vboxnetflt/ -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetflt/.SUPR0IdcClient.o.cmd -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetflt/.SUPR0IdcClientComponent.o.cmd @@ -1579,7 +1574,7 @@ drwxr-xr-x root/root usr/share/virtualbox/bin/src/vboxnetflt/.tmp_versions/ -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetflt/.vboxnetflt.mod.o.cmd -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetflt/.vboxnetflt.o.cmd -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetflt/Makefile --rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetflt/Module.symvers +-rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetflt/Module.symvers (EMPTY) -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetflt/SUPDrvIDC.h -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetflt/SUPR0IdcClient.c -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetflt/SUPR0IdcClient.o @@ -1667,7 +1662,6 @@ drwxr-xr-x root/root usr/share/virtualbox/bin/src/vboxnetflt/r0drv/linux/ -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetflt/vboxnetflt.mod.o -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetflt/vboxnetflt.o -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxnetflt/version-generated.h --rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxpci.ko drwxr-xr-x root/root usr/share/virtualbox/bin/src/vboxpci/ -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxpci/.SUPR0IdcClient.o.cmd -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxpci/.SUPR0IdcClientComponent.o.cmd @@ -1678,7 +1672,7 @@ drwxr-xr-x root/root usr/share/virtualbox/bin/src/vboxpci/.tmp_versions/ -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxpci/.vboxpci.mod.o.cmd -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxpci/.vboxpci.o.cmd -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxpci/Makefile --rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxpci/Module.symvers +-rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxpci/Module.symvers (EMPTY) -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxpci/SUPDrvIDC.h -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxpci/SUPR0IdcClient.c -rw-r--r-- root/root usr/share/virtualbox/bin/src/vboxpci/SUPR0IdcClient.o diff --git a/virtualbox/.md5sum b/virtualbox/.md5sum index f107bdb..75683b6 100644 --- a/virtualbox/.md5sum +++ b/virtualbox/.md5sum @@ -1,4 +1,4 @@ 2a2724088f65d0a373a689209bb4d938 60-vboxdrv.rules e25a6a1f3c113c373dc0433f9c2526f3 VirtualBox-5.1.4.tar.bz2 -7d871e19b96ece653ddce4cc83adbe66 virtualbox +0c555d9eeb7ee24fc059f956f5d9edb1 virtualbox 362e923d42651f370561b0f9095ea7a5 virtualbox.desktop diff --git a/virtualbox/Pkgfile b/virtualbox/Pkgfile index c33ee45..e2346de 100644 --- a/virtualbox/Pkgfile +++ b/virtualbox/Pkgfile @@ -6,13 +6,19 @@ name=virtualbox version=5.1.4 -release=1 +release=2 source=(http://download.virtualbox.org/$name/$version/VirtualBox-$version.tar.bz2 \ $name 60-vboxdrv.rules $name.desktop) build() { - # environment value - [ ! -z $KERN_DIR ] && KARG="KERN_DIR=$KERN_DIR" + # customize kernel version + if [ ! -z $KERN_DIR ]; then + KVER="$(make -s -C $KERN_DIR kernelversion)" + KARGS="KERN_DIR=$KERN_DIR" + else + KVER="$(uname -r)" + fi + KARGS="$KARGS MODULE_DIR=$PKG/lib/modules/$KVER/extra" cd VirtualBox-$version @@ -37,14 +43,9 @@ build() { source ./env.sh kmk all - # compile kernel modules - cd out/linux.amd64/release/bin/src - - make $KARG - - # install kernel modules - install -d $PKG/lib/modules/$(uname -r)/kernel/drivers/misc - install -m 0644 *.ko $PKG/lib/modules/$(uname -r)/kernel/drivers/misc + # compile and install kernel modules + sed '/depmod -a/d' -i out/linux.amd64/release/bin/src/*/Makefile + make -s -C out/linux.amd64/release/bin/src $KARGS install # remove superfluous files rm -rf $SRC/VirtualBox-$version/out/linux.amd64/release/bin/{sdk/samples,testcase,nls*} diff --git a/virtualbox/README b/virtualbox/README index e237ae4..7d4b4d1 100644 --- a/virtualbox/README +++ b/virtualbox/README @@ -41,6 +41,24 @@ POST-INSTALL PRECAUTION - Virtualbox by default uses /usr/src/linux as the source directory of your Linux kernel. - To use an alternative kernel directory you should type something like: - # env KERN_DIR=/not-default-path/src/linux pkgmk + Virtualbox by default uses /usr/src/linux as the source directory of your + Linux kernel. To use an alternative kernel directory you should type + something like: + # env KERN_DIR=/not-default-path/src/linux pkgmk + + +NOTES + + Upgrading a kernel should not affect external modules. Modules which are + included in the kernel are installed in: /lib/modules/$(KERNELRELEASE)/kernel + And external modules are installed in: /lib/modules/$(KERNELRELEASE)/extra + + Anyway if you want to compile and install virtualbox modules again you have + some alternatives: + # make -C /usr/share/virtualbox/bin/src \ + MODULE_DIR=/lib/modules/$(uname -r)/extra install + + Or if you want to an specific kernel version (for example: 4.1.8) + # make -C /usr/share/virtualbox/bin/src \ + KERN_DIR=/usr/src/linux-4.1.8 \ + MODULE_DIR=/lib/modules/4.1.8/extra install diff --git a/virtualbox/virtualbox b/virtualbox/virtualbox index eaae9e1..e4ae35d 100644 --- a/virtualbox/virtualbox +++ b/virtualbox/virtualbox @@ -14,10 +14,10 @@ VBOX_PATH=/usr/share/virtualbox/bin export LD_LIBRARY_PATH=${VBOX_PATH}:${LD_LIBRARY_PATH} cd ${VBOX_PATH} -./VBoxSVC &>/dev/null & +./VBoxSVC >/dev/null & sleep 2 ./VirtualBox -cd - &> /dev/null +cd - > /dev/null /usr/bin/pkill VBoxSVC || /bin/kill -9 `/usr/bin/pgrep VBoxSVC`