[PATCH] config_distro_bootcmd: Ability to boot u-boot script from FIT image

Yau Wai Gan yau.wai.gan at intel.com
Wed Jun 2 07:48:15 CEST 2021


When source u-boot script from an FIT image, it is required to provide the
script subimage name. Add an additional environment variable "scriptuname"
when sourcing u-boot script in FIT image during run distro_bootcmd.

Signed-off-by: Yau Wai Gan <yau.wai.gan at intel.com>
---
 include/config_distro_bootcmd.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index 2627c2a6a5..7d7ee99a07 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -451,7 +451,9 @@
 	"boot_a_script="                                                  \
 		"load ${devtype} ${devnum}:${distro_bootpart} "           \
 			"${scriptaddr} ${prefix}${script}; "              \
-		"source ${scriptaddr}\0"                                  \
+		"if test ${script} = \"boot.scr.uimg\"; then "            \
+			"source ${scriptaddr}:${scriptuname};"            \
+		"else source ${scriptaddr}; fi; \0"                       \
 	\
 	"scan_dev_for_scripts="                                           \
 		"for script in ${boot_scripts}; do "                      \
-- 
2.13.0



More information about the U-Boot mailing list