VirtualBox

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


Ignore:
Timestamp:
Feb 15, 2023 5:25:30 PM (2 years ago)
Author:
vboxsync
Message:

Additions: Linux: rcvboxadd: Do not rebuild kernel modules on system shutdown, bugref:10359.

This commit changes previous behavior when Guest Additions' kernel modules rebuild
was triggered on system shutdown ("rcvboxadd stop"). This is probably no longer needed.
Script will check, as before, if modules rebuild is needed on system start
("rcvboxadd start") and will attempt to reload them (as well as restart
corresponding services) after rebuild is completed.

File:
1 edited

Legend:

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

    r98476 r98595  
    7070QUIET=
    7171test -z "${TARGET_VER}" && TARGET_VER=`uname -r`
    72 
    73 # Marker to ignore a particular kernel version which was already installed.
    74 #
    75 # This is needed in order to prevent modules rebuild on system start and do
    76 # that on system shutdown instead. Modern Linux distributions might attempt
    77 # to run Additions service in async mode. As a result, on system boot, modules
    78 # not-by-us will be loaded while we will try to build our modules. This marker is:
    79 #
    80 #   created -- in scope of setup_modules() when actual modules are built.
    81 #   checked -- in scope of stop() when system goes shutdown and if marker
    82 #              for certain kernel version does not exist, modules rebuild
    83 #              will be triggered for this kernel version.
    84 #   removed -- in scope of cleanup_modules() when modules are removed from
    85 #              system for all installed kernels.
    86 SKIPFILE_BASE=/var/lib/VBoxGuestAdditions/skip
    8772
    8873export VBOX_KBUILD_TYPE
     
    331316    done
    332317    rm -f /etc/depmod.d/vboxvideo-upstream.conf
    333     rm -f "$SKIPFILE_BASE"-*
    334318}
    335319
     
    546530
    547531    update_initramfs "${KERN_VER}"
    548 
    549     # We have just built modules for KERN_VER kernel. Create a marker to indicate
    550     # that modules for this kernel version should not be rebuilt on system shutdown.
    551     touch "$SKIPFILE_BASE"-"$KERN_VER"
    552532
    553533    return 0
     
    873853            ps -A -o comm | grep -q '/*udevd$' 2>/dev/null ||
    874854            no_udev=1
    875         running_vboxguest || {
     855        check_running_module_version "vboxguest" || {
    876856            rm -f $dev || {
    877857                fail "Cannot remove $dev"
     
    880860                fail "Cannot remove $userdev"
    881861            }
    882             $MODPROBE vboxguest >/dev/null 2>&1 ||
    883                 fail "modprobe vboxguest failed"
    884             case "$no_udev" in 1)
    885                 sleep .5;;
    886             esac
    887             $MODPROBE vboxsf > /dev/null 2>&1 ||
    888                 info "modprobe vboxsf failed"
     862            # Assuming modules were just (re-)built, try to reload everything.
     863            reload
    889864        }
    890865        case "$no_udev" in 1)
     
    899874{
    900875    begin "Stopping."
    901     if test -z "${INSTALL_NO_MODULE_BUILDS}"; then
    902         # We want to build modules for newly installed kernels on shutdown, so
    903         # check which we marked at start-up.
    904         for setupi in /lib/modules/*; do
    905             KERN_VER="${setupi##*/}"
    906             # For a full setup, mark kernels we do not want to build.
    907             test -f "$SKIPFILE_BASE"-"$KERN_VER" || setup_modules "$KERN_VER"
    908         done
    909     fi
     876
    910877    if test -r /etc/ld.so.conf.d/00vboxvideo.conf; then
    911878        rm /etc/ld.so.conf.d/00vboxvideo.conf
     
    10831050        # since it's not loaded for very old guests.
    10841051        for mod in vboxguest vboxsf; do
    1085             check_running_module_version "$mod" || fail "currently loaded module $mod version ($(running_module_version "$mod") does not match to VirtualBox Guest Additions installation version ($VBOX_VERSION $VBOX_REVISION))"
     1052            check_running_module_version "$mod" || fail "currently loaded module $mod version ($(running_module_version "$mod")) does not match to VirtualBox Guest Additions installation version ($VBOX_VERSION $VBOX_REVISION)"
    10861053        done
    10871054        # Take reported version of running Guest Additions from running vboxguest module (as a paranoia check).
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