stage-0: Add fdt-forward
@@ -7,6 +7,18 @@ let
inherit (lib) mkOption types;
inherit (config.mobile.quirks) supportsStage-0;
inherit (config.mobile.boot.stage-1) kernel;
+
+ # A bit dirty, but actually works for what we want.
+ fdt-forward = pkgs.runCommandNoCC "fdt-forward-for-initrd" {} ''
+ mkdir -p $out/bin
+ # /bin/sh is busybox in the initrd, assuredly.
+ echo "#!/bin/sh" > $out/bin/fdt-forward
+ cat "${pkgs.mobile-nixos.fdt-forward}/bin/fdt-forward" >> $out/bin/fdt-forward
+ chmod +x $out/bin/fdt-forward
+
+ cp ${pkgs.ubootTools}/bin/fdtgrep $out/bin/
+ cp ${pkgs.dtc}/bin/dtc $out/bin/
+ '';
in
{
options = {
@@ -27,6 +39,7 @@ in
mobile.boot.stage-1.stage = if supportsStage-0 then 0 else 1;
mobile.boot.stage-1.extraUtils = with pkgs; [
{ package = pkgs.kexectools; }
+ { package = fdt-forward; }
];
};
}).config;
