Index: /trunk/src/VBox/Installer/solaris/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Installer/solaris/Makefile.kmk	(revision 22081)
+++ /trunk/src/VBox/Installer/solaris/Makefile.kmk	(revision 22082)
@@ -155,5 +155,5 @@
 solaris-bin_SOURCES = \
 	$(if $(VBOX_WITH_PYTHON),$(PATH_ROOT)/src/VBox/Frontends/VBoxShell/vboxshell.py,) \
-	$(VBOX_PATH_SOL_INST_SRC)/vboxdrv.sh \
+	$(VBOX_PATH_SOL_INST_SRC)/vboxconfig.sh \
 	$(VBOX_PATH_SOL_INST_SRC)/VBox.sh \
 	$(VBOX_PATH_SOL_INST_SRC)/ipsinstall.sh \
@@ -267,5 +267,5 @@
 
 SOLARIS_COMMON_EXES = \
-	vboxdrv.sh \
+	vboxconfig.sh \
 	VBox.sh \
 	ipsinstall.sh \
@@ -550,8 +550,8 @@
 	$(QUIET)$(SED) \
 		-e "s/_HARDENED_/$(if $(VBOX_WITH_HARDENED),hardened,)/" \
-		--output $(SOLARIS_VBOXINST_DIR)/vboxdrv.sh.tmp \
-		 $(PATH_BIN)/vboxdrv.sh
-	$(QUIET)$(INSTALL) -m 0755 $(SOLARIS_VBOXINST_DIR)/vboxdrv.sh.tmp                                       $(SOLARIS_VBOXINST_DIR)/vboxdrv.sh
-	$(QUIET)$(RM) -f $(SOLARIS_VBOXINST_DIR)/vboxdrv.sh.tmp
+		--output $(SOLARIS_VBOXINST_DIR)/vboxconfig.sh.tmp \
+		 $(PATH_BIN)/vboxconfig.sh
+	$(QUIET)$(INSTALL) -m 0755 $(SOLARIS_VBOXINST_DIR)/vboxconfig.sh.tmp                                    $(SOLARIS_VBOXINST_DIR)/vboxconfig.sh
+	$(QUIET)$(RM) -f $(SOLARIS_VBOXINST_DIR)/vboxconfig.sh.tmp
 	$(QUIET)$(if $(VBOX_WITH_QTGUI),$(INSTALL) -m 0644 $(VBOX_PATH_SOL_INST_SRC)/virtualbox.desktop         $(SOLARIS_USRSHR_APPS_DIR)/virtualbox.desktop,)
 	$(QUIET)$(INSTALL) -m 0644 $(SOLARIS_OUT_BIN)/VBox.png                                                  $(SOLARIS_USRSHR_PIXMAPS_DIR)/VBox.png
Index: /trunk/src/VBox/Installer/solaris/postinstall.sh
===================================================================
--- /trunk/src/VBox/Installer/solaris/postinstall.sh	(revision 22081)
+++ /trunk/src/VBox/Installer/solaris/postinstall.sh	(revision 22082)
@@ -21,17 +21,4 @@
 #
 
-install_python_bindings()
-{
-    PYTHONBIN=$1
-    if test -x "$PYTHONBIN"; then
-        VBOX_INSTALL_PATH=/opt/VirtualBox
-        export VBOX_INSTALL_PATH
-        cd /opt/VirtualBox/sdk/installer
-        $PYTHONBIN ./vboxapisetup.py install > /dev/null
-        return 0
-    fi
-    return 1
-}
-
 # Check for xVM/Xen
 currentisa=`uname -i`
@@ -44,132 +31,16 @@
 currentzone=`zonename`
 if test "$currentzone" = "global"; then
-    echo "Loading VirtualBox kernel modules..."
-    /opt/VirtualBox/vboxdrv.sh stopall silentunload checkarch
+    echo "Checking for older bits..."
+    /opt/VirtualBox/vboxconfig.sh preremove fatal
     rc=$?
     if test "$rc" -eq 0; then
