rpi-u-boot-scr: replace hardcoded values with variables
authorHugo Villeneuve <hugo@hugovil.com>
Sat, 13 Dec 2025 17:36:46 +0000 (12:36 -0500)
committerHugo Villeneuve <hugo@hugovil.com>
Fri, 23 Jan 2026 16:44:47 +0000 (11:44 -0500)
Signed-off-by: Hugo Villeneuve <hugo@hugovil.com>
raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.in
raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend

index aa0fcd9..a630e63 100644 (file)
@@ -1,6 +1,6 @@
 saveenv
 fdt addr ${fdt_addr} && fdt get value bootargs /chosen bootargs
 if env exists rpipart;then echo Booting from mmcblk0p${rpipart};else setenv rpipart @@ROOT_PART_A_ID@@;echo rpipart not set, default to ${rpipart};fi
-load mmc 0:${rpipart} ${kernel_addr_r} boot/@@KERNEL_IMAGETYPE@@
-setenv bootargs "${bootargs} root=/dev/mmcblk0p${rpipart}"
+load @@BOOT_MEDIA@@ 0:${rpipart} ${kernel_addr_r} boot/@@KERNEL_IMAGETYPE@@
+setenv bootargs "${bootargs} root=@@ROOT_PARENT_DEV@@@@ROOT_PART_PREFIX@@${rpipart}"
 @@KERNEL_BOOTCMD@@ ${kernel_addr_r} - ${fdt_addr}
index 48bca0b..5bac502 100644 (file)
@@ -2,5 +2,7 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
 
 do_compile:prepend() {
     sed -e "s!@@ROOT_PART_A_ID@@!${ROOT_PART_A_ID}!g" \
+        -e "s!@@ROOT_PARENT_DEV@@!${ROOT_PARENT_DEV}!g" \
+        -e "s!@@ROOT_PART_PREFIX@@!${ROOT_PART_PREFIX}!g" \
         -i "${WORKDIR}/boot.cmd.in"
 }