aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Woods2021-09-08 18:29:23 -0700
committerStefano Stabellini2021-09-10 15:48:54 -0700
commit98718d8cd49fcec9c45cea9038cd643862e6fb53 (patch)
treef0956fcbde68ff5205ab0716effc2a2afe55976f
parent18bf234a5b3e5cafed535fd8116557b0396aef25 (diff)
Clean up CLI argument override section
Signed-off-by: Brian Woods <brian.woods@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
-rwxr-xr-xscripts/uboot-script-gen42
1 files changed, 14 insertions, 28 deletions
diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
index 974fc5f..3359404 100755
--- a/scripts/uboot-script-gen
+++ b/scripts/uboot-script-gen
@@ -746,7 +746,7 @@ while getopts ":c:t:d:ho:k:u:ef" opt; do
uboot_dir=$OPTARG
;;
o )
- UBOOT_SCRIPT_ARG=$OPTARG
+ uboot_out_opt=$OPTARG
;;
k )
fits_keyd_opt=$OPTARG
@@ -782,21 +782,25 @@ check_depends
source "$cfg_file"
-if test "$load_opt"
+# command line overrides
+LOAD_CMD=${load_opt:-$LOAD_CMD}
+EFI=${efi_opt:-$EFI}
+FIT_ENC_KEY_DIR=${fits_keyd_opt:-$FIT_ENC_KEY_DIR}
+FIT_ENC_UB_DTB=${fits_dtb_opt:-$FIT_ENC_UB_DTB}
+if [ ! -z "$uboot_out_opt" ]
then
- LOAD_CMD="$load_opt"
+ UBOOT_SCRIPT="$uboot_out_opt".scr
+ UBOOT_SOURCE="$uboot_out_opt".source
fi
-if test ! "$LOAD_CMD"
+if test "$fit_opt" && ! test "$FIT"
then
- echo "LOAD_CMD not set, either specify it in the config or set it with the -t option"
- exit 1
+ FIT="${UBOOT_SOURCE%.source}.fit"
fi
-# CLI ARG overrides what's in the config file
-if [ ! -z "$UBOOT_SCRIPT_ARG" ]
+if test ! "$LOAD_CMD"
then
- UBOOT_SCRIPT="$UBOOT_SCRIPT_ARG".scr
- UBOOT_SOURCE="$UBOOT_SCRIPT_ARG".source
+ echo "LOAD_CMD not set, either specify it in the config or set it with the -t option"
+ exit 1
fi
if test "$XEN"
@@ -812,24 +816,6 @@ else
exit 1
fi
-if test "$efi_opt"
-then
- EFI="y"
-fi
-
-if test "$fit_opt" && ! test "$FIT"
-then
- FIT="${UBOOT_SOURCE%.source}.fit"
-fi
-
-if test "$fits_keyd_opt"
-then
- FIT_ENC_KEY_DIR="$fits_keyd_opt"
-fi
-if test "$fits_dtb_opt"
-then
- FIT_ENC_UB_DTB="$fits_dtb_opt"
-fi
fit_algo=$'hash {\n algo = "md5";\n };'
if test "$FIT_ENC_KEY_DIR" || test "$FIT_ENC_UB_DTB"
then