-        /opt/VirtualBox/vboxdrv.sh start
-        rc=$?
-
-        # VBoxDrv loaded successfully, proceed with the rest...
-        if test "$rc" -eq 0; then
-            # Load VBoxNetAdapter vboxnet
-            if test -f /platform/i86pc/kernel/drv/vboxnet.conf; then
-                /opt/VirtualBox/vboxdrv.sh netstart
-                rc=$?
-
-                # nwam/dhcpagent fix
-                nwamfile=/etc/nwam/llp
-                nwambackupfile=$nwamfile.vbox
-                if test "$rc" -eq 0 && test -f "$nwamfile"; then
-                    sed -e '/vboxnet/d' $nwamfile > $nwambackupfile
-                    echo "vboxnet0	static 192.168.56.1" >> $nwambackupfile
-                    mv -f $nwambackupfile $nwamfile
-                fi
-            fi
-
-            # Load VBoxNetFilter vboxflt
-            if test -f /platform/i86pc/kernel/drv/vboxflt.conf; then
-                /opt/VirtualBox/vboxdrv.sh fltstart
-                rc=$?
-            fi
-
-            # Load VBoxUSBMon vboxusbmon (do NOT load for Solaris 10)
-            if test -f /platform/i86pc/kernel/drv/vboxusbmon.conf && test "$osversion" != "5.10"; then
-                /opt/VirtualBox/vboxdrv.sh usbstart
-                rc=$?
-                if test "$rc" -eq 0; then
-                    # Add vboxusbmon to the devlink.tab
-                    sed -e '/name=vboxusbmon/d' /etc/devlink.tab > /etc/devlink.vbox
-                    echo "type=ddi_pseudo;name=vboxusbmon	\D" >> /etc/devlink.vbox
-                    mv -f /etc/devlink.vbox /etc/devlink.tab
-                fi
-            fi
-        fi
+        echo "Installing new bits..."
+        /opt/VirtualBox/vboxconfig.sh postinstall
     fi
-
-    # Fail on any errors while unloading previous modules because it makes it very hard to
-    # track problems when older vboxdrv is hanging about in memory and add_drv of the new
-    # one suceeds and it appears as though the new one is being used.
-    if test "$rc" -ne 0; then
-        echo "## Loading failed. Aborting installation."
-        exit 2
-    fi
-
-    echo "Configuring services and drivers..."
-
-    # Web service
-    if test -f /var/svc/manifest/application/virtualbox/virtualbox-webservice.xml; then
-        /usr/sbin/svccfg import /var/svc/manifest/application/virtualbox/virtualbox-webservice.xml
-        /usr/sbin/svcadm disable -s svc:/application/virtualbox/webservice:default
-    fi
-
-    # Add vboxdrv to the devlink.tab
-    sed -e '/name=vboxdrv/d' /etc/devlink.tab > /etc/devlink.vbox
-    echo "type=ddi_pseudo;name=vboxdrv	\D" >> /etc/devlink.vbox
-    mv -f /etc/devlink.vbox /etc/devlink.tab
-
-    # Create the device link
-    /usr/sbin/devfsadm -i vboxdrv
-
-    # Don't create link for Solaris 10
-    if test -f /platform/i86pc/kernel/drv/vboxusbmon.conf && test "$osversion" != "5.10"; then
-        /usr/sbin/devfsadm -i vboxusbmon
-    fi
-    sync
-
-    # We need to touch the desktop link in order to add it to the menu right away
-    if test -f "/usr/share/applications/virtualbox.desktop"; then
-        touch /usr/share/applications/virtualbox.desktop
-    fi
-
-    # Zone access service
-    if test -f /var/svc/manifest/application/virtualbox/virtualbox-zoneaccess.xml; then
-        /usr/sbin/svccfg import /var/svc/manifest/application/virtualbox/virtualbox-zoneaccess.xml
-        /usr/sbin/svcadm enable -s svc:/application/virtualbox/zoneaccess
-    fi
-
-    # Install python bindings
-    if test -f "/opt/VirtualBox/sdk/installer/vboxapisetup.py" || test -h "/opt/VirtualBox/sdk/installer/vboxapisetup.py"; then
-        PYTHONBIN=`which python 2> /dev/null`
-        if test -f "$PYTHONBIN" || test -h "$PYTHONBIN"; then
-            echo "Installing Python bindings..."
-
-            INSTALLEDIT=1
-            PYTHONBIN=`which python2.4 2>/dev/null`
-            install_python_bindings "$PYTHONBIN"
-            if test "$?" -eq 0; then
-                INSTALLEDIT=0
-            fi
-            PYTHONBIN=`which python2.5 2>/dev/null`
-            install_python_bindings "$PYTHONBIN"
-            if test "$?" -eq 0; then
-                INSTALLEDIT=0
-            fi
-            PYTHONBIN=`which python2.6 2>/dev/null`
-            install_python_bindings "$PYTHONBIN"
-            if test "$?" -eq 0; then 
-                INSTALLEDIT=0
-            fi
-
-            # remove files installed by Python build
-            rm -rf /opt/VirtualBox/sdk/installer/build
-
-            if test "$INSTALLEDIT" -ne 0; then
-                echo "** No suitable Python version found. Requires Python 2.4, 2.5 or 2.6."
-            fi
-        else
-            echo "** WARNING! Python not found, skipped installed Python bindings."
-            echo "   Manually run '/opt/VirtualBox/sdk/installer/vboxapisetup.py install'"
-            echo "   to install the bindings when python is available."
-        fi
-    fi
-
-    # Update boot archive
-    BOOTADMBIN=/sbin/bootadm
-    if test -x "$BOOTADMBIN"; then
-        echo "Updating boot archive..."
-        $BOOTADMBIN update-archive > /dev/null
+    rc=$?
+    if test "$rc" -eq 0; then
+        echo "Completed Successfully!"
     else
