VirtualBox

Changeset 101937 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Nov 7, 2023 12:15:59 PM (15 months ago)
Author:
vboxsync
Message:

Additions/solaris/{Installer,vboxms,vboxservice}: Add support for the
Solaris Guest Additions to be installed into an alternate root path
('pkgad -R'). This also enables the Solaris GAs to be installed in an
automated fashion when building Solaris images using the distribution
constructor (aka the distro_const(8) utility).

Location:
trunk/src/VBox/Additions
Files:
7 edited

Legend:

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

    r98103 r101937  
    4242LANG=C
    4343export LANG
     44
     45# "Remote" installs ('pkgadd -R') can skip many of the steps below.
     46REMOTE_INST=0
     47BASEDIR_OPT=""
     48if test "x${PKG_INSTALL_ROOT:-/}" != "x/"; then
     49    BASEDIR_OPT="-R $PKG_INSTALL_ROOT"
     50    REMOTE_INST=1
     51fi
     52export REMOTE_INST
     53export BASEDIR_OPT
    4454
    4555# uncompress(directory, file)
     
    5363
    5464    # Remove compressed path from the pkg
    55     /usr/sbin/removef $PKGINST "$1/$2.Z" 1>/dev/null
     65    /usr/sbin/removef $BASEDIR_OPT $PKGINST "$1/$2.Z" 1>/dev/null
    5666
    5767    # Add uncompressed path to the pkg
    58     /usr/sbin/installf -c none $PKGINST "$1/$2" f
     68    /usr/sbin/installf $BASEDIR_OPT -c none $PKGINST "$1/$2" f
    5969
    6070    # Uncompress the file (removes compressed file when done)
     
    7282solaris64dir="amd64"
    7383solaris32dir="i386"
    74 vboxadditions_path="$BASEDIR/opt/VirtualBoxAdditions"
     84vboxadditions_path="${PKG_INSTALL_ROOT}/opt/VirtualBoxAdditions"
    7585vboxadditions32_path=$vboxadditions_path/$solaris32dir
    7686vboxadditions64_path=$vboxadditions_path/$solaris64dir
     
    104114    # vboxguest.sh would've been installed, we just need to call it.
    105115    echo "Configuring VirtualBox guest kernel module..."
    106     # stop all previous modules (vboxguest, vboxfs) and start only starts vboxguest
    107     $vboxadditions_path/vboxguest.sh stopall silentunload
     116    # stop all previous modules (vboxguest, vboxfs) and load vboxguest
     117    # ('vboxguest.sh start' only starts vboxguest).
     118    if test "$REMOTE_INST" -eq 0; then
     119        $vboxadditions_path/vboxguest.sh stopall silentunload
     120    fi
    108121    $vboxadditions_path/vboxguest.sh start
    109122
     
    121134    fi
    122135
    123     sed -e '/name=vboxguest/d' /etc/devlink.tab > /etc/devlink.vbox
    124     echo "type=ddi_pseudo;name=vboxguest        \D" >> /etc/devlink.vbox
    125     chmod 0644 /etc/devlink.vbox
    126     chown root:$group /etc/devlink.vbox
    127     mv -f /etc/devlink.vbox /etc/devlink.tab
     136    sed -e '/name=vboxguest/d' ${PKG_INSTALL_ROOT}/etc/devlink.tab > ${PKG_INSTALL_ROOT}/etc/devlink.vbox
     137    echo "type=ddi_pseudo;name=vboxguest        \D" >> ${PKG_INSTALL_ROOT}/etc/devlink.vbox
     138    chmod 0644 ${PKG_INSTALL_ROOT}/etc/devlink.vbox
     139    chown root:$group ${PKG_INSTALL_ROOT}/etc/devlink.vbox
     140    mv -f ${PKG_INSTALL_ROOT}/etc/devlink.vbox ${PKG_INSTALL_ROOT}/etc/devlink.tab
    128141
    129142    # create the device link
    130     /usr/sbin/devfsadm -i vboxguest
    131 fi
    132 
     143    /usr/sbin/devfsadm $BASEDIR_OPT -i vboxguest
     144fi
     145
     146# create links
     147echo "Creating links..."
     148if test "$currentzone" = "global"; then
     149    /usr/sbin/installf $BASEDIR_OPT -c none $PKGINST /dev/vboxguest=../devices/pci@0,0/pci80ee,cafe@4:vboxguest s
     150    /usr/sbin/installf $BASEDIR_OPT -c none $PKGINST /dev/vboxms=../devices/pseudo/vboxms@0:vboxms s
     151fi
    133152
    134153# check if X.Org exists (snv_130 and higher have /usr/X11/* as /usr/*)
    135 if test -f "/usr/bin/Xorg"; then
    136     xorgbin="/usr/bin/Xorg"
    137 elif test -f "/usr/X11/bin/Xorg"; then
    138     xorgbin="/usr/X11/bin/Xorg"
     154if test -f "${PKG_INSTALL_ROOT}/usr/bin/Xorg"; then
     155    xorgbin="${PKG_INSTALL_ROOT}/usr/bin/Xorg"
     156elif test -f "${PKG_INSTALL_ROOT}/usr/X11/bin/Xorg"; then
     157    xorgbin="${PKG_INSTALL_ROOT}/usr/X11/bin/Xorg"
    139158else
    140159    xorgbin=""
    141160    retval=0
    142 fi
    143 
    144 # create links
    145 echo "Creating links..."
    146 if test "$currentzone" = "global"; then
    147     /usr/sbin/installf -c none $PKGINST /dev/vboxguest=../devices/pci@0,0/pci80ee,cafe@4:vboxguest s
    148     /usr/sbin/installf -c none $PKGINST /dev/vboxms=../devices/pseudo/vboxms@0:vboxms s
    149161fi
    150162
     
    159171
    160172    # "X.Y.Z" - strip off all numerics after the 2nd '.' character, e.g. "1.11.3" -> "1.11"
    161     # Then the next sed, strips of all '.' characters, "1.11" -> "111".
     173    # The second sed invocation removes all '.' characters, e.g. "1.11" -> "111".
    162174    fileversion=`echo $xorgversion | sed "s/\.[0-9]*//2" | sed "s/\.//"`
    163175    vboxvideo_src="vboxvideo_drv_$fileversion.so"
     
    184196        retval=2
    185197    elif test ! -f "$vboxadditions32_path/$vboxvideo_src" && test ! -f "$vboxadditions64_path/$vboxvideo_src"; then
    186         # Xorg 1.19 and later already contain a driver for vboxvideo.
    187         echo "As of X.Org Server 1.19, the VirtualBox graphics driver (vboxvideo) is part"
    188         echo "of Solaris.  Please install it from the package repository if necessary."
     198        if test ! -f "${PKG_INSTALL_ROOT}/usr/lib/xorg/modules/drivers/vboxvideo_drv.so"; then
     199            # Xorg 1.19 and later (delivered first in st_006) already contain a driver
     200            # for vboxvideo so advise users to install the required package if it isn't
     201            # already present.
     202            echo "As of X.Org Server 1.19, the VirtualBox graphics driver (vboxvideo) is part"
     203            echo "of Solaris.  Please install the package pkg:/x11/server/xorg/driver/xorg-video-vboxvideo"
     204            echo "from the package repository for the vboxvideo_drv.so graphics driver."
     205        fi
    189206    else
    190207        echo "Installing video driver for X.Org $xorgversion..."
    191208
    192209        # Determine destination paths (snv_130 and above use "/usr/lib/xorg", older use "/usr/X11/lib"
    193         vboxvideo32_dest_base="/usr/lib/xorg/modules/drivers"
     210        vboxvideo32_dest_base="${PKG_INSTALL_ROOT}/usr/lib/xorg/modules/drivers"
    194211        if test ! -d $vboxvideo32_dest_base; then
    195             vboxvideo32_dest_base="/usr/X11/lib/modules/drivers"
     212            vboxvideo32_dest_base="${PKG_INSTALL_ROOT}/usr/X11/lib/modules/drivers"
    196213        fi
    197214
     
    225242            if test "$skip32" = "no" && test -f "$vboxadditions32_path/$vboxvideo_src"; then
    226243                vboxvideo_dest="$vboxvideo32_dest_base/vboxvideo_drv.so"
    227                 /usr/sbin/installf -c none $PKGINST "$vboxvideo_dest" f
     244                /usr/sbin/installf $BASEDIR_OPT -c none $PKGINST "$vboxvideo_dest" f
    228245                cp "$vboxadditions32_path/$vboxvideo_src" "$vboxvideo_dest"
    229246
    230247                # Removing redundant names from pkg and files from disk
    231                 /usr/sbin/removef $PKGINST $vboxadditions32_path/vboxvideo_drv_* 1>/dev/null
     248                /usr/sbin/removef $BASEDIR_OPT $PKGINST $vboxadditions32_path/vboxvideo_drv_* 1>/dev/null
    232249                rm -f $vboxadditions32_path/vboxvideo_drv_*
    233250            fi
     
    236253            if test -f "$vboxadditions64_path/$vboxvideo_src"; then
    237254                vboxvideo_dest="$vboxvideo64_dest_base/vboxvideo_drv.so"
    238                 /usr/sbin/installf -c none $PKGINST "$vboxvideo_dest" f
     255                /usr/sbin/installf $BASEDIR_OPT -c none $PKGINST "$vboxvideo_dest" f
    239256                cp "$vboxadditions64_path/$vboxvideo_src" "$vboxvideo_dest"
    240257
    241258                # Removing redundant names from pkg and files from disk
    242                 /usr/sbin/removef $PKGINST $vboxadditions64_path/vboxvideo_drv_* 1>/dev/null
     259                /usr/sbin/removef $BASEDIR_OPT $PKGINST $vboxadditions64_path/vboxvideo_drv_* 1>/dev/null
    243260                rm -f $vboxadditions64_path/vboxvideo_drv_*
    244261            fi
    245262
    246263            # Some distros like Indiana have no xorg.conf, deal with this
    247             if test ! -f '/etc/X11/xorg.conf' && test ! -f '/etc/X11/.xorg.conf'; then
    248 
    249                 # Xorg 1.3.x+ should use the modeline less Xorg confs while older should
     264            if  test ! -f '${PKG_INSTALL_ROOT}/etc/X11/xorg.conf' && \
     265                test ! -f '${PKG_INSTALL_ROOT}/etc/X11/.xorg.conf'; then
     266
     267                # Xorg 1.3.x+ should use the modeline-less Xorg confs while older should
    250268                # use ones with all the video modelines in place. Argh.
    251269                xorgconf_file="solaris_xorg_modeless.conf"
     
    258276                esac
    259277
    260                 /usr/sbin/removef $PKGINST $vboxadditions_path/$xorgconf_file 1>/dev/null
    261                 mv -f $vboxadditions_path/$xorgconf_file /etc/X11/.xorg.conf
    262 
    263                 /usr/sbin/removef $PKGINST $vboxadditions_path/$xorgconf_unfit 1>/dev/null
     278                /usr/sbin/removef $BASEDIR_OPT $PKGINST $vboxadditions_path/$xorgconf_file 1>/dev/null
     279                mv -f $vboxadditions_path/$xorgconf_file ${PKG_INSTALL_ROOT}/etc/X11/.xorg.conf
     280
     281                /usr/sbin/removef $BASEDIR_OPT $PKGINST $vboxadditions_path/$xorgconf_unfit 1>/dev/null
    264282                rm -f $vboxadditions_path/$xorgconf_unfit
    265283            fi
     
    267285            # Check for VirtualBox graphics card
    268286            # S10u10's prtconf doesn't support the '-d' option, so let's use -v even though it's slower.
    269             is_vboxgraphics=`prtconf -v | grep -i pci80ee,beef`
     287            is_vboxgraphics=`${PKG_INSTALL_ROOT}/usr/sbin/prtconf -v | grep -i pci80ee,beef`
    270288            if test "$?" -eq 0; then
    271289                drivername="vboxvideo"
    272290            else
    273291                # Check for VMware graphics card
    274                 is_vmwaregraphics=`prtconf -v | grep -i pci15ad,405`
     292                is_vmwaregraphics=`${PKG_INSTALL_ROOT}/usr/sbin/prtconf -v | grep -i pci15ad,405`
    275293                if test "$?" -eq 0; then
    276294                    echo "Configuring X.Org to use VMware SVGA graphics driver..."
     
    293311    echo "Configuring client..."
    294312    vboxclient_src=$vboxadditions_path
    295     vboxclient_dest="/usr/share/gnome/autostart"
     313    vboxclient_dest="${PKG_INSTALL_ROOT}/usr/share/gnome/autostart"
    296314    clientinstalled=0
    297315    if test -d "$vboxclient_dest"; then
    298         /usr/sbin/installf -c none $PKGINST $vboxclient_dest/vboxclient.desktop=$vboxadditions_path/vboxclient.desktop s
     316        /usr/sbin/installf $BASEDIR_OPT -c none $PKGINST $vboxclient_dest/vboxclient.desktop=$vboxadditions_path/vboxclient.desktop s
    299317        clientinstalled=1
    300318    fi
    301     vboxclient_dest="/usr/dt/config/Xsession.d"
     319    vboxclient_dest="${PKG_INSTALL_ROOT}/usr/dt/config/Xsession.d"
    302320    if test -d "$vboxclient_dest"; then
    303         /usr/sbin/installf -c none $PKGINST $vboxclient_dest/1099.vboxclient=$vboxadditions_path/1099.vboxclient s
     321        /usr/sbin/installf $BASEDIR_OPT -c none $PKGINST $vboxclient_dest/1099.vboxclient=$vboxadditions_path/1099.vboxclient s
    304322        clientinstalled=1
    305323    fi
     
    307325    # Try other autostart locations if none of the above ones work
    308326    if test $clientinstalled -eq 0; then
    309         vboxclient_dest="/etc/xdg/autostart"
     327        vboxclient_dest="${PKG_INSTALL_ROOT}/etc/xdg/autostart"
    310328        if test -d "$vboxclient_dest"; then
    311             /usr/sbin/installf -c none $PKGINST $vboxclient_dest/1099.vboxclient=$vboxadditions_path/1099.vboxclient s
     329            /usr/sbin/installf $BASEDIR_OPT -c none $PKGINST $vboxclient_dest/1099.vboxclient=$vboxadditions_path/1099.vboxclient s
    312330            clientinstalled=1
    313331        else
     
    335353if test -f "$vboxadditions64_path/$vboxfsmod"; then
    336354    echo "Installing 64-bit shared folders module..."
    337     /usr/sbin/installf -c none $PKGINST "/usr/kernel/fs/$solaris64dir/vboxfs" f
    338     mv -f $vboxadditions64_path/$vboxfsmod /usr/kernel/fs/$solaris64dir/vboxfs
    339     /usr/sbin/removef $PKGINST $vboxadditions64_path/$vboxfsmod 1>/dev/null
    340     /usr/sbin/removef $PKGINST $vboxadditions64_path/$vboxfsunused 1>/dev/null
     355    /usr/sbin/installf $BASEDIR_OPT -c none $PKGINST "/usr/kernel/fs/$solaris64dir/vboxfs" f
     356    mv -f $vboxadditions64_path/$vboxfsmod ${PKG_INSTALL_ROOT}/usr/kernel/fs/$solaris64dir/vboxfs
     357    /usr/sbin/removef $BASEDIR_OPT $PKGINST $vboxadditions64_path/$vboxfsmod 1>/dev/null
     358    /usr/sbin/removef $BASEDIR_OPT $PKGINST $vboxadditions64_path/$vboxfsunused 1>/dev/null
    341359    rm -f $vboxadditions64_path/$vboxfsunused
    342360fi
     
    345363if test -f "$vboxadditions32_path/$vboxfsmod"; then
    346364    echo "Installing 32-bit shared folders module..."
    347     /usr/sbin/installf -c none $PKGINST "/usr/kernel/fs/vboxfs" f
    348     mv -f $vboxadditions32_path/$vboxfsmod /usr/kernel/fs/vboxfs
    349     /usr/sbin/removef $PKGINST $vboxadditions32_path/$vboxfsmod 1>/dev/null
    350     /usr/sbin/removef $PKGINST $vboxadditions32_path/$vboxfsunused 1>/dev/null
     365    /usr/sbin/installf $BASEDIR_OPT -c none $PKGINST "/usr/kernel/fs/vboxfs" f
     366    mv -f $vboxadditions32_path/$vboxfsmod ${PKG_INSTALL_ROOT}/usr/kernel/fs/vboxfs
     367    /usr/sbin/removef $BASEDIR_OPT $PKGINST $vboxadditions32_path/$vboxfsmod 1>/dev/null
     368    /usr/sbin/removef $BASEDIR_OPT $PKGINST $vboxadditions32_path/$vboxfsunused 1>/dev/null
    351369    rm -f $vboxadditions32_path/$vboxfsunused
    352370fi
     
    355373# All users which want to access the auto-mounted Shared Folders have to
    356374# be added to this group.
    357 groupadd vboxsf >/dev/null 2>&1
     375if test "$REMOTE_INST" -eq 0; then
     376    groupadd vboxsf >/dev/null 2>&1
     377fi
    358378
    359379# Move the pointer integration module to kernel/drv & remove the unused module name from pkg and file from disk
    360380
    361381# Finalize
    362 /usr/sbin/removef -f $PKGINST
    363 /usr/sbin/installf -f $PKGINST
     382/usr/sbin/removef $BASEDIR_OPT -f $PKGINST
     383/usr/sbin/installf $BASEDIR_OPT -f $PKGINST
    364384
    365385
    366386if test "$currentzone" = "global"; then
    367     /usr/sbin/devfsadm -i vboxguest
     387    /usr/sbin/devfsadm $BASEDIR_OPT -i vboxguest
    368388
    369389    # Setup VBoxService and vboxmslnk and start the services automatically
    370     echo "Configuring services (this might take a while)..."
     390    echo "Configuring VBoxService and vboxmslnk services (this might take a while)..."
    371391    cmax=32
    372392    cslept=0
     
    374394    sync
    375395
    376     # Since S11 the way to import a manifest is via restarting manifest-import which is asynchronous and can
    377     # take a while to complete, using disable/enable -s doesn't work either. So we restart it, and poll in
    378     # 1 second intervals to see if our service has been successfully imported and timeout after 'cmax' seconds.
    379     /usr/sbin/svcadm restart svc:system/manifest-import:default
    380     /usr/bin/svcs virtualbox/vboxservice >/dev/null 2>&1 && /usr/bin/svcs virtualbox/vboxmslnk >/dev/null 2>&1
    381     while test "$?" -ne 0;
    382     do
    383         sleep 1
    384         cslept=`expr $cslept + 1`
    385         if test "$cslept" -eq "$cmax"; then
    386             success=1
    387             break
    388         fi
     396    if test "$REMOTE_INST" -eq 0; then
     397        # Since S11 the way to import a manifest is via restarting manifest-import which is asynchronous and can
     398        # take a while to complete, using disable/enable -s doesn't work either. So we restart it, and poll in
     399        # 1 second intervals to see if our service has been successfully imported and timeout after 'cmax' seconds.
     400        /usr/sbin/svcadm restart svc:system/manifest-import:default
    389401        /usr/bin/svcs virtualbox/vboxservice >/dev/null 2>&1 && /usr/bin/svcs virtualbox/vboxmslnk >/dev/null 2>&1
    390     done
    391     if test "$success" -eq 0; then
    392         echo "Enabling services..."
    393         /usr/sbin/svcadm enable -s virtualbox/vboxservice
    394         /usr/sbin/svcadm enable -s virtualbox/vboxmslnk
    395     else
    396         echo "## Service import failed."
    397         echo "## See /var/svc/log/system-manifest-import:default.log for details."
    398         # Exit as partially failed installation
    399         retval=2
     402        while test "$?" -ne 0;
     403        do
     404            sleep 1
     405            cslept=`expr $cslept + 1`
     406            if test "$cslept" -eq "$cmax"; then
     407                success=1
     408                break
     409            fi
     410            /usr/bin/svcs virtualbox/vboxservice >/dev/null 2>&1 && /usr/bin/svcs virtualbox/vboxmslnk >/dev/null 2>&1
     411        done
     412        if test "$success" -eq 0; then
     413            echo "Enabling services..."
     414            /usr/sbin/svcadm enable -s virtualbox/vboxservice
     415            /usr/sbin/svcadm enable -s virtualbox/vboxmslnk
     416        else
     417            echo "## Service import failed."
     418            echo "## See /var/svc/log/system-manifest-import:default.log for details."
     419            # Exit as partially failed installation
     420            retval=2
     421        fi
    400422    fi
    401423
     
    403425    BOOTADMBIN=/sbin/bootadm
    404426    if test -x "$BOOTADMBIN"; then
    405         if test -h "/dev/vboxguest"; then
     427        if test -h "${PKG_INSTALL_ROOT}/dev/vboxguest"; then
    406428            echo "Updating boot archive..."
    407             $BOOTADMBIN update-archive > /dev/null
     429            $BOOTADMBIN update-archive $BASEDIR_OPT > /dev/null
    408430        else
    409431            echo "## Guest kernel module doesn't seem to be up. Skipped explicit boot-archive update."
     
    415437
    416438echo "Done."
    417 if test $retval -eq 0; then
    418     if test ! -z "$xorgbin"; then
    419         echo "Please re-login to activate the X11 guest additions."
    420     fi
    421     echo "If you have just un-installed the previous guest additions a REBOOT is required."
     439if test "$REMOTE_INST" -eq 0; then
     440    if test $retval -eq 0; then
     441        if test ! -z "$xorgbin"; then
     442            echo "Please re-login to activate the X11 guest additions."
     443        fi
     444        echo "If you have just un-installed the previous guest additions a REBOOT is required."
     445    fi
    422446fi
    423447exit $retval
  • trunk/src/VBox/Additions/solaris/Installer/preremove.sh

    r98103 r101937  
    4545
    4646# stop and unregister VBoxService
    47 /usr/sbin/svcadm disable -s virtualbox/vboxservice
    48 # Don't need to delete, taken care of by the manifest action
    49 # /usr/sbin/svccfg delete svc:/application/virtualbox/vboxservice:default
    50 /usr/sbin/svcadm restart svc:/system/manifest-import:default
     47if [ "${PKG_INSTALL_ROOT:-/}" = "/" ] ; then
     48    /usr/sbin/svcadm disable -s svc:/application/virtualbox/vboxservice:default
     49    /usr/sbin/svcadm disable -s svc:/application/virtualbox/vboxmslnk:default
     50    # Don't need to delete, taken care of by the manifest action
     51    #/usr/sbin/svccfg delete svc:/application/virtualbox/vboxservice:default
     52    #/usr/sbin/svccfg delete svc:/application/virtualbox/vboxmslnk:default
     53    /usr/sbin/svcadm restart -s svc:/system/manifest-import:default
    5154
    52 # stop VBoxClient
    53 pkill -INT VBoxClient
     55    # stop VBoxClient
     56    pkill -INT VBoxClient
     57fi
    5458
    5559echo "Removing VirtualBox kernel modules..."
    5660
    5761# vboxguest.sh would've been installed, we just need to call it.
    58 /opt/VirtualBoxAdditions/vboxguest.sh stopall silentunload
     62
     63${PKG_INSTALL_ROOT}/opt/VirtualBoxAdditions/vboxguest.sh stopall silentunload
    5964
    6065# Figure out group to use for /etc/devlink.tab (before Solaris 11 SRU6
     
    7277
    7378# remove devlink.tab entry for vboxguest
    74 sed -e '/name=vboxguest/d' /etc/devlink.tab > /etc/devlink.vbox
    75 chmod 0644 /etc/devlink.vbox
    76 chown root:$group /etc/devlink.vbox
    77 mv -f /etc/devlink.vbox /etc/devlink.tab
     79sed -e '/name=vboxguest/d' ${PKG_INSTALL_ROOT}/etc/devlink.tab > ${PKG_INSTALL_ROOT}/etc/devlink.vbox
     80chmod 0644 ${PKG_INSTALL_ROOT}/etc/devlink.vbox
     81chown root:$group ${PKG_INSTALL_ROOT}/etc/devlink.vbox
     82mv -f ${PKG_INSTALL_ROOT}/etc/devlink.vbox ${PKG_INSTALL_ROOT}/etc/devlink.tab
    7883
    7984# remove the link
    80 if test -h "/dev/vboxguest" || test -f "/dev/vboxguest"; then
    81     rm -f /dev/vboxdrv
     85if test -h "${PKG_INSTALL_ROOT}/dev/vboxguest" || test -f "${PKG_INSTALL_ROOT}/dev/vboxguest"; then
     86    rm -f ${PKG_INSTALL_ROOT}/dev/vboxdrv
    8287fi
    83 if test -h "/dev/vboxms" || test -f "/dev/vboxms"; then
    84     rm -f /dev/vboxms
     88if test -h "${PKG_INSTALL_ROOT}/dev/vboxms" || test -f "${PKG_INSTALL_ROOT}/dev/vboxms"; then
     89    rm -f ${PKG_INSTALL_ROOT}/dev/vboxms
    8590fi
    8691
    8792# Try and restore xorg.conf!
    8893echo "Restoring X.Org..."
    89 /opt/VirtualBoxAdditions/x11restore.pl
     94${PKG_INSTALL_ROOT}/opt/VirtualBoxAdditions/x11restore.pl
    9095
    9196
  • trunk/src/VBox/Additions/solaris/Installer/vboxguest.sh

    r98103 r101937  
    4646VFSMODNAME="vboxfs"
    4747VMSMODNAME="vboxms"
    48 MODDIR32="/usr/kernel/drv"
    49 MODDIR64="/usr/kernel/drv/amd64"
    50 VFSDIR32="/usr/kernel/fs"
    51 VFSDIR64="/usr/kernel/fs/amd64"
     48MODDIR32="${PKG_INSTALL_ROOT}/usr/kernel/drv"
     49MODDIR64="${PKG_INSTALL_ROOT}/usr/kernel/drv/amd64"
     50VFSDIR32="${PKG_INSTALL_ROOT}/usr/kernel/fs"
     51VFSDIR64="${PKG_INSTALL_ROOT}/usr/kernel/fs/amd64"
    5252
    5353abort()
     
    7979    if test -z "$1"; then
    8080        abort "missing argument to module_loaded()"
     81    fi
     82
     83    if test "$REMOTE_INST" -eq 1; then
     84        return 1
    8185    fi
    8286
     
    122126start_module()
    123127{
     128    if test "$REMOTE_INST" -eq 1; then
     129        /usr/sbin/add_drv $BASEDIR_OPT -i'pci80ee,cafe' -m'* 0666 root sys' $MODNAME 2>/dev/null || \
     130            abort "Failed to install VirtualBox guest kernel module into ${PKG_INSTALL_ROOT}."
     131        info "VirtualBox guest kernel module installed."
     132        return
     133    fi
     134
    124135    /usr/sbin/add_drv -i'pci80ee,cafe' -m'* 0666 root sys' $MODNAME
    125136    if test ! vboxguest_loaded; then
     
    134145stop_module()
    135146{
     147    if test "$REMOTE_INST" -eq 1; then
     148        /usr/sbin/rem_drv $BASEDIR_OPT $MODNAME || abort "Failed to uninstall VirtualBox guest kernel module."
     149        info "VirtualBox guest kernel module uninstalled."
     150        return
     151    fi
     152
    136153    if vboxguest_loaded; then
    137154        /usr/sbin/rem_drv $MODNAME || abort "Failed to unload VirtualBox guest kernel module."
     
    144161start_vboxfs()
    145162{
     163    if test "$REMOTE_INST" -eq 1; then
     164        return
     165    fi
     166
    146167    if vboxfs_loaded; then
    147168        info "VirtualBox FileSystem kernel module already loaded."
     
    158179stop_vboxfs()
    159180{
     181    if test "$REMOTE_INST" -eq 1; then
     182        return
     183    fi
     184
    160185    if vboxfs_loaded; then
    161186        vboxfs_mod_id=`/usr/sbin/modinfo | grep $VFSMODNAME | cut -f 1 -d ' ' `
     
    171196start_vboxms()
    172197{
     198    if test "$REMOTE_INST" -eq 1; then
     199        /usr/sbin/add_drv $BASEDIR_OPT -m'* 0666 root sys' $VMSMODNAME 2>/dev/null ||
     200            abort "Failed to install VirtualBox pointer integration module."
     201        info "VirtualBox pointer integration module installed."
     202        return
     203    fi
     204
    173205    /usr/sbin/add_drv -m'* 0666 root sys' $VMSMODNAME
    174206    if test ! vboxms_loaded; then
     
    183215stop_vboxms()
    184216{
     217    if test "$REMOTE_INST" -eq 1; then
     218        /usr/sbin/rem_drv $BASEDIR_OPT $VMSMODNAME || abort "Failed to uninstall VirtualBox pointer integration module."
     219        info "VirtualBox pointer integration module uninstalled."
     220        return
     221    fi
     222
    185223    if vboxms_loaded; then
    186224        /usr/sbin/rem_drv $VMSMODNAME || abort "Failed to unload VirtualBox pointer integration module."
     
    217255}
    218256
     257# "Remote" installs ('pkgadd -R') can skip many of the steps below.
     258REMOTE_INST=0
     259BASEDIR_OPT=""
     260if test "x${PKG_INSTALL_ROOT:-/}" != "x/"; then
     261    BASEDIR_OPT="-b $PKG_INSTALL_ROOT"
     262    REMOTE_INST=1
     263fi
     264export REMOTE_INST
     265export BASEDIR_OPT
     266
    219267check_root
    220268check_if_installed
  • trunk/src/VBox/Additions/solaris/Installer/vboxservice.xml

    r98103 r101937  
    4444    version='1'>
    4545
    46     <create_default_instance enabled='false' />
     46    <create_default_instance enabled='true' />
    4747
    4848    <single_instance/>
  • trunk/src/VBox/Additions/solaris/Mouse/vboxmslnk.xml

    r101532 r101937  
    4444    version='1'>
    4545
    46     <create_default_instance enabled='false' />
     46    <create_default_instance enabled='true' />
    4747
    4848    <single_instance/>
  • trunk/src/VBox/Additions/x11/Installer/x11config15sol.pl

    r98103 r101937  
    5757foreach $cfg (@cfg_files)
    5858{
     59
     60    if (($os_type =~ 'SunOS') && (defined $ENV{PKG_INSTALL_ROOT}))
     61    {
     62        $cfg = $ENV{PKG_INSTALL_ROOT}.$cfg;
     63    }
    5964    if (open(CFG, $cfg))
    6065    {
     
    98103
    99104        # Solaris specific: Rename our modified .xorg.conf to xorg.conf for it to be used
    100         if (($os_type =~ 'SunOS') && ($cfg =~ '/etc/X11/.xorg.conf'))
     105        if ((defined $ENV{PKG_INSTALL_ROOT}) &&
     106            ($os_type =~ 'SunOS') && ($cfg =~ "$ENV{PKG_INSTALL_ROOT}/etc/X11/.xorg.conf"))
    101107        {
    102             system("mv -f $cfg /etc/X11/xorg.conf");
     108                system("mv -f $cfg $ENV{PKG_INSTALL_ROOT}/etc/X11/xorg.conf");
     109        }
     110        else
     111        {
     112            if (($os_type =~ 'SunOS') && ($cfg =~ '/etc/X11/.xorg.conf'))
     113            {
     114                system("mv -f $cfg /etc/X11/xorg.conf");
     115            }
    103116        }
    104117
     
    107120}
    108121
    109 $config_count != 0 or die "Could not find any X11 configuration files";
     122$config_count != 0 or die "Could not find any X11 configuration files.";
    110123
  • trunk/src/VBox/Additions/x11/Installer/x11restore.pl

    r98103 r101937  
    4242foreach $cfg (@cfg_files)
    4343{
     44    if (($os_type =~ 'SunOS') && (defined $ENV{PKG_INSTALL_ROOT}))
     45    {
     46        $cfg = $ENV{PKG_INSTALL_ROOT}.$cfg;
     47    }
    4448    if (open(CFG, $cfg))
    4549    {
     
    5458                {
    5559                    close(BAK);
     60                    print("Restoring $cfg.back to $cfg.\n");
    5661                    rename $cfg.".bak", $cfg;
    5762                }
     
    7378    }
    7479}
    75 
    76 $config_count != 0 or die "Could not find backed-up xorg.conf to restore it.";
    77 
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