Merge branch 'master' of github.com:cloudbuilders/devstack
diff --git a/stack.sh b/stack.sh
index 9bf2627..dc85abb 100755
--- a/stack.sh
+++ b/stack.sh
@@ -270,8 +270,11 @@
 # an error.  It is also useful for following along as the install occurs.
 set -o xtrace
 
+# create the destination directory and ensure it is writable by the user
 sudo mkdir -p $DEST
-sudo chown `whoami` $DEST
+if [ ! -w $DEST ]; then
+    sudo chown `whoami` $DEST
+fi
 
 # Install Packages
 # ================
@@ -300,8 +303,6 @@
     fi
 
     if [ ! -d $2 ]; then
-        sudo mkdir $2
-        sudo chown `whoami` $2
         git clone $1 $2
         cd $2
         # This checkout syntax works for both branches and tags
diff --git a/tools/build_usb_boot.sh b/tools/build_usb_boot.sh
index ac49848..332c869 100755
--- a/tools/build_usb_boot.sh
+++ b/tools/build_usb_boot.sh
@@ -21,22 +21,25 @@
     # We have a block device, install syslinux and mount it
     DEST_DEV=$DEST_DIR
     DEST_DIR=`mktemp -d mntXXXXXX`
+    mount $DEST_DEV $DEST_DIR
+
+    if [ ! -d $DEST_DIR/syslinux ]; then
+        mkdir -p $DEST_DIR/syslinux
+    fi
 
     # Install syslinux on the device
     syslinux --install --directory syslinux $DEST_DEV
-
-    mount $DEST_DEV $DEST_DIR
 else
     # We have a directory (for sanity checking output)
-	DEST_DEV=""
-	if [ ! -d $DEST_DIR/syslinux ]; then
-	    mkdir -p $DEST_DIR/syslinux
-	fi
+    DEST_DEV=""
+    if [ ! -d $DEST_DIR/syslinux ]; then
+        mkdir -p $DEST_DIR/syslinux
+    fi
 fi
 
 # Get some more stuff from syslinux
 for i in memdisk menu.c32; do
-	cp -p /usr/lib/syslinux/$i $DEST_DIR/syslinux
+    cp -p /usr/lib/syslinux/$i $DEST_DIR/syslinux
 done
 
 CFG=$DEST_DIR/syslinux/syslinux.cfg