1 # $1: The new package version
3 # Unload module (if any).
4 modprobe -r vboxdrv &>/dev/null
7 echo "Building vboxdrv module..."
8 /usr/bin/vbox_build_module &>/dev/null
11 groupadd -f -g 108 vboxusers
13 # Load new udev-rule for module vboxdrv
14 udevcontrol reload_rules
17 echo '---------------------------------------------------------------------------'
18 echo ' You must agree to the following license in order to use this program:'
20 cat /opt/virtualbox/LICENSE
22 echo '---------------------------------------------------------------------------'
28 echo '---------------------------------------------------------------------------'
29 echo ' IMPORTANT NOTES:'
31 echo '- Run "vbox_build_module" as root every time your kernel is upgraded, to'
32 echo ' compile the module for the new kernel version.'
33 echo '- Add your user to the vboxusers group:'
34 echo ' gpasswd -a USERNAME vboxusers'
35 echo '- Add "vboxdrv" to the MODULES array in your "/etc/rc.conf"'
36 echo '- Add "vboxnet" to DAEMONS if you want easy bridge networking setup. Then'
37 echo ' edit "/etc/vbox/interfaces".'
38 echo '- Add the following line to "/etc/fstab" if you want the vboxusers to have'
39 echo ' permission to emulate USB devices:'
40 echo ' none /proc/bus/usb usbfs'
41 echo ' auto,busgid=108,busmode=0775,devgid=108,devmode=0664 0 0'
42 echo "---------------------------------------------------------------------------"
45 # $1: The new package version
46 # $2: The old package version
48 _OLDVERSION=`echo $2 | cut -f-1 -d '-'`
50 # Unload module (if any).
51 modprobe -r vboxdrv &>/dev/null
53 # Remove any stuff from an old installation.
54 # Old versions used to use this directory.
55 rm -Rf "/opt/VirtualBox-${_OLDVERSION}" &>/dev/null
58 echo "Building vboxdrv module..."
59 /usr/bin/vbox_build_module &>/dev/null
65 # $1: The old package version
67 # Delete vboxusers group
70 # Unload module (if any).
71 modprobe -r vboxdrv &>/dev/null
73 # Remove the module file.
74 find "/lib/modules" -name "vboxdrv.ko" -exec rm -f '{}' \;
76 # Remove any stuff remaining from the module compilation.
77 rm -Rf "/opt/virtualbox"