From f49906d80c30dbb37a2d2d188ab9bd9793a4ac3f Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Sat, 5 May 2018 19:02:00 +0300 Subject: nixos/sd-image-raspberrypi: Support Raspberry Pi Zero --- .../installer/cd-dvd/sd-image-raspberrypi.nix | 25 ++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'nixos/modules/installer') diff --git a/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix b/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix index 212013b5e289..fe6cc4161630 100644 --- a/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix +++ b/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix @@ -31,11 +31,24 @@ in users.extraUsers.root.initialHashedPassword = ""; sdImage = { - populateBootCommands = '' - (cd ${pkgs.raspberrypifw}/share/raspberrypi/boot && cp bootcode.bin fixup*.dat start*.elf $NIX_BUILD_TOP/boot/) - cp ${pkgs.ubootRaspberryPi}/u-boot.bin boot/u-boot-rpi.bin - echo 'kernel u-boot-rpi.bin' > boot/config.txt - ${extlinux-conf-builder} -t 3 -c ${config.system.build.toplevel} -d ./boot - ''; + populateBootCommands = let + configTxt = pkgs.writeText "config.txt" '' + # 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 + + [pi0] + kernel=u-boot-rpi0.bin + + [pi1] + kernel=u-boot-rpi1.bin + ''; + in '' + (cd ${pkgs.raspberrypifw}/share/raspberrypi/boot && cp bootcode.bin fixup*.dat start*.elf $NIX_BUILD_TOP/boot/) + cp ${pkgs.ubootRaspberryPiZero}/u-boot.bin boot/u-boot-rpi0.bin + cp ${pkgs.ubootRaspberryPi}/u-boot.bin boot/u-boot-rpi1.bin + cp ${configTxt} boot/config.txt + ${extlinux-conf-builder} -t 3 -c ${config.system.build.toplevel} -d ./boot + ''; }; } -- cgit 1.4.1