VirtualBox

source: vbox/trunk/debian/postinst@ 3852

Last change on this file since 3852 was 3848, checked in by vboxsync, 17 years ago

reexport

File size: 2.3 KB
Line 
1#!/bin/sh
2
3LOG="/var/log/vbox-install.log"
4
5# read INSTALL_DIR/src
6. /etc/vbox/vbox.cfg
7
8# for debconf
9. /usr/share/debconf/confmodule
10db_version 2.0
11
12# remove old cruft
13if [ -f /etc/init.d/vboxdrv.sh ]; then
14 echo "Found old version of /etc/init.d/vboxdrv.sh, removing."
15 rm /etc/init.d/vboxdrv.sh
16 update-rc.d vboxdrv.sh remove >/dev/null
17fi
18if [ -f /etc/init.d/virtualbox ]; then
19 echo "Found old version of /etc/init.d/virtualbox, removing."
20 rm /etc/init.d/virtualbox
21 update-rc.d virtualbox remove >/dev/null
22fi
23
24# install udev rule
25if [ -d /etc/udev/rules.d ]; then
26 udev_out=`udevinfo -V` 2>&1 > /dev/null
27 if [ "$udev_out" = "" ]; then
28 udev_out=`udevinfo -V` 2>&1 > /dev/null # New syntax
29 fi
30 udev_ver=`expr "$udev_out" : '[^0-9]*\([0-9]*\)'`
31 if [ "$udev_ver" = "" -o "$udev_ver" -lt 55 ]; then
32 echo 'KERNEL="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="vboxusers", MODE="0660"' \
33 > /etc/udev/rules.d/60-vboxdrv.rules
34 else
35 echo 'KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="vboxusers", MODE="0660"' \
36 > /etc/udev/rules.d/60-vboxdrv.rules
37 fi
38fi
39
40# create users groups
41db_input high virtualbox/group-vboxusers || true
42db_go || true
43groupadd -f vboxusers
44
45if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko ]; then
46 db_get virtualbox/module-compilation-allowed
47 if [ "$RET" = "false" ]; then
48 cat << EOF
49Unable to find a precompiled module for the current kernel
50though module compilation denied by debconf setting.
51EOF
52 else
53 db_input critical virtualbox/module-compilation-allowed || true
54 db_go || true
55 db_get virtualbox/module-compilation-allowed
56 if [ "$RET" = "true" ]; then
57 # Compile module. Don't show a message box here if everything works well.
58 cat << EOF
59Messages emitted during module compilation will be logged to $LOG.
60EOF
61 if ! $INSTALL_DIR/src/build_in_tmp install > /var/log/vbox-install.log 2>&1; then
62 db_fset virtualbox/module-compilation-failed seen false
63 db_input critical virtualbox/module-compilation-failed || true
64 db_go || true
65 touch /etc/vbox/module_not_compiled
66 # don't abort the installation!
67 else
68 # success
69 cat << EOF
70Success!
71EOF
72 rm -f /etc/vbox/module_not_compiled
73 fi
74 fi
75 fi
76fi
77
78#DEBHELPER#
79
80exit 0
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette