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

This commit is contained in:
Arun Saravanan Balachandran 2023-08-11 05:55:38 +05:30 committed by GitHub
parent d993630ab6
commit 7d46f76005
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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!"