From 3fa89f8f985318e919911b494e32a15c9448a725 Mon Sep 17 00:00:00 2001 From: Ayan Kumar Halder Date: Fri, 18 Mar 2022 19:07:24 +0000 Subject: Add support for BOOT_CMD With BOOT_CMD, one can specify the boot command used by the imagebuilder. The valid values are 'booti', 'bootm' and 'bootefi'. Also, removed EFI option. This is now covered by BOOT_CMD. Signed-off-by: Ayan Kumar Halder Reviewed-by: Stefano Stabellini Signed-off-by: Stefano Stabellini --- README.md | 10 ++++------ scripts/uboot-script-gen | 30 ++++++++++++++++++------------ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 2e63043..e74d86d 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,8 @@ To use it, first write a config file like `config`: ``` MEMORY_START="0x0" MEMORY_END="0x80000000" -EFI=y LOAD_CMD="tftpb" +BOOT_CMD="booti" DEVICE_TREE="mpsoc.dtb" XEN="xen" @@ -77,9 +77,9 @@ Where: argument. It has to be set either in the config file or CLI argument though. -- EFI specifies if the bootefi boot command should be used over booti. - If set to anything other than "n", "no", or "false" it will enable - bootefi. +- BOOT_CMD specifies the u-boot command used to boot the binaries. + By default, it is 'booti'. The acceptable values are 'booti', 'bootm' + and 'bootefi'. - DEVICE_TREE specifies the DTB file to load. @@ -219,8 +219,6 @@ Where:\ can only be used in combination with the -k option. This adds the public key into the dtb. Then one can add this dtb back into the u-boot bin or elf.\ --e specifies if bootefi should be used in the uboot script (instead of \ - booti). This is an optional argument. ### Signed FIT images diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen index 91e805d..6705184 100755 --- a/scripts/uboot-script-gen +++ b/scripts/uboot-script-gen @@ -720,6 +720,15 @@ function check_depends() done } +function check_boot_cmd() +{ + if ! [[ " bootm booti bootefi " =~ " ${BOOT_CMD}" ]] + then + echo "\"BOOT_CMD=$BOOT_CMD\" is not valid" + exit 1 + fi +} + function print_help { script=`basename "$0"` @@ -739,7 +748,6 @@ function print_help echo " KEY_DIR - key directory used for signing a fit image" echo " HINT - the file name of the crt and key file minus the suffix (ex, hint.crt and hint.key)" echo " U-BOOT_DTB - u-boot control dtb so that the public key gets added to it" - echo " -e - uses efiboot rather than booti" echo " -f - enable generating a FIT image" echo " -h - prints out the help message and exits " echo "Defaults:" @@ -748,7 +756,7 @@ function print_help echo " $script -c ../config -d ./build42 -t \"scsi load 1:1\"" } -while getopts ":c:t:d:ho:k:u:ef" opt; do +while getopts ":c:t:d:ho:k:u:f" opt; do case ${opt} in t ) case $OPTARG in @@ -784,9 +792,6 @@ while getopts ":c:t:d:ho:k:u:ef" opt; do u ) fits_dtb_opt=$OPTARG ;; - e ) - efi_opt=y - ;; f ) fit_opt=y ;; @@ -817,7 +822,6 @@ source "$SCRIPT_PATH/common" # 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" ] @@ -836,6 +840,13 @@ then exit 1 fi +if test ! "$BOOT_CMD" +then + BOOT_CMD="booti" +else + check_boot_cmd +fi + if test -z "$NUM_DOMUS" then NUM_DOMUS=0 @@ -978,12 +989,7 @@ device_tree_editing $device_tree_addr # disable device tree reloation echo "setenv fdt_high 0xffffffffffffffff" >> $UBOOT_SOURCE -if test "$EFI" && test "$EFI" != "n" && test "$EFI" != "no" && test "$EFI" != "false" -then - echo "bootefi $kernel_addr $device_tree_addr" >> $UBOOT_SOURCE -else - echo "booti $kernel_addr - $device_tree_addr" >> $UBOOT_SOURCE -fi +echo "$BOOT_CMD $kernel_addr - $device_tree_addr" >> $UBOOT_SOURCE if test "$FIT" then -- cgit v1.2.3