VirtualBox

Changeset 82441 in vbox for trunk/debian/postinst


Ignore:
Timestamp:
Dec 5, 2019 11:16:02 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
135289
Message:

Config: disable PCI passthrough
debian: big resync with files in src/VBox/Installer/Linux/debian, this must have been broken for years
doc: mention dropping of PCI passthrough
src/VBox/Installer/linux: adapt to handle no longer present vboxpci.ko (without completely ripping it out)

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/debian/postinst

    • Property svn:eol-style set to LF
    • Property svn:executable set to *
    • Property svn:keywords set to Author Date Id Revision
    r82440 r82441  
    11#!/bin/sh
     2# $Id$
     3## @file
     4# VirtualBox postinst
    25#
    3 # Copyright (C) 2006-2012 Oracle Corporation
     6
     7#
     8# Copyright (C) 2006-2019 Oracle Corporation
    49#
    510# This file is part of VirtualBox Open Source Edition (OSE), as
     
    1823#  abort-deconfigure: (our version): error during resolving conflicts
    1924
    20 #include installer-common.sh
     25## @todo Do we really gain anything from not just executing everything
     26##       unconditionally?
    2127
    2228LOG="/var/log/vbox-install.log"
     
    4955  fi
    5056
    51   # install udev rule (disable with INSTALL_NO_UDEV=1 in
    52   # /etc/default/virtualbox) and /dev/vboxdrv and /dev/vboxusb/*/* device nodes
    53   install_device_node_setup root 0600 /usr/share/virtualbox "${usb_group}"
    54 
    5557  # The starters need to be Suid root. They drop the privileges before starting
    5658  # the real frontend.
    57   if ! dpkg-statoverride --list /usr/lib/virtualbox/VirtualBox > /dev/null 2>&1; then
    58     chmod 4511 /usr/lib/virtualbox/VirtualBox
     59  if test -e /usr/lib/virtualbox/VirtualBoxVM; then
     60    if ! dpkg-statoverride --list /usr/lib/virtualbox/VirtualBoxVM > /dev/null 2>&1; then
     61      chmod 4511 /usr/lib/virtualbox/VirtualBoxVM
     62    fi
     63  else
     64    if ! dpkg-statoverride --list /usr/lib/virtualbox/VirtualBox > /dev/null 2>&1; then
     65      chmod 4511 /usr/lib/virtualbox/VirtualBox
     66    fi
    5967  fi
    6068  if ! dpkg-statoverride --list /usr/lib/virtualbox/VBoxHeadless > /dev/null 2>&1; then
     
    7886    fi
    7987  fi
    80 
    81   # if INSTALL_NO_VBOXDRV is set to 1, remove all shipped modules
    82   if [ "$INSTALL_NO_VBOXDRV" = "1" ]; then
    83     rm -f /lib/modules/*/misc/vboxdrv.ko
    84     rm -f /lib/modules/*/misc/vboxnetflt.ko
    85     rm -f /lib/modules/*/misc/vboxnetadp.ko
    86   fi
    87 
    8888fi # $1 = "configure"
    8989
    9090#DEBHELPER#
    9191
    92 if [ "$1" = "configure" ]; then
    93   # Start vboxdrv/vboxballoonctrl/vboxweb-service manually as we use our own error handling in postrm
    94   if [ -x "/etc/init.d/vboxdrv" ]; then
    95     update-rc.d vboxdrv defaults 20 80 >/dev/null
     92if test "${INSTALL_NO_VBOXDRV}" = 1; then
     93  POSTINST_START=--nostart
     94else
     95  POSTINST_START=
     96fi
    9697
    97     BUILD_MODULES=0
    98     REGISTER_MODULES=1
    99     # Disable module compilation with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox
    100     if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko ]; then
    101       REGISTER_MODULES=0
    102       if [ "$INSTALL_NO_VBOXDRV" != "1" ]; then
    103         db_get virtualbox/module-compilation-allowed
    104         if [ "$RET" = "false" ]; then
    105           cat << EOF
    106 Unable to find a precompiled module for the current kernel
    107 though module compilation denied by debconf setting.
    108 EOF
    109         else
    110           db_input low virtualbox/module-compilation-allowed || true
    111           db_go || true
    112           db_get virtualbox/module-compilation-allowed
    113           if [ "$RET" = "true" ]; then
    114             BUILD_MODULES=1
    115           fi
    116         fi
    117       fi
    118     fi
    119 
    120     if [ $BUILD_MODULES -eq 1 ]; then
    121       if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
    122         invoke-rc.d vboxdrv setup || true
    123       else
    124         /etc/init.d/vboxdrv setup || true
    125       fi
    126     else
    127       # shipped modules found, register sources at DKMS anyway
    128       if lsmod | grep -q "vboxdrv[^_-]"; then
    129         /etc/init.d/vboxdrv stop || true
    130       fi
    131       if [ $REGISTER_MODULES -eq 1 ]; then
    132         DKMS=`which dkms 2>/dev/null`
    133         if [ -n "$DKMS" ]; then
    134           $DKMS add -m vboxhost -v %VER% > /dev/null 2>&1 || true
    135         fi
    136       fi
    137       if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
    138         invoke-rc.d vboxdrv start || exit $?
    139       else
    140         /etc/init.d/vboxdrv start || exit $?
    141       fi
    142     fi
    143   fi
    144   if [ -x "/etc/init.d/vboxballoonctrl-service" ]; then
    145     update-rc.d vboxballoonctrl-service defaults 35 65 >/dev/null
    146     if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
    147         invoke-rc.d vboxballoonctrl-service start || exit $?
    148     else
    149         /etc/init.d/vboxballoonctrl-service start || exit $?
    150     fi
    151   fi
    152   if [ -x "/etc/init.d/vboxautostart-service" ]; then
    153     update-rc.d vboxautostart-service defaults 35 65 >/dev/null
    154     if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
    155         invoke-rc.d vboxautostart-service start || exit $?
    156     else
    157         /etc/init.d/vboxautostart-service start || exit $?
    158     fi
    159   fi
    160   if [ -x "/etc/init.d/vboxweb-service" ]; then
    161     update-rc.d vboxweb-service defaults 35 65 >/dev/null
    162     if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
    163         invoke-rc.d vboxweb-service start || exit $?
    164     else
    165         /etc/init.d/vboxweb-service start || exit $?
    166     fi
    167   fi
    168 
    169 fi # $1 = "configure"
     98# Install and start the new service scripts.
     99/usr/lib/virtualbox/prerm-common.sh || true
     100/usr/lib/virtualbox/postinst-common.sh ${POSTINST_START} > /dev/null || true
    170101
    171102exit 0
Note: See TracChangeset for help on using the changeset viewer.

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