From d8a2bb86c0e52bd5c41b2404ed3bbc7f80768842 Mon Sep 17 00:00:00 2001 From: LluĂ­s Batlle i Rossell Date: Sat, 9 May 2015 17:05:24 +0000 Subject: Raspberry Pi 2 changes to make it boot. It boots, but some things still don't work: 1) Installation of DTBs 2) Boot of initrd Booting still needs a proper config.txt in /boot, which could probably be managed by NixOS. --- .../modules/system/boot/loader/raspberrypi/raspberrypi.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix') diff --git a/nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix b/nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix index 1ea3ddd8867..b7400e333e2 100644 --- a/nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix +++ b/nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix @@ -3,6 +3,7 @@ with lib; let + cfg = config.boot.loader.raspberryPi; builder = pkgs.substituteAll { src = ./builder.sh; @@ -10,6 +11,7 @@ let inherit (pkgs) bash; path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep]; firmware = pkgs.raspberrypifw; + version = cfg.version; }; platform = pkgs.stdenv.platform; @@ -29,11 +31,23 @@ in ''; }; + boot.loader.raspberryPi.version = mkOption { + default = 2; + type = types.int; + description = '' + ''; + }; + }; config = mkIf config.boot.loader.raspberryPi.enable { system.build.installBootLoader = builder; system.boot.loader.id = "raspberrypi"; system.boot.loader.kernelFile = platform.kernelTarget; + assertions = [ + { assertion = (cfg.version == 1 || cfg.version == 2); + message = "loader.raspberryPi.version should be 1 or 2"; + } + ]; }; } -- cgit 1.4.1