summary refs log tree commit diff
path: root/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2018-05-05 19:02:00 +0300
committerTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>2018-06-01 13:48:55 +0300
commitf49906d80c30dbb37a2d2d188ab9bd9793a4ac3f (patch)
tree9283b4ca7cf0aa114fd8d117d44da45221711dcc /nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix
parent912e87c45cc4ffbdb80a606d01fe2fa6545386a3 (diff)
downloadnixpkgs-f49906d80c30dbb37a2d2d188ab9bd9793a4ac3f.tar
nixpkgs-f49906d80c30dbb37a2d2d188ab9bd9793a4ac3f.tar.gz
nixpkgs-f49906d80c30dbb37a2d2d188ab9bd9793a4ac3f.tar.bz2
nixpkgs-f49906d80c30dbb37a2d2d188ab9bd9793a4ac3f.tar.lz
nixpkgs-f49906d80c30dbb37a2d2d188ab9bd9793a4ac3f.tar.xz
nixpkgs-f49906d80c30dbb37a2d2d188ab9bd9793a4ac3f.tar.zst
nixpkgs-f49906d80c30dbb37a2d2d188ab9bd9793a4ac3f.zip
nixos/sd-image-raspberrypi: Support Raspberry Pi Zero
Diffstat (limited to 'nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix')
-rw-r--r--nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix25
1 files changed, 19 insertions, 6 deletions
diff --git a/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix b/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix
index 212013b5e28..fe6cc416163 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
+      '';
   };
 }