-        echo "## $BOOTADMBIN not found/executable. Skipped explicit boot-archive update."
+        echo "Completed but with errors."
     fi
 fi
@@ -180,4 +51,4 @@
 
 # return 20 = requires reboot, 2 = partial failure, 0  = success
-exit 0
+exit "$rc"
 
Index: /trunk/src/VBox/Installer/solaris/preremove.sh
===================================================================
--- /trunk/src/VBox/Installer/solaris/preremove.sh	(revision 22081)
+++ /trunk/src/VBox/Installer/solaris/preremove.sh	(revision 22082)
@@ -23,51 +23,8 @@
 currentzone=`zonename`
 if test "$currentzone" = "global"; then
-    # stop and unregister webservice SMF (if present)
-    webservicefound=`svcs -a | grep "virtualbox/webservice"`
-    if test ! -z "$webservicefound"; then
-        /usr/sbin/svcadm disable -s svc:/application/virtualbox/webservice:default
-        /usr/sbin/svccfg delete svc:/application/virtualbox/webservice:default
-    fi
-
-    # stop and unregister zoneaccess SMF (if present)
-    zoneaccessfound=`svcs -a | grep "virtualbox/zoneaccess"`
-    if test ! -z "$zoneaccessfound"; then
-        /usr/sbin/svcadm disable -s svc:/application/virtualbox/zoneaccess
-        /usr/sbin/svccfg delete svc:/application/virtualbox/zoneaccess
-    fi
-
-    # vboxdrv.sh would've been installed, we just need to call it.
-    /opt/VirtualBox/vboxdrv.sh usbstop alwaysremdrv
-    /opt/VirtualBox/vboxdrv.sh netstop alwaysremdrv
-    /opt/VirtualBox/vboxdrv.sh fltstop alwaysremdrv
-    /opt/VirtualBox/vboxdrv.sh stop alwaysremdrv
-
-    # remove devlink.tab entry for vboxdrv
-    sed -e '
-/name=vboxdrv/d' /etc/devlink.tab > /etc/devlink.vbox
-    mv -f /etc/devlink.vbox /etc/devlink.tab
-
-    # remove nwam entry for vboxnet
-    nwamfile=/etc/nwam/llp
-    nwambackupfile=$nwamfile.vbox
-    if test -f "$nwamfile"; then
-        sed -e '/vboxnet/d' $nwamfile > $nwambackupfile
-        mv -f $nwambackupfile $nwamfile
-    fi
-
-    # remove devlink.tab entry for vboxusbmon
-    sed -e '
-/name=vboxusbmon/d' /etc/devlink.tab > /etc/devlink.vbox
-    mv -f /etc/devlink.vbox /etc/devlink.tab
-
-    # remove the devlinks
-    if test -h "/dev/vboxdrv" || test -f "/dev/vboxdrv"; then
-        rm -f /dev/vboxdrv
-    fi
-    if test -h "/dev/vboxusbmon" || test -f "/dev/vboxusbmon"; then
-        rm -f /dev/vboxusbmon
-    fi
+    /opt/VirtualBox/vboxconfig.sh preremove
 fi
 
 echo "Done."
+exit 0
 
Index: /trunk/src/VBox/Installer/solaris/vboxconfig.sh
===================================================================
--- /trunk/src/VBox/Installer/solaris/vboxconfig.sh	(revision 22081)
+++ /trunk/src/VBox/Installer/solaris/vboxconfig.sh	(revision 22082)
@@ -23,5 +23,4 @@
 # Never use exit 2 or exit 20 etc., the return codes are used in
 # SRv4 postinstall procedures which carry special meaning. Just use exit 1 for failure.
