diff --git a/src/image/default.nix b/src/image/default.nix index 189e62d..5c97754 100644 --- a/src/image/default.nix +++ b/src/image/default.nix @@ -43,8 +43,17 @@ nixpkgsOnBuildForHost.stdenv.mkDerivation { runHook preBuild cp ${coreboot}/coreboot.rom . chmod +w coreboot.rom + + ${update-cbfs "FALLBACK"} + cbfstool coreboot.rom print -rFALLBACK + + # unfortunately this is the only way to trick cbfstool into + # putting a "header pointer" in both regions: + cbfstool coreboot.rom read -r FALLBACK -f half.img + cbfstool coreboot.rom write -F -r NORMAL -f half.img + rm half.img cbfstool coreboot.rom print -rNORMAL - ${lib.concatMapStrings (region: update-cbfs region) [ "NORMAL" "FALLBACK" ]} + runHook postBuild '';