From: Hugo Villeneuve Date: Tue, 17 Jan 2023 22:08:01 +0000 (-0500) Subject: Add rpi-u-boot-scr to support A/B boot partitions X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=5fcc542e7d76c900f718589696d7ae4484822fc4;p=yocto%2Fmeta-hvmpd.git Add rpi-u-boot-scr to support A/B boot partitions --- 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 new file mode 100644 index 0000000..9f2bb90 --- /dev/null +++ b/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.in @@ -0,0 +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} +@@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 new file mode 100644 index 0000000..475cb3f --- /dev/null +++ b/raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend @@ -0,0 +1,6 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +do_compile:prepend() { + sed -i -e 's/@@ROOT_PART_A_ID@@/${ROOT_PART_A_ID}/' \ + "${WORKDIR}/boot.cmd.in" +}