-set -x
 
 HOST_OS_VERSION=`uname -r`
@@ -44,17 +43,17 @@
 # "vboxdrv" is also used in sed lines here (change those as well if it ever changes)
 MOD_VBOXDRV=vboxdrv
-DESC_VBOXDRV="VirtualBox HostDriver"
+DESC_VBOXDRV="Host"
 
 MOD_VBOXNET=vboxnet
-DESC_VBOXNET="VirtualBox NetAdapter"
+DESC_VBOXNET="NetAdapter"
 
 MOD_VBOXFLT=vboxflt
-DESC_VBOXFLT="VirtualBox NetFilter"
+DESC_VBOXFLT="NetFilter"
 
 MOD_VBI=vbi
-DESC_VBI="VirtualBox Kernel Interface"
+DESC_VBI="Kernel Interface"
 
 MOD_VBOXUSBMON=vboxusbmon
-DESC_VBOXUSBMON="VirtualBox USBMonitor"
+DESC_VBOXUSBMON="USBMonitor"
 
 FATALOP=fatal
@@ -270,5 +269,5 @@
 
     if test $? -ne 0; then
-        errorprint "Adding:  $moddesc module ...FAILED!"
+        errorprint "   - Adding: $moddesc module ...FAILED!"
         if test "$fatal" = "$FATALOP"; then
             exit 1
@@ -295,8 +294,8 @@
         $BIN_REMDRV $modname
         if test $? -eq 0; then
-            success "Removed:  $moddesc module"
+            success "   - Removed: $moddesc module"
             return 0
         else
-            errorprint "Removing: $moddesc  ...FAILED!"
+            errorprint "   - Removing: $moddesc  ...FAILED!"
             if test "$fatal" = "$FATALOP"; then
                 exit 1
@@ -323,7 +322,7 @@
         $BIN_MODUNLOAD -i $modid
         if test $? -eq 0; then
-            success "Unloaded:  $moddesc module"
+            success "   - Unloaded:  $moddesc module"
         else
-            errorprint "Unloading:  $moddesc  ...FAILED!"
+            errorprint "   - Unloading:  $moddesc  ...FAILED!"
             if test "$fatal" = "$FATALOP"; then
                 exit 1
@@ -350,8 +349,8 @@
     $BIN_MODLOAD -p $modname
     if test $? -eq 0; then
-        success "Loaded:  $moddesc module"
+        success "   - Loaded:  $moddesc module"
         return 0
     else
-        errorprint "Loading:  $modesc  ...FAILED!"
+        errorprint "   - Loading:  $modesc  ...FAILED!"
         if test "$fatal" = "$FATALOP"; then
             exit 1
@@ -380,5 +379,5 @@
     /usr/sbin/devfsadm -i "$MOD_VBOXDRV"
 
-    if test $? -eq 0; then
+    if test $? -eq 0 && test -h "/dev/vboxdrv"; then
 
         if test -f /platform/i86pc/kernel/drv/vboxnet.conf; then
