Changeset 37789 in vbox
- Timestamp:
- Jul 6, 2011 9:09:09 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/solaris/vboxconfig.sh
r37787 r37789 71 71 DESC_VBOXUSB="USB" 72 72 73 UPDATEBOOTARCHIVE=0 73 74 REMOTEINST=0 74 75 FATALOP=fatal … … 227 228 if test "$REMOTEINST" -eq 1 || test -z "$HOST_OS_MINORVERSION" || test -z "$HOST_OS_MAJORVERSION"; then 228 229 if test -f "$PKG_INSTALL_ROOT/etc/release"; then 229 HOST_OS_MAJORVERSION=`cat $PKG_INSTALL_ROOT/etc/release| grep "Solaris 10"`230 HOST_OS_MAJORVERSION=`cat "$PKG_INSTALL_ROOT/etc/release" | grep "Solaris 10"` 230 231 if test -n "$HOST_OS_MAJORVERSION"; then 231 232 HOST_OS_MAJORVERSION="5.10" 232 233 else 233 HOST_OS_MAJORVERSION=`cat $PKG_INSTALL_ROOT/etc/release| egrep "snv_|oi_"`234 HOST_OS_MAJORVERSION=`cat "$PKG_INSTALL_ROOT/etc/release" | egrep "snv_|oi_"` 234 235 if test -n "$HOST_OS_MAJORVERSION"; then 235 236 HOST_OS_MAJORVERSION="5.11" … … 237 238 fi 238 239 if test "$HOST_OS_MAJORVERSION" != "5.10"; then 239 HOST_OS_MINORVERSION=`cat $PKG_INSTALL_ROOT/etc/release| tr ' ' '\n' | egrep 'snv_|oi_' | sed -e "s/snv_//" -e "s/oi_//" -e "s/[^0-9]//"`240 HOST_OS_MINORVERSION=`cat "$PKG_INSTALL_ROOT/etc/release" | tr ' ' '\n' | egrep 'snv_|oi_' | sed -e "s/snv_//" -e "s/oi_//" -e "s/[^0-9]//"` 240 241 else 241 242 HOST_OS_MINORVERSION="" … … 281 282 } 282 283 284 # update_boot_archive() 285 # cannot fail 286 update_boot_archive() 287 { 288 infoprint "Updating the boot archive..." 289 if test "$REMOTEINST" -eq 0; then 290 $BIN_BOOTADM update-archive > /dev/null 291 else 292 $BIN_BOOTADM update-archive -R "$PKG_INSTALL_ROOT" > /dev/null 293 fi 294 UPDATEBOOTARCHIVE=0 295 } 296 297 283 298 # module_added(modname) 284 299 # returns 1 if added, 0 otherwise … … 292 307 # Add a space at end of module name to make sure we have a perfect match to avoid 293 308 # any substring matches: e.g "vboxusb" & "vboxusbmon" 294 loadentry=`cat $PKG_INSTALL_ROOT/etc/name_to_major| grep "$1 "`309 loadentry=`cat "$PKG_INSTALL_ROOT/etc/name_to_major" | grep "$1 "` 295 310 if test -z "$loadentry"; then 296 311 return 1 … … 373 388 module_added $modname 374 389 if test "$?" -eq 0; then 390 UPDATEBOOTARCHIVE=1 375 391 if test "$ISIPS" != "$IPSOP"; then 376 392 $BIN_REMDRV $BASEDIR_OPT $modname … … 496 512 # Add vboxdrv to devlink.tab 497 513 if test -f "$PKG_INSTALL_ROOT/etc/devlink.tab"; then 498 sed -e '/name=vboxdrv/d' $PKG_INSTALL_ROOT/etc/devlink.tab > $PKG_INSTALL_ROOT/etc/devlink.vbox499 echo "type=ddi_pseudo;name=vboxdrv \D" >> $PKG_INSTALL_ROOT/etc/devlink.vbox500 mv -f $PKG_INSTALL_ROOT/etc/devlink.vbox $PKG_INSTALL_ROOT/etc/devlink.tab514 sed -e '/name=vboxdrv/d' "$PKG_INSTALL_ROOT/etc/devlink.tab" > "$PKG_INSTALL_ROOT/etc/devlink.vbox" 515 echo "type=ddi_pseudo;name=vboxdrv \D" >> "$PKG_INSTALL_ROOT/etc/devlink.vbox" 516 mv -f "$PKG_INSTALL_ROOT/etc/devlink.vbox" "$PKG_INSTALL_ROOT/etc/devlink.tab" 501 517 else 502 518 errorprint "Missing $PKG_INSTALL_ROOT/etc/devlink.tab, aborting install" … … 550 566 551 567 # Add vboxusbmon to devlink.tab 552 sed -e '/name=vboxusbmon/d' $PKG_INSTALL_ROOT/etc/devlink.tab > $PKG_INSTALL_ROOT/etc/devlink.vbox553 echo "type=ddi_pseudo;name=vboxusbmon \D" >> $PKG_INSTALL_ROOT/etc/devlink.vbox554 mv -f $PKG_INSTALL_ROOT/etc/devlink.vbox $PKG_INSTALL_ROOT/etc/devlink.tab568 sed -e '/name=vboxusbmon/d' "$PKG_INSTALL_ROOT/etc/devlink.tab" > "$PKG_INSTALL_ROOT/etc/devlink.vbox" 569 echo "type=ddi_pseudo;name=vboxusbmon \D" >> "$PKG_INSTALL_ROOT/etc/devlink.vbox" 570 mv -f "$PKG_INSTALL_ROOT/etc/devlink.vbox" "$PKG_INSTALL_ROOT/etc/devlink.tab" 555 571 556 572 # Create the device link for non-remote installs … … 590 606 591 607 # Remove vboxdrv from devlink.tab 592 if test -f $PKG_INSTALL_ROOT/etc/devlink.tab; then593 devlinkfound=`cat $PKG_INSTALL_ROOT/etc/devlink.tab| grep vboxdrv`608 if test -f "$PKG_INSTALL_ROOT/etc/devlink.tab"; then 609 devlinkfound=`cat "$PKG_INSTALL_ROOT/etc/devlink.tab" | grep vboxdrv` 594 610 if test -n "$devlinkfound"; then 595 sed -e '/name=vboxdrv/d' $PKG_INSTALL_ROOT/etc/devlink.tab > $PKG_INSTALL_ROOT/etc/devlink.vbox596 mv -f $PKG_INSTALL_ROOT/etc/devlink.vbox $PKG_INSTALL_ROOT/etc/devlink.tab611 sed -e '/name=vboxdrv/d' "$PKG_INSTALL_ROOT/etc/devlink.tab" > "$PKG_INSTALL_ROOT/etc/devlink.vbox" 612 mv -f "$PKG_INSTALL_ROOT/etc/devlink.vbox" "$PKG_INSTALL_ROOT/etc/devlink.tab" 597 613 fi 598 614 599 615 # Remove vboxusbmon from devlink.tab 600 devlinkfound=`cat $PKG_INSTALL_ROOT/etc/devlink.tab| grep vboxusbmon`616 devlinkfound=`cat "$PKG_INSTALL_ROOT/etc/devlink.tab" | grep vboxusbmon` 601 617 if test -n "$devlinkfound"; then 602 sed -e '/name=vboxusbmon/d' $PKG_INSTALL_ROOT/etc/devlink.tab > $PKG_INSTALL_ROOT/etc/devlink.vbox603 mv -f $PKG_INSTALL_ROOT/etc/devlink.vbox $PKG_INSTALL_ROOT/etc/devlink.tab618 sed -e '/name=vboxusbmon/d' "$PKG_INSTALL_ROOT/etc/devlink.tab" > "$PKG_INSTALL_ROOT/etc/devlink.vbox" 619 mv -f "$PKG_INSTALL_ROOT/etc/devlink.vbox" "$PKG_INSTALL_ROOT/etc/devlink.tab" 604 620 fi 605 621 fi … … 628 644 # remove devlinks 629 645 if test -h "$PKG_INSTALL_ROOT/dev/vboxdrv" || test -f "$PKG_INSTALL_ROOT/dev/vboxdrv"; then 630 rm -f $PKG_INSTALL_ROOT/dev/vboxdrv646 rm -f "$PKG_INSTALL_ROOT/dev/vboxdrv" 631 647 fi 632 648 if test -h "$PKG_INSTALL_ROOT/dev/vboxusbmon" || test -f "$PKG_INSTALL_ROOT/dev/vboxusbmon"; then 633 rm -f $PKG_INSTALL_ROOT/dev/vboxusbmon649 rm -f "$PKG_INSTALL_ROOT/dev/vboxusbmon" 634 650 fi 635 651 636 652 # unpatch nwam/dhcpagent fix 637 nwamfile= $PKG_INSTALL_ROOT/etc/nwam/llp653 nwamfile="$PKG_INSTALL_ROOT/etc/nwam/llp" 638 654 nwambackupfile=$nwamfile.vbox 639 655 if test -f "$nwamfile"; then … … 643 659 644 660 # remove netmask configuration 645 nmaskfile=$PKG_INSTALL_ROOT/etc/inet/netmasks 661 if test -h "$PKG_INSTALL_ROOT/etc/netmasks"; then 662 nmaskfile="$PKG_INSTALL_ROOT/etc/inet/netmasks" 663 else 664 nmaskfile="$PKG_INSTALL_ROOT/etc/netmasks" 665 fi 646 666 nmaskbackupfile=$nmaskfile.vbox 647 667 if test -f "$nmaskfile"; then 648 668 sed -e '/#VirtualBox_SectionStart/,/#VirtualBox_SectionEnd/d' $nmaskfile > $nmaskbackupfile 649 669 mv -f $nmaskbackupfile $nmaskfile 670 fi 671 672 if test $UPDATEBOOTARCHIVE -eq 1; then 673 update_boot_archive 650 674 fi 651 675 … … 794 818 if test -f "$DIR_CONF/vboxnet.conf"; then 795 819 # nwam/dhcpagent fix 796 nwamfile= $PKG_INSTALL_ROOT/etc/nwam/llp820 nwamfile="$PKG_INSTALL_ROOT/etc/nwam/llp" 797 821 nwambackupfile=$nwamfile.vbox 798 822 if test -f "$nwamfile"; then … … 820 844 # a copy of the actual file, repair that behaviour here. 821 845 recreatelink=0 822 if test -h $PKG_INSTALL_ROOT/etc/netmasks; then823 nmaskfile= $PKG_INSTALL_ROOT/etc/inet/netmasks846 if test -h "$PKG_INSTALL_ROOT/etc/netmasks"; then 847 nmaskfile="$PKG_INSTALL_ROOT/etc/inet/netmasks" 824 848 else 825 nmaskfile= $PKG_INSTALL_ROOT/etc/netmasks849 nmaskfile="$PKG_INSTALL_ROOT/etc/netmasks" 826 850 recreatelink=1 827 851 fi … … 831 855 if test -f $nmaskfile; then 832 856 sed -e '/#VirtualBox_SectionStart/,/#VirtualBox_SectionEnd/d' $nmaskfile > $nmaskbackupfile 857 858 if test $recreatelink -eq 1; then 859 # Check after removing our settings if /etc/netmasks is identifcal to /etc/inet/netmasks 860 anydiff=`diff $nmaskbackupfile "$PKG_INSTALL_ROOT/etc/inet/netmasks"` 861 if test ! -z $anydiff; then 862 # User may have some custom settings in /etc/netmasks, don't overwrite /etc/netmasks! 863 recreatelink=2 864 fi 865 fi 866 833 867 echo "#VirtualBox_SectionStart" >> $nmaskbackupfile 834 868 inst=0 … … 844 878 # Recreate /etc/netmasks as a link if necessary 845 879 if test $recreatelink -eq 1; then 846 cp -f $PKG_INSTALL_ROOT/etc/netmasks $PKG_INSTALL_ROOT/etc/inet/netmasks 847 ln -sf ./inet/netmasks $PKG_INSTALL_ROOT/etc/netmasks 880 rm -f "$PKG_INSTALL_ROOT/etc/netmasks" 881 ln -sf ./inet/netmasks "$PKG_INSTALL_ROOT/etc/netmasks" 882 elif test $recreatelink -eq 2; then 883 warnprint "/etc/netmasks is a symlink (to /etc/inet/netmasks) that older" 884 warnprint "VirtualBox installers incorrectly overwrote. Now the contents" 885 warnprint "of /etc/netmasks and /etc/inet/netmasks differ, therefore " 886 warnprint "VirtualBox will not attempt to overwrite /etc/netmasks as a" 887 warnprint "symlink to /etc/inet/netmasks. Please resolve this manually." 848 888 fi 849 889 fi … … 855 895 fi 856 896 857 if test -f $PKG_INSTALL_ROOT/var/svc/manifest/application/virtualbox/virtualbox-webservice.xml || test -f $PKG_INSTALL_ROOT/var/svc/manifest/application/virtualbox/virtualbox-zoneaccess.xml; then897 if test -f "$PKG_INSTALL_ROOT/var/svc/manifest/application/virtualbox/virtualbox-webservice.xml" || test -f "$PKG_INSTALL_ROOT/var/svc/manifest/application/virtualbox/virtualbox-zoneaccess.xml"; then 858 898 infoprint "Configuring services..." 859 899 if test "$REMOTEINST" -eq 1; then … … 876 916 # and icons. There is still some delay until the GUI picks it up, 877 917 # but that cannot be helped. 878 if test -d $PKG_INSTALL_ROOT/usr/share/icons; then918 if test -d "$PKG_INSTALL_ROOT/usr/share/icons"; then 879 919 infoprint "Installing MIME types and icons..." 880 920 if test "$REMOTEINST" -eq 0; then … … 925 965 fi 926 966 927 # Update boot archive 928 infoprint "Updating the boot archive..." 929 if test "$REMOTEINST" -eq 0; then 930 $BIN_BOOTADM update-archive > /dev/null 931 else 932 $BIN_BOOTADM update-archive -R $PKG_INSTALL_ROOT > /dev/null 933 fi 934 967 update_boot_archive 968 935 969 return 0 936 970 else
Note:
See TracChangeset
for help on using the changeset viewer.