summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rwxr-xr-xbuild147
-rw-r--r--config/data/coreboot/0bin0 -> 1 bytes
-rw-r--r--config/grub/default/patches/0001-mitigate-grub-s-missing-characters-for-borders-arrow.patch2
-rw-r--r--config/grub/default/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch2
-rw-r--r--config/grub/default/patches/0003-Add-CC0-license.patch2
-rw-r--r--config/grub/default/patches/0004-Define-GRUB_UINT32_MAX.patch2
-rw-r--r--config/grub/default/patches/0005-Add-Argon2-algorithm.patch4
-rw-r--r--config/grub/default/patches/0006-Error-on-missing-Argon2id-parameters.patch2
-rw-r--r--config/grub/default/patches/0007-Compile-with-Argon2id-support.patch2
-rw-r--r--config/grub/default/patches/0008-Make-grub-install-work-with-Argon2.patch4
-rw-r--r--config/grub/default/patches/0009-at_keyboard-coreboot-force-scancodes2-translate.patch2
-rw-r--r--config/grub/default/patches/0010-keylayouts-don-t-print-Unknown-key-message.patch2
-rw-r--r--config/grub/default/patches/0011-don-t-print-missing-prefix-errors-on-the-screen.patch2
-rw-r--r--config/grub/default/patches/0012-don-t-print-error-if-module-not-found.patch2
-rw-r--r--config/grub/default/patches/0013-don-t-print-empty-error-messages.patch2
-rw-r--r--config/grub/default/target.cfg2
-rw-r--r--config/grub/nvme/patches/0001-mitigate-grub-s-missing-characters-for-borders-arrow.patch2
-rw-r--r--config/grub/nvme/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch2
-rw-r--r--config/grub/nvme/patches/0003-Add-CC0-license.patch2
-rw-r--r--config/grub/nvme/patches/0004-Define-GRUB_UINT32_MAX.patch2
-rw-r--r--config/grub/nvme/patches/0005-Add-Argon2-algorithm.patch4
-rw-r--r--config/grub/nvme/patches/0006-Error-on-missing-Argon2id-parameters.patch2
-rw-r--r--config/grub/nvme/patches/0007-Compile-with-Argon2id-support.patch2
-rw-r--r--config/grub/nvme/patches/0008-Make-grub-install-work-with-Argon2.patch4
-rw-r--r--config/grub/nvme/patches/0009-at_keyboard-coreboot-force-scancodes2-translate.patch2
-rw-r--r--config/grub/nvme/patches/0010-keylayouts-don-t-print-Unknown-key-message.patch2
-rw-r--r--config/grub/nvme/patches/0011-don-t-print-missing-prefix-errors-on-the-screen.patch2
-rw-r--r--config/grub/nvme/patches/0012-don-t-print-error-if-module-not-found.patch2
-rw-r--r--config/grub/nvme/patches/0013-don-t-print-empty-error-messages.patch2
-rw-r--r--config/grub/nvme/patches/0014-Add-native-NVMe-driver-based-on-SeaBIOS.patch2
-rw-r--r--config/grub/nvme/target.cfg2
-rw-r--r--config/grub/xhci/patches/0001-mitigate-grub-s-missing-characters-for-borders-arrow.patch4
-rw-r--r--config/grub/xhci/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch4
-rw-r--r--config/grub/xhci/patches/0003-Add-CC0-license.patch4
-rw-r--r--config/grub/xhci/patches/0004-Define-GRUB_UINT32_MAX.patch4
-rw-r--r--config/grub/xhci/patches/0005-Add-Argon2-algorithm.patch6
-rw-r--r--config/grub/xhci/patches/0006-Error-on-missing-Argon2id-parameters.patch4
-rw-r--r--config/grub/xhci/patches/0007-Compile-with-Argon2id-support.patch4
-rw-r--r--config/grub/xhci/patches/0008-Make-grub-install-work-with-Argon2.patch6
-rw-r--r--config/grub/xhci/patches/0009-at_keyboard-coreboot-force-scancodes2-translate.patch4
-rw-r--r--config/grub/xhci/patches/0010-keylayouts-don-t-print-Unknown-key-message.patch4
-rw-r--r--config/grub/xhci/patches/0011-don-t-print-missing-prefix-errors-on-the-screen.patch4
-rw-r--r--config/grub/xhci/patches/0012-don-t-print-error-if-module-not-found.patch4
-rw-r--r--config/grub/xhci/patches/0013-don-t-print-empty-error-messages.patch4
-rw-r--r--config/grub/xhci/patches/0014-grub-core-bus-usb-Parse-SuperSpeed-companion-descrip.patch4
-rw-r--r--config/grub/xhci/patches/0015-usb-Add-enum-for-xHCI.patch4
-rw-r--r--config/grub/xhci/patches/0016-usbtrans-Set-default-maximum-packet-size.patch4
-rw-r--r--config/grub/xhci/patches/0017-grub-core-bus-usb-Add-function-pointer-for-attach-de.patch4
-rw-r--r--config/grub/xhci/patches/0018-grub-core-bus-usb-usbhub-Add-new-private-fields-for-.patch4
-rw-r--r--config/grub/xhci/patches/0019-grub-core-bus-usb-Add-xhci-support.patch4
-rw-r--r--config/grub/xhci/patches/0020-grub-core-bus-usb-usbhub-Add-xHCI-non-root-hub-suppo.patch4
-rw-r--r--config/grub/xhci/patches/0021-xHCI-also-accept-SBRN-0x31-and-0x32.patch4
-rw-r--r--config/grub/xhci/patches/0022-xhci-fix-port-indexing.patch4
-rw-r--r--config/grub/xhci/patches/0023-xhci-configure-TT-for-non-root-hubs.patch (renamed from config/grub/xhci/patches/0024-xhci-configure-TT-for-non-root-hubs.patch)6
-rw-r--r--config/grub/xhci/patches/0024-Fix-compilation-on-x86_64.patch (renamed from config/grub/xhci/patches/0025-Fix-compilation-on-x86_64.patch)6
-rw-r--r--config/grub/xhci/patches/0025-Add-native-NVMe-driver-based-on-SeaBIOS.patch (renamed from config/grub/xhci/patches/0026-Add-native-NVMe-driver-based-on-SeaBIOS.patch)4
-rw-r--r--config/grub/xhci/target.cfg2
-rw-r--r--include/git.sh52
-rw-r--r--include/lib.sh93
-rw-r--r--include/mrc.sh14
-rw-r--r--include/rom.sh45
-rw-r--r--include/vendor.sh387
-rwxr-xr-x[l---------]mk495
-rw-r--r--projectname1
-rw-r--r--projectsite1
-rwxr-xr-xscript/trees405
l---------update1
l---------vendor1
69 files changed, 774 insertions, 1046 deletions
diff --git a/.gitignore b/.gitignore
index 177512a7..4979e1f9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,6 +24,8 @@
/push
/version
/versiondate
+/.version
+/.versiondate
/vendorfiles/
*me.bin
*sch5545ec.bin
diff --git a/build b/build
deleted file mode 100755
index f61018c6..00000000
--- a/build
+++ /dev/null
@@ -1,147 +0,0 @@
-#!/usr/bin/env sh
-# SPDX-License-Identifier: GPL-3.0-or-later
-# Copyright (c) 2020-2025 Leah Rowe <leah@libreboot.org>
-# Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com>
-
-set -u -e
-
-if [ "./${0##*/}" != "${0}" ] || [ ! -f "build" ] || [ -L "build" ]; then
- printf "You must run this in the proper work directory.\n" 1>&2
- exit 1
-fi
-
-. "include/lib.sh"
-. "include/vendor.sh"
-. "include/mrc.sh"
-
-eval "`setvars "" vdir src_dirname srcdir mode xp ser`"
-err="fail"
-
-main()
-{
- [ $# -lt 1 ] && $err "bad command"
-
- spath="script/$1"
- shcmd="shift 1"
- if [ "${1#-*}" != "$1" ]; then
- spath="script/trees"
- shcmd=":"
- fi
-
- for g in "command -v git" "git config --global user.name" \
- "git config --global user.email" "git_init"; do
- eval "$g 1>/dev/null 2>/dev/null || $err \"Unconfigured: $g\""
- done
-
- case "${spath#script/}" in
- version) printf "%s\nWebsite: %s\n" "$relname" "$projectsite" ;;
- release)
- shift 1
- mkrelease "$@" ;;
- inject)
- shift 1
- vendor_inject "$@" ;;
- download)
- shift 1
- vendor_download "$@" ;;
- roms)
- if [ $# -gt 1 ] && [ "$2" = "serprog" ]; then
- mk -b stm32-vserprog pico-serprog
- return 0
- fi
- shift 1
- x_ ./mk -b coreboot "$@" ;;
- *)
- [ -f "$spath" ] || $err "bad command"
- $shcmd
- "$spath" "$@" || $err "excmd: $spath $(echo "$@")" ;;
- esac
- set -u -e # some commands disable them. turn them on!
-}
-
-git_init()
-{
- [ -L ".git" ] && return 1
- [ -e ".git" ] && return 0
- eval "`setvars "$(date -Rud @$versiondate)" cdate _nogit`"
-
- git init || return 1
- git add -A . || return 1
- git commit -m "$projectname $version" --date "$cdate" \
- --author="xbmk <xbmk@example.com>" || return 1
- git tag -a "$version" -m "$projectname $version" || return 1
-}
-
-mkrelease()
-{
- export XBMK_RELEASE="y"
-
- vdir="release"
- while getopts d:m: option; do
- [ -z "$OPTARG" ] && $err "empty argument not allowed"
- case "$option" in
- d) vdir="$OPTARG" ;;
- m) mode="$OPTARG" ;;
- *) $err "invalid option '-$option'" ;;
- esac
- done
-
- vdir="$vdir/$version"
- src_dirname="${relname}_src"
- srcdir="$vdir/$src_dirname"
-
- [ -e "$vdir" ] && $err "already exists: \"$vdir\""
- mkdir -p "$vdir" || $err "mkvdir: !mkdir -p \"$vdir\""
- git clone . "$srcdir" || $err "mkdir: !gitclone \"$srcdir\""
- touch "$srcdir/lock" || $err "can't make lock file in $srcdir/"
-
- build_release
-
- printf "\n\nDONE! Check release files under %s\n" "$vdir"
-}
-
-build_release()
-{
- (
- cd "$srcdir" || $err "$vdir: !cd \"$srcdir\""
- ./mk -f
- x_ rm -Rf tmp
- rmgit .
- x_ mv src/docs docs
- ) || $err "can't create release files"
-
- git log --graph --pretty=format:'%Cred%h%Creset %s %Creset' \
- --abbrev-commit > "$srcdir/CHANGELOG" || $err "!gitlog $srcdir"
- rm -f "$srcdir/lock" || $err "can't remove lock file in $srcdir"
-
- (
- cd "${srcdir%/*}" || $err "$vdir: mktarball \"$srcdir\""
- mktarball "${srcdir##*/}" "${srcdir##*/}.tar.xz" || $err "$vdir: mksrc"
- ) || $err "can't create src tarball"
- [ "$mode" = "src" ] && return 0
-
- touch "$srcdir/lock" || $err "can't make lock file in $srcdir/"
- (
- cd "$srcdir" || $err "$vdir: 2 !cd \"$srcdir\""
- mk -b coreboot pico-serprog stm32-vserprog pcsx-redux
- x_ mv bin ../roms
- ) || $err "can't build rom images"
-
- rm -Rf "$srcdir" || $err "!rm -Rf $srcdir"
-}
-
-fail()
-{
- tmp_cleanup || printf "WARNING: can't rm tmpfiles: %s\n" "$TMPDIR" 1>&2
- err_ "${1}"
-}
-
-tmp_cleanup()
-{
- [ "$xbmk_parent" = "y" ] || return 0
- [ "$TMPDIR" = "/tmp" ] || rm -Rf "$TMPDIR" || return 1
- rm -f lock || return 1
-}
-
-main "$@"
-tmp_cleanup || err_ "can't rm TMPDIR upon non-zero exit: $TMPDIR"
diff --git a/config/data/coreboot/0 b/config/data/coreboot/0
new file mode 100644
index 00000000..f76dd238
--- /dev/null
+++ b/config/data/coreboot/0
Binary files differ
diff --git a/config/grub/default/patches/0001-mitigate-grub-s-missing-characters-for-borders-arrow.patch b/config/grub/default/patches/0001-mitigate-grub-s-missing-characters-for-borders-arrow.patch
index 391beaf1..ffd2c537 100644
--- a/config/grub/default/patches/0001-mitigate-grub-s-missing-characters-for-borders-arrow.patch
+++ b/config/grub/default/patches/0001-mitigate-grub-s-missing-characters-for-borders-arrow.patch
@@ -1,4 +1,4 @@
-From 016f8655f5bed2b65c19e0e127b72ba3cfbcfb7d Mon Sep 17 00:00:00 2001
+From 8ccafb60665bba3759248b13d2d1683818aaf4ee Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Sun, 31 Oct 2021 03:47:05 +0000
Subject: [PATCH 01/13] mitigate grub's missing characters for borders/arrow
diff --git a/config/grub/default/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch b/config/grub/default/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch
index 149b719d..933e7dfa 100644
--- a/config/grub/default/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch
+++ b/config/grub/default/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch
@@ -1,4 +1,4 @@
-From d7f6f258ea14ec47d586eccbd0f5d96784e8bd15 Mon Sep 17 00:00:00 2001
+From 3fb09986e62a9945862456d5f1d63a6ccba2c861 Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Sat, 19 Nov 2022 16:30:24 +0000
Subject: [PATCH 02/13] say the name libreboot, in the grub menu
diff --git a/config/grub/default/patches/0003-Add-CC0-license.patch b/config/grub/default/patches/0003-Add-CC0-license.patch
index 09c55867..c074099a 100644
--- a/config/grub/default/patches/0003-Add-CC0-license.patch
+++ b/config/grub/default/patches/0003-Add-CC0-license.patch
@@ -1,4 +1,4 @@
-From 85a88ecf10e1dd5cef7244aedaf7db76e845045f Mon Sep 17 00:00:00 2001
+From dc790ff2ba2702ee863c9d16e05cf843a152f3d4 Mon Sep 17 00:00:00 2001
From: Ax333l <main@axelen.xyz>
Date: Thu, 17 Aug 2023 00:00:00 +0000
Subject: [PATCH 03/13] Add CC0 license
diff --git a/config/grub/default/patches/0004-Define-GRUB_UINT32_MAX.patch b/config/grub/default/patches/0004-Define-GRUB_UINT32_MAX.patch
index 8277df92..af617683 100644
--- a/config/grub/default/patches/0004-Define-GRUB_UINT32_MAX.patch
+++ b/config/grub/default/patches/0004-Define-GRUB_UINT32_MAX.patch
@@ -1,4 +1,4 @@
-From bb12d671182c455c894979a8a5890f5f4baa02dc Mon Sep 17 00:00:00 2001
+From 298eaaca770545e19dfacd47511c2081c1fece08 Mon Sep 17 00:00:00 2001
From: Ax333l <main@axelen.xyz>
Date: Thu, 17 Aug 2023 00:00:00 +0000
Subject: [PATCH 04/13] Define GRUB_UINT32_MAX
diff --git a/config/grub/default/patches/0005-Add-Argon2-algorithm.patch b/config/grub/default/patches/0005-Add-Argon2-algorithm.patch
index 452c0937..dacd83ee 100644
--- a/config/grub/default/patches/0005-Add-Argon2-algorithm.patch
+++ b/config/grub/default/patches/0005-Add-Argon2-algorithm.patch
@@ -1,4 +1,4 @@
-From 216e1351e5957e0589d488427a6dfee246705d0d Mon Sep 17 00:00:00 2001
+From 378aa081ac1211d0bf4043eeb0bb7d4aa534043f Mon Sep 17 00:00:00 2001
From: Ax333l <main@axelen.xyz>
Date: Thu, 17 Aug 2023 00:00:00 +0000
Subject: [PATCH 05/13] Add Argon2 algorithm
@@ -30,7 +30,7 @@ Signed-off-by: Nicholas Johnson <nick@nicholasjohnson.ch>
create mode 100644 grub-core/lib/argon2/ref.c
diff --git a/docs/grub-dev.texi b/docs/grub-dev.texi
-index 3ad8e3efa..d7c6232af 100644
+index f4367f895..9d96cedf9 100644
--- a/docs/grub-dev.texi
+++ b/docs/grub-dev.texi
@@ -503,12 +503,76 @@ GRUB includes some code from other projects, and it is sometimes necessary
diff --git a/config/grub/default/patches/0006-Error-on-missing-Argon2id-parameters.patch b/config/grub/default/patches/0006-Error-on-missing-Argon2id-parameters.patch
index 33bc9417..f1ea10c2 100644
--- a/config/grub/default/patches/0006-Error-on-missing-Argon2id-parameters.patch
+++ b/config/grub/default/patches/0006-Error-on-missing-Argon2id-parameters.patch
@@ -1,4 +1,4 @@
-From a2687cc594714ff33a4c50d40222c113768ed826 Mon Sep 17 00:00:00 2001
+From febaf431d235f07b97f07f935611dc168b0b35bb Mon Sep 17 00:00:00 2001
From: Ax333l <main@axelen.xyz>
Date: Thu, 17 Aug 2023 00:00:00 +0000
Subject: [PATCH 06/13] Error on missing Argon2id parameters
diff --git a/config/grub/default/patches/0007-Compile-with-Argon2id-support.patch b/config/grub/default/patches/0007-Compile-with-Argon2id-support.patch
index 7d22cc74..c0a8fffb 100644
--- a/config/grub/default/patches/0007-Compile-with-Argon2id-support.patch
+++ b/config/grub/default/patches/0007-Compile-with-Argon2id-support.patch
@@ -1,4 +1,4 @@
-From 2d1af8f5dfd1492ac95bcf7db4e6c789aa83018e Mon Sep 17 00:00:00 2001
+From 12d3e4dfff3f92daf2f3f73cc0797425f7bb9df6 Mon Sep 17 00:00:00 2001
From: Ax333l <main@axelen.xyz>
Date: Thu, 17 Aug 2023 00:00:00 +0000
Subject: [PATCH 07/13] Compile with Argon2id support
diff --git a/config/grub/default/patches/0008-Make-grub-install-work-with-Argon2.patch b/config/grub/default/patches/0008-Make-grub-install-work-with-Argon2.patch
index e73a7ccb..12e78752 100644
--- a/config/grub/default/patches/0008-Make-grub-install-work-with-Argon2.patch
+++ b/config/grub/default/patches/0008-Make-grub-install-work-with-Argon2.patch
@@ -1,4 +1,4 @@
-From 67900e39bd45018b5611862b9438081c618b916f Mon Sep 17 00:00:00 2001
+From 8e639e9558c98019566743cc5723e641b1726d15 Mon Sep 17 00:00:00 2001
From: Ax333l <main@axelen.xyz>
Date: Thu, 17 Aug 2023 00:00:00 +0000
Subject: [PATCH 08/13] Make grub-install work with Argon2
@@ -9,7 +9,7 @@ Signed-off-by: Nicholas Johnson <nick@nicholasjohnson.ch>
1 file changed, 2 insertions(+)
diff --git a/util/grub-install.c b/util/grub-install.c
-index 7dc5657bb..cf7315891 100644
+index 060246589..059036d3c 100644
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -448,6 +448,8 @@ probe_mods (grub_disk_t disk)
diff --git a/config/grub/default/patches/0009-at_keyboard-coreboot-force-scancodes2-translate.patch b/config/grub/default/patches/0009-at_keyboard-coreboot-force-scancodes2-translate.patch
index d1973955..50195201 100644
--- a/config/grub/default/patches/0009-at_keyboard-coreboot-force-scancodes2-translate.patch
+++ b/config/grub/default/patches/0009-at_keyboard-coreboot-force-scancodes2-translate.patch
@@ -1,4 +1,4 @@
-From e8ae938700e715194e47d346c43aa4be23f1b4bf Mon Sep 17 00:00:00 2001
+From 8a098ee241040ccfdf03636f558ef6a3b431bb90 Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Mon, 30 Oct 2023 22:19:21 +0000
Subject: [PATCH 09/13] at_keyboard coreboot: force scancodes2+translate
diff --git a/config/grub/default/patches/0010-keylayouts-don-t-print-Unknown-key-message.patch b/config/grub/default/patches/0010-keylayouts-don-t-print-Unknown-key-message.patch
index c9e41d8e..685e21c4 100644
--- a/config/grub/default/patches/0010-keylayouts-don-t-print-Unknown-key-message.patch
+++ b/config/grub/default/patches/0010-keylayouts-don-t-print-Unknown-key-message.patch
@@ -1,4 +1,4 @@
-From dfd1639bb999e3dbbd346cc97f4bbaf32d129cd6 Mon Sep 17 00:00:00 2001
+From d86b69fa2c0d73440e5b990d8ab4b66c5c23fa46 Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Tue, 31 Oct 2023 10:33:28 +0000
Subject: [PATCH 10/13] keylayouts: don't print "Unknown key" message
diff --git a/config/grub/default/patches/0011-don-t-print-missing-prefix-errors-on-the-screen.patch b/config/grub/default/patches/0011-don-t-print-missing-prefix-errors-on-the-screen.patch
index 72c51f8b..f15d78e1 100644
--- a/config/grub/default/patches/0011-don-t-print-missing-prefix-errors-on-the-screen.patch
+++ b/config/grub/default/patches/0011-don-t-print-missing-prefix-errors-on-the-screen.patch
@@ -1,4 +1,4 @@
-From 8421c59fa62ce954dcba05ad04591c651d6dcf43 Mon Sep 17 00:00:00 2001
+From 3726c1e12b8896e4a77cc7a2b490e933dc2c08da Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Sun, 5 Nov 2023 16:14:58 +0000
Subject: [PATCH 11/13] don't print missing prefix errors on the screen
diff --git a/config/grub/default/patches/0012-don-t-print-error-if-module-not-found.patch b/config/grub/default/patches/0012-don-t-print-error-if-module-not-found.patch
index dab4318c..713f1244 100644
--- a/config/grub/default/patches/0012-don-t-print-error-if-module-not-found.patch
+++ b/config/grub/default/patches/0012-don-t-print-error-if-module-not-found.patch
@@ -1,4 +1,4 @@
-From c377f3c025101da17252a43449cc58fdd44c44af Mon Sep 17 00:00:00 2001
+From c86a635609a4623baa9312f5c1bebfd51f5883a1 Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Sun, 5 Nov 2023 16:36:22 +0000
Subject: [PATCH 12/13] don't print error if module not found
diff --git a/config/grub/default/patches/0013-don-t-print-empty-error-messages.patch b/config/grub/default/patches/0013-don-t-print-empty-error-messages.patch
index c351a74a..d23ea109 100644
--- a/config/grub/default/patches/0013-don-t-print-empty-error-messages.patch
+++ b/config/grub/default/patches/0013-don-t-print-empty-error-messages.patch
@@ -1,4 +1,4 @@
-From 664ce75106049547d7595fc021a0a1f9a69e585a Mon Sep 17 00:00:00 2001
+From 715ba566042aa140cbeb06836c558460ef6f446f Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Sun, 5 Nov 2023 17:25:20 +0000
Subject: [PATCH 13/13] don't print empty error messages
diff --git a/config/grub/default/target.cfg b/config/grub/default/target.cfg
index 8264d306..a9dab736 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="4dc6166571645780c459dde2cdc1b001a5ec844c"
+rev="a4da71dafeea519b034beb159dfe80c486c2107c"
diff --git a/config/grub/nvme/patches/0001-mitigate-grub-s-missing-characters-for-borders-arrow.patch b/config/grub/nvme/patches/0001-mitigate-grub-s-missing-characters-for-borders-arrow.patch
index 1421d21b..dff2503c 100644
--- a/config/grub/nvme/patches/0001-mitigate-grub-s-missing-characters-for-borders-arrow.patch
+++ b/config/grub/nvme/patches/0001-mitigate-grub-s-missing-characters-for-borders-arrow.patch
@@ -1,4 +1,4 @@
-From 07cd05c1756cdb18cf5e55d72e4002e271e8af12 Mon Sep 17 00:00:00 2001
+From 5f8189d928309146675a56279458d8bb7534ec0c Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Sun, 31 Oct 2021 03:47:05 +0000
Subject: [PATCH 01/14] mitigate grub's missing characters for borders/arrow
diff --git a/config/grub/nvme/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch b/config/grub/nvme/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch
index fd77218a..8a1203d7 100644
--- a/config/grub/nvme/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch
+++ b/config/grub/nvme/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch
@@ -1,4 +1,4 @@
-From c1617d04ac24544d578643863c545bb885444030 Mon Sep 17 00:00:00 2001
+From fce8730b8c20b7de0394976861b3d2ebcc21f425 Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Sat, 19 Nov 2022 16:30:24 +0000
Subject: [PATCH 02/14] say the name libreboot, in the grub menu
diff --git a/config/grub/nvme/patches/0003-Add-CC0-license.patch b/config/grub/nvme/patches/0003-Add-CC0-license.patch
index e4704e6e..5a664f32 100644
--- a/config/grub/nvme/patches/0003-Add-CC0-license.patch
+++ b/config/grub/nvme/patches/0003-Add-CC0-license.patch
@@ -1,4 +1,4 @@
-From 4987b1725277f0e16895b7a67b8b2af9de3183ed Mon Sep 17 00:00:00 2001
+From 088901d1a7577b52d110803d3c6a0e198130e524 Mon Sep 17 00:00:00 2001
From: Ax333l <main@axelen.xyz>
Date: Thu, 17 Aug 2023 00:00:00 +0000
Subject: [PATCH 03/14] Add CC0 license
diff --git a/config/grub/nvme/patches/0004-Define-GRUB_UINT32_MAX.patch b/config/grub/nvme/patches/0004-Define-GRUB_UINT32_MAX.patch
index ff11241f..9e7b2b99 100644
--- a/config/grub/nvme/patches/0004-Define-GRUB_UINT32_MAX.patch
+++ b/config/grub/nvme/patches/0004-Define-GRUB_UINT32_MAX.patch
@@ -1,4 +1,4 @@
-From 6e3672bcba5075908f2a3b2ec235168bf2a4b1ed Mon Sep 17 00:00:00 2001
+From 1a3fdb4075f32eab6ebda0c813720f0336f1bde7 Mon Sep 17 00:00:00 2001
From: Ax333l <main@axelen.xyz>
Date: Thu, 17 Aug 2023 00:00:00 +0000
Subject: [PATCH 04/14] Define GRUB_UINT32_MAX
diff --git a/config/grub/nvme/patches/0005-Add-Argon2-algorithm.patch b/config/grub/nvme/patches/0005-Add-Argon2-algorithm.patch
index 1bdc0717..df088e63 100644
--- a/config/grub/nvme/patches/0005-Add-Argon2-algorithm.patch
+++ b/config/grub/nvme/patches/0005-Add-Argon2-algorithm.patch
@@ -1,4 +1,4 @@
-From ec94eb604358bd87236fc3cce9d14770c3595461 Mon Sep 17 00:00:00 2001
+From 490fb23a8bd4d669a3dc48f0581321f08f6f2020 Mon Sep 17 00:00:00 2001
From: Ax333l <main@axelen.xyz>
Date: Thu, 17 Aug 2023 00:00:00 +0000
Subject: [PATCH 05/14] Add Argon2 algorithm
@@ -30,7 +30,7 @@ Signed-off-by: Nicholas Johnson <nick@nicholasjohnson.ch>
create mode 100644 grub-core/lib/argon2/ref.c
diff --git a/docs/grub-dev.texi b/docs/grub-dev.texi
-index 3ad8e3efa..d7c6232af 100644
+index f4367f895..9d96cedf9 100644
--- a/docs/grub-dev.texi
+++ b/docs/grub-dev.texi
@@ -503,12 +503,76 @@ GRUB includes some code from other projects, and it is sometimes necessary
diff --git a/config/grub/nvme/patches/0006-Error-on-missing-Argon2id-parameters.patch b/config/grub/nvme/patches/0006-Error-on-missing-Argon2id-parameters.patch
index ffacb5fa..ef109bd3 100644
--- a/config/grub/nvme/patches/0006-Error-on-missing-Argon2id-parameters.patch
+++ b/config/grub/nvme/patches/0006-Error-on-missing-Argon2id-parameters.patch
@@ -1,4 +1,4 @@
-From e02e392863dd30f40c538770c31268a8337433c5 Mon Sep 17 00:00:00 2001
+From c8fac788716d0c8723149eee205f1f0bdc92efbe Mon Sep 17 00:00:00 2001
From: Ax333l <main@axelen.xyz>
Date: Thu, 17 Aug 2023 00:00:00 +0000
Subject: [PATCH 06/14] Error on missing Argon2id parameters
diff --git a/config/grub/nvme/patches/0007-Compile-with-Argon2id-support.patch b/config/grub/nvme/patches/0007-Compile-with-Argon2id-support.patch
index e34fd631..517752ee 100644
--- a/config/grub/nvme/patches/0007-Compile-with-Argon2id-support.patch
+++ b/config/grub/nvme/patches/0007-Compile-with-Argon2id-support.patch
@@ -1,4 +1,4 @@
-From 67a96fa1d99ebf28dbdaefbce57e6f3cba2f6bf3 Mon Sep 17 00:00:00 2001
+From c9046b0a40ddc43d97e93127538bec0fde62d04e Mon Sep 17 00:00:00 2001
From: Ax333l <main@axelen.xyz>
Date: Thu, 17 Aug 2023 00:00:00 +0000
Subject: [PATCH 07/14] Compile with Argon2id support
diff --git a/config/grub/nvme/patches/0008-Make-grub-install-work-with-Argon2.patch b/config/grub/nvme/patches/0008-Make-grub-install-work-with-Argon2.patch
index c1726631..1cf06602 100644
--- a/config/grub/nvme/patches/0008-Make-grub-install-work-with-Argon2.patch
+++ b/config/grub/nvme/patches/0008-Make-grub-install-work-with-Argon2.patch
@@ -1,4 +1,4 @@
-From de000f70873b61d62b0d561e0af5302e178c4e42 Mon Sep 17 00:00:00 2001
+From bc99124fb0de2e4b0407f5b8591306241ffc7dc1 Mon Sep 17 00:00:00 2001
From: Ax333l <main@axelen.xyz>
Date: Thu, 17 Aug 2023 00:00:00 +0000
Subject: [PATCH 08/14] Make grub-install work with Argon2
@@ -9,7 +9,7 @@ Signed-off-by: Nicholas Johnson <nick@nicholasjohnson.ch>
1 file changed, 2 insertions(+)
diff --git a/util/grub-install.c b/util/grub-install.c
-index 7dc5657bb..cf7315891 100644
+index 060246589..059036d3c 100644
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -448,6 +448,8 @@ probe_mods (grub_disk_t disk)
diff --git a/config/grub/nvme/patches/0009-at_keyboard-coreboot-force-scancodes2-translate.patch b/config/grub/nvme/patches/0009-at_keyboard-coreboot-force-scancodes2-translate.patch
index bc1fa260..9a1d866b 100644
--- a/config/grub/nvme/patches/0009-at_keyboard-coreboot-force-scancodes2-translate.patch
+++ b/config/grub/nvme/patches/0009-at_keyboard-coreboot-force-scancodes2-translate.patch
@@ -1,4 +1,4 @@
-From 5b239742565ed20fce545aa32952a37bbb45beb8 Mon Sep 17 00:00:00 2001
+From 47ee3e0a5635e99d04fb1248a4896c24ff5bc746 Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Mon, 30 Oct 2023 22:19:21 +0000
Subject: [PATCH 09/14] at_keyboard coreboot: force scancodes2+translate
diff --git a/config/grub/nvme/patches/0010-keylayouts-don-t-print-Unknown-key-message.patch b/config/grub/nvme/patches/0010-keylayouts-don-t-print-Unknown-key-message.patch
index 62c320ba..d11d424f 100644
--- a/config/grub/nvme/patches/0010-keylayouts-don-t-print-Unknown-key-message.patch
+++ b/config/grub/nvme/patches/0010-keylayouts-don-t-print-Unknown-key-message.patch
@@ -1,4 +1,4 @@
-From f8c3f597daf62a13f1c1169fddd78c833dd05cf1 Mon Sep 17 00:00:00 2001
+From 1934b92519503bfbb8c2f331afab6a34255250ad Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Tue, 31 Oct 2023 10:33:28 +0000
Subject: [PATCH 10/14] keylayouts: don't print "Unknown key" message
diff --git a/config/grub/nvme/patches/0011-don-t-print-missing-prefix-errors-on-the-screen.patch b/config/grub/nvme/patches/0011-don-t-print-missing-prefix-errors-on-the-screen.patch
index db720a76..3315f731 100644
--- a/config/grub/nvme/patches/0011-don-t-print-missing-prefix-errors-on-the-screen.patch
+++ b/config/grub/nvme/patches/0011-don-t-print-missing-prefix-errors-on-the-screen.patch
@@ -1,4 +1,4 @@
-From 27c79cf561fd5eef0c8eb5dda9f536cee3926b57 Mon Sep 17 00:00:00 2001
+From 6f48f88cd472729f0274f36cef87e76a31b6db35 Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Sun, 5 Nov 2023 16:14:58 +0000
Subject: [PATCH 11/14] don't print missing prefix errors on the screen
diff --git a/config/grub/nvme/patches/0012-don-t-print-error-if-module-not-found.patch b/config/grub/nvme/patches/0012-don-t-print-error-if-module-not-found.patch
index 63e4b39c..26e08383 100644
--- a/config/grub/nvme/patches/0012-don-t-print-error-if-module-not-found.patch
+++ b/config/grub/nvme/patches/0012-don-t-print-error-if-module-not-found.patch
@@ -1,4 +1,4 @@
-From 752ac0c09c7ac3f1ecc5d3d4d8410d424b433da2 Mon Sep 17 00:00:00 2001
+From aab095ed496aec3be4428b48a36a502426e0d275 Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Sun, 5 Nov 2023 16:36:22 +0000
Subject: [PATCH 12/14] don't print error if module not found
diff --git a/config/grub/nvme/patches/0013-don-t-print-empty-error-messages.patch b/config/grub/nvme/patches/0013-don-t-print-empty-error-messages.patch
index bbc9410e..2519d1cc 100644
--- a/config/grub/nvme/patches/0013-don-t-print-empty-error-messages.patch
+++ b/config/grub/nvme/patches/0013-don-t-print-empty-error-messages.patch
@@ -1,4 +1,4 @@
-From ac7a47b0a80a0f398c1250384fd5bc8c228c5d09 Mon Sep 17 00:00:00 2001
+From 703903ca50b9a5705db0cf5dad1ed2561b28d886 Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Sun, 5 Nov 2023 17:25:20 +0000
Subject: [PATCH 13/14] don't print empty error messages
diff --git a/config/grub/nvme/patches/0014-Add-native-NVMe-driver-based-on-SeaBIOS.patch b/config/grub/nvme/patches/0014-Add-native-NVMe-driver-based-on-SeaBIOS.patch
index 3d7db82c..9f2ee88f 100644
--- a/config/grub/nvme/patches/0014-Add-native-NVMe-driver-based-on-SeaBIOS.patch
+++ b/config/grub/nvme/patches/0014-Add-native-NVMe-driver-based-on-SeaBIOS.patch
@@ -1,4 +1,4 @@
-From 421a826c41882baafb2c5710959810657f24a52e Mon Sep 17 00:00:00 2001
+From e2d0d0695ded985463aac53f6fec5ce945bd4893 Mon Sep 17 00:00:00 2001
From: Mate Kukri <km@mkukri.xyz>
Date: Mon, 20 May 2024 11:43:35 +0100
Subject: [PATCH 14/14] Add native NVMe driver based on SeaBIOS
diff --git a/config/grub/nvme/target.cfg b/config/grub/nvme/target.cfg
index 822d27b6..aa86509f 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="4dc6166571645780c459dde2cdc1b001a5ec844c"
+rev="a4da71dafeea519b034beb159dfe80c486c2107c"
diff --git a/config/grub/xhci/patches/0001-mitigate-grub-s-missing-characters-for-borders-arrow.patch b/config/grub/xhci/patches/0001-mitigate-grub-s-missing-characters-for-borders-arrow.patch
index d1ddc352..5ce90533 100644
--- a/config/grub/xhci/patches/0001-mitigate-grub-s-missing-characters-for-borders-arrow.patch
+++ b/config/grub/xhci/patches/0001-mitigate-grub-s-missing-characters-for-borders-arrow.patch
@@ -1,7 +1,7 @@
-From 96e8baf58dcae1dbc016420ea1972d50f09f8f9b Mon Sep 17 00:00:00 2001
+From 836f5ba3fe25ef53b4cfcd8a0a1f7a6fb9bcb21c Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Sun, 31 Oct 2021 03:47:05 +0000
-Subject: [PATCH 01/26] mitigate grub's missing characters for borders/arrow
+Subject: [PATCH 01/25] mitigate grub's missing characters for borders/arrow
characters
This cleans up the display on the main screen in GRUB.
diff --git a/config/grub/xhci/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch b/config/grub/xhci/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch
index 74970882..14163ab0 100644
--- a/config/grub/xhci/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch
+++ b/config/grub/xhci/patches/0002-say-the-name-libreboot-in-the-grub-menu.patch
@@ -1,7 +1,7 @@
-From f23a77c22e61e466c081d2b81b968bac4812e6b6 Mon Sep 17 00:00:00 2001
+From cb5fe4b9cae34e6ebb12953f62328c883a89a9f2 Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Sat, 19 Nov 2022 16:30:24 +0000
-Subject: [PATCH 02/26] say the name libreboot, in the grub menu
+Subject: [PATCH 02/25] say the name libreboot, in the grub menu
---
grub-core/normal/main.c | 2 +-
diff --git a/config/grub/xhci/patches/0003-Add-CC0-license.patch b/config/grub/xhci/patches/0003-Add-CC0-license.patch
index 1903a465..19e195fa 100644
--- a/config/grub/xhci/patches/0003-Add-CC0-license.patch
+++ b/config/grub/xhci/patches/0003-Add-CC0-license.patch
@@ -1,7 +1,7 @@
-From 4e2ba04266f006369dc10b981803ba3a237f2ad8 Mon Sep 17 00:00:00 2001
+From ef94d2c0a9dab9cb1a6888b07893fa341c463649 Mon Sep 17 00:00:00 2001
From: Ax333l <main@axelen.xyz>
Date: Thu, 17 Aug 2023 00:00:00 +0000
-Subject: [PATCH 03/26] Add CC0 license
+Subject: [PATCH 03/25] Add CC0 license
Signed-off-by: Nicholas Johnson <nick@nicholasjohnson.ch>
---
diff --git a/config/grub/xhci/patches/0004-Define-GRUB_UINT32_MAX.patch b/config/grub/xhci/patches/0004-Define-GRUB_UINT32_MAX.patch
index 2adba78b..cc309abd 100644
--- a/config/grub/xhci/patches/0004-Define-GRUB_UINT32_MAX.patch
+++ b/config/grub/xhci/patches/0004-Define-GRUB_UINT32_MAX.patch
@@ -1,7 +1,7 @@
-From c0b5c14042ee44e0e3ed814ebba3190b47514d82 Mon Sep 17 00:00:00 2001
+From aebfb4ee87203cc0dbe53ae1e951061efb73452f Mon Sep 17 00:00:00 2001
From: Ax333l <main@axelen.xyz>
Date: Thu, 17 Aug 2023 00:00:00 +0000
-Subject: [PATCH 04/26] Define GRUB_UINT32_MAX
+Subject: [PATCH 04/25] Define GRUB_UINT32_MAX
Signed-off-by: Nicholas Johnson <nick@nicholasjohnson.ch>
---
diff --git a/config/grub/xhci/patches/0005-Add-Argon2-algorithm.patch b/config/grub/xhci/patches/0005-Add-Argon2-algorithm.patch
index 0db13c60..35b96718 100644
--- a/config/grub/xhci/patches/0005-Add-Argon2-algorithm.patch
+++ b/config/grub/xhci/patches/0005-Add-Argon2-algorithm.patch
@@ -1,7 +1,7 @@
-From 46aa2f307de53b305045f7706b38a4e0d198875e Mon Sep 17 00:00:00 2001
+From 22a609e508350e2606f90f96d9d0569b2294cfcf Mon Sep 17 00:00:00 2001
From: Ax333l <main@axelen.xyz>
Date: Thu, 17 Aug 2023 00:00:00 +0000
-Subject: [PATCH 05/26] Add Argon2 algorithm
+Subject: [PATCH 05/25] Add Argon2 algorithm
Signed-off-by: Nicholas Johnson <nick@nicholasjohnson.ch>
---
@@ -30,7 +30,7 @@ Signed-off-by: Nicholas Johnson <nick@nicholasjohnson.ch>
create mode 100644 grub-core/lib/argon2/ref.c
diff --git a/docs/grub-dev.texi b/docs/grub-dev.texi
-index 3ad8e3efa..d7c6232af 100644
+index f4367f895..9d96cedf9 100644
--- a/docs/grub-dev.texi
+++ b/docs/grub-dev.texi
@@ -503,12 +503,76 @@ GRUB includes some code from other projects, and it is sometimes necessary
diff --git a/config/grub/xhci/patches/0006-Error-on-missing-Argon2id-parameters.patch b/config/grub/xhci/patches/0006-Error-on-missing-Argon2id-parameters.patch
index b9da0bec..5f487314 100644
--- a/config/grub/xhci/patches/0006-Error-on-missing-Argon2id-parameters.patch
+++ b/config/grub/xhci/patches/0006-Error-on-missing-Argon2id-parameters.patch
@@ -1,7 +1,7 @@
-From c3a68f158725a858206c1fc91407b4993142a4a5 Mon Sep 17 00:00:00 2001
+From 0c0da88e7619e5424ef062ea6867dfe32f032164 Mon Sep 17 00:00:00 2001
From: Ax333l <main@axelen.xyz>
Date: Thu, 17 Aug 2023 00:00:00 +0000
-Subject: [PATCH 06/26] Error on missing Argon2id parameters
+Subject: [PATCH 06/25] Error on missing Argon2id parameters
Signed-off-by: Nicholas Johnson <nick@nicholasjohnson.ch>
---
diff --git a/config/grub/xhci/patches/0007-Compile-with-Argon2id-support.patch b/config/grub/xhci/patches/0007-Compile-with-Argon2id-support.patch
index c6369367..a809e2e4 100644
--- a/config/grub/xhci/patches/0007-Compile-with-Argon2id-support.patch
+++ b/config/grub/xhci/patches/0007-Compile-with-Argon2id-support.patch
@@ -1,7 +1,7 @@
-From 13f149fa5fe4e2ae0e95b3055584335beb9bdee8 Mon Sep 17 00:00:00 2001
+From 2a52c5c4f481469667c7c00e43befac28645d57f Mon Sep 17 00:00:00 2001
From: Ax333l <main@axelen.xyz>
Date: Thu, 17 Aug 2023 00:00:00 +0000
-Subject: [PATCH 07/26] Compile with Argon2id support
+Subject: [PATCH 07/25] Compile with Argon2id support
Signed-off-by: Nicholas Johnson <nick@nicholasjohnson.ch>
---
diff --git a/config/grub/xhci/patches/0008-Make-grub-install-work-with-Argon2.patch b/config/grub/xhci/patches/0008-Make-grub-install-work-with-Argon2.patch
index b0e36f9e..7948ec91 100644
--- a/config/grub/xhci/patches/0008-Make-grub-install-work-with-Argon2.patch
+++ b/config/grub/xhci/patches/0008-Make-grub-install-work-with-Argon2.patch
@@ -1,7 +1,7 @@
-From 068442a692ab28298eab6bfd89a286c1d2ab91e0 Mon Sep 17 00:00:00 2001
+From 15076c6c38f4b7bc8e684974a908295478fbae9d Mon Sep 17 00:00:00 2001
From: Ax333l <main@axelen.xyz>
Date: Thu, 17 Aug 2023 00:00:00 +0000
-Subject: [PATCH 08/26] Make grub-install work with Argon2
+Subject: [PATCH 08/25] Make grub-install work with Argon2
Signed-off-by: Nicholas Johnson <nick@nicholasjohnson.ch>
---
@@ -9,7 +9,7 @@ Signed-off-by: Nicholas Johnson <nick@nicholasjohnson.ch>
1 file changed, 2 insertions(+)
diff --git a/util/grub-install.c b/util/grub-install.c
-index 7dc5657bb..cf7315891 100644
+index 060246589..059036d3c 100644
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -448,6 +448,8 @@ probe_mods (grub_disk_t disk)
diff --git a/config/grub/xhci/patches/0009-at_keyboard-coreboot-force-scancodes2-translate.patch b/config/grub/xhci/patches/0009-at_keyboard-coreboot-force-scancodes2-translate.patch
index 9d7a9387..c18061ba 100644
--- a/config/grub/xhci/patches/0009-at_keyboard-coreboot-force-scancodes2-translate.patch
+++ b/config/grub/xhci/patches/0009-at_keyboard-coreboot-force-scancodes2-translate.patch
@@ -1,7 +1,7 @@
-From 063d8d5fe39d2addca7806ca0a7c6f0544affa8f Mon Sep 17 00:00:00 2001
+From 696f0d54d306472ad00b46e5a702080ae16d0101 Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Mon, 30 Oct 2023 22:19:21 +0000
-Subject: [PATCH 09/26] at_keyboard coreboot: force scancodes2+translate
+Subject: [PATCH 09/25] at_keyboard coreboot: force scancodes2+translate
Scan code set 2 with translation should be assumed in
every case, as the default starting position.
diff --git a/config/grub/xhci/patches/0010-keylayouts-don-t-print-Unknown-key-message.patch b/config/grub/xhci/patches/0010-keylayouts-don-t-print-Unknown-key-message.patch
index b116ea52..80f04547 100644
--- a/config/grub/xhci/patches/0010-keylayouts-don-t-print-Unknown-key-message.patch
+++ b/config/grub/xhci/patches/0010-keylayouts-don-t-print-Unknown-key-message.patch
@@ -1,7 +1,7 @@
-From cb7d93059959eb921328bd285f18e363f0f44aec Mon Sep 17 00:00:00 2001
+From 907e8f373bac0c618c491a3a5cb4137d4446de05 Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Tue, 31 Oct 2023 10:33:28 +0000
-Subject: [PATCH 10/26] keylayouts: don't print "Unknown key" message
+Subject: [PATCH 10/25] keylayouts: don't print "Unknown key" message
on keyboards with stuck keys, this results in GRUB just
spewing it repeatedly, preventing use of GRUB.
diff --git a/config/grub/xhci/patches/0011-don-t-print-missing-prefix-errors-on-the-screen.patch b/config/grub/xhci/patches/0011-don-t-print-missing-prefix-errors-on-the-screen.patch
index 655e0005..a89f9e29 100644
--- a/config/grub/xhci/patches/0011-don-t-print-missing-prefix-errors-on-the-screen.patch
+++ b/config/grub/xhci/patches/0011-don-t-print-missing-prefix-errors-on-the-screen.patch
@@ -1,7 +1,7 @@
-From 2ca7390361d1ff8ea18399b41e38436c8d506d60 Mon Sep 17 00:00:00 2001
+From b5693f53db4d337b4345192da08130b0f2f9bd08 Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Sun, 5 Nov 2023 16:14:58 +0000
-Subject: [PATCH 11/26] don't print missing prefix errors on the screen
+Subject: [PATCH 11/25] don't print missing prefix errors on the screen
we do actually set the prefix. this patch modifies
grub to still set grub_errno and return accordingly,
diff --git a/config/grub/xhci/patches/0012-don-t-print-error-if-module-not-found.patch b/config/grub/xhci/patches/0012-don-t-print-error-if-module-not-found.patch
index 589dd4d7..913e148c 100644
--- a/config/grub/xhci/patches/0012-don-t-print-error-if-module-not-found.patch
+++ b/config/grub/xhci/patches/0012-don-t-print-error-if-module-not-found.patch
@@ -1,7 +1,7 @@
-From 51b439fc0aea4ef2c52c80fa765d9bda992a8ac2 Mon Sep 17 00:00:00 2001
+From 55c2e4b1d413fa03d9597007b16d136b3a6fa713 Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Sun, 5 Nov 2023 16:36:22 +0000
-Subject: [PATCH 12/26] don't print error if module not found
+Subject: [PATCH 12/25] don't print error if module not found
still set grub_errno accordingly, and otherwise
behave the same. in libreboot, we remove a lot of
diff --git a/config/grub/xhci/patches/0013-don-t-print-empty-error-messages.patch b/config/grub/xhci/patches/0013-don-t-print-empty-error-messages.patch
index 7cd354e3..381bca8b 100644
--- a/config/grub/xhci/patches/0013-don-t-print-empty-error-messages.patch
+++ b/config/grub/xhci/patches/0013-don-t-print-empty-error-messages.patch
@@ -1,7 +1,7 @@
-From 88c2d1618283c7f1c3b4adbce532789b0ca2447d Mon Sep 17 00:00:00 2001
+From 93210cf7c046c0c9c8c77ffde4397a25d391c64d Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Sun, 5 Nov 2023 17:25:20 +0000
-Subject: [PATCH 13/26] don't print empty error messages
+Subject: [PATCH 13/25] don't print empty error messages
this is part two of the quest to kill the prefix
error message. after i disabled prefix-related
diff --git a/config/grub/xhci/patches/0014-grub-core-bus-usb-Parse-SuperSpeed-companion-descrip.patch b/config/grub/xhci/patches/0014-grub-core-bus-usb-Parse-SuperSpeed-companion-descrip.patch
index a35a16e9..a2df041f 100644
--- a/config/grub/xhci/patches/0014-grub-core-bus-usb-Parse-SuperSpeed-companion-descrip.patch
+++ b/config/grub/xhci/patches/0014-grub-core-bus-usb-Parse-SuperSpeed-companion-descrip.patch
@@ -1,7 +1,7 @@
-From 2472f3c2e465863c51a3cacf96ab910c015cfa8e Mon Sep 17 00:00:00 2001
+From a216d09bffcb2f2bff96445cca412c9328b4a6bf Mon Sep 17 00:00:00 2001
From: Patrick Rudolph <patrick.rudolph@9elements.com>
Date: Sun, 15 Nov 2020 19:00:27 +0100
-Subject: [PATCH 14/26] grub-core/bus/usb: Parse SuperSpeed companion
+Subject: [PATCH 14/25] grub-core/bus/usb: Parse SuperSpeed companion
descriptors
Parse the SS_ENDPOINT_COMPANION descriptor, which is only present on USB 3.0
diff --git a/config/grub/xhci/patches/0015-usb-Add-enum-for-xHCI.patch b/config/grub/xhci/patches/0015-usb-Add-enum-for-xHCI.patch
index 84b81df7..1e45acc8 100644
--- a/config/grub/xhci/patches/0015-usb-Add-enum-for-xHCI.patch
+++ b/config/grub/xhci/patches/0015-usb-Add-enum-for-xHCI.patch
@@ -1,7 +1,7 @@
-From 681a247209c83451cdebf6fc02cee6737a1921b6 Mon Sep 17 00:00:00 2001
+From cb56fbac65869f04fcf9b0b4b360f4ccc6deabed Mon Sep 17 00:00:00 2001
From: Patrick Rudolph <patrick.rudolph@9elements.com>
Date: Mon, 7 Dec 2020 08:41:22 +0100
-Subject: [PATCH 15/26] usb: Add enum for xHCI
+Subject: [PATCH 15/25] usb: Add enum for xHCI
Will be used in future patches.
diff --git a/config/grub/xhci/patches/0016-usbtrans-Set-default-maximum-packet-size.patch b/config/grub/xhci/patches/0016-usbtrans-Set-default-maximum-packet-size.patch
index 611db609..537ed958 100644
--- a/config/grub/xhci/patches/0016-usbtrans-Set-default-maximum-packet-size.patch
+++ b/config/grub/xhci/patches/0016-usbtrans-Set-default-maximum-packet-size.patch
@@ -1,7 +1,7 @@
-From 8af01b2548f61a9197b9f931831ca397a7e7c9b3 Mon Sep 17 00:00:00 2001
+From 3c735bf84a74e5a5612ca9b59868e050da8a46fe Mon Sep 17 00:00:00 2001
From: Patrick Rudolph <patrick.rudolph@9elements.com>
Date: Mon, 7 Dec 2020 08:41:23 +0100
-Subject: [PATCH 16/26] usbtrans: Set default maximum packet size
+Subject: [PATCH 16/25] usbtrans: Set default maximum packet size
Set the maximum packet size to 512 for SuperSpeed devices.
diff --git a/config/grub/xhci/patches/0017-grub-core-bus-usb-Add-function-pointer-for-attach-de.patch b/config/grub/xhci/patches/0017-grub-core-bus-usb-Add-function-pointer-for-attach-de.patch
index 05540fa6..d61f2a8a 100644
--- a/config/grub/xhci/patches/0017-grub-core-bus-usb-Add-function-pointer-for-attach-de.patch
+++ b/config/grub/xhci/patches/0017-grub-core-bus-usb-Add-function-pointer-for-attach-de.patch
@@ -1,7 +1,7 @@
-From 7a977001a1574c884c4f711686c2de01386b9230 Mon Sep 17 00:00:00 2001
+From c01366a852d40e060fc060dda6cf2891c9c50bd0 Mon Sep 17 00:00:00 2001
From: Patrick Rudolph <patrick.rudolph@9elements.com>
Date: Sun, 15 Nov 2020 19:51:42 +0100
-Subject: [PATCH 17/26] grub-core/bus/usb: Add function pointer for
+Subject: [PATCH 17/25] grub-core/bus/usb: Add function pointer for
attach/detach events
The xHCI code needs to be called for attaching or detaching a device.
diff --git a/config/grub/xhci/patches/0018-grub-core-bus-usb-usbhub-Add-new-private-fields-for-.patch b/config/grub/xhci/patches/0018-grub-core-bus-usb-usbhub-Add-new-private-fields-for-.patch
index a3eaba15..75314780 100644
--- a/config/grub/xhci/patches/0018-grub-core-bus-usb-usbhub-Add-new-private-fields-for-.patch
+++ b/config/grub/xhci/patches/0018-grub-core-bus-usb-usbhub-Add-new-private-fields-for-.patch
@@ -1,7 +1,7 @@
-From e8a237ffb5bd3ba5258ce5c173b31424f3a39392 Mon Sep 17 00:00:00 2001
+From 1ec77a83178e5c1c005b6b27139287f1463f1b49 Mon Sep 17 00:00:00 2001
From: Patrick Rudolph <patrick.rudolph@9elements.com>
Date: Mon, 7 Dec 2020 08:41:25 +0100
-Subject: [PATCH 18/26] grub-core/bus/usb/usbhub: Add new private fields for
+Subject: [PATCH 18/25] grub-core/bus/usb/usbhub: Add new private fields for
xHCI controller
Store the root port number, the route, consisting out of the port ID
diff --git a/config/grub/xhci/patches/0019-grub-core-bus-usb-Add-xhci-support.patch b/config/grub/xhci/patches/0019-grub-core-bus-usb-Add-xhci-support.patch
index e6c0d474..043320b9 100644
--- a/config/grub/xhci/patches/0019-grub-core-bus-usb-Add-xhci-support.patch
+++ b/config/grub/xhci/patches/0019-grub-core-bus-usb-Add-xhci-support.patch
@@ -1,7 +1,7 @@
-From badcc0d5ff1d4b194c93a530344788c4231d8789 Mon Sep 17 00:00:00 2001
+From 03998bc9b74366ecf64d5f76fe4b398ec7fc5d31 Mon Sep 17 00:00:00 2001
From: Patrick Rudolph <patrick.rudolph@9elements.com>
Date: Mon, 7 Dec 2020 08:41:26 +0100
-Subject: [PATCH 19/26] grub-core/bus/usb: Add xhci support
+Subject: [PATCH 19/25] grub-core/bus/usb: Add xhci support
Add support for xHCI USB controllers.
The code is based on seabios implementation, but has been heavily
diff --git a/config/grub/xhci/patches/0020-grub-core-bus-usb-usbhub-Add-xHCI-non-root-hub-suppo.patch b/config/grub/xhci/patches/0020-grub-core-bus-usb-usbhub-Add-xHCI-non-root-hub-suppo.patch
index 01d7d008..6c5c1731 100644
--- a/config/grub/xhci/patches/0020-grub-core-bus-usb-usbhub-Add-xHCI-non-root-hub-suppo.patch
+++ b/config/grub/xhci/patches/0020-grub-core-bus-usb-usbhub-Add-xHCI-non-root-hub-suppo.patch
@@ -1,7 +1,7 @@
-From e4416b166e501777e53de387ac4329150483a160 Mon Sep 17 00:00:00 2001
+From 7571efed2cdd949a203401630a19f42c74095797 Mon Sep 17 00:00:00 2001
From: Patrick Rudolph <patrick.rudolph@9elements.com>
Date: Mon, 7 Dec 2020 08:41:27 +0100
-Subject: [PATCH 20/26] grub-core/bus/usb/usbhub: Add xHCI non root hub support
+Subject: [PATCH 20/25] grub-core/bus/usb/usbhub: Add xHCI non root hub support
Tested on Intel PCH C246, the USB3 hub can be configured by grub.
diff --git a/config/grub/xhci/patches/0021-xHCI-also-accept-SBRN-0x31-and-0x32.patch b/config/grub/xhci/patches/0021-xHCI-also-accept-SBRN-0x31-and-0x32.patch
index d0874f85..587782c2 100644
--- a/config/grub/xhci/patches/0021-xHCI-also-accept-SBRN-0x31-and-0x32.patch
+++ b/config/grub/xhci/patches/0021-xHCI-also-accept-SBRN-0x31-and-0x32.patch
@@ -1,7 +1,7 @@
-From 8e6d5b598b3e21c905023b438110d71f487a2289 Mon Sep 17 00:00:00 2001
+From 0c58853bd1e4ca63cdeb5b5ef949d78cbd9028d0 Mon Sep 17 00:00:00 2001
From: Sven Anderson <sven@anderson.de>
Date: Sat, 28 May 2022 21:39:23 +0200
-Subject: [PATCH 21/26] xHCI: also accept SBRN 0x31 and 0x32
+Subject: [PATCH 21/25] xHCI: also accept SBRN 0x31 and 0x32
Signed-off-by: Sven Anderson <sven@anderson.de>
---
diff --git a/config/grub/xhci/patches/0022-xhci-fix-port-indexing.patch b/config/grub/xhci/patches/0022-xhci-fix-port-indexing.patch
index 7e0bcb74..64872650 100644
--- a/config/grub/xhci/patches/0022-xhci-fix-port-indexing.patch
+++ b/config/grub/xhci/patches/0022-xhci-fix-port-indexing.patch
@@ -1,7 +1,7 @@
-From 32c6d97e2a80c2e74dd9daf74281a89d1a05faaa Mon Sep 17 00:00:00 2001
+From 0da64bd7a144361198ee3dbcd4921fbbdf5c08fa Mon Sep 17 00:00:00 2001
From: Sven Anderson <sven@anderson.de>
Date: Mon, 13 Jan 2025 19:51:41 +0100
-Subject: [PATCH 22/26] xhci: fix port indexing
+Subject: [PATCH 22/25] xhci: fix port indexing
---
grub-core/bus/usb/xhci.c | 10 +++++-----
diff --git a/config/grub/xhci/patches/0024-xhci-configure-TT-for-non-root-hubs.patch b/config/grub/xhci/patches/0023-xhci-configure-TT-for-non-root-hubs.patch
index a605e210..c63850d6 100644
--- a/config/grub/xhci/patches/0024-xhci-configure-TT-for-non-root-hubs.patch
+++ b/config/grub/xhci/patches/0023-xhci-configure-TT-for-non-root-hubs.patch
@@ -1,7 +1,7 @@
-From 233f7dd274ef2ccac7b1fc0f5cfdeb7c01aef58b Mon Sep 17 00:00:00 2001
+From fa9c2124b1ca476f8b2ce168d56527100757ef90 Mon Sep 17 00:00:00 2001
From: Sven Anderson <sven@anderson.de>
Date: Mon, 13 Jan 2025 20:26:32 +0100
-Subject: [PATCH 24/26] xhci: configure TT for non-root-hubs
+Subject: [PATCH 23/25] xhci: configure TT for non-root-hubs
---
grub-core/bus/usb/usbhub.c | 6 +++++
@@ -24,7 +24,7 @@ index e96505aa9..629b3ed53 100644
+ return grub_usb_devs[addr];
+}
diff --git a/grub-core/bus/usb/xhci.c b/grub-core/bus/usb/xhci.c
-index d13a7c39d..8ad2a10f9 100644
+index dc89b9619..88c9ac57f 100644
--- a/grub-core/bus/usb/xhci.c
+++ b/grub-core/bus/usb/xhci.c
@@ -623,13 +623,46 @@ grub_xhci_alloc_inctx(struct grub_xhci *x, int maxepid,
diff --git a/config/grub/xhci/patches/0025-Fix-compilation-on-x86_64.patch b/config/grub/xhci/patches/0024-Fix-compilation-on-x86_64.patch
index e75cc5e9..d03db740 100644
--- a/config/grub/xhci/patches/0025-Fix-compilation-on-x86_64.patch
+++ b/config/grub/xhci/patches/0024-Fix-compilation-on-x86_64.patch
@@ -1,7 +1,7 @@
-From 0441e7eff7950bfd47fc2f5533ce2c64b785dc1d Mon Sep 17 00:00:00 2001
+From b049a11e2cf54e51b3a9fd4d3435089999e61702 Mon Sep 17 00:00:00 2001
From: Patrick Rudolph <patrick.rudolph@9elements.com>
Date: Wed, 24 Feb 2021 08:25:41 +0100
-Subject: [PATCH 25/26] Fix compilation on x86_64
+Subject: [PATCH 24/25] Fix compilation on x86_64
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
---
@@ -9,7 +9,7 @@ Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/grub-core/bus/usb/xhci.c b/grub-core/bus/usb/xhci.c
-index 8ad2a10f9..ceb57c9b3 100644
+index 88c9ac57f..9b9bae6e5 100644
--- a/grub-core/bus/usb/xhci.c
+++ b/grub-core/bus/usb/xhci.c
@@ -184,7 +184,7 @@ enum
diff --git a/config/grub/xhci/patches/0026-Add-native-NVMe-driver-based-on-SeaBIOS.patch b/config/grub/xhci/patches/0025-Add-native-NVMe-driver-based-on-SeaBIOS.patch
index 36bbecd9..96ecbaaf 100644
--- a/config/grub/xhci/patches/0026-Add-native-NVMe-driver-based-on-SeaBIOS.patch
+++ b/config/grub/xhci/patches/0025-Add-native-NVMe-driver-based-on-SeaBIOS.patch
@@ -1,7 +1,7 @@
-From 4440b01a702368c81520f630aa16852de55bb808 Mon Sep 17 00:00:00 2001
+From 7bb8bb98b86fc97e1ce04e6169d517acbd476e1e Mon Sep 17 00:00:00 2001
From: Mate Kukri <km@mkukri.xyz>
Date: Mon, 20 May 2024 11:43:35 +0100
-Subject: [PATCH 26/26] Add native NVMe driver based on SeaBIOS
+Subject: [PATCH 25/25] Add native NVMe driver based on SeaBIOS
Tested to successfully boot Debian on QEMU and OptiPlex 3050.
diff --git a/config/grub/xhci/target.cfg b/config/grub/xhci/target.cfg
index aca71fca..5727e70b 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="4dc6166571645780c459dde2cdc1b001a5ec844c"
+rev="a4da71dafeea519b034beb159dfe80c486c2107c"
diff --git a/include/git.sh b/include/git.sh
index 30f9729a..4fa904ba 100644
--- a/include/git.sh
+++ b/include/git.sh
@@ -15,7 +15,7 @@ fetch_targets()
printf "Creating %s tree %s\n" "$project" "$tree"
git_prep "$loc" "$loc" "$xbmkpwd/$configdir/$tree/patches" \
- "src/$project/$tree" u
+ "src/$project/$tree" with_submodules
nuke "$project/$tree" "$project/$tree"
}
@@ -34,8 +34,8 @@ fetch_project()
clone_project
for x in config/git/*; do
- [ -d "$x" ] && nuke "${x##*/}" "src/${x##*/}" 2>/dev/null
- done; return 0
+ [ -d "$x" ] && nuke "${x##*/}" "src/${x##*/}" 2>/dev/null; :
+ done; :
}
clone_project()
@@ -56,30 +56,28 @@ git_prep()
chkvars rev
tmpclone "$1" "$2" "$tmpgit" "$rev" "$_patchdir"
if singletree "$project" || [ $# -gt 4 ]; then
- prep_submodules "$_loc"
+ [ -f "$mdir/module.list" ] && while read -r msrcdir; do
+ fetch_submodule "$msrcdir"
+ done < "$mdir/module.list"; :
fi
- [ "$project" = "coreboot" ] && [ -n "$xtree" ] && [ $# -gt 2 ] && \
- [ "$xtree" != "$tree" ] && link_crossgcc "$_loc"
- [ "$XBMK_RELEASE" = "y" ] && \
- [ "$_loc" != "$XBMK_CACHE/repo/$project" ] && \
- rmgit "$tmpgit"
+ if [ "$project" = "coreboot" ] && [ -n "$xtree" ] && [ $# -gt 2 ] && \
+ [ "$xtree" != "$tree" ]; then (
+ x_ cd "$tmpgit/util" && x_ rm -Rf crossgcc
+ x_ ln -s "../../$xtree/util/crossgcc" crossgcc
+ ) || $err "$_loc: !xgcc link"; fi
- move_repo "$_loc"
-}
+ [ "$_loc" != "$XBMK_CACHE/repo/$project" ] && \
+ [ "$XBMK_RELEASE" = "y" ] && rmgit "$tmpgit"
-prep_submodules()
-{
- [ -f "$mdir/module.list" ] && while read -r msrcdir; do
- fetch_submodule "$msrcdir"
- done < "$mdir/module.list"; :
+ [ "$_loc" = "${_loc%/*}" ] || x_ mkdir -p "${_loc%/*}"
+ mv "$tmpgit" "$_loc" || $err "git_prep: !mv $tmpgit $_loc"
}
fetch_submodule()
{
- mcfgdir="$mdir/${1##*/}"
- eval "`setvars "" subhash subrepo subrepo_bkup subfile subfile_bkup \
- st`"
+ mcfgdir="$mdir/${1##*/}"; eval \
+ "`setvars "" subhash subrepo subrepo_bkup subfile subfile_bkup st`"
[ ! -f "$mcfgdir/module.cfg" ] || . "$mcfgdir/module.cfg" || \
$err "! . $mcfgdir/module.cfg"
@@ -137,22 +135,6 @@ git_am_patches()
done; :
}
-link_crossgcc()
-{
- (
- x_ cd "$tmpgit/util" && x_ rm -Rf crossgcc
- ln -s "../../$xtree/util/crossgcc" crossgcc || $err "$1: !xgcc link"
- ) || $err "$1: !xgcc link"; :
-}
-
-move_repo()
-{
- [ "$1" = "${1%/*}" ] || x_ mkdir -p "${1%/*}"
- mv "$tmpgit" "$1" || $err "git_prep: !mv $tmpgit $1"
-}
-
-# can delete from multi- and single-tree projects.
-# called from script/trees when downloading sources.
nuke()
{
e "config/${1%/}/nuke.list" f missing || while read -r nukefile; do
diff --git a/include/lib.sh b/include/lib.sh
index a3cdf554..21066ecc 100644
--- a/include/lib.sh
+++ b/include/lib.sh
@@ -6,6 +6,9 @@
export LC_COLLATE=C
export LC_ALL=C
+projectname="libreboot"
+projectsite="https://libreboot.org/"
+
[ -z "${PATH+x}" ] && \
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
xbmkpath="$PATH"
@@ -23,9 +26,9 @@ err_()
printf "ERROR %s: %s\n" "$0" "$1" 1>&2
exit 1
}
-
-xbmkpwd=`pwd` || $err "Cannot generate PWD"
-export PWD="$xbmkpwd"
+x_() {
+ [ $# -lt 1 ] || "$@" || $err "Unhandled error for: $(echo "$@")"; :
+}
setvars()
{
@@ -43,14 +46,6 @@ chkvars()
done; :
}
-eval "`setvars "" _nogit board reinstall versiondate projectsite projectname \
- aur_notice configdir datadir version relname xbmk_parent`"
-
-for fv in projectname projectsite version versiondate; do
- eval "[ ! -f \"$fv\" ] || read -r $fv < \"$fv\" || :"
-done
-chkvars projectname projectsite
-
setcfg()
{
[ $# -gt 1 ] && printf "e \"%s\" f missing && return %s;\n" "$1" "$2"
@@ -83,11 +78,25 @@ install_packages()
[ -n "$aur_notice" ] && \
printf "You need AUR packages: %s\n" "$aur_notice" 1>&2; :
}
+
+eval "`setvars "" _nogit board reinstall versiondate aur_notice configdir \
+ datadir version relname xbmktmp`"
+
if [ $# -gt 0 ] && [ "$1" = "dependencies" ]; then
install_packages "$@" || exit 1
exit 0
fi
+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"
+
+xbmkpwd="`pwd`" || $err "Cannot generate PWD"
+export PWD="$xbmkpwd"
+
+for fv in version versiondate; do
+ eval "[ ! -f \".$fv\" ] || read -r $fv < \".$fv\" || :"
+done
+
pyver="2"
python="python3"
command -v python3 1>/dev/null || python="python"
@@ -104,9 +113,6 @@ if [ "${pyver%%.*}" != "3" ]; then
exit 1
fi
-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"
-
# XBMK_CACHE is a directory, for caching downloads and git repositories
[ -z "${XBMK_CACHE+x}" ] && export XBMK_CACHE="$xbmkpwd/cache"
[ -z "$XBMK_CACHE" ] && export XBMK_CACHE="$xbmkpwd/cache"
@@ -122,22 +128,25 @@ if [ -z "${TMPDIR+x}" ]; then
[ -f "lock" ] && $err "$xbmkpwd/lock exists. Is a build running?"
export TMPDIR="/tmp"
export TMPDIR="$(mktemp -d -t xbmk_XXXXXXXX)"
+ xbmktmp="$TMPDIR"
touch lock || $err "cannot create 'lock' file"
- rm -Rf "$XBMK_CACHE/xbmkpath" "$XBMK_CACHE/gnupath" || \
- $err "cannot remove xbmkpath"
- mkdir -p "$XBMK_CACHE/gnupath" "$XBMK_CACHE/xbmkpath" || \
- $err "cannot create gnupath"
- export PATH="$XBMK_CACHE/xbmkpath:$XBMK_CACHE/gnupath:$PATH" || \
- $err "Can't create gnupath/xbmkpath"
+ x_ rm -Rf "$XBMK_CACHE/xbmkpath" "$XBMK_CACHE/gnupath"
+ x_ mkdir -p "$XBMK_CACHE/gnupath" "$XBMK_CACHE/xbmkpath"
+ export PATH="$XBMK_CACHE/xbmkpath:$XBMK_CACHE/gnupath:$PATH"
(
# set up python v3.x in PATH, in case it's not set up correctly.
# see code above that detected the correct python3 command.
cd "$XBMK_CACHE/xbmkpath" || $err "can't cd $XBMK_CACHE/xbmkpath"
- ln -s "`command -v "$python"`" python || \
- $err "Can't set up python symlink in $XBMK_CACHE/xbmkpath"
+ x_ ln -s "`command -v "$python"`" python
) || $err "Can't set up python symlink in $XBMK_CACHE/xbmkpath"
- xbmk_parent="y"
+
+ xbmk_rval=0
+ ./mk "$@" || xbmk_rval=1
+ rm -Rf "$xbmktmp" || xbmk_rval=1
+ rm -f lock || xbmk_rval=1
+ exit $xbmk_rval
fi
+xbmktmp="$TMPDIR"
# if "y": a coreboot target won't be built if target.cfg says release="n"
# (this is used to exclude certain build targets from releases)
@@ -148,15 +157,10 @@ fi
expr "X$XBMK_THREADS" : "X-\{0,1\}[0123456789][0123456789]*$" \
1>/dev/null 2>/dev/null || export XBMK_THREADS=1 # user gave a non-integer
-x_() {
- [ $# -lt 1 ] || "$@" || \
- $err "Unhandled non-zero exit: $(echo "$@")"; :
-}
-
-[ -e ".git" ] || [ -f "version" ] || printf "unknown\n" > version || \
- $err "Cannot generate unknown version file"
-[ -e ".git" ] || [ -f "versiondate" ] || printf "1716415872\n" > versiondate \
- || $err "Cannot generate unknown versiondate file"
+[ -e ".git" ] || [ -f ".version" ] || printf "unknown\n" > .version || \
+ $err "Cannot generate unknown .version file"
+[ -e ".git" ] || [ -f ".versiondate" ] || printf "1716415872\n" > \
+ .versiondate || $err "Cannot generate unknown .versiondate file"
version_="$version"
[ ! -e ".git" ] || version="$(git describe --tags HEAD 2>&1)" || \
@@ -164,9 +168,9 @@ version_="$version"
versiondate_="$versiondate"
[ ! -e ".git" ] || versiondate="$(git show --no-patch --no-notes \
--pretty='%ct' HEAD)" || versiondate="$versiondate_"
-for p in projectname version versiondate projectsite; do
+for p in version versiondate; do
chkvars "$p"
- eval "x_ printf \"%s\\n\" \"\$$p\" > $p"
+ eval "printf \"%s\\n\" \"\$$p\" > .$p || $err \"can't save $p\""
done
relname="$projectname-$version"
export LOCALVERSION="-$projectname-${version%%-*}"
@@ -187,9 +191,8 @@ remkdir()
mkrom_tarball()
{
- printf "%s\n" "$version" > "$1/version" || $err "$1 !version"
- printf "%s\n" "$versiondate" > "$1/versiondate" || $err "$1 !vdate"
- printf "%s\n" "$projectname" > "$1/projectname" || $err "$1 !pname"
+ printf "%s\n" "$version" > "$1/.version" || $err "$1 !version"
+ printf "%s\n" "$versiondate" > "$1/.versiondate" || $err "$1 !vdate"
mktarball "$1" "${1%/*}/${relname}_${1##*/}.tar.xz"
x_ rm -Rf "$1"
@@ -197,10 +200,8 @@ mkrom_tarball()
mktarball()
{
- if [ "${2%/*}" != "$2" ]; then
- mkdir -p "${2%/*}" || $err "mk, !mkdir -p \"${2%/*}\""
- fi
- tar -c "$1" | xz -T$XBMK_THREADS -9e > "$2" || $err "mktarball 2, $1"
+ [ "${2%/*}" = "$2" ] || x_ mkdir -p "${2%/*}"
+ x_ tar -c "$1" | xz -T$XBMK_THREADS -9e > "$2" || $err "mktarball2, $1"
}
mksha512sum()
@@ -226,7 +227,7 @@ singletree()
{
for targetfile in "config/${1}/"*/target.cfg; do
[ -e "$targetfile" ] && [ -f "$targetfile" ] && return 1; :
- done; return 0
+ done; :
}
# can grab from the internet, or copy locally.
@@ -238,8 +239,7 @@ download()
dl_fail="n" # 1 url, 2 url backup, 3 destination, 4 checksum
vendor_checksum "$4" "$cached" 2>/dev/null && dl_fail="y"
[ "$dl_fail" = "n" ] && e "$3" f && return 0
- mkdir -p "${3%/*}" "$XBMK_CACHE/file" || \
- $err "!mkdir '$3' '$XBMK_CACHE/file'"
+ x_ mkdir -p "${3%/*}" "$XBMK_CACHE/file"
for url in "$1" "$2"; do
[ "$dl_fail" = "n" ] && break
[ -z "$url" ] && continue
@@ -262,7 +262,7 @@ download()
vendor_checksum "$4" "$cached" || dl_fail="n"
done
[ "$dl_fail" = "y" ] && $err "$1 $2 $3 $4: not downloaded"
- [ "$cached" = "$3" ] || cp "$cached" "$3" || $err "!d cp $cached $3"; :
+ [ "$cached" = "$3" ] || x_ cp "$cached" "$3"; :
}
vendor_checksum()
@@ -289,8 +289,7 @@ cbfs()
fi
fi
- "$cbfstool" "$fRom" $ccmd -f "$fAdd" -n "$fName" $lzma || \
- $err "CBFS fail: $fRom $ccmd -f '$fAdd' -n '$fName' $lzma"; :
+ x_ "$cbfstool" "$fRom" $ccmd -f "$fAdd" -n "$fName" $lzma
}
mk()
diff --git a/include/mrc.sh b/include/mrc.sh
index e08a0f0e..6e00292b 100644
--- a/include/mrc.sh
+++ b/include/mrc.sh
@@ -35,8 +35,8 @@ extract_partition()
dd if="${1%.zip}" of="root-a.ext2" bs=1024 skip=$(( $START / 1024 )) \
count=$(( $SIZE / 1024 )) || $err "ex dd ${1%.zip}, root-a.ext2"
- printf "cd /usr/sbin\ndump chromeos-firmwareupdate $SHELLBALL\nquit" \
- | debugfs "root-a.ext2" || $err "can't extract shellball"
+ printf "cd /usr/sbin\ndump chromeos-firmwareupdate %s\nquit" \
+ "$SHELLBALL" | debugfs "root-a.ext2" || $err "!extract shellball"
}
extract_refcode()
@@ -50,12 +50,10 @@ extract_refcode()
chkvars cbfstoolref
mkdir -p "${_refdest%/*}" || $err "ref: !mkdir -p ${_refdest%/*}"
- "$cbfstoolref" "$appdir/bios.bin" extract \
- -m x86 -n fallback/refcode -f "$_refdest" -r RO_SECTION \
- || $err "extract_refcode $board: !cbfstoolref $_refdest"
+ x_ "$cbfstoolref" "$appdir/bios.bin" extract \
+ -m x86 -n fallback/refcode -f "$_refdest" -r RO_SECTION
# enable the Intel GbE device, if told by offset MRC_refcode_gbe
- [ -z "$MRC_refcode_gbe" ] || dd if="config/ifd/hp820g2/1.bin" \
- of="$_refdest" bs=1 seek=$MRC_refcode_gbe count=1 conv=notrunc || \
- $err "extract_refcode $_refdest: byte $MRC_refcode_gbe"; :
+ [ -z "$MRC_refcode_gbe" ] || x_ dd if="config/ifd/hp820g2/1.bin" \
+ of="$_refdest" bs=1 seek=$MRC_refcode_gbe count=1 conv=notrunc; :
}
diff --git a/include/rom.sh b/include/rom.sh
index 7102953f..710df853 100644
--- a/include/rom.sh
+++ b/include/rom.sh
@@ -12,7 +12,8 @@ mkserprog()
[ "$1" = "pico" ] && mkpicotool
- basename -as .h "$serdir/"*.h > "$TMPDIR/ser" || $err "!mk $1 $TMPDIR"
+ basename -as .h "$serdir/"*.h > "$xbmktmp/ser" || \
+ $err "!mk $1 $xbmktmp"
while read -r sertarget; do
[ "$1" = "pico" ] &&
@@ -31,7 +32,7 @@ mkserprog()
"$sersrc" BOARD=$sertarget
x_ mkdir -p "bin/serprog_$1"
x_ mv "$serx" "bin/serprog_$1/serprog_$sertarget.${serx##*.}"
- done < "$TMPDIR/ser"
+ done < "$xbmktmp/ser"
[ "$XBMK_RELEASE" = "y" ] && mkrom_tarball "bin/serprog_$1"; :
}
@@ -41,10 +42,9 @@ mkpicotool()
rm -Rf "$picotool" || $err "Can't remove picotool builddir"
(
x_ cd src/picotool
- cmake -DCMAKE_INSTALL_PREFIX=xbmkbin -DPICOTOOL_FLAT_INSTALL=1 \
- -DPICO_SDK_PATH=../pico-sdk || \
- $err "Can't prep picotool"
- make install || $err "Can't build picotool"; :
+ x_ cmake -DCMAKE_INSTALL_PREFIX=xbmkbin -DPICOTOOL_FLAT_INSTALL=1 \
+ -DPICO_SDK_PATH=../pico-sdk
+ x_ make install
) || $err "Can't build picotool"; :
}
@@ -64,13 +64,12 @@ mkpayload_grub()
eval "`setvars "" grub_modules grub_install_modules`"
$dry eval "`setcfg "$grubdata/module/$tree"`"
$dry x_ rm -f "$srcdir/grub.elf"; $dry \
- "$srcdir/grub-mkstandalone" --grub-mkimage="$srcdir/grub-mkimage" \
+ x_ "$srcdir/grub-mkstandalone" --grub-mkimage="$srcdir/grub-mkimage" \
-O i386-coreboot -o "$srcdir/grub.elf" -d "${srcdir}/grub-core/" \
--fonts= --themes= --locales= --modules="$grub_modules" \
--install-modules="$grub_install_modules" \
"/boot/grub/grub_default.cfg=${srcdir}/.config" \
- "/boot/grub/grub.cfg=$grubdata/memdisk.cfg" || \
- $err "$tree: cannot build grub.elf"; :
+ "/boot/grub/grub.cfg=$grubdata/memdisk.cfg"; :
}
mkvendorfiles()
@@ -117,7 +116,7 @@ mkcorebootbin()
{
[ "$target" = "$tree" ] && return 0
- tmprom="$TMPDIR/coreboot.rom"
+ tmprom="$xbmktmp/coreboot.rom"
$dry x_ cp "$srcdir/build/coreboot.rom" "$tmprom"
initmode="${defconfig##*/}"
@@ -160,7 +159,8 @@ mkcorebootbin()
$dry add_seabios
[ "$payload_uboot" = "y" ] && pname="uboot" && $dry add_uboot
else
- pname="custom" && $dry cprom; :
+ pname="custom"
+ $dry cprom
fi; :
}
@@ -172,14 +172,13 @@ add_seabios()
fi
_seabioself="elf/seabios/default/$initmode/bios.bin.elf"
-
_seaname="fallback/payload" && [ "$payload_grubsea" = "y" ] && \
_seaname="seabios.elf"
+
cbfs "$tmprom" "$_seabioself" "$_seaname"
x_ "$cbfstool" "$tmprom" add-int -i 3000 -n etc/ps2-keyboard-spinup
- _z="2"
- [ "$initmode" = "vgarom" ] && _z="0"
+ _z="2" && [ "$initmode" = "vgarom" ] && _z="0"
x_ "$cbfstool" "$tmprom" add-int -i $_z -n etc/pci-optionrom-exec
x_ "$cbfstool" "$tmprom" add-int -i 0 -n etc/optionroms-checksum
[ "$initmode" = "libgfxinit" ] && \
@@ -203,8 +202,8 @@ add_grub()
_grubname="fallback/payload"
cbfs "$tmprom" "$grubelf" "$_grubname"
printf "set grub_scan_disk=\"%s\"\n" "$grub_scan_disk" \
- > "$TMPDIR/tmpcfg" || $err "$target: !insert scandisk"
- cbfs "$tmprom" "$TMPDIR/tmpcfg" scan.cfg raw
+ > "$xbmktmp/tmpcfg" || $err "$target: !insert scandisk"
+ cbfs "$tmprom" "$xbmktmp/tmpcfg" scan.cfg raw
[ "$initmode" != "normal" ] && [ "$displaymode" != "txtmode" ] && \
cbfs "$tmprom" "$grubdata/background/background1280x800.png" \
"background.png" raw; :
@@ -212,11 +211,9 @@ add_grub()
mkseagrub()
{
- if [ "$payload_grubsea" = "y" ]; then
- pname="grub"
- else
- cbfs "$tmprom" "$grubdata/bootorder" bootorder raw
- fi
+ [ "$payload_grubsea" = "y" ] && pname="grub"
+ [ "$payload_grubsea" = "y" ] || \
+ cbfs "$tmprom" "$grubdata/bootorder" bootorder raw
for keymap in config/data/grub/keymap/*.gkb; do
[ -f "$keymap" ] && cprom "${keymap##*/}"; :
done; :
@@ -262,7 +259,6 @@ add_uboot()
[ "$payload_uboot_amd64" = "y" ] && \
ubootelf="$ubdir/u-boot-x86-with-spl.bin" # EFI-compatible
- [ -f "$ubootelf" ] || $err "cb/$ubtarget: Can't find u-boot"
cbfs "$tmprom" "$ubootelf" "$ubpath" $ubcbfsargs
[ "$payload_seabios" = "y" ] || cprom; :
}
@@ -286,8 +282,7 @@ mkcoreboottar()
[ "$target" = "$tree" ] && return 0
[ "$XBMK_RELEASE" = "y" ] || return 0
[ "$release" != "n" ] || return 0
+
$dry mkrom_tarball "bin/$target"
- $dry ./mk inject "bin/${relname}_${target}.tar.xz" nuke || \
- $err "Can't delete vendorfiles in 'bin/${relname}_$target.tar.xz'"
- return 0
+ $dry x_ ./mk inject "bin/${relname}_${target}.tar.xz" nuke; :
}
diff --git a/include/vendor.sh b/include/vendor.sh
index 740f01b0..c4e57069 100644
--- a/include/vendor.sh
+++ b/include/vendor.sh
@@ -15,16 +15,18 @@ dontflash="!!! AN ERROR OCCURED! Please DO NOT flash if injection failed. !!!"
vfix="DO_NOT_FLASH_YET._FIRST,_INJECT_FILES_VIA_INSTRUCTIONS_ON_LIBREBOOT.ORG_"
vguide="https://libreboot.org/docs/install/ivy_has_common.html"
tmpromdel="$xbmkpwd/tmp/DO_NOT_FLASH"
+nvm="util/nvmutil/nvm"
-cv="CONFIG_HAVE_ME_BIN CONFIG_ME_BIN_PATH CONFIG_INCLUDE_SMSC_SCH5545_EC_FW \
- CONFIG_SMSC_SCH5545_EC_FW_FILE CONFIG_KBC1126_FIRMWARE CONFIG_KBC1126_FW1 \
+cvchk="CONFIG_HAVE_MRC CONFIG_HAVE_ME_BIN CONFIG_KBC1126_FIRMWARE \
+ CONFIG_VGA_BIOS_FILE CONFIG_INCLUDE_SMSC_SCH5545_EC_FW \
+ CONFIG_LENOVO_TBFW_BIN CONFIG_FSP_M_FILE CONFIG_FSP_S_FILE"
+
+cv="CONFIG_ME_BIN_PATH CONFIG_SMSC_SCH5545_EC_FW_FILE CONFIG_KBC1126_FW1 \
CONFIG_KBC1126_FW2 CONFIG_KBC1126_FW1_OFFSET CONFIG_KBC1126_FW2_OFFSET \
- CONFIG_VGA_BIOS_FILE CONFIG_VGA_BIOS_ID CONFIG_BOARD_DELL_E6400 \
- CONFIG_HAVE_MRC CONFIG_MRC_FILE CONFIG_HAVE_REFCODE_BLOB \
- CONFIG_REFCODE_BLOB_FILE CONFIG_GBE_BIN_PATH CONFIG_IFD_BIN_PATH \
- CONFIG_LENOVO_TBFW_BIN CONFIG_FSP_FD_PATH CONFIG_FSP_M_FILE \
- CONFIG_FSP_S_FILE CONFIG_FSP_S_CBFS CONFIG_FSP_M_CBFS CONFIG_FSP_USE_REPO \
- CONFIG_FSP_FULL_FD"
+ CONFIG_VGA_BIOS_ID CONFIG_BOARD_DELL_E6400 CONFIG_FSP_S_CBFS \
+ CONFIG_HAVE_REFCODE_BLOB CONFIG_REFCODE_BLOB_FILE CONFIG_GBE_BIN_PATH \
+ CONFIG_IFD_BIN_PATH CONFIG_FSP_FD_PATH CONFIG_MRC_FILE CONFIG_FSP_M_CBFS \
+ CONFIG_FSP_USE_REPO CONFIG_FSP_FULL_FD $cvchk"
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 \
@@ -34,44 +36,29 @@ eval "`setvars "" has_hashes EC_hash DL_hash DL_url_bkup MRC_refcode_gbe vcfg \
_7ztest ME11bootguard ME11delta ME11version ME11sku ME11pch tmpromdir \
IFD_platform ifdprefix cdir sdir _me _metmp mfs TBFW_url_bkup TBFW_url \
TBFW_hash TBFW_size hashfile xromsize xchanged EC_url_bkup need_files \
- vfile $cv`"
+ vfile cbcfg $cv`"
vendor_download()
{
[ $# -gt 0 ] || $err "No argument given"
export PATH="$PATH:/sbin"
- board="$1"
- readcfg && readkconfig && bootstrap && getfiles; :
+ board="$1" && readcfg && readkconfig && bootstrap && getfiles; :
}
readkconfig()
{
- check_defconfig "$boarddir" 1>"$TMPDIR/vendorcfg.list" && return 1
-
- rm -f "$TMPDIR/tmpcbcfg" || $err "!rm $TMPDIR/tmpcbcfg - $dontflash"
- while read -r cbcfgfile; do
- for cbc in $cv; do
- rm -f "$TMPDIR/tmpcbcfg2" || \
- $err "!rm $TMPDIR/tmpcbcfg2 - $dontflash"
- grep "$cbc" "$cbcfgfile" 1>"$TMPDIR/tmpcbcfg2" \
- 2>/dev/null || :
- [ -f "$TMPDIR/tmpcbcfg2" ] || continue
- cat "$TMPDIR/tmpcbcfg2" >> "$TMPDIR/tmpcbcfg" || \
- $err "!cat $TMPDIR/tmpcbcfg2 - $dontflash"
- done
- done < "$TMPDIR/vendorcfg.list"
-
- eval "`setcfg "$TMPDIR/tmpcbcfg"`"
+ x_ rm -f "$xbmktmp/cbcfg"
+ cbcfg="`check_defconfig "$boarddir"`" || for cbc in $cv; do
+ grep "$cbc" "$cbcfg" 1>>"$xbmktmp/cbcfg" 2>/dev/null || :
+ done
+ eval "`setcfg "$xbmktmp/cbcfg" 1`"
- for c in CONFIG_HAVE_MRC CONFIG_HAVE_ME_BIN CONFIG_KBC1126_FIRMWARE \
- CONFIG_VGA_BIOS_FILE CONFIG_INCLUDE_SMSC_SCH5545_EC_FW \
- CONFIG_LENOVO_TBFW_BIN CONFIG_FSP_M_FILE CONFIG_FSP_S_FILE; do
+ for c in $cvchk; do
eval "[ \"\${$c}\" = \"/dev/null\" ] && continue"
eval "[ -z \"\${$c}\" ] && continue"
eval "`setcfg "$vfile"`"
return 0
done
- printf "Vendor files not needed for: %s\n" "$board" 1>&2
return 1
}
@@ -136,12 +123,10 @@ fetch()
rm -Rf "${_dl}_extracted" || $err "!rm ${_ul}_extracted. $dontflash"
e "$_dest" f && return 0
- mkdir -p "${_dest%/*}" || \
- $err "mkdirs: !mkdir -p ${_dest%/*} - $dontflash"
+ x_ mkdir -p "${_dest%/*}"
remkdir "$appdir"
extract_archive "$_dl" "$appdir" "$dl_type" || \
- [ "$dl_type" = "e6400vga" ] || \
- $err "mkd $_dest $dl_type: !extract. $dontflash"
+ [ "$dl_type" = "e6400vga" ] || $err "$_dest $dl_type: !extract"
eval "extract_$dl_type"
set -u -e
@@ -173,19 +158,17 @@ extract_intel_me()
extract_intel_me_bruteforce()
{
[ $# -gt 0 ] && cdir="$1"
-
e "$_metmp" f && return 0
[ -z "$sdir" ] && sdir="$(mktemp -d)"
- mkdir -p "$sdir" || \
- $err "extract_intel_me: !mkdir -p \"$sdir\" - $dontflash"
+ x_ mkdir -p "$sdir"
set +u +e
(
[ "${cdir#/a}" != "$cdir" ] && cdir="${cdir#/}"
cd "$cdir" || $err "extract_intel_me: !cd \"$cdir\" - $dontflash"
for i in *; do
- [ -f "$_metmp" ] && break
+ e "$_metmp" f && break
[ -L "$i" ] && continue
if [ -f "$i" ]; then
_r="-r" && [ -n "$mfs" ] && _r=""
@@ -204,7 +187,7 @@ extract_intel_me_bruteforce()
cdir="$1"; [ "${cdir#/a}" != "$cdir" ] && cdir="${cdir#/}"
cd "$cdir" || :
done
- )
+ ) || :
rm -Rf "$sdir" || $err "extract_intel_me: !rm -Rf $sdir - $dontflash"
}
@@ -212,11 +195,10 @@ apply_me11_deguard_mod()
{
(
x_ cd src/deguard/
- ./finalimage.py --delta "data/delta/$ME11delta" \
+ x_ ./finalimage.py --delta "data/delta/$ME11delta" \
--version "$ME11version" \
--pch "$ME11pch" --sku "$ME11sku" --fake-fpfs data/fpfs/zero \
- --input "$_metmp" --output "$_me" || \
- $err "Error running deguard for $_me - $dontflash"
+ --input "$_metmp" --output "$_me"
) || $err "Error running deguard for $_me - $dontflash"
}
@@ -242,33 +224,24 @@ decat_fspfd()
_fspdir="$2"
_fspsplit="$cbdir/3rdparty/fsp/Tools/SplitFspBin.py"
- $python "$_fspsplit" split -f "$_fspfd" -o "$_fspdir" -n "Fsp.fd" || \
- $err "decat_fspfd '$1' '$2': Can't de-concatenate; $dontflash"; :
+ x_ $python "$_fspsplit" split -f "$_fspfd" -o "$_fspdir" -n "Fsp.fd"
}
extract_kbc1126ec()
{
- e "$kbc1126_ec_dump" f missing && \
- $err "$cbdir: kbc1126 util missing - $dontflash"
+ x_ e "$kbc1126_ec_dump" f
(
x_ cd "$appdir/"
mv Rompaq/68*.BIN ec.bin || :
if [ ! -f "ec.bin" ]; then
unar -D ROM.CAB Rom.bin || unar -D Rom.CAB Rom.bin || \
- unar -D 68*.CAB Rom.bin || \
- $err "can't extract Rom.bin - $dontflash"
+ unar -D 68*.CAB Rom.bin || $err "kbc1126 unar failed"
x_ mv Rom.bin ec.bin
fi
- [ -f ec.bin ] || \
- $err "extract_kbc1126_ec $board: can't extract - $dontflash"
- "$kbc1126_ec_dump" ec.bin || \
- $err "!1126ec $board extract ecfw - $dontflash"
- ) || $err "can't extract kbc1126 ec firmware - $dontflash"
+ x_ e ec.bin f && x_ "$kbc1126_ec_dump" ec.bin
+ ) || $err "$board: can't extract kbc1126 ec firmware - $dontflash"
- e "$appdir/ec.bin.fw1" f not && \
- $err "$board: kbc1126ec fetch failed - $dontflash"
- e "$appdir/ec.bin.fw2" f not && \
- $err "$board: kbc1126ec fetch failed - $dontflash"
+ x_ e "$appdir/ec.bin.fw1" f && x_ e "$appdir/ec.bin.fw2" f
cp "$appdir/"ec.bin.fw* "${_dest%/*}/" || \
$err "!cp 1126ec $_dest - $dontflash"; :
@@ -281,12 +254,10 @@ extract_e6400vga()
tail -c +$E6400_VGA_offset "$_dl" | gunzip > "$appdir/bios.bin" || :
(
x_ cd "$appdir"
- [ -f "bios.bin" ] || \
- $err "extract_e6400vga: can't extract bios.bin - $dontflash"
+ x_ e "bios.bin" f
"$e6400_unpack" bios.bin || printf "TODO: fix dell extract util\n"
) || $err "can't extract e6400 vga rom - $dontflosh"
- cp "$appdir/$E6400_VGA_romname" "$_dest" || \
- $err "extract_e6400vga $board: can't cp $_dest - $dontflash"; :
+ x_ cp "$appdir/$E6400_VGA_romname" "$_dest"
}
extract_sch5545ec()
@@ -299,8 +270,7 @@ extract_sch5545ec()
_sch5545ec_fw="$_sch5545ec_fw/0 Raw section/body.bin" # <-- this!
"$uefiextract" "$_bios" || $err "sch5545 !extract - $dontflash"
- cp "$_sch5545ec_fw" "$_dest" || \
- $err "$_dest: !sch5545 copy - $dontflash"; :
+ x_ cp "$_sch5545ec_fw" "$_dest"
}
# Lenovo ThunderBolt firmware updates:
@@ -315,14 +285,11 @@ extract_tbfw()
while read -r f; do
[ -f "$f" ] || continue
[ -L "$f" ] && continue
- cp "$f" "tmp/tb.bin" || \
- $err "extract_tbfw $_dest: Can't copy TBT.bin - $dontflash"
+ x_ cp "$f" "tmp/tb.bin"
break
done < "tmp/tb.txt"
- dd if=/dev/null of=tmp/tb.bin bs=1 seek=$TBFW_size || \
- $err "extract_tbfw $_dest: Can't pad TBT.bin - $dontflash"
- cp "tmp/tb.bin" "$_dest" || \
- $err "extract_tbfw $_dest: copy error - $dontflash "; :
+ x_ dd if=/dev/null of=tmp/tb.bin bs=1 seek=$TBFW_size
+ x_ cp "tmp/tb.bin" "$_dest"
}
extract_fspm()
@@ -338,8 +305,7 @@ extract_fsps()
# this copies the fsp s/m; re-base is handled by ./mk inject
copy_fsp()
{
- cp "$appdir/Fsp_$1.fd" "$_dest" || \
- $err "copy_fsp: Can't copy $1 to $_dest - $dontflash"; :
+ x_ cp "$appdir/Fsp_$1.fd" "$_dest"
}
fail_inject()
@@ -349,13 +315,12 @@ fail_inject()
printf "\n\n%s\n\n" "$dontflash" 1>&2
printf "WARNING: File '%s' was NOT modified.\n\n" "$archive" 1>&2
printf "Please MAKE SURE vendor files are inserted before flashing\n\n"
- fail "$1"
+ err_ "$1"
}
vendor_inject()
{
- need_files="n" # will be set to "y" if vendorfiles needed
- _olderr="$err"
+ need_files="n"
err="fail_inject"
remkdir "$tmpromdel"
@@ -363,99 +328,41 @@ vendor_inject()
[ $# -lt 1 ] && $err "No options specified. - $dontflash"
eval "`setvars "" nukemode new_mac xchanged`"
- # randomise the MAC address by default
- # TODO: support setting CBFS MAC address for GA-G41M-ES2L
+ archive="$1";
new_mac="??:??:??:??:??:??"
- archive="$1";
[ $# -gt 1 ] && case "$2" in
nuke)
new_mac=""
nukemode="nuke" ;;
setmac)
[ $# -gt 2 ] && new_mac="$3" && \
- [ -z "$new_mac" ] && $err \
- "You set an empty MAC address string" ;;
+ [ -z "$new_mac" ] && $err "Empty MAC address specified" ;;
*) $err "Unrecognised inject mode: '$2'"
esac
-
- # allow the user to skip setting MAC addresses.
- # if new_mac is empty, this script skips running nvmutil
[ "$new_mac" = "keep" ] && new_mac=""
- # we don't allow the *user* to clear new_mac, in the setmac
- # command, in case the build system is being integrated with
- # another, where setmac is relied upon and is being set
- # explicitly. this is a preventative error handle, as a courtes
- # to that hypothetical user e.g. Linux distro package maintainer
- # integrating this build system into their distro. if they used
- # a variable for that, and they forgot to initialise it, they'll know.
-
- check_release "$archive" || \
- $err "You must run this script on a release archive. - $dontflash"
-
- [ "$new_mac" = "restore" ] && \
- printf "Restoring default GbE for '$archive', board '$board'\n"
+ check_release "$archive" || $err "'$archive' is not a release archive"
readcfg && need_files="y"
if [ "$need_files" = "y" ] || [ -n "$new_mac" ]; then
- [ "$nukemode" = "nuke" ] || x_ ./mk download "$board"
+ [ "$nukemode" != "nuke" ] && [ "$need_files" = "y" ] && \
+ x_ ./mk download "$board"
patch_release_roms
fi
- [ "$need_files" != "y" ] && printf \
- "\nTarball '%s' (board '%s) doesn't need vendorfiles.\n" \
- "$archive" "$board" 1>&2
xtype="patched" && [ "$nukemode" = "nuke" ] && xtype="nuked"
- [ "$xchanged" != "y" ] && \
- printf "\nRelease archive '%s' was *NOT* modified.\n" \
- "$archive" && [ "$has_hashes" = "y" ] && \
- printf "WARNING: '%s' contains '%s'. DO NOT FLASH!\n" \
- "$archive" "$hashfile" 1>&2 && \
- printf "(vendorfiles may be needed and aren't there)\n" \
- 1>&2
- [ "$xchanged" = "y" ] && \
- printf "\nRelease archive '%s' successfully %s.\n" \
- "$archive" "$xtype" && [ "$nukemode" != "nuke" ] && \
- printf "You may now extract '%s' and flash images from it.\n" \
- "$archive"
- [ "$xchanged" = "y" ] && [ "$nukemode" = "nuke" ] && \
- printf "WARNING! Vendorfiles *removed*. DO NOT FLASH.\n" 1>&2 \
- && printf "DO NOT flash images from '%s'\n" \
- "$archive" 1>&2
-
- [ "$need_files" = "n" ] && printf \
- "Board '%s' doesn't use vendorfiles, so none were inserted.\n" \
- "$board"
-
- #
- # catch-all error handler, for libreboot release opsec:
- #
- # if vendor files defined, and a hash file was missing, that means
- # a nuke must succeed, if specified. if no hashfile was present,
- # that means vendorfiles had been injected, so a nuke must succeed.
- # this check is here in case of future bugs in lbmk's handling
- # of vendorfile deletions on release archives, which absolutely
- # must always be 100% reliable, so paranoia is paramount:
- #
- if [ "$xchanged" != "y" ] && [ "$need_files" = "y" ] && \
- [ "$nukemode" = "nuke" ] && [ "$has_hashes" != "y" ]; then
- printf "FAILED NUKE: tarball '$archive', board '$board'\n" 1>&2
- $err "Unhandled vendorfile deletion: DO NOT RELEASE TO RSYNC"
- fi # of course, we assume that those variables are also set right
-
- err="$_olderr"
- return 0
+ [ "$xchanged" != "y" ] && printf "\n'%s' *NOT* modified.\n" "$archive"
+ [ "$xchanged" = "y" ] && printf "\n'%s' %s.\n" "$archive" "$xtype"; :
}
check_release()
{
- [ -L "$archive" ] && \
- $err "'$archive' is a symlink, not a file - $dontflash"
- [ -f "$archive" ] || return 1
+ [ -L "$archive" ] && $err "'$archive' is a symlink. $dontflash"
+ e "$archive" f missing && return 1
+
archivename="`basename "$archive"`"
- [ -z "$archivename" ] && \
- $err "Cannot determine archive file name - $dontflash"
+ [ -z "$archivename" ] && $err "Can't determine archive name. $dontflash"
case "$archivename" in
*_src.tar.xz)
@@ -470,18 +377,17 @@ check_release()
readcfg()
{
- if [ "$board" = "serprog_rp2040" ] || \
- [ "$board" = "serprog_stm32" ] || \
- [ "$board" = "serprog_pico" ]; then
+ if [ "$board" = "serprog_rp2040" ] || [ "$board" = "serprog_stm32" ] \
+ || [ "$board" = "serprog_pico" ]; then
return 1
fi
boarddir="$cbcfgsdir/$board"
eval "`setcfg "$boarddir/target.cfg"`"
- chkvars tree
- x_ ./mk -d coreboot "$tree" # even if vendorfiles not used, see: setmac
+ chkvars tree && x_ ./mk -d coreboot "$tree"
[ -z "$vcfg" ] && return 1
+
vfile="config/vendor/$vcfg/pkg.cfg"
[ -L "$vfile" ] && $err "'$archive', '$board': $vfile is a symlink"
[ -f "$vfile" ] || $err "'$archive', '$board': $vfile doesn't exist"
@@ -499,24 +405,19 @@ readcfg()
patch_release_roms()
{
has_hashes="n"
-
tmpromdir="tmp/DO_NOT_FLASH/bin/$board"
+
remkdir "${tmpromdir%"/bin/$board"}"
- tar -xf "$archive" -C "${tmpromdir%"/bin/$board"}" || \
- $err "Can't extract '$archive'"
+ x_ tar -xf "$archive" -C "${tmpromdir%"/bin/$board"}"
for _hashes in $hashfiles; do
- [ -L "$tmpromdir/$_hashes" ] && \
- $err "'$archive' -> the hashfile is a symlink. $dontflash"
- [ -f "$tmpromdir/$_hashes" ] && has_hashes="y" && \
+ [ "$need_files" = "y" ] || break
+ e "$tmpromdir/$_hashes" f && has_hashes="y" && \
hashfile="$_hashes" && break; :
done
- x_ mkdir -p "tmp"
- [ -L "tmp/rom.list" ] && \
+ x_ mkdir -p "tmp" && [ -L "tmp/rom.list" ] && \
$err "'$archive' -> tmp/rom.list is a symlink - $dontflash"
- x_ rm -f "tmp/rom.list" "tmp/zero.1b"
- x_ dd if=/dev/zero of=tmp/zero.1b bs=1 count=1
find "$tmpromdir" -maxdepth 1 -type f -name "*.rom" > "tmp/rom.list" \
|| $err "'$archive' -> Can't make tmp/rom.list - $dontflash"
@@ -525,128 +426,80 @@ patch_release_roms()
while read -r _xrom ; do
process_release_rom "$_xrom" || break
done < "tmp/rom.list"
- rm -f "$tmpromdir/README.md" || :
[ "$nukemode" != "nuke" ] || \
- printf "Make sure you inserted vendor files: %s\n" \
- "$vguide" > "$tmpromdir/README.md" || :
+ printf "Make sure you inserted vendor files: %s\n" \
+ "$vguide" > "$tmpromdir/README.md" || :
else
printf "Skipping vendorfiles on '%s'\n" "$archive" 1>&2
+ need_files="n"
fi
(
+ [ "$need_files" = "y" ] || exit 0
cd "$tmpromdir" || $err "patch '$archive': can't cd $tmpromdir"
# NOTE: For compatibility with older rom releases, defer to sha1
if [ "$has_hashes" = "y" ] && [ "$nukemode" != "nuke" ]; then
sha512sum --status -c "$hashfile" || \
- sha1sum --status -c "$hashfile" || \
- $err "'$archive' -> Can't verify vendor hashes. $dontflash"
- rm -f "$hashfile" || \
- $err "$archive: Can't rm hashfile. $dontflash"
+ x_ sha1sum --status -c "$hashfile"
+ x_ rm -f "$hashfile"
fi
) || $err "'$archive' -> Can't verify vendor hashes. $dontflash"
- if [ -n "$new_mac" ]; then
- if ! modify_mac_addresses; then
- printf "\nNo GbE region defined for '%s'\n" "$board" \
- 1>&2
- printf "Therefore, changing the MAC is impossible.\n" \
- 1>&2
- printf "This board probably lacks Intel ethernet.\n" \
- 1>&2
- printf "(or it's pre-IFD Intel with Intel GbE NIC)\n" \
- 1>&2
- fi
- fi
+ [ -z "$new_mac" ] || modify_mac || printf "\nGbE not defined\n" 1>&2
[ "$xchanged" = "y" ] || rm -Rf "$tmpromdel" || :
[ "$xchanged" = "y" ] || return 0
+
(
- cd "${tmpromdir%"/bin/$board"}" || \
- $err "Can't cd '${tmpromdir%"/bin/$board"}'; $dontflash"
- # ../../ is the root of lbmk
- mkrom_tarball "bin/$board"
+ x_ cd "${tmpromdir%"/bin/$board"}"
+ mkrom_tarball "bin/$board"
) || $err "Cannot re-generate '$archive' - $dontflash"
mv "${tmpromdir%"/bin/$board"}/bin/${relname}_${board}.tar.xz" \
- "$archive" || \
- $err "'$archive' -> Cannot overwrite - $dontflash"; :
+ "$archive" || $err "'$archive' -> Can't overwrite - $dontflash"; :
}
process_release_rom()
{
_xrom="$1"
_xromname="${1##*/}"
+ _xromnew="${_xrom%/*}/${_xromname#"$vfix"}"
+ [ "$nukemode" = "nuke" ] && _xromnew="${_xrom%/*}/$vfix${_xrom##*/}"
- [ -L "$_xrom" ] && \
- $err "$archive -> '${_xrom#"tmp/DO_NOT_FLASH/"}' is a symlink"
- [ -f "$_xrom" ] || return 0
+ e "$_xrom" f missing && return 0
+ [ -z "${_xromname#"$vfix"}" ] && $err "$_xromname / $vfix: name match"
- [ -z "${_xromname#"$vfix"}" ] && \
- $err "'$_xromname'->'"${_xromname#"$vfix"}"' empty. $dontflash"
# Remove the prefix and 1-byte pad
if [ "$nukemode" != "nuke" ] && \
[ "${_xromname#"$vfix"}" != "$_xromname" ]; then
- _xromnew="${_xrom%/*}/${_xromname#"$vfix"}"
-
- # Remove the 1-byte padding
- stat -c '%s' "$_xrom" > "tmp/rom.size" || \
- $err "$_xrom: Can't get rom size. $dontflash"
- read -r xromsize < "tmp/rom.size" || \
- $err "$_xrom: Can't read rom size. $dontflash"
-
- expr "X$xromsize" : "X-\{0,1\}[0123456789][0123456789]*$" \
- 1>/dev/null 2>/dev/null || $err "$_xrom size non-integer"
- [ $xromsize -lt 2 ] && $err \
- "$_xrom: Will not create empty file. $dontflash"
-
- # TODO: check whether the size would be a multiple of 64KB
- # the smallest rom images we do are 512kb
- xromsize="`expr $xromsize - 1`"
- [ $xromsize -lt 524288 ] && \
- $err "$_xrom size too small; likely not a rom. $dontflash"
-
- dd if="$_xrom" of="$_xromnew" bs=$xromsize count=1 || \
- $err "$_xrom: Can't resize. $dontflash"
+ xromsize="$(expr $(stat -c '%s' "$_xrom") - 1)" || $err "!int"
+ [ $xromsize -lt 524288 ] && $err "too small, $xromsize: $_xrom"
+
+ x_ dd if="$_xrom" of="$_xromnew" bs=$xromsize count=1
rm -f "$_xrom" || $err "Can't rm $_xrom - $dontflash"
_xrom="$_xromnew"
fi
- [ "$nukemode" = "nuke" ] && \
- mksha512sum "$_xrom" "vendorhashes"
+ [ "$nukemode" = "nuke" ] && mksha512sum "$_xrom" "vendorhashes"
patch_rom "$_xrom" || return 1 # if break return, can still change MAC
[ "$nukemode" != "nuke" ] && return 0
# Rename the file, prefixing a warning saying not to flash
- # the target image, which now has vendor files removed. Also
- # pad it so that flashprog returns an error if the user tries
- # to flash it, due to mismatching ROM size vs chip size
- cat "$_xrom" tmp/zero.1b > "${_xrom%/*}/$vfix${_xrom##*/}" || \
- $err "'$archive' -> can't pad/rename '$_xrom'. $dontflash"
- rm -f "$_xrom" || $err "'$archive' -> can't rm '$_xrom'. $dontflash"
+ cat "$_xrom" config/data/coreboot/0 > "$_xromnew" || $err "!pad $_xrom"
+ x_ rm -f "$_xrom"
}
patch_rom()
{
rom="$1"
- # regarding ifs below:
- # if a hash file exists, we only want to allow inject.
- # if a hash file is missing, we only want to allow nuke.
- # this logical rule prevents double-nuke and double-inject
-
- # if injecting without a hash file i.e. inject what was injected
- # (or inject where no vendor files are needed, covered previously)
if [ "$has_hashes" != "y" ] && [ "$nukemode" != "nuke" ]; then
- printf "inject: '%s' has no hash file. Skipping.\n" \
- "$archive" 1>&2
+ printf "'%s' has no hash file. Skipping.\n" "$archive" 1>&2
return 1
- fi
- # nuking *with* a hash file, i.e. nuking what was nuked before
- if [ "$has_hashes" = "y" ] && [ "$nukemode" = "nuke" ]; then
- printf "inject nuke: '%s' has a hash file. Skipping nuke.\n" \
- "$archive" 1>&2
+ elif [ "$has_hashes" = "y" ] && [ "$nukemode" = "nuke" ]; then
+ printf "'%s' has a hash file. Skipping nuke.\n" "$archive" 1>&2
return 1
fi
@@ -663,25 +516,12 @@ patch_rom()
[ "$CONFIG_INCLUDE_SMSC_SCH5545_EC_FW" = "y" ] && \
[ -n "$CONFIG_SMSC_SCH5545_EC_FW_FILE" ] && \
inject sch5545_ecfw.bin "$CONFIG_SMSC_SCH5545_EC_FW_FILE" raw
- #
- # coreboot adds FSP-M first. so we shall add it first, then S:
- # NOTE:
- # We skip the fetch if CONFIG_FSP_USE_REPO or CONFIG_FSP_FULL_FD is set
- # but only for inject/nuke. we still run fetch (see above) because on
- # _fsp targets, coreboot still needs them, but coreboot Kconfig uses
- # makefile syntax and puts $(obj) in the path, which makes no sense
- # in sh. So we modify the path there, but lbmk only uses the file
- # in vendorfiles/ if neither CONFIG_FSP_USE_REPO nor CONFIG_FSP_FULL_FD
- # are set
- #
[ -z "$CONFIG_FSP_USE_REPO" ] && [ -z "$CONFIG_FSP_FULL_FD" ] && \
[ -n "$CONFIG_FSP_M_FILE" ] && \
inject "$CONFIG_FSP_M_CBFS" "$CONFIG_FSP_M_FILE" fsp --xip
[ -z "$CONFIG_FSP_USE_REPO" ] && [ -z "$CONFIG_FSP_FULL_FD" ] && \
[ -n "$CONFIG_FSP_S_FILE" ] && \
inject "$CONFIG_FSP_S_CBFS" "$CONFIG_FSP_S_FILE" fsp
- # TODO: modify gbe *after checksum verification only*
- # TODO: insert default gbe if doing -n nuke
printf "ROM image successfully patched: %s\n" "$rom"
xchanged="y"
@@ -689,14 +529,14 @@ patch_rom()
inject()
{
- [ $# -lt 3 ] && $err "$*, $rom: usage: inject name path type (offset)"
[ "$2" = "/dev/null" ] && return 0
- eval "`setvars "" cbfsname _dest _t _offset`"
cbfsname="$1"
_dest="${2##*../}"
_t="$3"
+ _offset=""
+
if [ "$_t" = "fsp" ]; then
[ $# -gt 3 ] && _offset="$4"
else
@@ -704,7 +544,7 @@ inject()
$err "inject $*, $rom: offset given but empty (undefined)"
fi
- e "$_dest" f n && [ "$nukemode" != "nuke" ] && $err "!inject $dl_type"
+ [ "$nukemode" = "nuke" ] || x_ e "$_dest" f
if [ "$cbfsname" = "IFD" ]; then
[ "$nukemode" = "nuke" ] || "$ifdtool" $ifdprefix -i \
@@ -712,15 +552,9 @@ inject()
$err "failed: inject '$_t' '$_dest' on '$rom'"
[ "$nukemode" != "nuke" ] || "$ifdtool" $ifdprefix --nuke $_t \
"$rom" -O "$rom" || $err "$rom: !nuke IFD/$_t"
- xchanged="y"
- return 0
elif [ "$nukemode" = "nuke" ]; then
- "$cbfstool" "$rom" remove -n "$cbfsname" || \
- $err "inject $rom: can't remove $cbfsname"
- xchanged="y"
- return 0
- fi
- if [ "$_t" = "stage" ]; then # the only stage we handle is refcode
+ x_ "$cbfstool" "$rom" remove -n "$cbfsname"
+ elif [ "$_t" = "stage" ]; then # the only stage we handle is refcode
x_ mkdir -p tmp
x_ rm -f "tmp/refcode"
"$rmodtool" -i "$_dest" -o "tmp/refcode" || "!reloc refcode"
@@ -733,45 +567,26 @@ inject()
xchanged="y"; :
}
-modify_mac_addresses()
+modify_mac()
{
- [ "$nukemode" = "nuke" ] && \
- $err "Cannot modify MAC addresses while nuking vendor files"
-
- # chkvars CONFIG_GBE_BIN_PATH
[ -n "$CONFIG_GBE_BIN_PATH" ] || return 1
- e "${CONFIG_GBE_BIN_PATH##*../}" f n && $err "missing gbe file"
- [ "$new_mac" != "restore" ] && \
- x_ make -C util/nvmutil
-
- x_ mkdir -p tmp
- [ -L "tmp/gbe" ] && $err "tmp/gbe exists but is a symlink"
- [ -d "tmp/gbe" ] && $err "tmp/gbe exists but is a directory"
- if [ -e "tmp/gbe" ]; then
- [ -f "tmp/gbe" ] || $err "tmp/gbe exists and is not a file"
- fi
- x_ cp "${CONFIG_GBE_BIN_PATH##*../}" "tmp/gbe"
-
- [ "$new_mac" != "restore" ] && \
- x_ "util/nvmutil/nvm" "tmp/gbe" setmac "$new_mac"
+ x_ mkdir -p tmp && x_ cp "${CONFIG_GBE_BIN_PATH##*../}" tmp/gbe
+ [ "$new_mac" != "restore" ] && x_ make -C util/nvmutil && \
+ x_ "$nvm" tmp/gbe setmac "$new_mac"
find "$tmpromdir" -maxdepth 1 -type f -name "*.rom" > "tmp/rom.list" \
|| $err "'$archive' -> Can't make tmp/rom.list - $dontflash"
while read -r _xrom; do
- [ -L "$_xrom" ] && continue
- [ -f "$_xrom" ] || continue
- "$ifdtool" $ifdprefix -i GbE:"tmp/gbe" "$_xrom" -O \
- "$_xrom" || $err "'$_xrom': Can't insert new GbE file"
- xchanged="y"
+ e "$_xrom" f && xchanged="y" && x_ \
+ "$ifdtool" $ifdprefix -i GbE:tmp/gbe "$_xrom" -O "$_xrom"
done < "tmp/rom.list"
- printf "\nThe following GbE NVM words were written in '%s':\n" \
- "$archive"
- x_ util/nvmutil/nvm tmp/gbe dump | grep -v "bytes read from file" || :
+
+ printf "\nGbE NVM written to '%s':\n" "$archive"
+ x_ "$nvm" tmp/gbe dump | grep -v "bytes read from file" || :
[ "$new_mac" = "restore" ] && \
- printf "\nNOTE: User specified setmac 'restore' argument.\n" && \
- printf "Default GbE file '%s' written without running nvmutil.\n" \
- "${CONFIG_GBE_BIN_PATH##*../}"; :
+ printf "\nDefault GbE file '%s' written, unmodified.\n" \
+ "${CONFIG_GBE_BIN_PATH##*../}"; :
}
diff --git a/mk b/mk
index c795b054..a8e4e617 120000..100755
--- a/mk
+++ b/mk
@@ -1 +1,494 @@
-build \ No newline at end of file
+#!/usr/bin/env sh
+# SPDX-License-Identifier: GPL-3.0-or-later
+# Copyright (c) 2020-2025 Leah Rowe <leah@libreboot.org>
+# Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com>
+# Copyright (c) 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
+# Copyright (c) 2022-2023 Alper Nebi Yasak <alpernebiyasak@gmail.com>
+
+set -u -e
+
+if [ "./${0##*/}" != "${0}" ] || [ ! -f "mk" ] || [ -L "mk" ]; then
+ printf "You must run this in the proper work directory.\n" 1>&2
+ exit 1
+fi
+
+. "include/lib.sh"
+. "include/vendor.sh"
+. "include/mrc.sh"
+
+eval "`setvars "" vdir src_dirname srcdir mode xp ser`"
+
+main()
+{
+ [ $# -lt 1 ] && $err "bad command"
+ rval=0
+
+ for g in "command -v git" "git config --global user.name" \
+ "git config --global user.email" "git_init"; do
+ eval "$g 1>/dev/null 2>/dev/null || $err \"Unconfigured: $g\""
+ done
+
+ case "$1" in
+ version) printf "%s\nWebsite: %s\n" "$relname" "$projectsite" ;;
+ release|download|inject)
+ cmd="vendor_$1" && [ "$1" = "release" ] && cmd="mkrelease"
+ shift 1
+ $cmd "$@" ;;
+ -*) rval=1 ;;
+ *) $err "bad command" ;;
+ esac
+ set -u -e # some commands disable them. turn them on!
+ return $rval
+}
+
+git_init()
+{
+ [ -L ".git" ] && return 1
+ [ -e ".git" ] && return 0
+ eval "`setvars "$(date -Rud @$versiondate)" cdate _nogit`"
+
+ git init || return 1
+ git add -A . || return 1
+ git commit -m "$projectname $version" --date "$cdate" \
+ --author="xbmk <xbmk@example.com>" || return 1
+ git tag -a "$version" -m "$projectname $version" || return 1
+}
+
+mkrelease()
+{
+ export XBMK_RELEASE="y"
+
+ vdir="release"
+ while getopts d:m: option; do
+ [ -z "$OPTARG" ] && $err "empty argument not allowed"
+ case "$option" in
+ d) vdir="$OPTARG" ;;
+ m) mode="$OPTARG" ;;
+ *) $err "invalid option '-$option'" ;;
+ esac
+ done
+
+ vdir="$vdir/$version"
+ src_dirname="${relname}_src"
+ srcdir="$vdir/$src_dirname"
+
+ [ -e "$vdir" ] && $err "already exists: \"$vdir\""
+ mkdir -p "$vdir" || $err "mkvdir: !mkdir -p \"$vdir\""
+ git clone . "$srcdir" || $err "mkdir: !gitclone \"$srcdir\""
+ touch "$srcdir/lock" || $err "can't make lock file in $srcdir/"
+
+ build_release
+
+ printf "\n\nDONE! Check release files under %s\n" "$vdir"
+}
+
+build_release()
+{
+ (
+ cd "$srcdir" || $err "$vdir: !cd \"$srcdir\""
+
+ ./mk -f
+ x_ rm -Rf tmp
+ rmgit .
+ x_ mv src/docs docs
+ ) || $err "can't create release files"
+
+ git log --graph --pretty=format:'%Cred%h%Creset %s %Creset' \
+ --abbrev-commit > "$srcdir/CHANGELOG" || $err "!gitlog $srcdir"
+ rm -f "$srcdir/lock" || $err "can't remove lock file in $srcdir"
+
+ (
+ cd "${srcdir%/*}" || $err "$vdir: mktarball \"$srcdir\""
+ mktarball "${srcdir##*/}" "${srcdir##*/}.tar.xz" || $err "$vdir: mksrc"
+ ) || $err "can't create src tarball"
+ [ "$mode" = "src" ] && return 0
+
+ touch "$srcdir/lock" || $err "can't make lock file in $srcdir/"
+ (
+ cd "$srcdir" || $err "$vdir: 2 !cd \"$srcdir\""
+ mk -b coreboot pico-serprog stm32-vserprog pcsx-redux
+ x_ mv bin ../roms
+ ) || $err "can't build rom images"
+
+ rm -Rf "$srcdir" || $err "!rm -Rf $srcdir"
+}
+
+main "$@" && exit 0
+
+# what follows was formerly script/trees, whose main() is now trees()
+
+. "include/git.sh"
+
+eval "`setvars "" xarch srcdir premake gnatdir xlang mode makeargs elfdir cmd \
+ project target target_dir targets xtree _f release bootstrapargs mkhelper \
+ autoconfargs listfile autogenargs btype tree rev tree_depend build_depend \
+ defconfig postmake mkhelpercfg dry dest_dir mdir cleanargs gccver gccfull \
+ gnatver gnatfull gccdir cmakedir do_make badhash`"
+
+trees()
+{
+ flags="f:b:m:u:c:x:s:l:n:d:"
+
+ while getopts $flags option; do
+ [ -n "$_f" ] && $err "only one flag is permitted"
+ _f="$1"
+
+ case "$_f" in
+ -d) dry=":" ;;
+ -b) : ;;
+ -u) mode="oldconfig" ;;
+ -m) mode="menuconfig" ;;
+ -c) mode="distclean" ;;
+ -x) mode="crossgcc-clean" ;;
+ -f)
+ do_make="n"
+ dry=":" ;;
+ -s) mode="savedefconfig" ;;
+ -l) mode="olddefconfig" ;;
+ -n) mode="nconfig" ;;
+ *) $err "invalid option '-$option'" ;;
+ esac
+
+ if [ -z "${OPTARG+x}" ]; then
+ shift 1
+ break
+ fi
+
+ project="${OPTARG#src/}"
+ shift 2
+ done
+ [ -z "$_f" ] && $err "missing flag ($flags)"
+ if [ -z "$project" ]; then
+ mk $_f $(ls -1 config/git)
+ return 1
+ fi
+
+ x_ e "config/git/$project/pkg.cfg" f
+
+ for d in "elf" "config/data" "config" "src"; do
+ eval "${d#*/}dir=\"$d/$project\""
+ done
+ dest_dir="$elfdir"
+
+ listfile="$datadir/build.list"
+ [ -f "$listfile" ] || listfile="" # optional on all projects
+
+ mkhelpercfg="$datadir/mkhelper.cfg"
+ if e "$mkhelpercfg" f missing; then
+ mkhelpercfg="$xbmktmp/mkhelper.cfg"
+ x_ touch "$mkhelpercfg"
+ fi
+
+ targets="$*"
+ cmd="build_targets $targets"
+ singletree "$project" && cmd="build_project"
+
+ remkdir "${tmpgit%/*}"
+}
+
+build_project()
+{
+ configure_project "$configdir" || return 0
+ [ ! -f "$listfile" ] || $dry elfcheck || return 0
+
+ [ "$mode" = "distclean" ] && mode="clean"
+ run_make_command || return 0
+
+ [ -n "$mode" ] || $dry copy_elf; :
+}
+
+build_targets()
+{
+ [ -d "$configdir" ] || $err "directory, $configdir, does not exist"
+ [ $# -gt 0 ] || targets="$(ls -1 "$configdir")" || $err "!o $configdir"
+
+ for x in $targets; do
+ unset CROSS_COMPILE
+ export PATH="$xbmkpath"
+ [ "$x" = "list" ] && x_ ls -1 "config/$project" && \
+ listfile="" && break
+
+ target="$x"
+ printf "'make %s', '%s', '%s'\n" "$mode" "$project" "$target"
+ x_ handle_defconfig
+
+ mkhelp "$postmake"
+ done; :
+}
+
+handle_defconfig()
+{
+ target_dir="$configdir/$target"
+
+ [ -f "CHANGELOG" ] || fetch_project "$project"
+ configure_project "$target_dir" || return 0
+ x_ mkdir -p "$elfdir/$target"
+
+ chkvars tree
+ srcdir="src/$project/$tree"
+
+ if [ "$mode" = "distclean" ] || [ "$mode" = "crossgcc-clean" ]; then
+ [ -d "$srcdir" ] || return 0
+ fi
+ [ -z "$mode" ] && $dry check_cross_compiler
+
+ for y in "$target_dir/config"/*; do
+ [ "$_f" = "-d" ] || [ -f "$y" ] || continue
+ [ "$_f" = "-d" ] || defconfig="$y"
+
+ [ -n "$mode" ] || check_defconfig || continue
+ handle_makefile
+ [ -n "$mode" ] || $dry copy_elf
+ done; :
+}
+
+configure_project()
+{
+ eval "`setvars "" cleanargs build_depend autoconfargs xtree postmake \
+ tree_depend makeargs btype mkhelper bootstrapargs premake release \
+ xarch xlang badhash`"
+ _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
+ eval "`setvars "" rev tree`"
+ eval "`setcfg "$_tcfg"`"
+ printf "Loading %s config: %s\n" "$project" "$_tcfg"
+
+ [ "$_f" = "-d" ] && build_depend="" # dry run
+ [ "$cmd" = "build_project" ] && break
+ [ "$do_make" != "n" ] && break
+
+ [ "${_tcfg%/*/target.cfg}" = "${_tcfg%"/$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
+ [ -z "$mode" ] && $dry build_dependencies
+
+ mdir="$xbmkpwd/config/submodule/$project"
+ [ -n "$tree" ] && mdir="$mdir/$tree"
+ [ -f "CHANGELOG" ] || check_project_hashes
+
+ if [ "$do_make" = "n" ]; then
+ [ -f "CHANGELOG" ] || fetch_${cmd#build_}
+ return 1
+ fi
+ x_ ./mk -f "$project" "$target"
+}
+
+build_dependencies()
+{
+ for bd in $build_depend; do
+ bd_p="${bd%%/*}"
+ bd_t="${bd##*/}"
+ [ -z "$bd_p" ] && $dry $err "$project/$tree: !bd '$bd'"
+ [ "${bd##*/}" = "$bd" ] && bd_t=""
+ [ -z "$bd_p" ] || $dry x_ ./mk -b $bd_p $bd_t; :
+ done; :
+}
+
+check_project_hashes()
+{
+ old_pjhash="" && x_ mkdir -p "$XBMK_CACHE/hash"
+ [ ! -f "$XBMK_CACHE/hash/$project$tree" ] || \
+ read -r old_pjhash < "$XBMK_CACHE/hash/$project$tree"
+
+ x_ rm -f "$xbmktmp/project.list" "$xbmktmp/project.hash" \
+ "$xbmktmp/project.tmp"
+ x_ touch "$xbmktmp/project.tmp" "$xbmktmp/project.hash"
+
+ for rmchk in "$datadir" "$configdir/$tree" "$mdir"; do
+ [ ! -d "$rmchk" ] || find "$rmchk" -type f -not -path \
+ "*/.git*/*" >> "$xbmktmp/project.tmp" || $err "!fh $rmchk"
+ done
+ sort "$xbmktmp/project.tmp" > "$xbmktmp/project.list" || $err "!pj srt"
+
+ while read -r rmchk; do
+ [ ! -f "$rmchk" ] || x_ sha512sum "$rmchk" | awk \
+ '{print $1}' >> "$xbmktmp/project.hash" || $err "!h $rmchk"
+ done < "$xbmktmp/project.list"
+
+ pjhash="$(sha512sum "$xbmktmp/project.hash" | awk '{print $1}')" || :
+ [ "$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"
+
+ [ "$badhash" != "y" ] || x_ rm -Rf "src/$project/$tree" \
+ "elf/$project/$tree" "elf/$project/$target"; :
+}
+
+check_cross_compiler()
+{
+ xgccargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS"
+ for _xarch in $xarch; do
+ cbdir="src/coreboot/$tree"
+ [ "$project" != "coreboot" ] && cbdir="src/coreboot/default"
+ [ -n "$xtree" ] && cbdir="src/coreboot/$xtree"
+
+ x_ ./mk -f coreboot "${cbdir#src/coreboot/}"
+
+ export PATH="$xbmkpwd/$cbdir/util/crossgcc/xgcc/bin:$PATH"
+ export CROSS_COMPILE="${xarch% *}-"
+ [ -n "$xlang" ] && export BUILD_LANGUAGES="$xlang"
+
+ xfix="${_xarch%-*}" && [ "$xfix" = "x86_64" ] && xfix="x64"
+
+ # match gnat-X to gcc
+ check_gnu_path gcc gnat || x_ check_gnu_path gnat gcc
+
+ # sometimes buildgcc fails for like no reason. try twice.
+ make -C "$cbdir" crossgcc-$xfix $xgccargs || \
+ x_ make -C "$cbdir" crossgcc-$xfix $xgccargs
+
+ # we only want to mess with hostcc to build xgcc
+ rm -f "$XBMK_CACHE/gnupath/"* || $err "Can't clear gnupath/"; :
+ done; :
+}
+
+# fix mismatching gcc/gnat versions on debian trixie/sid. as of december 2024,
+# trixie/sid had gnat-13 as gnat and gcc-14 as gcc, but has gnat-14 in apt. in
+# some cases, gcc 13+14 and gnat-13 are present; or gnat-14 and gcc-14, but
+# gnat in PATH never resolves to gnat-14, because gnat-14 was "experimental"
+check_gnu_path()
+{
+ [ $# -lt 2 ] && $err "check_gnu_path: Too few arguments"
+ [ "$1" = "$2" ] && $err "check_gnu_path: Both arguments identical"
+ for _gnuarg in 1 2; do
+ eval "[ \"\$$_gnuarg\" = \"gcc\" ] && continue"
+ eval "[ \"\$$_gnuarg\" = \"gnat\" ] && continue"
+ $err "check_gnu_path: Invalid argument \"$_gnuarg\""
+ done
+ command -v "$1" 1>/dev/null || $err "Host '$1' unavailable"
+
+ eval "`setvars "" gccver gccfull gnatver gnatfull gccdir gnatdir`"
+ gnu_setver "$1" "$1" || $err "Command '$1' unavailable."
+ gnu_setver "$2" "$2" || :
+
+ eval "[ -z \"\$$1ver\" ] && $err \"Cannot detect host '$1' version\""
+ [ "$gnatfull" = "$gccfull" ] && return 0
+
+ eval "$1dir=\"$(dirname "$(command -v "$1")")\""
+ eval "_gnudir=\"\$$1dir\"; _gnuver=\"\$$1ver\""
+ for _gnubin in "$_gnudir/$2-"*; do
+ [ -f "$_gnubin" ] || continue
+ [ "${_gnubin#"$_gnudir/$2-"}" = "$_gnuver" ] || continue
+ _gnuver="${_gnubin#"$_gnudir/$2-"}"; break
+ done
+ gnu_setver "$2" "$_gnudir/$2-$_gnuver" || return 1
+ [ "$gnatfull" = "$gccfull" ] || return 1
+
+ (
+ rm -f "$XBMK_CACHE/gnupath/"* || $err "Cannot clear gnupath/"
+ cd "$XBMK_CACHE/gnupath" || $err "Can't cd to gnupath/"
+ for _gnubin in "$_gnudir/$2"*"-$_gnuver"; do
+ _gnuutil="${_gnubin##*/}" && [ -e "$_gnubin" ] && \
+ x_ ln -s "$_gnubin" "${_gnuutil%"-$_gnuver"}"
+ done
+ ) || $err "Cannot create $2-$_gnuver link in $_gnudir"; :
+}
+
+gnu_setver()
+{
+ eval "$2 --version 1>/dev/null 2>/dev/null || return 1"
+ eval "$1ver=\"`"$2" --version 2>/dev/null | head -n1`\""
+ eval "$1ver=\"\${$1ver##* }\""
+ eval "$1full=\"\$$1ver\""
+ eval "$1ver=\"\${$1ver%%.*}\""; :
+}
+
+check_defconfig()
+{
+ [ -f "$defconfig" ] || $dry $err "$project/$target: missing defconfig"
+ dest_dir="$elfdir/$target/${defconfig#"$target_dir/config/"}"
+
+ $dry elfcheck || return 1 # skip build if a previous one exists
+ $dry x_ mkdir -p "$dest_dir"
+}
+
+elfcheck()
+{
+ # TODO: very hacky check. do it properly (based on build.list)
+ for elftest in "$dest_dir"/*; do
+ [ -e "$elftest" ] && e "$elftest" f && return 1
+ done; :
+}
+
+handle_makefile()
+{
+ $dry check_makefile "$srcdir" && x_ make -C "$srcdir" $cleanargs clean
+
+ [ -f "$defconfig" ] && x_ cp "$defconfig" "$srcdir/.config"
+ [ -n "$mode" ] || [ -n "$btype" ] || $dry make -C \
+ "$srcdir" silentoldconfig || make -C "$srcdir" oldconfig || :
+
+ run_make_command || $err "handle_makefile $srcdir: no makefile!"
+
+ _copy=".config" && [ "$mode" = "savedefconfig" ] && _copy="defconfig"
+ [ "${mode%config}" = "$mode" ] || \
+ $dry x_ cp "$srcdir/$_copy" "$defconfig"
+
+ [ -e "$srcdir/.git" ] && [ "$project" = "u-boot" ] && \
+ [ "$mode" = "distclean" ] && \
+ $dry x_ git -C "$srcdir" $cleanargs clean -fdx; :
+}
+
+run_make_command()
+{
+ mkhelp "$premake"
+
+ $dry check_cmake "$srcdir" && [ -z "$mode" ] && \
+ $dry check_autoconf "$srcdir"
+ $dry check_makefile "$srcdir" || return 1
+
+ $dry x_ make -C "$srcdir" $mode -j$XBMK_THREADS $makeargs
+ mkhelp "$mkhelper"
+
+ [ "$mode" != "clean" ] || \
+ $dry make -C "$srcdir" $cleanargs distclean || :; :
+}
+
+check_cmake()
+{
+ [ -z "$cmakedir" ] || $dry check_makefile "$1" || cmake -B "$1" \
+ "$1/$cmakedir" || $dry x_ check_makefile "$1"
+ [ -z "$cmakedir" ] || $dry x_ check_makefile "$1"; :
+}
+
+check_autoconf()
+{
+ (
+ cd "$1" || $err "!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()
+{
+ [ -f "$1/Makefile" ] || [ -f "$1/makefile" ] || \
+ [ -f "$1/GNUmakefile" ] || return 1; :
+}
+
+mkhelp()
+{
+ [ -z "$1" ] || [ -n "$mode" ] || eval "$1" || $err "mkhelp: !$1"; :
+}
+
+copy_elf()
+{
+ [ -f "$listfile" ] && x_ mkdir -p "$dest_dir" && while read -r f; do
+ [ -f "$srcdir/$f" ] && x_ cp "$srcdir/$f" "$dest_dir"
+ done < "$listfile"
+ x_ make clean -C "$srcdir" $cleanargs
+}
+
+if trees "$@"; then
+ . "$mkhelpercfg"
+ $cmd
+fi
diff --git a/projectname b/projectname
deleted file mode 100644
index aa4ff178..00000000
--- a/projectname
+++ /dev/null
@@ -1 +0,0 @@
-libreboot
diff --git a/projectsite b/projectsite
deleted file mode 100644
index bb74f9d7..00000000
--- a/projectsite
+++ /dev/null
@@ -1 +0,0 @@
-https://libreboot.org/
diff --git a/script/trees b/script/trees
deleted file mode 100755
index 3cdd8dd4..00000000
--- a/script/trees
+++ /dev/null
@@ -1,405 +0,0 @@
-#!/usr/bin/env sh
-# SPDX-License-Identifier: GPL-3.0-or-later
-# Copyright (c) 2022-2023 Alper Nebi Yasak <alpernebiyasak@gmail.com>
-# Copyright (c) 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
-# Copyright (c) 2023-2025 Leah Rowe <leah@libreboot.org>
-
-set -u -e
-
-. "include/lib.sh"
-. "include/git.sh"
-
-eval "`setvars "" xarch srcdir premake gnatdir xlang mode makeargs elfdir cmd \
- project target target_dir targets xtree _f release bootstrapargs mkhelper \
- autoconfargs listfile autogenargs btype tree rev tree_depend build_depend \
- defconfig postmake mkhelpercfg dry dest_dir mdir cleanargs gccver gccfull \
- gnatver gnatfull gccdir cmakedir`"
-
-# ./mk -f will set this to "n", thus
-# disabling the use of make commands
-do_make="y"
-mode="all" # make all
-
-# badhash changes to "y" when project
-# files change, e.g. config files, patches
-badhash="n"
-
-flags="-m/-u/-b/-c/-x/-f/-s/-l/-n/-d"
-
-main()
-{
- [ $# -lt 1 ] && $err "No argument provided"
- [ "${1%-*}" = "$1" ] && $err \
- "First argument must be a flag ($flags)"
-
- while getopts f:b:m:u:c:x:s:l:n:d: option; do
- [ -n "$_f" ] && $err "only one flag is permitted"
- _f="$1"
-
- case "$_f" in
- -d)
- mode=""
- dry=":" ;;
- -b) mode="" ;;
- -u) mode="oldconfig" ;;
- -m) mode="menuconfig" ;;
- -c) mode="distclean" ;;
- -x) mode="crossgcc-clean" ;;
- -f)
- do_make="n"
- dry=":" ;;
- -s) mode="savedefconfig" ;;
- -l) mode="olddefconfig" ;;
- -n) mode="nconfig" ;;
- *) $err "invalid option '-$option'" ;;
- esac
-
- if [ -z "${OPTARG+x}" ]; then
- shift 1
- break
- fi
-
- project="${OPTARG#src/}"
- shift 2
- done
- [ -z "$_f" ] && $err "missing flag ($flags)"
- if [ -z "$project" ]; then
- mk $_f $(ls -1 config/git)
- return 1
- fi
-
- [ -f "config/git/$project/pkg.cfg" ] || $err "'$project' not defined"
-
- for d in "elf" "config/data" "config" "src"; do
- eval "${d#*/}dir=\"$d/$project\""
- done
- dest_dir="$elfdir"
-
- listfile="$datadir/build.list"
- [ -f "$listfile" ] || listfile="" # optional on all projects
-
- mkhelpercfg="$datadir/mkhelper.cfg"
- if e "$mkhelpercfg" f missing; then
- mkhelpercfg="$TMPDIR/mkhelper.cfg"
- x_ touch "$mkhelpercfg"
- fi
-
- targets="$*"
- cmd="build_targets $targets"
- singletree "$project" && cmd="build_project"
-
- remkdir "${tmpgit%/*}"
-}
-
-build_project()
-{
- configure_project "$configdir" || return 0
- [ ! -f "$listfile" ] || $dry elfcheck || return 0
-
- [ "$mode" = "distclean" ] && mode="clean"
- run_make_command || return 0
-
- [ -n "$mode" ] || $dry copy_elf; :
-}
-
-build_targets()
-{
- [ -d "$configdir" ] || $err "directory, $configdir, does not exist"
- [ $# -gt 0 ] || targets="$(ls -1 "$configdir")" || $err "!o $configdir"
-
- for x in $targets; do
- unset CROSS_COMPILE
- export PATH="$xbmkpath"
- [ "$x" = "list" ] && x_ ls -1 "config/$project" && \
- listfile="" && break
- target="$x"
- printf "'make %s', '%s', '%s'\n" "$mode" "$project" "$target"
- x_ handle_defconfig
- [ -n "$mode" ] || [ -z "$postmake" ] || $postmake || \
- $err "$project/$target: !postmake: $postmake"; :
- done; return 0
-}
-
-handle_defconfig()
-{
- target_dir="$configdir/$target"
-
- [ -f "CHANGELOG" ] || fetch_project "$project"
- configure_project "$target_dir" || return 0
- x_ mkdir -p "$elfdir/$target"
-
- chkvars tree
- srcdir="src/$project/$tree"
-
- if [ "$mode" = "distclean" ] || [ "$mode" = "crossgcc-clean" ]; then
- [ -d "$srcdir" ] || return 0
- fi
- [ -z "$mode" ] && $dry check_cross_compiler
-
- for y in "$target_dir/config"/*; do
- [ "$_f" = "-d" ] || [ -f "$y" ] || continue
- [ "$_f" = "-d" ] || defconfig="$y"
-
- [ -n "$mode" ] || check_defconfig || continue
- handle_makefile
- [ -n "$mode" ] || $dry copy_elf
- done; :
-}
-
-configure_project()
-{
- eval "`setvars "" cleanargs build_depend autoconfargs xtree postmake \
- tree_depend makeargs btype mkhelper bootstrapargs premake release \
- xarch xlang`"
- _tcfg="$1/target.cfg"
- badhash="n"
- [ -f "$_tcfg" ] || btype="auto"
- [ -f "$datadir/mkhelper.cfg" ] && \
- eval "`setcfg "$datadir/mkhelper.cfg"`"
-
- while [ -f "$_tcfg" ] || [ "$cmd" != "build_project" ]; do
- eval "`setvars "" rev tree`"
- eval "`setcfg "$_tcfg"`"
- printf "Loading %s config: %s\n" "$project" "$_tcfg"
-
- [ "$_f" = "-d" ] && build_depend="" # dry run
- [ "$cmd" = "build_project" ] && break
- [ "$do_make" = "y" ] && break
-
- [ "${_tcfg%/*/target.cfg}" = "${_tcfg%"/$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
- [ -z "$mode" ] && build_dependencies
-
- mdir="$xbmkpwd/config/submodule/$project"
- [ -n "$tree" ] && mdir="$mdir/$tree"
- [ -f "CHANGELOG" ] || check_project_hashes
-
- if [ "$do_make" = "y" ]; then
- x_ ./mk -f "$project" "$target"
- return 0
- fi
- [ -f "CHANGELOG" ] || fetch_${cmd#build_}
- return 1
-}
-
-build_dependencies()
-{
- for bd in $build_depend; do
- bd_p="${bd%%/*}"
- bd_t="${bd##*/}"
- [ -z "$bd_p" ] && $dry $err "$project/$tree: !bd '$bd'"
- [ "${bd##*/}" = "$bd" ] && bd_t=""
- [ -z "$bd_p" ] || $dry ./mk -b $bd_p $bd_t \
- || $err "!mk $project/$tree $bd_p/$bd_t"; :
- done; :
-}
-
-check_project_hashes()
-{
- mkdir -p "$XBMK_CACHE/hash" || $err "!mkdir '$XBMK_CACHE/hash'"
- old_pjhash=""
- [ ! -f "$XBMK_CACHE/hash/$project$tree" ] || \
- read -r old_pjhash < "$XBMK_CACHE/hash/$project$tree"
-
- x_ rm -f "$TMPDIR/project.list" "$TMPDIR/project.hash" \
- "$TMPDIR/project.tmp"
- x_ touch "$TMPDIR/project.tmp"
- x_ touch "$TMPDIR/project.hash"
-
- for rmchk in "$datadir" "$configdir/$tree" "$mdir"; do
- [ -d "$rmchk" ] || continue
- find "$rmchk" -type f -not -path "*/.git*/*" >> \
- "$TMPDIR/project.tmp" || $err "!find $rmchk > project.tmp"
- done
- sort "$TMPDIR/project.tmp" > "$TMPDIR/project.list" || \
- $err "!sort project tmp/list"
-
- while read -r rmchk; do
- [ ! -f "$rmchk" ] || sha512sum "$rmchk" | awk \
- '{print $1}' >> "$TMPDIR/project.hash" || $err "!h $rmchk"
- done < "$TMPDIR/project.list"
-
- pjhash="$(sha512sum "$TMPDIR/project.hash" | awk '{print $1}')" || :
- badhash="y" && [ "$pjhash" = "$old_pjhash" ] && badhash="n"
- [ -f "$XBMK_CACHE/hash/$project$tree" ] || badhash="y"
-
- printf "%s\n" "$pjhash" > "$XBMK_CACHE/hash/$project$tree" || \
- $err "!mk $XBMK_CACHE/hash/$project$tree"
-
- [ "$badhash" = "n" ] || rm -Rf "src/$project/$tree" \
- "elf/$project/$tree" "elf/$project/$target" || \
- $err "!rm $project $tree"; :
-}
-
-check_cross_compiler()
-{
- xgccargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS"
- for _xarch in $xarch; do
- cbdir="src/coreboot/$tree"
- [ "$project" != "coreboot" ] && cbdir="src/coreboot/default"
- [ -n "$xtree" ] && cbdir="src/coreboot/$xtree"
-
- x_ ./mk -f coreboot "${cbdir#src/coreboot/}"
-
- export PATH="$xbmkpwd/$cbdir/util/crossgcc/xgcc/bin:$PATH"
- export CROSS_COMPILE="${xarch% *}-"
- [ -n "$xlang" ] && export BUILD_LANGUAGES="$xlang"
-
- xfix="${_xarch%-*}" && [ "$xfix" = "x86_64" ] && xfix="x64"
-
- # match gnat-X to gcc
- check_gnu_path gcc gnat || check_gnu_path gnat gcc || \
- $err "Cannot match host GCC/GNAT versions"
-
- # sometimes buildgcc fails for like no reason. try twice.
- make -C "$cbdir" crossgcc-$xfix $xgccargs || \
- make -C "$cbdir" crossgcc-$xfix $xgccargs || \
- $err "!mkxgcc $project/$xtree '$xfix' '$xgccargs'"
-
- # we only want to mess with hostcc to build xgcc
- rm -f "$XBMK_CACHE/gnupath/"* || \
- $err "Cannot clear gnupath/"; :
- done; :
-}
-
-# fix mismatching gcc/gnat versions on debian trixie/sid. as of december 2024,
-# trixie/sid had gnat-13 as gnat and gcc-14 as gcc, but has gnat-14 in apt. in
-# some cases, gcc 13+14 and gnat-13 are present; or gnat-14 and gcc-14, but
-# gnat in PATH never resolves to gnat-14, because gnat-14 was "experimental"
-check_gnu_path()
-{
- [ $# -lt 2 ] && $err "check_gnu_path: Too few arguments"
- [ "$1" = "$2" ] && $err "check_gnu_path: Both arguments identical"
- for _gnuarg in 1 2; do
- eval "[ \"\$$_gnuarg\" = \"gcc\" ] && continue"
- eval "[ \"\$$_gnuarg\" = \"gnat\" ] && continue"
- $err "check_gnu_path: Invalid argument \"$_gnuarg\""
- done
- command -v "$1" 1>/dev/null || $err "Host '$1' unavailable"
-
- eval "`setvars "" gccver gccfull gnatver gnatfull gccdir gnatdir`"
- gnu_setver "$1" "$1" || $err "Command '$1' unavailable."
- gnu_setver "$2" "$2" || :
-
- eval "[ -z \"\$$1ver\" ] && $err \"Cannot detect host '$1' version\""
- [ "$gnatfull" = "$gccfull" ] && return 0
-
- eval "$1dir=\"$(dirname "$(command -v "$1")")\""
- eval "_gnudir=\"\$$1dir\"; _gnuver=\"\$$1ver\""
- for _gnubin in "$_gnudir/$2-"*; do
- [ -f "$_gnubin" ] || continue
- [ "${_gnubin#"$_gnudir/$2-"}" = "$_gnuver" ] || continue
- _gnuver="${_gnubin#"$_gnudir/$2-"}"; break
- done
- gnu_setver "$2" "$_gnudir/$2-$_gnuver" || return 1
- [ "$gnatfull" = "$gccfull" ] || return 1
-
- (
- rm -f "$XBMK_CACHE/gnupath/"* || $err "Cannot clear gnupath/"
- cd "$XBMK_CACHE/gnupath" || $err "Can't cd to gnupath/"
- for _gnubin in "$_gnudir/$2"*"-$_gnuver"; do
- [ -e "$_gnubin" ] || continue
- _gnuutil="${_gnubin##*/}"
- x_ ln -s "$_gnubin" "${_gnuutil%"-$_gnuver"}"
- done
- ) || $err "Cannot create $2-$_gnuver link in $_gnudir"; :
-}
-
-gnu_setver()
-{
- eval "$2 --version 1>/dev/null 2>/dev/null || return 1"
- eval "$1ver=\"`"$2" --version 2>/dev/null | head -n1`\""
- eval "$1ver=\"\${$1ver##* }\""
- eval "$1full=\"\$$1ver\""
- eval "$1ver=\"\${$1ver%%.*}\""; :
-}
-
-check_defconfig()
-{
- [ -f "$defconfig" ] || $dry $err "$project/$target: missing defconfig"
- dest_dir="$elfdir/$target/${defconfig#"$target_dir/config/"}"
-
- $dry elfcheck || return 1 # skip build if a previous one exists
- $dry x_ mkdir -p "$dest_dir"
-}
-
-elfcheck()
-{
- # TODO: very hacky check. do it properly (based on build.list)
- for elftest in "$dest_dir"/*; do
- [ -e "$elftest" ] && e "$elftest" f && return 1
- done; :
-}
-
-handle_makefile()
-{
- $dry check_makefile "$srcdir" && x_ make -C "$srcdir" $cleanargs clean
- [ -f "$defconfig" ] && x_ cp "$defconfig" "$srcdir/.config"
- [ -n "$mode" ] || [ -n "$btype" ] || $dry make -C \
- "$srcdir" silentoldconfig || make -C "$srcdir" oldconfig || :
-
- run_make_command || $err "handle_makefile $srcdir: no makefile!"
-
- _copy=".config" && [ "$mode" = "savedefconfig" ] && _copy="defconfig"
- [ "${mode%config}" = "$mode" ] || \
- $dry x_ cp "$srcdir/$_copy" "$defconfig"
-
- [ -e "$srcdir/.git" ] && [ "$project" = "u-boot" ] && \
- [ "$mode" = "distclean" ] && \
- $dry x_ git -C "$srcdir" $cleanargs clean -fdx; :
-}
-
-run_make_command()
-{
- [ -z "$premake" ] || [ -n "$mode" ] || $premake || $err "!$premake"
- $dry check_cmake "$srcdir" && [ -z "$mode" ] && \
- $dry check_autoconf "$srcdir"
- $dry check_makefile "$srcdir" || return 1
-
- $dry make -C "$srcdir" $mode -j$XBMK_THREADS $makeargs || $err "!$mode"
- [ -z "$mkhelper" ] || [ -n "$mode" ] || $mkhelper || $err "!$mkhelper"
-
- [ "$mode" != "clean" ] || \
- $dry make -C "$srcdir" $cleanargs distclean || :; :
-}
-
-check_cmake()
-{
- [ -z "$cmakedir" ] || $dry check_makefile "$1" || cmake -B "$1" \
- "$1/$cmakedir" || $dry check_makefile "$1" || $err \
- "$1: !cmk $cmakedir"
- [ -z "$cmakedir" ] || $dry check_makefile "$1" || \
- $err "check_cmake $1: can't generate Makefile"; :
-}
-
-check_autoconf()
-{
- (
- cd "$1" || $err "!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()
-{
- [ -f "$1/Makefile" ] || [ -f "$1/makefile" ] || \
- [ -f "$1/GNUmakefile" ] || return 1; :
-}
-
-copy_elf()
-{
- [ -f "$listfile" ] && x_ mkdir -p "$dest_dir" && while read -r f; do
- [ -f "$srcdir/$f" ] && x_ cp "$srcdir/$f" "$dest_dir"
- done < "$listfile"
- x_ make clean -C "$srcdir" $cleanargs
-}
-
-main "$@" || exit 0
-. "$mkhelpercfg"
-$cmd
diff --git a/update b/update
deleted file mode 120000
index c795b054..00000000
--- a/update
+++ /dev/null
@@ -1 +0,0 @@
-build \ No newline at end of file
diff --git a/vendor b/vendor
deleted file mode 120000
index c795b054..00000000
--- a/vendor
+++ /dev/null
@@ -1 +0,0 @@
-build \ No newline at end of file