From f6199342722c64a283d006b473b43918e93b4119 Mon Sep 17 00:00:00 2001 From: Andrei Cherechesu Date: Wed, 27 Jul 2022 13:08:27 -0700 Subject: Added the parsing for APPEND_EXTRA_CMDS variable, which enables the user to specify the path to a text file that contains, on each line, u-boot commands that will be added to the generated script as "fixups", before the boot command. The file specified by the APPEND_EXTRA_CMDS variable parameter will be copied as-is in the generated script. Signed-off-by: Andrei Cherechesu Signed-off-by: Stefano Stabellini Reviewed-by: Stefano Stabellini --- scripts/uboot-script-gen | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'scripts/uboot-script-gen') diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen index 19d7919..a4ddd1e 100755 --- a/scripts/uboot-script-gen +++ b/scripts/uboot-script-gen @@ -342,6 +342,9 @@ function check_file_type() elif [ "$type" = "Device Tree Blob" ] then type="Device Tree Blob\|data" + elif [ "$type" = "text" ] + then + type="ASCII text" fi file -L $filename | grep "$type" &> /dev/null @@ -1156,6 +1159,14 @@ device_tree_editing $device_tree_addr # disable device tree reloation echo "setenv fdt_high 0xffffffffffffffff" >> $UBOOT_SOURCE + +# append extra u-boot commands (fixups) to script before boot command +if test "$APPEND_EXTRA_CMDS" +then + check_file_type "$APPEND_EXTRA_CMDS" "text" + cat $APPEND_EXTRA_CMDS >> $UBOOT_SOURCE +fi + echo "$BOOT_CMD $kernel_addr - $device_tree_addr" >> $UBOOT_SOURCE if test "$FIT" -- cgit v1.2.3