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.
This commit is contained in:
Lluís Batlle i Rossell
2015-05-09 17:05:24 +00:00
parent 916b95b829
commit d8a2bb86c0
3 changed files with 28 additions and 7 deletions
@@ -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";
}
];
};
}