sd-image: fix raspberry pi 0 boot (#355469)

This commit is contained in:
Michele Guerini Rocco 2024-12-01 17:42:24 +01:00 committed by GitHub
commit c7a4e4c503
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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