Verified Commit 7f5a6db6 authored by Matt Devillier's avatar Matt Devillier
Browse files

Add configs, bootsplash, build script



Memtest86 removed as secondary payload due to issues
with gcc-8/current coreboot toolchain

Change-Id: I5d97a886d44f55f0a02fe5d8827a777a0eb3d77c
Signed-off-by: Matt Devillier's avatarMatt DeVillier <matt.devillier@puri.sm>
parent b4ea6ec7
#!/usr/bin/bash
# use TERM to exit on error
trap "exit 1" TERM
export TOP_PID=$$
# Blob hashes for validation
#
# Librem 13 v1 and Librem 15 v2 binary blob hashes
#
# microcode cpu306D4_platC0_ver0000002D_2019-03-07_PRD_CDB7ABE3
BDW_UCODE_SHA="d6076e5f26e0863d47564ccda5a22e7c493e2b14e1bcdc90ec32377a8f0ed3d0"
# flash descriptor extracted from stock AMI firmware, unlocked, ME/BIOS regions resized
BDW_DESCRIPTOR_SHA="976209b5e2d5c19f92de770b1b619ddb38bf587cf01d8c57d70d2abd826d9e11"
# ME 10.0.32.1000 CON, run thru me_cleaner with '-S' param
BDW_ME_SHA="1e8f08c3eb31a0fdb91ec0222d4398b9192141502941a5262e9155915ffb6991"
# MRC blob, refcode extracted from google/tidus recovery image
BDW_MRC_SHA="dd05ab481e1fe0ce20ade164cf3dbef3c479592801470e6e79faa17624751343"
BDW_REFCODE_SHA="8a919ffece61ba21664b1028b0ebbfabcd727d90c1ae2f72b48152b8774323a4"
# vbios extracted from stock AMI firmware
BDW_VBIOS_SHA="e1cd1b4f2bd21e036145856e2d092eb47c27cdb4b717c3b182a18d8c0b1d0f01"
#
# Librem 13 v2/v3 and Librem 15 v3 binary blob hashes
#
# microcode cpu406E3_platC0_ver000000CC_2019-04-01_PRD_95AEDE54
SKL_UCODE_SHA="6c6e420fe0490de51a504303d4c5d12ef8832ffb98a2d5327a9a07f05e62b01f"
# flash descriptor extracted from stock AMI firmware, unlocked, ME/BIOS regions resized
SKL_DESCRIPTOR_SHA="642ca36f52aabb5198b82e013bf64a73a5148693a58376fffce322a4d438b524"
# ME 11.0.18.1002 CON, run thru me_cleaner with '-S -w "MFS"' params
SKL_ME_SHA="cf06d3eb8b24490a1ab46fd988b6cef822e5347cd6a2e92bc332cb4a376eb8bc"
# vbios extracted from stock AMI firmware
SKL_VBIOS_SHA="18d861485b86f93dad2b294cebd40b99eb03493d32b514e731ddb8dcf3a1ce83"
#
# Librem 13 v4 and Librem 15 v4 binary blob hashes
#
# microcode cpu806E9_platC0_ver000000B4_2019-04-01_PRD_3D6ECAB4
KBL_UCODE_SHA="0e3a06d8949a1d7df2c75b414765b98181766e3bd5bc7c317fad65bfcf7c276b"
# flash descriptor extracted from stock AMI firmware, unlocked, ME/BIOS regions resized
KBL_DESCRIPTOR_SHA="642ca36f52aabb5198b82e013bf64a73a5148693a58376fffce322a4d438b524"
# ME 11.6.0.1126 CON, run thru me_cleaner with '-S -w "MFS"' params
KBL_ME_SHA="0eec2e1135193941edd39d0ec0f463e353d0c6c9068867a2f32a72b64334fb34"
# vbios extracted from stock AMI firmware
KBL_VBIOS_SHA="7181b60e119d08d5c2a265071093f6973dbea9c9f25d890a7b377059cf733a98"
die () {
local msg=$1
if [ ! -z "$msg" ]; then
echo ""
echo -e "$msg"
echo ""
fi
kill -s TERM $TOP_PID
exit 1
}
verify_blob() {
local filename=$1
local hash=$2
local description=$3
if [[ -z "$filename" || -z "$hash" || -z "$description" ]]; then
die "usage: verify_blob <file> <hash> <description>"
fi
sha=$(sha256sum "${BLOBS_DIR}/$filename" | awk '{print $1}')
if [ "$sha" != "$hash" ]; then
die "$description has the wrong SHA256 hash"
fi
}
verify_blobs() {
case $BOARD in
"librem13v1" | "librem15v2" )
BLOBS_DIR="3rdparty/blobs/mainboard/purism/librem_bdw"
verify_blob cpu_microcode_blob.bin $BDW_UCODE_SHA "Intel Microcode Update"
verify_blob descriptor.bin $BDW_DESCRIPTOR_SHA "Intel Flash Descriptor"
verify_blob me.bin $BDW_ME_SHA "Intel ME firmware"
verify_blob mrc.bin $BDW_MRC_SHA "Memory Reference Code"
verify_blob refcode.elf $BDW_REFCODE_SHA "Silicon Init Reference Code"
verify_blob vgabios.bin $BDW_VBIOS_SHA "VGA BIOS"
;;
"librem13v2" | "librem13v3" | "librem15v3" )
BLOBS_DIR="3rdparty/blobs/mainboard/purism/librem_skl"
verify_blob cpu_microcode_blob.bin $SKL_UCODE_SHA "Intel Microcode Update"
verify_blob descriptor.bin $SKL_DESCRIPTOR_SHA "Intel Flash Descriptor"
verify_blob me.bin $SKL_ME_SHA "Intel ME firmware"
verify_blob vgabios.bin $SKL_VBIOS_SHA "VGA BIOS"
;;
"librem13v4" | "librem15v4" )
BLOBS_DIR="3rdparty/blobs/mainboard/purism/librem_kbl"
verify_blob cpu_microcode_blob.bin $KBL_UCODE_SHA "Intel Microcode Update"
verify_blob descriptor.bin $KBL_DESCRIPTOR_SHA "Intel Flash Descriptor"
verify_blob me.bin $KBL_ME_SHA "Intel ME firmware"
verify_blob vgabios.bin $KBL_VBIOS_SHA "VGA BIOS"
;;
esac
}
update_crossgcc_toolchain() {
# assume called from coreboot root dir
local CURRENT_TOOLCHAIN_VERSION=0
local GCC_FILE='util/crossgcc/xgcc/bin/i386-elf-gcc'
local TARGET_TOOLCHAIN_VERSION=$(grep -m 1 CROSSGCC_VERSION= util/crossgcc/buildgcc | sed -e 's/^.*="\([0-9]\+\.[0-9]\+\)".*$/\1/')
if [ -f "${GCC_FILE}" ]; then
CURRENT_TOOLCHAIN_VERSION=$(${GCC_FILE} --version | grep -m 1 'coreboot toolchain' | sed -e 's/^.*coreboot toolchain v\([0-9]\+\.[0-9]\+\).*$/\1/')
fi
if [ "${CURRENT_TOOLCHAIN_VERSION}" != "${TARGET_TOOLCHAIN_VERSION}" ]; then
echo "coreboot toolchain version changed from ${CURRENT_TOOLCHAIN_VERSION} to ${TARGET_TOOLCHAIN_VERSION}"
echo "Cleaning crossgcc compiler before rebuilding it"
make crossgcc-clean
fi
make crossgcc-i386 CPUS=$(nproc)
[ $? -ne 0 ] && die "Error building coreboot toolchain" || true
}
# check build target
build_targets=("librem13v1" "librem15v2" "librem13v2" "librem13v3" "librem15v3" "librem13v4" "librem15v4")
if [[ ! " ${build_targets[@]} " =~ " $1 " ]]; then
echo "You must specify a valid build target:"
echo "${build_targets[@]}"
exit 1
fi
BOARD=$1
verify_blobs
# check/build toolchain
update_crossgcc_toolchain || die
# do a clean build
make distclean
# copy config
cp configs/config.${BOARD} .config
make olddefconfig
# build coreboot and payload(s)
if ! make; then
die "Error building coreboot"
fi
# get git rev
rev=$(git describe --tags --dirty)
# copy to root dir
filename="coreboot-${BOARD}-${rev}.rom"
cp build/coreboot.rom ./$filename
echo "$filename"
# print SHA for BIOS region (should match utility script)
util/ifdtool/ifdtool -x $filename >/dev/null
echo "SHA: $(sha256sum flashregion_1_bios.bin | awk '{print $1}')"
rm -f flashregion* 2>/dev/null
CONFIG_LOCALVERSION="4.9-Purism-1"
CONFIG_USE_BLOBS=y
CONFIG_BOOTSPLASH_IMAGE=y
CONFIG_VENDOR_PURISM=y
CONFIG_CBFS_SIZE=0x5C0000
CONFIG_VGA_BIOS=y
CONFIG_MAINBOARD_SERIAL_NUMBER="System Serial Number"
CONFIG_VGA_BIOS_FILE="3rdparty/blobs/mainboard/purism/librem_bdw/vgabios.bin"
CONFIG_HAVE_IFD_BIN=y
CONFIG_BOARD_PURISM_LIBREM13_V1=y
CONFIG_HAVE_MRC=y
CONFIG_MRC_FILE="3rdparty/blobs/mainboard/purism/librem_bdw/mrc.bin"
CONFIG_HAVE_REFCODE_BLOB=y
CONFIG_REFCODE_BLOB_FILE="3rdparty/blobs/mainboard/purism/librem_bdw/refcode.elf"
# CONFIG_PCIEXP_CLK_PM is not set
CONFIG_CPU_UCODE_BINARIES="3rdparty/blobs/mainboard/purism/librem_bdw/cpu_microcode_blob.bin"
CONFIG_HAVE_ME_BIN=y
CONFIG_CHECK_ME=y
# CONFIG_DRIVERS_INTEL_WIFI is not set
CONFIG_COREINFO_SECONDARY_PAYLOAD=y
CONFIG_LOCALVERSION="4.9-Purism-1"
CONFIG_USE_BLOBS=y
CONFIG_BOOTSPLASH_IMAGE=y
CONFIG_VENDOR_PURISM=y
CONFIG_VGA_BIOS=y
CONFIG_MAINBOARD_SERIAL_NUMBER="System Serial Number"
CONFIG_VGA_BIOS_FILE="3rdparty/blobs/mainboard/purism/librem_skl/vgabios.bin"
CONFIG_INTEL_GMA_VBT_FILE="3rdparty/fsp/KabylakeFspBinPkg/SampleCode/Vbt/Vbt.bin"
# CONFIG_DRIVERS_UART_8250IO is not set
CONFIG_IFD_BIN_PATH="3rdparty/blobs/mainboard/purism/librem_skl/descriptor.bin"
CONFIG_ME_BIN_PATH="3rdparty/blobs/mainboard/purism/librem_skl/me.bin"
CONFIG_HAVE_IFD_BIN=y
CONFIG_ADD_FSP_BINARIES=y
CONFIG_BOARD_PURISM_LIBREM13_V2=y
CONFIG_CPU_UCODE_BINARIES="3rdparty/blobs/mainboard/purism/librem_skl/cpu_microcode_blob.bin"
CONFIG_HAVE_ME_BIN=y
CONFIG_INTEL_GMA_ADD_VBT=y
CONFIG_FSP_USE_REPO=y
CONFIG_FSP_M_XIP=y
# CONFIG_DRIVERS_INTEL_WIFI is not set
CONFIG_USER_TPM1=y
CONFIG_COREINFO_SECONDARY_PAYLOAD=y
CONFIG_LOCALVERSION="4.9-Purism-1"
CONFIG_USE_BLOBS=y
CONFIG_BOOTSPLASH_IMAGE=y
CONFIG_VENDOR_PURISM=y
CONFIG_VGA_BIOS=y
CONFIG_MAINBOARD_SERIAL_NUMBER="System Serial Number"
CONFIG_VGA_BIOS_FILE="3rdparty/blobs/mainboard/purism/librem_skl/vgabios.bin"
CONFIG_INTEL_GMA_VBT_FILE="3rdparty/fsp/KabylakeFspBinPkg/SampleCode/Vbt/Vbt.bin"
# CONFIG_DRIVERS_UART_8250IO is not set
CONFIG_IFD_BIN_PATH="3rdparty/blobs/mainboard/purism/librem_skl/descriptor.bin"
CONFIG_ME_BIN_PATH="3rdparty/blobs/mainboard/purism/librem_skl/me.bin"
CONFIG_HAVE_IFD_BIN=y
CONFIG_ADD_FSP_BINARIES=y
CONFIG_BOARD_PURISM_LIBREM13_V3=y
CONFIG_CPU_UCODE_BINARIES="3rdparty/blobs/mainboard/purism/librem_skl/cpu_microcode_blob.bin"
CONFIG_HAVE_ME_BIN=y
CONFIG_INTEL_GMA_ADD_VBT=y
CONFIG_FSP_USE_REPO=y
CONFIG_FSP_M_XIP=y
# CONFIG_DRIVERS_INTEL_WIFI is not set
CONFIG_USER_TPM1=y
CONFIG_COREINFO_SECONDARY_PAYLOAD=y
CONFIG_LOCALVERSION="4.9-Purism-1"
CONFIG_USE_BLOBS=y
CONFIG_BOOTSPLASH_IMAGE=y
CONFIG_VENDOR_PURISM=y
CONFIG_VGA_BIOS=y
CONFIG_MAINBOARD_SERIAL_NUMBER="System Serial Number"
CONFIG_VGA_BIOS_FILE="3rdparty/blobs/mainboard/purism/librem_kbl/vgabios.bin"
CONFIG_INTEL_GMA_VBT_FILE="3rdparty/fsp/KabylakeFspBinPkg/SampleCode/Vbt/Vbt.bin"
# CONFIG_DRIVERS_UART_8250IO is not set
CONFIG_IFD_BIN_PATH="3rdparty/blobs/mainboard/purism/librem_kbl/descriptor.bin"
CONFIG_ME_BIN_PATH="3rdparty/blobs/mainboard/purism/librem_kbl/me.bin"
CONFIG_HAVE_IFD_BIN=y
CONFIG_ADD_FSP_BINARIES=y
CONFIG_BOARD_PURISM_LIBREM13_V4=y
CONFIG_CPU_UCODE_BINARIES="3rdparty/blobs/mainboard/purism/librem_kbl/cpu_microcode_blob.bin"
CONFIG_HAVE_ME_BIN=y
CONFIG_INTEL_GMA_ADD_VBT=y
CONFIG_FSP_USE_REPO=y
CONFIG_FSP_M_XIP=y
# CONFIG_DRIVERS_INTEL_WIFI is not set
CONFIG_USER_TPM1=y
CONFIG_COREINFO_SECONDARY_PAYLOAD=y
CONFIG_LOCALVERSION="4.9-Purism-1"
CONFIG_USE_BLOBS=y
CONFIG_BOOTSPLASH_IMAGE=y
CONFIG_VENDOR_PURISM=y
CONFIG_CBFS_SIZE=0x5C0000
CONFIG_VGA_BIOS=y
CONFIG_MAINBOARD_SERIAL_NUMBER="System Serial Number"
CONFIG_VGA_BIOS_FILE="3rdparty/blobs/mainboard/purism/librem_bdw/vgabios.bin"
CONFIG_HAVE_IFD_BIN=y
CONFIG_BOARD_PURISM_LIBREM15_V2=y
CONFIG_HAVE_MRC=y
CONFIG_MRC_FILE="3rdparty/blobs/mainboard/purism/librem_bdw/mrc.bin"
CONFIG_HAVE_REFCODE_BLOB=y
CONFIG_REFCODE_BLOB_FILE="3rdparty/blobs/mainboard/purism/librem_bdw/refcode.elf"
# CONFIG_PCIEXP_CLK_PM is not set
CONFIG_CPU_UCODE_BINARIES="3rdparty/blobs/mainboard/purism/librem_bdw/cpu_microcode_blob.bin"
CONFIG_HAVE_ME_BIN=y
CONFIG_CHECK_ME=y
# CONFIG_DRIVERS_INTEL_WIFI is not set
CONFIG_COREINFO_SECONDARY_PAYLOAD=y
CONFIG_LOCALVERSION="4.9-Purism-1"
CONFIG_USE_BLOBS=y
CONFIG_BOOTSPLASH_IMAGE=y
CONFIG_VENDOR_PURISM=y
CONFIG_VGA_BIOS=y
CONFIG_MAINBOARD_SERIAL_NUMBER="System Serial Number"
CONFIG_VGA_BIOS_FILE="3rdparty/blobs/mainboard/purism/librem_skl/vgabios.bin"
CONFIG_INTEL_GMA_VBT_FILE="3rdparty/fsp/KabylakeFspBinPkg/SampleCode/Vbt/Vbt.bin"
# CONFIG_DRIVERS_UART_8250IO is not set
CONFIG_IFD_BIN_PATH="3rdparty/blobs/mainboard/purism/librem_skl/descriptor.bin"
CONFIG_ME_BIN_PATH="3rdparty/blobs/mainboard/purism/librem_skl/me.bin"
CONFIG_HAVE_IFD_BIN=y
CONFIG_ADD_FSP_BINARIES=y
CONFIG_BOARD_PURISM_LIBREM15_V3=y
CONFIG_CPU_UCODE_BINARIES="3rdparty/blobs/mainboard/purism/librem_skl/cpu_microcode_blob.bin"
CONFIG_HAVE_ME_BIN=y
CONFIG_INTEL_GMA_ADD_VBT=y
CONFIG_FSP_USE_REPO=y
CONFIG_FSP_M_XIP=y
# CONFIG_DRIVERS_INTEL_WIFI is not set
CONFIG_USER_TPM1=y
CONFIG_COREINFO_SECONDARY_PAYLOAD=y
CONFIG_LOCALVERSION="4.9-Purism-1"
CONFIG_USE_BLOBS=y
CONFIG_BOOTSPLASH_IMAGE=y
CONFIG_VENDOR_PURISM=y
CONFIG_VGA_BIOS=y
CONFIG_MAINBOARD_SERIAL_NUMBER="System Serial Number"
CONFIG_VGA_BIOS_FILE="3rdparty/blobs/mainboard/purism/librem_kbl/vgabios.bin"
CONFIG_INTEL_GMA_VBT_FILE="3rdparty/fsp/KabylakeFspBinPkg/SampleCode/Vbt/Vbt.bin"
# CONFIG_DRIVERS_UART_8250IO is not set
CONFIG_IFD_BIN_PATH="3rdparty/blobs/mainboard/purism/librem_kbl/descriptor.bin"
CONFIG_ME_BIN_PATH="3rdparty/blobs/mainboard/purism/librem_kbl/me.bin"
CONFIG_HAVE_IFD_BIN=y
CONFIG_ADD_FSP_BINARIES=y
CONFIG_BOARD_PURISM_LIBREM15_V4=y
CONFIG_CPU_UCODE_BINARIES="3rdparty/blobs/mainboard/purism/librem_kbl/cpu_microcode_blob.bin"
CONFIG_HAVE_ME_BIN=y
CONFIG_INTEL_GMA_ADD_VBT=y
CONFIG_FSP_USE_REPO=y
CONFIG_FSP_M_XIP=y
# CONFIG_DRIVERS_INTEL_WIFI is not set
CONFIG_USER_TPM1=y
CONFIG_COREINFO_SECONDARY_PAYLOAD=y
Markdown is supported
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