VirtualBox

Ignore:
Timestamp:
Oct 1, 2015 1:05:50 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
103000
Message:

Installers/linux: try to rebuild the kernel modules if they cannot be loaded.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/debian/postinst.in

    r57969 r57986  
    7878    fi
    7979  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 
    8880fi # $1 = "configure"
    8981
    9082#DEBHELPER#
    9183
    92 BUILD_MODULES=0
    93 REGISTER_MODULES=1
    94 # Disable module compilation with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox
    95 if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko ]; then
    96   REGISTER_MODULES=0
     84if test "${INSTALL_NO_VBOXDRV}" = 1; then
     85  POSTINST_START=
     86  # if INSTALL_NO_VBOXDRV is set to 1, remove all shipped modules
    9787  if [ "$1" = "configure" ]; then
    98     if [ "$INSTALL_NO_VBOXDRV" != "1" ]; then
     88    rm -f /lib/modules/*/misc/vboxdrv.ko
     89    rm -f /lib/modules/*/misc/vboxnetflt.ko
     90    rm -f /lib/modules/*/misc/vboxnetadp.ko
     91    rm -f /lib/modules/*/misc/vboxpci.ko
     92  fi
     93else
     94  POSTINST_START=--start
     95  # Disable module compilation with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox
     96  if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko ]; then
     97    if [ "$1" = "configure" ]; then
    9998      db_get virtualbox/module-compilation-allowed
    10099      if [ "$RET" = "false" ]; then
     
    103102though module compilation denied by debconf setting.
    104103EOF
     104        POSTINST_START=
    105105      else
    106106        db_input low virtualbox/module-compilation-allowed || true
    107107        db_go || true
    108108        db_get virtualbox/module-compilation-allowed
    109         if [ "$RET" = "true" ]; then
    110           BUILD_MODULES=1
     109        if [ "$RET" = "false" ]; then
     110          POSTINST_START=
    111111        fi
    112112      fi
    113     fi
    114   fi # $1 = "configure"
    115 fi
    116 
    117 if [ $BUILD_MODULES -eq 1 ]; then
    118   /usr/lib/virtualbox/vboxdrv.sh setup || true
     113    fi # $1 = "configure"
     114  fi
    119115fi
    120116
    121117# Install and start the new service scripts.
    122 POSTINST_START=--start
    123 test "${INSTALL_NO_VBOXDRV}" = 1 && POSTINST_START=
    124118/usr/lib/virtualbox/prerm-common.sh || true
    125119/usr/lib/virtualbox/postinst-common.sh /usr/lib/virtualbox "${POSTINST_START}" > /dev/null || true
Note: See TracChangeset for help on using the changeset viewer.

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