postinst revision 5b802b5e11fed6e163afca32e9118d2599d312fb
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync# Copyright (C) 2006-2007 Sun Microsystems, Inc.
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync# available from http://www.virtualbox.org. This file is free software;
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync# you can redistribute it and/or modify it under the terms of the GNU
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync# General Public License as published by the Free Software Foundation,
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync# distribution. VirtualBox OSE is distributed in the hope that it will
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync# be useful, but WITHOUT ANY WARRANTY of any kind.
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync# for debconf
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync# remove old cruft
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync echo "Found old version of /etc/init.d/vboxdrv.sh, removing."
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync echo "Found old version of /etc/init.d/virtualbox, removing."
af62929dce3cc5e14c75438cd2b893f82ae6dbc8vboxsync echo "Found old version of /etc/vbox/vbox.cfg, removing."
0ae258e7d0d2520036514d896a9eea58bf285f03vboxsync# install udev rule
04e845ee9ef813501cd2570a4188cb852d170408vboxsync if [ "$udev_ver" = "" -o "$udev_ver" -lt 55 ]; then
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync echo 'KERNEL="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="vboxusers", MODE="0660"' \
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync echo 'KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="vboxusers", MODE="0660"' \
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync# create users groups
085bc29163eb87e345acaae02789e4c233d51f3bvboxsyncdb_input high virtualbox-ose/group-vboxusers || true
085bc29163eb87e345acaae02789e4c233d51f3bvboxsyncif [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko ]; then
085bc29163eb87e345acaae02789e4c233d51f3bvboxsyncUnable to find a precompiled module for the current kernel
085bc29163eb87e345acaae02789e4c233d51f3bvboxsyncthough module compilation denied by debconf setting.
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync db_input critical virtualbox-ose/module-compilation-allowed || true
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync # Compile module. Don't show a message box here if everything works well.
085bc29163eb87e345acaae02789e4c233d51f3bvboxsyncMessages emitted during module compilation will be logged to $LOG.
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync if ! /usr/share/virtualbox-ose/src/build_in_tmp install > /var/log/vbox-install.log 2>&1; then
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync db_fset virtualbox-ose/module-compilation-failed seen false
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync db_input critical virtualbox-ose/module-compilation-failed || true
7e77c8f54449be6f28ccbf32f7e651554d9f4060vboxsync # don't abort the installation!
af62929dce3cc5e14c75438cd2b893f82ae6dbc8vboxsync# There might be an old module active (e.g. manually loaded)