From 51c703f25b2b317e4eacd281e410150ecf12aab1 Mon Sep 17 00:00:00 2001 From: Aleksander Mistewicz Date: Tue, 14 Jun 2016 17:48:06 +0200 Subject: [PATCH] Exit script on flash_dd or bmaptool fail Change-Id: I4c7d230df8719c708b5600266acad8c9c1bcf6cc Signed-off-by: Aleksander Mistewicz --- tct/minnow_prepare_flash_conf.sh | 4 ++++ tct/odroid_prepare_flash_conf.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tct/minnow_prepare_flash_conf.sh b/tct/minnow_prepare_flash_conf.sh index 45d02e1..7ca5e91 100755 --- a/tct/minnow_prepare_flash_conf.sh +++ b/tct/minnow_prepare_flash_conf.sh @@ -54,9 +54,13 @@ DEV_SDCARD=$(uuid2dev "${UUID_FILE}" "${SDMUX}") echo "Bmaptool: start" test -b "${DEV_SDCARD}" || die "File does not exist or is not block special" sudo bmaptool -q copy "${IMAGE}" "${DEV_SDCARD}" +RET=$? echo "Bmaptool: finish" change_uuid "${UUID_FILE}" "${DEV_SDCARD}" +if [ $RET -ne 0 ]; then + die "Bmaptool exited with an error" "$RET" +fi switch2device "${SDMUX}" restart_device "${SDMUX}" diff --git a/tct/odroid_prepare_flash_conf.sh b/tct/odroid_prepare_flash_conf.sh index d48bbd4..5273abe 100755 --- a/tct/odroid_prepare_flash_conf.sh +++ b/tct/odroid_prepare_flash_conf.sh @@ -61,9 +61,13 @@ DEV_SDCARD=$(uuid2dev "${UUID_FILE}" "${SDMUX}") cd "${IMAGE_UNPACKED}" ${TESTLAB_SCRIPTS}/flash/flash_dd.sh "${DEV_SDCARD}" +RET=$? cd "${OLDPWD}" change_uuid "${UUID_FILE}" "${DEV_SDCARD}" +if [ $RET -ne 0 ]; then + die "flash_dd exited with an error" "$RET" +fi switch2device "${SDMUX}" restart_device "${SDMUX}" -- 2.7.4