VirtualBox

Changeset 20271 in vbox for trunk


Ignore:
Timestamp:
Jun 4, 2009 11:40:48 AM (16 years ago)
Author:
vboxsync
Message:

Solaris/Installer: ipsinstall.

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

Legend:

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

    r20264 r20271  
    253253        vboxdrv.sh \
    254254        VBox.sh \
     255        ipsinstall.sh \
    255256        $(if $(VBOX_WITH_VBOXSDL),libSDL-1.2.so.0,) \
    256257        $(if $(not $(VBOX_WITH_NETFLT))vnic_setup.sh,) \
     
    442443                $(VBOX_PATH_SOL_INST_SRC)/vbox.pkgresponse \
    443444                $(VBOX_PATH_SOL_INST_SRC)/VBox.sh \
     445                $(VBOX_PATH_SOL_INST_SRC)/ipsinstall.sh \
    444446                $(VBOX_PATH_SOL_INST_SRC)/virtualbox.desktop \
    445447                $(PATH_ROOT)/doc/ReadMe-Solaris.txt \
     
    527529        $(QUIET)$(RM) -f $(SOLARIS_VBOXINST_DIR)/vboxdrv.sh.tmp
    528530        $(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_SOL_INST_SRC)/VBox.sh                                            $(SOLARIS_VBOXINST_DIR)/VBox.sh
     531        $(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_SOL_INST_SRC)/ipsinstall.sh                                      $(SOLARIS_VBOXINST_DIR)/ipsinstall.sh
    529532        $(QUIET)$(if $(VBOX_WITH_QTGUI),$(INSTALL) -m 0644 $(VBOX_PATH_SOL_INST_SRC)/virtualbox.desktop         $(SOLARIS_USRSHR_APPS_DIR)/virtualbox.desktop,)
    530533        $(QUIET)$(INSTALL) -m 0644 $(SOLARIS_OUT_BIN)/VBox.png                                                  $(SOLARIS_USRSHR_PIXMAPS_DIR)/VBox.png
  • trunk/src/VBox/Installer/solaris/ipsinstall.sh

    r20270 r20271  
    2525# script once to avoid rebooting the system before using VirtualBox
    2626#
    27 currentzone=`zonename`
    28 osversion=`uname -r`
    29 if test "$currentzone" = "global"; then
    30     BIN_REMDRV=/usr/sbin/rem_drv
    31     BIN_ADDDRV=/usr/sbin/add_drv
    32     BIN_MODLOAD=/usr/sbin/modload
    33     BIN_DEVFSADM=/usr/sbin/devfsadm
    3427
    35     # Halt services in case of installation update
    36     zoneaccessfound=`svcs -a | grep "virtualbox/zoneaccess"`
    37     if test ! -z "$zoneaccessfound"; then
    38         /usr/sbin/svcadm disable -s svc:/application/virtualbox/zoneaccess
     28check_root()
     29{
     30    idbin=/usr/xpg4/bin/id
     31    if test ! -f "$idbin"; then
     32        found=`which id | grep "no id"`
     33        if test ! -z "$found"; then
     34            echo "## Failed to find a suitable user id binary."
     35        else
     36            idbin=$found
     37        fi
    3938    fi
    4039
    41     # Remove drivers ignoring errors as they are not really loaded
    42     # just updated various boot archive files without really loading
    43     # them... But we _want_ them to be loaded.
    44     echo "Removing any stale driver configurations..."
     40    if test `$idbin -u` -ne 0; then
     41        echo "## This script must be run with administrator privileges."
     42    fi
     43}
    4544
    46     $BIN_REMDRV vboxflt > /dev/null 2>&1
    47     /sbin/ifconfig vboxnet0 unplumb > /dev/null 2>&1
    48     $BIN_REMDRV vboxnet > /dev/null 2>&1
    49     $BIN_REMDRV vboxusbmon > /dev/null 2>&1
    50     $BIN_REMDRV vboxdrv > /dev/null 2>&1
     45check_zone()
     46{
     47    currentzone=`zonename`
     48    if test "$currentzone" != "global"; then
     49        echo "## This script must be run from the global zone."
     50    fi
     51}
    5152
    52     echo "Loading VirtualBox Drivers:"
    53     # Add drivers the proper way and load them immediately
    54     /opt/VirtualBox/vboxdrv.sh start
    55     rc=$?
    56     if test "$rc" -eq 0; then
    57         # Add vboxdrv to the devlink.tab
    58         sed -e '
     53check_root
     54check_zone
     55
     56osversion=`uname -r`
     57
     58BIN_REMDRV=/usr/sbin/rem_drv
     59BIN_ADDDRV=/usr/sbin/add_drv
     60BIN_MODLOAD=/usr/sbin/modload
     61BIN_DEVFSADM=/usr/sbin/devfsadm
     62
     63# Halt services in case of installation update
     64zoneaccessfound=`svcs -a | grep "virtualbox/zoneaccess"`
     65if test ! -z "$zoneaccessfound"; then
     66    /usr/sbin/svcadm disable -s svc:/application/virtualbox/zoneaccess
     67fi
     68
     69# Remove drivers ignoring errors as they are not really loaded
     70# just updated various boot archive files without really loading
     71# them... But we _want_ them to be loaded.
     72echo "Removing any stale driver configurations..."
     73
     74$BIN_REMDRV vboxflt > /dev/null 2>&1
     75/sbin/ifconfig vboxnet0 unplumb > /dev/null 2>&1
     76$BIN_REMDRV vboxnet > /dev/null 2>&1
     77$BIN_REMDRV vboxusbmon > /dev/null 2>&1
     78$BIN_REMDRV vboxdrv > /dev/null 2>&1
     79
     80echo "Loading VirtualBox Drivers:"
     81# Add drivers the proper way and load them immediately
     82/opt/VirtualBox/vboxdrv.sh start
     83rc=$?
     84if test "$rc" -eq 0; then
     85    # Add vboxdrv to the devlink.tab
     86    sed -e '
    5987/name=vboxdrv/d' /etc/devlink.tab > /etc/devlink.vbox
    60         echo "type=ddi_pseudo;name=vboxdrv      \D" >> /etc/devlink.vbox
    61         mv -f /etc/devlink.vbox /etc/devlink.tab
     88    echo "type=ddi_pseudo;name=vboxdrv  \D" >> /etc/devlink.vbox
     89    mv -f /etc/devlink.vbox /etc/devlink.tab
    6290
    63         # Create the device link
    64         /usr/sbin/devfsadm -i vboxdrv
     91    # Create the device link
     92    /usr/sbin/devfsadm -i vboxdrv
    6593
    66         echo "HostDrv    : SUCCESS"
     94    echo "HostDrv    : SUCCESS"
    6795
    68         # Load VBoxNetAdapter vboxnet
    69         if test -f /platform/i86pc/kernel/drv/vboxnet.conf; then
    70             /opt/VirtualBox/vboxdrv.sh netstart
    71             rc=$?
     96    # Load VBoxNetAdapter vboxnet
     97    if test -f /platform/i86pc/kernel/drv/vboxnet.conf; then
     98        /opt/VirtualBox/vboxdrv.sh netstart
     99        rc=$?
    72100
    73             if test "$rc" -eq 0; then
    74                 echo "NetAdapter : SUCCESS"
     101        if test "$rc" -eq 0; then
     102            echo "NetAdapter : SUCCESS"
    75103
    76                 # nwam/dhcpagent fix
    77                 nwamfile=/etc/nwam/llp
    78                 nwambackupfile=$nwamfile.vbox
    79                 if test -f "$nwamfile"; then
    80                     sed -e '/vboxnet/d' $nwamfile > $nwambackupfile
    81                     echo "vboxnet0      static 192.168.56.1" >> $nwambackupfile
    82                     mv -f $nwambackupfile $nwamfile
    83                     echo "  -> patched /etc/nwam/llp to use static IP for vboxnet0"
    84                 fi
    85             else
    86                 echo "NetAdapter : FAILED"
     104            # nwam/dhcpagent fix
     105            nwamfile=/etc/nwam/llp
     106            nwambackupfile=$nwamfile.vbox
     107            if test -f "$nwamfile"; then
     108                sed -e '/vboxnet/d' $nwamfile > $nwambackupfile
     109                echo "vboxnet0  static 192.168.56.1" >> $nwambackupfile
     110                mv -f $nwambackupfile $nwamfile
     111                echo "  -> patched /etc/nwam/llp to use static IP for vboxnet0"
    87112            fi
     113        else
     114            echo "NetAdapter : FAILED"
    88115        fi
    89 
    90         # Load VBoxNetFilter vboxflt
    91         if test -f /platform/i86pc/kernel/drv/vboxflt.conf; then
    92             /opt/VirtualBox/vboxdrv.sh fltstart
    93             rc=$?
    94             if test "$rc" -eq 0; then
    95                 echo "NetFilter  : SUCCESS"
    96             else
    97                 echo "NetFilter  : FAILED"
    98             fi
    99         fi
    100 
    101         # Load VBoxUSBMonitor vboxusbmon (do NOT load for Solaris 10)
    102         if test -f /platform/i86pc/kernel/drv/vboxusbmon.conf && test "$osversion" != "5.10"; then
    103             /opt/VirtualBox/vboxdrv.sh usbstart
    104             rc=$?
    105             if test "$rc" -eq 0; then
    106 
    107                 # Add vboxusbmon to the devlink.tab
    108                 sed -e '
    109                 /name=vboxusbmon/d' /etc/devlink.tab > /etc/devlink.vbox
    110                 echo "type=ddi_pseudo;name=vboxusbmon   \D" >> /etc/devlink.vbox
    111                 mv -f /etc/devlink.vbox /etc/devlink.tab
    112 
    113                 /usr/sbin/devfsadm -i vboxusbmon
    114 
    115                 echo "USBMonitor : SUCCESS"
    116             else
    117                 echo "USBMonitor : FAILED"
    118             fi
    119         fi
    120     else
    121         echo "HostDrv    : FAILED"
    122116    fi
    123117
    124     # Enable Zone access service
    125     if test -f /var/svc/manifest/application/virtualbox/zoneaccess.xml; then
    126         /usr/sbin/svcadm enable -s svc:/application/virtualbox/zoneaccess
    127         echo "Service to use VirtualBox from zones  : ENABLED"
     118    # Load VBoxNetFilter vboxflt
     119    if test -f /platform/i86pc/kernel/drv/vboxflt.conf; then
     120        /opt/VirtualBox/vboxdrv.sh fltstart
     121        rc=$?
     122        if test "$rc" -eq 0; then
     123            echo "NetFilter  : SUCCESS"
     124        else
     125            echo "NetFilter  : FAILED"
     126        fi
    128127    fi
    129128
    130     # We need to touch the desktop link in order to add it to the menu right away
    131     if test -f "/usr/share/applications/virtualbox.desktop"; then
    132         touch /usr/share/applications/virtualbox.desktop
     129    # Load VBoxUSBMonitor vboxusbmon (do NOT load for Solaris 10)
     130    if test -f /platform/i86pc/kernel/drv/vboxusbmon.conf && test "$osversion" != "5.10"; then
     131        /opt/VirtualBox/vboxdrv.sh usbstart
     132        rc=$?
     133        if test "$rc" -eq 0; then
     134
     135            # Add vboxusbmon to the devlink.tab
     136            sed -e '
     137            /name=vboxusbmon/d' /etc/devlink.tab > /etc/devlink.vbox
     138            echo "type=ddi_pseudo;name=vboxusbmon       \D" >> /etc/devlink.vbox
     139            mv -f /etc/devlink.vbox /etc/devlink.tab
     140
     141            /usr/sbin/devfsadm -i vboxusbmon
     142
     143            echo "USBMonitor : SUCCESS"
     144        else
     145            echo "USBMonitor : FAILED"
     146        fi
    133147    fi
     148else
     149    echo "HostDrv    : FAILED"
     150fi
     151
     152# Enable Zone access service
     153if test -f /var/svc/manifest/application/virtualbox/zoneaccess.xml; then
     154    /usr/sbin/svcadm enable -s svc:/application/virtualbox/zoneaccess
     155    echo "Service to use VirtualBox from zones  : ENABLED"
     156fi
     157
     158# We need to touch the desktop link in order to add it to the menu right away
     159if test -f "/usr/share/applications/virtualbox.desktop"; then
     160    touch /usr/share/applications/virtualbox.desktop
    134161fi
    135162
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