From 265ec0b7673d3df608dfb9e1cbec39b3bb68cdd6 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 17:40:44 +0100 Subject: dependencies/debian: add libx86 already present on a few other config files, e.g. arch i noticed on debian-experimental that i needed to explicitly install it, whereas it was implicitly installed on debian 12 Signed-off-by: Leah Rowe --- config/dependencies/debian | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/dependencies/debian b/config/dependencies/debian index 992fb690..d4c26ee0 100755 --- a/config/dependencies/debian +++ b/config/dependencies/debian @@ -14,5 +14,5 @@ libusb-dev lz4 lzma lzma-alone m4 nasm openssl p7zip p7zip-full parted pciutils perl pkg-config python3 python3-distutils-extra python3-pkg-resources python3-pycryptodome \ python3-pyelftools python3-setuptools python-is-python3 sharutils swig unar \ unifont unifont-bin unzip uuid-dev wget xfonts-unifont zlib1g-dev ccache \ -g++-mipsel-linux-gnu make genisoimage mtools \ +g++-mipsel-linux-gnu make genisoimage mtools libx86-1 libx86-dev \ " -- cgit v1.2.1 From 769a97aed5a712c80141fee8da60868c437fbf36 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 18:50:06 +0100 Subject: init.sh: Hardcode XBMK_CACHE for integrity I never really intended for this to be configurable, but the cache directory is also used during release builds. There's too much that can go wrong, letting the user decide where their cache is. Simplify it by hardcoding. Signed-off-by: Leah Rowe --- include/init.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/include/init.sh b/include/init.sh index ee19c398..cd4acf43 100644 --- a/include/init.sh +++ b/include/init.sh @@ -89,15 +89,9 @@ xbmk_set_env() export TMPDIR="$(mktemp -d -t xbmk_XXXXXXXX)" xbmktmp="$TMPDIR" - # XBMK_CACHE is a directory, for caching downloads and git repon - [ -z "${XBMK_CACHE+x}" ] && export XBMK_CACHE="$xbmkpwd/cache" - [ -z "$XBMK_CACHE" ] && export XBMK_CACHE="$xbmkpwd/cache" + export XBMK_CACHE="$xbmkpwd/cache" [ -L "$XBMK_CACHE" ] && [ "$XBMK_CACHE" = "$xbmkpwd/cache" ] && \ err "cachedir '$xbmkpwd/cache' is a symlink" - [ -L "$XBMK_CACHE" ] && export XBMK_CACHE="$xbmkpwd/cache" - xbmkcache="`findpath "$XBMK_CACHE"`" || \ - err "Can't resolve cachedir: '$XBMK_CACHE'" - export XBMK_CACHE="$xbmkcache" [ ! -e "$XBMK_CACHE" ] || \ [ -d "$XBMK_CACHE" ] || err "cachedir '$XBMK_CACHE' is a file"; : -- cgit v1.2.1 From b25a4876434d371dc4278d71365574158c77d47d Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 18:53:22 +0100 Subject: init.sh: looser XBMK_THREADS validation on child processes, we can simply correct it. we currently provide an error message, but this is silly. Signed-off-by: Leah Rowe --- include/init.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/include/init.sh b/include/init.sh index cd4acf43..38eb1c81 100644 --- a/include/init.sh +++ b/include/init.sh @@ -30,7 +30,7 @@ xbmk_init() id -u 1>/dev/null 2>/dev/null || err "suid check failed (id -u)" [ "$(id -u)" != "0" ] || err "this command as root is not permitted" - for init_cmd in get_version set_env git_init child_exec; do + for init_cmd in get_version set_env set_threads git_init child_exec; do xbmk_$init_cmd "$@" || break done } @@ -76,7 +76,7 @@ xbmk_set_env() if [ "$is_child" = "y" ]; then [ -z "${XBMK_CACHE+x}" ] && err "XBMK_CACHE unset on child" - [ -z "${XBMK_THREADS+x}" ] && err "XBMK_THREADS unset on child" + [ -z "${XBMK_THREADS+x}" ] && xbmk_set_threads e "lock" f missing && err "lock file absent on child" return 1 fi @@ -104,10 +104,6 @@ xbmk_set_env() [ "$XBMK_RELEASE" = "Y" ] && export XBMK_RELEASE="y" [ "$XBMK_RELEASE" = "y" ] || export XBMK_RELEASE="n" - [ -z "${XBMK_THREADS+x}" ] && export XBMK_THREADS=1 - expr "X$XBMK_THREADS" : "X-\{0,1\}[0123456789][0123456789]*$" \ - 1>/dev/null 2>/dev/null || export XBMK_THREADS=1 - xbmk_set_version export LOCALVERSION="-$projectname-${version%%-*}" @@ -117,6 +113,13 @@ xbmk_set_env() xbmk_set_pyver } +xbmk_set_threads() +{ + [ -z "${XBMK_THREADS+x}" ] && export XBMK_THREADS=1 + expr "X$XBMK_THREADS" : "X-\{0,1\}[0123456789][0123456789]*$" \ + 1>/dev/null 2>/dev/null || export XBMK_THREADS=1 +} + xbmk_set_version() { version_="$version" -- cgit v1.2.1 From d9c64b267540a7c0a62f219c1c27c790234fd11c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 19:24:43 +0100 Subject: xbmk: stricter handling of files on while loops i overlooked these! Signed-off-by: Leah Rowe --- include/lib.sh | 4 ++-- include/tree.sh | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/lib.sh b/include/lib.sh index 6c831795..025db88a 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -106,9 +106,9 @@ fx_() dx_() { - [ -f "$2" ] && while read -r fx; do + [ ! -f "$2" ] || while read -r fx; do $1 "$fx" || return 1 - done < "$2"; : + done < "$2" || err "dx_ $*: cannot read '$2'"; : } x_() diff --git a/include/tree.sh b/include/tree.sh index 25d4732c..9dccf857 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -332,8 +332,9 @@ check_makefile() copy_elf() { - [ -f "$listfile" ] && x_ mkdir -p "$dest_dir" && while read -r f; do + [ -f "$listfile" ] && x_ mkdir -p "$dest_dir" + [ ! -f "$listfile" ] || while read -r f; do [ -f "$srcdir/$f" ] && x_ cp "$srcdir/$f" "$dest_dir" - done < "$listfile" + done < "$listfile" || err "copy_elf $*: cannot read '$listfile'" x_ make clean -C "$srcdir" $cleanargs } -- cgit v1.2.1 From 8aaf404ddea8a8d6c21f0a1f83f1675a8b0895aa Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 19:29:59 +0100 Subject: lib.sh: Use while, not for, to process arguments This is more reliable against globbing, in context of for. Signed-off-by: Leah Rowe --- include/lib.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/include/lib.sh b/include/lib.sh index 025db88a..184d0491 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -53,8 +53,10 @@ setvars() fi val="$1" shift 1 - for var in "$@"; do - _setvars="$var=\"$val\"; $_setvars" + while true; do + [ $# -lt 1 ] && break + _setvars="$1=\"$val\"; $_setvars" + shift 1 done printf "%s\n" "${_setvars% }" } @@ -69,9 +71,11 @@ setcfg() chkvars() { - for var in "$@"; do - eval "[ -n \"\${$var+x}\" ] || err \"$var unset\"" - eval "[ -n \"\$$var\" ] || err \"$var unset\"" + while true; do + [ $# -lt 1 ] && break + eval "[ -n \"\${$1+x}\" ] || err \"$1 unset\"" + eval "[ -n \"\$$1\" ] || err \"$1 unset\"" + shift 1 done; : } -- cgit v1.2.1 From 900da04efa929a9373d5a6f3f56f8b8ac8f193df Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 19:57:06 +0100 Subject: tree.sh: fix up copy_elf(), bad for loop Because of how sh works, having just the [] line causes sh to exit, annoyingly without an error message, but it does cause a non-zero exit. This bug will have already been triggering, before I added the recent error handling on files for this for loop. also do it to the other loop in lib.sh Signed-off-by: Leah Rowe --- include/lib.sh | 2 +- include/tree.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/lib.sh b/include/lib.sh index 184d0491..7c4d71ea 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -111,7 +111,7 @@ fx_() dx_() { [ ! -f "$2" ] || while read -r fx; do - $1 "$fx" || return 1 + $1 "$fx" || return 1; : done < "$2" || err "dx_ $*: cannot read '$2'"; : } diff --git a/include/tree.sh b/include/tree.sh index 9dccf857..8d787d4c 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -334,7 +334,7 @@ copy_elf() { [ -f "$listfile" ] && x_ mkdir -p "$dest_dir" [ ! -f "$listfile" ] || while read -r f; do - [ -f "$srcdir/$f" ] && x_ cp "$srcdir/$f" "$dest_dir" - done < "$listfile" || err "copy_elf $*: cannot read '$listfile'" + [ -f "$srcdir/$f" ] && x_ cp "$srcdir/$f" "$dest_dir"; : + done < "$listfile" || err "copy_elf $*: cannot read '$listfile'"; : x_ make clean -C "$srcdir" $cleanargs } -- cgit v1.2.1 From 620c1dd6fae0f0f83212e9f6b6fb27c1faf67b83 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 22:59:20 +0100 Subject: get.sh: Make xbmkget err on exiting the loop check The idea in this function is that if a file or repo is successfully handled, a return will be performed from the loop. If the loop exits for any reason, an error is thrown. The current code is probably fine, but I can forsee future modifications possibly causing bugs here. Make it unambiguous, by always throwing an error if execution reaches the end of the function. Signed-off-by: Leah Rowe --- include/get.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/get.sh b/include/get.sh index 667ab398..ab6ff401 100644 --- a/include/get.sh +++ b/include/get.sh @@ -87,7 +87,8 @@ xbmkget() for url in "$2" "$3"; do [ -n "$url" ] && try_file "$url" "$@" && \ eval "[ -$echk \"$4\" ] && return 0" - done && err "$1 $2 $3 $4: not downloaded"; : + done + err "$1 $2 $3 $4: not downloaded"; : } try_file() -- cgit v1.2.1 From cdc0fb49e1c47a013ea99117acbf62e96ec5c652 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 23:07:01 +0100 Subject: get.sh: make xbmkget() easier to understand the intent once again is that this for loop shall return, with zero status, if success is observed. otherwise, the loop breaks and an error is thrown. Signed-off-by: Leah Rowe --- include/get.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/get.sh b/include/get.sh index ab6ff401..89859454 100644 --- a/include/get.sh +++ b/include/get.sh @@ -85,8 +85,10 @@ xbmkget() echk="f" && [ "$1" = "git" ] && echk="d" for url in "$2" "$3"; do - [ -n "$url" ] && try_file "$url" "$@" && \ - eval "[ -$echk \"$4\" ] && return 0" + [ -n "$url" ] || continue + try_file "$url" "$@" || continue + eval "[ -$echk \"$4\" ] || continue" + return 0 # successful download/copy done err "$1 $2 $3 $4: not downloaded"; : } -- cgit v1.2.1 From f15bb8153a3f2fce6e0aea28ce029c889a2e7c76 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 23:09:37 +0100 Subject: get.sh: stricter URL check in xbmkget() don't skip if the URL is empty. throw an error instead. i decree that all links must be properly initialised, because that is the design of lbmk. where only one link is provided, such as in a local copy operation, the second would succeed no better than the first so two identical paths are given. Signed-off-by: Leah Rowe --- include/get.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/get.sh b/include/get.sh index 89859454..8280d96b 100644 --- a/include/get.sh +++ b/include/get.sh @@ -85,7 +85,7 @@ xbmkget() echk="f" && [ "$1" = "git" ] && echk="d" for url in "$2" "$3"; do - [ -n "$url" ] || continue + [ -n "$url" ] || err "empty URL given in: xbmkget $*" try_file "$url" "$@" || continue eval "[ -$echk \"$4\" ] || continue" return 0 # successful download/copy -- cgit v1.2.1 From 903f78bf080ee8ad9176022005b81a3d3ac530b3 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 23:13:29 +0100 Subject: get.sh: add missing check in fetch_project() we check the main url, but not backup urls. this patch fixes that oversight. Signed-off-by: Leah Rowe --- include/get.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/get.sh b/include/get.sh index 8280d96b..ae2c5a35 100644 --- a/include/get.sh +++ b/include/get.sh @@ -22,7 +22,7 @@ fetch_project() eval "`setvars "" xtree`" eval "`setcfg "config/git/$project/pkg.cfg"`" - chkvars url + chkvars url bkup_url [ -n "$xtree" ] && x_ ./mk -f coreboot "$xtree" [ -z "$depend" ] || for d in $depend ; do -- cgit v1.2.1 From fb7aaa78bb080a473bdf0edf449bf08045e8366c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 20 May 2025 02:58:33 +0100 Subject: vendor.sh: optimise find_me() i'm adding characters to 7ztest, which isn't being passed on through because everything runs in subshells; the next pass would default back to the original string, so a given file may be checked multiple times. fix this by mitigation; use the random string from mktemp as a suffix instead. in practice, this has not affected performance much, but it will nevertheless avoid unnecessary work by xbmk. Signed-off-by: Leah Rowe --- include/init.sh | 2 +- include/vendor.sh | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/include/init.sh b/include/init.sh index 38eb1c81..39d48948 100644 --- a/include/init.sh +++ b/include/init.sh @@ -181,7 +181,7 @@ pybin() [ $venv -gt 0 ] && for pypath in "/usr/local/bin" "/usr/bin"; do [ -e "$pypath/$1" ] && [ ! -d "$pypath/$1" ] && \ [ -x "$pypath/$1" ] && printf "%s/%s\n" "$pypath" "$1" && \ - return 0 + return 0; : done && return 1 # Defer to normal command -v if not a venv diff --git a/include/vendor.sh b/include/vendor.sh index 2732eade..88c3fa04 100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -38,7 +38,7 @@ eval "`setvars "" has_hashes EC_hash DL_hash DL_url_bkup MRC_refcode_gbe vcfg \ E6400_VGA_DL_hash E6400_VGA_DL_url E6400_VGA_DL_url_bkup E6400_VGA_offset \ E6400_VGA_romname SCH5545EC_DL_url_bkup SCH5545EC_DL_hash _dest mecleaner \ kbc1126_ec_dump MRC_refcode_cbtree _dl SCH5545EC_DL_url EC_url rom DL_url \ - nuke cbfstoolref FSPFD_hash _7ztest ME11bootguard ME11delta xromsize \ + nuke cbfstoolref FSPFD_hash ME11bootguard ME11delta xromsize \ ME11version ME11sku ME11pch _me _metmp mfs TBFW_url_bkup TBFW_url cbdir \ TBFW_hash TBFW_size hashfile EC_url_bkup FSPM_bin_hash FSPS_bin_hash \ EC_FW1_hash EC_FW2_hash ME_bin_hash MRC_bin_hash REF_bin_hash _dl_bin \ @@ -156,7 +156,6 @@ 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" @@ -165,7 +164,7 @@ extract_intel_me() [ "$ME11bootguard" = "y" ] && x_ ./mk -f deguard set +u +e - x_ rm -Rf "$xbmkpwd/metmp" + x_ rm -Rf "$xbmklocal/metmp" ( fx_ find_me x_ find "$xbmkpwd/$appdir" -type f ) || : [ "$ME11bootguard" != "y" ] && x_ mv "$_metmp" "$_pre_dest" && return 0 @@ -182,14 +181,19 @@ find_me() [ -f "$_metmp" ] && exit 1 [ -L "$1" ] && return 0 - _7ztest="${_7ztest}a" && _r="-r" && [ -n "$mfs" ] && _r="" + _7x="`mktemp`" || err "find_me: can't make tmp file" + x_ rm -f "$_7x" + _7x="$xbmklocal/metmp/${_7x##*/}" + + _r="-r" + [ -n "$mfs" ] && _r="" "$mecleaner" $mfs $_r -t -O "$xbmklocal/a" -M "$_metmp" "$1" || \ "$mecleaner" $mfs $_r -t -O "$_metmp" "$1" || "$me7updateparser" \ - -O "$_metmp" "$1" || extract_archive "$1" "$_7ztest" || return 0 + -O "$_metmp" "$1" || extract_archive "$1" "$_7x" || return 0 [ -f "$_metmp" ] && exit 1 - ( fx_ find_me x_ find "$_7ztest" -type f ) || exit 1; : + ( fx_ find_me x_ find "$_7x" -type f ) || exit 1; : } extract_archive() -- cgit v1.2.1 From f6b77822835fcd775a845c825a4e6a78abaa742a Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 20 May 2025 20:14:09 +0100 Subject: Revert "vendor.sh: optimise find_me()" This reverts commit fb7aaa78bb080a473bdf0edf449bf08045e8366c. it caused a few issues. will re-do later the old code isn't really broken, just inefficient, because several files are scanned twice, but in practise the overhead isn't that great The error occurs sometimes, when bruteforcing me.bin: ERROR ./mk: Unhandled error for: mv /home/user/lbmk/tmp/me.bin /home/user/lbmk/cache/tmpdl/check This revert should fix the issue, for now. --- include/init.sh | 2 +- include/vendor.sh | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/include/init.sh b/include/init.sh index 39d48948..38eb1c81 100644 --- a/include/init.sh +++ b/include/init.sh @@ -181,7 +181,7 @@ pybin() [ $venv -gt 0 ] && for pypath in "/usr/local/bin" "/usr/bin"; do [ -e "$pypath/$1" ] && [ ! -d "$pypath/$1" ] && \ [ -x "$pypath/$1" ] && printf "%s/%s\n" "$pypath" "$1" && \ - return 0; : + return 0 done && return 1 # Defer to normal command -v if not a venv diff --git a/include/vendor.sh b/include/vendor.sh index 88c3fa04..2732eade 100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -38,7 +38,7 @@ eval "`setvars "" has_hashes EC_hash DL_hash DL_url_bkup MRC_refcode_gbe vcfg \ E6400_VGA_DL_hash E6400_VGA_DL_url E6400_VGA_DL_url_bkup E6400_VGA_offset \ E6400_VGA_romname SCH5545EC_DL_url_bkup SCH5545EC_DL_hash _dest mecleaner \ kbc1126_ec_dump MRC_refcode_cbtree _dl SCH5545EC_DL_url EC_url rom DL_url \ - nuke cbfstoolref FSPFD_hash ME11bootguard ME11delta xromsize \ + nuke cbfstoolref FSPFD_hash _7ztest ME11bootguard ME11delta xromsize \ ME11version ME11sku ME11pch _me _metmp mfs TBFW_url_bkup TBFW_url cbdir \ TBFW_hash TBFW_size hashfile EC_url_bkup FSPM_bin_hash FSPS_bin_hash \ EC_FW1_hash EC_FW2_hash ME_bin_hash MRC_bin_hash REF_bin_hash _dl_bin \ @@ -156,6 +156,7 @@ 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" @@ -164,7 +165,7 @@ extract_intel_me() [ "$ME11bootguard" = "y" ] && x_ ./mk -f deguard set +u +e - x_ rm -Rf "$xbmklocal/metmp" + x_ rm -Rf "$xbmkpwd/metmp" ( fx_ find_me x_ find "$xbmkpwd/$appdir" -type f ) || : [ "$ME11bootguard" != "y" ] && x_ mv "$_metmp" "$_pre_dest" && return 0 @@ -181,19 +182,14 @@ find_me() [ -f "$_metmp" ] && exit 1 [ -L "$1" ] && return 0 - _7x="`mktemp`" || err "find_me: can't make tmp file" - x_ rm -f "$_7x" - _7x="$xbmklocal/metmp/${_7x##*/}" - - _r="-r" - [ -n "$mfs" ] && _r="" + _7ztest="${_7ztest}a" && _r="-r" && [ -n "$mfs" ] && _r="" "$mecleaner" $mfs $_r -t -O "$xbmklocal/a" -M "$_metmp" "$1" || \ "$mecleaner" $mfs $_r -t -O "$_metmp" "$1" || "$me7updateparser" \ - -O "$_metmp" "$1" || extract_archive "$1" "$_7x" || return 0 + -O "$_metmp" "$1" || extract_archive "$1" "$_7ztest" || return 0 [ -f "$_metmp" ] && exit 1 - ( fx_ find_me x_ find "$_7x" -type f ) || exit 1; : + ( fx_ find_me x_ find "$_7ztest" -type f ) || exit 1; : } extract_archive() -- cgit v1.2.1 From 24b8e633e0348d60dc7d64a919605e69f6ef0379 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 21 May 2025 13:34:18 +0100 Subject: GRUB: Update to revision 73d1c959e (14 March 2025) This brings in several changes from upstream: * 73d1c959e cryptocheck: Add --quiet option * dbc0eb5bd disk/cryptodisk: Wipe the passphrase from memory * 301b4ef25 disk/cryptodisk: Add the "erase secrets" function * 23ec4535f docs: Document available crypto disks checks * 10d778c4b commands/search: Add the diskfilter support * 7a584fbde disk/diskfilter: Introduce the "cryptocheck" command * ed691c0e0 commands/search: Introduce the --cryptodisk-only argument * c448f511e kern/rescue_reader: Block the rescue mode until the CLI authentication * 4abac0ad5 fs/xfs: Fix large extent counters incompat feature support This commit is of particular interest: * dbc0eb5bd disk/cryptodisk: Wipe the passphrase from memory Signed-off-by: Leah Rowe --- config/grub/default/target.cfg | 2 +- config/grub/nvme/target.cfg | 2 +- config/grub/xhci/target.cfg | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/grub/default/target.cfg b/config/grub/default/target.cfg index a9dab736..f5cc85f1 100644 --- a/config/grub/default/target.cfg +++ b/config/grub/default/target.cfg @@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-3.0-or-later tree="default" -rev="a4da71dafeea519b034beb159dfe80c486c2107c" +rev="73d1c959ea3417e9309ba8c6102d7d6dc7c94259" diff --git a/config/grub/nvme/target.cfg b/config/grub/nvme/target.cfg index aa86509f..7e473f19 100644 --- a/config/grub/nvme/target.cfg +++ b/config/grub/nvme/target.cfg @@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-3.0-or-later tree="nvme" -rev="a4da71dafeea519b034beb159dfe80c486c2107c" +rev="73d1c959ea3417e9309ba8c6102d7d6dc7c94259" diff --git a/config/grub/xhci/target.cfg b/config/grub/xhci/target.cfg index 5727e70b..0b90065b 100644 --- a/config/grub/xhci/target.cfg +++ b/config/grub/xhci/target.cfg @@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-3.0-or-later tree="xhci" -rev="a4da71dafeea519b034beb159dfe80c486c2107c" +rev="73d1c959ea3417e9309ba8c6102d7d6dc7c94259" -- cgit v1.2.1 From a3250d144744e77b6a0d0f7cf011ecc6800edaaf Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 22 May 2025 01:17:27 +0100 Subject: tree.sh: Don't run make-clean on dry runs Otherwise, ./mk -d (without arguments) fails for GRUB, which first requires running autoconf to get a Makefile. Signed-off-by: Leah Rowe --- include/tree.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/tree.sh b/include/tree.sh index 8d787d4c..83887864 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -275,7 +275,8 @@ elfcheck() handle_makefile() { - $dry check_makefile "$srcdir" && x_ make -C "$srcdir" $cleanargs clean + $dry check_makefile "$srcdir" && \ + $dry x_ make -C "$srcdir" $cleanargs clean [ -f "$defconfig" ] && x_ cp "$defconfig" "$srcdir/.config" [ -n "$mode" ] || [ -n "$btype" ] || $dry make -C \ -- cgit v1.2.1 From 8e0c6059d155052c30a2b765b91c580e93ebdb7f Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 22 May 2025 01:47:02 +0100 Subject: rom.sh: skip copyps1bios on dry builds otherwise, ./mk -d (without arguments) will fail. Signed-off-by: Leah Rowe --- include/rom.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/rom.sh b/include/rom.sh index 65900a01..1c39979d 100644 --- a/include/rom.sh +++ b/include/rom.sh @@ -20,6 +20,8 @@ buildser() copyps1bios() { + [ "$dry" = ":" ] && return 0; : + remkdir "bin/playstation" x_ cp src/pcsx-redux/src/mips/openbios/openbios.bin bin/playstation -- cgit v1.2.1 From f9266601b8c73daf36518c71db5e5c36080f3ddf Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 22 May 2025 11:27:22 +0100 Subject: vendor.sh: add colon at the end of a for loop Signed-off-by: Leah Rowe --- include/vendor.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/vendor.sh b/include/vendor.sh index 2732eade..99fc7467 100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -107,7 +107,7 @@ fetch() [ "$dl_type" = "fsp" ] && for _cdl in dl dl_bkup; do eval "$_cdl=\"\${$_cdl##*../}\"; _cdp=\"\$$_cdl\"" [ -f "$_cdp" ] || _cdp="$cbdir/$_cdp" - [ -f "$_cdp" ] && eval "$_cdl=\"$_cdp\"" + [ -f "$_cdp" ] && eval "$_cdl=\"$_cdp\""; : done; : # download the file (from the internet) to extract from -- cgit v1.2.1 From fc0720184d954690071dcbf1c9322a2006701a94 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 22 May 2025 11:34:28 +0100 Subject: xbmk: add fake config makefile args to flashprog also pcsx-redux this way, commands like "./mk -u" without argument will not fail. these fake makefile commands do nothing. otherwise, an error errors because their makefiles do not define these options. Signed-off-by: Leah Rowe --- ...002-lbmk-hack-add-config-Makefile-options.patch | 48 ++++++++++++++++++++++ ...-lbmk-hack-add-no-ops-for-config-commands.patch | 43 +++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 config/flashprog/patches/0002-lbmk-hack-add-config-Makefile-options.patch create mode 100644 config/pcsx-redux/patches/0002-lbmk-hack-add-no-ops-for-config-commands.patch diff --git a/config/flashprog/patches/0002-lbmk-hack-add-config-Makefile-options.patch b/config/flashprog/patches/0002-lbmk-hack-add-config-Makefile-options.patch new file mode 100644 index 00000000..d2702d23 --- /dev/null +++ b/config/flashprog/patches/0002-lbmk-hack-add-config-Makefile-options.patch @@ -0,0 +1,48 @@ +From b7a4d2907d3358173510aa6e31af08afe4969b38 Mon Sep 17 00:00:00 2001 +From: Leah Rowe +Date: Thu, 22 May 2025 11:25:42 +0100 +Subject: [PATCH 1/1] lbmk hack: add config Makefile options + +this prevents a build error when running the +-u, -m, -s, -l and -n options in lbmk without +argument. + +this makes no functional changes to flashprog. + +Signed-off-by: Leah Rowe +--- + Makefile | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 12adf61..701f842 100644 +--- a/Makefile ++++ b/Makefile +@@ -1113,7 +1113,23 @@ libpayload: clean + gitconfig: + ./util/getrevision.sh -c 2>/dev/null && ./util/git-hooks/install.sh + +-.PHONY: all install clean distclean config branch tag versioninfo _export export tarball libpayload gitconfig ++oldconfig: ++ : ++ ++menuconfig: ++ : ++ ++savedefconfig: ++ : ++ ++olddefconfig: ++ : ++ ++nconfig: ++ : ++ ++ ++.PHONY: all install clean distclean config branch tag versioninfo _export export tarball libpayload gitconfig oldconfig menuconfig savedefconfig olddefconfig nconfig + + # Disable implicit suffixes and built-in rules (for performance and profit) + .SUFFIXES: +-- +2.39.5 + diff --git a/config/pcsx-redux/patches/0002-lbmk-hack-add-no-ops-for-config-commands.patch b/config/pcsx-redux/patches/0002-lbmk-hack-add-no-ops-for-config-commands.patch new file mode 100644 index 00000000..1a495d60 --- /dev/null +++ b/config/pcsx-redux/patches/0002-lbmk-hack-add-no-ops-for-config-commands.patch @@ -0,0 +1,43 @@ +From e4cd98fb5e3baf8260a3692cab745dea925b0764 Mon Sep 17 00:00:00 2001 +From: Leah Rowe +Date: Thu, 22 May 2025 11:29:37 +0100 +Subject: [PATCH 1/1] lbmk hack: add no-ops for config commands + +./mk -u, -m, -s, -l and -n cause errors without +arguments, because pcsx-redux's makefile doesn't +have them. additionally, i use my own makefile here, +so that only the openbios is compiled. + +add these so that lbmk doesn't crash during tests. + +Signed-off-by: Leah Rowe +--- + lbmkbofhmakefile | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/lbmkbofhmakefile b/lbmkbofhmakefile +index fe2e36d2..e0e2a11e 100644 +--- a/lbmkbofhmakefile ++++ b/lbmkbofhmakefile +@@ -14,3 +14,18 @@ clean: + + distclean: + make -C src/mips/openbios clean ++ ++oldconfig: ++ : ++ ++menuconfig: ++ : ++ ++savedefconfig: ++ : ++ ++olddefconfig: ++ : ++ ++nconfig: ++ : +-- +2.39.5 + -- cgit v1.2.1 From 231b320e63bb452208b3d01e5df6844ead4b76db Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 22 May 2025 11:51:31 +0100 Subject: release.sh: copy version files to rsrc Otherwise, an "unknown" version number is created. This regression was caused by the recent optimisation that reduces the amount of extra work done by init.sh on child instances of xbmk. As a result of those changes, now release.sh has to do some minor initialisation of its own, such as this. Signed-off-by: Leah Rowe --- include/release.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/release.sh b/include/release.sh index 5d6da466..f23ed541 100644 --- a/include/release.sh +++ b/include/release.sh @@ -27,6 +27,8 @@ release() remkdir "$vdir" x_ git clone . "$rsrc" + x_ cp ".version" "$rsrc/.version" + x_ cp ".versiondate" "$rsrc/.versiondate" prep_release src prep_release tarball -- cgit v1.2.1 From 419733d3073cbfc9f8f67e835b385b2b41e6f045 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 22 May 2025 12:22:07 +0100 Subject: get.sh: re-generate remotes every time that way, when a remote changes in config/, it will be updated automatically, without user intervention. Signed-off-by: Leah Rowe --- include/get.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/get.sh b/include/get.sh index ae2c5a35..08a561d9 100644 --- a/include/get.sh +++ b/include/get.sh @@ -143,8 +143,10 @@ try_git() [ -d "$gitdest" ] || x_ mkdir -p "${gitdest%/*}" [ -d "$gitdest" ] || x_ mv "$tmpgitcache" "$gitdest" - ( x_ git -C "$gitdest" remote add main "$4" 2>/dev/null ) || : - ( x_ git -C "$gitdest" remote add backup "$5" 2>/dev/null ) || : + ( x_ git -C "$gitdest" remote remove main ) || : + ( x_ git -C "$gitdest" remote remove backup ) || : + x_ git -C "$gitdest" remote add main "$4" + x_ git -C "$gitdest" remote add backup "$5" ( x_ git -C "$gitdest" fetch --all ) || : ( x_ git -C "$gitdest" pull --all ) || :; : } -- cgit v1.2.1 From 0216a3104a50ebf01405f6e04e44d0349567b85e Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 22 May 2025 12:43:34 +0100 Subject: get.sh: Always update git remotes Right now, if cache/clone/PROJECT/ already exists, the logic for pulling new changes doesn't execute, and neither does the logic for updating remotes. This is bad when updating revisions, because then manual updating is required, defeating the purpose of xbmk's own automation in this regard. Fix it by only checking the cached download on files, not Git repositories; the try_git function itself will already perform this check, before updating remotes and pulling in new commits from upstream. The updating only happens when a given target directory doesn't exist, e.g. src/flashprog/ or src/grub/default/, so this won't slow down release builds for example. Signed-off-by: Leah Rowe --- include/get.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/get.sh b/include/get.sh index 08a561d9..6f1b5f1d 100644 --- a/include/get.sh +++ b/include/get.sh @@ -104,7 +104,8 @@ try_file() echk="d" && [ "$2" != "git" ] && echk="f" && \ bad_checksum "$6" "$cached" 2>/dev/null && x_ rm -f "$cached" - eval "[ -$echk \"$cached\" ] || try_$2 \"\$cached\" \"\$@\" || return 1" + evalchk="[ -$echk \"$cached\" ] || " && [ "$2" = "git" ] && evalchk="" + eval "${evalchk}try_$2 \"\$cached\" \"\$@\" || return 1" [ "$2" != "git" ] && [ -f "$5" ] && \ bad_checksum "$6" "$5" 2>/dev/null && x_ cp "$cached" "$5" eval "[ -$echk \"$cached\" ] || return 1" -- cgit v1.2.1 From 64cc91bca33d3a5356a805155d229b574e954f1c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 22 May 2025 13:48:20 +0100 Subject: coreboot/default: Remove unneeded FSP modules We only need the Kabylake version. We can safely remove the other ones, thereby significantly reducing the size of the lbmk release archive. Signed-off-by: Leah Rowe --- config/coreboot/default/nuke.list | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 config/coreboot/default/nuke.list diff --git a/config/coreboot/default/nuke.list b/config/coreboot/default/nuke.list new file mode 100644 index 00000000..c811f95d --- /dev/null +++ b/config/coreboot/default/nuke.list @@ -0,0 +1,18 @@ +3rdparty/fsp/EagleStreamFspBinPkg +3rdparty/fsp/AlderLakeFspBinPkg +3rdparty/fsp/MeteorLakeFspBinPkg +3rdparty/fsp/IceLakeFspBinPkg +3rdparty/fsp/AmberLakeFspBinPkg +3rdparty/fsp/DenvertonNSFspBinPkg +3rdparty/fsp/TigerLakeFspBinPkg +3rdparty/fsp/CedarIslandFspBinPkg +3rdparty/fsp/ElkhartLakeFspBinPkg +3rdparty/fsp/CometLakeFspBinPkg +3rdparty/fsp/WhitleyFspBinPkg +3rdparty/fsp/ArrowLakeFspBinPkg +3rdparty/fsp/IdavilleFspBinPkg +3rdparty/fsp/BraswellFspBinPkg +3rdparty/fsp/CoffeeLakeFspBinPkg +3rdparty/fsp/RaptorLakeFspBinPkg +3rdparty/fsp/ApolloLakeFspBinPkg +3rdparty/fsp/SkylakeFspBinPkg -- cgit v1.2.1 From 452aeb6001a5fc2b08da72536e6ed0d6fe2b6a9d Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 22 May 2025 14:13:11 +0100 Subject: coreboot: Remove unused vboot tests Futility tests enlarge the src tarballs, without much utility. Uttterly futile. Signed-off-by: Leah Rowe --- config/coreboot/default/nuke.list | 1 + config/coreboot/fam15h/nuke.list | 1 + 2 files changed, 2 insertions(+) create mode 100644 config/coreboot/fam15h/nuke.list diff --git a/config/coreboot/default/nuke.list b/config/coreboot/default/nuke.list index c811f95d..7e5ba3b5 100644 --- a/config/coreboot/default/nuke.list +++ b/config/coreboot/default/nuke.list @@ -16,3 +16,4 @@ 3rdparty/fsp/RaptorLakeFspBinPkg 3rdparty/fsp/ApolloLakeFspBinPkg 3rdparty/fsp/SkylakeFspBinPkg +3rdparty/vboot/tests diff --git a/config/coreboot/fam15h/nuke.list b/config/coreboot/fam15h/nuke.list new file mode 100644 index 00000000..8ca7a4cf --- /dev/null +++ b/config/coreboot/fam15h/nuke.list @@ -0,0 +1 @@ +3rdparty/vboot/tests -- cgit v1.2.1 From 3e28873532b13a750df04d8dad8ffacb159cc7da Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 23 May 2025 04:52:36 +0100 Subject: ifd/hp8300usdt: set the HAP bit by default In practise, coreboot can set this bit at build time. We also use ME Soft Temporary Disable by default, on this platform. We also use me_cleaner by default, so the me.bin file added to flash only contains the code that would run with HAP set anyway. Therefore, this change is of little practical consequence, but as a friend put it to me, this change is most technically correct. And I'm all about technical correctness. Signed-off-by: Leah Rowe --- config/ifd/hp8300usdt/ifd | Bin 4096 -> 4096 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/config/ifd/hp8300usdt/ifd b/config/ifd/hp8300usdt/ifd index 3b81b704..282a8abb 100644 Binary files a/config/ifd/hp8300usdt/ifd and b/config/ifd/hp8300usdt/ifd differ -- cgit v1.2.1