[build] Make the build to fail if raw image generation is not successful (#16461)

This commit is contained in:
Arun Saravanan Balachandran 2023-09-07 21:45:03 +05:30 committed by GitHub
parent d7b85af18b
commit d758e44c2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -139,7 +139,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 $tmp_output_onie_image
sudo ./$tmp_output_onie_image
sudo ./$tmp_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
}
rm $tmp_output_onie_image
[ -r $OUTPUT_RAW_IMAGE ] || {