From 14d46abceda7a7ad6081b6ab321fb0efb4bc3325 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 9 May 2025 20:31:00 +0100 Subject: 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 --- include/mrc.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/mrc.sh b/include/mrc.sh index 00fb8626..edd35414 100644 --- a/include/mrc.sh +++ b/include/mrc.sh @@ -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() -- cgit v1.2.1