VirtualBox

Changeset 22082 in vbox


Ignore:
Timestamp:
Aug 7, 2009 5:57:05 PM (15 years ago)
Author:
vboxsync
Message:

Solaris/Installer: Enabled the new vboxconfig.sh.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/solaris/Makefile.kmk

    r21764 r22082  
    155155solaris-bin_SOURCES = \
    156156        $(if $(VBOX_WITH_PYTHON),$(PATH_ROOT)/src/VBox/Frontends/VBoxShell/vboxshell.py,) \
    157         $(VBOX_PATH_SOL_INST_SRC)/vboxdrv.sh \
     157        $(VBOX_PATH_SOL_INST_SRC)/vboxconfig.sh \
    158158        $(VBOX_PATH_SOL_INST_SRC)/VBox.sh \
    159159        $(VBOX_PATH_SOL_INST_SRC)/ipsinstall.sh \
     
    267267
    268268SOLARIS_COMMON_EXES = \
    269         vboxdrv.sh \
     269        vboxconfig.sh \
    270270        VBox.sh \
    271271        ipsinstall.sh \
     
    550550        $(QUIET)$(SED) \
    551551                -e "s/_HARDENED_/$(if $(VBOX_WITH_HARDENED),hardened,)/" \
    552                 --output $(SOLARIS_VBOXINST_DIR)/vboxdrv.sh.tmp \
    553                  $(PATH_BIN)/vboxdrv.sh
    554         $(QUIET)$(INSTALL) -m 0755 $(SOLARIS_VBOXINST_DIR)/vboxdrv.sh.tmp                                       $(SOLARIS_VBOXINST_DIR)/vboxdrv.sh
    555         $(QUIET)$(RM) -f $(SOLARIS_VBOXINST_DIR)/vboxdrv.sh.tmp
     552                --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
    556556        $(QUIET)$(if $(VBOX_WITH_QTGUI),$(INSTALL) -m 0644 $(VBOX_PATH_SOL_INST_SRC)/virtualbox.desktop         $(SOLARIS_USRSHR_APPS_DIR)/virtualbox.desktop,)
    557557        $(QUIET)$(INSTALL) -m 0644 $(SOLARIS_OUT_BIN)/VBox.png                                                  $(SOLARIS_USRSHR_PIXMAPS_DIR)/VBox.png
  • trunk/src/VBox/Installer/solaris/postinstall.sh

    r22003 r22082  
    2121#
    2222
    23 install_python_bindings()
    24 {
    25     PYTHONBIN=$1
    26     if test -x "$PYTHONBIN"; then
    27         VBOX_INSTALL_PATH=/opt/VirtualBox
    28         export VBOX_INSTALL_PATH
    29         cd /opt/VirtualBox/sdk/installer
    30         $PYTHONBIN ./vboxapisetup.py install > /dev/null
    31         return 0
    32     fi
    33     return 1
    34 }
    35 
    3623# Check for xVM/Xen
    3724currentisa=`uname -i`
     
    4431currentzone=`zonename`
    4532if test "$currentzone" = "global"; then
    46     echo "Loading VirtualBox kernel modules..."
    47     /opt/VirtualBox/vboxdrv.sh stopall silentunload checkarch
     33    echo "Checking for older bits..."
     34    /opt/VirtualBox/vboxconfig.sh preremove fatal
    4835    rc=$?
    4936    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
    8839    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!"
    17243    else
    173         echo "## $BOOTADMBIN not found/executable. Skipped explicit boot-archive update."
     44        echo "Completed but with errors."
    17445    fi
    17546fi
     
    18051
    18152# return 20 = requires reboot, 2 = partial failure, 0  = success
    182 exit 0
     53exit "$rc"
    18354
  • trunk/src/VBox/Installer/solaris/preremove.sh

    r20956 r22082  
    2323currentzone=`zonename`
    2424if 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
    7026fi
    7127
    7228echo "Done."
     29exit 0
    7330
  • trunk/src/VBox/Installer/solaris/vboxconfig.sh

    r22080 r22082  
    2323# Never use exit 2 or exit 20 etc., the return codes are used in
    2424# SRv4 postinstall procedures which carry special meaning. Just use exit 1 for failure.
    25 set -x
    2625
    2726HOST_OS_VERSION=`uname -r`
     
    4443# "vboxdrv" is also used in sed lines here (change those as well if it ever changes)
    4544MOD_VBOXDRV=vboxdrv
    46 DESC_VBOXDRV="VirtualBox HostDriver"
     45DESC_VBOXDRV="Host"
    4746
    4847MOD_VBOXNET=vboxnet
    49 DESC_VBOXNET="VirtualBox NetAdapter"
     48DESC_VBOXNET="NetAdapter"
    5049
    5150MOD_VBOXFLT=vboxflt
    52 DESC_VBOXFLT="VirtualBox NetFilter"
     51DESC_VBOXFLT="NetFilter"
    5352
    5453MOD_VBI=vbi
    55 DESC_VBI="VirtualBox Kernel Interface"
     54DESC_VBI="Kernel Interface"
    5655
    5756MOD_VBOXUSBMON=vboxusbmon
    58 DESC_VBOXUSBMON="VirtualBox USBMonitor"
     57DESC_VBOXUSBMON="USBMonitor"
    5958
    6059FATALOP=fatal
     
    270269
    271270    if test $? -ne 0; then
    272         errorprint "Adding: $moddesc module ...FAILED!"
     271        errorprint "   - Adding: $moddesc module ...FAILED!"
    273272        if test "$fatal" = "$FATALOP"; then
    274273            exit 1
     
    295294        $BIN_REMDRV $modname
    296295        if test $? -eq 0; then
    297             success "Removed: $moddesc module"
     296            success "   - Removed: $moddesc module"
    298297            return 0
    299298        else
    300             errorprint "Removing: $moddesc  ...FAILED!"
     299            errorprint "   - Removing: $moddesc  ...FAILED!"
    301300            if test "$fatal" = "$FATALOP"; then
    302301                exit 1
     
    323322        $BIN_MODUNLOAD -i $modid
    324323        if test $? -eq 0; then
    325             success "Unloaded:  $moddesc module"
     324            success "   - Unloaded:  $moddesc module"
    326325        else
    327             errorprint "Unloading:  $moddesc  ...FAILED!"
     326            errorprint "   - Unloading:  $moddesc  ...FAILED!"
    328327            if test "$fatal" = "$FATALOP"; then
    329328                exit 1
     
    350349    $BIN_MODLOAD -p $modname
    351350    if test $? -eq 0; then
    352         success "Loaded:  $moddesc module"
     351        success "   - Loaded:  $moddesc module"
    353352        return 0
    354353    else
    355         errorprint "Loading:  $modesc  ...FAILED!"
     354        errorprint "   - Loading:  $modesc  ...FAILED!"
    356355        if test "$fatal" = "$FATALOP"; then
    357356            exit 1
     
    380379    /usr/sbin/devfsadm -i "$MOD_VBOXDRV"
    381380
    382     if test $? -eq 0; then
     381    if test $? -eq 0 && test -h "/dev/vboxdrv"; then
    383382
    384383        if test -f /platform/i86pc/kernel/drv/vboxnet.conf; then
     
    421420{
    422421    fatal=$1
     422
    423423    # Remove vboxdrv from devlink.tab
    424424    devlinkfound=`cat /etc/devlink.tab | grep vboxdrv`
     
    435435    fi
    436436
    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"
    442439
    443440    unload_module "$MOD_VBOXFLT" "$DESC_VBOXFLT" "$fatal"
     
    458455    if test -h "/dev/vboxusbmon" || test -f "/dev/vboxusbmon"; then
    459456        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
    460465    fi
    461466
     
    491496        $BIN_SVCADM disable -s svc:/application/virtualbox/webservice:default
    492497        $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
    493503    fi
    494504
     
    498508        $BIN_SVCADM disable -s svc:/application/virtualbox/zoneaccess
    499509        $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
    502517    # unplumb vboxnet0
    503518    vboxnetup=`$BIN_IFCONFIG vboxnet0 >/dev/null 2>&1`
     
    514529
    515530
    516 # post_install()
    517 # !! failure is always fatal
    518 post_install()
     531# postinstall()
     532# !! failure is always fatal
     533postinstall()
    519534{
    520535    infoprint "Loading VirtualBox kernel modules..."
     
    522537
    523538    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
    525540            # nwam/dhcpagent fix
    526541            nwamfile=/etc/nwam/llp
     
    537552                $BIN_IFCONFIG vboxnet0 192.168.56.1 netmask 255.255.255.0 up
    538553            else
     554                # Should this be fatal?
    539555                warnprint "Failed to bring up vboxnet0!!"
    540556            fi
     
    549565            /usr/sbin/svccfg import /var/svc/manifest/application/virtualbox/virtualbox-webservice.xml
    550566            /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
    551572        fi
    552573
     
    555576            /usr/sbin/svccfg import /var/svc/manifest/application/virtualbox/virtualbox-zoneaccess.xml
    556577            /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
    557583        fi
    558584
     
    576602                PYTHONBIN=`which python2.6 2>/dev/null`
    577603                install_python_bindings "$PYTHONBIN"
    578                 if test "$?" -eq 0; then 
     604                if test "$?" -eq 0; then
    579605                    INSTALLEDIT=0
    580606                fi
     
    585611                if test "$INSTALLEDIT" -ne 0; then
    586612                    warnprint "No suitable Python version found. Required Python 2.4, 2.5 or 2.6."
     613                    warnprint "Skipped installing the Python bindings."
    587614                fi
    588615            else
     
    603630}
    604631
    605 
    606 # pre_remove([fatal])
     632# preremove([fatal])
    607633# failure: depends on [fatal]
    608 pre_remove()
     634preremove()
    609635{
    610636    fatal=$1
     
    636662
    637663case "$drvop" in
    638 post_install)
     664postinstall)
    639665    check_module_arch
    640     post_install
     666    postinstall
    641667    ;;
    642 pre_remove)
    643     pre_remove "$fatal"
     668preremove)
     669    preremove "$fatal"
    644670    ;;
    645671install_drivers)
     
    651677    ;;
    652678*)
    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]"
    654680    exit 1
    655681esac
Note: See TracChangeset for help on using the changeset viewer.

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