From b5a3634ea1fc968c2ff31ef4333bb6008e24197f Mon Sep 17 00:00:00 2001 From: Michal Kazior Date: Tue, 12 Nov 2024 10:46:47 +0100 Subject: [PATCH] sd-image: fix raspberry pi 0 boot Raspberry Pi 0 was stuck at rainbow image on hdmi output and was not booting. Both dtbs are needed _and_ the enable_uart=1. Any of them missing leaves RPI0 stuck at the rainbow image. --- nixos/modules/installer/sd-card/sd-image-raspberrypi.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/modules/installer/sd-card/sd-image-raspberrypi.nix b/nixos/modules/installer/sd-card/sd-image-raspberrypi.nix index 103d6787a03c..0e6eb251091c 100644 --- a/nixos/modules/installer/sd-card/sd-image-raspberrypi.nix +++ b/nixos/modules/installer/sd-card/sd-image-raspberrypi.nix @@ -17,6 +17,10 @@ sdImage = { populateFirmwareCommands = let configTxt = pkgs.writeText "config.txt" '' + # u-boot refuses to start (gets stuck at rainbow polygon) without this, + # at least on Raspberry Pi 0. + enable_uart=1 + # Prevent the firmware from smashing the framebuffer setup done by the mainline kernel # when attempting to show low-voltage or overtemperature warnings. avoid_warnings=1 @@ -28,7 +32,7 @@ kernel=u-boot-rpi1.bin ''; in '' - (cd ${pkgs.raspberrypifw}/share/raspberrypi/boot && cp bootcode.bin fixup*.dat start*.elf $NIX_BUILD_TOP/firmware/) + (cd ${pkgs.raspberrypifw}/share/raspberrypi/boot && cp bootcode.bin fixup*.dat start*.elf *.dtb $NIX_BUILD_TOP/firmware/) cp ${pkgs.ubootRaspberryPiZero}/u-boot.bin firmware/u-boot-rpi0.bin cp ${pkgs.ubootRaspberryPi}/u-boot.bin firmware/u-boot-rpi1.bin cp ${configTxt} firmware/config.txt