* [PATCH] u-boot-script: Allow OVERLAY to be a u-boot env variable as well
@ 2022-01-13 9:46 Jan Kiszka
2022-02-14 10:17 ` Anton Mikanovich
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2022-01-13 9:46 UTC (permalink / raw)
To: isar-users; +Cc: Chao Zeng, Bao Cheng Su
From: Jan Kiszka <jan.kiszka@siemens.com>
This allows to define the list of overlays also during boot-time,
retrieving it from a u-boot env variable. All we need to do for that is
adding a loop around loading and applying entries in the generated
script. That will interpret an entry during boot-time as list and
iterate over all entries.
In order to use this feature, the wks entry for a rootfs-u-boot
partition needs to be extended by
--sourceparams "overlays=\"\$\{my_overlays\}\""
Quoting and escaping is important to propagate ${my_overlays} into the
generated script.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
Chao, please confirm if this fully addresses your case.
meta/recipes-bsp/u-boot-script/files/update-u-boot-script | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-bsp/u-boot-script/files/update-u-boot-script b/meta/recipes-bsp/u-boot-script/files/update-u-boot-script
index eb2c2955..39b9fa0f 100755
--- a/meta/recipes-bsp/u-boot-script/files/update-u-boot-script
+++ b/meta/recipes-bsp/u-boot-script/files/update-u-boot-script
@@ -62,11 +62,13 @@ if [ -n "${OVERLAYS}" ]; then
if ! echo $OVERLAY | grep -q "^/"; then
OVERLAY_PATH=/usr/lib/linux-image-${KERNEL_VERSION}/
fi
- echo "echo Loading ${OVERLAY_PATH}${OVERLAY}..." >> ${BOOT_CMD}
+ echo "for entry in ${OVERLAY}; do" >> ${BOOT_CMD}
+ echo "echo Loading ${OVERLAY_PATH}\${entry}..." >> ${BOOT_CMD}
echo "load \${devtype} \${devnum}:${ROOT_PARTITION}" \
- "\${overlay_addr_r} ${OVERLAY_PATH}${OVERLAY}" \
+ "\${overlay_addr_r} ${OVERLAY_PATH}\${entry}" \
>> ${BOOT_CMD}
echo "fdt apply \${overlay_addr_r}" >> ${BOOT_CMD}
+ echo "done" >> ${BOOT_CMD}
done
fi
--
2.31.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] u-boot-script: Allow OVERLAY to be a u-boot env variable as well
2022-01-13 9:46 [PATCH] u-boot-script: Allow OVERLAY to be a u-boot env variable as well Jan Kiszka
@ 2022-02-14 10:17 ` Anton Mikanovich
0 siblings, 0 replies; 2+ messages in thread
From: Anton Mikanovich @ 2022-02-14 10:17 UTC (permalink / raw)
To: Jan Kiszka, isar-users; +Cc: Chao Zeng, Bao Cheng Su
13.01.2022 12:46, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> This allows to define the list of overlays also during boot-time,
> retrieving it from a u-boot env variable. All we need to do for that is
> adding a loop around loading and applying entries in the generated
> script. That will interpret an entry during boot-time as list and
> iterate over all entries.
>
> In order to use this feature, the wks entry for a rootfs-u-boot
> partition needs to be extended by
>
> --sourceparams "overlays=\"\$\{my_overlays\}\""
>
> Quoting and escaping is important to propagate ${my_overlays} into the
> generated script.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Applied to next, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-14 10:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-13 9:46 [PATCH] u-boot-script: Allow OVERLAY to be a u-boot env variable as well Jan Kiszka
2022-02-14 10:17 ` Anton Mikanovich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox