Changeset 66423 in vbox for trunk/src/VBox/Additions/linux/installer/vboxadd.sh
- Timestamp:
- Apr 4, 2017 7:57:09 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/installer/vboxadd.sh
r66413 r66423 33 33 34 34 # Testing: 35 # * Should fail if the configuration file is missing or missing INSTALL_[DIR|VER]. 36 # * vboxadd user and vboxsf groups should be created if they do not exist. 37 # * udev rule should be successfully created. 35 # * Should fail if the configuration file is missing or missing INSTALL_DIR or 36 # INSTALL_VER entries. 37 # * vboxadd user and vboxsf groups should be created if they do not exist - test 38 # by removing them before installing. 38 39 # * Shared folders can be mounted and auto-mounts accessible to vboxsf group, 39 40 # including on recent Fedoras with SELinux. 40 # * Setting INSTALL_NO_MODULE_BUILDS inhibits modules, users, udev in setup and 41 # cleanup but not the shared folder group creation. 42 # * rcvboxadd udev[cleanup] sets up udev and creates the user but skips modules, 43 # shared folders and group creation. 41 # * Setting INSTALL_NO_MODULE_BUILDS inhibits modules and module automatic 42 # rebuild script creation; otherwise modules, user, group, rebuild script, 43 # udev rule and shared folder mount helper should be created/set up. 44 # * Setting INSTALL_NO_MODULE_BUILDS inhibits module load and unload on start 45 # and stop. 44 46 # * Uninstalling the Additions and re-installing them does not trigger warnings. 45 47 … … 204 206 # If we got this far assume that the slow set-up has been done. 205 207 QUICKSETUP=yes 206 uname -r | grep -q -E '^2\.6|^3|^4' 2>/dev/null && 207 ps -A -o comm | grep -q '/*udevd$' 2>/dev/null || 208 no_udev=1 209 running_vboxguest || { 210 rm -f $dev || { 211 fail "Cannot remove $dev" 208 if test -z "${INSTALL_NO_MODULE_BUILDS}"; then 209 uname -r | grep -q -E '^2\.6|^3|^4' 2>/dev/null && 210 ps -A -o comm | grep -q '/*udevd$' 2>/dev/null || 211 no_udev=1 212 running_vboxguest || { 213 rm -f $dev || { 214 fail "Cannot remove $dev" 215 } 216 217 rm -f $userdev || { 218 fail "Cannot remove $userdev" 219 } 220 221 $MODPROBE vboxguest >/dev/null 2>&1 || { 222 setup 223 $MODPROBE vboxguest >/dev/null 2>&1 || { 224 "${INSTALL_DIR}/init/vboxadd-x11" cleanup 2>> "${LOG}" 225 fail "modprobe vboxguest failed" 226 } 227 } 228 case "$no_udev" in 1) 229 sleep .5;; 230 esac 212 231 } 213 214 rm -f $userdev || { 215 fail "Cannot remove $userdev" 216 } 217 218 $MODPROBE vboxguest >/dev/null 2>&1 || { 219 setup 220 $MODPROBE vboxguest >/dev/null 2>&1 || { 221 "${INSTALL_DIR}/init/vboxadd-x11" cleanup 2>> "${LOG}" 222 fail "modprobe vboxguest failed" 232 case "$no_udev" in 1) 233 do_vboxguest_non_udev;; 234 esac 235 236 running_vboxsf || { 237 $MODPROBE vboxsf > /dev/null 2>&1 || { 238 if dmesg | grep "VbglR0SfConnect failed" > /dev/null 2>&1; then 239 info "Unable to start shared folders support. Make sure that your VirtualBox build supports this feature." 240 else 241 info "modprobe vboxsf failed" 242 fi 223 243 } 224 244 } 225 case "$no_udev" in 1) 226 sleep .5;; 227 esac 228 } 229 case "$no_udev" in 1) 230 do_vboxguest_non_udev;; 231 esac 232 233 running_vboxsf || { 234 $MODPROBE vboxsf > /dev/null 2>&1 || { 235 if dmesg | grep "VbglR0SfConnect failed" > /dev/null 2>&1; then 236 info "Unable to start shared folders support. Make sure that your VirtualBox build supports this feature." 237 else 238 info "modprobe vboxsf failed" 239 fi 240 } 241 } 245 fi # INSTALL_NO_MODULE_BUILDS 242 246 243 247 # Put the X.Org driver in place. This is harmless if it is not needed. … … 283 287 fail "Cannot unmount vboxsf folders" 284 288 fi 289 test -n "${INSTALL_NO_MODULE_BUILDS}" && return 0 285 290 modprobe -q -r -a vboxvideo vboxsf vboxguest 286 291 if egrep -q 'vboxguest|vboxsf|vboxvideo' /proc/modules; then … … 452 457 chcon -t bin_t "$BUILDINTMP" > /dev/null 2>&1 453 458 454 setup_modules459 test -z "${INSTALL_NO_MODULE_BUILDS}" && setup_modules 455 460 create_vbox_user 456 461 create_udev_rule 457 create_module_rebuild_script462 test -z "${INSTALL_NO_MODULE_BUILDS}" && create_module_rebuild_script 458 463 test -n "${QUICKSETUP}" && return 0 459 464 shared_folder_setup … … 467 472 cleanup() 468 473 { 469 # Delete old versions of VBox modules. 470 cleanup_modules 471 depmod 472 473 # Remove old module sources 474 for i in $OLDMODULES; do 475 rm -rf /usr/src/$i-* 476 done 474 if test -z "${INSTALL_NO_MODULE_BUILDS}"; then 475 # Delete old versions of VBox modules. 476 cleanup_modules 477 depmod 478 479 # Remove old module sources 480 for i in $OLDMODULES; do 481 rm -rf /usr/src/$i-* 482 done 483 fi 477 484 478 485 # Clean-up X11-related bits … … 481 488 # Remove other files 482 489 rm /sbin/mount.vboxsf 2>/dev/null 483 rm -f /etc/kernel/postinst.d/vboxadd /etc/kernel/prerm.d/vboxadd 484 rmdir -p /etc/kernel/postinst.d /etc/kernel/prerm.d 2>/dev/null 490 if test -z "${INSTALL_NO_MODULE_BUILDS}"; then 491 rm -f /etc/kernel/postinst.d/vboxadd /etc/kernel/prerm.d/vboxadd 492 rmdir -p /etc/kernel/postinst.d /etc/kernel/prerm.d 2>/dev/null 493 fi 485 494 rm /etc/udev/rules.d/60-vboxadd.rules 2>/dev/null 486 495 } … … 509 518 ;; 510 519 setup) 511 if test -z "${INSTALL_NO_MODULE_BUILDS}"; then 512 setup 513 else 514 shared_folder_setup 515 fi 520 setup 516 521 start 517 522 ;; … … 521 526 ;; 522 527 cleanup) 523 if test -z "${INSTALL_NO_MODULE_BUILDS}"; then 524 cleanup 525 else 526 rm /sbin/mount.vboxsf 2>/dev/null 527 fi 528 ;; 529 udevsetup) 530 create_vbox_user 531 create_udev_rule 532 ;; 533 udevcleanup) 534 rm /etc/udev/rules.d/60-vboxadd.rules 2>/dev/null 528 cleanup 535 529 ;; 536 530 status) … … 538 532 ;; 539 533 *) 540 echo "Usage: $0 {start|stop|restart|status|setup|quicksetup|cleanup |udevsetup|udevcleanup} [quiet]"534 echo "Usage: $0 {start|stop|restart|status|setup|quicksetup|cleanup} [quiet]" 541 535 exit 1 542 536 esac
Note:
See TracChangeset
for help on using the changeset viewer.