diff --git a/lib/image-helpers.sh b/lib/image-helpers.sh index a99163effb..3f1ac16caa 100644 --- a/lib/image-helpers.sh +++ b/lib/image-helpers.sh @@ -113,8 +113,12 @@ customize_image() mount -o bind,ro $SRC/userpatches/overlay $SDCARD/tmp/overlay display_alert "Calling image customization script" "customize-image.sh" "info" chroot $SDCARD /bin/bash -c "/tmp/customize-image.sh $RELEASE $LINUXFAMILY $BOARD $BUILD_DESKTOP" + CUSTOMIZE_IMAGE_RC=$? umount $SDCARD/tmp/overlay mountpoint -q $SDCARD/tmp/overlay || rm -r $SDCARD/tmp/overlay + if [[ $CUSTOMIZE_IMAGE_RC != 0 ]]; then + exit_with_error "customize-image.sh exited with error (rc: $CUSTOMIZE_IMAGE_RC)" + fi } ############################################################################# install_deb_chroot()