diff options
-rwxr-xr-x | include/mrc.sh | 2 | ||||
-rwxr-xr-x | include/option.sh | 22 | ||||
-rwxr-xr-x | include/vendor.sh | 42 | ||||
-rwxr-xr-x | script/build/fw/coreboot | 2 | ||||
-rwxr-xr-x | script/build/fw/serprog | 3 | ||||
-rwxr-xr-x | script/update/project/release | 3 | ||||
-rwxr-xr-x | script/update/project/trees | 3 | ||||
-rwxr-xr-x | script/update/vendor/download | 17 | ||||
-rwxr-xr-x | script/update/vendor/inject | 20 |
9 files changed, 51 insertions, 63 deletions
diff --git a/include/mrc.sh b/include/mrc.sh index 43a59d82..4ff067a9 100755 --- a/include/mrc.sh +++ b/include/mrc.sh @@ -4,6 +4,8 @@ # Modifications in this version are Copyright 2021 and 2023 Leah Rowe. # Original copyright detailed in repo: https://review.coreboot.org/coreboot/ +eval "$(setvars "" MRC_url MRC_url_bkup MRC_hash MRC_board)" + extract_mrc() { [ -z "${MRC_board}" ] && err "extract_mrc $MRC_hash: MRC_board not set" diff --git a/include/option.sh b/include/option.sh index 262107fd..991ec0dc 100755 --- a/include/option.sh +++ b/include/option.sh @@ -3,6 +3,20 @@ # SPDX-FileCopyrightText: 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com> # SPDX-FileCopyrightText: 2023 Leah Rowe <leah@libreboot.org> +vendir="vendor" +appdir="${vendir}/app" +cbdir="src/coreboot/default" +cbcfgsdir="config/coreboot" +ifdtool="cbutils/default/ifdtool" +cbfstool="cbutils/default/cbfstool" + +eval "$(setvars "" CONFIG_BOARD_DELL_E6400 CONFIG_HAVE_MRC CONFIG_HAVE_ME_BIN \ + CONFIG_ME_BIN_PATH CONFIG_KBC1126_FIRMWARE CONFIG_KBC1126_FW1 \ + CONFIG_KBC1126_FW1_OFFSET CONFIG_KBC1126_FW2 CONFIG_KBC1126_FW2_OFFSET \ + CONFIG_VGA_BIOS_FILE CONFIG_VGA_BIOS_ID CONFIG_GBE_BIN_PATH \ + CONFIG_INCLUDE_SMSC_SCH5545_EC_FW CONFIG_SMSC_SCH5545_EC_FW_FILE \ + CONFIG_IFD_BIN_PATH CONFIG_MRC_FILE _dest board boarddir)" + listitems() { rval=1 @@ -37,6 +51,14 @@ EOF rm -f "${revfile}" || "${_fail}" "scan_config: Cannot remove tmpfile" } +check_defconfig() +{ + for x in "${1}"/config/*; do + [ -f "${x}" ] && return 0 + done + return 1 +} + handle_coreboot_utils() { for util in cbfstool ifdtool; do diff --git a/include/vendor.sh b/include/vendor.sh deleted file mode 100755 index d9854d0f..00000000 --- a/include/vendor.sh +++ /dev/null @@ -1,42 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-only -# SPDX-FileCopyrightText: 2023 Leah Rowe <leah@libreboot.org> - -_ua="Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0" - -_7ztest="a" -vendir="vendor" -appdir="${vendir}/app" -cbdir="src/coreboot/default" -cbcfgsdir="config/coreboot" -ifdtool="cbutils/default/ifdtool" -cbfstool="cbutils/default/cbfstool" -nvmutil="util/nvmutil/nvm" -pciromsdir="pciroms" - -mecleaner="${PWD}/src/coreboot/default/util/me_cleaner/me_cleaner.py" -me7updateparser="${PWD}/util/me7_update_parser/me7_update_parser.py" -e6400_unpack="${PWD}/src/bios_extract/dell_inspiron_1100_unpacker.py" -kbc1126_ec_dump="${PWD}/${cbdir}/util/kbc1126/kbc1126_ec_dump" -pfs_extract="${PWD}/src/biosutilities/Dell_PFS_Extract.py" -uefiextract="${PWD}/src/uefitool/uefiextract" - -eval "$(setvars "" EC_url EC_url_bkup EC_hash DL_hash DL_url DL_url_bkup _dest \ - E6400_VGA_DL_hash E6400_VGA_DL_url E6400_VGA_DL_url_bkup E6400_VGA_offset \ - E6400_VGA_romname SCH5545EC_DL_url SCH5545EC_DL_url_bkup SCH5545EC_DL_hash \ - MRC_url MRC_url_bkup MRC_hash MRC_board archive rom board modifygbe _dl \ - new_mac release releasearchive _b boarddir nukemode rom)" - -eval "$(setvars "" CONFIG_BOARD_DELL_E6400 CONFIG_HAVE_MRC CONFIG_HAVE_ME_BIN \ - CONFIG_ME_BIN_PATH CONFIG_KBC1126_FIRMWARE CONFIG_KBC1126_FW1 \ - CONFIG_KBC1126_FW1_OFFSET CONFIG_KBC1126_FW2 CONFIG_KBC1126_FW2_OFFSET \ - CONFIG_VGA_BIOS_FILE CONFIG_VGA_BIOS_ID CONFIG_GBE_BIN_PATH \ - CONFIG_INCLUDE_SMSC_SCH5545_EC_FW CONFIG_SMSC_SCH5545_EC_FW_FILE \ - CONFIG_IFD_BIN_PATH CONFIG_MRC_FILE)" - -check_defconfig() -{ - for x in "${1}"/config/*; do - [ -f "${x}" ] && return 0 - done - return 1 -} diff --git a/script/build/fw/coreboot b/script/build/fw/coreboot index 487bfa31..9e266ce7 100755 --- a/script/build/fw/coreboot +++ b/script/build/fw/coreboot @@ -22,7 +22,7 @@ kmapdir="config/grub/keymap" # target.cfg files have to specifically enable [a] payload(s) pv="payload_grub payload_grub_withseabios payload_seabios payload_memtest" pv="${pv} payload_seabios_withgrub payload_uboot memtest_bin" -v="romdir cbdir cbfstool cbrom initmode displaymode cbcfg targetdir tree arch" +v="romdir cbrom initmode displaymode cbcfg targetdir tree arch" v="${v} grub_timeout ubdir vendorfiles board grub_scan_disk uboot_config" eval "$(setvars "n" ${pv})" eval "$(setvars "" ${v})" diff --git a/script/build/fw/serprog b/script/build/fw/serprog index 0525962d..eb0e5ede 100755 --- a/script/build/fw/serprog +++ b/script/build/fw/serprog @@ -7,8 +7,7 @@ set -u -e . "include/err.sh" -eval "$(setvars "" platform pico_sdk_dir pico_src_dir stm32_src_dir \ - boards_dir)" +eval "$(setvars "" platform pico_sdk_dir pico_src_dir stm32_src_dir boards_dir)" pico_src_dir=src/pico-serprog pico_sdk_dir=src/pico-sdk diff --git a/script/update/project/release b/script/update/project/release index 0fd29e82..91992032 100755 --- a/script/update/project/release +++ b/script/update/project/release @@ -14,9 +14,6 @@ _f="coreboot u-boot seabios flashrom grub memtest86plus uefitool" _f="${_f} bios_extract biosutilities pico-serprog stm32-vserprog" _f="${_f} rpi-pico-serprog" -ifdtool="cbutils/default/ifdtool" -cbfstool="cbutils/default/cbfstool" - main() { vdir="release" diff --git a/script/update/project/trees b/script/update/project/trees index bb0899f0..c8643966 100755 --- a/script/update/project/trees +++ b/script/update/project/trees @@ -14,8 +14,7 @@ set -u -e export LOCALVERSION="-${projectname}-${version%%-*}" eval "$(setvars "" arch cfgsdir codedir config config_name crossgcc_ada mode \ - elfdir listfile project romtype target target_dir targets tree cbfstool _f \ - target1)" + elfdir listfile project romtype target target_dir targets tree _f target1)" tmpclean="$(mktemp -d -t makeclean.XXXXXXXXXX)" diff --git a/script/update/vendor/download b/script/update/vendor/download index a32be3ba..87e9d3a5 100755 --- a/script/update/vendor/download +++ b/script/update/vendor/download @@ -5,12 +5,25 @@ # SPDX-FileCopyrightText: 2023 Leah Rowe <leah@libreboot.org> . "include/err.sh" -. "include/vendor.sh" -. "include/mrc.sh" . "include/option.sh" +. "include/mrc.sh" export PATH="${PATH}:/sbin" +_ua="Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0" +_7ztest="a" + +e6400_unpack="${PWD}/src/bios_extract/dell_inspiron_1100_unpacker.py" +kbc1126_ec_dump="${PWD}/${cbdir}/util/kbc1126/kbc1126_ec_dump" +me7updateparser="${PWD}/util/me7_update_parser/me7_update_parser.py" +mecleaner="${PWD}/${cbdir}/util/me_cleaner/me_cleaner.py" +pfs_extract="${PWD}/src/biosutilities/Dell_PFS_Extract.py" +uefiextract="${PWD}/src/uefitool/uefiextract" + +eval "$(setvars "" _b _dl EC_url EC_url_bkup EC_hash DL_hash DL_url DL_url_bkup \ + E6400_VGA_DL_hash E6400_VGA_DL_url E6400_VGA_DL_url_bkup E6400_VGA_offset \ + E6400_VGA_romname SCH5545EC_DL_url SCH5545EC_DL_url_bkup SCH5545EC_DL_hash)" + main() { [ $# -gt 0 ] || err "No argument given" diff --git a/script/update/vendor/inject b/script/update/vendor/inject index 10692196..c4a7f702 100755 --- a/script/update/vendor/inject +++ b/script/update/vendor/inject @@ -5,10 +5,11 @@ # SPDX-FileCopyrightText: 2023 Leah Rowe <leah@libreboot.org> . "include/err.sh" -. "include/vendor.sh" . "include/option.sh" -release_archive="n" +nvmutil="util/nvmutil/nvm" + +eval "$(setvars "" archive rom modifygbe nukemode release new_mac)" main() { @@ -46,8 +47,7 @@ check_board() [ ! -z ${board+x} ] || \ board=$(detect_board "${rom}") else - release=true - releasearchive="${archive}" + release="y" board=$(detect_board "${archive}") fi @@ -98,10 +98,8 @@ build_dependencies() inject_vendorfiles() { - release_archive="n" - [ "${release}" != "true" ] && x_ patch_rom "${rom}" && return 0 - printf "patching release file\n" - release_archive="y" + [ "${release}" != "y" ] && x_ patch_rom "${rom}" && return 0 + printf "patching release images\n" patch_release_roms } @@ -110,7 +108,7 @@ patch_release_roms() _tmpdir="tmp/romdir" x_ rm -Rf "${_tmpdir}" x_ mkdir -p "${_tmpdir}" - x_ tar -xf "${releasearchive}" -C "${_tmpdir}" + x_ tar -xf "${archive}" -C "${_tmpdir}" for x in "${_tmpdir}"/bin/*/*.rom ; do printf "patching rom: %s\n" "$x" @@ -162,7 +160,7 @@ patch_rom() # (unless nomicrocode is the only config provided) [ "${rom}" != "${rom%_nomicrocode.rom}.rom" ] && \ [ -f "${rom%_nomicrocode.rom}.rom" ] && \ - [ "${release_archive}" = "y" ] && return 0 + [ "${release}" = "y" ] && return 0 x_ check_defconfig "${boarddir}" @@ -185,7 +183,7 @@ patch_rom() [ "${CONFIG_INCLUDE_SMSC_SCH5545_EC_FW}" = "y" ] && \ [ ! -z "${CONFIG_SMSC_SCH5545_EC_FW_FILE}" ] && \ inject "sch5545_ecfw.bin" "$CONFIG_SMSC_SCH5545_EC_FW_FILE" raw - [ "${modifygbe}" = "true" ] && ! [ "${release}" = "true" ] && \ + [ "${modifygbe}" = "true" ] && ! [ "${release}" = "y" ] && \ inject "IFD" "${CONFIG_GBE_BIN_PATH}" "GbE" printf "ROM image successfully patched: %s\n" "${rom}" |