VirtualBox

Changeset 32237 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 3, 2010 2:59:00 PM (14 years ago)
Author:
vboxsync
Message:

deb/rpm: register modules at DKMS if we don't need to compile during installation

Location:
trunk/src/VBox/Installer/linux
Files:
2 edited

Legend:

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

    r32183 r32237  
    133133
    134134    BUILD_MODULES=0
     135    REGISTER_MODULES=1
    135136    # Disable module compilation with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox
    136     if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko -a "$INSTALL_NO_VBOXDRV" != "1" ]; then
    137       db_get virtualbox/module-compilation-allowed
    138       if [ "$RET" = "false" ]; then
    139         cat << EOF
     137    if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko ]; then
     138      REGISTER_MODULES=0
     139      if [ "$INSTALL_NO_VBOXDRV" != "1" ]; then
     140        db_get virtualbox/module-compilation-allowed
     141        if [ "$RET" = "false" ]; then
     142          cat << EOF
    140143Unable to find a precompiled module for the current kernel
    141144though module compilation denied by debconf setting.
    142145EOF
    143       else
    144         db_input low virtualbox/module-compilation-allowed || true
    145         db_go || true
    146         db_get virtualbox/module-compilation-allowed
    147         if [ "$RET" = "true" ]; then
    148           BUILD_MODULES=1
     146        else
     147          db_input low virtualbox/module-compilation-allowed || true
     148          db_go || true
     149          db_get virtualbox/module-compilation-allowed
     150          if [ "$RET" = "true" ]; then
     151            BUILD_MODULES=1
     152          fi
    149153        fi
    150154      fi
    151155    fi
    152156
    153     if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
    154       if [ $BUILD_MODULES -eq 1 ]; then
     157    if [ $BUILD_MODULES -eq 1 ]; then
     158      if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
    155159        invoke-rc.d vboxdrv setup || true
    156160      else
    157         invoke-rc.d vboxdrv start || exit $?
     161        /etc/init.d/vboxdrv setup || true
    158162      fi
    159163    else
    160       if [ $BUILD_MODULES -eq 1 ]; then
    161         /etc/init.d/vboxdrv setup || true
     164      # shipped modules found, register sources at DKMS anyway
     165      if [ $REGISTER_MODULES -eq 1 ]; then
     166        DKMS=`which dkms 2>/dev/null`
     167        if [ -n "$DKMS" ]; then
     168          $DKMS add -m vboxhost -v %VER% > /dev/null 2>&1 || true
     169        fi
     170      fi
     171      if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
     172        invoke-rc.d vboxdrv start || exit $?
    162173      else
    163174        /etc/init.d/vboxdrv start || exit $?
  • trunk/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec

    r32186 r32237  
    267267# Disable module compilation with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox
    268268BUILD_MODULES=0
    269 if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko -a "$INSTALL_NO_VBOXDRV" != "1" ]; then
    270   # compile problem
    271   cat << EOF
     269REGISTER_MODULES=1
     270if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko ]; then
     271  REGISTER_MODULES=0
     272  if [ "$INSTALL_NO_VBOXDRV" != "1" ]; then
     273    # compile problem
     274    cat << EOF
    272275No precompiled module for this kernel found -- trying to build one. Messages
    273276emitted during module compilation will be logged to $LOG.
    274277
    275278EOF
    276   BUILD_MODULES=1
     279    BUILD_MODULES=1
     280  fi
    277281fi
    278282# if INSTALL_NO_VBOXDRV is set to 1, remove all shipped modules
     
    288292  /etc/init.d/vboxdrv setup || true
    289293else
     294  if [ $REGISTER_MODULES -eq 1 ]; then
     295    DKMS=`which dkms 2>/dev/null`
     296    if [ -n "$DKMS" ]; then
     297      $DKMS remove -m vboxhost -v %VER% --all > /dev/null 2>&1 || true
     298    fi
     299  fi
    290300  /etc/init.d/vboxdrv start > /dev/null
    291301fi
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