sd-image-armv7l-multiplatform.nix: Preliminary Raspberry Pi 2/3 support

- RPi3 successfully gets to U-Boot, but then fails to boot the kernel
due to a missing device tree file. This should get added to the 4.8
kernel release once this patch is merged: https://lkml.org/lkml/2016/6/1/841
- RPi2 is not tested, but it should successfully boot the NixOS image.

+20 -2
+20 -2
nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix
··· 19 "it cannot be cross compiled"; 20 }; 21 22 boot.loader.grub.enable = false; 23 boot.loader.generic-extlinux-compatible.enable = true; 24 ··· 30 users.extraUsers.root.initialHashedPassword = ""; 31 32 sdImage = { 33 - populateBootCommands = '' 34 ${extlinux-conf-builder} -t 3 -c ${config.system.build.toplevel} -d ./boot 35 - ''; 36 }; 37 }
··· 19 "it cannot be cross compiled"; 20 }; 21 22 + # Needed by RPi firmware 23 + nixpkgs.config.allowUnfree = true; 24 + 25 boot.loader.grub.enable = false; 26 boot.loader.generic-extlinux-compatible.enable = true; 27 ··· 33 users.extraUsers.root.initialHashedPassword = ""; 34 35 sdImage = { 36 + populateBootCommands = let 37 + configTxt = pkgs.writeText "config.txt" '' 38 + [pi2] 39 + kernel=u-boot-rpi2.bin 40 + 41 + [pi3] 42 + kernel=u-boot-rpi3.bin 43 + enable_uart=1 44 + ''; 45 + in '' 46 + for f in bootcode.bin fixup.dat start.elf; do 47 + cp ${pkgs.raspberrypifw}/share/raspberrypi/boot/$f boot/ 48 + done 49 + cp ${pkgs.ubootRaspberryPi2}/u-boot.bin boot/u-boot-rpi2.bin 50 + cp ${pkgs.ubootRaspberryPi3}/u-boot.bin boot/u-boot-rpi3.bin 51 + cp ${configTxt} boot/config.txt 52 ${extlinux-conf-builder} -t 3 -c ${config.system.build.toplevel} -d ./boot 53 + ''; 54 }; 55 }