heads/blobs/t440p/download-clean-me
gaspar-ilom 361a706872
use truncated ME without relocating FTPR and keep modules to try NRI depending on ME
apparently haswell NRI depends on some ME functionality
so we want wot try if get faster boot times with a proper ME
we still truncate unused regions as we need the space for the bios

Signed-off-by: gaspar-ilom <gasparilom@riseup.net>

create ifd.bin from donor board

Signed-off-by: gaspar-ilom <gasparilom@riseup.net>
2025-03-17 23:59:51 +01:00

58 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
function usage() {
echo -n \
"Usage: $(basename "$0") path_to_output_directory
Download Intel ME firmware from Lenovo.
"
}
ME_BIN_HASH="2cb8dd18b18b6af0d09365fe7734f5b27dda85fb508960bcf0a32d52bdc96d60"
if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
if [[ "${1:-}" == "--help" ]]; then
usage
else
if [[ -z "${COREBOOT_DIR}" ]]; then
echo "ERROR: No COREBOOT_DIR variable defined."
exit 1
fi
output_dir="$(realpath "${1:-./}")"
if [[ ! -f "${output_dir}/me.bin" ]]; then
# Unpack Lenovo's Windows installer into a temporary directory and
# extract the Intel ME blob.
pushd "$(mktemp -d)"
curl -O https://download.lenovo.com/pccbbs/mobiles/glrg22ww.exe
innoextract glrg22ww.exe
mv app/ME9.1_5M_Production.bin "${COREBOOT_DIR}/util/me_cleaner"
popd
# Neutralize and shrink Intel ME. Note that this doesn't include
# --soft-disable to set the "ME Disable" or "ME Disable B" (e.g.,
# High Assurance Program) bits, as they are defined within the Flash
# Descriptor.
# https://github.com/corna/me_cleaner/wiki/External-flashing#neutralize-and-shrink-intel-me-useful-only-for-coreboot
pushd "${COREBOOT_DIR}/util/me_cleaner"
python me_cleaner.py -t -k -O me_shrinked.bin ME9.1_5M_Production.bin
mv me_shrinked.bin "${output_dir}/me.bin"
rm ./*.bin
popd
fi
if ! echo "${ME_BIN_HASH} ${output_dir}/me.bin" | sha256sum --check; then
echo "ERROR: SHA256 checksum for me.bin doesn't match."
exit 1
fi
fi
fi