8 LOG
="/var/log/vbox-install.log"
10 if [ -n "$INSTALL_DIR" ]; then
11 VBOXMANAGE
="$INSTALL_DIR/VBoxManage"
12 BUILDVBOXDRV
="$INSTALL_DIR/src/vboxhost/vboxdrv/build_in_tmp"
13 BUILDVBOXNETFLT
="$INSTALL_DIR/src/vboxhost/vboxnetflt/build_in_tmp"
14 BUILDVBOXNETADP
="$INSTALL_DIR/src/vboxhost/vboxnetadp/build_in_tmp"
16 echo "missing vbox.cfg"
22 stat_busy
"Unloading VirtualBox kernel modules"
23 for module
in vbox
{netflt
,netadp
,drv
}; do
24 if grep -q "^${module}" /proc
/modules
; then
30 for p
in /lib
/modules
/*; do
31 if [ ! -d "$p/kernel" ]; then
32 if [ -e "$p/misc/vboxdrv.ko" ]; then
33 stat_busy
"Removing old VirtualBox kernel modules from $p"
34 rm -f "$p/misc/vbox"{drv
,netadp
,netflt
}.ko
2>/dev
/null
35 rmdir -p --ignore-fail-on-non-empty "$p/misc/" 2>/dev
/null
40 if find /lib
/modules
/`uname -r` -name "vboxnetadp\.*" 2>/dev
/null|
grep -q vboxnetadp
; then
41 stat_busy
"Removing old VirtualBox netadp kernel module"
42 find /lib
/modules
/`uname -r` -name "vboxnetadp\.*" 2>/dev
/null|
xargs rm -f 2>/dev
/null
45 if find /lib
/modules
/`uname -r` -name "vboxnetflt\.*" 2>/dev
/null|
grep -q vboxnetflt
; then
46 stat_busy
"Removing old VirtualBox netflt kernel module"
47 find /lib
/modules
/`uname -r` -name "vboxnetflt\.*" 2>/dev
/null|
xargs rm -f 2>/dev
/null
50 if find /lib
/modules
/`uname -r` -name "vboxdrv\.*" 2>/dev
/null|
grep -q vboxdrv
; then
51 stat_busy
"Removing old VirtualBox kernel module"
52 find /lib
/modules
/`uname -r` -name "vboxdrv\.*" 2>/dev
/null|
xargs rm -f 2>/dev
/null
55 stat_busy
"Recompiling VirtualBox kernel modules"
57 --save-module-symvers /tmp
/vboxdrv-Module.symvers \
58 --no-print-directory install > $LOG 2>&1; then
59 echo "Look at $LOG to find out what went wrong"
61 if ! $BUILDVBOXNETFLT \
62 --use-module-symvers /tmp
/vboxdrv-Module.symvers \
63 --no-print-directory install >> $LOG 2>&1; then
64 echo "Look at $LOG to find out what went wrong"
66 if ! $BUILDVBOXNETADP \
67 --use-module-symvers /tmp
/vboxdrv-Module.symvers \
68 --no-print-directory install >> $LOG 2>&1; then
69 echo "Look at $LOG to find out what went wrong"
72 stat_busy
"Reloading VirtualBox kernel modules"
73 for module
in "${MODLIST[@]}"; do
79 echo "usage: $0 {setup}"