VirtualBox

Changeset 39235 in vbox


Ignore:
Timestamp:
Nov 8, 2011 12:59:21 PM (13 years ago)
Author:
vboxsync
Message:

Additions/solaris: Fix VBoxService loading using manifest class actions. Classify VBoxService under "applications" rather than "system".

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

Legend:

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

    r33656 r39235  
    5959}
    6060
     61dirlist_fixup()
     62{
     63  "$VBOX_AWK" 'NF == 6 && $1 == "d" && '"$2"' { '"$3"' } { print }' "$1" > "tmp-$1"
     64  mv -f "tmp-$1" "$1"
     65}
    6166
    6267# Create relative hardlinks
     
    8186
    8287# Include opt/VirtualBoxAdditions and subdirectories as we want uninstall to clean up directory structure as well
    83 find . -type d | $VBOX_GGREP -E 'opt/VirtualBoxAdditions' | pkgproto >> prototype
     88find . -type d | $VBOX_GGREP -E 'opt/VirtualBoxAdditions|var/svc/manifest/application/virtualbox' | pkgproto >> prototype
    8489
    8590# Include /etc/fs/vboxfs (as we need to create the subdirectory)
     
    9499filelist_fixup prototype '$3 == "opt/VirtualBoxAdditions/amd64/VBoxService"'                                 '$4 = "4755"'
    95100
     101# Manifest class action scripts
     102filelist_fixup prototype '$3 == "var/svc/manifest/application/virtualbox/vboxservice.xml"'                   '$2 = "manifest";$6 = "sys"'
     103
    96104# vboxguest
    97105filelist_fixup prototype '$3 == "usr/kernel/drv/vboxguest"'                                                  '$6="sys"'
    98106filelist_fixup prototype '$3 == "usr/kernel/drv/amd64/vboxguest"'                                            '$6="sys"'
     107
     108# Use 'root' as group so as to match attributes with the previous installation and prevent a conflict. Otherwise pkgadd bails out thinking
     109# we're violating directory attributes of another (non existing) package
     110dirlist_fixup prototype  '$3 == "var/svc/manifest/application/virtualbox"'                                   '$6 = "root"'
    99111
    100112echo " --- start of prototype  ---"
  • trunk/src/VBox/Additions/solaris/Installer/postinstall.sh

    r37423 r39235  
    7777}
    7878
     79abort()
     80{
     81    echo 1>&2 "## $1"
     82    exit 1
     83}
     84
     85get_sysinfo()
     86{
     87    BIN_PKG=`which pkg 2> /dev/null`
     88    if test -x "$BIN_PKG"; then
     89        PKGFMRI=`$BIN_PKG contents -H -t set -a name=pkg.fmri -o pkg.fmri pkg:/system/kernel 2> /dev/null`
     90        if test ! -z "$PKGFMRI"; then
     91            # The format is "pkg://solaris/system/[email protected],5.11-0.161:20110315T070332Z"
     92            #            or "pkg://solaris/system/[email protected],5.11-0.175.0.0.0.1.0:20111012T032837Z"
     93            STR_KERN=`echo "$PKGFMRI" | sed 's/^.*\@//;s/\:.*//;s/.*,//'`
     94            if test ! -z "$STR_KERN"; then
     95                # The format is "5.11-0.161" or "5.11-0.175.0.0.0.1.0"
     96                HOST_OS_MAJORVERSION=`echo "$STR_KERN" | cut -f1 -d'-'`
     97                HOST_OS_MINORVERSION=`echo "$STR_KERN" | cut -f2 -d'-' | cut -f2 -d '.'`
     98            else
     99                abort "Failed to parse the Solaris kernel version."
     100            fi       
     101        else
     102            abort "Failed to detect the Solaris kernel version."
     103        fi
     104    else
     105        HOST_OS_MAJORVERSION=`uname -r`
     106        if test -z "$HOST_OS_MAJORVERSION" || test "$HOST_OS_MAJORVERSION" != "5.10";  then
     107            # S11 without 'pkg' ?? Something's wrong... bail.
     108            abort "Solaris $HOST_OS_MAJOR_VERSION detected without executable $BIN_PKG !? Confused."
     109        fi
     110        # Use uname to verify it's S10.
     111        # Major version is S10, Minor version is no longer relevant (or used), use uname -v so it gets something
     112        # like "Generic_blah" for purely cosmetic purposes
     113        HOST_OS_MINORVERSION=`uname -v`
     114    fi
     115    echo "Detected Solaris $HOST_OS_MAJORVERSION version $HOST_OS_MINORVERSION"
     116}
     117
    79118solaris64dir="amd64"
    80119solaris32dir="i386"
     
    83122vboxadditions64_path=$vboxadditions_path/$solaris64dir
    84123
     124# get OS details
     125get_sysinfo
    85126# get the current zone
    86127currentzone=`zonename`
     
    393434
    394435if test "$currentzone" = "global"; then
    395     # Setup our VBoxService SMF service
     436    /usr/sbin/devfsadm -i vboxguest
     437
     438    # Setup our VBoxService SMF service (needs the full FMRI here)
    396439    echo "Configuring service..."
    397 
    398     /usr/sbin/svccfg import /var/svc/manifest/system/virtualbox/vboxservice.xml
    399     /usr/sbin/svcadm enable svc:/system/virtualbox/vboxservice
    400 
    401     /usr/sbin/devfsadm -i vboxguest
     440    /usr/sbin/svcadm enable -s svc:/application/virtualbox/vboxservice
    402441
    403442    # Update boot archive
  • trunk/src/VBox/Additions/solaris/Installer/preremove.sh

    r33656 r39235  
    2323#
    2424
    25 echo "VirtualBox Guest Additions - preremove script"
    26 echo "This script will unload the VirtualBox Guest kernel module..."
     25echo "Removing VirtualBox service..."
    2726
    2827# stop and unregister VBoxService daemon
    29 /usr/sbin/svcadm disable -s svc:/system/virtualbox/vboxservice:default
    30 /usr/sbin/svccfg delete svc:/system/virtualbox/vboxservice:default
     28/usr/sbin/svcadm disable -s virtualbox/vboxservice:default
     29# Don't need to delete, taken care of by the manifest action
     30# /usr/sbin/svccfg delete svc:/application/virtualbox/vboxservice:default
    3131
    3232# stop VBoxClient
    3333pkill -INT VBoxClient
    3434
     35echo "Removing VirtualBox kernel modules..."
     36
    3537# vboxguest.sh would've been installed, we just need to call it.
    36 /opt/VirtualBoxAdditions/vboxguest.sh stopall
     38/opt/VirtualBoxAdditions/vboxguest.sh stopall silentunload
    3739
    3840# remove devlink.tab entry for vboxguest
  • trunk/src/VBox/Additions/solaris/Installer/vboxguest.pkginfo

    r26547 r39235  
    1111HOTLINE="Please contact your local service provider"
    1212BASEDIR="/"
    13 CLASSES=none sed
     13CLASSES=none manifest
    1414DESC="@VBOX_PRODUCT@ Guest Additions for Solaris guests"
    1515
  • trunk/src/VBox/Additions/solaris/Installer/vboxguest.sh

    r39219 r39235  
    2727VFSMODNAME="vboxfs"
    2828MODDIR32="/usr/kernel/drv"
    29 MODDIR64=$MODDIR32/amd64
     29MODDIR64="/usr/kernel/drv/amd64"
    3030VFSDIR32="/usr/kernel/fs"
    3131VFSDIR64="/usr/kernel/fs/amd64"
     
    114114{
    115115    if vboxguest_loaded; then
    116         /usr/sbin/rem_drv $MODNAME || abort "## Failed to unload VirtualBox guest kernel module."
     116        /usr/sbin/rem_drv $MODNAME || abort "Failed to unload VirtualBox guest kernel module."
    117117        info "VirtualBox guest kernel module unloaded."
    118118    elif test -z "$SILENTUNLOAD"; then
     
    148148}
    149149
    150 restart_module()
    151 {
    152     stop_module
    153     sync
    154     start_module
    155     return 0
    156 }
    157 
    158 restart_all()
    159 {
    160     stop_module
    161     sync
    162     start_module
    163     return 0
    164 }
    165 
    166150status_module()
    167151{
     
    180164}
    181165
     166restart_all()
     167{
     168    stop_all
     169    start_module
     170    start_vboxfs
     171    return 0
     172}
     173
    182174check_root
    183175check_if_installed
     
    199191stop)
    200192    stop_module
    201     ;;
    202 restart)
    203     restart_module
    204193    ;;
    205194status)
  • trunk/src/VBox/Additions/solaris/Installer/vboxservice.xml

    r33656 r39235  
    2525<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
    2626
    27 <service_bundle type='manifest' name='export'>
     27<service_bundle type='manifest' name='SUNWvboxguest:vboxservice'>
    2828
    2929<service
    30     name='system/virtualbox/vboxservice'
     30    name='application/virtualbox/vboxservice'
    3131    type='service'
    3232    version='1'>
  • trunk/src/VBox/Additions/solaris/Makefile.kmk

    r38082 r39235  
    6969SOLARIS_ADD_USRBIN_DIR                  := $(SOLARIS_ADDINST_OUT_DIR)/usr/bin
    7070SOLARIS_ADD_ETCFS_DIR                   := $(SOLARIS_ADDINST_OUT_DIR)/etc/fs/vboxfs
    71 SOLARIS_ADD_SERVICESINST_DIR            := $(SOLARIS_ADDINST_OUT_DIR)/var/svc/manifest/system/virtualbox
     71SOLARIS_ADD_SERVICESINST_DIR            := $(SOLARIS_ADDINST_OUT_DIR)/var/svc/manifest/application/virtualbox
    7272
    7373ifeq ($(KBUILD_TARGET_ARCH),x86)
     
    149149        var/svc \
    150150        var/svc/manifest \
    151         var/svc/manifest/system \
    152         var/svc/manifest/system/virtualbox \
     151        var/svc/manifest/application \
     152        var/svc/manifest/application/virtualbox \
    153153        )
    154154
     
    302302        $(call MSG_L1,Creating install package: $@)
    303303        $(QUIET)$(MKDIR) -p $(SOLARIS_ADD_ETCFS_DIR)
     304        $(QUIET)$(MKDIR) -p $(VBOX_PATH_SOLARIS_ADDITION_INSTALLER)
    304305        $(QUIET)$(LN_SYMLINK) -f ../..$(SOLARIS_VBOXADDINST_SUBDIR)/1099.vboxclient                           $(SOLARIS_ADD_USRBIN_DIR)/VBoxClient-all
    305306ifdef VBOX_WITH_COMBINED_SOLARIS_GUEST_PACKAGE
     
    315316        $(LN_SYMLINK) -f ../../..$(SOLARIS_VBOXADDINST_SUBDIR)/$(SOLARIS_ADDDIR_NAME_ISA)/vboxfsmount         $(SOLARIS_ADD_ETCFS_DIR)/mount
    316317endif
     318        $(QUIET)$(INSTALL) -m 0644 $(VBOX_PATH_SOLARIS_ADDITION_INSTALLER)/vboxservice.xml                    $(SOLARIS_ADD_SERVICESINST_DIR)/vboxservice.xml
    317319        $(QUIET)$(SOLARIS_ADDINST_OUT_DIR)/makepackage.sh $(SOLARIS_ADDINST_OUT_DIR) $(PKGFILENAME) $(VBOX_SVN_REV)
    318320        $(QUIET)$(INSTALL) -m 0644 $(SOLARIS_ADDINST_OUT_DIR)/$(PKGFILENAME) $(PATH_STAGE_BIN)/additions/$(PKGFILENAME)
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