Exit script on flash_dd or bmaptool fail 99/74699/10
authorAleksander Mistewicz <a.mistewicz@samsung.com>
Tue, 14 Jun 2016 15:48:06 +0000 (17:48 +0200)
committerAleksander Mistewicz <a.mistewicz@samsung.com>
Wed, 24 Aug 2016 08:54:53 +0000 (10:54 +0200)
Change-Id: I4c7d230df8719c708b5600266acad8c9c1bcf6cc
Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
tct/minnow_prepare_flash_conf.sh
tct/odroid_prepare_flash_conf.sh

index 45d02e1..7ca5e91 100755 (executable)
@@ -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}"
 
index d48bbd4..5273abe 100755 (executable)
@@ -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}"