From ebfa42d709e7d432ad41cb675c239143da41759c Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sat, 13 Dec 2025 12:36:46 -0500 Subject: [PATCH] rpi-u-boot-scr: replace hardcoded values with variables Signed-off-by: Hugo Villeneuve --- raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.in | 4 ++-- .../recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.in b/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.in index aa0fcd9..a630e63 100644 --- a/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.in +++ b/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.in @@ -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} diff --git a/raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend b/raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend index 48bca0b..5bac502 100644 --- a/raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend +++ b/raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend @@ -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" } -- 2.20.1