From ba7c49c090b7b41564ec5e9c69e60a022c2ace6e Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 26 May 2025 00:33:36 +0100 Subject: vendor.sh: simplify fetch() the checks at the end of the function are mostly superfluous, because bad_checksum() is immediately called just beforehand, and performs the same checks. Signed-off-by: Leah Rowe --- include/vendor.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'include/vendor.sh') diff --git a/include/vendor.sh b/include/vendor.sh index 99fc7467..0111f90f 100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -132,14 +132,8 @@ fetch() ( fx_ "eval mkdst \"$binsum\"" x_ find "${_pre_dest%/*}" -type f ) || : bad_checksum "$binsum" "$_dest" || [ ! -f "$_dest" ] || return 0 - [ -z "$binsum" ] && \ - printf "'%s', '%s': checksum undefined. Check files in '%s'\n" \ - "$board" "$_dest" "${_pre_dest%/*}" 1>&2 - e "$_dest" f not && err "missing file '$_dest', !extract_$dl_type"; : - e "$_dest" f && printf "WARNING: '%s' made with bad hash (will rm)\n" \ - "$_dest" 1>&2 - [ -L "$_dest" ] && printf "WARNING: '%s' is a link. Please delete!\n" \ - "$_dest" 1>&2 + [ -z "$binsum" ] && printf "'%s': checksum undefined\n" "$_dest" 1>&2 + [ -L "$_dest" ] && printf "WARNING: '%s' is a link!\n" "$_dest" 1>&2 [ -L "$_dest" ] || x_ rm -f "$_dest" err "Could not safely extract '$_dest', for board '$board'" } -- cgit v1.2.1 From 18dacd4c22b1dfe6ab985d76712dd8261f173ce4 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 26 May 2025 00:57:50 +0100 Subject: xbmk: rename xbmklocal/xbmktmp variables shorten them Signed-off-by: Leah Rowe --- include/vendor.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include/vendor.sh') diff --git a/include/vendor.sh b/include/vendor.sh index 0111f90f..6702f5fd 100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -150,9 +150,9 @@ extract_intel_me() { e "$mecleaner" f not && err "$cbdir: me_cleaner missing" - _7ztest="$xbmklocal/metmp/a" - _metmp="$xbmklocal/me.bin" - x_ rm -f "$_metmp" "$xbmklocal/a" + _7ztest="$xbloc/metmp/a" + _metmp="$xbloc/me.bin" + x_ rm -f "$_metmp" "$xbloc/a" mfs="" && [ "$ME11bootguard" = "y" ] && mfs="--whitelist MFS" && \ chkvars ME11delta ME11version ME11sku ME11pch @@ -178,7 +178,7 @@ find_me() _7ztest="${_7ztest}a" && _r="-r" && [ -n "$mfs" ] && _r="" - "$mecleaner" $mfs $_r -t -O "$xbmklocal/a" -M "$_metmp" "$1" || \ + "$mecleaner" $mfs $_r -t -O "$xbloc/a" -M "$_metmp" "$1" || \ "$mecleaner" $mfs $_r -t -O "$_metmp" "$1" || "$me7updateparser" \ -O "$_metmp" "$1" || extract_archive "$1" "$_7ztest" || return 0 @@ -387,9 +387,9 @@ vfile() elif [ "$nuke" = "nuke" ]; then x_ "$cbfstool" "$rom" remove -n "$cbfsname" elif [ "$_t" = "stage" ]; then # the only stage we handle is refcode - x_ rm -f "$xbmklocal/refcode" - x_ "$rmodtool" -i "$_dest" -o "$xbmklocal/refcode" - x_ "$cbfstool" "$rom" add-stage -f "$xbmklocal/refcode" \ + x_ rm -f "$xbloc/refcode" + x_ "$rmodtool" -i "$_dest" -o "$xbloc/refcode" + x_ "$cbfstool" "$rom" add-stage -f "$xbloc/refcode" \ -n "$cbfsname" -t stage else x_ "$cbfstool" "$rom" add -f "$_dest" -n "$cbfsname" \ -- cgit v1.2.1 From 09b6e91803d4112ae22d31313a5fdbe8afe79707 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 26 May 2025 01:30:33 +0100 Subject: general cleanup in get.sh and vendor.sh Signed-off-by: Leah Rowe --- include/vendor.sh | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'include/vendor.sh') diff --git a/include/vendor.sh b/include/vendor.sh index 6702f5fd..4d8d1184 100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -26,12 +26,11 @@ cvchk="CONFIG_INCLUDE_SMSC_SCH5545_EC_FW CONFIG_HAVE_MRC CONFIG_HAVE_ME_BIN \ CONFIG_FSP_S_FILE CONFIG_KBC1126_FW1 CONFIG_KBC1126_FW2" # lbmk-specific extensions to the "cv" variable (not suitable for cbmk) -cvxbmk="CONFIG_ME_BIN_PATH CONFIG_SMSC_SCH5545_EC_FW_FILE \ - CONFIG_KBC1126_FW1_OFFSET CONFIG_KBC1126_FW2_OFFSET \ +cvxbmk="CONFIG_ME_BIN_PATH CONFIG_SMSC_SCH5545_EC_FW_FILE CONFIG_FSP_FULL_FD \ + CONFIG_KBC1126_FW1_OFFSET CONFIG_KBC1126_FW2_OFFSET CONFIG_FSP_USE_REPO \ CONFIG_VGA_BIOS_ID CONFIG_BOARD_DELL_E6400 CONFIG_FSP_S_CBFS \ CONFIG_HAVE_REFCODE_BLOB CONFIG_REFCODE_BLOB_FILE CONFIG_FSP_FD_PATH \ - CONFIG_IFD_BIN_PATH CONFIG_MRC_FILE CONFIG_FSP_M_CBFS \ - CONFIG_FSP_USE_REPO CONFIG_FSP_FULL_FD" + CONFIG_IFD_BIN_PATH CONFIG_MRC_FILE CONFIG_FSP_M_CBFS" # lbmk-specific extensions; mostly used for downloading vendor files eval "`setvars "" has_hashes EC_hash DL_hash DL_url_bkup MRC_refcode_gbe vcfg \ @@ -54,17 +53,14 @@ download() getfiles() { [ -z "$CONFIG_HAVE_ME_BIN" ] || fetch intel_me "$DL_url" \ - "$DL_url_bkup" "$DL_hash" "$CONFIG_ME_BIN_PATH" "curl" \ - "$ME_bin_hash" + "$DL_url_bkup" "$DL_hash" "$CONFIG_ME_BIN_PATH" curl "$ME_bin_hash" [ -z "$CONFIG_INCLUDE_SMSC_SCH5545_EC_FW" ] || fetch sch5545ec \ "$SCH5545EC_DL_url" "$SCH5545EC_DL_url_bkup" "$SCH5545EC_DL_hash" \ "$CONFIG_SMSC_SCH5545_EC_FW_FILE" "curl" "$SCH5545EC_bin_hash" [ -z "$CONFIG_KBC1126_FW1" ] || fetch kbc1126ec "$EC_url" \ - "$EC_url_bkup" "$EC_hash" "$CONFIG_KBC1126_FW1" "curl" \ - "$EC_FW1_hash" + "$EC_url_bkup" "$EC_hash" "$CONFIG_KBC1126_FW1" curl "$EC_FW1_hash" [ -z "$CONFIG_KBC1126_FW2" ] || fetch kbc1126ec "$EC_url" \ - "$EC_url_bkup" "$EC_hash" "$CONFIG_KBC1126_FW2" "curl" \ - "$EC_FW2_hash" + "$EC_url_bkup" "$EC_hash" "$CONFIG_KBC1126_FW2" curl "$EC_FW2_hash" [ -z "$CONFIG_VGA_BIOS_FILE" ] || fetch e6400vga "$E6400_VGA_DL_url" \ "$E6400_VGA_DL_url_bkup" "$E6400_VGA_DL_hash" \ "$CONFIG_VGA_BIOS_FILE" "curl" "$E6400_VGA_bin_hash" @@ -111,12 +107,11 @@ fetch() done; : # download the file (from the internet) to extract from - xbmkget "$dlop" "$dl" "$dl_bkup" "$_dl" "$dlsum" + xbget "$dlop" "$dl" "$dl_bkup" "$_dl" "$dlsum" x_ rm -Rf "${_dl}_extracted" # skip extraction if a cached extracted file exists - ( xbmkget copy "$_dl_bin" "$_dl_bin" "$_dest" "$binsum" 2>/dev/null ) \ - || : + ( xbget copy "$_dl_bin" "$_dl_bin" "$_dest" "$binsum" 2>/dev/null ) || : [ -f "$_dest" ] && return 0 x_ mkdir -p "${_dest%/*}" -- cgit v1.2.1 From dc6996252a0f516add85e0cbcf1693bfa80f8c99 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 27 May 2025 10:11:42 +0100 Subject: put coreboot utils in elf/coreboot/TREE not elf/UTIL/TREE This way, they are automatically deleted when a tree has to be re-built. Signed-off-by: Leah Rowe --- include/vendor.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/vendor.sh') diff --git a/include/vendor.sh b/include/vendor.sh index 4d8d1184..3f287899 100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -270,8 +270,8 @@ bootstrap() cbdir="src/coreboot/$tree" mecleaner="$xbmkpwd/$cbdir/util/me_cleaner/me_cleaner.py" kbc1126_ec_dump="$xbmkpwd/$cbdir/util/kbc1126/kbc1126_ec_dump" - cbfstool="elf/cbfstool/$tree/cbfstool" - rmodtool="elf/cbfstool/$tree/rmodtool" + cbfstool="elf/coreboot/$tree/cbfstool" + rmodtool="elf/coreboot/$tree/rmodtool" x_ ./mk -f coreboot "${cbdir##*/}" fx_ "x_ ./mk -b" printf "uefitool\nbiosutilities\nbios_extract\n" -- cgit v1.2.1 From 974bdbb38159d90b90eeff68220c7464b418866d Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 27 May 2025 11:18:18 +0100 Subject: vendor.sh: fix bad cbfstool path i overlooked this one in the previous commit there is always one. Signed-off-by: Leah Rowe --- include/vendor.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/vendor.sh') diff --git a/include/vendor.sh b/include/vendor.sh index 3f287899..55373913 100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -277,7 +277,7 @@ bootstrap() fx_ "x_ ./mk -b" printf "uefitool\nbiosutilities\nbios_extract\n" [ -d "${kbc1126_ec_dump%/*}" ] && x_ make -C "$cbdir/util/kbc1126" [ -n "$MRC_refcode_cbtree" ] && \ - cbfstoolref="elf/cbfstool/$MRC_refcode_cbtree/cbfstool" && \ + cbfstoolref="elf/coreboot/$MRC_refcode_cbtree/cbfstool" && \ x_ ./mk -d coreboot "$MRC_refcode_cbtree"; : } -- cgit v1.2.1