summaryrefslogtreecommitdiff
path: root/resources/scripts/update/blobs/extract
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-07-08 22:07:36 +0100
committerLeah Rowe <leah@libreboot.org>2023-07-08 22:09:58 +0100
commit2bbb4c839a8224b17c7929b7ea612085d1351d20 (patch)
tree2542dfe950ff5927fa0d2f3fb1782c262467953e /resources/scripts/update/blobs/extract
parent6bc619db902015af208f2b3d2321708e1db9da11 (diff)
remove blobutil and boards/utils needing/for blobs
delete all blobs. TODO: actually deblob coreboot/uboot when downloading. i'll that in a little while, in an upcoming commit. yes. purge it all, in fsf style. censor what the fsf doesn't like. so that they can feel good about having less, because ideological purity is better than helping more people use coreboot, yes? Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'resources/scripts/update/blobs/extract')
-rwxr-xr-xresources/scripts/update/blobs/extract150
1 files changed, 0 insertions, 150 deletions
diff --git a/resources/scripts/update/blobs/extract b/resources/scripts/update/blobs/extract
deleted file mode 100755
index b32ec0ea..00000000
--- a/resources/scripts/update/blobs/extract
+++ /dev/null
@@ -1,150 +0,0 @@
-#!/usr/bin/env sh
-# script to automate extracting blobs from an existing vendor bios
-
-# SPDX-FileCopyrightText: 2022 Caleb La Grange <thonkpeasant@protonmail.com>
-# SPDX-FileCopyrightText: 2023 Leah Rowe <leah@libreboot.org>
-# SPDX-License-Identifier: GPL-3.0-only
-
-sname=""
-board=""
-vendor_rom=""
-
-cbdir="coreboot/default"
-cbcfgsdir="resources/coreboot"
-ifdtool="${cbdir}/util/ifdtool/ifdtool"
-mecleaner="me_cleaner/me_cleaner.py"
-me7updateparser="resources/blobs/me7_update_parser.py"
-
-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}
- if [ $# -lt 2 ]; then
- fail "Missing arguments (less than two)."
- fi
-
- board="${1}"
- vendor_rom="${2}"
-
- boarddir="${cbcfgsdir}/${board}"
-
- check_board
- build_dependencies
- extract_blobs
-}
-
-check_board()
-{
- if [ ! -f "${vendor_rom}" ] ; then
- fail "file does not exist: ${vendor_rom}"
- elif [ ! -d "${boarddir}" ]; then
- fail "build/roms ${board}: target not defined"
- elif [ ! -f "${boarddir}/board.cfg" ]; then
- fail "build/roms ${board}: missing board.cfg"
- fi
-}
-
-build_dependencies()
-{
- if [ ! -d me_cleaner ]; then
- printf "downloading me_cleaner\n"
- ./download me_cleaner || fail 'could not download me_cleaner'
- else
- printf "me_cleaner already downloaded. Skipping.\n"
- printf "run ./download me_cleaner to manually overwrite\n"
- fi
-
- if [ ! -d ${cbdir} ]; then
- printf "downloading coreboot\n"
- ./download coreboot default \
- || fail "could not download coreboot"
- else
- printf "coreboot already downloaded. Skipping.\n"
- printf "run ./download coreboot to manually overwrite\n"
- fi
-
- if ! [ -f ${ifdtool} ]; then
- printf "building ifdtool from coreboot\n"
- make -C "${ifdtool%/ifdtool}" \
- || fail "could not build ifdtool"
- fi
-}
-
-extract_blobs()
-{
- printf "extracting blobs for %s from %s\n" ${board} ${vendor_rom}
-
- set -- "${boarddir}/config/"*
- . ${1} 2>/dev/null
- . "${boarddir}/board.cfg"
-
- if [ "$CONFIG_HAVE_MRC" = "y" ]; then
- printf 'haswell board detected, downloading mrc\n'
- ./download mrc || fail "could not download mrc"
- fi
-
- _me_destination=${CONFIG_ME_BIN_PATH#../../}
- _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 %s\n" \
- ${_me_destination%/*}
- 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"
-
- ${mecleaner} -D ${_ifd_destination} \
- -M ${_me_destination} ${vendor_rom} -t -r -S \
- || ${me7updateparser} \
- -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'
-}
-
-fail()
-{
- print_help
-
- printf "\n%s: ERROR: %s\n" ${sname} $@
- exit 1
-}
-
-print_help()
-{
- printf "Usage: ./blobutil extract {boardname} {path/to/vendor_rom}\n"
- printf "Example: ./blobutil extract x230 12mb_flash.bin\n"
- printf "\nYou need to specify exactly 2 arguments\n"
-}
-
-main $@