From 2ba816bf6ed8c0a7954cb35b57d72395a0cc1816 Mon Sep 17 00:00:00 2001 From: Adolfo Delorenzo Date: Thu, 12 Feb 2026 18:29:28 -0600 Subject: [PATCH] fix: add config.txt and DTBs to RPi boot control partition The Raspberry Pi firmware reads config.txt from partition 1 BEFORE processing autoboot.txt. Without arm_64bit=1 on the boot control partition, the firmware defaults to 32-bit mode and shows only a rainbow square. Add minimal config.txt, device tree blobs, and overlays to partition 1 so the firmware can initialize correctly before redirecting to the A/B boot partitions. Co-Authored-By: Claude Opus 4.6 --- build/scripts/create-rpi-image.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/build/scripts/create-rpi-image.sh b/build/scripts/create-rpi-image.sh index 57fd44d..f9aeed8 100755 --- a/build/scripts/create-rpi-image.sh +++ b/build/scripts/create-rpi-image.sh @@ -161,6 +161,15 @@ boot_partition=2 boot_partition=3 AUTOBOOT +# Minimal config.txt on partition 1 — firmware reads this BEFORE autoboot.txt +# to determine arm_64bit mode and GPU settings. Without arm_64bit=1 here, +# the firmware defaults to 32-bit and can't load our 64-bit kernel. +cat > "$MNT_CTL/config.txt" << 'CFGTXT' +arm_64bit=1 +enable_uart=1 +gpu_mem=16 +CFGTXT + # Copy firmware blobs — REQUIRED on partition 1 for EEPROM to boot if ls "$RPI_FIRMWARE_DIR"/start*.elf 1>/dev/null 2>&1; then cp "$RPI_FIRMWARE_DIR"/start*.elf "$MNT_CTL/" @@ -172,6 +181,14 @@ if [ -f "$RPI_FIRMWARE_DIR/bootcode.bin" ]; then cp "$RPI_FIRMWARE_DIR/bootcode.bin" "$MNT_CTL/" fi +# Copy DTBs to partition 1 — firmware may need them before redirecting +if ls "$RPI_FIRMWARE_DIR"/bcm27*.dtb 1>/dev/null 2>&1; then + cp "$RPI_FIRMWARE_DIR"/bcm27*.dtb "$MNT_CTL/" +fi +if [ -d "$RPI_FIRMWARE_DIR/overlays" ]; then + cp -r "$RPI_FIRMWARE_DIR/overlays" "$MNT_CTL/" +fi + # --- Helper: populate a boot partition --- populate_boot_partition() { local MNT="$1"