VirtualBox

source: vbox/trunk/debian/postinst@ 4041

Last change on this file since 4041 was 3862, checked in by vboxsync, 17 years ago

fixed a bunch of lintian warnings/errors, mostly by moving files to the right place

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