mrc.sh: operate on refcode in tmp area first

that way, the Intel GbE device can be enabled there,
and only then would the refcode file be copied.

otherwise, the current behaviour would leave buggy
refcode in place, if the dd command failed.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-05-09 20:31:00 +01:00
parent 6e521c2e1e
commit 14d46abced
+4 -2
View File
@@ -30,11 +30,13 @@ extract_refcode()
mkdir -p "${_refdest%/*}" || err "ref: !mkdir -p ${_refdest%/*}"
x_ "$cbfstoolref" "$appdir/bios.bin" extract \
-m x86 -n fallback/refcode -f "$_refdest" -r RO_SECTION
-m x86 -n fallback/refcode -f "$appdir/ref" -r RO_SECTION
# enable the Intel GbE device, if told by offset MRC_refcode_gbe
[ -z "$MRC_refcode_gbe" ] || x_ dd if="config/ifd/hp820g2/1.bin" \
of="$_refdest" bs=1 seek=$MRC_refcode_gbe count=1 conv=notrunc; :
of="$appdir/ref" bs=1 seek=$MRC_refcode_gbe count=1 conv=notrunc; :
x_ mv "$appdir/ref" "$_refdest"
}
extract_shellball()