VirtualBox

Changeset 67054 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 24, 2017 8:36:39 AM (8 years ago)
Author:
vboxsync
Message:

bugref:8834: Makeself installers/Linux: indicate problems better in the exit codes
Detect failure to build kernel modules, to load kernel modules or to replace running kernel modules in the base Makeself installer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/install.sh

    r63645 r67054  
    1515# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1616#
     17
     18# Testing:
     19# * After successful installation, 0 is returned if the vboxdrv module version
     20#   built matches the one loaded.
     21# * If the kernel modules cannot be built (run the installer with KERN_DIR=/) or
     22#   loaded (run with KERN_DIR=/lib/modules/<installed non-current version>/build)
     23#   then 1 is returned.
    1724
    1825PATH=$PATH:/bin:/sbin:/usr/sbin
     
    5360VBOXUSB_GRP=$GROUPNAME
    5461
     62## Were we able to stop any previously running Additions kernel modules?
     63MODULES_STOPPED=1
     64
    5565
    5666##############################################################################
     
    381391    fi
    382392    "${INSTALLATION_DIR}/prerm-common.sh" >> "${LOG}"
     393
     394    # Now check whether the kernel modules were stopped.
     395    lsmod | grep -q vboxdrv && MODULES_STOPPED=
     396
    383397    "${INSTALLATION_DIR}/postinst-common.sh" ${START_SERVICES} >> "${LOG}"
    384398
     
    393407    info "We hope that you enjoy using VirtualBox."
    394408    info ""
     409
     410    # And do a final test as to whether the kernel modules were properly created
     411    # and loaded.  Return 0 if both are true, 1 if not.
     412    test -n "${MODULES_STOPPED}" &&
     413        modinfo vboxdrv >/dev/null 2>&1 &&
     414        lsmod | grep -q vboxdrv ||
     415        abort "The installation log file is at ${LOG}."
     416
    395417    log "Installation successful"
    396418elif [ "$ACTION" = "uninstall" ]; then
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