From c7c4370f188bbd524b591a0dd6d94a61ac0a57a1 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Wed, 28 Jun 2023 11:07:46 -0700 Subject: [PATCH] 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. --- src/platform/common/arm64.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platform/common/arm64.nix b/src/platform/common/arm64.nix index 31ce911..2f34cf1 100644 --- a/src/platform/common/arm64.nix +++ b/src/platform/common/arm64.nix @@ -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 ""; }; })];