Changeset 89203 in vbox for trunk/src/VBox
- Timestamp:
- May 20, 2021 4:32:38 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/linux/vboxdrv.sh
r89173 r89203 274 274 } 275 275 276 # Returns path to module file as seen by modinfo(8) or empty string. 277 module_path() 278 { 279 mod="$1" 280 [ -n "$mod" ] || return 281 282 modinfo "$mod" 2>/dev/null | grep -e "^filename:" | tr -s ' ' | cut -d " " -f2 283 } 284 276 285 # Returns module version if module is available or empty string. 277 286 module_version() … … 292 301 } 293 302 294 # Returns "1" if module is available in the system and its version and revision 295 # number do match to current VirtualBox installation. Or empty string otherwise. 303 # Returns "1" if externally built module is available in the system and its 304 # version and revision number do match to current VirtualBox installation. 305 # Or empty string otherwise. 296 306 module_available() 297 307 { … … 299 309 [ -n "$mod" ] || return 300 310 301 [ "$VBOX_VERSION" = "$(module_version $mod)" ] || return 302 [ "$VBOX_REVISION" = "$(module_revision $mod)" ] || return 311 [ "$VBOX_VERSION" = "$(module_version "$mod")" ] || return 312 [ "$VBOX_REVISION" = "$(module_revision "$mod")" ] || return 313 314 # Check if module belongs to VirtualBox installation. 315 # 316 # We have a convention that only modules from /lib/modules/*/misc 317 # belong to us. Modules from other locations are treated as 318 # externally built. 319 mod_path="$(module_path "$mod")" 320 321 # If module path points to a symbolic link, resolve actual file location. 322 [ -L "$mod_path" ] && mod_path="$(readlink -e -- "$mod_path")" 323 324 # File exists? 325 [ -f "$mod_path" ] || return 326 327 # Extract last component of module path and check whether it is located 328 # outside of /lib/modules/*/misc. 329 mod_dir="$(dirname "$mod_path" | sed 's;^.*/;;')" 330 [ "$mod_dir" != "misc" ] || return 303 331 304 332 echo "1" … … 332 360 fi 333 361 334 # Check if system already has matching modules installed.335 [ "$(setup_complete)" = "1" ] || setup336 337 362 if ! running vboxdrv; then 363 364 # Check if system already has matching modules installed. 365 [ "$(setup_complete)" = "1" ] || setup 366 338 367 if ! rm -f $DEVICE; then 339 368 failure "Cannot remove $DEVICE"
Note:
See TracChangeset
for help on using the changeset viewer.