VirtualBox

Changeset 58117 in vbox for trunk


Ignore:
Timestamp:
Oct 8, 2015 2:54:33 PM (9 years ago)
Author:
vboxsync
Message:

Solaris/Installer: Detect all unofficial Solaris distros as S11 snv_151. Added support for vboxusb touch file to force installing host USB support.

File:
1 edited

Legend:

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

    r58028 r58117  
    229229}
    230230
    231 # get_sysinfo
     231# get_sysinfo_other()
     232# cannot fail
     233get_unofficial_sysinfo()
     234{
     235    HOST_OS_MAJORVERSION="11"
     236    HOST_OS_MINORVERSION="151"
     237}
     238
     239# get_sysinfo()
    232240# cannot fail
    233241get_sysinfo()
    234242{
     243    # First check 'uname -v' and weed out the recognized, unofficial distros of Solaris
     244    STR_OSVER=`uname -v`
     245    case "$STR_OSVER" in
     246        omnios*|oi_*|illumos*)
     247            get_unofficial_sysinfo
     248            return 0
     249            ;;
     250    esac
     251
    235252    BIN_PKG=`which pkg 2> /dev/null`
    236253    if test -x "$BIN_PKG"; then
     
    672689    else
    673690        # If host is S10 or S11 (< snv_159) or vboxbow isn't shipped, then load vboxflt
    674         if test "$HOST_OS_MAJORVERSION" -eq 10 || (test "$HOST_OS_MAJORVERSION" -eq 11 && test "$HOST_OS_MINORVERSION" -lt 159) || test ! -f "$DIR_CONF/vboxbow.conf"; then
     691        if     test "$HOST_OS_MAJORVERSION" -eq 10 \
     692           || (test "$HOST_OS_MAJORVERSION" -eq 11 && test "$HOST_OS_MINORVERSION" -lt 159) \
     693           ||  test ! -f "$DIR_CONF/vboxbow.conf"; then
    675694            load_vboxflt
    676695        else
     
    681700
    682701    # Load VBoxUSBMon, VBoxUSB
    683     if test -f "$DIR_CONF/vboxusbmon.conf" && test "$HOST_OS_MAJORVERSION" != "10"; then
    684         # For VirtualBox 3.1 the new USB code requires Nevada > 123 i.e. S12+ or S11 b124+
    685         if test "$HOST_OS_MAJORVERSION" -gt 11 || (test "$HOST_OS_MAJORVERSION" -eq 11 && test "$HOST_OS_MINORVERSION" -gt 123); then
    686             # Add a group "vboxuser" (8-character limit) for USB access.
    687             # All users which need host USB-passthrough support will have to be added to this group.
    688             groupadd vboxuser >/dev/null 2>&1
    689 
    690             add_driver "$MOD_VBOXUSBMON" "$DESC_VBOXUSBMON" "$FATALOP" "not-$NULLOP" "'* 0666 root sys'"
    691             load_module "drv/$MOD_VBOXUSBMON" "$DESC_VBOXUSBMON" "$FATALOP"
    692 
    693             chown root:vboxuser "/devices/pseudo/vboxusbmon@0:vboxusbmon"
    694 
    695             # Add vboxusbmon to devlink.tab
    696             sed -e '/name=vboxusbmon/d' "$PKG_INSTALL_ROOT/etc/devlink.tab" > "$PKG_INSTALL_ROOT/etc/devlink.vbox"
    697             echo "type=ddi_pseudo;name=vboxusbmon       \D" >> "$PKG_INSTALL_ROOT/etc/devlink.vbox"
    698             mv -f "$PKG_INSTALL_ROOT/etc/devlink.vbox" "$PKG_INSTALL_ROOT/etc/devlink.tab"
    699 
    700             # Create the device link for non-remote installs
    701             if test "$REMOTEINST" -eq 0; then
    702                 /usr/sbin/devfsadm -i  "$MOD_VBOXUSBMON"
    703                 if test $? -ne 0; then
    704                     errorprint "Failed to create device link for $MOD_VBOXUSBMON."
    705                     exit 1
    706                 fi
    707             fi
    708 
    709             # Add vboxusb if present
    710             # This driver is special, we need it in the boot-archive but since there is no
    711             # USB device to attach to now (it's done at runtime) it will fail to attach so
    712             # redirect attaching failure output to /dev/null
    713             if test -f "$DIR_CONF/vboxusb.conf"; then
    714                 add_driver "$MOD_VBOXUSB" "$DESC_VBOXUSB" "$FATALOP" "$NULLOP"
    715                 load_module "drv/$MOD_VBOXUSB" "$DESC_VBOXUSB" "$FATALOP"
    716             fi
    717         else
    718             warnprint "Solaris 11 build 124 or higher required for USB support. Skipped installing USB support."
     702    try_vboxusb="no"
     703    if test -f "$DIR_CONF/vboxusbmon.conf"; then
     704        if test -f "$PKG_INSTALL_ROOT/etc/vboxinst_vboxusb"; then
     705            subprint "Detected: Force-load file $PKG_INSTALL_ROOT/etc/vboxinst_vboxusb."
     706            try_vboxusb="yes"
     707        else
     708            # For VirtualBox 3.1 the new USB code requires Nevada > 123 i.e. S12+ or S11 b124+
     709            if     test "$HOST_OS_MAJORVERSION" -gt 11 \
     710               || (test "$HOST_OS_MAJORVERSION" -eq 11 && test "$HOST_OS_MINORVERSION" -gt 123); then
     711                try_vboxusb="yes"
     712            else
     713                warnprint "Solaris 11 build 124 or higher required for USB support. Skipped installing USB support."
     714            fi
     715        fi
     716    fi
     717    if test "$try_vboxusb" = "yes"; then
     718        # Add a group "vboxuser" (8-character limit) for USB access.
     719        # All users which need host USB-passthrough support will have to be added to this group.
     720        groupadd vboxuser >/dev/null 2>&1
     721
     722        add_driver "$MOD_VBOXUSBMON" "$DESC_VBOXUSBMON" "$FATALOP" "not-$NULLOP" "'* 0666 root sys'"
     723        load_module "drv/$MOD_VBOXUSBMON" "$DESC_VBOXUSBMON" "$FATALOP"
     724
     725        chown root:vboxuser "/devices/pseudo/vboxusbmon@0:vboxusbmon"
     726
     727        # Add vboxusbmon to devlink.tab
     728        sed -e '/name=vboxusbmon/d' "$PKG_INSTALL_ROOT/etc/devlink.tab" > "$PKG_INSTALL_ROOT/etc/devlink.vbox"
     729        echo "type=ddi_pseudo;name=vboxusbmon   \D" >> "$PKG_INSTALL_ROOT/etc/devlink.vbox"
     730        mv -f "$PKG_INSTALL_ROOT/etc/devlink.vbox" "$PKG_INSTALL_ROOT/etc/devlink.tab"
     731
     732        # Create the device link for non-remote installs
     733        if test "$REMOTEINST" -eq 0; then
     734            /usr/sbin/devfsadm -i  "$MOD_VBOXUSBMON"
     735            if test $? -ne 0; then
     736                errorprint "Failed to create device link for $MOD_VBOXUSBMON."
     737                exit 1
     738            fi
     739        fi
     740
     741        # Add vboxusb if present
     742        # This driver is special, we need it in the boot-archive but since there is no
     743        # USB device to attach to now (it's done at runtime) it will fail to attach so
     744        # redirect attaching failure output to /dev/null
     745        if test -f "$DIR_CONF/vboxusb.conf"; then
     746            add_driver "$MOD_VBOXUSB" "$DESC_VBOXUSB" "$FATALOP" "$NULLOP"
     747            load_module "drv/$MOD_VBOXUSB" "$DESC_VBOXUSB" "$FATALOP"
    719748        fi
    720749    fi
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