summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO65
-rw-r--r--009-include-path.patch85
-rw-r--r--10-vboxdrv.rules5
-rw-r--r--PKGBUILD208
-rw-r--r--VBoxFixUSB16
-rw-r--r--dkms.conf35
-rw-r--r--do_dkms67
-rw-r--r--vboxweb.conf11
-rw-r--r--vboxweb.rc86
-rw-r--r--virtualbox-bin.install47
10 files changed, 625 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..ecb3caafa4d2
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,65 @@
+pkgbase = virtualbox-bin-5
+ pkgdesc = Oracle VM VirtualBox Binary Edition (Oracle branded non-OSE version 5)
+ pkgver = 5.2.26
+ pkgrel = 1
+ url = https://www.virtualbox.org/
+ install = virtualbox-bin.install
+ arch = x86_64
+ license = GPL2
+ makedepends = linux-headers
+ depends = dkms
+ depends = fontconfig
+ depends = gcc
+ depends = libgl
+ depends = libidl2
+ depends = libxcursor
+ depends = libxinerama
+ depends = libxmu
+ depends = python
+ depends = sdl
+ optdepends = virtualbox-ext-oracle: for Oracle extensions
+ optdepends = linux-headers: build the module for Arch kernel
+ optdepends = linux-lts-headers: build the module for LTS Arch kernel
+ provides = virtualbox=5.2.26
+ provides = virtualbox-sdk
+ provides = VIRTUALBOX-HOST-MODULES
+ provides = virtualbox-host-dkms
+ provides = virtualbox-guest-iso
+ conflicts = virtualbox
+ conflicts = virtualbox-sdk
+ conflicts = virtualbox-host-dkms
+ conflicts = virtualbox-host-modules-arch
+ replaces = virtualbox_bin
+ replaces = virtualbox-sun
+ noextract = VirtualBoxSDK-5.2.26-128414.zip
+ options = !strip
+ options = !emptydirs
+ backup = etc/vbox/vbox.cfg
+ backup = etc/conf.d/vboxweb
+ source = https://download.virtualbox.org/virtualbox/5.2.26/VirtualBoxSDK-5.2.26-128414.zip
+ source = VBoxAuth-r75085.h::https://www.virtualbox.org/svn/vbox/trunk/include/VBox/VBoxAuth.h?p=75085
+ source = VBoxAuthPAM-r75085.c::https://www.virtualbox.org/svn/vbox/trunk/src/VBox/HostServices/auth/pam/VBoxAuthPAM.c?p=75085
+ source = VBoxAuthSimple-r75085.cpp::https://www.virtualbox.org/svn/vbox/trunk/src/VBox/HostServices/auth/simple/VBoxAuthSimple.cpp?p=75085
+ source = VBoxFixUSB
+ source = 10-vboxdrv.rules
+ source = vboxweb.rc
+ source = vboxweb.conf
+ source = do_dkms
+ source = dkms.conf
+ source = 009-include-path.patch
+ source = http://download.virtualbox.org/virtualbox/5.2.26/VirtualBox-5.2.26-128414-Linux_amd64.run
+ sha256sums = 8195105ffeb4eeb5dd9b71d2dd43a1d9a52e26c6e47d36c59e6a4efa734bda97
+ sha256sums = 23e3e0e6abfaa69bf0aa046c0ee070d19435b97cb4bfbb16bba65a2783502154
+ sha256sums = 815f6e2e3ab687356aad0e6f59eef6e266514fb12a6b569d239d834e0a480f37
+ sha256sums = 99deff35d8a600f20223b96ba409451834e58ac21a589a989dd82a2d6fe006ae
+ sha256sums = 0aebe22abab402ea6b6573af637a99d8056a904920a52d84fb97729219219c23
+ sha256sums = 69417a9e8855cab8e4878886abe138f559fd17ae487d4cd19c8a24974a8bbec2
+ sha256sums = 656905de981ffa24f6f921c920538854a235225053f44baedacc07b46ca0cf56
+ sha256sums = 12dbba3b59991f2b68cddeeeda20236aeff63e11b7e2d1b08d9d6a82225f6651
+ sha256sums = cc1c0500ab07bc13563d99037f776bf64bdc90bb521e31e2e0b04e42ea5bb36a
+ sha256sums = e9df0fff15184d0a90abe17707bdbe1931582433bbc14ded4fb3b0252653c801
+ sha256sums = 5112f0e1ba3bd0bd92ef2edb2d21024e265abb02841aa29aa05410526adc273f
+ sha256sums = 2612057005af12938408cbdce2416c65a72664ee17bd8a4c1536b357367cccec
+
+pkgname = virtualbox-bin-5
+
diff --git a/009-include-path.patch b/009-include-path.patch
new file mode 100644
index 000000000000..845ae9df92e4
--- /dev/null
+++ b/009-include-path.patch
@@ -0,0 +1,85 @@
+diff --git a/src/VBox/HostDrivers/Support/vboxdrv/Makefile b/src/VBox/HostDrivers/Support/vboxdrv/Makefile
+index d199047..34d895f 100644
+--- a/src/VBox/HostDrivers/Support/vboxdrv/Makefile
++++ b/src/VBox/HostDrivers/Support/vboxdrv/Makefile
+@@ -131,7 +131,7 @@ ifdef VBOX_WITH_NATIVE_DTRACE
+ MOD_OBJS += SUPDrvDTrace.o
+ endif
+
+-MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
++MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD)/vboxdrv,/ /include /r0drv/linux)
+ ifdef VBOX_WITH_NATIVE_DTRACE
+ MOD_INCL += -I/usr/include/linux -I/usr/include
+ endif
+@@ -157,7 +157,7 @@ ifdef VBOX_WITH_TEXT_MODMEM_HACK
+ endif
+
+ # build defs
+-MOD_CFLAGS = -include $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h \
++MOD_CFLAGS = -include $(KBUILD_EXTMOD)/vboxdrv/include/VBox/SUPDrvMangling.h \
+ -fno-omit-frame-pointer -fno-pie
+
+ include $(obj)/Makefile.include.footer
+diff --git a/src/VBox/HostDrivers/Support/vboxnetadp/Makefile b/src/VBox/HostDrivers/Support/vboxnetadp/Makefile
+index 694cb5c..8487820 100644
+--- a/src/VBox/HostDrivers/Support/vboxnetadp/Makefile
++++ b/src/VBox/HostDrivers/Support/vboxnetadp/Makefile
+@@ -34,7 +34,7 @@ MOD_OBJS += math/gcc/divdi3.o \
+ math/gcc/umoddi3.o
+ endif
+
+-MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
++MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD)/vboxnetadp,/ /include /r0drv/linux)
+ MOD_DEFS = -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX \
+ -DRT_WITH_VBOX -DVBOX_WITH_HARDENING \
+ -Wno-declaration-after-statement
+@@ -59,6 +59,6 @@ ifdef VBOX_USE_INSERT_PAGE
+ endif
+
+ # build defs
+-MOD_CFLAGS = -include $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h -fno-pie
++MOD_CFLAGS = -include $(KBUILD_EXTMOD)/vboxnetadp/include/VBox/SUPDrvMangling.h -fno-pie
+
+ include $(obj)/Makefile.include.footer
+diff --git a/src/VBox/HostDrivers/Support/vboxnetflt/Makefile b/src/VBox/HostDrivers/Support/vboxnetflt/Makefile
+index e262c61..ca956d5 100644
+--- a/src/VBox/HostDrivers/Support/vboxnetflt/Makefile
++++ b/src/VBox/HostDrivers/Support/vboxnetflt/Makefile
+@@ -38,7 +38,7 @@ MOD_OBJS += math/gcc/divdi3.o \
+ math/gcc/umoddi3.o
+ endif
+
+-MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
++MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD)/vboxnetflt,/ /include /r0drv/linux)
+ MOD_DEFS = -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 \
+ -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING \
+ -Wno-declaration-after-statement
+@@ -63,6 +63,6 @@ ifdef VBOX_USE_INSERT_PAGE
+ endif
+
+ # build defs
+-MOD_CFLAGS = -include $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h -fno-pie
++MOD_CFLAGS = -include $(KBUILD_EXTMOD)/vboxnetflt/include/VBox/SUPDrvMangling.h -fno-pie
+
+ include $(obj)/Makefile.include.footer
+diff --git a/src/VBox/HostDrivers/Support/vboxpci/Makefile b/src/VBox/HostDrivers/Support/vboxpci/Makefile
+index 6b3878a..7b8a8a2 100644
+--- a/src/VBox/HostDrivers/Support/vboxpci/Makefile
++++ b/src/VBox/HostDrivers/Support/vboxpci/Makefile
+@@ -38,7 +38,7 @@ MOD_OBJS += math/gcc/divdi3.o \
+ math/gcc/umoddi3.o
+ endif
+
+-MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
++MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD)/vboxpci,/ /include /r0drv/linux)
+ MOD_DEFS = -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX \
+ -DRT_WITH_VBOX -DVBOX_WITH_HARDENING
+ ifeq ($(BUILD_TARGET_ARCH),amd64)
+@@ -60,6 +60,6 @@ ifdef VBOX_USE_INSERT_PAGE
+ endif
+
+ # build defs
+-MOD_CFLAGS = -include $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h -fno-pie
++MOD_CFLAGS = -include $(KBUILD_EXTMOD)/vboxpci/include/VBox/SUPDrvMangling.h -fno-pie
+
+ include $(obj)/Makefile.include.footer
diff --git a/10-vboxdrv.rules b/10-vboxdrv.rules
new file mode 100644
index 000000000000..12b7ab57afc6
--- /dev/null
+++ b/10-vboxdrv.rules
@@ -0,0 +1,5 @@
+KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="root", MODE="0600"
+SUBSYSTEM=="usb_device", ACTION=="add", RUN="VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
+SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", RUN="VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
+SUBSYSTEM=="usb_device", ACTION=="remove", RUN="VBoxCreateUSBNode.sh --remove $major $minor"
+SUBSYSTEM=="usb", ACTION=="remove", ENV{DEVTYPE}=="usb_device", RUN="VBoxCreateUSBNode.sh --remove $major $minor"
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..17ccd8b2a54d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,208 @@
+# Maintainer : David C. Rankin <drankinatty@gmail.com>
+
+pkgname=virtualbox-bin-5
+pkgver=5.2.26
+_build=128414
+_rev=75085
+pkgrel=1
+pkgdesc='Oracle VM VirtualBox Binary Edition (Oracle branded non-OSE version 5)'
+arch=('x86_64')
+url='https://www.virtualbox.org/'
+license=('GPL2')
+depends=('dkms' 'fontconfig' 'gcc' 'libgl' 'libidl2' 'libxcursor' 'libxinerama'
+ 'libxmu' 'python' 'sdl')
+makedepends=('linux-headers')
+optdepends=('virtualbox-ext-oracle: for Oracle extensions'
+ 'linux-headers: build the module for Arch kernel'
+ 'linux-lts-headers: build the module for LTS Arch kernel')
+provides=("virtualbox=${pkgver}" 'virtualbox-sdk' 'VIRTUALBOX-HOST-MODULES'
+ 'virtualbox-host-dkms' 'virtualbox-guest-iso')
+conflicts=('virtualbox' 'virtualbox-sdk' 'virtualbox-host-dkms' 'virtualbox-host-modules-arch')
+replaces=('virtualbox_bin' 'virtualbox-sun')
+backup=('etc/vbox/vbox.cfg' 'etc/conf.d/vboxweb')
+options=('!strip' '!emptydirs')
+install="${pkgname%-5}.install"
+source=("https://download.virtualbox.org/virtualbox/${pkgver}/VirtualBoxSDK-${pkgver}-${_build}.zip"
+ "VBoxAuth-r${_rev}.h"::"https://www.virtualbox.org/svn/vbox/trunk/include/VBox/VBoxAuth.h?p=${_rev}"
+ "VBoxAuthPAM-r${_rev}.c"::"https://www.virtualbox.org/svn/vbox/trunk/src/VBox/HostServices/auth/pam/VBoxAuthPAM.c?p=${_rev}"
+ "VBoxAuthSimple-r${_rev}.cpp"::"https://www.virtualbox.org/svn/vbox/trunk/src/VBox/HostServices/auth/simple/VBoxAuthSimple.cpp?p=${_rev}"
+ 'VBoxFixUSB'
+ '10-vboxdrv.rules'
+ 'vboxweb.rc'
+ 'vboxweb.conf'
+ 'do_dkms'
+ 'dkms.conf'
+ '009-include-path.patch'
+ "http://download.virtualbox.org/virtualbox/${pkgver}/VirtualBox-${pkgver}-${_build}-Linux_amd64.run")
+noextract=("VirtualBoxSDK-${pkgver}-${_build}.zip")
+sha256sums=('8195105ffeb4eeb5dd9b71d2dd43a1d9a52e26c6e47d36c59e6a4efa734bda97'
+ '23e3e0e6abfaa69bf0aa046c0ee070d19435b97cb4bfbb16bba65a2783502154'
+ '815f6e2e3ab687356aad0e6f59eef6e266514fb12a6b569d239d834e0a480f37'
+ '99deff35d8a600f20223b96ba409451834e58ac21a589a989dd82a2d6fe006ae'
+ '0aebe22abab402ea6b6573af637a99d8056a904920a52d84fb97729219219c23'
+ '69417a9e8855cab8e4878886abe138f559fd17ae487d4cd19c8a24974a8bbec2'
+ '656905de981ffa24f6f921c920538854a235225053f44baedacc07b46ca0cf56'
+ '12dbba3b59991f2b68cddeeeda20236aeff63e11b7e2d1b08d9d6a82225f6651'
+ 'cc1c0500ab07bc13563d99037f776bf64bdc90bb521e31e2e0b04e42ea5bb36a'
+ 'e9df0fff15184d0a90abe17707bdbe1931582433bbc14ded4fb3b0252653c801'
+ '5112f0e1ba3bd0bd92ef2edb2d21024e265abb02841aa29aa05410526adc273f'
+ '2612057005af12938408cbdce2416c65a72664ee17bd8a4c1536b357367cccec')
+
+prepare() {
+ [ "$CARCH" = 'i686' ] && local _arch='x86'
+ [ "$CARCH" = 'x86_64' ] && local _arch='amd64'
+
+ mkdir -p "${pkgname}-${pkgver}"
+
+ # extract the main source file
+ yes | sh "VirtualBox-${pkgver}-${_build}-Linux_${_arch}.run" \
+ --target "${srcdir}/${pkgname}-${pkgver}" \
+ --nox11 \
+ --noexec \
+ &> /dev/null
+
+ # extract sdk
+ cd "${pkgname}-${pkgver}"
+ bsdtar -xf "${srcdir}/VirtualBoxSDK-${pkgver}-${_build}.zip"
+}
+
+package() {
+ local _installdir='/opt/VirtualBox'
+
+ # install bundled files
+ printf '%s\n' ' -> Installing bundled files...'
+ install -d "${pkgdir}/${_installdir}"
+ tar -jxf "${srcdir}/${pkgname}-${pkgver}/VirtualBox.tar.bz2" -C "${pkgdir}/${_installdir}"
+
+ # apply patch 009-include-path (thanks to Christian Hesse)
+ printf '%s\n' " -> Applying patch '009-includepath.patch'..."
+ cd "${pkgdir}/${_installdir}/src/vboxhost/"
+ patch -Np5 -i "${srcdir}/009-include-path.patch"
+
+ # hardened build: mark binaries suid root, create symlinks for working around
+ # unsupported $ORIGIN/.. in VBoxC.so and make sure the
+ # directory is only writable by the user (paranoid)
+ cd "${pkgdir}/${_installdir}"
+ chmod 4511 VirtualBox VBox{SDL,Headless,NetDHCP,NetNAT,NetAdpCtl,VolInfo}
+ for _lib in VBox{VMM,RT}.so
+ do
+ ln -s "${_installdir}/${_lib}" "components/${_lib}"
+ done
+ chmod go-w "${pkgdir}/${_installdir}"
+
+ # install SDK
+ printf '%s\n' ' -> Installing SDK...'
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ pushd 'sdk/installer' >/dev/null
+ VBOX_INSTALL_PATH="$_installdir" python vboxapisetup.py install --root "$pkgdir"
+ popd >/dev/null
+ rm -r "${pkgdir}/${_installdir}/sdk"
+ mkdir -p "${pkgdir}/${_installdir}/sdk"
+ cp -a sdk/bindings "${pkgdir}/${_installdir}/sdk"
+ cp -a sdk/docs "${pkgdir}/${_installdir}"
+ install -D -m644 "${srcdir}/VBoxAuth-r${_rev}.h" "${pkgdir}/${_installdir}/sdk/bindings/auth/include/VBoxAuth.h"
+ install -D -m644 "${srcdir}/VBoxAuthPAM-r${_rev}.c" "${pkgdir}/${_installdir}/sdk/bindings/auth/VBoxAuthPAM.cpp"
+ install -D -m644 "${srcdir}/VBoxAuthSimple-r${_rev}.cpp" "${pkgdir}/${_installdir}/sdk/bindings/auth/VBoxAuthSimple.cpp"
+
+ # install udev rules
+ printf '%s\n' ' -> Installing udev rules...'
+ cd "${pkgdir}/${_installdir}"
+ install -D -m0644 "${srcdir}/10-vboxdrv.rules" "${pkgdir}/usr/lib/udev/rules.d/10-vboxdrv.rules"
+ ## we need to copy and not symlink VBoxCreateUSBNode.sh in /usr/lib/udev to avoid udevd
+ ## to look /opt when /opt is not mounted. This can be done until VBoxCreateUSBNode.sh doesn't
+ ## need more stuff from /opt
+ cp -a VBoxCreateUSBNode.sh "${pkgdir}/usr/lib/udev/"
+
+ printf '%s\n' ' -> Installing scripts...'
+
+ # install VBoxFixUSB script
+ install -D -m0755 "${srcdir}/VBoxFixUSB" VBoxFixUSB
+
+ # install vboxweb initscript
+ install -D -m0755 "${srcdir}/vboxweb.rc" "${pkgdir}/etc/rc.d/vboxweb"
+ install -D -m0644 "${srcdir}/vboxweb.conf" "${pkgdir}/etc/conf.d/vboxweb"
+
+ printf '%s\n' ' -> Creating needed symlinks...'
+
+ # symlink the launchers (second link can fail if fs is not case sensitive)
+ install -d -m0755 "${pkgdir}/usr/bin"
+ for _bin in VirtualBox VBox{Headless,Manage,SDL,SVC,Tunctl,NetAdpCtl,FixUSB} rdesktop-vrdp
+ do
+ ln -s "${_installdir}/${_bin}" "${pkgdir}/usr/bin/${_bin}"
+ ln -s "${_installdir}/${_bin}" "${pkgdir}/usr/bin/${_bin,,}" &>/dev/null || :
+ done
+
+ # symlink the desktop icon and .desktop files
+ install -d -m0755 "${pkgdir}/usr/"{share/applications,share/pixmaps}
+ ln -s "${_installdir}/VBox.png" "${pkgdir}/usr/share/pixmaps/VBox.png"
+ ln -s "${_installdir}/icons/128x128/virtualbox.png" "${pkgdir}/usr/share/pixmaps/virtualbox.png"
+ ln -s "${_installdir}/virtualbox.desktop" "${pkgdir}/usr/share/applications/virtualbox.desktop"
+
+ # symlink mime info
+ install -d -m0755 "${pkgdir}/usr/share/mime/packages"
+ ln -s "${_installdir}/virtualbox.xml" "${pkgdir}/usr/share/mime/packages/virtualbox.xml"
+
+ # symlink doc
+ install -d -m0755 "${pkgdir}/usr/share/doc/${pkgname}"
+ ln -s "${_installdir}/VirtualBox.chm" "${pkgdir}/usr/share/doc/${pkgname}/virtualbox.chm"
+
+ # symlink icons
+ pushd icons >/dev/null
+ for _dir in *
+ do
+ cd "$_dir"
+ install -d -m0755 "${pkgdir}/usr/share/icons/hicolor/${_dir}/"{apps,mimetypes}
+ for _icon in *
+ do
+ if [ "$_icon" = 'virtualbox.png' ]
+ then
+ ln -s "${_installdir}/icons/${_dir}/${_icon}" "${pkgdir}/usr/share/icons/hicolor/${_dir}/apps/${_icon}"
+ else
+ ln -s "${_installdir}/icons/${_dir}/${_icon}" "${pkgdir}/usr/share/icons/hicolor/${_dir}/mimetypes/${_icon}"
+ fi
+ done
+ cd - >/dev/null
+ done
+ popd >/dev/null
+
+ # with the relase of VirtualBox 5.1.0, Oracle dropped DKMS support from their package
+ # we will restore DKMS with the use of these config files
+ printf '%s\n' ' -> Installing DKMS support...'
+ install -D -m0755 "${srcdir}/do_dkms" -t "${pkgdir}/${_installdir}/src/vboxhost"
+ ## update module version
+ cd "$srcdir"
+ cp -a dkms.conf "${pkgname}-${pkgver}"
+ sed -i "s/PACKAGE_VERSION=/PACKAGE_VERSION=${pkgver}/" "${pkgname}-${pkgver}/dkms.conf"
+ install -D -m0644 "${pkgname}-${pkgver}/dkms.conf" -t "${pkgdir}/${_installdir}/src/vboxhost"
+
+ # module sources in /usr/src
+ printf '%s\n' ' -> Installing module sources...'
+ install -d -m0755 "${pkgdir}/usr/src"
+ mv "${pkgdir}/${_installdir}/src/vboxhost" "${pkgdir}/usr/src/vboxhost-${pkgver}"
+
+ # write the configuration file
+ printf '%s\n' ' -> Writing the configuration file...'
+ install -D -m0644 /dev/null "${pkgdir}/etc/vbox/vbox.cfg"
+ cat > "${pkgdir}/etc/vbox/vbox.cfg" <<EOF
+# VirtualBox installation directory
+INSTALL_DIR='${_installdir}'
+
+# VirtualBox version
+INSTALL_VER='${pkgver}'
+INSTALL_REV='${_build}'
+EOF
+
+ # write modules-load.d configuration to ensure that modules are loaded at boot
+ printf '%s\n' " -> Writing 'modules-load.d' configuration..."
+ install -D -m644 /dev/null "${pkgdir}/usr/lib/modules-load.d/${pkgname}.conf"
+ printf '%s\n' '# Load virtualbox kernel modules at boot ' >"${pkgdir}/usr/lib/modules-load.d/${pkgname}.conf"
+ printf '%s\n\n' "# This file was installed by the ${pkgname} AUR package" >>"${pkgdir}/usr/lib/modules-load.d/${pkgname}.conf"
+ printf '%s\n' 'vboxdrv' >>"${pkgdir}/usr/lib/modules-load.d/${pkgname}.conf"
+ printf '%s\n' 'vboxpci' >>"${pkgdir}/usr/lib/modules-load.d/${pkgname}.conf"
+ printf '%s\n' 'vboxnetadp' >>"${pkgdir}/usr/lib/modules-load.d/${pkgname}.conf"
+ printf '%s\n' 'vboxnetflt' >>"${pkgdir}/usr/lib/modules-load.d/${pkgname}.conf"
+
+ # fix permissions (change executables from 4711 to 4755)
+ printf '%s\n' ' -> Fixing permissions...'
+ chmod 4755 "${pkgdir}/${_installdir}"/{VBox{Headless,Net{AdpCtl,DHCP,NAT},SDL,VolInfo},VirtualBox}
+}
diff --git a/VBoxFixUSB b/VBoxFixUSB
new file mode 100644
index 000000000000..f4c1ebe6f015
--- /dev/null
+++ b/VBoxFixUSB
@@ -0,0 +1,16 @@
+#!/bin/bash
+# 2012: Seblu was here
+
+. /etc/vbox/vbox.cfg
+
+# Build our device tree
+for i in /sys/bus/usb/devices/*; do
+ if test -r "$i/dev"; then
+ dev="`cat "$i/dev" 2> /dev/null`"
+ major="`expr "$dev" : '\(.*\):' 2> /dev/null`"
+ minor="`expr "$dev" : '.*:\(.*\)' 2> /dev/null`"
+ class="`cat $i/bDeviceClass 2> /dev/null`"
+ sh "$INSTALL_DIR/VBoxCreateUSBNode.sh" "$major" "$minor" "$class" 2>/dev/null
+ fi
+done
+# vim:set ts=2 sw=2 ft=sh et:
diff --git a/dkms.conf b/dkms.conf
new file mode 100644
index 000000000000..1b0a07b95d82
--- /dev/null
+++ b/dkms.conf
@@ -0,0 +1,35 @@
+## @file
+# Linux DKMS config script for the VirtualBox guest kernel modules
+#
+
+#
+# Copyright (C) 2006-2015 Oracle Corporation
+#
+# This file is part of VirtualBox Open Source Edition (OSE), as
+# available from http://www.virtualbox.org. This file is free software;
+# you can redistribute it and/or modify it under the terms of the GNU
+# General Public License (GPL) as published by the Free Software
+# Foundation, in version 2 as it comes in the "COPYING" file of the
+# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+#
+
+PACKAGE_NAME="vboxhost"
+PACKAGE_VERSION=
+AUTOINSTALL=yes
+
+BUILT_MODULE_NAME[0]="vboxdrv"
+BUILT_MODULE_LOCATION[0]="vboxdrv"
+DEST_MODULE_LOCATION[0]="/kernel/misc"
+
+BUILT_MODULE_NAME[1]="vboxnetflt"
+BUILT_MODULE_LOCATION[1]="vboxnetflt"
+DEST_MODULE_LOCATION[1]="/kernel/misc"
+
+BUILT_MODULE_NAME[2]="vboxnetadp"
+BUILT_MODULE_LOCATION[2]="vboxnetadp"
+DEST_MODULE_LOCATION[2]="/kernel/misc"
+
+BUILT_MODULE_NAME[3]="vboxpci"
+BUILT_MODULE_LOCATION[3]="vboxpci"
+DEST_MODULE_LOCATION[3]="/kernel/misc"
diff --git a/do_dkms b/do_dkms
new file mode 100644
index 000000000000..cc9c7d676051
--- /dev/null
+++ b/do_dkms
@@ -0,0 +1,67 @@
+#!/bin/sh
+
+#
+# Script to register/build/unregister a kernel module with DKMS.
+#
+# Copyright (C) 2010-2015 Oracle Corporation
+#
+# This file is part of VirtualBox Open Source Edition (OSE), as
+# available from http://www.virtualbox.org. This file is free software;
+# you can redistribute it and/or modify it under the terms of the GNU
+# General Public License (GPL) as published by the Free Software
+# Foundation, in version 2 as it comes in the "COPYING" file of the
+# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+#
+
+ACTION=
+if [ "$1" = "install" ]; then
+ ACTION="install"
+ MODULE="$2"
+ VERSION="$3"
+elif [ "$1" = "uninstall" ]; then
+ shift
+ ACTION="uninstall"
+ OLDMODULES="$*"
+ break
+fi
+
+DKMS=`which dkms 2>/dev/null`
+if [ -n "$DKMS" ]
+then
+ if [ "$ACTION" = "uninstall" ]; then
+
+ echo "Uninstalling modules from DKMS"
+ for m in $OLDMODULES
+ do
+ $DKMS status -m $m | while read line
+ # first, remove _any_ old module
+ do
+ if echo "$line" | grep -q added > /dev/null ||
+ echo "$line" | grep -q built > /dev/null ||
+ echo "$line" | grep -q installed > /dev/null; then
+ # either 'vboxvideo, <version>: added'
+ # or 'vboxvideo, <version>, ...: installed'
+ version=`echo "$line" | sed "s/$m,\([^,]*\)[,:].*/\1/;t;d"`
+ echo " removing old DKMS module $m version $version"
+ $DKMS remove -m $m -v $version --all
+ fi
+ done
+ done
+ exit 0
+
+ elif [ "$ACTION" = "install" ]; then
+
+ echo "Attempting to install using DKMS"
+ if $DKMS add -m $MODULE -v $VERSION &&
+ $DKMS build -m $MODULE -v $VERSION &&
+ $DKMS install -m $MODULE -v $VERSION --force
+ then
+ exit 0
+ fi
+ echo "Failed to install using DKMS, attempting to install without"
+
+ fi
+fi
+
+exit 1
diff --git a/vboxweb.conf b/vboxweb.conf
new file mode 100644
index 000000000000..49d82d828ead
--- /dev/null
+++ b/vboxweb.conf
@@ -0,0 +1,11 @@
+# WebService Mandatory Variables
+#VBOXWEB_USER=
+
+# WebService Variables
+#VBOXWEB_LOGFILE=
+#$VBOXWEB_HOST=
+#$VBOXWEB_PORT=
+#$VBOXWEB_TIMEOUT=
+#$VBOXWEB_CHECK_INTERVAL=
+#$VBOXWEB_THREADS=
+#$VBOXWEB_KEEPALIVE=
diff --git a/vboxweb.rc b/vboxweb.rc
new file mode 100644
index 000000000000..97273e3c7391
--- /dev/null
+++ b/vboxweb.rc
@@ -0,0 +1,86 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/vbox/vbox.cfg
+. /etc/conf.d/vboxweb
+
+BINARY="$INSTALL_DIR/vboxwebsrv"
+
+start() {
+ stat_busy "Starting VirtualBox Web Service";
+ if ! pidof -o %PPID $BINARY >/dev/null; then
+ [[ "$VBOXWEB_USER" ]] || stat_die
+ lsmod | grep -q "vboxdrv[^_-]" || stat_die
+ PARAMS="--background"
+ [[ "$VBOXWEB_HOST" ]] && PARAMS+=" -H $VBOXWEB_HOST"
+ [[ "$VBOXWEB_PORT" ]] && PARAMS+=" -p $VBOXWEB_PORT"
+ [[ "$VBOXWEB_TIMEOUT" ]] && PARAMS+=" -t $VBOXWEB_TIMEOUT"
+ [[ "$VBOXWEB_CHECK_INTERVAL" ]] && PARAMS+=" -i $VBOXWEB_CHECK_INTERVAL"
+ [[ "$VBOXWEB_THREADS" ]] && PARAMS+=" -T $VBOXWEB_THREADS"
+ [[ "$VBOXWEB_KEEPALIVE" ]] && PARAMS+=" -k $VBOXWEB_KEEPALIVE"
+ [[ "$VBOXWEB_LOGFILE" ]] && PARAMS+=" -F $VBOXWEB_LOGFILE"
+ # prevent inheriting this setting to VBoxSVC
+ unset VBOX_RELEASE_LOG_DEST
+ su - $VBOXWEB_USER -c "$BINARY $PARAMS" &>/dev/null
+ # ugly: wait until the final process has forked
+ sleep .2
+ if pidof -o %PPID $BINARY >/dev/null; then
+ add_daemon vboxweb
+ stat_done
+ else
+ stat_die
+ fi
+ else
+ stat_die
+ fi
+}
+
+stop() {
+ stat_busy "Stopping VirtualBox Web Service"
+ PID=$(pidof -o %PPID $BINARY)
+ [[ $PID ]] && kill $PID &>/dev/null
+ if ! pidof -o %PPID $BINARY >/dev/null; then
+ rm_daemon vboxweb
+ stat_done
+ else
+ stat_die
+ fi
+}
+
+restart() {
+ stop && start
+}
+
+status() {
+ stat_busy "Checking for VirtualBox Web Service"
+ if pidof -o %PPID $BINARY >/dev/null; then
+ stat_done
+ else
+ stat_fail
+ false
+ fi
+}
+
+case "$1" in
+start)
+ start
+ ;;
+stop)
+ stop
+ ;;
+restart)
+ restart
+ ;;
+force-reload)
+ restart
+ ;;
+status)
+ status
+ ;;
+*)
+ echo "Usage: $0 {start|stop|restart|status}"
+ exit 1
+esac
+
+# vim:set ts=2 sw=2 ft=sh et:
diff --git a/virtualbox-bin.install b/virtualbox-bin.install
new file mode 100644
index 000000000000..d64b47cbf0d7
--- /dev/null
+++ b/virtualbox-bin.install
@@ -0,0 +1,47 @@
+# arg 1: the new package version
+post_install() {
+ # Add vboxusers group, GID 108 is reserved (http://wiki.archlinux.org/index.php/UID_and_GID_list),
+ getent group vboxusers &> /dev/null || groupadd -f -g 108 vboxusers
+
+ # Load new udev rule for module vboxdrv
+ udevadm control --reload-rules
+
+ # Show warnings
+ cat <<EOF
+
+==> Remember to add allowed users to the vboxusers group:
+==> # gpasswd -a USERNAME vboxusers
+EOF
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+pre_upgrade() {
+ # Remove any stuff remaining from the module compilation
+ rm -Rf "/opt/VirtualBox"
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ post_install "$1"
+ (($(vercmp $2 '4.1.14-2') < 0 )) && cat <<EOF || true
+
+==> **Warning**
+==> This version drop vboxdrv initscript.
+==> Please change to dkms instead of vboxdrv in DAEMONS in rc.conf.
+==>
+EOF
+}
+
+# arg 1: the old package version
+post_remove() {
+ # Remove any stuff remaining from the module compilation
+ rm -Rf "/opt/VirtualBox"
+
+ # Remove any run files
+ rm -Rf "/var/run/VirtualBox"
+
+ # remove vboxusers group
+ groupdel vboxusers &>/dev/null || true
+}