platform/common/arm64: only pass --fmap to flashrom when passing -i

Previously, the flashrom scripts would pass --fmap to every
invocation of flashrom, even when overwriting the entire image.
This was unnecessary, and would cause issues if the chip being
written to had a corrupted fmap table.  This commit passes the
--fmap flag only when it is needed due to the -i flag being present.
master
Adam Joseph 1 year ago
parent 1a92a17774
commit c7c4370f18

@ -10,14 +10,14 @@
scripts = let
flashromScript = moreFlags: ''
set -euo pipefail
${final.flashrom}/bin/flashrom -p linux_mtd --fmap ${moreFlags}
${final.flashrom}/bin/flashrom -p linux_mtd ${moreFlags}
'';
flashromWriteScript = moreFlags:
flashromScript "-w ${final.coreboot}/coreboot.rom ${moreFlags}";
in prev.scripts // {
flashrom = flashromScript "$@";
flash-write-fallback = flashromWriteScript "-i FALLBACK";
flash-write-normal = flashromWriteScript "-i NORMAL";
flash-write-fallback = flashromWriteScript "--fmap -i FALLBACK";
flash-write-normal = flashromWriteScript "--fmap -i NORMAL";
flash-write-all = flashromWriteScript "";
};
})];

Loading…
Cancel
Save