summaryrefslogtreecommitdiff
path: root/resources/scripts/blobs/extract
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-05-14 09:50:48 +0100
committerLeah Rowe <leah@libreboot.org>2023-05-14 09:50:48 +0100
commit009bf3b67f71f86ad5331afe0cd68efc578dfb90 (patch)
tree4a033cf24f306670247b4ba1842c44e509e15a7b /resources/scripts/blobs/extract
parentfd3936cc59277a6b9ba261ca88ab0258eb8e9302 (diff)
blobutil/extract: split up extract_blobs()
Diffstat (limited to 'resources/scripts/blobs/extract')
-rwxr-xr-xresources/scripts/blobs/extract39
1 files changed, 28 insertions, 11 deletions
diff --git a/resources/scripts/blobs/extract b/resources/scripts/blobs/extract
index d648d090..ad15d44f 100755
--- a/resources/scripts/blobs/extract
+++ b/resources/scripts/blobs/extract
@@ -14,6 +14,15 @@ cbcfgsdir="resources/coreboot"
ifdtool="${cbdir}/util/ifdtool/ifdtool"
boarddir=""
+CONFIG_HAVE_MRC=""
+CONFIG_ME_BIN_PATH=""
+CONFIG_GBE_BIN_PATH=""
+CONFIG_IFD_BIN_PATH=""
+
+_me_destination=""
+_gbe_destination=""
+_ifd_destination=""
+
main()
{
sname=${0}
@@ -70,7 +79,6 @@ build_dependencies()
extract_blobs()
{
- # TODO: split up this function, it's a mess
printf "extracting blobs for %s from %s\n" ${board} ${vendor_rom}
set -- "${boarddir}/config/"*
@@ -86,27 +94,36 @@ extract_blobs()
_gbe_destination=${CONFIG_GBE_BIN_PATH#../../}
_ifd_destination=${CONFIG_IFD_BIN_PATH#../../}
+ extract_blob_intel_me
+ extract_blob_intel_gbe_nvm
+
+ # Cleans up other files extracted with ifdtool
+ rm -f flashregion*.bin 2> /dev/null
+
+ if [ -f ${_ifd_destination} ]; then
+ printf "gbe, ifd, and me extracted to ${_me_destination%/*}\n"
+ else
+ printf "WARNING: Intel firmware descriptor could not "
+ printf "be extracted with modified me\n"
+ fi
+}
+
+extract_blob_intel_me()
+{
printf "extracting clean ime and modified ifd\n"
./me_cleaner/me_cleaner.py -D ${_ifd_destination} \
-M ${_me_destination} ${vendor_rom} -t -r -S || \
./resources/blobs/me7_update_parser.py
-O ${_me_destination} ${vendor_rom} \
|| fail 'me_cleaner failed to extract blobs from rom'
+}
+extract_blob_intel_gbe_nvm()
+{
printf "extracting gigabit ethernet firmware"
./${ifdtool} -x ${vendor_rom}
mv flashregion*gbe.bin ${_gbe_destination} \
|| fail 'could not extract gbe'
-
- # Cleans up other files extracted with ifdtool
- rm flashregion*.bin 2> /dev/null
-
- if [ -f ${_ifd_destination} ]; then
- printf "gbe, ifd, and me extracted to ${_me_destination%/*}\n"
- else
- printf "WARNING: Intel firmware descriptor could not "
- printf "be extracted with modified me\n"
- fi
}
fail()