From afdd9c079de340ad2877baf7307555b271f04d87 Mon Sep 17 00:00:00 2001 From: "Fiona Klute (WIWA)" Date: Fri, 7 Feb 2025 18:14:56 +0100 Subject: [PATCH] board/raspberrypi: Support boot.scr for U-Boot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If using U-Boot as "kernel" for the raspberrypi bootloader, include boot.scr in the boot partition if it exists. To use this, use BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE to set a config file that uses U-Boot, and enable building a boot script in the U-Boot host tool settings. Signed-off-by: Fiona Klute (WIWA) Reviewed-by: Yann E. MORIN Tested-by: Gaƫl PORTAY Signed-off-by: Arnout Vandecappelle --- board/raspberrypi/post-image.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/board/raspberrypi/post-image.sh b/board/raspberrypi/post-image.sh index 9b9eac972b..e4611d05dd 100755 --- a/board/raspberrypi/post-image.sh +++ b/board/raspberrypi/post-image.sh @@ -19,6 +19,12 @@ if [ ! -e "${GENIMAGE_CFG}" ]; then KERNEL=$(sed -n 's/^kernel=//p' "${BINARIES_DIR}/rpi-firmware/config.txt") FILES+=( "${KERNEL}" ) + # If config.txt calls for running U-Boot, include the boot + # script if any. + if [ "${KERNEL}" = "u-boot.bin" ] && [ -e "${BINARIES_DIR}/boot.scr" ]; then + FILES+=( "boot.scr" ) + fi + BOOT_FILES=$(printf '\\t\\t\\t"%s",\\n' "${FILES[@]}") sed "s|#BOOT_FILES#|${BOOT_FILES}|" "${BOARD_DIR}/genimage.cfg.in" \ > "${GENIMAGE_CFG}"