postinst.in revision 4a4856069da3a44c647c802b7df4f0c9ae1ea179
f2ca52afeb0baed982c05e9d8591e0e4c7539dbdvboxsync# Copyright (C) 2006-2011 Oracle Corporation
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync# available from http://www.virtualbox.org. This file is free software;
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync# you can redistribute it and/or modify it under the terms of the GNU
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync# General Public License as published by the Free Software Foundation,
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync# distribution. VirtualBox OSE is distributed in the hope that it will
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync# be useful, but WITHOUT ANY WARRANTY of any kind.
003bed4b86e46315aaef143a73c95eb8eee7fe78vboxsync# we can be called with the following arguments (6.5 of Debian policy):
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync# configure: (our version): installing/configuring new version
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync# abort-upgrade: (old version): upgrading to a new version failed
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync# abort-remove: (our version): removing this package failed
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync# abort-deconfigure: (our version): error during resolving conflicts
003bed4b86e46315aaef143a73c95eb8eee7fe78vboxsync[ -r /etc/default/virtualbox ] && . /etc/default/virtualbox
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync # for debconf
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync # remove old cruft
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync echo "Found old version of /etc/init.d/vboxdrv.sh, removing."
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync echo "Found old version of /etc/vbox/vbox.cfg, removing."
003bed4b86e46315aaef143a73c95eb8eee7fe78vboxsync # create users groups (disable with INSTALL_NO_GROUP=1 in /etc/default/virtualbox)
4a4856069da3a44c647c802b7df4f0c9ae1ea179vboxsync # install udev rule (disable with INSTALL_NO_UDEV=1 in
4a4856069da3a44c647c802b7df4f0c9ae1ea179vboxsync # /etc/default/virtualbox) and /dev/vboxdrv and /dev/vboxusb/*/* device nodes
4a4856069da3a44c647c802b7df4f0c9ae1ea179vboxsync install_device_node_setup root 0600 /usr/share/virtualbox "${usb_group}"
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync # The starters need to be Suid root. They drop the privileges before starting
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync # the real frontend.
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync if ! dpkg-statoverride --list /usr/lib/virtualbox/VirtualBox > /dev/null 2>&1; then
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync if ! dpkg-statoverride --list /usr/lib/virtualbox/VBoxHeadless > /dev/null 2>&1; then
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync if ! dpkg-statoverride --list /usr/lib/virtualbox/VBoxSDL > /dev/null 2>&1; then
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync if ! dpkg-statoverride --list /usr/lib/virtualbox/VBoxNetDHCP > /dev/null 2>&1; then
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsync if ! dpkg-statoverride --list /usr/lib/virtualbox/VBoxNetAdpCtl > /dev/null 2>&1; then
003bed4b86e46315aaef143a73c95eb8eee7fe78vboxsync # if INSTALL_NO_VBOXDRV is set to 1, remove all shipped modules
939ffd583b0105c9cfab3570932faa41e0ccd563vboxsyncfi # $1 = "configure"
f2ca52afeb0baed982c05e9d8591e0e4c7539dbdvboxsync # Start vboxdrv/vboxballoonctrl/vboxweb-service manually as we use our own error handling in postrm
7eaaa8a4480370b82ef3735994f986f338fb4df2vboxsync if [ -x "/etc/init.d/vboxdrv" ]; then
7eaaa8a4480370b82ef3735994f986f338fb4df2vboxsync # Disable module compilation with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox
f5ab5688c35373443d953e2a9fa8a054defdece8vboxsync if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko ]; then
7eaaa8a4480370b82ef3735994f986f338fb4df2vboxsyncUnable to find a precompiled module for the current kernel
7eaaa8a4480370b82ef3735994f986f338fb4df2vboxsyncthough module compilation denied by debconf setting.
f5ab5688c35373443d953e2a9fa8a054defdece8vboxsync db_input low virtualbox/module-compilation-allowed || true
f5ab5688c35373443d953e2a9fa8a054defdece8vboxsync # shipped modules found, register sources at DKMS anyway
f5ab5688c35373443d953e2a9fa8a054defdece8vboxsync if [ -n "$DKMS" ]; then
f5ab5688c35373443d953e2a9fa8a054defdece8vboxsync $DKMS add -m vboxhost -v %VER% > /dev/null 2>&1 || true
f2ca52afeb0baed982c05e9d8591e0e4c7539dbdvboxsync if [ -x "/etc/init.d/vboxballoonctrl-service" ]; then
f2ca52afeb0baed982c05e9d8591e0e4c7539dbdvboxsync update-rc.d vboxballoonctrl-service defaults >/dev/null
f2ca52afeb0baed982c05e9d8591e0e4c7539dbdvboxsync invoke-rc.d vboxballoonctrl-service start || exit $?
f2ca52afeb0baed982c05e9d8591e0e4c7539dbdvboxsync /etc/init.d/vboxballoonctrl-service start || exit $?
7eaaa8a4480370b82ef3735994f986f338fb4df2vboxsync if [ -x "/etc/init.d/vboxweb-service" ]; then
7eaaa8a4480370b82ef3735994f986f338fb4df2vboxsyncfi # $1 = "configure"