VirtualBox

Changeset 107920 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Jan 23, 2025 4:19:03 PM (3 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167151
Message:

Additions: Linux: rcvboxadd: Use generic function to check if kernel module is loaded, bugref:10359.

File:
1 edited

Legend:

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

    r107919 r107920  
    168168VBOX_REVISION="r`"$VBOXCONTROL" --version | cut -d r -f2`"
    169169[ "$VBOX_REVISION" != "r" ] || VBOX_REVISION='unknown'
    170 
    171 # Returns if the vboxguest module is running or not.
    172 #
    173 # Returns true if vboxguest module is running, false if not.
    174 running_vboxguest()
    175 {
    176     lsmod | grep -q "vboxguest[^_-]"
    177 }
    178 
    179 # Returns if the vboxsf module is running or not.
    180 #
    181 # Returns true if vboxsf module is running, false if not.
    182 running_vboxsf()
    183 {
    184     lsmod | grep -q "vboxsf[^_-]"
    185 }
    186170
    187171# Returns if a specific module is running or not.
     
    881865    groupadd -r -f vboxdrmipc >/dev/null 2>&1
    882866
    883     if  running_vboxguest; then
     867    if  running_module "vboxguest"; then
    884868        # Only warn user if currently loaded modules version do not match Guest Additions Installation.
    885869        check_running_module_version "vboxguest" || info "Running kernel modules will not be replaced until the system is restarted or 'rcvboxadd reload' triggered"
     
    11641148            # If final goal of unloading vboxguest.ko won't be met, we will fail on
    11651149            # the next step anyway.
    1166             running_vboxsf && modprobe -r vboxsf >/dev/null  2>&1
    1167             running_vboxguest
     1150            running_module "vboxsf" && modprobe -r vboxsf >/dev/null  2>&1
     1151            running_module "vboxguest"
    11681152            if [ $? -eq 0 ]; then
    11691153                modprobe -r vboxguest >/dev/null  2>&1
     
    11761160
    11771161        # Check if we succeeded with unloading vboxguest after several attempts.
    1178         running_vboxguest
     1162        running_module "vboxguest"
    11791163        if [ $? -eq 0 ]; then
    11801164            info "cannot reload kernel modules: one or more module(s) is still in use"
     
    12181202dmnstatus()
    12191203{
    1220     if running_vboxguest; then
     1204    if running_module "vboxguest"; then
    12211205        echo "The VirtualBox Additions are currently running."
    12221206    else
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