From 7d46f760055c7c8ff0ad67e8674f25617acec83a Mon Sep 17 00:00:00 2001 From: Arun Saravanan Balachandran <52521751+ArunSaravananBalachandran@users.noreply.github.com> Date: Fri, 11 Aug 2023 05:55:38 +0530 Subject: [PATCH] [build][201811] Make the build to fail if raw image generation is not successful (#15448) --- build_image.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build_image.sh b/build_image.sh index 4b7a0393e3..0a12a81837 100755 --- a/build_image.sh +++ b/build_image.sh @@ -60,7 +60,11 @@ elif [ "$IMAGE_TYPE" = "raw" ]; then ## Run the installer ## The 'build' install mode of the installer is used to generate this dump. sudo chmod a+x $OUTPUT_ONIE_IMAGE - sudo ./$OUTPUT_ONIE_IMAGE + sudo ./$OUTPUT_ONIE_IMAGE || { + ## Failure during 'build' install mode of the installer results in an incomplete raw image. + ## Delete the incomplete raw image. + sudo rm -f $OUTPUT_RAW_IMAGE + } [ -r $OUTPUT_RAW_IMAGE ] || { echo "Error : $OUTPUT_RAW_IMAGE not generated!"