aboutsummaryrefslogtreecommitdiff
path: root/scripts/uboot-script-gen
diff options
context:
space:
mode:
authorAndrei Cherechesu2022-06-30 17:00:26 +0300
committerStefano Stabellini2022-07-06 17:58:34 -0700
commit549612d07a18add36e665ff48f094076c9653eaf (patch)
tree0f2cf7e25d024b9c18b69a284bcb674e4546669e /scripts/uboot-script-gen
parent8080718b8a8c94841155ead67bfb22cbd8e4840f (diff)
scripts: Add support for prepending path to file names
Added support for prepending path to file names in the final generated u-boot script, for the use-case where we have the files in a separate folder that can be accessed with a given $LOAD_CMD. For example, we can have "fatload mmc 0:2" as LOAD_CMD but the files would need to be loaded from the /boot folder within the 2nd partition, not from the root ("/"). By specifying the "-p <path>" parameter when running the script, paths like "/boot" can be automatically prepended to the generated u-boot commands used to load the files in board's memory. Also added the support to disk_image script, to enable generating a FAT partition with the binaries deployed in a custom folder within it, if the "-p" parameter is specified. Signed-off-by: Andrei Cherechesu <andrei.cherechesu@nxp.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Diffstat (limited to 'scripts/uboot-script-gen')
-rwxr-xr-xscripts/uboot-script-gen12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
index 085e29f..8f08cd6 100755
--- a/scripts/uboot-script-gen
+++ b/scripts/uboot-script-gen
@@ -316,7 +316,7 @@ function load_file()
then
echo "imxtract \$fit_addr $fit_scr_name $memaddr" >> $UBOOT_SOURCE
else
- echo "$LOAD_CMD $memaddr $relative_path" >> $UBOOT_SOURCE
+ echo "$LOAD_CMD $memaddr ${prepend_path:+$prepend_path/}$relative_path" >> $UBOOT_SOURCE
fi
add_size $filename
}
@@ -891,7 +891,7 @@ function print_help
{
script=`basename "$0"`
echo "usage:"
- echo " $script -c CONFIG_FILE -d DIRECTORY [-t LOAD_CMD] [-o FILE] [-k KEY_DIR/HINT [-u U-BOOT_DTB]] [-e] [-f]"
+ echo " $script -c CONFIG_FILE -d DIRECTORY [-t LOAD_CMD] [-o FILE] [-k KEY_DIR/HINT [-u U-BOOT_DTB]] [-e] [-f] [-p PREPEND_PATH]"
echo " $script -h"
echo "where:"
echo " CONFIG_FILE - configuration file"
@@ -907,6 +907,7 @@ function print_help
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 " -f - enable generating a FIT image"
+ echo " PREPEND_PATH - path to be appended before file names to match deploy location within rootfs"
echo " -h - prints out the help message and exits "
echo "Defaults:"
echo " CONFIG_FILE=$cfg_file, UBOOT_TYPE=\"LOAD_CMD\" env var, DIRECTORY=$uboot_dir"
@@ -914,7 +915,7 @@ function print_help
echo " $script -c ../config -d ./build42 -t \"scsi load 1:1\""
}
-while getopts ":c:t:d:ho:k:u:f" opt; do
+while getopts ":c:t:d:ho:k:u:fp:" opt; do
case ${opt} in
t )
case $OPTARG in
@@ -953,6 +954,9 @@ while getopts ":c:t:d:ho:k:u:f" opt; do
f )
fit_opt=y
;;
+ p )
+ prepend_path="$OPTARG"
+ ;;
h )
print_help
exit 0
@@ -1179,5 +1183,5 @@ then
echo "$LOAD_CMD $fit_addr $FIT; source $fit_addr:boot_scr"
else
echo "Generated uboot script $UBOOT_SCRIPT, to be loaded at address $uboot_addr:"
- echo "$LOAD_CMD $uboot_addr $UBOOT_SCRIPT; source $uboot_addr"
+ echo "$LOAD_CMD $uboot_addr ${prepend_path:+$prepend_path/}$UBOOT_SCRIPT; source $uboot_addr"
fi