VirtualBox

Changeset 30667 in vbox for trunk/src/VBox/Installer/solaris


Ignore:
Timestamp:
Jul 6, 2010 1:18:28 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
63426
Message:

Solaris/Installer: Support remote installations. Adds better support to determine OS minor version for non-conventional versions found in uname.

Location:
trunk/src/VBox/Installer/solaris
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/solaris/checkinstall.sh

    r28800 r30667  
    2323}
    2424
     25# nothing to check for targetted install
     26if test "x${BASEDIR}" != "x/"; then
     27    exit 0
     28fi
    2529
    2630# Check if VBoxSVC is currently running
     
    3741    echo "## Halting & removing zone access service..."
    3842    /usr/sbin/svcadm disable -s svc:/application/virtualbox/zoneaccess
    39     /usr/sbin/svccfg delete svc:/application/virtualbox/zoneaccess
     43    # Don't delete the service, handled by manifest class action
     44    # /usr/sbin/svccfg delete svc:/application/virtualbox/zoneaccess
    4045fi
    4146
     
    4651    echo "## Halting & removing webservice..."
    4752    /usr/sbin/svcadm disable -s svc:/application/virtualbox/webservice
    48     /usr/sbin/svccfg delete svc:/application/virtualbox/webservice
     53    # Don't delete the service, handled by manifest class action
     54    # /usr/sbin/svccfg delete svc:/application/virtualbox/webservice
    4955fi
    5056
  • trunk/src/VBox/Installer/solaris/makepackage.sh

    r30099 r30667  
    7979}
    8080
     81dirlist_fixup()
     82{
     83  "$VBOX_AWK" 'NF == 6 && $1 == "d" && '"$2"' { '"$3"' } { print }' "$1" > "tmp-$1"
     84  mv -f "tmp-$1" "$1"
     85}
     86
    8187hardlink_fixup()
    8288{
     
    132138find . ! -type d | $VBOX_GGREP -v -E 'prototype|makepackage.sh|vbox.pkginfo|postinstall.sh|checkinstall.sh|preremove.sh|ReadMe.txt|vbox.space|vbox.depend|vbox.copyright|VirtualBoxKern' | pkgproto >> prototype
    133139
    134 # Include only opt/VirtualBox and subdirectories as we want uninstall to clean up directory structure as well
    135 find . -type d | $VBOX_GGREP -E 'opt/VirtualBox' | pkgproto >> prototype
     140# Include opt/VirtualBox and subdirectories as we want uninstall to clean up directory structure.
     141# Include usr/bin, because remote installs with symlinks when usr/bin/ doesn't need not fail.
     142# Inlcude var/svc for manifest class action script does not create them.
     143find . -type d | $VBOX_GGREP -E 'opt/VirtualBox|usr/bin|var/svc/manifest/application/virtualbox' | pkgproto >> prototype
    136144
    137145# fix up file permissions (owner/group)
     
    166174filelist_fixup prototype '$3 == "platform/i86pc/kernel/drv/vboxusb"'                                   '$6 = "sys"'
    167175filelist_fixup prototype '$3 == "platform/i86pc/kernel/drv/amd64/vboxusb"'                             '$6 = "sys"'
     176
     177# Manifest class action scripts
     178filelist_fixup prototype '$3 == "var/svc/manifest/application/virtualbox/virtualbox-webservice.xml"'    '$2 = "manifest";$6 = "sys"'
     179filelist_fixup prototype '$3 == "var/svc/manifest/application/virtualbox/virtualbox-zoneaccess.xml"'    '$2 = "manifest";$6 = "sys"'
     180dirlist_fixup prototype      '$3 == "var/svc/manifest/application/virtualbox"'                              '$6 = "sys"'
    168181
    169182# hardening requires some executables to be marked setuid.
  • trunk/src/VBox/Installer/solaris/pkginstall.sh

    r28800 r30667  
    2929fi
    3030
    31 /opt/VirtualBox/vboxconfig.sh --preremove --fatal "$ISIPS"
     31${BASEDIR}/opt/VirtualBox/vboxconfig.sh --preremove --fatal "$ISIPS"
    3232
    3333if test "$?" -eq 0; then
    3434    echo "Installing new ones..."
    35     /opt/VirtualBox/vboxconfig.sh --postinstall
     35    ${BASEDIR}/opt/VirtualBox/vboxconfig.sh --postinstall
    3636    rc=$?
    3737    if test "$rc" -ne 0; then
  • trunk/src/VBox/Installer/solaris/postinstall.sh

    r28800 r30667  
    1919currentzone=`zonename`
    2020if test "$currentzone" = "global"; then
    21     /opt/VirtualBox/pkginstall.sh --srv4
     21    ${BASEDIR}/opt/VirtualBox/pkginstall.sh --srv4
    2222    rc=$?
    2323fi
    2424
     25# installf inherits ${PKG_INSTALL_ROOT} from pkgadd, no need to explicitly specify
    2526/usr/sbin/installf -f $PKGINST
    2627
  • trunk/src/VBox/Installer/solaris/preremove.sh

    r28800 r30667  
    1717if test "$currentzone" = "global"; then
    1818    echo "Removing VirtualBox services and drivers..."
    19     /opt/VirtualBox/vboxconfig.sh --preremove
     19    ${BASEDIR}/opt/VirtualBox/vboxconfig.sh --preremove
    2020    if test "$?" -eq 0; then
    2121        echo "Done."
  • trunk/src/VBox/Installer/solaris/vbox.pkginfo

    r26538 r30667  
    1212MAXINST=1
    1313EMAIL="[email protected]"
    14 CLASSES=none sed
     14CLASSES=none manifest
    1515DESC="A powerful PC virtualization solution"
    1616
  • trunk/src/VBox/Installer/solaris/vboxconfig.sh

    r28800 r30667  
    1616#
    1717
    18 
    1918# Never use exit 2 or exit 20 etc., the return codes are used in
    2019# SRv4 postinstall procedures which carry special meaning. Just use exit 1 for failure.
     
    2322HOST_OS_MAJORVERSION=`uname -r`
    2423# Which OpenSolaris version (snv_xxx)?
    25 HOST_OS_MINORVERSION=`uname -v | sed -e "s/snv_//" -e "s/[^0-9]//"`
    26 
    27 DIR_VBOXBASE=/opt/VirtualBox
    28 DIR_CONF="/platform/i86pc/kernel/drv"
    29 DIR_MOD_32="/platform/i86pc/kernel/drv"
     24HOST_OS_MINORVERSION=`uname -v | grep 'snv' | sed -e "s/snv_//" -e "s/[^0-9]//"`
     25
     26DIR_VBOXBASE=${BASEDIR}/opt/VirtualBox
     27DIR_CONF="${BASEDIR}/platform/i86pc/kernel/drv"
     28DIR_MOD_32="${BASEDIR}/platform/i86pc/kernel/drv"
    3029DIR_MOD_64=$DIR_MOD_32/amd64
    3130
     
    6362DESC_VBOXUSB="USB"
    6463
     64REMOTEINST=0
    6565FATALOP=fatal
    6666NULLOP=nulloutput
     
    149149}
    150150
     151# get_sysinfo
     152# cannot fail
     153get_sysinfo()
     154{
     155    if test "$REMOTEINST" -eq 1 || test -z "$HOST_OS_MINORVERSION" || test -z "$HOST_OS_MAJORVERSION"; then
     156        if test -f "${BASEDIR}/etc/release"; then
     157            HOST_OS_MAJORVERSION=`cat ${BASEDIR}/etc/release | grep "Solaris 10"`
     158            if test -n "$HOST_OS_MAJORVERSION"; then
     159                HOST_OS_MAJORVERSION="5.10"
     160            else
     161                HOST_OS_MAJORVERSION=`cat ${BASEDIR}/etc/release | grep "snv_"`
     162                if test -n "$HOST_OS_MAJORVERSION"; then
     163                    HOST_OS_MAJORVERSION="5.11"
     164                fi
     165            fi
     166            if test "$HOST_OS_MAJORVERSION" != "5.10"; then
     167                HOST_OS_MINORVERSION=`cat ${BASEDIR}/etc/release | tr ' ' '\n' | grep 'snv_' | sed -e "s/snv_//" -e "s/[^0-9]//"`
     168            else
     169                HOST_OS_MINORVERSION=""
     170            fi
     171        else
     172            HOST_OS_MAJORVERSION=""
     173            HOST_OS_MINORVERSION=""
     174        fi
     175    fi
     176}
     177
    151178# check_zone()
    152179# !! failure is always fatal
     
    192219
    193220    # Add a space at end of module name to make sure we have a perfect match to avoid
    194     # any substring matches: e.g "vboxusb" & "vboxusbmon"
    195     loadentry=`cat /etc/name_to_major | grep "$1 "`
     221    # any substring matches: e.g "vboxusb" & "vbo $BASEDIR_OPT xusbmon"
     222    loadentry=`cat ${BASEDIR}/etc/name_to_major | grep "$1 "`
    196223    if test -z "$loadentry"; then
    197224        return 1
     
    235262    if test -n "$modperm"; then
    236263        if test "$nullop" = "$NULLOP"; then
    237             $BIN_ADDDRV -m"$modperm" $modname  >/dev/null 2>&1
    238         else
    239             $BIN_ADDDRV -m"$modperm" $modname
     264            $BIN_ADDDRV $BASEDIR_OPT -m"$modperm" $modname  >/dev/null 2>&1
     265        else
     266            $BIN_ADDDRV $BASEDIR_OPT -m"$modperm" $modname
    240267        fi
    241268    else
    242269        if test "$nullop" = "$NULLOP"; then
    243             $BIN_ADDDRV $modname >/dev/null 2>&1
    244         else
    245             $BIN_ADDDRV $modname
     270            $BIN_ADDDRV $BASEDIR_OPT $modname >/dev/null 2>&1
     271        else
     272            $BIN_ADDDRV $BASEDIR_OPT $modname
    246273        fi
    247274    fi
     
    253280        fi
    254281        return 1
     282    elif test "$REMOTEINST" -eq 1 && test "$?" -eq 0; then
     283        subprint "Added: $moddesc driver"
    255284    fi
    256285    return 0
     
    269298    moddesc=$2
    270299    fatal=$3
     300
    271301    module_added $modname
    272302    if test "$?" -eq 0; then
    273303        if test "$ISIPS" != "$IPSOP"; then
    274             $BIN_REMDRV $modname
    275         else
    276             $BIN_REMDRV $modname >/dev/null 2>&1
    277         fi
     304            $BIN_REMDRV $BASEDIR_OPT $modname
     305        else
     306            $BIN_REMDRV $BASEDIR_OPT $modname >/dev/null 2>&1
     307        fi
     308        # for remote installs, don't bother with return values of rem_drv
    278309        if test $? -eq 0; then
    279310            subprint "Removed: $moddesc module"
     
    296327        errorprint "missing argument to unload_module()"
    297328        exit 1
     329    fi
     330
     331    # No-OP for non-root installs
     332    if test "$REMOTEINST" -eq 1; then
     333        return 0
    298334    fi
    299335
     
    325361        errorprint "missing argument to load_module()"
    326362        exit 1
     363    fi
     364
     365    # No-OP for non-root installs
     366    if test "$REMOTEINST" -eq 1; then
     367        return 0
    327368    fi
    328369
     
    360401
    361402    # Add vboxdrv to devlink.tab
    362     sed -e '/name=vboxdrv/d' /etc/devlink.tab > /etc/devlink.vbox
    363     echo "type=ddi_pseudo;name=vboxdrv  \D" >> /etc/devlink.vbox
    364     mv -f /etc/devlink.vbox /etc/devlink.tab
    365 
    366     # Create the device link
    367     /usr/sbin/devfsadm -i "$MOD_VBOXDRV"
    368 
    369     if test $? -eq 0 && test -h "/dev/vboxdrv"; then
    370 
    371         if test -f "$DIR_CONF/vboxnet.conf"; then
    372             add_driver "$MOD_VBOXNET" "$DESC_VBOXNET" "$FATALOP"
    373             load_module "drv/$MOD_VBOXNET" "$DESC_VBOXNET" "$FATALOP"
    374         fi
    375 
    376         if test -f "$DIR_CONF/vboxflt.conf"; then
    377             add_driver "$MOD_VBOXFLT" "$DESC_VBOXFLT" "$FATALOP"
    378             load_module "drv/$MOD_VBOXFLT" "$DESC_VBOXFLT" "$FATALOP"
    379         fi
    380 
    381         if test -f "$DIR_CONF/vboxusbmon.conf" && test "$HOST_OS_MAJORVERSION" != "5.10"; then
    382             # For VirtualBox 3.1 the new USB code requires Nevada > 123
    383             if test "$HOST_OS_MINORVERSION" -gt 123; then
    384                 add_driver "$MOD_VBOXUSBMON" "$DESC_VBOXUSBMON" "$FATALOP" "not-$NULLOP" "'* 0666 root sys'"
    385                 load_module "drv/$MOD_VBOXUSBMON" "$DESC_VBOXUSBMON" "$FATALOP"
    386 
    387                 # Add vboxusbmon to devlink.tab
    388                 sed -e '/name=vboxusbmon/d' /etc/devlink.tab > /etc/devlink.vbox
    389                 echo "type=ddi_pseudo;name=vboxusbmon   \D" >> /etc/devlink.vbox
    390                 mv -f /etc/devlink.vbox /etc/devlink.tab
    391 
    392                 # Create the device link
     403    if test -f "${BASEDIR}/etc/devlink.tab"; then
     404        sed -e '/name=vboxdrv/d' ${BASEDIR}/etc/devlink.tab > ${BASEDIR}/etc/devlink.vbox
     405        echo "type=ddi_pseudo;name=vboxdrv      \D" >> ${BASEDIR}/etc/devlink.vbox
     406        mv -f ${BASEDIR}/etc/devlink.vbox ${BASEDIR}/etc/devlink.tab
     407    else
     408        errorprint "Missing ${BASEDIR}/etc/devlink.tab, aborting install"
     409        return 1
     410    fi
     411
     412    # Create the device link for non-remote installs
     413    if test "$REMOTEINST" -eq 0; then
     414        /usr/sbin/devfsadm -i "$MOD_VBOXDRV"
     415        if test $? -ne 0 || test ! -h "/dev/vboxdrv"; then
     416            errorprint "Failed to create device link for $MOD_VBOXDRV."
     417            exit 1
     418        fi
     419    fi
     420
     421    # Load VBoxNetAdp
     422    if test -f "$DIR_CONF/vboxnet.conf"; then
     423        add_driver "$MOD_VBOXNET" "$DESC_VBOXNET" "$FATALOP"
     424        load_module "drv/$MOD_VBOXNET" "$DESC_VBOXNET" "$FATALOP"
     425    fi
     426
     427    # Load VBoxNetFlt
     428    if test -f "$DIR_CONF/vboxflt.conf"; then
     429        add_driver "$MOD_VBOXFLT" "$DESC_VBOXFLT" "$FATALOP"
     430        load_module "drv/$MOD_VBOXFLT" "$DESC_VBOXFLT" "$FATALOP"
     431    fi
     432
     433    # Load VBoxUSBMon, VBoxUSB
     434    if test -f "$DIR_CONF/vboxusbmon.conf" && test "$HOST_OS_MAJORVERSION" != "5.10"; then
     435        # For VirtualBox 3.1 the new USB code requires Nevada > 123
     436        if test "$HOST_OS_MINORVERSION" -gt 123; then
     437            add_driver "$MOD_VBOXUSBMON" "$DESC_VBOXUSBMON" "$FATALOP" "not-$NULLOP" "'* 0666 root sys'"
     438            load_module "drv/$MOD_VBOXUSBMON" "$DESC_VBOXUSBMON" "$FATALOP"
     439
     440            # Add vboxusbmon to devlink.tab
     441            sed -e '/name=vboxusbmon/d' ${BASEDIR}/etc/devlink.tab > ${BASEDIR}/etc/devlink.vbox
     442            echo "type=ddi_pseudo;name=vboxusbmon       \D" >> ${BASEDIR}/etc/devlink.vbox
     443            mv -f ${BASEDIR}/etc/devlink.vbox ${BASEDIR}/etc/devlink.tab
     444
     445            # Create the device link for non-remote installs
     446            if test "$REMOTEINST" -eq 0; then
    393447                /usr/sbin/devfsadm -i  "$MOD_VBOXUSBMON"
    394448                if test $? -ne 0; then
     
    396450                    exit 1
    397451                fi
    398 
    399                 # Add vboxusb if present
    400                 # This driver is special, we need it in the boot-archive but since there is no
    401                 # USB device to attach to now (it's done at runtime) it will fail to attach so
    402                 # redirect attaching failure output to /dev/null
    403                 if test -f "$DIR_CONF/vboxusb.conf"; then
    404                     add_driver "$MOD_VBOXUSB" "$DESC_VBOXUSB" "$FATALOP" "$NULLOP"
    405                     load_module "drv/$MOD_VBOXUSB" "$DESC_VBOXUSB" "$FATALOP"
    406                 fi
     452            fi
     453
     454            # Add vboxusb if present
     455            # This driver is special, we need it in the boot-archive but since there is no
     456            # USB device to attach to now (it's done at runtime) it will fail to attach so
     457            # redirect attaching failure output to /dev/null
     458            if test -f "$DIR_CONF/vboxusb.conf"; then
     459                add_driver "$MOD_VBOXUSB" "$DESC_VBOXUSB" "$FATALOP" "$NULLOP"
     460                load_module "drv/$MOD_VBOXUSB" "$DESC_VBOXUSB" "$FATALOP"
     461            fi
     462        else
     463            if test -n "$HOST_OS_MINORVERSION"; then
     464                warnprint "Solaris 5.11 snv_124 or higher required for USB support. Skipped installing USB support."
    407465            else
    408                 warnprint "Solaris 5.11 snv_124 or higher required for USB support. Skipped installing USB support."
    409             fi
    410         fi
    411     else
    412         errorprint "Failed to create device link for $MOD_VBOXDRV."
    413         exit 1
     466                warnprint "Failed to determine Solaris 5.11 snv version. Skipped installing USB support."
     467            fi
     468        fi
    414469    fi
    415470
     
    424479
    425480    # Remove vboxdrv from devlink.tab
    426     devlinkfound=`cat /etc/devlink.tab | grep vboxdrv`
    427     if test -n "$devlinkfound"; then
    428         sed -e '/name=vboxdrv/d' /etc/devlink.tab > /etc/devlink.vbox
    429         mv -f /etc/devlink.vbox /etc/devlink.tab
    430     fi
    431 
    432     # Remove vboxusbmon from devlink.tab
    433     devlinkfound=`cat /etc/devlink.tab | grep vboxusbmon`
    434     if test -n "$devlinkfound"; then
    435         sed -e '/name=vboxusbmon/d' /etc/devlink.tab > /etc/devlink.vbox
    436         mv -f /etc/devlink.vbox /etc/devlink.tab
     481    if test -f ${BASEDIR}/etc/devlink.tab; then
     482        devlinkfound=`cat ${BASEDIR}/etc/devlink.tab | grep vboxdrv`
     483        if test -n "$devlinkfound"; then
     484            sed -e '/name=vboxdrv/d' ${BASEDIR}/etc/devlink.tab > ${BASEDIR}/etc/devlink.vbox
     485            mv -f ${BASEDIR}/etc/devlink.vbox ${BASEDIR}/etc/devlink.tab
     486        fi
     487
     488        # Remove vboxusbmon from devlink.tab
     489        devlinkfound=`cat ${BASEDIR}/etc/devlink.tab | grep vboxusbmon`
     490        if test -n "$devlinkfound"; then
     491            sed -e '/name=vboxusbmon/d' ${BASEDIR}/etc/devlink.tab > ${BASEDIR}/etc/devlink.vbox
     492            mv -f ${BASEDIR}/etc/devlink.vbox ${BASEDIR}/etc/devlink.tab
     493        fi
    437494    fi
    438495
     
    456513
    457514    # remove devlinks
    458     if test -h "/dev/vboxdrv" || test -f "/dev/vboxdrv"; then
    459         rm -f /dev/vboxdrv
    460     fi
    461     if test -h "/dev/vboxusbmon" || test -f "/dev/vboxusbmon"; then
    462         rm -f /dev/vboxusbmon
     515    if test -h "${BASEDIR}/dev/vboxdrv" || test -f "${BASEDIR}/dev/vboxdrv"; then
     516        rm -f ${BASEDIR}/dev/vboxdrv
     517    fi
     518    if test -h "${BASEDIR}/dev/vboxusbmon" || test -f "${BASEDIR}/dev/vboxusbmon"; then
     519        rm -f ${BASEDIR}/dev/vboxusbmon
    463520    fi
    464521
    465522    # unpatch nwam/dhcpagent fix
    466     nwamfile=/etc/nwam/llp
     523    nwamfile=${BASEDIR}/etc/nwam/llp
    467524    nwambackupfile=$nwamfile.vbox
    468525    if test -f "$nwamfile"; then
     
    472529
    473530    # remove netmask configuration
    474     nmaskfile=/etc/netmasks
     531    nmaskfile=${BASEDIR}/etc/netmasks
    475532    nmaskbackupfile=$nmaskfile.vbox
    476533    if test -f "$nmaskfile"; then
     
    519576    fatal=$1
    520577
    521     # stop and unregister webservice SMF
     578    # No-Op for remote installs
     579    if test "$REMOTEINST" -eq 1; then
     580        return 0
     581    fi
     582
     583    # stop webservice
    522584    servicefound=`$BIN_SVCS -a | grep "virtualbox/webservice" 2>/dev/null`
    523585    if test ! -z "$servicefound"; then
    524586        $BIN_SVCADM disable -s svc:/application/virtualbox/webservice:default
    525         $BIN_SVCCFG delete svc:/application/virtualbox/webservice:default
     587        # Don't delete the manifest, this is handled by the manifest class action
     588        # $BIN_SVCCFG delete svc:/application/virtualbox/webservice:default
    526589        if test "$?" -eq 0; then
    527590            subprint "Unloaded: Web service"
     
    531594    fi
    532595
    533     # stop and unregister zoneaccess SMF
     596    # stop zoneaccess service
    534597    servicefound=`$BIN_SVCS -a | grep "virtualbox/zoneaccess" 2>/dev/null`
    535598    if test ! -z "$servicefound"; then
    536599        $BIN_SVCADM disable -s svc:/application/virtualbox/zoneaccess
    537         $BIN_SVCCFG delete svc:/application/virtualbox/zoneaccess
     600        # Don't delete the manifest, this is handled by the manifest class action
     601        # $BIN_SVCCFG delete svc:/application/virtualbox/zoneaccess
    538602        if test "$?" -eq 0; then
    539603            subprint "Unloaded: Zone access service"
     
    543607    fi
    544608
    545     # unplumb all vboxnet instances
     609    # unplumb all vboxnet instances for non-remote installs
    546610    inst=0
    547611    while test $inst -ne $MOD_VBOXNET_INST; do
     
    584648        if test -f "$DIR_CONF/vboxnet.conf"; then
    585649            # nwam/dhcpagent fix
    586             nwamfile=/etc/nwam/llp
     650            nwamfile=${BASEDIR}/etc/nwam/llp
    587651            nwambackupfile=$nwamfile.vbox
    588652            if test -f "$nwamfile"; then
     
    600664            fi
    601665
    602             # plumb and configure vboxnet0
    603             $BIN_IFCONFIG vboxnet0 plumb up
    604             if test "$?" -eq 0; then
    605                 $BIN_IFCONFIG vboxnet0 192.168.56.1 netmask 255.255.255.0 up
    606 
    607                 # add the netmask to stay persistent across host reboots
    608                 nmaskfile=/etc/netmasks
    609                 nmaskbackupfile=$nmaskfile.vbox
    610                 if test -f $nmaskfile; then
    611                     sed -e '/#VirtualBox_SectionStart/,/#VirtualBox_SectionEnd/d' $nmaskfile > $nmaskbackupfile
    612                     echo "#VirtualBox_SectionStart" >> $nmaskbackupfile
    613                     inst=0
    614                     networkn=56
    615                     while test $inst -ne 1; do
    616                         echo "192.168.$networkn.0 255.255.255.0" >> $nmaskbackupfile
    617                         inst=`expr $inst + 1`
    618                         networkn=`expr $networkn + 1`
    619                     done
    620                     echo "#VirtualBox_SectionEnd" >> $nmaskbackupfile
    621                     mv -f $nmaskbackupfile $nmaskfile
     666            # plumb and configure vboxnet0 for non-remote installs
     667            if test "$REMOTEINST" -eq 0; then
     668                $BIN_IFCONFIG vboxnet0 plumb up
     669                if test "$?" -eq 0; then
     670                    $BIN_IFCONFIG vboxnet0 192.168.56.1 netmask 255.255.255.0 up
     671
     672                    # add the netmask to stay persistent across host reboots
     673                    nmaskfile=${BASEDIR}/etc/netmasks
     674                    nmaskbackupfile=$nmaskfile.vbox
     675                    if test -f $nmaskfile; then
     676                        sed -e '/#VirtualBox_SectionStart/,/#VirtualBox_SectionEnd/d' $nmaskfile > $nmaskbackupfile
     677                        echo "#VirtualBox_SectionStart" >> $nmaskbackupfile
     678                        inst=0
     679                        networkn=56
     680                        while test $inst -ne 1; do
     681                            echo "192.168.$networkn.0 255.255.255.0" >> $nmaskbackupfile
     682                            inst=`expr $inst + 1`
     683                            networkn=`expr $networkn + 1`
     684                        done
     685                        echo "#VirtualBox_SectionEnd" >> $nmaskbackupfile
     686                        mv -f $nmaskbackupfile $nmaskfile
     687                    fi
     688                else
     689                    # Should this be fatal?
     690                    warnprint "Failed to bring up vboxnet0!!"
    622691                fi
    623             else
    624                 # Should this be fatal?
    625                 warnprint "Failed to bring up vboxnet0!!"
    626             fi
    627         fi
    628 
    629         if test -f /var/svc/manifest/application/virtualbox/virtualbox-webservice.xml || test -f /var/svc/manifest/application/virtualbox/virtualbox-zoneaccess.xml; then
     692            fi
     693        fi
     694
     695        if test -f ${BASEDIR}/var/svc/manifest/application/virtualbox/virtualbox-webservice.xml || test -f ${BASEDIR}/var/svc/manifest/application/virtualbox/virtualbox-zoneaccess.xml; then
    630696            infoprint "Configuring services..."
    631         fi
    632 
    633         # Web service
    634         if test -f /var/svc/manifest/application/virtualbox/virtualbox-webservice.xml; then
    635             /usr/sbin/svccfg import /var/svc/manifest/application/virtualbox/virtualbox-webservice.xml
    636             /usr/sbin/svcadm disable -s svc:/application/virtualbox/webservice:default
    637             if test "$?" -eq 0; then
    638                 subprint "Loaded: Web service"
    639             else
    640                 subprint "Loading: Web service  ...ERROR(S)."
    641             fi
    642         fi
    643 
    644         # Zone access service
    645         if test -f /var/svc/manifest/application/virtualbox/virtualbox-zoneaccess.xml; then
    646             /usr/sbin/svccfg import /var/svc/manifest/application/virtualbox/virtualbox-zoneaccess.xml
    647             /usr/sbin/svcadm enable -s svc:/application/virtualbox/zoneaccess
    648             if test "$?" -eq 0; then
    649                 subprint "Loaded: Zone access service"
    650             else
    651                 subprint "Loading: Zone access service  ...ERROR(S)."
    652             fi
    653         fi
    654 
    655         # Install python bindings
    656         if test -f "$DIR_VBOXBASE/sdk/installer/vboxapisetup.py" || test -h "$DIR_VBOXBASE/sdk/installer/vboxapisetup.py"; then
    657             PYTHONBIN=`which python 2> /dev/null`
    658             if test -f "$PYTHONBIN" || test -h "$PYTHONBIN"; then
    659                 infoprint "Installing Python bindings..."
    660 
    661                 INSTALLEDIT=1
    662                 PYTHONBIN=`which python2.4 2>/dev/null`
    663                 install_python_bindings "$PYTHONBIN" "Python 2.4"
     697            if test "$REMOTEINST" -eq 1; then
     698                subprint "Skipped for targetted installs."
     699            fi
     700        fi
     701
     702        # Enable Zone access service for non-remote installs, other services (Webservice) are delivered disabled by the manifest class action
     703        if test "$REMOTEINST" -eq 0; then
     704            servicefound=`$BIN_SVCS -a | grep "virtualbox/zoneaccess" | grep "disabled" 2>/dev/null`
     705            if test ! -z "$servicefound"; then
     706                /usr/sbin/svcadm enable -s svc:/application/virtualbox/zoneaccess
    664707                if test "$?" -eq 0; then
    665                     INSTALLEDIT=0
     708                    subprint "Loaded: Zone access service"
     709                else
     710                    subprint "Loading Zone access service  ...FAILED."
    666711                fi
    667                 PYTHONBIN=`which python2.5 2>/dev/null`
    668                 install_python_bindings "$PYTHONBIN"  "Python 2.5"
    669                 if test "$?" -eq 0; then
    670                     INSTALLEDIT=0
     712            fi
     713        fi
     714
     715        # Install python bindings for non-remote installs
     716        if test "$REMOTEINST" -eq 0; then
     717            if test -f "$DIR_VBOXBASE/sdk/installer/vboxapisetup.py" || test -h "$DIR_VBOXBASE/sdk/installer/vboxapisetup.py"; then
     718                PYTHONBIN=`which python 2> /dev/null`
     719                if test -f "$PYTHONBIN" || test -h "$PYTHONBIN"; then
     720                    infoprint "Installing Python bindings..."
     721
     722                    INSTALLEDIT=1
     723                    PYTHONBIN=`which python2.4 2>/dev/null`
     724                    install_python_bindings "$PYTHONBIN" "Python 2.4"
     725                    if test "$?" -eq 0; then
     726                        INSTALLEDIT=0
     727                    fi
     728                    PYTHONBIN=`which python2.5 2>/dev/null`
     729                    install_python_bindings "$PYTHONBIN"  "Python 2.5"
     730                    if test "$?" -eq 0; then
     731                        INSTALLEDIT=0
     732                    fi
     733                    PYTHONBIN=`which python2.6 2>/dev/null`
     734                    install_python_bindings "$PYTHONBIN" "Python 2.6"
     735                    if test "$?" -eq 0; then
     736                        INSTALLEDIT=0
     737                    fi
     738
     739                    # remove files installed by Python build
     740                    rm -rf $DIR_VBOXBASE/sdk/installer/build
     741
     742                    if test "$INSTALLEDIT" -ne 0; then
     743                        warnprint "No suitable Python version found. Required Python 2.4, 2.5 or 2.6."
     744                        warnprint "Skipped installing the Python bindings."
     745                    fi
     746                else
     747                    warnprint "Python not found, skipped installed Python bindings."
    671748                fi
    672                 PYTHONBIN=`which python2.6 2>/dev/null`
    673                 install_python_bindings "$PYTHONBIN" "Python 2.6"
    674                 if test "$?" -eq 0; then
    675                     INSTALLEDIT=0
    676                 fi
    677 
    678                 # remove files installed by Python build
    679                 rm -rf $DIR_VBOXBASE/sdk/installer/build
    680 
    681                 if test "$INSTALLEDIT" -ne 0; then
    682                     warnprint "No suitable Python version found. Required Python 2.4, 2.5 or 2.6."
    683                     warnprint "Skipped installing the Python bindings."
    684                 fi
    685             else
    686                 warnprint "Python not found, skipped installed Python bindings."
    687             fi
     749            fi
     750        else
     751            warnprint "Skipped installing Python bindings. Run, as root, 'vboxapisetup.py install' manually from the booted system."
    688752        fi
    689753
    690754        # Update boot archive
    691755        infoprint "Updating the boot archive..."
    692         $BIN_BOOTADM update-archive > /dev/null
     756        if test "$REMOTEINST" -eq 0; then
     757            $BIN_BOOTADM update-archive > /dev/null
     758        else
     759            $BIN_BOOTADM update-archive -R ${BASEDIR} > /dev/null
     760        fi
    693761
    694762        return 0
     
    722790check_zone
    723791find_bins
     792get_sysinfo
     793
     794if test "x${BASEDIR}" != "x/"; then
     795    BASEDIR_OPT="-b ${BASEDIR}"
     796    REMOTEINST=1
     797fi
    724798
    725799# Get command line options
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette