Hi,
Sorry for the delayed response but I've managed to find some time to
make a bit of progress with this.
For now, I've added a separate function which gets called if the 'uname
-v' reports one of the 3rd party Solaris variants (OI/Illumos etc.).
That function however just declares it as S11/151. I also added your
suggestion for the vboxinst_vboxusb touch file although I modified your
code a little (checking presence of vboxusbmon.conf first and then
checking the remaining bits).
These changes have been committed to trunk and I intend to backport this
to 5.0.x branch in the next few days. Once this is in, we can add better
support for these distros' kernel easily as risk of breaking the
official Solaris versions are minimized.
If you want an immediate diff, I've attached it here.
Regards,
Ram.
On 09/14/15 05:11 PM, Ramshankar wrote:
Hi,
Not until the problems are ironed out that all the cases work, or we
make the patch
safe for the existing cases (official S10/S11 versions) and have a
distinct separate
code path for all the remaining cases.
I'll take a look later this week when I have some time if it's possible
to separate
first using uname, and then drill down into the pkg(5) kernel package
version parsing.
My primary concern is to not break any of the existing cases.
Regards,
Ram.
On 09/11/2015 01:14 PM, Jim Klimov wrote:
Hi Ram,
Is there any progress about integrating some or all of this
vboxconfog.sh improvement into the upstream releases?
Thanks,
Jim
On 2015-07-22 18:48, Jim Klimov wrote:
Hello Ram,
Sorry I was away from networking for a while so could not check.
I ran vboxconfig.sh replicas modified by your and by my patches,
instrumented to print out major/minor versions after get_sysinfo and
abort. Results differ:
OI_151a8 : both detected as 11 / 151
PKGFMRI=pkg://openindiana.org/system/kernel@0.5.11,5.11-0.151.1.8:20130721T133142Z
OmniOS Bloody 151015: mine detected as 11 / 151, yours detected as 11 /
151015 (which will be greater than 159 in a later test)
PKGFMRI=pkg://omnios/system/kernel@0.5.11,5.11-0.151015:20150714T040209Z
OI Hipster: mine detected as 11 / 151, yours detected as 11 / 0
PKGFMRI=pkg://openindiana.org/system/kernel@0.5.11-2015.0.1.15147:20150721T130056Z
SXCE snv_117 (svr4): mine detected as 11 / 117 (interim
HOST_OS_MAJORVERSION=SXCE), yours detected as a strange Solaris 11
without pkg(5) and aborted... VirtualBox does run there (at least an
older version, and IIRC without both of the advanced modules) ;-)
Jim
----- Исходное сообщение -----
От: Ramshankar <ramshankar.venkatara...@oracle.com>
Дата: Tuesday, July 7, 2015 16:25
Тема: Re: [vbox-dev] Patch to support installation on non-Sun/Oracle
Solaris hosts
Кому (To): j...@cos.ru
Копия (Cc): vbox-dev@virtualbox.org
> Hi Jim,
>
> On 07/ 7/15 02:45 PM, Jim Klimov wrote:
> > Hello Ram,
> >
> > Makes sense, and that's why I started with touch-files
> following an
> > established example so as to support anything regardless of
> matching,> only an admin (or wrap-package) who'd touch the file
> is needed. ;)
>
> Adding a touch file is okay. I have no objections to having that
> option in.
>
> > I think a "case" would be more readable and conservative on
> resources> than a stack of if-elif-else-fi (don't have to call
> an external program
> > too many times) and would suffice especially since you are comparing
> > fixed strings or, at most, simple wildcards here.
>
> Yes, I'm aware of this but as of now, I'd rather have everything
> working
> than
> fork-avoidance optimizations. This can come at a later step.
>
> > In the patch itself, here's a bit that worries me: either I've
> had a
> > night too sleepless, or there is a logical error here:
> >
> >
> + STR_KERN_MAJOR=`echo "$PKGFMRI" | sed
> > 's/^.*\@//;s/\,.*//;s/\-.*//'`
> >
> + if test "$STR_KERN_MAJOR" = "5.12"; then
> > + ###(comments snipped)
> >
> + BRANCH_VERSION=$STR_KERN_MAJOR
> >
> + HOST_OS_MAJORVERSION=`echo "$BRANCH_VERSION" |
> > cut -f2 -d'-' | cut -f1,2 -d'.'`
> >
> + if test "$HOST_OS_MAJORVERSION" = "5.12"; then
> >
> + HOST_OS_MAJORVERSION="12"
> >
> + HOST_OS_MINORVERSION=`echo
> > "$BRANCH_VERSION" | cut -f2 -d'-' | cut -f6 -d'.'`
> >
> + return 0
> >
> + else
> >
> + errorprint "Failed to parse the Solaris
> > kernel major version."
> >
> + exit 1
> >
> > Here you have STR_KERN_MAJOR=="5.12" (fixed, no more, no
> less), then
> > assign BRANCH_VERSION to the same "5.12" and try to `cut`
> major/minor> versions out of it. You do get "5.12" again as
> major, but minor without
> > the dash-separated part of the FMRI is meaningless (and ends
> up empty).
>
> Oops, my mistake. Thanks. I've attached a new patch of that part
> of the code
> which I think should address the problem.
>
> > Otherwise, cutting the "5.11", "0.5.11" or "5.12" parts seems
> to work
> > correctly here.
> >
> > Also, in line 10 (added comment for OI Hipster string) there
> is "of"
> > instead of "or" ;)
>
> Also fixed in the patch I've attached.
>
> Let me know how this works for the OS/distros in question here.
>
> Regards,
> Ram.
>
_______________________________________________
vbox-dev mailing list
vbox-dev@virtualbox.org
https://www.virtualbox.org/mailman/listinfo/vbox-dev
_______________________________________________
vbox-dev mailing list
vbox-dev@virtualbox.org
https://www.virtualbox.org/mailman/listinfo/vbox-dev
_______________________________________________
vbox-dev mailing list
vbox-dev@virtualbox.org
https://www.virtualbox.org/mailman/listinfo/vbox-dev
Index: /trunk/src/VBox/Installer/solaris/vboxconfig.sh
===================================================================
--- /trunk/src/VBox/Installer/solaris/vboxconfig.sh (revision 103079)
+++ /trunk/src/VBox/Installer/solaris/vboxconfig.sh (revision 103214)
@@ -229,8 +229,25 @@
}
-# get_sysinfo
+# get_sysinfo_other()
+# cannot fail
+get_unofficial_sysinfo()
+{
+ HOST_OS_MAJORVERSION="11"
+ HOST_OS_MINORVERSION="151"
+}
+
+# get_sysinfo()
# cannot fail
get_sysinfo()
{
+ # First check 'uname -v' and weed out the recognized, unofficial distros of Solaris
+ STR_OSVER=`uname -v`
+ case "$STR_OSVER" in
+ omnios*|oi_*|illumos*)
+ get_unofficial_sysinfo
+ return 0
+ ;;
+ esac
+
BIN_PKG=`which pkg 2> /dev/null`
if test -x "$BIN_PKG"; then
@@ -672,5 +689,7 @@
else
# If host is S10 or S11 (< snv_159) or vboxbow isn't shipped, then load vboxflt
- 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
+ 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
load_vboxflt
else
@@ -681,40 +700,50 @@
# Load VBoxUSBMon, VBoxUSB
- if test -f "$DIR_CONF/vboxusbmon.conf" && test "$HOST_OS_MAJORVERSION" != "10"; then
- # For VirtualBox 3.1 the new USB code requires Nevada > 123 i.e. S12+ or S11 b124+
- if test "$HOST_OS_MAJORVERSION" -gt 11 || (test "$HOST_OS_MAJORVERSION" -eq 11 && test "$HOST_OS_MINORVERSION" -gt 123); then
- # Add a group "vboxuser" (8-character limit) for USB access.
- # All users which need host USB-passthrough support will have to be added to this group.
- groupadd vboxuser >/dev/null 2>&1
-
- add_driver "$MOD_VBOXUSBMON" "$DESC_VBOXUSBMON" "$FATALOP" "not-$NULLOP" "'* 0666 root sys'"
- load_module "drv/$MOD_VBOXUSBMON" "$DESC_VBOXUSBMON" "$FATALOP"
-
- chown root:vboxuser "/devices/pseudo/vboxusbmon@0:vboxusbmon"
-
- # Add vboxusbmon to devlink.tab
- sed -e '/name=vboxusbmon/d' "$PKG_INSTALL_ROOT/etc/devlink.tab" > "$PKG_INSTALL_ROOT/etc/devlink.vbox"
- echo "type=ddi_pseudo;name=vboxusbmon \D" >> "$PKG_INSTALL_ROOT/etc/devlink.vbox"
- mv -f "$PKG_INSTALL_ROOT/etc/devlink.vbox" "$PKG_INSTALL_ROOT/etc/devlink.tab"
-
- # Create the device link for non-remote installs
- if test "$REMOTEINST" -eq 0; then
- /usr/sbin/devfsadm -i "$MOD_VBOXUSBMON"
- if test $? -ne 0; then
- errorprint "Failed to create device link for $MOD_VBOXUSBMON."
- exit 1
- fi
- fi
-
- # Add vboxusb if present
- # This driver is special, we need it in the boot-archive but since there is no
- # USB device to attach to now (it's done at runtime) it will fail to attach so
- # redirect attaching failure output to /dev/null
- if test -f "$DIR_CONF/vboxusb.conf"; then
- add_driver "$MOD_VBOXUSB" "$DESC_VBOXUSB" "$FATALOP" "$NULLOP"
- load_module "drv/$MOD_VBOXUSB" "$DESC_VBOXUSB" "$FATALOP"
- fi
- else
- warnprint "Solaris 11 build 124 or higher required for USB support. Skipped installing USB support."
+ try_vboxusb="no"
+ if test -f "$DIR_CONF/vboxusbmon.conf"; then
+ if test -f "$PKG_INSTALL_ROOT/etc/vboxinst_vboxusb"; then
+ subprint "Detected: Force-load file $PKG_INSTALL_ROOT/etc/vboxinst_vboxusb."
+ try_vboxusb="yes"
+ else
+ # For VirtualBox 3.1 the new USB code requires Nevada > 123 i.e. S12+ or S11 b124+
+ if test "$HOST_OS_MAJORVERSION" -gt 11 \
+ || (test "$HOST_OS_MAJORVERSION" -eq 11 && test "$HOST_OS_MINORVERSION" -gt 123); then
+ try_vboxusb="yes"
+ else
+ warnprint "Solaris 11 build 124 or higher required for USB support. Skipped installing USB support."
+ fi
+ fi
+ fi
+ if test "$try_vboxusb" = "yes"; then
+ # Add a group "vboxuser" (8-character limit) for USB access.
+ # All users which need host USB-passthrough support will have to be added to this group.
+ groupadd vboxuser >/dev/null 2>&1
+
+ add_driver "$MOD_VBOXUSBMON" "$DESC_VBOXUSBMON" "$FATALOP" "not-$NULLOP" "'* 0666 root sys'"
+ load_module "drv/$MOD_VBOXUSBMON" "$DESC_VBOXUSBMON" "$FATALOP"
+
+ chown root:vboxuser "/devices/pseudo/vboxusbmon@0:vboxusbmon"
+
+ # Add vboxusbmon to devlink.tab
+ sed -e '/name=vboxusbmon/d' "$PKG_INSTALL_ROOT/etc/devlink.tab" > "$PKG_INSTALL_ROOT/etc/devlink.vbox"
+ echo "type=ddi_pseudo;name=vboxusbmon \D" >> "$PKG_INSTALL_ROOT/etc/devlink.vbox"
+ mv -f "$PKG_INSTALL_ROOT/etc/devlink.vbox" "$PKG_INSTALL_ROOT/etc/devlink.tab"
+
+ # Create the device link for non-remote installs
+ if test "$REMOTEINST" -eq 0; then
+ /usr/sbin/devfsadm -i "$MOD_VBOXUSBMON"
+ if test $? -ne 0; then
+ errorprint "Failed to create device link for $MOD_VBOXUSBMON."
+ exit 1
+ fi
+ fi
+
+ # Add vboxusb if present
+ # This driver is special, we need it in the boot-archive but since there is no
+ # USB device to attach to now (it's done at runtime) it will fail to attach so
+ # redirect attaching failure output to /dev/null
+ if test -f "$DIR_CONF/vboxusb.conf"; then
+ add_driver "$MOD_VBOXUSB" "$DESC_VBOXUSB" "$FATALOP" "$NULLOP"
+ load_module "drv/$MOD_VBOXUSB" "$DESC_VBOXUSB" "$FATALOP"
fi
fi
_______________________________________________
vbox-dev mailing list
vbox-dev@virtualbox.org
https://www.virtualbox.org/mailman/listinfo/vbox-dev