From 49a258eafc5f84ec0f1a7e7b7b9453e2befe80f9 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 27 May 2025 11:26:00 +0100 Subject: inject.sh: remove unnecessary check we don't handle single images anymore, so we don't need to check for it at all. Signed-off-by: Leah Rowe --- include/inject.sh | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/inject.sh b/include/inject.sh index a58acc81..7f98f3dc 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -60,8 +60,6 @@ check_release() case "$archivename" in *_src.tar.xz) err "'$archive' is a src archive, silly!" ;; - grub_*|seagrub_*|custom_*|seauboot_*|seabios_withgrub_*) - err "'$archive' is a ROM image (it must be a tarball)" ;; *.tar.xz) _stripped_prefix="${archivename#*_}" board="${_stripped_prefix%.tar.xz}" ;; *) -- cgit v1.2.1 From ad851804b8598b1bea0e349e0e834b06b0c98b92 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 27 May 2025 11:28:49 +0100 Subject: inject.sh: condense check_release Signed-off-by: Leah Rowe --- include/inject.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/inject.sh b/include/inject.sh index 7f98f3dc..80ab8b49 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -58,12 +58,10 @@ check_release() [ -z "$archivename" ] && err "Can't determine archive name" case "$archivename" in - *_src.tar.xz) - err "'$archive' is a src archive, silly!" ;; + *_src.tar.xz) err "'$archive' is a src archive, silly!" ;; *.tar.xz) _stripped_prefix="${archivename#*_}" board="${_stripped_prefix%.tar.xz}" ;; - *) - err "'$archive': could not detect board type" + *) err "'$archive': could not detect board type" esac; : } -- cgit v1.2.1 From bc9ea0a1aa08bfebac35c458c030f71e2c2d0614 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 27 May 2025 11:29:04 +0100 Subject: inject.sh: add missing semicolons Signed-off-by: Leah Rowe --- include/inject.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/inject.sh b/include/inject.sh index 80ab8b49..de97de71 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -61,7 +61,7 @@ check_release() *_src.tar.xz) err "'$archive' is a src archive, silly!" ;; *.tar.xz) _stripped_prefix="${archivename#*_}" board="${_stripped_prefix%.tar.xz}" ;; - *) err "'$archive': could not detect board type" + *) err "'$archive': could not detect board type" ;; esac; : } -- cgit v1.2.1 From 46f7d48c8d7a7390a55e3c3bff914b68881a34bd Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 27 May 2025 11:32:11 +0100 Subject: inject.sh: simplify. and remove unnecessary check checking whether archivename is empty isn't needed, because the case/switch afterward would catch this condition. Signed-off-by: Leah Rowe --- include/inject.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include') diff --git a/include/inject.sh b/include/inject.sh index de97de71..9354b439 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -38,7 +38,7 @@ inject() esac [ "$new_mac" = "keep" ] && new_mac="" - check_release + x_ e "$archive" f && check_release check_target && patch_release [ "$xchanged" = "y" ] && remktar @@ -52,10 +52,8 @@ inject() check_release() { [ -L "$archive" ] && err "'$archive' is a symlink" - e "$archive" f missing && err "'$archive' missing" archivename="`basename "$archive"`" || err "Can't get '$archive' name" - [ -z "$archivename" ] && err "Can't determine archive name" case "$archivename" in *_src.tar.xz) err "'$archive' is a src archive, silly!" ;; -- cgit v1.2.1 From 28f03d39cb1a7cfa8db46b3875557a530aebdd46 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 27 May 2025 11:38:22 +0100 Subject: inject.sh: simplify remktar() Signed-off-by: Leah Rowe --- include/inject.sh | 22 +++++++++------------- include/vendor.sh | 4 ++-- 2 files changed, 11 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/inject.sh b/include/inject.sh index 9354b439..09d155fd 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -13,7 +13,7 @@ cv="CONFIG_GBE_BIN_PATH" [ -n "$cvchk" ] && cv="$cv $cvchk" eval "`setvars "" archive boarddir IFD_platform ifdprefix tree new_mac \ - tmpromdir board xchanged $cv`" + tdir board xchanged $cv`" inject() { @@ -41,7 +41,8 @@ inject() x_ e "$archive" f && check_release check_target && patch_release - [ "$xchanged" = "y" ] && remktar + [ "$xchanged" != "y" ] || ( remktar ) || err + x_ mv "${tdir%"/bin/$board"}/bin/${relname}_${board}.tar.xz" "$archive" xnot=" NOT" && [ "$xchanged" = "y" ] && xnot="" printf "\n'%s' was%s modified\n" "$archive" "$xnot" 1>&2 @@ -80,13 +81,13 @@ patch_release() [ "$nuke" = "nuke" ] || x_ ./mk download "$board" has_hashes="n" - tmpromdir="$tmpromdel/bin/$board" + tdir="$tmpromdel/bin/$board" - remkdir "${tmpromdir%"/bin/$board"}" - x_ tar -xf "$archive" -C "${tmpromdir%"/bin/$board"}" + remkdir "${tdir%"/bin/$board"}" + x_ tar -xf "$archive" -C "${tdir%"/bin/$board"}" for _hashes in "vendorhashes" "blobhashes"; do - e "$tmpromdir/$_hashes" f && \ + e "$tdir/$_hashes" f && \ has_hashes="y" && hashfile="$_hashes" && break; : done @@ -117,7 +118,7 @@ modify_mac() x_ make -C util/nvmutil clean && x_ make -C util/nvmutil && \ x_ "$nvm" "$xbloc/gbe" setmac "$new_mac" - fx_ newmac x_ find "$tmpromdir" -maxdepth 1 -type f -name "*.rom" + fx_ newmac x_ find "$tdir" -maxdepth 1 -type f -name "*.rom" printf "\nThe following GbE NVM data will be written:\n" x_ "$nvm" "$xbloc/gbe" dump | grep -v "bytes read from file" || : @@ -131,12 +132,7 @@ newmac() remktar() { - ( - x_ cd "${tmpromdir%"/bin/$board"}" + x_ cd "${tdir%"/bin/$board"}" printf "Re-building tar archive (please wait)\n" mkrom_tarball "bin/$board" 1>/dev/null - ) || err "Cannot re-generate '$archive'" - - mv "${tmpromdir%"/bin/$board"}/bin/${relname}_${board}.tar.xz" \ - "$archive" || err "'$archive' -> Can't overwrite"; : } diff --git a/include/vendor.sh b/include/vendor.sh index 55373913..e92e811a 100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -261,7 +261,7 @@ getvfile() { eval "`setcfg "config/vendor/$vcfg/pkg.cfg" 1`" bootstrap && [ $# -gt 0 ] && getfiles && return 0 # download - fx_ prep x_ find "$tmpromdir" -maxdepth 1 -type f -name "*.rom" + fx_ prep x_ find "$tdir" -maxdepth 1 -type f -name "*.rom" ( check_vendor_hashes ) || err "$archive: Can't verify hashes"; : } @@ -395,7 +395,7 @@ vfile() check_vendor_hashes() { - x_ cd "$tmpromdir" + x_ cd "$tdir" [ "$has_hashes" = "n" ] || [ "$nuke" = "nuke" ] || sha512sum \ --status -c "$hashfile" || x_ sha1sum --status -c "$hashfile" x_ rm -f "$hashfile" -- cgit v1.2.1 From dbf0fda39a78504e76d24e907db130b542cb286a Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 27 May 2025 11:49:18 +0100 Subject: rom.sh: simplify check_coreboot_util Signed-off-by: Leah Rowe --- include/rom.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/rom.sh b/include/rom.sh index c1b78c75..1eb199cd 100644 --- a/include/rom.sh +++ b/include/rom.sh @@ -65,13 +65,9 @@ check_coreboot_util() utilmode="" && [ -n "$mode" ] && utilmode="clean" x_ make -C "$utilsrcdir" $utilmode -j$XBMK_THREADS $makeargs [ -n "$mode" ] && x_ rm -Rf "$utilelfdir" && return 0 - [ -z "$mode" ] || return 0 - [ -f "$utilelfdir/$1" ] && return 0 - - x_ mkdir -p "$utilelfdir" - x_ cp "$utilsrcdir/$1" "$utilelfdir" - [ "$1" = "cbfstool" ] || return 0 - x_ cp "$utilsrcdir/rmodtool" "$utilelfdir" + [ ! -f "$utilelfdir/$1" ] && x_ mkdir -p "$utilelfdir" && \ + x_ cp "$utilsrcdir/$1" "$utilelfdir" && [ "$1" = "cbfstool" ] && \ + x_ cp "$utilsrcdir/rmodtool" "$utilelfdir"; : } mkcorebootbin() -- cgit v1.2.1 From aacd46bf812369710a0080b7e51f1a1c7d1ce9ee Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 27 May 2025 11:57:13 +0100 Subject: xbmk: simplify a few err calls many of the messages are redundant, because errors caused by the commands they handle would produce similar messages. Signed-off-by: Leah Rowe --- include/get.sh | 3 +-- include/release.sh | 3 +-- include/rom.sh | 3 +-- include/tree.sh | 6 ++---- 4 files changed, 5 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/get.sh b/include/get.sh index a3328454..4b31c7c9 100644 --- a/include/get.sh +++ b/include/get.sh @@ -106,8 +106,7 @@ try_file() eval "[ -$echk \"$cached\" ] || return 1" if [ "$2" = "git" ]; then - [ -d "$5" ] || tmpclone "$cached" "$5" "$6" "$7" || \ - err "Can't clone final repo in command: try_file $*"; : + [ -d "$5" ] || tmpclone "$cached" "$5" "$6" "$7" || err; : else bad_checksum "$6" "$cached" && x_ rm -f "$cached" && return 1 [ "$cached" != "$5" ] && x_ cp "$cached" "$5" diff --git a/include/release.sh b/include/release.sh index 912687dc..c13be2c3 100644 --- a/include/release.sh +++ b/include/release.sh @@ -19,8 +19,7 @@ release() done reldest="$reldir/$version" - [ -e "$reldest" ] && \ - err "already exists: \"$reldest\"" + [ -e "$reldest" ] && err "already exists: \"$reldest\"" vdir="$XBMK_CACHE/relpwd/${xbtmp##*/}/$version" rsrc="$vdir/${relname}_src" diff --git a/include/rom.sh b/include/rom.sh index 1eb199cd..972f264e 100644 --- a/include/rom.sh +++ b/include/rom.sh @@ -48,8 +48,7 @@ corebootpremake() [ -n "$mode" ] || [ ! -f "$srcdir/.config" ] || $dry printf \ "CONFIG_CCACHE=y\n" >> "$srcdir/.config" || err "$srcdir: !cook"; : fx_ check_coreboot_util printf "cbfstool\nifdtool\n" - printf "%s\n" "${version%%-*}" > "$srcdir/.coreboot-version" || \ - err "!mk $srcdir .coreboot-version" + printf "%s\n" "${version%%-*}" > "$srcdir/.coreboot-version" || err [ -z "$mode" ] && [ "$target" != "$tree" ] && \ x_ ./mk download "$target"; : } diff --git a/include/tree.sh b/include/tree.sh index 11607eed..e8f55c48 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -45,8 +45,7 @@ trees() [ -z "$_f" ] && err "missing flag ($flags)" [ -z "$project" ] && fx_ "x_ ./mk $_f" x_ ls -1 config/git && return 1 - [ -f "config/git/$project/pkg.cfg" ] || \ - err "config/git/$project/pkg.cfg missing" + e "config/git/$project/pkg.cfg" f missing && err "$project: no pkg.cfg" for d in "elf" "config/data" "config" "src"; do eval "${d#*/}dir=\"$d/$project\"" @@ -187,8 +186,7 @@ check_project_hashes() [ "$pjhash" != "$old_pjhash" ] && badhash="y" [ -f "$XBMK_CACHE/hash/$project$tree" ] || badhash="y" - printf "%s\n" "$pjhash" > "$XBMK_CACHE/hash/$project$tree" || \ - err "!mk $XBMK_CACHE/hash/$project$tree" + printf "%s\n" "$pjhash" > "$XBMK_CACHE/hash/$project$tree" || err [ "$badhash" != "y" ] || x_ rm -Rf "src/$project/$tree" \ "elf/$project/$tree" "elf/$project/$target"; : -- cgit v1.2.1 From f8444a879594d498a6304ca7e22f7971ecc5830b Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 27 May 2025 12:17:06 +0100 Subject: tree.sh: simplify build_project() Signed-off-by: Leah Rowe --- include/tree.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include') diff --git a/include/tree.sh b/include/tree.sh index e8f55c48..86779733 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -74,9 +74,7 @@ build_project() [ ! -f "$listfile" ] || $dry elfcheck || return 0 [ "$mode" = "distclean" ] && mode="clean" - run_make_command || return 0 - - [ -n "$mode" ] || $dry copy_elf; : + run_make_command && [ -z "$mode" ] && $dry copy_elf; : } build_targets() -- cgit v1.2.1 From bdd42c0f32facffd0a0fb8b82851ba0dc1a8bd07 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 27 May 2025 12:19:56 +0100 Subject: tree.sh: simplify handle_defconfig() Signed-off-by: Leah Rowe --- include/tree.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/tree.sh b/include/tree.sh index 86779733..fec9568e 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -117,8 +117,7 @@ handle_defconfig() [ "$_f" = "-d" ] || defconfig="$y" [ -n "$mode" ] || check_defconfig || continue - handle_makefile - [ -n "$mode" ] || $dry copy_elf + handle_makefile && [ -z "$mode" ] && $dry copy_elf; : done; : } -- cgit v1.2.1 From a0be6d11c07cf7ae5994be39425a8c5650df4bb2 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 27 May 2025 12:52:53 +0100 Subject: tree.sh: simplify build_targets() Signed-off-by: Leah Rowe --- include/tree.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include') diff --git a/include/tree.sh b/include/tree.sh index fec9568e..cca827df 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -90,9 +90,7 @@ build_targets() target="$x" printf "'make %s', '%s', '%s'\n" "$mode" "$project" "$target" - x_ handle_defconfig - - [ -n "$mode" ] || x_ $postmake + x_ handle_defconfig && [ -z "$mode" ] && x_ $postmake; : done; : } -- cgit v1.2.1 From 68356a8ca0eb647ef9d4ddd0a3f873ff00ada867 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 27 May 2025 12:54:13 +0100 Subject: tree.sh: condense configure_project() Signed-off-by: Leah Rowe --- include/tree.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/tree.sh b/include/tree.sh index cca827df..e394e973 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -138,8 +138,7 @@ configure_project() [ "$do_make" != "n" ] && break [ "${_tcfg%/*/target.cfg}" = "${_tcfg%"/$tree/target.cfg"}" ] \ - && break - _tcfg="${_tcfg%/*/target.cfg}/$tree/target.cfg" + && break; _tcfg="${_tcfg%/*/target.cfg}/$tree/target.cfg" done [ "$XBMK_RELEASE" = "y" ] && [ "$release" = "n" ] && return 1 [ -z "$btype" ] || [ "${mode%config}" = "$mode" ] || return 1 -- cgit v1.2.1 From f4a1d2217fe3d4b8b7ec29326a52a5eb25368f55 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 27 May 2025 12:56:27 +0100 Subject: tree.sh: condense build_targets() Signed-off-by: Leah Rowe --- include/tree.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include') diff --git a/include/tree.sh b/include/tree.sh index e394e973..a2d4c378 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -86,9 +86,7 @@ build_targets() unset CROSS_COMPILE export PATH="$xbmkpath" [ "$x" = "list" ] && x_ ls -1 "config/$project" && \ - listfile="" && break - - target="$x" + listfile="" && break; target="$x" printf "'make %s', '%s', '%s'\n" "$mode" "$project" "$target" x_ handle_defconfig && [ -z "$mode" ] && x_ $postmake; : done; : -- cgit v1.2.1 From 49b02b759fbfbeb862d61045637fcb1e0dbc8853 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 27 May 2025 12:59:42 +0100 Subject: tree.sh: more reliable clean in run_make_command Don't do no-op if it fails; fall back to "clean" instead, and fail if that fails. The no-op was there was not all projects have distclean, but we do intend for them all to be cleaned. We mitigate further error by only running make-clean if a makefile exists. Signed-off-by: Leah Rowe --- include/tree.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/tree.sh b/include/tree.sh index a2d4c378..54de692b 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -292,8 +292,10 @@ run_make_command() $dry x_ make -C "$srcdir" $mode -j$XBMK_THREADS $makeargs [ -n "$mode" ] || x_ $mkhelper + check_makefile "$srcdir" || return 0 [ "$mode" != "clean" ] || \ - $dry make -C "$srcdir" $cleanargs distclean || :; : + $dry make -C "$srcdir" $cleanargs distclean || \ + $dry x_ make -C "$srcdir" $cleanargs clean; : } check_cmake() -- cgit v1.2.1 From 5af830209ba71ac3f13958a05224dd84d38f276f Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 27 May 2025 13:49:13 +0100 Subject: tree.sh: simplify check_autoconf() Signed-off-by: Leah Rowe --- include/tree.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/tree.sh b/include/tree.sh index 54de692b..976e3b56 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -285,8 +285,8 @@ run_make_command() { [ -n "$mode" ] || x_ $premake - $dry check_cmake "$srcdir" && [ -z "$mode" ] && \ - $dry check_autoconf "$srcdir" + $dry check_cmake "$srcdir" + [ -n "$mode" ] || ( $dry check_autoconf "$srcdir" ) || err $dry check_makefile "$srcdir" || return 1 $dry x_ make -C "$srcdir" $mode -j$XBMK_THREADS $makeargs @@ -307,12 +307,10 @@ check_cmake() check_autoconf() { - ( x_ cd "$1" [ -f "bootstrap" ] && x_ ./bootstrap $bootstrapargs [ -f "autogen.sh" ] && x_ ./autogen.sh $autogenargs [ -f "configure" ] && x_ ./configure $autoconfargs; : - ) || err "can't bootstrap project: $1"; : } check_makefile() -- cgit v1.2.1 From d5a657308c0392514006d420cb268ee51f5497c4 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 27 May 2025 14:31:06 +0100 Subject: vendor.sh: simplify getfiles() Signed-off-by: Leah Rowe --- include/vendor.sh | 57 +++++++++++++++++++++++++------------------------------ 1 file changed, 26 insertions(+), 31 deletions(-) (limited to 'include') diff --git a/include/vendor.sh b/include/vendor.sh index e92e811a..5e1c77ff 100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -21,16 +21,15 @@ appdir="$vendir/app" vfix="DO_NOT_FLASH_YET._FIRST,_INJECT_FILES_VIA_INSTRUCTIONS_ON_LIBREBOOT.ORG_" # lbmk-specific extension to the "cv" variable (not suitable for cbmk) -cvchk="CONFIG_INCLUDE_SMSC_SCH5545_EC_FW CONFIG_HAVE_MRC CONFIG_HAVE_ME_BIN \ +cvchk="CONFIG_SMSC_SCH5545_EC_FW_FILE CONFIG_MRC_FILE CONFIG_ME_BIN_PATH \ CONFIG_LENOVO_TBFW_BIN CONFIG_VGA_BIOS_FILE CONFIG_FSP_M_FILE \ 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_FSP_FULL_FD \ +cvxbmk="CONFIG_FSP_FULL_FD CONFIG_IFD_BIN_PATH CONFIG_FSP_M_CBFS \ 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_HAVE_REFCODE_BLOB CONFIG_REFCODE_BLOB_FILE CONFIG_FSP_FD_PATH" # lbmk-specific extensions; mostly used for downloading vendor files eval "`setvars "" has_hashes EC_hash DL_hash DL_url_bkup MRC_refcode_gbe vcfg \ @@ -52,32 +51,28 @@ 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" - [ -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" - [ -z "$CONFIG_KBC1126_FW2" ] || fetch kbc1126ec "$EC_url" \ - "$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" - [ -z "$CONFIG_HAVE_MRC" ] || fetch "mrc" "$MRC_url" "$MRC_url_bkup" \ - "$MRC_hash" "$CONFIG_MRC_FILE" "curl" "$MRC_bin_hash" - [ -z "$CONFIG_REFCODE_BLOB_FILE" ] || fetch "refcode" "$MRC_url" \ - "$MRC_url_bkup" "$MRC_hash" "$CONFIG_REFCODE_BLOB_FILE" "curl" \ - "$REF_bin_hash" - [ -z "$CONFIG_LENOVO_TBFW_BIN" ] || fetch "tbfw" "$TBFW_url" \ - "$TBFW_url_bkup" "$TBFW_hash" "$CONFIG_LENOVO_TBFW_BIN" "curl" \ - "$TBFW_bin_hash" - [ -z "$CONFIG_FSP_M_FILE" ] || fetch "fsp" "$CONFIG_FSP_FD_PATH" \ - "$CONFIG_FSP_FD_PATH" "$FSPFD_hash" "$CONFIG_FSP_M_FILE" "copy" \ - "$FSPM_bin_hash" - [ -z "$CONFIG_FSP_S_FILE" ] || fetch "fsp" "$CONFIG_FSP_FD_PATH" \ - "$CONFIG_FSP_FD_PATH" "$FSPFD_hash" "$CONFIG_FSP_S_FILE" "copy" \ - "$FSPS_bin_hash"; : + fetch intel_me "$DL_url" "$DL_url_bkup" "$DL_hash" \ + "$CONFIG_ME_BIN_PATH" curl "$ME_bin_hash" + fetch sch5545ec "$SCH5545EC_DL_url" "$SCH5545EC_DL_url_bkup" \ + "$SCH5545EC_DL_hash" "$CONFIG_SMSC_SCH5545_EC_FW_FILE" curl \ + "$SCH5545EC_bin_hash" + fetch kbc1126ec "$EC_url" "$EC_url_bkup" "$EC_hash" \ + "$CONFIG_KBC1126_FW1" curl "$EC_FW1_hash" + fetch kbc1126ec "$EC_url" "$EC_url_bkup" "$EC_hash" \ + "$CONFIG_KBC1126_FW2" curl "$EC_FW2_hash" + fetch e6400vga "$E6400_VGA_DL_url" "$E6400_VGA_DL_url_bkup" \ + "$E6400_VGA_DL_hash" "$CONFIG_VGA_BIOS_FILE" curl \ + "$E6400_VGA_bin_hash" + fetch mrc "$MRC_url" "$MRC_url_bkup" "$MRC_hash" "$CONFIG_MRC_FILE" \ + curl "$MRC_bin_hash" + fetch refcode "$MRC_url" "$MRC_url_bkup" "$MRC_hash" \ + "$CONFIG_REFCODE_BLOB_FILE" curl "$REF_bin_hash" + fetch tbfw "$TBFW_url" "$TBFW_url_bkup" "$TBFW_hash" \ + "$CONFIG_LENOVO_TBFW_BIN" curl "$TBFW_bin_hash" + fetch fsp "$CONFIG_FSP_FD_PATH" "$CONFIG_FSP_FD_PATH" "$FSPFD_hash" \ + "$CONFIG_FSP_M_FILE" copy "$FSPM_bin_hash" + fetch fsp "$CONFIG_FSP_FD_PATH" "$CONFIG_FSP_FD_PATH" "$FSPFD_hash" \ + "$CONFIG_FSP_S_FILE" copy "$FSPS_bin_hash"; : } fetch() @@ -86,7 +81,7 @@ fetch() dl="$2" dl_bkup="$3" dlsum="$4" - _dest="${5##*../}" + _dest="${5##*../}" && [ -z "$_dest" ] && return 0 _pre_dest="$XBMK_CACHE/tmpdl/check" || err "!fetch, mktemp, $*" dlop="$6" binsum="$7" -- cgit v1.2.1 From 68eca880c683947e2f189c1368fb6032ce6fc832 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 27 May 2025 14:32:34 +0100 Subject: tree.sh: simplify configure_project() Signed-off-by: Leah Rowe --- include/tree.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/tree.sh b/include/tree.sh index 976e3b56..7bfddf67 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -122,8 +122,7 @@ configure_project() eval "`setvars "" cleanargs build_depend autoconfargs xtree postmake \ makeargs btype mkhelper bootstrapargs premake release xlang xarch \ badhash`" - _tcfg="$1/target.cfg" - [ -f "$_tcfg" ] || btype="auto" + _tcfg="$1/target.cfg" && [ ! -f "$_tcfg" ] && btype="auto" e "$datadir/mkhelper.cfg" f && eval "`setcfg "$datadir/mkhelper.cfg"`" while e "$_tcfg" f || [ "$cmd" != "build_project" ]; do -- cgit v1.2.1 From 00d99adb5c1e0343bf889a260ea57b1292a3bc9c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 27 May 2025 21:42:31 +0100 Subject: Revert "inject.sh: simplify remktar()" This reverts commit 28f03d39cb1a7cfa8db46b3875557a530aebdd46. The commit that this reverts, broke building release roms. Signed-off-by: Leah Rowe --- include/inject.sh | 22 +++++++++++++--------- include/vendor.sh | 4 ++-- 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/inject.sh b/include/inject.sh index 09d155fd..9354b439 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -13,7 +13,7 @@ cv="CONFIG_GBE_BIN_PATH" [ -n "$cvchk" ] && cv="$cv $cvchk" eval "`setvars "" archive boarddir IFD_platform ifdprefix tree new_mac \ - tdir board xchanged $cv`" + tmpromdir board xchanged $cv`" inject() { @@ -41,8 +41,7 @@ inject() x_ e "$archive" f && check_release check_target && patch_release - [ "$xchanged" != "y" ] || ( remktar ) || err - x_ mv "${tdir%"/bin/$board"}/bin/${relname}_${board}.tar.xz" "$archive" + [ "$xchanged" = "y" ] && remktar xnot=" NOT" && [ "$xchanged" = "y" ] && xnot="" printf "\n'%s' was%s modified\n" "$archive" "$xnot" 1>&2 @@ -81,13 +80,13 @@ patch_release() [ "$nuke" = "nuke" ] || x_ ./mk download "$board" has_hashes="n" - tdir="$tmpromdel/bin/$board" + tmpromdir="$tmpromdel/bin/$board" - remkdir "${tdir%"/bin/$board"}" - x_ tar -xf "$archive" -C "${tdir%"/bin/$board"}" + remkdir "${tmpromdir%"/bin/$board"}" + x_ tar -xf "$archive" -C "${tmpromdir%"/bin/$board"}" for _hashes in "vendorhashes" "blobhashes"; do - e "$tdir/$_hashes" f && \ + e "$tmpromdir/$_hashes" f && \ has_hashes="y" && hashfile="$_hashes" && break; : done @@ -118,7 +117,7 @@ modify_mac() x_ make -C util/nvmutil clean && x_ make -C util/nvmutil && \ x_ "$nvm" "$xbloc/gbe" setmac "$new_mac" - fx_ newmac x_ find "$tdir" -maxdepth 1 -type f -name "*.rom" + fx_ newmac x_ find "$tmpromdir" -maxdepth 1 -type f -name "*.rom" printf "\nThe following GbE NVM data will be written:\n" x_ "$nvm" "$xbloc/gbe" dump | grep -v "bytes read from file" || : @@ -132,7 +131,12 @@ newmac() remktar() { - x_ cd "${tdir%"/bin/$board"}" + ( + x_ cd "${tmpromdir%"/bin/$board"}" printf "Re-building tar archive (please wait)\n" mkrom_tarball "bin/$board" 1>/dev/null + ) || err "Cannot re-generate '$archive'" + + mv "${tmpromdir%"/bin/$board"}/bin/${relname}_${board}.tar.xz" \ + "$archive" || err "'$archive' -> Can't overwrite"; : } diff --git a/include/vendor.sh b/include/vendor.sh index 5e1c77ff..f7dce827 100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -256,7 +256,7 @@ getvfile() { eval "`setcfg "config/vendor/$vcfg/pkg.cfg" 1`" bootstrap && [ $# -gt 0 ] && getfiles && return 0 # download - fx_ prep x_ find "$tdir" -maxdepth 1 -type f -name "*.rom" + fx_ prep x_ find "$tmpromdir" -maxdepth 1 -type f -name "*.rom" ( check_vendor_hashes ) || err "$archive: Can't verify hashes"; : } @@ -390,7 +390,7 @@ vfile() check_vendor_hashes() { - x_ cd "$tdir" + x_ cd "$tmpromdir" [ "$has_hashes" = "n" ] || [ "$nuke" = "nuke" ] || sha512sum \ --status -c "$hashfile" || x_ sha1sum --status -c "$hashfile" x_ rm -f "$hashfile" -- cgit v1.2.1