From 5fcc542e7d76c900f718589696d7ae4484822fc4 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Tue, 17 Jan 2023 17:08:01 -0500 Subject: [PATCH] Add rpi-u-boot-scr to support A/B boot partitions --- raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.in | 6 ++++++ .../recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.in create mode 100644 raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend 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" +} -- 2.20.1