Index: /trunk/src/VBox/Additions/solaris/Installer/makepackage.sh
===================================================================
--- /trunk/src/VBox/Additions/solaris/Installer/makepackage.sh	(revision 41697)
+++ /trunk/src/VBox/Additions/solaris/Installer/makepackage.sh	(revision 41698)
@@ -31,4 +31,9 @@
     exit 1
 fi
+ostype=`uname -s`
+if test "$ostype" != "Linux" && test "$ostype" != "SunOS" ; then
+  echo "Linux/Solaris not detected."
+  exit 1
+fi
 
 VBOX_BASEPKG_DIR=$1
@@ -39,5 +44,14 @@
 VBOX_PKGNAME=SUNWvboxguest
 VBOX_AWK=/usr/bin/awk
-VBOX_GGREP=/usr/sfw/bin/ggrep
+case "$ostype" in
+"SunOS")
+  VBOX_GGREP=/usr/sfw/bin/ggrep
+  VBOX_SOL_PKG_DEV=/var/spool/pkg
+  ;;
+*)
+  VBOX_GGREP=`which grep`
+  VBOX_SOL_PKG_DEV=$4
+  ;;
+esac
 VBOX_AWK=/usr/bin/awk
 
@@ -118,10 +132,10 @@
 
 # create the package instance
-pkgmk -p $VBOXPKG_TIMESTAMP -o -r .
+pkgmk -d $VBOX_SOL_PKG_DEV -p $VBOXPKG_TIMESTAMP -o -r .
 
 # translate into package datastream
-pkgtrans -s -o /var/spool/pkg `pwd`/$VBOX_PKGFILENAME "$VBOX_PKGNAME"
+pkgtrans -s -o "$VBOX_SOL_PKG_DEV" `pwd`/$VBOX_PKGFILENAME "$VBOX_PKGNAME"
 
-rm -rf "/var/spool/pkg/$VBOX_PKGNAME"
+rm -rf "$VBOX_SOL_PKG_DEV/$VBOX_PKGNAME"
 exit $?
 
