File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed
Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -270,8 +270,11 @@ failed() {
270270# an error. It is also useful for following along as the install occurs.
271271set -o xtrace
272272
273+ # create the destination directory and ensure it is writable by the user
273274sudo mkdir -p $DEST
274- sudo chown ` whoami` $DEST
275+ if [ ! -w $DEST ]; then
276+ sudo chown ` whoami` $DEST
277+ fi
275278
276279# Install Packages
277280# ================
@@ -300,8 +303,6 @@ function git_clone {
300303 fi
301304
302305 if [ ! -d $2 ]; then
303- sudo mkdir $2
304- sudo chown ` whoami` $2
305306 git clone $1 $2
306307 cd $2
307308 # This checkout syntax works for both branches and tags
Original file line number Diff line number Diff line change @@ -21,22 +21,25 @@ if [ -b $DEST_DIR ]; then
2121 # We have a block device, install syslinux and mount it
2222 DEST_DEV=$DEST_DIR
2323 DEST_DIR=` mktemp -d mntXXXXXX`
24+ mount $DEST_DEV $DEST_DIR
25+
26+ if [ ! -d $DEST_DIR /syslinux ]; then
27+ mkdir -p $DEST_DIR /syslinux
28+ fi
2429
2530 # Install syslinux on the device
2631 syslinux --install --directory syslinux $DEST_DEV
27-
28- mount $DEST_DEV $DEST_DIR
2932else
3033 # We have a directory (for sanity checking output)
31- DEST_DEV=" "
32- if [ ! -d $DEST_DIR /syslinux ]; then
33- mkdir -p $DEST_DIR /syslinux
34- fi
34+ DEST_DEV=" "
35+ if [ ! -d $DEST_DIR /syslinux ]; then
36+ mkdir -p $DEST_DIR /syslinux
37+ fi
3538fi
3639
3740# Get some more stuff from syslinux
3841for i in memdisk menu.c32; do
39- cp -p /usr/lib/syslinux/$i $DEST_DIR /syslinux
42+ cp -p /usr/lib/syslinux/$i $DEST_DIR /syslinux
4043done
4144
4245CFG=$DEST_DIR /syslinux/syslinux.cfg
You can’t perform that action at this time.
0 commit comments