forked from dan/liminix
this is for the belkin rt3200, whose uboot doesn't do extlinux but can load a fit from a ubifs. It adds the a kernel+dtb as /boot/fit
28 lines
661 B
Nix
28 lines
661 B
Nix
{
|
|
config
|
|
, pkgs
|
|
, lib
|
|
, ...
|
|
}:
|
|
let
|
|
inherit (lib) mkIf mkEnableOption mkOption types concatStringsSep;
|
|
inherit (pkgs.pseudofile) dir symlink;
|
|
cfg = config.boot.loader.fit;
|
|
o = config.system.outputs;
|
|
cmdline = concatStringsSep " " config.boot.commandLine;
|
|
wantsDtb = config.hardware.dts ? src && config.hardware.dts.src != null;
|
|
in {
|
|
options.boot.loader.fit.enable = mkEnableOption "FIT in /boot";
|
|
|
|
config = mkIf cfg.enable {
|
|
system.outputs.bootfiles = pkgs.runCommand "boot-fit" {} ''
|
|
mkdir $out
|
|
cd $out
|
|
cp ${o.uimage} fit
|
|
'';
|
|
filesystem = dir {
|
|
boot = symlink config.system.outputs.bootfiles;
|
|
};
|
|
};
|
|
}
|