From d642f86144491e3f825608e363c56714241e5f92 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Mon, 17 Oct 2011 14:55:10 -0500 Subject: [PATCH 1/3] Fix syslinux failure on new USB drive --- tools/build_usb_boot.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) 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 @@ if [ -b $DEST_DIR ]; then # 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 From c8d9ce4ef44c3490bd5a09e4749c98ceeadc1f2f Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Wed, 19 Oct 2011 14:21:08 -0700 Subject: [PATCH 2/3] vish points out that sudo isn't needed here since DEST is owned by user --- stack.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/stack.sh b/stack.sh index 95bcadc..a49de1a 100755 --- a/stack.sh +++ b/stack.sh @@ -301,8 +301,6 @@ function git_clone { 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 From fe95e0fee3e22d94d0ed815be0f0c90b681e6019 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Wed, 19 Oct 2011 14:30:37 -0700 Subject: [PATCH 3/3] only chown if needed (fixes nfs issue) --- stack.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stack.sh b/stack.sh index a49de1a..62d5073 100755 --- a/stack.sh +++ b/stack.sh @@ -271,8 +271,11 @@ failed() { # 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 # ================