- Timestamp:
- Aug 20, 2009 12:45:58 PM (15 years ago)
- Location:
- trunk/src/VBox/Installer/solaris
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/solaris/ipsinstall.sh
r22003 r22368 1 1 #!/bin/sh 2 2 ## @file 3 # Sun VirtualBox - Manual IPS/pkg(5)postinstall script for Solaris.3 # Sun VirtualBox - VirtualBox postinstall script for Solaris. 4 4 # 5 5 # If you just installed VirtualBox using IPS/pkg(5), you should run this … … 23 23 # 24 24 25 check_root() 26 { 27 idbin=/usr/xpg4/bin/id 28 if test ! -f "$idbin"; then 29 found=`which id` 30 if test ! -f "$found" || test ! -h "$found"; then 31 echo "## Failed to find a suitable user id binary." 32 exit 1 33 else 34 idbin=$found 25 if test "$1" != "--srv4"; then 26 # IPS package 27 echo "Checking for older & partially installed bits..." 28 ISIPS="--ips" 29 else 30 # SRv4 package 31 echo "Checking for older bits..." 32 ISIPS="" 33 fi 34 35 /opt/VirtualBox/vboxconfig.sh --preremove --fatal "$ISIPS" 36 37 if test "$?" -eq 0; then 38 echo "Installing new ones..." 39 /opt/VirtualBox/vboxconfig.sh --postinstall 40 rc=$? 41 if test "$rc" -ne 0; then 42 echo "Completed but with errors." 43 rc=20 44 else 45 if test "$1" != "--srv4"; then 46 echo "Post installation completed successfully!" 35 47 fi 36 48 fi 37 38 if test `$idbin -u` -ne 0; then 39 echo "## This script must be run with administrator privileges." 40 exit 2 41 fi 42 } 43 44 check_zone() 45 { 46 currentzone=`zonename` 47 if test "$currentzone" != "global"; then 48 echo "## This script must be run from the global zone." 49 exit 3 50 fi 51 } 52 53 install_python_bindings() 54 { 55 PYTHONBIN=$1 56 if test -x "$PYTHONBIN"; then 57 VBOX_INSTALL_PATH=/opt/VirtualBox 58 export VBOX_INSTALL_PATH 59 cd /opt/VirtualBox/sdk/installer 60 $PYTHONBIN ./vboxapisetup.py install > /dev/null 61 return 0 62 fi 63 return 1 64 } 65 66 check_root 67 check_zone 68 69 osversion=`uname -r` 70 71 BIN_REMDRV=/usr/sbin/rem_drv 72 BIN_ADDDRV=/usr/sbin/add_drv 73 BIN_MODLOAD=/usr/sbin/modload 74 BIN_DEVFSADM=/usr/sbin/devfsadm 75 76 # Halt services in case of installation update 77 zoneaccessfound=`svcs -a | grep "virtualbox/zoneaccess"` 78 if test ! -z "$zoneaccessfound"; then 79 /usr/sbin/svcadm disable -s svc:/application/virtualbox/zoneaccess 49 else 50 echo "## ERROR!! Failed to remove older/partially installed bits." 51 rc=1 80 52 fi 81 53 82 # Remove drivers ignoring errors as they are not really loaded 83 # just updated various boot archive files without really loading 84 # them... But we _want_ them to be loaded. 85 echo "Removing stale driver configurations..." 54 exit "$rc" 86 55 87 $BIN_REMDRV vboxflt > /dev/null 2>&188 /sbin/ifconfig vboxnet0 unplumb > /dev/null 2>&189 $BIN_REMDRV vboxnet > /dev/null 2>&190 $BIN_REMDRV vboxusbmon > /dev/null 2>&191 $BIN_REMDRV vboxdrv > /dev/null 2>&192 93 echo "Loading VirtualBox Drivers:"94 # Add drivers the proper way and load them immediately95 /opt/VirtualBox/vboxdrv.sh start96 rc=$?97 if test "$rc" -eq 0; then98 # Add vboxdrv to the devlink.tab99 sed -e '/name=vboxdrv/d' /etc/devlink.tab > /etc/devlink.vbox100 echo "type=ddi_pseudo;name=vboxdrv \D" >> /etc/devlink.vbox101 mv -f /etc/devlink.vbox /etc/devlink.tab102 103 # Create the device link104 /usr/sbin/devfsadm -i vboxdrv105 rc=$?106 107 if test "$rc" -eq 0; then108 # Load VBoxNetAdapter vboxnet109 if test -f /platform/i86pc/kernel/drv/vboxnet.conf; then110 /opt/VirtualBox/vboxdrv.sh netstart111 rc=$?112 113 if test "$rc" -eq 0; then114 # nwam/dhcpagent fix115 nwamfile=/etc/nwam/llp116 nwambackupfile=$nwamfile.vbox117 if test -f "$nwamfile"; then118 sed -e '/vboxnet/d' $nwamfile > $nwambackupfile119 echo "vboxnet0 static 192.168.56.1" >> $nwambackupfile120 mv -f $nwambackupfile $nwamfile121 echo " -> patched /etc/nwam/llp to use static IP for vboxnet0"122 fi123 fi124 fi125 else126 echo "## Failed to create device link in /dev for vboxdrv"127 fi128 129 # Load VBoxNetFilter vboxflt130 if test "$rc" -eq 0 && test -f /platform/i86pc/kernel/drv/vboxflt.conf; then131 /opt/VirtualBox/vboxdrv.sh fltstart132 rc=$?133 fi134 135 # Load VBoxUSBMonitor vboxusbmon (do NOT load for Solaris 10)136 if test "$rc" -eq 0 && test -f /platform/i86pc/kernel/drv/vboxusbmon.conf && test "$osversion" != "5.10"; then137 /opt/VirtualBox/vboxdrv.sh usbstart138 rc=$?139 if test "$rc" -eq 0; then140 141 # Add vboxusbmon to the devlink.tab142 sed -e '/name=vboxusbmon/d' /etc/devlink.tab > /etc/devlink.vbox143 echo "type=ddi_pseudo;name=vboxusbmon \D" >> /etc/devlink.vbox144 mv -f /etc/devlink.vbox /etc/devlink.tab145 146 /usr/sbin/devfsadm -i vboxusbmon147 rc=$?148 if test "$rc" -ne 0; then149 echo "## Failed to create device link in /dev for vboxusbmon"150 fi151 fi152 fi153 fi154 155 rc2=0156 if test -f "/var/svc/manifest/application/virtualbox/virtualbox-zoneaccess.xml"; then157 /usr/sbin/svccfg import /var/svc/manifest/application/virtualbox/virtualbox-zoneaccess.xml158 rc2=$?159 if test "$rc2" -eq 0; then160 /usr/sbin/svcadm enable -s svc:/application/virtualbox/zoneaccess161 rc2=$?162 if test "$rc2" -eq 0; then163 echo "Enabled VirtualBox zone service."164 else165 echo "## Failed to enable VirtualBox zone service."166 fi167 else168 echo "## Failed to import VirtualBox zone service."169 fi170 fi171 172 # We need to touch the desktop link in order to add it to the menu right away173 if test -f "/usr/share/applications/virtualbox.desktop"; then174 touch /usr/share/applications/virtualbox.desktop175 echo "Added VirtualBox shortcut menu item."176 fi177 178 # Install python bindings179 rc3=0180 if test -f "/opt/VirtualBox/sdk/installer/vboxapisetup.py" || test -h "/opt/VirtualBox/sdk/installer/vboxapisetup.py"; then181 PYTHONBIN=`which python 2>/dev/null`182 if test -f "$PYTHONBIN" || test -h "$PYTHONBIN"; then183 echo "Installing Python bindings..."184 185 INSTALLEDIT=1186 PYTHONBIN=`which python2.4 2>/dev/null`187 install_python_bindings "$PYTHONBIN"188 if test "$?" -eq 0; then189 INSTALLEDIT=0190 fi191 PYTHONBIN=`which python2.5 2>/dev/null`192 install_python_bindings "$PYTHONBIN"193 if test "$?" -eq 0; then194 INSTALLEDIT=0195 fi196 PYTHONBIN=`which python2.6 2>/dev/null`197 install_python_bindings "$PYTHONBIN"198 if test "$?" -eq 0; then199 INSTALLEDIT=0200 fi201 202 # remove files installed by Python build203 rm -rf /opt/VirtualBox/sdk/installer/build204 205 if test "$INSTALLEDIT" -ne 0; then206 echo "** No suitable Python version found. Requires Python 2.4, 2.5 or 2.6."207 fi208 rc3=$INSTALLEDIT209 else210 echo "** WARNING! Python not found, skipped installed Python bindings."211 echo " Manually run '/opt/VirtualBox/sdk/installer/vboxapisetup.py install'"212 echo " to install the bindings when python is available."213 rc3=1214 fi215 fi216 217 # Update boot archive (only when driver's were all successfully loaded)218 rc4=0219 if test "$rc" -eq 0; then220 BOOTADMBIN=/sbin/bootadm221 if test -f "$BOOTADMBIN" || test -h "$BOOTADMBIN"; then222 echo "Updating boot archive..."223 $BOOTADMBIN update-archive > /dev/null224 rc4=$?225 fi226 fi227 228 echo "Done."229 if test "$rc" -eq 0 && test "$rc2" -eq 0 && test "$rc3" -eq 0 && test "$rc4" -eq 0; then230 echo "Post install successfully completed."231 else232 echo "Post install completed but with some errors."233 # 20 - partially failed installed234 $rc=20235 fi236 exit $rc237 -
trunk/src/VBox/Installer/solaris/postinstall.sh
r22123 r22368 21 21 # 22 22 23 # Check for xVM/Xen24 currentisa=`uname -i`25 if test "$currentisa" = "i86xpv"; then26 echo "## VirtualBox cannot run under xVM Dom0! Fatal Error, Aborting installation!"27 exit 128 fi29 30 23 currentzone=`zonename` 31 24 if test "$currentzone" = "global"; then 32 echo "Checking for older bits..." 33 /opt/VirtualBox/vboxconfig.sh preremove fatal 25 /opt/VirtualBox/ipsinstall.sh --srv4 34 26 rc=$? 35 if test "$rc" -eq 0; then36 echo "Installing new ones..."37 /opt/VirtualBox/vboxconfig.sh postinstall38 fi39 rc=$?40 if test "$rc" -ne 0; then41 echo "Completed but with errors."42 rc=2043 fi44 27 fi 45 28 -
trunk/src/VBox/Installer/solaris/vboxconfig.sh
r22350 r22368 59 59 FATALOP=fatal 60 60 SILENTOP=silent 61 IPSOP=ips 61 62 ISSILENT= 63 ISIPS= 62 64 63 65 infoprint() … … 263 265 module_added $modname 264 266 if test "$?" -eq 0; then 265 $BIN_REMDRV $modname 267 if test "$ISIPS" != "$IPSOP"; then 268 $BIN_REMDRV $modname 269 else 270 $BIN_REMDRV $modname >/dev/null 2>&1 271 fi 266 272 if test $? -eq 0; then 267 273 subprint "Removed: $moddesc module" … … 444 450 install_python_bindings() 445 451 { 446 if test -z "$1" || test -z "$2"; then 452 # The python binary might not be there, so just exit silently 453 if test -z "$1"; then 454 return 0 455 fi 456 457 if test -z "$2"; then 447 458 errorprint "missing argument to install_python_bindings" 448 459 exit 1 … … 645 656 find_bins 646 657 647 drvop=$1 648 if test "$2" = "$FATALOP" || test "$3" = "$FATALOP"; then 649 fatal=$FATALOP 650 fi 651 if test "$2" = "$SILENTOP" || test "$3" = "$SILENTOP"; then 652 ISSILENT=$SILENTOP 653 fi 658 # Get command line options 659 while test $# -gt 0; 660 do 661 case "$1" in 662 --postinstall | --preremove | --installdrivers | --removedrivers) 663 drvop="$1" 664 ;; 665 --fatal) 666 fatal="$FATALOP" 667 ;; 668 --silent) 669 ISSILENT="$SILENTOP" 670 ;; 671 --ips) 672 ISIPS="$IPSOP" 673 ;; 674 *) 675 errorprint "Invalid arguments" 676 exit 1 677 break 678 ;; 679 esac 680 shift 681 done 654 682 655 683 case "$drvop" in 656 postinstall)684 --postinstall) 657 685 check_module_arch 658 686 postinstall 659 687 ;; 660 preremove)688 --preremove) 661 689 preremove "$fatal" 662 690 ;; 663 install_drivers)691 --installdrivers) 664 692 check_module_arch 665 693 install_drivers 666 694 ;; 667 remove_drivers)695 --removedrivers) 668 696 remove_drivers "$fatal" 669 697 ;; 670 698 *) 671 e cho "Usage: $0 postinstall|preremove|install_drivers|remove_drivers [fatal] [silent]"699 errorprint "Invalid operation $drvop" 672 700 exit 1 673 701 esac
Note:
See TracChangeset
for help on using the changeset viewer.