From: Alex Yang Date: Sat, 15 Apr 2017 18:18:38 +0000 (+0800) Subject: The image file is deleted mistakenly X-Git-Tag: opnfv-5.0.RC1~108^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F95%2F33395%2F1;p=daisy.git The image file is deleted mistakenly There's an mistake in patch 33327. See https://gerrit.opnfv.org/gerrit/#/c/33327/ The cleanup function was called twice, so the image file was deleted. Change-Id: I5fe6a90b46739d1c6d8b66365d2c8e55350cde00 Signed-off-by: Alex Yang --- diff --git a/tools/daisy-img-modify.sh b/tools/daisy-img-modify.sh index f172ceec..90910a14 100755 --- a/tools/daisy-img-modify.sh +++ b/tools/daisy-img-modify.sh @@ -211,9 +211,6 @@ cleanup() { kpartx -dv $raw_imgfile || eliminate fi rm -f $raw_imgfile - if [ -f $imgfile ]; then - rm -rf $imgfile - fi rm -rf $mountdir } @@ -239,6 +236,9 @@ error_trap() main() { cleanup + if [ -f $imgfile ]; then + rm -rf $imgfile + fi trap "error_trap" EXIT SIGTERM