--- hildon-initscripts-0.8.14-orig/af-sb-init.sh.in	2005-05-18 13:16:58.000000000 +0300
+++ hildon-initscripts-0.8.14/af-sb-init.sh.in	2005-06-05 19:50:52.000000000 +0300
@@ -68,6 +68,8 @@
 
 # Let's use SB launcher wrapper
 export LAUNCHWRAPPER=/usr/bin/scratchbox-launcher.sh
+export LAUNCHWRAPPER_NICE=/usr/bin/scratchbox-launcher.sh
+export LAUNCHWRAPPER_TRYRESTART=/usr/bin/scratchbox-launcher.sh
 
 # Check our environment
 if [ -e /targets/links/scratchbox.config ]; then
@@ -79,9 +81,14 @@
     fi
 
     # we are using Scratchbox and sbrsh
-    SBRSH="sbrsh $SBOX_TARGET_NAME"
+    # Test if in sbox 0.9.8 before deciding how to call sbrsh
+    if cat /scratchbox/etc/scratchbox-version | grep "0\.9\.8" >/dev/null; then
+    	SBRSH="sbrsh $SBOX_TARGET_NAME"
+    else 
+	SBRSH="sbrsh -c /targets/$SBOX_TARGET_NAME.sbrsh"
+    fi
   fi
-
+ 
   # Modify the DBUS session bus socket so that it is different for each user.
   if [ -e /etc/dbus-1/session.conf ]; then
       if grep 'session_bus_socket</listen>' /etc/dbus-1/session.conf; then
--- hildon-initscripts-0.8.14-orig/debian/changelog	2005-05-18 13:16:57.000000000 +0300
+++ hildon-initscripts-0.8.14/debian/changelog	2005-06-03 19:51:04.000000000 +0300
@@ -1,3 +1,10 @@
+hildon-initscripts (0.8.14-1sbox1.0) unstable; urgency=low
+
+  * Added support for QEMU
+  * Added support for Scratchbox 1.0
+
+ -- Valtteri Rahkonen <valtteri@rahkonen.org>  Fri,  3 Jun 2005 19:47:00 +0200
+
 hildon-initscripts (0.8.14-1) unstable; urgency=low
 
   * Changed the temporary files to user specific
--- hildon-initscripts-0.8.14-orig/scratchbox-launcher.sh	2005-05-18 13:16:58.000000000 +0300
+++ hildon-initscripts-0.8.14/scratchbox-launcher.sh	2005-06-03 20:25:14.000000000 +0300
@@ -43,10 +43,21 @@
     fi
 
     # we are using Scratchbox and sbrsh
-    SBRSH="sbrsh $SBOX_TARGET_NAME"
+    # Test if in sbox 0.9.8 before deciding how to call sbrsh
+    if cat /scratchbox/etc/scratchbox-version | grep "0\.9\.8" >/dev/null; then
+      SBRSH="sbrsh $SBOX_TARGET_NAME"
+    else 
+      SBRSH="sbrsh -c /targets/$SBOX_TARGET_NAME.sbrsh"
+    fi
   fi
 fi
 
+# Are we runnung QEMU?
+if echo $SBOX_CPUTRANSPARENCY_METHOD | grep "qemu-arm$" >/dev/null; then
+  SBRSH=""
+fi 
+								  
+
 
 if [ $STOP = TRUE ]; then
     if [ ! -e $PIDFILE ]; then
@@ -68,10 +79,16 @@
     DOIT=TRUE
     if [ -e $PIDFILE ]; then
 	PID=`cat $PIDFILE`
-	$SBRSH grep "$BASENAME" /proc/$PID/cmdline >/dev/null 2>&1
+
+	if [ -z "$SBRSH" ]; then
+	  grep "$BASENAME" /proc/$PID/cmdline >/dev/null 2>&1
+	else
+	  $SBRSH grep "$BASENAME" /proc/$PID/cmdline >/dev/null 2>&1
+	fi
+	
 	if [ $? -eq 0 ]; then
-	    echo "$SVC is already running, doing nothing"
-	    DOIT=FALSE
+	  echo "$SVC is already running, doing nothing"
+	  DOIT=FALSE
 	fi
     fi
     
@@ -84,9 +101,14 @@
 		$VALGRIND $CMD $PARAMS &
 	    else
 		if [ -z "$SBRSH" ]; then
-		    # no sbrsh
-		    $CMD $PARAMS &
-		    echo $! > $PIDFILE  
+		    if echo $SBOX_CPUTRANSPARENCY_METHOD | grep "qemu-arm$" >/dev/null; then
+                      qemu-arm $CMD $PARAMS &
+		      echo $! > $PIDFILE
+		    else
+		      # no transparency
+		      $CMD $PARAMS &
+		      echo $! > $PIDFILE  
+		    fi
 		else
     		    # We need to run it with sbrsh show that we get the pid of
 		    # the sbrsh and then on stop we can kill the sbrsh and 
