diff options
| author | John Ogness <john.ogness@linutronix.de> | 2018-02-20 09:46:18 +0100 |
|---|---|---|
| committer | John Ogness <john.ogness@linutronix.de> | 2018-02-20 09:46:18 +0100 |
| commit | eb0e3153da910db2eb3e7a0bd0d5ca35adee0dd6 (patch) | |
| tree | 2fe32eb4081fd7626379fbb7b6804d79c27b322d /lx-trainer-vm | |
| parent | 03775051c72b38d5ff14050d755d278c8c83125d (diff) | |
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 <john.ogness@linutronix.de>
Diffstat (limited to 'lx-trainer-vm')
| -rwxr-xr-x | lx-trainer-vm/dd-multi.sh | 7 |
1 files changed, 4 insertions, 3 deletions
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 |