@@ -421,4 +420,5 @@
 {
     fatal=$1
+
     # Remove vboxdrv from devlink.tab
     devlinkfound=`cat /etc/devlink.tab | grep vboxdrv`
@@ -435,9 +435,6 @@
     fi
 
-    # USBMonitor might not even be installed, but anyway...
-    if test -f /platform/i86pc/kernel/drv/vboxusbmon.conf && test "$HOST_OS_VERSION" != "5.10"; then
-        unload_module "$MOD_VBOXUSBMON" "$DESC_VBOXUSBMON" "$fatal"
-        rem_driver "$MOD_VBOXUSBMON" "$DESC_VBOXUSBMON" "$fatal"
-    fi
+    unload_module "$MOD_VBOXUSBMON" "$DESC_VBOXUSBMON" "$fatal"
+    rem_driver "$MOD_VBOXUSBMON" "$DESC_VBOXUSBMON" "$fatal"
 
     unload_module "$MOD_VBOXFLT" "$DESC_VBOXFLT" "$fatal"
@@ -458,4 +455,12 @@
     if test -h "/dev/vboxusbmon" || test -f "/dev/vboxusbmon"; then
         rm -f /dev/vboxusbmon
+    fi
+
+    # unpatch nwam/dhcpagent fix
+    nwamfile=/etc/nwam/llp
+    nwambackupfile=$nwamfile.vbox
+    if test -f "$nwamfile"; then
+        sed -e '/vboxnet/d' $nwamfile > $nwambackupfile
+        mv -f $nwambackupfile $nwamfile
     fi
 
@@ -491,4 +496,9 @@
         $BIN_SVCADM disable -s svc:/application/virtualbox/webservice:default
         $BIN_SVCCFG delete svc:/application/virtualbox/webservice:default
+        if test "$?" -eq 0; then
+            success "   - Unloaded:  Web service"
+        else
+            warnprint "   - Unloading:  Web service  ...ERROR(S)."
+        fi
     fi
 
@@ -498,6 +508,11 @@
         $BIN_SVCADM disable -s svc:/application/virtualbox/zoneaccess
         $BIN_SVCCFG delete svc:/application/virtualbox/zoneaccess
-    fi
-    
+        if test "$?" -eq 0; then
+            success "   - Unloaded:  Zone access service"
+        else
+            warnprint "   - Unloading:  Zone access service  ...ERROR(S)."
+        fi
+    fi
+
     # unplumb vboxnet0
     vboxnetup=`$BIN_IFCONFIG vboxnet0 >/dev/null 2>&1`
@@ -514,7 +529,7 @@
 
 
-# post_install()
-# !! failure is always fatal
-post_install()
+# postinstall()
+# !! failure is always fatal
+postinstall()
 {
     infoprint "Loading VirtualBox kernel modules..."
@@ -522,5 +537,5 @@
 
     if test "$?" -eq 0; then
-        if test -f /platform/i86pc/kernel/drv/vboxnet.conf; then        
+        if test -f /platform/i86pc/kernel/drv/vboxnet.conf; then
             # nwam/dhcpagent fix
             nwamfile=/etc/nwam/llp
@@ -537,4 +552,5 @@
                 $BIN_IFCONFIG vboxnet0 192.168.56.1 netmask 255.255.255.0 up
             else
+                # Should this be fatal?
                 warnprint "Failed to bring up vboxnet0!!"
             fi
@@ -549,4 +565,9 @@
             /usr/sbin/svccfg import /var/svc/manifest/application/virtualbox/virtualbox-webservice.xml
             /usr/sbin/svcadm disable -s svc:/application/virtualbox/webservice:default
+            if test "$?" -eq 0; then
+                success "   - Loaded:  Web service"
+            else
+                warnprint "   - Loading:  Web service  ...ERROR(S)."
+            fi
         fi
 
@@ -555,4 +576,9 @@
             /usr/sbin/svccfg import /var/svc/manifest/application/virtualbox/virtualbox-zoneaccess.xml
             /usr/sbin/svcadm enable -s svc:/application/virtualbox/zoneaccess
+            if test "$?" -eq 0; then
+                success "   - Loaded:  Zone access service"
+            else
+                warnprint "   - Loading:  Zone access service  ...ERROR(S)."
+            fi
         fi
 
@@ -576,5 +602,5 @@
                 PYTHONBIN=`which python2.6 2>/dev/null`
                 install_python_bindings "$PYTHONBIN"
-                if test "$?" -eq 0; then 
+                if test "$?" -eq 0; then
                     INSTALLEDIT=0
                 fi
@@ -585,4 +611,5 @@
                 if test "$INSTALLEDIT" -ne 0; then
                     warnprint "No suitable Python version found. Required Python 2.4, 2.5 or 2.6."
+                    warnprint "Skipped installing the Python bindings."
                 fi
             else
@@ -603,8 +630,7 @@
 }
 
-
-# pre_remove([fatal])
+# preremove([fatal])
 # failure: depends on [fatal]
-pre_remove()
+preremove()
 {
     fatal=$1
@@ -636,10 +662,10 @@
 
 case "$drvop" in
-post_install)
+postinstall)
     check_module_arch
-    post_install
+    postinstall
     ;;
-pre_remove)
-    pre_remove "$fatal"
+preremove)
+    preremove "$fatal"
     ;;
 install_drivers)
@@ -651,5 +677,5 @@
     ;;
 *)
-    echo "Usage: $0 post_install|pre_remove|install_drivers|remove_drivers [fatal]"
+    echo "Usage: $0 postinstall|preremove|install_drivers|remove_drivers [fatal] [silent]"
     exit 1
 esac
