VirtualBox

Changeset 32183 in vbox for trunk/src/VBox/Installer


Ignore:
Timestamp:
Sep 1, 2010 3:53:42 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
65467
Message:

Linux Installer/Additions: attempt to properly register the host/guest kernel modules at DKMS and use the setup function of the service script to compile the modules instead of doing this separately in the installer scripts

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/Makefile.kmk

    r31768 r32183  
    55
    66#
    7 # Copyright (C) 2006-2007 Oracle Corporation
     7# Copyright (C) 2006-2010 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    146146        VBoxSysInfo.sh \
    147147        VBox.sh \
    148         VBox.png \
    149         src
     148        VBox.png
    150149
    151150# Qt4 GUI
     
    254253# All the bin files that goes into the archives.
    255254#
    256 VBOX_LNX_ARCH_FILES := $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_STRIP_OBJ) $(VBOX_LNX_NO_STRIP)
     255VBOX_LNX_ARCH_FILES := $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_STRIP_OBJ) $(VBOX_LNX_NO_STRIP) src
    257256
    258257# Cleanup of the files we copy/symlink from bin.
     
    382381endif
    383382
     383# special rule for the kernel modules
     384$(VBOX_LNX_INST_OUT_DIR)/archive/src: $(PATH_BIN)/src | $(dir $@)
     385        $(call MSG_INST_SYM,$<,$@)
     386        $(QUIET)$(RM) -Rf $@
     387        $(QUIET)$(MKDIR) $@
     388        $(QUIET)$(LN_SYMLINK) $< $@/vboxhost
     389
    384390# pattern rule for linking the VBOX_LNX_NO_STRIP into archive/
    385391$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_NO_STRIP)): \
  • trunk/src/VBox/Installer/linux/debian/postinst.in

    r32008 r32183  
    9393  fi
    9494
    95   # try to build a kernel module (disable with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox)
    96   REGISTER_DKMS=1
    97   if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko -a "$INSTALL_NO_VBOXDRV" != "1" ]; then
    98     db_get virtualbox/module-compilation-allowed
    99     if [ "$RET" = "false" ]; then
    100       cat << EOF
    101 Unable to find a precompiled module for the current kernel
    102 though module compilation denied by debconf setting.
    103 EOF
    104     else
    105       db_input low virtualbox/module-compilation-allowed || true
    106       db_go || true
    107       db_get virtualbox/module-compilation-allowed
    108       if [ "$RET" = "true" ]; then
    109         # Compile module. Don't show a message box here if everything works well.
    110         cat << EOF
    111 Messages emitted during module compilation will be logged to $LOG.
    112 EOF
    113         rm -f /etc/vbox/module_not_compiled
    114         echo "** Compiling vboxdrv" > /var/log/vbox-install.log
    115         if ! /usr/share/virtualbox/src/vboxdrv/build_in_tmp \
    116             --save-module-symvers /tmp/vboxdrv-Module.symvers \
    117             --no-print-directory KBUILD_VERBOSE= \
    118             install >> /var/log/vbox-install.log 2>&1; then
    119           db_fset virtualbox/module-compilation-failed seen false
    120           db_input critical virtualbox/module-compilation-failed || true
    121           db_go || true
    122           touch /etc/vbox/module_not_compiled
    123           # don't abort the installation!
    124         else
    125           echo "** Compiling vboxnetflt" >> /var/log/vbox-install.log
    126           if ! /usr/share/virtualbox/src/vboxnetflt/build_in_tmp \
    127               --use-module-symvers /tmp/vboxdrv-Module.symvers \
    128               --no-print-directory KBUILD_VERBOSE= \
    129               install >> /var/log/vbox-install.log 2>&1; then
    130             db_fset virtualbox/module-compilation-failed seen false
    131             db_input critical virtualbox/module-compilation-failed || true
    132             db_go || true
    133             touch /etc/vbox/module_not_compiled
    134             # don't abort the installation!
    135           else
    136             echo "** Compiling vboxnetadp" >> /var/log/vbox-install.log
    137             if ! /usr/share/virtualbox/src/vboxnetadp/build_in_tmp \
    138                 --use-module-symvers /tmp/vboxdrv-Module.symvers \
    139                 --no-print-directory KBUILD_VERBOSE= \
    140                 install >> /var/log/vbox-install.log 2>&1; then
    141               db_fset virtualbox/module-compilation-failed seen false
    142               db_input critical virtualbox/module-compilation-failed || true
    143               db_go || true
    144               touch /etc/vbox/module_not_compiled
    145               # don't abort the installation!
    146             fi
    147           fi
    148         fi
    149         # cleanup
    150         rm -f /tmp/vboxdrv-Module.symvers
    151         if [ ! -f /etc/vbox/module_not_compiled ]; then
    152           # success
    153           cat << EOF
    154 Success!
    155 EOF
    156           REGISTER_DKMS=
    157         fi
    158       fi
    159     fi
    160   fi
    161 
    162   # Register at DKMS. If the modules were built above, they are already registered
    163   if [ -n "$REGISTER_DKMS" ]; then
    164     DKMS=`which dkms 2>/dev/null`
    165     if [ -n "$DKMS" ]; then
    166       for m in vboxdrv vboxnetflt vboxnetadp; do
    167         $DKMS status -m $m | while read line; do
    168           if echo "$line" | grep -q added > /dev/null ||
    169              echo "$line" | grep -q built > /dev/null ||
    170              echo "$line" | grep -q installed > /dev/null; then
    171                v=`echo "$line" | sed "s/$m,\([^,]*\)[,:].*/\1/;t;d"`
    172                $DKMS remove -m $m -v $v --all > /dev/null 2>&1
    173           fi
    174         done
    175         $DKMS add -m $m -v %VER% > /dev/null 2>&1
    176       done
    177     fi
    178   fi
    179 
    180   # There might be an old module active (e.g. manually loaded)
    181   if lsmod | grep -q "vboxdrv[^_-]"; then
    182     /etc/init.d/vboxdrv stop || true
    183   fi
    184 
    18595  # The starters need to be Suid root. They drop the privileges before starting
    18696  # the real frontend.
     
    216126  if [ -x "/etc/init.d/vboxdrv" ]; then
    217127    update-rc.d vboxdrv defaults >/dev/null
     128
     129    # There might be an old module active (e.g. manually loaded)
     130    if lsmod | grep -q "vboxdrv[^_-]"; then
     131      /etc/init.d/vboxdrv stop || true
     132    fi
     133
     134    BUILD_MODULES=0
     135    # 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
     140Unable to find a precompiled module for the current kernel
     141though module compilation denied by debconf setting.
     142EOF
     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
     149        fi
     150      fi
     151    fi
     152
    218153    if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
     154      if [ $BUILD_MODULES -eq 1 ]; then
     155        invoke-rc.d vboxdrv setup || true
     156      else
    219157        invoke-rc.d vboxdrv start || exit $?
     158      fi
    220159    else
     160      if [ $BUILD_MODULES -eq 1 ]; then
     161        /etc/init.d/vboxdrv setup || true
     162      else
    221163        /etc/init.d/vboxdrv start || exit $?
     164      fi
    222165    fi
    223166  fi
     
    230173#    fi
    231174  fi
    232 fi
     175
     176fi # $1 = "configure"
    233177
    234178exit 0
  • trunk/src/VBox/Installer/linux/debian/prerm.in

    r32008 r32183  
    4444
    4545# make sure we de-register the DMKS modules before the files get removed
    46 DKMS=`which dkms 2>/dev/null`
    47 if [ -n "$DKMS" ]; then
    48   $DKMS remove -m vboxnetadp -v %VER% --all > /dev/null 2>&1 || true
    49   $DKMS remove -m vboxnetflt -v %VER% --all > /dev/null 2>&1 || true
    50   $DKMS remove -m vboxdrv -v %VER% --all > /dev/null 2>&1 || true
     46if [ "$1" = "upgrade" -o "$1" = "remove" -o "$1" = "deconfigure" ]; then
     47  DKMS=`which dkms 2>/dev/null`
     48  if [ -n "$DKMS" ]; then
     49    $DKMS remove -m vboxhost -v %VER% --all > /dev/null 2>&1 || true
     50  fi
    5151fi
    5252
  • trunk/src/VBox/Installer/linux/debian/rules

    r32044 r32183  
    278278            usr/bin/VBox                        usr/bin/VBoxHeadless \
    279279            $(if $(NOWEBSVC),,usr/bin/VBox      usr/bin/vboxwebsrv) \
    280             usr/share/virtualbox/src/vboxdrv    usr/src/vboxdrv-$(ver) \
    281             usr/share/virtualbox/src/vboxnetflt usr/src/vboxnetflt-$(ver) \
    282             usr/share/virtualbox/src/vboxnetadp usr/src/vboxnetadp-$(ver)
     280            usr/share/virtualbox/src/vboxhost   usr/src/vboxhost-$(ver)
    283281        dh_desktop
    284282        dh_installmenu
  • trunk/src/VBox/Installer/linux/install.sh

    r31768 r32183  
    6565
    6666module_loaded() {
    67     lsmod | grep -q vboxdrv
     67    lsmod | grep -q "vboxdrv[^_-]"
    6868}
    6969
     
    268268            if [ -n "$DKMS" ]
    269269            then
     270                $DKMS remove -m vboxhost -v $INSTALL_VER --all > /dev/null 2>&1
    270271                $DKMS remove -m vboxdrv -v $INSTALL_VER --all > /dev/null 2>&1
    271272                $DKMS remove -m vboxnetflt -v $INSTALL_VER --all > /dev/null 2>&1
     
    382383    ln -sf $INSTALLATION_DIR/virtualbox.desktop /usr/share/applications/virtualbox.desktop
    383384    ln -sf $INSTALLATION_DIR/rdesktop-vrdp /usr/bin/rdesktop-vrdp
    384     ln -sf $INSTALLATION_DIR/src/vboxdrv /usr/src/vboxdrv-_VERSION_
    385     ln -sf $INSTALLATION_DIR/src/vboxnetflt /usr/src/vboxnetflt-_VERSION_
    386     ln -sf $INSTALLATION_DIR/src/vboxnetadp /usr/src/vboxnetadp-_VERSION_
     385    ln -sf $INSTALLATION_DIR/src/vboxhost /usr/src/vboxhost-_VERSION_
    387386
    388387    # If Python is available, install Python bindings
     
    432431    udevplug -Busb > /dev/null 2>&1
    433432
     433    # Write the configuration. Do this before we call /etc/init.d/vboxdrv setup!
     434    echo "# VirtualBox installation directory" > $CONFIG_DIR/$CONFIG
     435    echo "INSTALL_DIR='$INSTALLATION_DIR'" >> $CONFIG_DIR/$CONFIG
     436    echo "# VirtualBox version" >> $CONFIG_DIR/$CONFIG
     437    echo "INSTALL_VER='$VERSION'" >> $CONFIG_DIR/$CONFIG
     438    echo "INSTALL_REV='$SVNREV'" >> $CONFIG_DIR/$CONFIG
     439
    434440    # Make kernel module
    435441    MODULE_FAILED="false"
    436442    if [ "$BUILD_MODULE" = "true" ]
    437443    then
    438         info "Building the VirtualBox vboxdrv kernel module"
     444        info "Building the VirtualBox kernel modules"
    439445        log "Output from the module build process (the Linux kernel build system) follows:"
    440446        cur=`pwd`
    441447        log ""
    442         cd $INSTALLATION_DIR/src/vboxdrv
    443         ./build_in_tmp \
    444           --save-module-symvers /tmp/vboxdrv-Module.symvers \
    445           --no-print-directory install >> $LOG 2>&1
    446         RETVAL=$?
    447         if [ $RETVAL -ne 0 ]
    448         then
    449             info "Failed to build the vboxdrv kernel module."
    450             info "Please check the log file $LOG for more information."
    451             MODULE_FAILED="true"
    452             RC_SCRIPT=1
    453         else
    454             info "Building the VirtualBox netflt kernel module"
    455             log "Output from the module build process (the Linux kernel build system) follows:"
    456             cd $INSTALLATION_DIR/src/vboxnetflt
    457             ./build_in_tmp \
    458               --use-module-symvers /tmp/vboxdrv-Module.symvers \
    459               --no-print-directory install >> $LOG 2>&1
    460             RETVAL=$?
    461             if [ $RETVAL -ne 0 ]
    462             then
    463                 info "Failed to build the vboxnetflt kernel module."
    464                 info "Please check the log file $LOG for more information."
    465                 MODULE_FAILED="true"
    466                 RC_SCRIPT=1
    467             else
    468                 info "Building the VirtualBox netadp kernel module"
    469                 log "Output from the module build process (the Linux kernel build system) follows:"
    470                 cd $INSTALLATION_DIR/src/vboxnetadp
    471                 ./build_in_tmp \
    472                     --use-module-symvers /tmp/vboxdrv-Module.symvers \
    473                     --no-print-directory install >> $LOG 2>&1
    474                 RETVAL=$?
    475                 if [ $RETVAL -ne 0 ]
    476                 then
    477                     info "Failed to build the vboxnetadp kernel module."
    478                     info "Please check the log file $LOG for more information."
    479                     MODULE_FAILED="true"
    480                     RC_SCRIPT=1
    481                 fi
    482             fi
    483         fi
    484         # cleanup
    485         rm -f /tmp/vboxdrv-Module.symvers
     448        setup_init_script vboxdrv
    486449        # Start VirtualBox kernel module
    487450        if [ $RETVAL -eq 0 ] && ! start_init_script vboxdrv; then
     
    495458    fi
    496459
    497     echo "# VirtualBox installation directory" > $CONFIG_DIR/$CONFIG
    498     echo "INSTALL_DIR='$INSTALLATION_DIR'" >> $CONFIG_DIR/$CONFIG
    499     echo "# VirtualBox version" >> $CONFIG_DIR/$CONFIG
    500     echo "INSTALL_VER='$VERSION'" >> $CONFIG_DIR/$CONFIG
    501     echo "INSTALL_REV='$SVNREV'" >> $CONFIG_DIR/$CONFIG
    502460    info ""
    503461    if [ ! "$MODULE_FAILED" = "true" ]
  • trunk/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec

    r32008 r32183  
    135135ln -s VBox $RPM_BUILD_ROOT/usr/bin/VBoxHeadless
    136136ln -s VBox $RPM_BUILD_ROOT/usr/bin/vboxwebsrv
    137 ln -s /usr/share/virtualbox/src/vboxdrv $RPM_BUILD_ROOT/usr/src/vboxdrv-%VER%
    138 ln -s /usr/share/virtualbox/src/vboxnetflt $RPM_BUILD_ROOT/usr/src/vboxnetflt-%VER%
    139 ln -s /usr/share/virtualbox/src/vboxnetadp $RPM_BUILD_ROOT/usr/src/vboxnetadp-%VER%
     137ln -s /usr/share/virtualbox/src/vboxhost $RPM_BUILD_ROOT/usr/src/vboxhost-%VER%
    140138mv virtualbox.desktop $RPM_BUILD_ROOT/usr/share/applications/virtualbox.desktop
    141139mv VBox.png $RPM_BUILD_ROOT/usr/share/pixmaps/VBox.png
     
    267265%endif
    268266
    269 # try to build a kernel module (disable with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox)
    270 REGISTER_DKMS=1
     267# Disable module compilation with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox
     268BUILD_MODULES=0
    271269if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko -a "$INSTALL_NO_VBOXDRV" != "1" ]; then
    272270  # compile problem
     
    276274
    277275EOF
    278   rm -f /etc/vbox/module_not_compiled
    279   echo "** Compiling vboxdrv" > /var/log/vbox-install.log
    280   if ! /usr/share/virtualbox/src/vboxdrv/build_in_tmp \
    281     --save-module-symvers /tmp/vboxdrv-Module.symvers \
    282     --no-print-directory KBUILD_VERBOSE= \
    283     install >> /var/log/vbox-install.log 2>&1; then
    284     cat << EOF
    285 Compilation of the kernel module FAILED! VirtualBox will not start until this
    286 problem is fixed. Please consult $LOG to find out why the
    287 kernel module does not compile. Most probably the kernel sources are not found.
    288 Install them and execute
    289 
    290   /etc/init.d/vboxdrv setup
    291 
    292 as root.
    293 
    294 EOF
    295     touch /etc/vbox/module_not_compiled
    296   else
    297     echo "** Compiling vboxnetflt" >> /var/log/vbox-install.log
    298     if ! /usr/share/virtualbox/src/vboxnetflt/build_in_tmp \
    299       --use-module-symvers /tmp/vboxdrv-Module.symvers \
    300       --no-print-directory KBUILD_VERBOSE= \
    301       install >> /var/log/vbox-install.log 2>&1; then
    302       cat << EOF
    303 Compilation of the kernel module FAILED! VirtualBox will not start until this
    304 problem is fixed. Please consult $LOG to find out why the
    305 kernel module does not compile. Most probably the kernel sources are not found.
    306 Install them and execute
    307 
    308   /etc/init.d/vboxdrv setup
    309 
    310 as root.
    311 
    312 EOF
    313       touch /etc/vbox/module_not_compiled
    314     else
    315       echo "** Compiling vboxnetadp" >> /var/log/vbox-install.log
    316       if ! /usr/share/virtualbox/src/vboxnetadp/build_in_tmp \
    317         --use-module-symvers /tmp/vboxdrv-Module.symvers \
    318         --no-print-directory KBUILD_VERBOSE= \
    319         install >> /var/log/vbox-install.log 2>&1; then
    320         cat << EOF
    321 Compilation of the kernel module FAILED! VirtualBox will not start until this
    322 problem is fixed. Please consult $LOG to find out why the
    323 kernel module does not compile. Most probably the kernel sources are not found.
    324 Install them and execute
    325 
    326   /etc/init.d/vboxdrv setup
    327 
    328 as root.
    329 
    330 EOF
    331         touch /etc/vbox/module_not_compiled
    332       fi
    333     fi
    334   fi
    335   rm -f /tmp/vboxdrv-Module.symvers
    336   if [ ! -f /etc/vbox/module_not_compiled ]; then
    337     cat << EOF
    338 Success!
    339 
    340 EOF
    341     REGISTER_DKMS=
    342   fi
    343 fi
    344 # Register at DKMS. If the modules were built above, they are already registered
    345 if [ -n "$REGISTER_DKMS" ]; then
    346   DKMS=`which dkms 2>/dev/null`
    347   if [ -n "$DKMS" ]; then
    348     for m in vboxdrv vboxnetflt vboxnetadp; do
    349       $DKMS status -m $m | while read line; do
    350         if echo "$line" | grep -q added > /dev/null ||
    351            echo "$line" | grep -q built > /dev/null ||
    352            echo "$line" | grep -q installed > /dev/null; then
    353              v=`echo "$line" | sed "s/$m,\([^,]*\)[,:].*/\1/;t;d"`
    354              $DKMS remove -m $m -v $v --all > /dev/null 2>&1
    355         fi
    356       done
    357       $DKMS add -m $m -v %VER% > /dev/null 2>&1
    358     done
    359   fi
     276  BUILD_MODULES=1
    360277fi
    361278# if INSTALL_NO_VBOXDRV is set to 1, remove all shipped modules
     
    368285  /etc/init.d/vboxdrv stop || true
    369286fi
    370 if [ ! -f /etc/vbox/module_not_compiled ]; then
    371   depmod -a
     287if [ $BUILD_MODULES -eq 1 ]; then
     288  /etc/init.d/vboxdrv setup || true
     289else
    372290  /etc/init.d/vboxdrv start > /dev/null
    373   /etc/init.d/vboxweb-service start > /dev/null
    374 fi
     291fi
     292/etc/init.d/vboxweb-service start > /dev/null
    375293
    376294
     
    405323DKMS=`which dkms 2>/dev/null`
    406324if [ -n "$DKMS" ]; then
    407   $DKMS remove -m vboxnetadp -v %VER% --all > /dev/null 2>&1 || true
    408   $DKMS remove -m vboxnetflt -v %VER% --all > /dev/null 2>&1 || true
    409   $DKMS remove -m vboxdrv -v %VER% --all > /dev/null 2>&1 || true
     325  $DKMS remove -m vboxhost -v %VER% --all > /dev/null 2>&1 || true
    410326fi
    411327
  • trunk/src/VBox/Installer/linux/uninstall.sh

    r31768 r32183  
    11#!/bin/sh
     2#
     3# Oracle VM VirtualBox
     4# VirtualBox linux uninstallation script
     5
     6#
     7# Copyright (C) 2009-2010 Oracle Corporation
     8#
     9# This file is part of VirtualBox Open Source Edition (OSE), as
     10# available from http://www.virtualbox.org. This file is free software;
     11# you can redistribute it and/or modify it under the terms of the GNU
     12# General Public License (GPL) as published by the Free Software
     13# Foundation, in version 2 as it comes in the "COPYING" file of the
     14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
     15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
     16#
    217
    318. `dirname $0`/routines.sh
     
    4964# Remove kernel module installed
    5065if [ -n "$DKMS" ]; then
    51     $DKMS remove -m vboxdrv -v $INSTALL_VER --all > /dev/null 2>&1
     66    $DKMS remove -m vboxhost -v $INSTALL_VER --all > /dev/null 2>&1
    5267fi
    5368if [ -z "$VBOX_DONT_REMOVE_OLD_MODULES" ]; then
     
    5873    find /lib/modules/`uname -r` -name vbox\* 2>/dev/null|xargs rmdir -p 2> /dev/null
    5974    find /lib/modules/`uname -r` -name misc\* 2>/dev/null|xargs rmdir -p 2> /dev/null
     75    rm -f /usr/src/vboxhost-$INSTALL_VER 2> /dev/null
    6076    rm -f /usr/src/vboxdrv-$INSTALL_VER 2> /dev/null
    6177    rm -f /usr/src/vboxnetflt-$INSTALL_VER 2> /dev/null
  • trunk/src/VBox/Installer/linux/vboxdrv.sh.in

    r29657 r32183  
    4444if [ -n "$INSTALL_DIR" ]; then
    4545    VBOXMANAGE="$INSTALL_DIR/VBoxManage"
    46     BUILDVBOXDRV="$INSTALL_DIR/src/vboxdrv/build_in_tmp"
    47     BUILDVBOXNETFLT="$INSTALL_DIR/src/vboxnetflt/build_in_tmp"
    48     BUILDVBOXNETADP="$INSTALL_DIR/src/vboxnetadp/build_in_tmp"
     46    DODKMS="$INSTALL_DIR/src/vboxhost/do_dkms"
     47    BUILDVBOXDRV="$INSTALL_DIR/src/vboxhost/vboxdrv/build_in_tmp"
     48    BUILDVBOXNETFLT="$INSTALL_DIR/src/vboxhost/vboxnetflt/build_in_tmp"
     49    BUILDVBOXNETADP="$INSTALL_DIR/src/vboxhost/vboxnetadp/build_in_tmp"
    4950else
    5051    VBOXMANAGE="/usr/lib/%PACKAGE%/VBoxManage"
    51     BUILDVBOXDRV="/usr/share/%PACKAGE%/src/vboxdrv/build_in_tmp"
    52     BUILDVBOXNETFLT="/usr/share/%PACKAGE%/src/vboxnetflt/build_in_tmp"
    53     BUILDVBOXNETADP="/usr/share/%PACKAGE%/src/vboxnetadp/build_in_tmp"
     52    DODKMS="/usr/share/%PACKAGE%/src/vboxhost/do_dkms"
     53    BUILDVBOXDRV="/usr/share/%PACKAGE%/src/vboxhost/vboxdrv/build_in_tmp"
     54    BUILDVBOXNETFLT="/usr/share/%PACKAGE%/src/vboxhost/vboxnetflt/build_in_tmp"
     55    BUILDVBOXNETADP="/usr/share/%PACKAGE%/src/vboxhost/vboxnetadp/build_in_tmp"
    5456fi
    5557
     
    280282}
    281283
     284# setup_script
    282285setup()
    283286{
    284287    stop
     288    begin_msg "Uninstalling old VirtualBox DKMS kernel modules"
     289    $DODKMS uninstall > $LOG
     290    succ_msg
    285291    if find /lib/modules/`uname -r` -name "vboxnetadp\.*" 2>/dev/null|grep -q vboxnetadp; then
    286292        begin_msg "Removing old VirtualBox netadp kernel module"
     
    298304        succ_msg
    299305    fi
    300     begin_msg "Recompiling VirtualBox kernel module"
    301     if ! $BUILDVBOXDRV \
    302         --save-module-symvers /tmp/vboxdrv-Module.symvers \
    303         --no-print-directory install > $LOG 2>&1; then
    304         failure "Look at $LOG to find out what went wrong"
    305     fi
    306     if ! $BUILDVBOXNETFLT \
    307         --use-module-symvers /tmp/vboxdrv-Module.symvers \
     306    begin_msg "Trying to register the VirtualBox kernel modules using DKMS"
     307    if ! $DODKMS install >> $LOG; then
     308      fail_msg "Failed, trying without DKMS"
     309      begin_msg "Recompiling VirtualBox kernel module"
     310      if ! $BUILDVBOXDRV \
     311          --save-module-symvers /tmp/vboxdrv-Module.symvers \
     312          --no-print-directory install >> $LOG 2>&1; then
     313          failure "Look at $LOG to find out what went wrong"
     314      fi
     315      if ! $BUILDVBOXNETFLT \
     316          --use-module-symvers /tmp/vboxdrv-Module.symvers \
     317          --no-print-directory install >> $LOG 2>&1; then
     318          failure "Look at $LOG to find out what went wrong"
     319      fi
     320      if ! $BUILDVBOXNETADP \
     321          --use-module-symvers /tmp/vboxdrv-Module.symvers \
    308322        --no-print-directory install >> $LOG 2>&1; then
    309         failure "Look at $LOG to find out what went wrong"
    310     fi
    311     if ! $BUILDVBOXNETADP \
    312         --use-module-symvers /tmp/vboxdrv-Module.symvers \
    313         --no-print-directory install >> $LOG 2>&1; then
    314         failure "Look at $LOG to find out what went wrong"
     323          failure "Look at $LOG to find out what went wrong"
     324      fi
    315325    fi
    316326    rm -f /etc/vbox/module_not_compiled
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