Skip to content

Commit d758e44

Browse files
[build] Make the build to fail if raw image generation is not successful (#16461)
1 parent d7b85af commit d758e44

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

build_image.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,11 @@ elif [ "$IMAGE_TYPE" = "raw" ]; then
139139
## Run the installer
140140
## The 'build' install mode of the installer is used to generate this dump.
141141
sudo chmod a+x $tmp_output_onie_image
142-
sudo ./$tmp_output_onie_image
142+
sudo ./$tmp_output_onie_image || {
143+
## Failure during 'build' install mode of the installer results in an incomplete raw image.
144+
## Delete the incomplete raw image.
145+
sudo rm -f $OUTPUT_RAW_IMAGE
146+
}
143147
rm $tmp_output_onie_image
144148

145149
[ -r $OUTPUT_RAW_IMAGE ] || {

0 commit comments

Comments
 (0)