From 7e4dfde7065c37c0f95efbc65ae1402e0eb0408b Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Wed, 3 May 2023 15:01:01 -0700 Subject: [PATCH] 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. --- src/platform/common/amd64.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platform/common/amd64.nix b/src/platform/common/amd64.nix index ed264bf..52ab425 100644 --- a/src/platform/common/amd64.nix +++ b/src/platform/common/amd64.nix @@ -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";