scripts/generate.sh: Do not require firmware.rom

This commit is contained in:
Jeremy Soller
2020-12-29 10:25:40 -07:00
committed by Jeremy Soller
parent ad2d818403
commit bb877392e2

View File

@@ -6,19 +6,23 @@ set -e
SCRIPT_DIR=$(dirname "$0") SCRIPT_DIR=$(dirname "$0")
if [ -z "$1" ] || [ -z "$2" ] if [ -z "$1" ]
then then
echo "$0 <model> <firmware.rom> [ec.rom]" >&2 echo "$0 <model> [firmware.rom] [ec.rom]" >&2
exit 1 exit 1
fi fi
MODEL="$1" MODEL="$1"
if [ ! -f "$2" ] BIOS_IMAGE=
if [ -n "$2" ]
then then
echo "Could not find BIOS image '$2'" >&2 if [ ! -f "$2" ]
exit 1 then
echo "Could not find BIOS image '$2'" >&2
exit 1
fi
BIOS_IMAGE=$(realpath "$2")
fi fi
BIOS_IMAGE=$(realpath "$2")
EC_ROM= EC_ROM=
if [ -n "$3" ] if [ -n "$3" ]
@@ -51,13 +55,16 @@ sudo ./tools/coreboot-collector/target/release/coreboot-collector > "${MODEL_DIR
${SCRIPT_DIR}/coreboot-gpio.sh "${MODEL_DIR}/coreboot-collector.txt" > "${MODEL_DIR}/gpio.h" ${SCRIPT_DIR}/coreboot-gpio.sh "${MODEL_DIR}/coreboot-collector.txt" > "${MODEL_DIR}/gpio.h"
${SCRIPT_DIR}/coreboot-hda.sh "${MODEL_DIR}/coreboot-collector.txt" > "${MODEL_DIR}/hda_verb.c" ${SCRIPT_DIR}/coreboot-hda.sh "${MODEL_DIR}/coreboot-collector.txt" > "${MODEL_DIR}/hda_verb.c"
# Get the flash descriptor and Intel ME blobs if [ -n "${BIOS_IMAGE}" ]
make -C coreboot/util/ifdtool then
coreboot/util/ifdtool/ifdtool -x "${BIOS_IMAGE}" # Get the flash descriptor and Intel ME blobs
# TODO: Don't hardcode flash region index make -C coreboot/util/ifdtool
mv flashregion_0_flashdescriptor.bin "${MODEL_DIR}/fd.rom" coreboot/util/ifdtool/ifdtool -x "${BIOS_IMAGE}"
mv flashregion_2_intel_me.bin "${MODEL_DIR}/me.rom" # TODO: Don't hardcode flash region index
rm -f flashregion_*.bin mv flashregion_0_flashdescriptor.bin "${MODEL_DIR}/fd.rom"
mv flashregion_2_intel_me.bin "${MODEL_DIR}/me.rom"
rm -f flashregion_*.bin
fi
# Get the Video BIOS Table for Intel systems # Get the Video BIOS Table for Intel systems
if sudo [ -e /sys/kernel/debug/dri/0/i915_vbt ] if sudo [ -e /sys/kernel/debug/dri/0/i915_vbt ]