scripts/gen_image_generic.sh: fail on errors
authorStijn Tintel <stijn@linux-ipv6.be>
Tue, 26 Mar 2019 17:35:55 +0000 (19:35 +0200)
committerStijn Tintel <stijn@linux-ipv6.be>
Tue, 26 Mar 2019 22:13:30 +0000 (00:13 +0200)
The script always exits with value 0, even if some of the commands fail.
This can potentially create broken, unbootable images, e.g. when
make_ext4fs fails due to TARGET_KERNEL_PARTSIZE being too small for the
kernel. Avoid this by failing the script when any command fails.

Acked-by: Jo-Philipp Wich <jo@mein.io>
Acked-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
scripts/gen_image_generic.sh

index 206ba7f3fa520547ce2dc2b4c5f54b914d10b0d0..d9beeb02953a224bdf6376966b368b47ff8a5331 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 # Copyright (C) 2006-2012 OpenWrt.org
-set -x
+set -e -x
 [ $# == 5 -o $# == 6 ] || {
     echo "SYNTAX: $0 <file> <kernel size> <kernel directory> <rootfs size> <rootfs image> [<align>]"
     exit 1