Commit 638d7b46 authored by Seblu's avatar Seblu
Browse files

up to vbox 4.1.0 (add dkms support)


git-svn-id: https://seblu.net/s/archpkg@98 02741741-5192-46b8-8916-7152b19231d9
parent 50629ec7
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -7,8 +7,8 @@
# Contributor: iggy <iggy.mfΘgmail·com>

pkgname=virtualbox_bin
pkgver=4.0.12
_build=72916
pkgver=4.1.0
_build=73009
pkgrel=1
pkgdesc='Oracle VM VirtualBox Binary Edition'
arch=('i686' 'x86_64')
@@ -17,6 +17,7 @@ license=('GPL2')
depends=('libidl2' 'libxcursor' 'libxinerama' 'libxslt' 'curl' 'kernel26-headers' 'python2')
options=('!strip')
optdepends=('virtualbox-ext-oracle: for Oracle extensions'
            'dkms: for handling kernel modules with dkms'
            'qt: for GUI support'
            'sdl: for VBoxSDL and GUI support'
            'mesa: for OpenGL support'
@@ -38,13 +39,13 @@ source=(
  'vboxweb.rc'
  'vboxweb.conf'
)
md5sums=('d020868f3d255a913eb9c9dbee2b7ff8'
md5sums=('e3e38cb11938822b7d830174c5bbe488'
         'fe60f9510502bea67383d9198ae8c13c'
         'c162cfc3683bb8e6970cf08a88b1e4a3'
         '2d5a0c5275bf660da9f30f75820b6078'
         'e7a94c97b1b1e1e843c1bb85181d2de8'
         '951bf4a5524e919fc4aaee6f46041e3d'
         'c159d683ba1947290fc2ad2c64194150'
         '3ac185709bfe688bb753c46e170d0546')
[[ "${CARCH}" = i686 ]] && md5sums[0]='c072af8d97d8bb56fce1e0332eaf94b6'
[[ "${CARCH}" = i686 ]] && md5sums[0]='533d1d194e89137cb27365ff4f29e008'
_installdir='/opt/VirtualBox'

package() {
+6 −1
Original line number Diff line number Diff line
# Try to build module if don't exist when calling start
START_BUILD=yes
# This variable is automatically set to no when DKMS is in use
START_BUILD=Yes

# Disable use of DKMS
# Elsewhere script try to detect DKMS
DISABLE_DKMS=No
+48 −26
Original line number Diff line number Diff line
@@ -15,11 +15,23 @@ else
  exit 0
fi

# detection of dkms (if not disabled)
if [[ "$DISABLE_DKMS" =~ [yY][eE][sS] ]]; then
  USE_DKMS=0
else
  which dkms &>/dev/null
  USE_DKMS=$((! $?))
fi

# STARTBUILD cannot be used with dkms
(( USE_DKMS == 1 )) && START_BUILD=no


load() {
  if [[ "$START_BUILD" =~ yes|YES ]]; then
  if [[ "$START_BUILD" =~ [yY][eE][sS] ]]; then
    # check if module exists
    c=$('find' "/lib/modules/$(uname -r)" -type f -regex '.*/vbox\(drv\|netadp\|netflt\).ko' | wc -l)
     [[ $c -eq 0 ]] && setup
    ((c == 0 )) && setup
  fi
  stat_busy "Loading VirtualBox kernel modules"
  # trivial loading
@@ -57,12 +69,21 @@ unload() {
}

remove() {
  if (( USE_DKMS == 1 )); then
    status "Removing VirtualBox kernel modules with DKMS" dkms remove -m vboxhost -v "$INSTALL_VER" --all
  else
    stat_busy "Removing VirtualBox kernel modules"
  'find' "/lib/modules/$(uname -r)" -type f -regex '.*/vbox\(drv\|netadp\|netflt\).ko' -delete
    find "/lib/modules/$(uname -r)" -type f -regex '.*/vbox\(drv\|netadp\|netflt\).ko' -delete
    stat_done
  fi
}

setup() {
  if (( USE_DKMS == 1 )); then
    status "Adding VirtualBox kernel modules in DKMS" dkms add -m vboxhost -v "$INSTALL_VER"
    status "Bulding VirtualBox kernel modules with DKMS" dkms build -m vboxhost -v "$INSTALL_VER"
    status "Installing VirtualBox kernel modules with DKMS" dkms install -m vboxhost -v "$INSTALL_VER"
  else
    remove
    stat_busy "Compiling VirtualBox kernel modules"
    LOG="/tmp/vbox-install.log"
@@ -83,6 +104,7 @@ setup() {
    fi
    depmod -A
    stat_done
fi
}

fixusb() {