Changeset 22082 in vbox
- Timestamp:
- Aug 7, 2009 5:57:05 PM (15 years ago)
- Location:
- trunk/src/VBox/Installer/solaris
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/solaris/Makefile.kmk
r21764 r22082 155 155 solaris-bin_SOURCES = \ 156 156 $(if $(VBOX_WITH_PYTHON),$(PATH_ROOT)/src/VBox/Frontends/VBoxShell/vboxshell.py,) \ 157 $(VBOX_PATH_SOL_INST_SRC)/vbox drv.sh \157 $(VBOX_PATH_SOL_INST_SRC)/vboxconfig.sh \ 158 158 $(VBOX_PATH_SOL_INST_SRC)/VBox.sh \ 159 159 $(VBOX_PATH_SOL_INST_SRC)/ipsinstall.sh \ … … 267 267 268 268 SOLARIS_COMMON_EXES = \ 269 vbox drv.sh \269 vboxconfig.sh \ 270 270 VBox.sh \ 271 271 ipsinstall.sh \ … … 550 550 $(QUIET)$(SED) \ 551 551 -e "s/_HARDENED_/$(if $(VBOX_WITH_HARDENED),hardened,)/" \ 552 --output $(SOLARIS_VBOXINST_DIR)/vbox drv.sh.tmp \553 $(PATH_BIN)/vbox drv.sh554 $(QUIET)$(INSTALL) -m 0755 $(SOLARIS_VBOXINST_DIR)/vbox drv.sh.tmp $(SOLARIS_VBOXINST_DIR)/vboxdrv.sh555 $(QUIET)$(RM) -f $(SOLARIS_VBOXINST_DIR)/vbox drv.sh.tmp552 --output $(SOLARIS_VBOXINST_DIR)/vboxconfig.sh.tmp \ 553 $(PATH_BIN)/vboxconfig.sh 554 $(QUIET)$(INSTALL) -m 0755 $(SOLARIS_VBOXINST_DIR)/vboxconfig.sh.tmp $(SOLARIS_VBOXINST_DIR)/vboxconfig.sh 555 $(QUIET)$(RM) -f $(SOLARIS_VBOXINST_DIR)/vboxconfig.sh.tmp 556 556 $(QUIET)$(if $(VBOX_WITH_QTGUI),$(INSTALL) -m 0644 $(VBOX_PATH_SOL_INST_SRC)/virtualbox.desktop $(SOLARIS_USRSHR_APPS_DIR)/virtualbox.desktop,) 557 557 $(QUIET)$(INSTALL) -m 0644 $(SOLARIS_OUT_BIN)/VBox.png $(SOLARIS_USRSHR_PIXMAPS_DIR)/VBox.png -
trunk/src/VBox/Installer/solaris/postinstall.sh
r22003 r22082 21 21 # 22 22 23 install_python_bindings()24 {25 PYTHONBIN=$126 if test -x "$PYTHONBIN"; then27 VBOX_INSTALL_PATH=/opt/VirtualBox28 export VBOX_INSTALL_PATH29 cd /opt/VirtualBox/sdk/installer30 $PYTHONBIN ./vboxapisetup.py install > /dev/null31 return 032 fi33 return 134 }35 36 23 # Check for xVM/Xen 37 24 currentisa=`uname -i` … … 44 31 currentzone=`zonename` 45 32 if test "$currentzone" = "global"; then 46 echo " Loading VirtualBox kernel modules..."47 /opt/VirtualBox/vbox drv.sh stopall silentunload checkarch33 echo "Checking for older bits..." 34 /opt/VirtualBox/vboxconfig.sh preremove fatal 48 35 rc=$? 49 36 if test "$rc" -eq 0; then 50 /opt/VirtualBox/vboxdrv.sh start 51 rc=$? 52 53 # VBoxDrv loaded successfully, proceed with the rest... 54 if test "$rc" -eq 0; then 55 # Load VBoxNetAdapter vboxnet 56 if test -f /platform/i86pc/kernel/drv/vboxnet.conf; then 57 /opt/VirtualBox/vboxdrv.sh netstart 58 rc=$? 59 60 # nwam/dhcpagent fix 61 nwamfile=/etc/nwam/llp 62 nwambackupfile=$nwamfile.vbox 63 if test "$rc" -eq 0 && test -f "$nwamfile"; then 64 sed -e '/vboxnet/d' $nwamfile > $nwambackupfile 65 echo "vboxnet0 static 192.168.56.1" >> $nwambackupfile 66 mv -f $nwambackupfile $nwamfile 67 fi 68 fi 69 70 # Load VBoxNetFilter vboxflt 71 if test -f /platform/i86pc/kernel/drv/vboxflt.conf; then 72 /opt/VirtualBox/vboxdrv.sh fltstart 73 rc=$? 74 fi 75 76 # Load VBoxUSBMon vboxusbmon (do NOT load for Solaris 10) 77 if test -f /platform/i86pc/kernel/drv/vboxusbmon.conf && test "$osversion" != "5.10"; then 78 /opt/VirtualBox/vboxdrv.sh usbstart 79 rc=$? 80 if test "$rc" -eq 0; then 81 # Add vboxusbmon to the devlink.tab 82 sed -e '/name=vboxusbmon/d' /etc/devlink.tab > /etc/devlink.vbox 83 echo "type=ddi_pseudo;name=vboxusbmon \D" >> /etc/devlink.vbox 84 mv -f /etc/devlink.vbox /etc/devlink.tab 85 fi 86 fi 87 fi 37 echo "Installing new bits..." 38 /opt/VirtualBox/vboxconfig.sh postinstall 88 39 fi 89 90 # Fail on any errors while unloading previous modules because it makes it very hard to 91 # track problems when older vboxdrv is hanging about in memory and add_drv of the new 92 # one suceeds and it appears as though the new one is being used. 93 if test "$rc" -ne 0; then 94 echo "## Loading failed. Aborting installation." 95 exit 2 96 fi 97 98 echo "Configuring services and drivers..." 99 100 # Web service 101 if test -f /var/svc/manifest/application/virtualbox/virtualbox-webservice.xml; then 102 /usr/sbin/svccfg import /var/svc/manifest/application/virtualbox/virtualbox-webservice.xml 103 /usr/sbin/svcadm disable -s svc:/application/virtualbox/webservice:default 104 fi 105 106 # Add vboxdrv to the devlink.tab 107 sed -e '/name=vboxdrv/d' /etc/devlink.tab > /etc/devlink.vbox 108 echo "type=ddi_pseudo;name=vboxdrv \D" >> /etc/devlink.vbox 109 mv -f /etc/devlink.vbox /etc/devlink.tab 110 111 # Create the device link 112 /usr/sbin/devfsadm -i vboxdrv 113 114 # Don't create link for Solaris 10 115 if test -f /platform/i86pc/kernel/drv/vboxusbmon.conf && test "$osversion" != "5.10"; then 116 /usr/sbin/devfsadm -i vboxusbmon 117 fi 118 sync 119 120 # We need to touch the desktop link in order to add it to the menu right away 121 if test -f "/usr/share/applications/virtualbox.desktop"; then 122 touch /usr/share/applications/virtualbox.desktop 123 fi 124 125 # Zone access service 126 if test -f /var/svc/manifest/application/virtualbox/virtualbox-zoneaccess.xml; then 127 /usr/sbin/svccfg import /var/svc/manifest/application/virtualbox/virtualbox-zoneaccess.xml 128 /usr/sbin/svcadm enable -s svc:/application/virtualbox/zoneaccess 129 fi 130 131 # Install python bindings 132 if test -f "/opt/VirtualBox/sdk/installer/vboxapisetup.py" || test -h "/opt/VirtualBox/sdk/installer/vboxapisetup.py"; then 133 PYTHONBIN=`which python 2> /dev/null` 134 if test -f "$PYTHONBIN" || test -h "$PYTHONBIN"; then 135 echo "Installing Python bindings..." 136 137 INSTALLEDIT=1 138 PYTHONBIN=`which python2.4 2>/dev/null` 139 install_python_bindings "$PYTHONBIN" 140 if test "$?" -eq 0; then 141 INSTALLEDIT=0 142 fi 143 PYTHONBIN=`which python2.5 2>/dev/null` 144 install_python_bindings "$PYTHONBIN" 145 if test "$?" -eq 0; then 146 INSTALLEDIT=0 147 fi 148 PYTHONBIN=`which python2.6 2>/dev/null` 149 install_python_bindings "$PYTHONBIN" 150 if test "$?" -eq 0; then 151 INSTALLEDIT=0 152 fi 153 154 # remove files installed by Python build 155 rm -rf /opt/VirtualBox/sdk/installer/build 156 157 if test "$INSTALLEDIT" -ne 0; then 158 echo "** No suitable Python version found. Requires Python 2.4, 2.5 or 2.6." 159 fi 160 else 161 echo "** WARNING! Python not found, skipped installed Python bindings." 162 echo " Manually run '/opt/VirtualBox/sdk/installer/vboxapisetup.py install'" 163 echo " to install the bindings when python is available." 164 fi 165 fi 166 167 # Update boot archive 168 BOOTADMBIN=/sbin/bootadm 169 if test -x "$BOOTADMBIN"; then 170 echo "Updating boot archive..." 171 $BOOTADMBIN update-archive > /dev/null 40 rc=$? 41 if test "$rc" -eq 0; then 42 echo "Completed Successfully!" 172 43 else 173 echo " ## $BOOTADMBIN not found/executable. Skipped explicit boot-archive update."44 echo "Completed but with errors." 174 45 fi 175 46 fi … … 180 51 181 52 # return 20 = requires reboot, 2 = partial failure, 0 = success 182 exit 053 exit "$rc" 183 54 -
trunk/src/VBox/Installer/solaris/preremove.sh
r20956 r22082 23 23 currentzone=`zonename` 24 24 if test "$currentzone" = "global"; then 25 # stop and unregister webservice SMF (if present) 26 webservicefound=`svcs -a | grep "virtualbox/webservice"` 27 if test ! -z "$webservicefound"; then 28 /usr/sbin/svcadm disable -s svc:/application/virtualbox/webservice:default 29 /usr/sbin/svccfg delete svc:/application/virtualbox/webservice:default 30 fi 31 32 # stop and unregister zoneaccess SMF (if present) 33 zoneaccessfound=`svcs -a | grep "virtualbox/zoneaccess"` 34 if test ! -z "$zoneaccessfound"; then 35 /usr/sbin/svcadm disable -s svc:/application/virtualbox/zoneaccess 36 /usr/sbin/svccfg delete svc:/application/virtualbox/zoneaccess 37 fi 38 39 # vboxdrv.sh would've been installed, we just need to call it. 40 /opt/VirtualBox/vboxdrv.sh usbstop alwaysremdrv 41 /opt/VirtualBox/vboxdrv.sh netstop alwaysremdrv 42 /opt/VirtualBox/vboxdrv.sh fltstop alwaysremdrv 43 /opt/VirtualBox/vboxdrv.sh stop alwaysremdrv 44 45 # remove devlink.tab entry for vboxdrv 46 sed -e ' 47 /name=vboxdrv/d' /etc/devlink.tab > /etc/devlink.vbox 48 mv -f /etc/devlink.vbox /etc/devlink.tab 49 50 # remove nwam entry for vboxnet 51 nwamfile=/etc/nwam/llp 52 nwambackupfile=$nwamfile.vbox 53 if test -f "$nwamfile"; then 54 sed -e '/vboxnet/d' $nwamfile > $nwambackupfile 55 mv -f $nwambackupfile $nwamfile 56 fi 57 58 # remove devlink.tab entry for vboxusbmon 59 sed -e ' 60 /name=vboxusbmon/d' /etc/devlink.tab > /etc/devlink.vbox 61 mv -f /etc/devlink.vbox /etc/devlink.tab 62 63 # remove the devlinks 64 if test -h "/dev/vboxdrv" || test -f "/dev/vboxdrv"; then 65 rm -f /dev/vboxdrv 66 fi 67 if test -h "/dev/vboxusbmon" || test -f "/dev/vboxusbmon"; then 68 rm -f /dev/vboxusbmon 69 fi 25 /opt/VirtualBox/vboxconfig.sh preremove 70 26 fi 71 27 72 28 echo "Done." 29 exit 0 73 30 -
trunk/src/VBox/Installer/solaris/vboxconfig.sh
r22080 r22082 23 23 # Never use exit 2 or exit 20 etc., the return codes are used in 24 24 # SRv4 postinstall procedures which carry special meaning. Just use exit 1 for failure. 25 set -x26 25 27 26 HOST_OS_VERSION=`uname -r` … … 44 43 # "vboxdrv" is also used in sed lines here (change those as well if it ever changes) 45 44 MOD_VBOXDRV=vboxdrv 46 DESC_VBOXDRV=" VirtualBox HostDriver"45 DESC_VBOXDRV="Host" 47 46 48 47 MOD_VBOXNET=vboxnet 49 DESC_VBOXNET=" VirtualBoxNetAdapter"48 DESC_VBOXNET="NetAdapter" 50 49 51 50 MOD_VBOXFLT=vboxflt 52 DESC_VBOXFLT=" VirtualBoxNetFilter"51 DESC_VBOXFLT="NetFilter" 53 52 54 53 MOD_VBI=vbi 55 DESC_VBI=" VirtualBoxKernel Interface"54 DESC_VBI="Kernel Interface" 56 55 57 56 MOD_VBOXUSBMON=vboxusbmon 58 DESC_VBOXUSBMON=" VirtualBoxUSBMonitor"57 DESC_VBOXUSBMON="USBMonitor" 59 58 60 59 FATALOP=fatal … … 270 269 271 270 if test $? -ne 0; then 272 errorprint " Adding:$moddesc module ...FAILED!"271 errorprint " - Adding: $moddesc module ...FAILED!" 273 272 if test "$fatal" = "$FATALOP"; then 274 273 exit 1 … … 295 294 $BIN_REMDRV $modname 296 295 if test $? -eq 0; then 297 success " Removed:$moddesc module"296 success " - Removed: $moddesc module" 298 297 return 0 299 298 else 300 errorprint " Removing: $moddesc ...FAILED!"299 errorprint " - Removing: $moddesc ...FAILED!" 301 300 if test "$fatal" = "$FATALOP"; then 302 301 exit 1 … … 323 322 $BIN_MODUNLOAD -i $modid 324 323 if test $? -eq 0; then 325 success " Unloaded: $moddesc module"324 success " - Unloaded: $moddesc module" 326 325 else 327 errorprint " Unloading: $moddesc ...FAILED!"326 errorprint " - Unloading: $moddesc ...FAILED!" 328 327 if test "$fatal" = "$FATALOP"; then 329 328 exit 1 … … 350 349 $BIN_MODLOAD -p $modname 351 350 if test $? -eq 0; then 352 success " Loaded: $moddesc module"351 success " - Loaded: $moddesc module" 353 352 return 0 354 353 else 355 errorprint " Loading: $modesc ...FAILED!"354 errorprint " - Loading: $modesc ...FAILED!" 356 355 if test "$fatal" = "$FATALOP"; then 357 356 exit 1 … … 380 379 /usr/sbin/devfsadm -i "$MOD_VBOXDRV" 381 380 382 if test $? -eq 0 ; then381 if test $? -eq 0 && test -h "/dev/vboxdrv"; then 383 382 384 383 if test -f /platform/i86pc/kernel/drv/vboxnet.conf; then … … 421 420 { 422 421 fatal=$1 422 423 423 # Remove vboxdrv from devlink.tab 424 424 devlinkfound=`cat /etc/devlink.tab | grep vboxdrv` … … 435 435 fi 436 436 437 # USBMonitor might not even be installed, but anyway... 438 if test -f /platform/i86pc/kernel/drv/vboxusbmon.conf && test "$HOST_OS_VERSION" != "5.10"; then 439 unload_module "$MOD_VBOXUSBMON" "$DESC_VBOXUSBMON" "$fatal" 440 rem_driver "$MOD_VBOXUSBMON" "$DESC_VBOXUSBMON" "$fatal" 441 fi 437 unload_module "$MOD_VBOXUSBMON" "$DESC_VBOXUSBMON" "$fatal" 438 rem_driver "$MOD_VBOXUSBMON" "$DESC_VBOXUSBMON" "$fatal" 442 439 443 440 unload_module "$MOD_VBOXFLT" "$DESC_VBOXFLT" "$fatal" … … 458 455 if test -h "/dev/vboxusbmon" || test -f "/dev/vboxusbmon"; then 459 456 rm -f /dev/vboxusbmon 457 fi 458 459 # unpatch nwam/dhcpagent fix 460 nwamfile=/etc/nwam/llp 461 nwambackupfile=$nwamfile.vbox 462 if test -f "$nwamfile"; then 463 sed -e '/vboxnet/d' $nwamfile > $nwambackupfile 464 mv -f $nwambackupfile $nwamfile 460 465 fi 461 466 … … 491 496 $BIN_SVCADM disable -s svc:/application/virtualbox/webservice:default 492 497 $BIN_SVCCFG delete svc:/application/virtualbox/webservice:default 498 if test "$?" -eq 0; then 499 success " - Unloaded: Web service" 500 else 501 warnprint " - Unloading: Web service ...ERROR(S)." 502 fi 493 503 fi 494 504 … … 498 508 $BIN_SVCADM disable -s svc:/application/virtualbox/zoneaccess 499 509 $BIN_SVCCFG delete svc:/application/virtualbox/zoneaccess 500 fi 501 510 if test "$?" -eq 0; then 511 success " - Unloaded: Zone access service" 512 else 513 warnprint " - Unloading: Zone access service ...ERROR(S)." 514 fi 515 fi 516 502 517 # unplumb vboxnet0 503 518 vboxnetup=`$BIN_IFCONFIG vboxnet0 >/dev/null 2>&1` … … 514 529 515 530 516 # post _install()517 # !! failure is always fatal 518 post _install()531 # postinstall() 532 # !! failure is always fatal 533 postinstall() 519 534 { 520 535 infoprint "Loading VirtualBox kernel modules..." … … 522 537 523 538 if test "$?" -eq 0; then 524 if test -f /platform/i86pc/kernel/drv/vboxnet.conf; then 539 if test -f /platform/i86pc/kernel/drv/vboxnet.conf; then 525 540 # nwam/dhcpagent fix 526 541 nwamfile=/etc/nwam/llp … … 537 552 $BIN_IFCONFIG vboxnet0 192.168.56.1 netmask 255.255.255.0 up 538 553 else 554 # Should this be fatal? 539 555 warnprint "Failed to bring up vboxnet0!!" 540 556 fi … … 549 565 /usr/sbin/svccfg import /var/svc/manifest/application/virtualbox/virtualbox-webservice.xml 550 566 /usr/sbin/svcadm disable -s svc:/application/virtualbox/webservice:default 567 if test "$?" -eq 0; then 568 success " - Loaded: Web service" 569 else 570 warnprint " - Loading: Web service ...ERROR(S)." 571 fi 551 572 fi 552 573 … … 555 576 /usr/sbin/svccfg import /var/svc/manifest/application/virtualbox/virtualbox-zoneaccess.xml 556 577 /usr/sbin/svcadm enable -s svc:/application/virtualbox/zoneaccess 578 if test "$?" -eq 0; then 579 success " - Loaded: Zone access service" 580 else 581 warnprint " - Loading: Zone access service ...ERROR(S)." 582 fi 557 583 fi 558 584 … … 576 602 PYTHONBIN=`which python2.6 2>/dev/null` 577 603 install_python_bindings "$PYTHONBIN" 578 if test "$?" -eq 0; then 604 if test "$?" -eq 0; then 579 605 INSTALLEDIT=0 580 606 fi … … 585 611 if test "$INSTALLEDIT" -ne 0; then 586 612 warnprint "No suitable Python version found. Required Python 2.4, 2.5 or 2.6." 613 warnprint "Skipped installing the Python bindings." 587 614 fi 588 615 else … … 603 630 } 604 631 605 606 # pre_remove([fatal]) 632 # preremove([fatal]) 607 633 # failure: depends on [fatal] 608 pre _remove()634 preremove() 609 635 { 610 636 fatal=$1 … … 636 662 637 663 case "$drvop" in 638 post _install)664 postinstall) 639 665 check_module_arch 640 post _install666 postinstall 641 667 ;; 642 pre _remove)643 pre _remove "$fatal"668 preremove) 669 preremove "$fatal" 644 670 ;; 645 671 install_drivers) … … 651 677 ;; 652 678 *) 653 echo "Usage: $0 post _install|pre_remove|install_drivers|remove_drivers [fatal]"679 echo "Usage: $0 postinstall|preremove|install_drivers|remove_drivers [fatal] [silent]" 654 680 exit 1 655 681 esac
Note:
See TracChangeset
for help on using the changeset viewer.