aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/image
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2021-10-25 10:17:15 +0200
committerRafał Miłecki <rafal@milecki.pl>2021-11-08 15:58:13 +0100
commitb8bbac951c42c6639a66696ade4477aa2be6aa54 (patch)
tree919e15e87ee20c61e0199c9931e0e2a71589d879 /target/linux/layerscape/image
parenta02c971dff934a11ddadf7ffd850dabcab5a3cdf (diff)
downloadupstream-b8bbac951c42c6639a66696ade4477aa2be6aa54.tar.gz
upstream-b8bbac951c42c6639a66696ade4477aa2be6aa54.tar.bz2
upstream-b8bbac951c42c6639a66696ade4477aa2be6aa54.zip
layerscape: mkits-multiple-config: fail on invalid arguments
Fail if arguments couldn't be parsed and print unrecognized part. It's important when running it from script with dynamic values. Missing value could result in skipping argument and silent failures (unexpected its). Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target/linux/layerscape/image')
-rwxr-xr-xtarget/linux/layerscape/image/mkits-multiple-config.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/target/linux/layerscape/image/mkits-multiple-config.sh b/target/linux/layerscape/image/mkits-multiple-config.sh
index 68870686c5..b2d8f4ef7f 100755
--- a/target/linux/layerscape/image/mkits-multiple-config.sh
+++ b/target/linux/layerscape/image/mkits-multiple-config.sh
@@ -198,6 +198,11 @@ parse_args() {
usage;;
esac
done
+ shift $(($OPTIND - 1))
+ [ $# -gt 0 ] && {
+ echo "Failed to parse all passed arguments (unrecognized: \"$@\")"
+ exit 1
+ }
[ -n "${OUTPUT}" ] || OUTPUT=fitimage.its
[ -n "${VERSION}" ] || VERSION="Unknown"
[ -n "${ARCH}" ] || ARCH=arm