Changeset 107963 in vbox for trunk/src/VBox/Additions/linux/installer/vboxadd.sh
- Timestamp:
- Jan 28, 2025 12:55:41 PM (4 weeks ago)
- svn:sync-xref-src-repo-rev:
- 167213
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/installer/vboxadd.sh
r107923 r107963 982 982 983 983 # A wrapper for check_running_module_version. 984 # Go through the list of Guest Additions' modules and 985 # verify if they are loaded and running version matches 986 # to current installation version. Skip vboxvideo since 987 # it is not loaded for old guests. 984 # Verify if module is loaded and its version matches 985 # to current Additions installation version. 986 check_running_module() 987 { 988 mod="$1" 989 990 # Check args. 991 [ -n "$mod" ] || return 992 993 # During reload action it may take some time for module 994 # to be fully loaded, so make a few attempts while checking this. 995 for attempt in 1 2 3 4 5; do 996 997 # Wait before the next attempt. 998 [ -n "$vbox_add_wait" -a $? -ne 0 ] && sleep 1 999 1000 running_module "$mod" 1001 if [ $? -eq 0 ]; then 1002 mod_is_running="1" 1003 check_running_module_version "$mod" 1004 [ $? -eq 0 ] && break 1005 else 1006 mod_is_running="" 1007 false 1008 fi 1009 1010 done 1011 1012 # In case of error, try to print out proper reason of failure. 1013 if [ $? -ne 0 ]; then 1014 # Was module loaded? 1015 if [ -z "$mod_is_running" ]; then 1016 info "module $mod is not loaded" 1017 else 1018 # If module was loaded it means that it has incorrect version. 1019 info "currently loaded module $mod version ($(running_module_version "$mod")) does not match to VirtualBox Guest Additions installation version ($VBOX_VERSION $VBOX_REVISION)" 1020 fi 1021 1022 # Set "bad" rc. 1023 false 1024 fi 1025 } 1026 1027 # Go through list of Additions modules and check 1028 # if they were properly loaded. 988 1029 check_status_kernel() 989 1030 { 990 for mod in vboxguest vboxsf; do 991 992 for attempt in 1 2 3 4 5; do 993 994 # Wait before the next attempt. 995 [ -n "$vbox_add_wait" -a $? -ne 0 ] && sleep 1 996 997 running_module "$mod" 998 if [ $? -eq 0 ]; then 999 mod_is_running="1" 1000 check_running_module_version "$mod" 1001 [ $? -eq 0 ] && break 1002 else 1003 mod_is_running="" 1004 false 1005 fi 1006 1007 done 1008 1009 # In case of error, try to print out proper reason of failure. 1010 if [ $? -ne 0 ]; then 1011 # Was module loaded? 1012 if [ -z "$mod_is_running" ]; then 1013 info "module $mod is not loaded" 1014 else 1015 # If module was loaded it means that it has incorrect version. 1016 info "currently loaded module $mod version ($(running_module_version "$mod")) does not match to VirtualBox Guest Additions installation version ($VBOX_VERSION $VBOX_REVISION)" 1017 fi 1018 1019 # Set "bad" rc. 1020 false 1021 fi 1022 1023 done 1031 # Module vboxguest should be loaded unconditionally once Guest Additions were installed. 1032 check_running_module "vboxguest" 1033 1034 # Module vboxsf module might not be loaded if VM has no Shared Folder mappings. 1035 # Check that first and then verify the module. 1036 if [ $? -eq 0 ]; then 1037 VBoxControl sharedfolder list >/dev/null 2>&1 1038 if [ $? -eq 0 ]; then 1039 check_running_module "vboxsf" 1040 else 1041 # Do not spoil $?. 1042 true 1043 fi 1044 fi 1045 1046 # Module vboxvideo is optional and expected to be loaded only when VM is 1047 # running VBoxVGA or VBoxSVGA graphics. 1048 if [ $? -eq 0 ]; then 1049 gpu_vendor=$(lspci | grep 'VGA compatible controller' | cut -d ' ' -f 5 2>/dev/null) 1050 if [ "gpu_vendor" = "InnoTek" ]; then 1051 check_running_module "vboxvideo" 1052 else 1053 # Do not spoil $?. 1054 true 1055 fi 1056 fi 1024 1057 } 1025 1058 … … 1237 1270 # modules. This operation is asynchronous and requires some time for 1238 1271 # modules to be loaded in most of the cases. By setting this variable, we 1239 # ask check_ status_kernel() to wait a bit before making a decision1272 # ask check_running_module() to wait a bit before making a decision 1240 1273 # whether modules were loaded or not. 1241 1274 vbox_add_wait=1
Note:
See TracChangeset
for help on using the changeset viewer.