platform/common/amd64.nix: omit --fmap when writing the entire chip

Trying to write to a chip using --fmap will fail if the chip does
not yet have a valid fmap table (for example, a blank chip).  Let's
omit this flag when writing the entire image.
master
Adam Joseph 2 years ago
parent 7817620c35
commit 7e4dfde706

@ -28,7 +28,7 @@
else "--fmap-file ${final.fmap}";
flashromScript = moreFlags: ''
set -euo pipefail
${final.flashrom}/bin/flashrom -p internal ${layoutFlags} ${moreFlags}
${final.flashrom}/bin/flashrom -p internal $@ ${moreFlags}
'';
flashromWriteScript = moreFlags:
flashromScript "-w ${final.coreboot}/coreboot.rom ${moreFlags}";
@ -38,8 +38,8 @@
'';
in prev.scripts // {
flashrom = flashromScript "$@";
flash-write-fallback = flashromWriteScript "-i FALLBACK";
flash-write-normal = flashromWriteScript "-i NORMAL";
flash-write-fallback = flashromWriteScript "${layoutFlags} -i FALLBACK";
flash-write-normal = flashromWriteScript "${layoutFlags} -i NORMAL";
flash-write-all = flashromWriteScript "";
nextboot-use-fallback = nvramToolScript "-w boot_option=Fallback";
nextboot-use-normal = nvramToolScript "-w boot_option=Normal";

Loading…
Cancel
Save