diff options
| author | John Ogness <john.ogness@linutronix.de> | 2018-05-04 17:23:51 +0200 |
|---|---|---|
| committer | John Ogness <john.ogness@linutronix.de> | 2018-05-04 17:23:51 +0200 |
| commit | db24a8bfe1b90d09402b28608db7aae8477b894e (patch) | |
| tree | 3a20dd7e633552d08cfa059f20748c7687fff5d0 /lx-trainer-vm | |
| parent | 1d2e45718a772d754c8b6d2dd87dbf287de4d60a (diff) | |
dd-multi.sh: check for layers before beginning
It is very annoying if the script aborts in the middle because
of something like missing files. Check for them in the beginnning.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Diffstat (limited to 'lx-trainer-vm')
| -rwxr-xr-x | lx-trainer-vm/dd-multi.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lx-trainer-vm/dd-multi.sh b/lx-trainer-vm/dd-multi.sh index 499260b..dc205a6 100755 --- a/lx-trainer-vm/dd-multi.sh +++ b/lx-trainer-vm/dd-multi.sh @@ -65,6 +65,14 @@ for dest in $DESTS; do fi done +# all layers must be available +for tarball in $LAYERS; do + if [ ! -f $tarball ]; then + echo "error: missing layer file: $tarball" + usage_exit + fi +done + # detect partion type of source if [ "`env - /sbin/parted --script $SRC print | \ grep 'Partition Table' | awk '{print $3}'`" != "gpt" ]; then @@ -153,4 +161,4 @@ done # cleanup temp directory rm -rf $TMP_ROOT -echo "done, no errors" +echo 'done, no errors' |
