From eb0e3153da910db2eb3e7a0bd0d5ca35adee0dd6 Mon Sep 17 00:00:00 2001 From: John Ogness Date: Tue, 20 Feb 2018 09:46:18 +0100 Subject: dd-multi.sh: add support for layer tarballs in subdirs Use 'basename' to isolate the layer tarball filename in case they are specified in a directory other than the current working directory. Signed-off-by: John Ogness --- lx-trainer-vm/dd-multi.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lx-trainer-vm/dd-multi.sh') diff --git a/lx-trainer-vm/dd-multi.sh b/lx-trainer-vm/dd-multi.sh index 998aaf5..2049be8 100755 --- a/lx-trainer-vm/dd-multi.sh +++ b/lx-trainer-vm/dd-multi.sh @@ -108,7 +108,7 @@ for dest in $DESTS; do # copy layer tarballs to /home for tarball in $LAYERS; do - destfile="${TMP_ROOT}${dest}2/$tarball" + destfile="${TMP_ROOT}${dest}2/`basename $tarball`" if [ -f $destfile ]; then echo echo "WARNING: OVERWRITING $destfile" 1>&2 @@ -124,8 +124,9 @@ for dest in $DESTS; do # unpack layers for tarball in $LAYERS; do - chroot ${TMP_ROOT}${dest}1 tar -x -f /home/$tarball --numeric-owner -C / - rm ${TMP_ROOT}${dest}1/home/$tarball + destfile=`basename $tarball` + chroot ${TMP_ROOT}${dest}1 tar -x -f /home/$destfile --numeric-owner -C / + rm ${TMP_ROOT}${dest}1/home/$destfile done # unmount partitions -- cgit v1.2.3