summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-12-21 15:52:03 +0000
committerLeah Rowe <leah@libreboot.org>2023-12-21 15:52:03 +0000
commit1153bc3b6c607c5c941f362c8cd56c4967c02134 (patch)
tree8ebc228d8b6b5f1a8abcb6c2aec3c1a04b088e6a /include
parent28dfd91ab398445a63e7c4dec1b19404ca1672ae (diff)
mrc.sh: don't run the shellball. use unzip.
the shellball (for extracting the coreboot rom, to get at mrc.bin) contains lines that are not posix-friendly. specifically, the "local" command is used, and this is not defined for posix sh. the shellball is essentially just a bunch of shell functions that compress/decompress the zip file, containing the firmware update. you can modify the files and re-run the shellball to recompress, though lbmk just uses the decompress function. as pointed out by Nicholas Chin, it is possible to just run "unzip" directly on the update, to get at bios.bin. we don't really need all the extra checks performed by the shellball, so let's just bypass it altogether. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include')
-rwxr-xr-xinclude/mrc.sh17
1 files changed, 2 insertions, 15 deletions
diff --git a/include/mrc.sh b/include/mrc.sh
index 929aed7a..d4c94e5d 100755
--- a/include/mrc.sh
+++ b/include/mrc.sh
@@ -22,7 +22,7 @@ extract_mrc()
extract_coreboot
) || err "mrc download/extract failure"
- "${cbfstool}" "${appdir}/"coreboot-*.bin extract -n mrc.bin \
+ "${cbfstool}" "${appdir}/"bios.bin extract -n mrc.bin \
-f "${_dest}" -r RO_SECTION || err "extract_mrc: cbfstool ${_dest}"
}
@@ -59,18 +59,5 @@ extract_coreboot()
printf "Extracting coreboot image\n"
[ -f "${SHELLBALL}" ] || \
err "extract_coreboot: shellball missing in google cros image"
- sh "${SHELLBALL}" --unpack "${_unpacked}" || err "shellball, ${SHELLBALL}"
-
- # TODO: audit the f* out of that shellball, for each mrc version.
- # it has to be updated for each mrc update. we should ideally
- # implement the functionality ourselves.
-
- [ -f "${_unpacked}/VERSION" ] || \
- err "extract_coreboot: VERSION file missing on google coreboot rom"
-
- _version=$( cat "${_unpacked}/VERSION" | grep BIOS\ version: | \
- cut -f2 -d: | tr -d \ )
-
- cp "${_unpacked}/bios.bin" "coreboot-${_version}.bin" || \
- err "!cp unpacked, ${_unpacked}/bios.bin, coreboot-${_version}.rom"
+ x_ unzip "${SHELLBALL}"
}