src/image: fix ability to boot from NORMAL region

commit fa3da49c84 "coreboot: update
patch to add master header in both images" still isn't causing
coreboot to put a master header into the NORMAL region.  As a
result, images built after that commit but before this one will
always use the FALLBACK region.

This commit adds the master header explicitly, since I still can't
seem to get coreboot to do that on its own.
master
Adam Joseph 1 year ago
parent 98c5638e64
commit 0e0ab73687

@ -43,8 +43,17 @@ nixpkgsOnBuildForHost.stdenv.mkDerivation {
runHook preBuild runHook preBuild
cp ${coreboot}/coreboot.rom . cp ${coreboot}/coreboot.rom .
chmod +w 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 cbfstool coreboot.rom print -rNORMAL
${lib.concatMapStrings (region: update-cbfs region) [ "NORMAL" "FALLBACK" ]}
runHook postBuild runHook postBuild
''; '';

Loading…
Cancel
Save