Skip to content
Snippets Groups Projects
Commit 009bf3b6 authored by Leah Rowe's avatar Leah Rowe
Browse files

blobutil/extract: split up extract_blobs()

parent fd3936cc
Branches
No related merge requests found
......@@ -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()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment