From 8d23351755ef023dc68e90de539ae086dda7dcec Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 12 Jul 2010 02:15:38 +0200 Subject: updates Signed-off-by: Florian Pritz --- virtualbox_bin/.gitignore | 1 + virtualbox_bin/PKGBUILD | 58 +++++++++++----------- virtualbox_bin/vboxdrv | 54 ++++++++++++++++++++ virtualbox_bin/virtualbox.install | 100 ++++++++++++++++++++++++-------------- 4 files changed, 148 insertions(+), 65 deletions(-) create mode 100644 virtualbox_bin/.gitignore create mode 100644 virtualbox_bin/vboxdrv (limited to 'virtualbox_bin') diff --git a/virtualbox_bin/.gitignore b/virtualbox_bin/.gitignore new file mode 100644 index 0000000..9857323 --- /dev/null +++ b/virtualbox_bin/.gitignore @@ -0,0 +1 @@ +*.run diff --git a/virtualbox_bin/PKGBUILD b/virtualbox_bin/PKGBUILD index 605710a..6e82e75 100644 --- a/virtualbox_bin/PKGBUILD +++ b/virtualbox_bin/PKGBUILD @@ -6,8 +6,8 @@ # Contributor: iggy pkgname="virtualbox_bin" -pkgver="3.2.0" -_build="61806" +pkgver="3.2.6" +_build="63112" pkgrel=1 pkgdesc="Powerful x86 virtualization (Personal Use Binaries Edition)." arch=('i686' 'x86_64') @@ -23,28 +23,28 @@ optdepends=("qt: for VirtualBox GUI" provides=("virtualbox=${pkgver}") conflicts=('virtualbox-ose' 'virtualbox-modules') install='virtualbox.install' -_architect='x86' -[ "$CARCH" = "x86_64" ] && _architect='amd64' -source=("VirtualBox-${pkgver}-${_build}-Linux_${_architect}.run::http://download.virtualbox.org/virtualbox/${pkgver}/VirtualBox-${pkgver}-${_build}-Linux_${_architect}.run" +_arch='x86' +[ "$CARCH" = "x86_64" ] && _arch='amd64' +source=("VirtualBox-${pkgver}-${_build}-Linux_${_arch}.run::http://download.virtualbox.org/virtualbox/${pkgver}/VirtualBox-${pkgver}-${_build}-Linux_${_arch}.run" '10-vboxdrv.rules' - 'vbox_build_module') -md5sums=('003c36b1704dda450b6b21e99afc2d85' + 'vboxdrv') +md5sums=('a32de974d0e06196e7fd4581d93535b1' '98859bfca9ef2ebf2ea43eb9123316fc' - 'dcb2d165b25274f77426a895d6dc41af') -[ "$CARCH" = "x86_64" ] && md5sums[0]='6fc4475dc26af6aa64bd9fb37ea9ca6a' + '160fc08a43cd9a719d306b5f023dea42') +[ "$CARCH" = "x86_64" ] && md5sums[0]='c88939c097f9e077b3941f5752b9e6d7' build() { # Check and unpack the run package via sh(1) - sh "VirtualBox-${pkgver}-${_build}-Linux_${_architect}.run" --check || return 1 - echo yes | sh "VirtualBox-${pkgver}-${_build}-Linux_${_architect}.run" --target "$srcdir" \ + sh "VirtualBox-${pkgver}-${_build}-Linux_${_arch}.run" --check || return 1 + echo yes | sh "VirtualBox-${pkgver}-${_build}-Linux_${_arch}.run" --target "$srcdir" \ --nox11 --noexec &> /dev/null || return 1 # Unpack bundled files - mkdir -p "$pkgdir/opt/VirtualBox" || return 1 + install -d "$pkgdir/opt/VirtualBox" || return 1 cd "$pkgdir/opt/VirtualBox" tar -xjf "$srcdir/VirtualBox.tar.bz2" || return 1 - mkdir -p "$pkgdir/usr/"{bin,share/applications,share/pixmaps} || return 1 + install -d "$pkgdir/usr/"{bin,share/applications,share/pixmaps} || return 1 # Hardened build: Mark binaries suid root, create symlinks for working around # unsupported $ORIGIN/.. in VBoxC.so and make sure the @@ -73,6 +73,18 @@ build() { #cd "$pkgdir/opt/VirtualBox" rm -Rf sdk vboxshell.py VBoxPython* + # Install rc.d script for module compilation + install -Dm0755 "${srcdir}/vboxdrv" "${pkgdir}/etc/rc.d/vboxdrv" || return 1 + + # Replace init script stuff + sed -i -e 's,sudo /etc/init.d/vboxdrv setup,/etc/rc.d/vboxdrv setup,g' \ + "$pkgdir/opt/VirtualBox/VBox.sh" + sed -i -e 's,sudo /etc/init.d/vboxdrv restart,modprobe vboxdrv,g' \ + "$pkgdir/opt/VirtualBox/VBox.sh" + + # Install udev rules + install -Dm0644 "$srcdir/10-vboxdrv.rules" "$pkgdir/lib/udev/rules.d/10-vboxdrv.rules" || return 1 + # Symlink the launchers for _bin in VirtualBox VBox{Headless,Manage,SDL,SVC,Tunctl,NetAdpCtl} rdesktop-vrdp; do ln -s "/opt/VirtualBox/${_bin}" "$pkgdir/usr/bin/${_bin}" @@ -82,23 +94,11 @@ build() { ln -s "/opt/VirtualBox/VBox.png" "$pkgdir/usr/share/pixmaps/VBox.png" ln -s "/opt/VirtualBox/virtualbox.desktop" "$pkgdir/usr/share/applications/VirtualBox.desktop" - # Install vbox_build_module - install -Dm0744 "$srcdir/vbox_build_module" "$pkgdir/usr/bin/vbox_build_module" || return 1 - - # Replace some init scripts by simplified stuff - sed -i -e 's,sudo /etc/init.d/vboxdrv setup,/usr/bin/vbox_build_module,g' \ - "$pkgdir/opt/VirtualBox/VBox.sh" - sed -i -e 's,sudo /etc/init.d/vboxdrv restart,modprobe vboxdrv,g' \ - "$pkgdir/opt/VirtualBox/VBox.sh" - - # Install udev rules - install -Dm0644 "$srcdir/10-vboxdrv.rules" "$pkgdir/lib/udev/rules.d/10-vboxdrv.rules" || return 1 + # Symlink the license + install -d "$pkgdir/usr/share/licenses/$pkgname" || return 1 + ln -s "/opt/VirtualBox/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/PUEL" # Setup configuration - mkdir -p "$pkgdir/etc/vbox" || return 1 + install -d "$pkgdir/etc/vbox" || return 1 echo 'INSTALL_DIR="/opt/VirtualBox"' > "$pkgdir/etc/vbox/vbox.cfg" - - # Symlink the license - mkdir -p "$pkgdir/usr/share/licenses/$pkgname" || return 1 - ln -s "/opt/VirtualBox/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/PUEL" } diff --git a/virtualbox_bin/vboxdrv b/virtualbox_bin/vboxdrv new file mode 100644 index 0000000..df1bfeb --- /dev/null +++ b/virtualbox_bin/vboxdrv @@ -0,0 +1,54 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/vbox/vbox.cfg + +LOG="/var/log/vbox-install.log" +if [ -n "$INSTALL_DIR" ]; then + VBOXMANAGE="$INSTALL_DIR/VBoxManage" + BUILDVBOXDRV="$INSTALL_DIR/src/vboxdrv/build_in_tmp" + BUILDVBOXNETFLT="$INSTALL_DIR/src/vboxnetflt/build_in_tmp" + BUILDVBOXNETADP="$INSTALL_DIR/src/vboxnetadp/build_in_tmp" +else + echo "missing vbox.cfg" + exit 0 +fi +case "$1" in + setup) + if find /lib/modules/`uname -r` -name "vboxnetadp\.*" 2>/dev/null|grep -q vboxnetadp; then + stat_busy "Removing old VirtualBox netadp kernel module" + find /lib/modules/`uname -r` -name "vboxnetadp\.*" 2>/dev/null|xargs rm -f 2>/dev/null + stat_done + fi + if find /lib/modules/`uname -r` -name "vboxnetflt\.*" 2>/dev/null|grep -q vboxnetflt; then + stat_busy "Removing old VirtualBox netflt kernel module" + find /lib/modules/`uname -r` -name "vboxnetflt\.*" 2>/dev/null|xargs rm -f 2>/dev/null + stat_done + fi + if find /lib/modules/`uname -r` -name "vboxdrv\.*" 2>/dev/null|grep -q vboxdrv; then + stat_busy "Removing old VirtualBox kernel module" + find /lib/modules/`uname -r` -name "vboxdrv\.*" 2>/dev/null|xargs rm -f 2>/dev/null + stat_done + fi + stat_busy "Recompiling VirtualBox kernel modules" + if ! $BUILDVBOXDRV \ + --save-module-symvers /tmp/vboxdrv-Module.symvers \ + --no-print-directory install > $LOG 2>&1; then + echo "Look at $LOG to find out what went wrong" + fi + if ! $BUILDVBOXNETFLT \ + --use-module-symvers /tmp/vboxdrv-Module.symvers \ + --no-print-directory install >> $LOG 2>&1; then + echo "Look at $LOG to find out what went wrong" + fi + if ! $BUILDVBOXNETADP \ + --use-module-symvers /tmp/vboxdrv-Module.symvers \ + --no-print-directory install >> $LOG 2>&1; then + echo "Look at $LOG to find out what went wrong" + fi + stat_done + ;; + *) + echo "usage: $0 {setup}" +esac diff --git a/virtualbox_bin/virtualbox.install b/virtualbox_bin/virtualbox.install index 6831b68..e41a22b 100644 --- a/virtualbox_bin/virtualbox.install +++ b/virtualbox_bin/virtualbox.install @@ -1,21 +1,3 @@ -_install_notes() { - echo - echo '---------------------------------------------------------------------------' - echo ' IMPORTANT NOTES:' - echo - echo '- Run "vbox_build_module" as root every time your kernel is upgraded, to' - echo ' compile the module for the new kernel version.' - echo '- Add your user to the vboxusers group:' - echo ' gpasswd -a USERNAME vboxusers' - echo '- Add "vboxdrv" to the MODULES array in your "/etc/rc.conf"' - echo '- Add "vboxnetflt" to MODULES if you want Host Interface networking.' - echo '- Add "vboxnetadp" to MODULES if you want Host-Only networking.' - echo '- If USB does not work for you out-of-the-box, add the following line' - echo ' to "/etc/fstab":' - echo ' none /proc/bus/usb usbfs auto,busgid=108,busmode=0775,devgid=108,devmode=0664 0 0' - echo "---------------------------------------------------------------------------" -} - # $1: The new package version post_install() { # Unload modules (if any) @@ -24,8 +6,7 @@ post_install() { done # Build new module - echo "Building VirtualBox modules..." - /usr/bin/vbox_build_module &> /dev/null + /etc/rc.d/vboxdrv setup # Add vboxusers group, GID 108 is reserved (http://wiki.archlinux.org/index.php/UID_and_GID_list), # but in some systems it may be being used - please replace if needed. @@ -38,17 +19,39 @@ post_install() { udevadm control --reload-rules # Show the license - echo '---------------------------------------------------------------------------' >&2 - echo ' You must agree to the following license in order to use this program:' >&2 + echo >&2 + echo '==> You must agree to the following license in order to use this program:' >&2 + echo '------------------------------------------------------------------------' >&2 echo >&2 cat "/opt/VirtualBox/LICENSE" >&2 echo >&2 - echo '---------------------------------------------------------------------------' >&2 - - # Load the new module - modprobe vboxdrv - - _install_notes + echo '------------------------------------------------------------------------' >&2 + + /bin/cat < Add your user to the vboxusers group: +==> # gpasswd -a USERNAME vboxusers +==> +==> You must load vboxdrv module before starting VirtualBox: +==> # modprobe vboxdrv +==> +==> You must load vboxnetflt for Host Interface Networking: +==> # modprobe vboxnetflt +==> +==> You must load vboxnetadp for Host-Only networking: +==> # modprobe vboxnetadp +==> +==> To load it automatically, add vboxdrv module to the "MODULES" array +==> "/etc/rc.conf". +==> +==> Run \`/etc/rc.d/vboxdrv setup\` as root every time your kernel is +==> upgraded, to compile the module for the new kernel version. +==> +==> If USB does not work for you out-of-the-box, add the following line +==> to "/etc/fstab": +==> "none /proc/bus/usb usbfs auto,busgid=108,busmode=0775,devgid=108,devmode=0664 0 0" + +EOF } # $1: The new package version @@ -70,18 +73,43 @@ post_upgrade() { if [ "$1" != "$2" ]; then rm -Rf "/opt/virtualbox" &> /dev/null fi + + # Build new module + /etc/rc.d/vboxdrv setup # Create the directory below if it doesn't exist mkdir -p "/var/run/VirtualBox" - # Build new module - echo "Building VirtualBox modules..." - /usr/bin/vbox_build_module &> /dev/null - - # Load the new module - modprobe vboxdrv - - _install_notes + /bin/cat < You must load vboxdrv module before starting VirtualBox: +==> # modprobe vboxdrv +==> +==> You must load vboxnetflt for Host Interface Networking: +==> # modprobe vboxnetflt +==> +==> You must load vboxnetadp for Host-Only networking: +==> # modprobe vboxnetadp +==> +==> To load it automatically, add vboxdrv module to the "MODULES" array +==> "/etc/rc.conf". +==> +==> Run \`/etc/rc.d/vboxdrv setup\` as root every time your kernel is +==> upgraded, to compile the module for the new kernel version. +==> +==> If USB does not work for you out-of-the-box, add the following line +==> to "/etc/fstab": +==> "none /proc/bus/usb usbfs auto,busgid=108,busmode=0775,devgid=108,devmode=0664 0 0" + +EOF + + if [ "`vercmp $_OLDVERSION 3.2.2`" -lt 0 ]; then + /bin/cat < IMPORTANT: This package now uses \`/etc/rc.d/vboxdrv setup\` instead +==> of the old "vbox_build_module" script. + +EOF + fi } # $1: The old package version -- cgit v1.2.3-24-g4f1b