--- voyage-current/usr/local/sbin/copyfiles.sh-x	2009-09-23 17:20:21.000000000 +0200
+++ voyage-current/usr/local/sbin/copyfiles.sh	2009-09-29 10:40:05.898321407 +0200
@@ -65,10 +65,17 @@
 # any files which we don't want to copy.  First, we check if there is a
 # file 'exclude-files' (which can contain a list of regular-expressions
 # describing files)
+if [ "$DISTDIR" = "/" ]; then 
+	DISTDIRPREFIX="";
+else 
+	DISTDIRPREFIX="$DISTDIR";
+fi
+
+exclude="--exclude /tmp/cf --exclude '$DISTDIRPREFIX/sys/*' --exclude '$DISTDIRPREFIX/dev/*' --exclude '$DISTDIRPREFIX/proc/*'"
 if [ -f $EXECDIR/exclude-files ]; then
-	excl="--exclude-from=$EXECDIR/exclude-files"
+	excl="$exclude --exclude-from=$EXECDIR/exclude-files"
 else
-	excl=""
+	excl="$exclude"
 fi
 
 # Here we can generate a list (based upon the specified profile) of any
@@ -78,7 +85,7 @@
 # Ready to do the copy - it might take awhile, so output a message to let
 # the user know what we are doing
 echo -ne "Copying files .... " >&2
-rsync -aHx --delete $excl $DISTDIR/* $TARGET_MOUNT || \
+eval rsync -aHx --delete $excl $DISTDIRPREFIX/* $TARGET_MOUNT || \
   err_quit "Failed to copy files!"
 echo -e "done\n" >&2
 
