VirtualBox

Changeset 66504 in vbox for trunk/src/VBox/Additions/linux


Ignore:
Timestamp:
Apr 10, 2017 4:57:41 PM (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 Additions Makeself installer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/installer/install.sh.in

    r66387 r66504  
    1717#
    1818
     19# Testing:
     20# * After successful installation, 0 is returned if the vboxguest module version
     21#   built matches the one loaded and 2 is returned otherwise.  E.g. VBoxClient
     22#   running will prevent vboxguest reloading.
     23# * If the kernel modules cannot be built (run the installer with KERN_DIR=/) or
     24#   loaded (run with KERN_VER=<installed non-current version>) then 1 is returned.
     25
    1926PATH=$PATH:/bin:/sbin:/usr/sbin
    2027
     
    3643SELF=$1
    3744LOGFILE="/var/log/vboxadd-install.log"
     45
     46## Were we able to stop any previously running Additions kernel modules?
     47MODULES_STOPPED=1
    3848
    3949. "./$ROUTINES"
     
    320330test "$ACTION" = "install" || exit 0
    321331
     332# Now check whether the kernel modules were stopped.
     333lsmod | grep -q vboxguest && MODULES_STOPPED=
     334
    322335# Choose a proper umask
    323336umask 022
     
    564577    echo >&2 "  ldconfig"
    565578fi
     579
     580# And do a final test as to whether the kernel modules were properly created
     581# and loaded.  Return 0 if both are true, 1 if the modules could not be built
     582# or loaded (except due to already running older modules) and 2 if already
     583# running modules probably prevented new ones from loading.  vboxvideo is
     584# currently not tested.
     585# Assume that we have already printed enough messages by now and stay silent.
     586modinfo vboxguest >/dev/null 2>&1 || exit 1
     587lsmod | grep -q vboxguest || exit 1
     588test -n "${MODULES_STOPPED}" || exit 2
     589exit 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