Compare commits

...

100 Commits

Author SHA1 Message Date
Leah Rowe
62d5fea0d2 Merge branch 'master' into 25.06_branch 2025-05-27 21:49:01 +01:00
Leah Rowe
00d99adb5c Revert "inject.sh: simplify remktar()"
This reverts commit 28f03d39cb.

The commit that this reverts, broke building release roms.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27 21:44:45 +01:00
Leah Rowe
68eca880c6 tree.sh: simplify configure_project()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27 14:32:34 +01:00
Leah Rowe
d5a657308c vendor.sh: simplify getfiles()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27 14:31:57 +01:00
Leah Rowe
5af830209b tree.sh: simplify check_autoconf()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27 13:49:13 +01:00
Leah Rowe
49b02b759f tree.sh: more reliable clean in run_make_command
Don't do no-op if it fails; fall back to "clean" instead,
and fail if that fails.

The no-op was there was not all projects have distclean,
but we do intend for them all to be cleaned.

We mitigate further error by only running make-clean if
a makefile exists.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27 13:03:13 +01:00
Leah Rowe
f4a1d2217f tree.sh: condense build_targets()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27 12:56:27 +01:00
Leah Rowe
68356a8ca0 tree.sh: condense configure_project()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27 12:54:13 +01:00
Leah Rowe
a0be6d11c0 tree.sh: simplify build_targets()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27 12:52:53 +01:00
Leah Rowe
bdd42c0f32 tree.sh: simplify handle_defconfig()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27 12:19:56 +01:00
Leah Rowe
f8444a8795 tree.sh: simplify build_project()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27 12:17:06 +01:00
Leah Rowe
aacd46bf81 xbmk: simplify a few err calls
many of the messages are redundant, because errors caused
by the commands they handle would produce similar messages.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27 11:57:13 +01:00
Leah Rowe
dbf0fda39a rom.sh: simplify check_coreboot_util
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27 11:49:18 +01:00
Leah Rowe
28f03d39cb inject.sh: simplify remktar()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27 11:38:22 +01:00
Leah Rowe
46f7d48c8d inject.sh: simplify. and remove unnecessary check
checking whether archivename is empty isn't needed, because
the case/switch afterward would catch this condition.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27 11:32:11 +01:00
Leah Rowe
bc9ea0a1aa inject.sh: add missing semicolons
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27 11:29:04 +01:00
Leah Rowe
ad851804b8 inject.sh: condense check_release
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27 11:28:49 +01:00
Leah Rowe
49a258eafc inject.sh: remove unnecessary check
we don't handle single images anymore, so we don't
need to check for it at all.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27 11:26:00 +01:00
Leah Rowe
f66265eb6c Merge branch 'master' into 25.06_branch 2025-05-27 11:23:28 +01:00
Leah Rowe
9583a3919c Merge branch 'master' into 25.06_branch 2025-05-25 20:58:04 +01:00
Leah Rowe
383b9754fc Merge branch 'master' into 25.06_branch 2025-05-23 14:13:47 +01:00
Leah Rowe
34dac6da99 Merge branch 'master' into 25.06_branch 2025-05-18 19:20:42 +01:00
Leah Rowe
b8d7959ef6 Merge branch 'master' into 25.06_branch 2025-05-17 11:10:24 +01:00
Leah Rowe
1b29ad275f Merge branch 'master' into 25.06_branch 2025-05-15 02:47:00 +01:00
Leah Rowe
a8d0777da1 Merge branch 'master' into 25.06_branch 2025-05-14 21:46:44 +01:00
Leah Rowe
77d33721f3 Merge branch 'master' into 25.06_branch 2025-05-10 20:27:50 +01:00
Leah Rowe
466b156ecf Merge branch 'master' into 25.06_branch 2025-05-10 18:23:57 +01:00
Leah Rowe
b0e5fa255e Merge branch 'master' into 25.04_branch 2025-05-08 22:19:54 +01:00
Leah Rowe
15461df2e8 Merge branch 'master' into 25.04_branch 2025-05-08 21:24:56 +01:00
Leah Rowe
b525833f42 Merge branch 'master' into 25.04_branch 2025-05-08 15:53:46 +01:00
Leah Rowe
d9e8923ff4 Merge branch 'master' into 25.04_branch 2025-05-08 09:14:19 +01:00
Leah Rowe
0a93c82388 Merge branch 'master' into 25.04_branch 2025-05-06 14:56:33 +01:00
Leah Rowe
7d73e45f5b mk: Fix bad error handling for gnu_setver
I mixed logical OR and AND by mistake. Oops!

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:20:31 +01:00
Leah Rowe
bedc6b8f65 GRUB: Mark E820 reserved on coreboot memory
See, coreboot bug report:

https://ticket.coreboot.org/issues/590

We hadn't noticed this for quite a while, since we always
just booted with iomem=relaxed when needing to run cbmem,
since in practise it was always combined with other tasks
that require access to lower memory.

GRUB currently matches coreboot's own mmap for cbmem, but
for example SeaBIOS marks cbmem as E820 reserved. Therefore,
this change replicates the SeaBIOS behaviour.

Without this patch, Linux needs to boot with iomem=relaxed
for cbmem access, for example when running ./cbmem -1

With this patch, cbmem is now accessible regardless. This
patch also prevents Linux from overwriting parts of CBMEM.

Thanks go to Paul Menzel, who wrote this GRUB patch.

Thanks also go to Nicholas Chin, who provided testing, all
the way from Coreboot 25.03 back to Coreboot 4.20. It seems
that this is just something the payloads have to handle.

This means that both SeaBIOS and GRUB no longer have this
bug, in Libreboot; now what remains is to replicate the
test with our U-Boot payload.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:19:18 +01:00
Leah Rowe
93fef4734b inject.sh: simplify extract_intel_me_bruteforce()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:19:18 +01:00
Leah Rowe
d083840ca0 inject.sh: Remove unnecessary check
_dest is already checked in the calling function fetch(),
after extract_tbfw() has been called.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:19:18 +01:00
Leah Rowe
8bb3f6cfc8 inject.sh extract_intel_me(): reduce indentation
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:19:18 +01:00
Leah Rowe
b3ed7035ec inject.sh: Move FSP extraction only to extract_fsp
Don't do FSP-specific extraction in extract_archive, as
that is not what the latter is for.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:19:13 +01:00
Leah Rowe
5829a185d0 inject.sh: tidy up intel me handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:23 +01:00
Leah Rowe
64a91acc43 inject.sh: tidy up the deguard command
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:23 +01:00
Leah Rowe
40dc64e25e lib.sh: set -u -e in err()
Some parts of lbmk set +u +e, to be reset later on
under normal conditions upon exit. We must ensure
such level of integrity in err() as well.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:23 +01:00
Leah Rowe
5383002202 lib.sh: Provide error message where none is given
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:23 +01:00
Leah Rowe
bb1f32a6d4 init.sh: Silence the output of git config --global
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:23 +01:00
Leah Rowe
26d44bcd61 init.sh: Run git name/email check before init
Otherwise, it returns if init is already done, which
later leads to build errors in coreboot.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:23 +01:00
Leah Rowe
33b6c6fee2 lib.sh: stricter xbmk_err check in err()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
50e78df21b lib.sh: simplify err-not-set handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
1b324cbefb lib.sh: Add warning if x_ is called without args
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
eacd9808b6 lib.sh: simplify err()
Rely once again on err_, but still explicitly add an exit
just below, in case I made a mistake one day.

err() is essentially a trap that triggers in case I mess
up an error function, so that it doesn't reliably exit.

So, the idea is that everything calls err(), and err() is
almost never modified, or modified very carefully.

If error exits were ever broken, the result could be quite
unpredictable, so lbmk has very strict error handling, and
great care is taken to ensure that it does reliably exit.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
d4776f065c init.sh: single-quote xbmklock in xbmk_lock()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
4618452c19 init.sh: define lock file in a variable instead
don't hardcode it.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
d130bca610 init.sh: tidy up xbmk_child_exec()
make the command style more consistent, for example
relying on x_ inside a subshell to print the command
and arguments if a command failed.

this is a good style, and i'll probably use it in other
places on lbmk.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
a9aa1eeb06 lib.sh err: add missing redirect to stderr
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
bc169eb5b0 lbmk: MUCH safer err function
Don't directly call a variable. Call a function that
checks the variable instead.

The new err function also checks whether an exit was
actually done, and exits 1 if not.

If an exit was done by the given function, but the exit
was zero, this is also corrected to perform an exit 1.

This fixes a longstanding design flaw of lbmk.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
2adaef73ac lib.sh: rename errx to xmsg
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
44f1723c4f lib.sh: Make x_ err if first arg is empty
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
07145cc94a lib.sh: Make err_ always exit no matter what
Always certainly redundant, since if -u -e isn't
set, it'll continue to exit anyway.

However, we want to be pedantic about this, since
the safety of lbmk relies entirely on this function
NOT misbehaving.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
8d8f6932f1 inject.sh: tidy up TBFW handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
f69bdefc2b inject.sh: remove useless comment block
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
342d570978 init.sh: tidy up the python version check
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
bbdc46b060 init.sh: move non-init functions to lib.sh
these were missed in a previous cleanup

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
3c0bef558d init.sh: simplify dependencies handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
674fc35011 rom.sh: tidy up copyps1bios()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
e740ab7e5a mk: tidy up xgccargs handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
656a7b450b mk: remove useless code
this was added a few commits ago, but the previous commit
made me realise it's not needed at all.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
0417af86ec init.sh: tidy up pathdir creation
we can use remkdir here. it does the same thing.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
d82668ffa5 mk: re-make gnupath/ after handling crossgcc
instead of deleting every file within

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
b3bb9eba59 mk: tidy up check_cross_compiler
only initialise variables at the point they're needed.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
41f12003b8 mk: re-make gnupath/ for each cross compiler
it could be that some were left over before, for some
reason. that isn't currently the case, but this will
avoid the possibility in future.

therefore, this is a preemptive bug fix.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
422b1fbe7b mk: reduce indentation in check_cross_compiler()
we only call it in one place. the resulting code is still
quite clear.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
cf7f4a039f mk: Allow use of x_ on prefix functions
Use this for the sha512sum command, on the main mk
script at the function check_project_hashes().

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
cd7604c4d5 mk: tidy up check_project_hashes() sha512sum check
the extra function isn't needed at all. awk can just
handle every line all at once.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
06022878d6 mk: simplify check_gnu_path()
the initial checks are unnecessary, since i always know
what arguments are being provided.

the -f check in the for loop is now an -x instead, more
efficient and complete.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
aafa313b6e inject.sh: minor code cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
57c51e128a inject.sh: simplify extract_archive()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
5971f3c9d5 inject.sh: simplified fsp extraction
we know that _dest is always what's set in the coreboot config,
without the ../../../ in it, so just copy both files in a single
function, and call the function twice.

if both files are done on the first call, the second call will
be skipped. if only the first file was done on the  first call,
running the download script again will skip the  first one, and
grab the second one.

this also avoids having to run the decat function twice, in most
cases, so it's a tiny optimisation.

this optimisation only works if both fsp files (s and m) are to
be extracted into the same directory, which is the case anyway,
and this will always be the case.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
a2839ba063 inject.sh: Remove redundant code in copy_tbfw
We don't use the tbtmp variable anymore, in this function.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
d865898e5f inject.sh: Stricter TBFW handling
Don't copy it until it has been padded properly.

Otherwise, erroneous padding would result in an error,
and who knows what would be left in vendorfiles/ ?

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
ef3bda7d93 init.sh: *Re-create* tmpdirs on parent instance
To make sure any old files are removed, always re-create.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
980a1033e9 init.sh: Always create xbmklocal
If we're in a release work directory, TMPDIR is already
set, so the local ./tmp won't be created, which would
lead to an error.

Fix it by creating xbmklocal before checking TMPDIR.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
aa18889fb3 lbmk: Unified local ./tmp handling
Make it an absolute directory, relative to xbmktmp.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
2dc2fb3321 lib.sh: redirect find errors to /dev/null
this silences confusing error messages that the user
sees on the screen, that are actually benign, and it
will thus reduce the number of people who ask questions
on #libreboot irc

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
82c68ddc9a lib.sh: Fix bad touch command
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
55e916110d inject.sh: Only build nvmutil once
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
4f886cfd99 inject.sh: always re-build nvmutil
it's not a lot of code, and takes less than a second.

the previous change uses x instead of ?, but this would
cause an error if the nvmutil was already built, because
the makefile might cause a build to be skipped.

therefore, force a re-build to mitigate the error.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
91ffabd836 util/nvmutil: use x, not ?, for random characters
A user reported that '?' causes an error on zsh. See:

https://codeberg.org/libreboot/lbmk/issues/261

For example:

./mk inject libreboot-XXXXXX.tar.xz setmac ??:??:??:??:??:??

The user got:

 zsh: no matches found: ??:??:??:??:??:??

The mitigation here is to double-quote, e.g.:

./mk inject libreboot-XXXXXX.tar.xz setmac "??:??:??:??:??:??"

However, a lot of people won't do that. Therefore, I will
retain the current behaviour but support x/X for randomness.

Now lbmk uses x by default, instead. I will now update the
documentation, accordingly.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
e6687929b9 lib.sh find_ex: explicitly create the tmp file
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
02d60aca30 init.sh: Explicitly create the xbmktmp directory
mktemp would normally do it, but we must not rely on that

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
929240a38f init.sh: unified handling of ./tmp
not to be confused with /tmp

we use ./tmp inside the lbmk work directory, for large files,
because /tmp might not be very big, or might be a tmpfs

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
a80aed7ee1 lib.sh: add fe_ which is fx_ but err on find
In the mk script, we need fx_ to not return errors on the
find command, since it's searching a bunch of directories
where some of them may not exist.

All other instances where fx_ is used, must return an error
if the directory being searched doesn't exist.

For this, fe_() is introduced, which does the same as fx_
but with this much stricter check.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
aa39abfff8 lbmk: unified execution on find commands
We have a lot of places in lbmk where the output of find is
used, and then some function is executed on the result.

This is messy, and bloats several of these functions.

Now this is unified, into a new function: fx_

What fx_ does is execute a given function, for each result
found, with the arguments for a find command appended.

For example:

find -name ".git"

If you wanted to do: foo "$arg"

Where "arg" is a search result from find, and you wanted
to execute "foo" on each one, you would do:

fx_ foo -name ".git"

The find utility does have an -exec feature, but I've found
that it only works for executables, not functions.

fx_ does not return errors, so "foo" in this example
would have to do its own error handling.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
69b5d63f92 NEW MAINBOARD: Dell Precision T1700 SFF and MT
This is similar to the 9020SFF, but this board has ECC support.
However, the native raminit isn't used here, even though it is
otherwise compatible, because the native init doesn't do ECC yet.

The broadwell mrc.bin has ECC support, which is also used on the
HP EliteBook 820 G2. The MRC for broadwell can be used on haswell
boards such as the T1700.

Add both the SFF and MT variants. Since these are identical to the
9020 variants, except for slightly different PCH enabling ECC, we
can just re-use the 9020 port without issue.

We *could* add a variant to coreboot, for T1700, but there is not
really any pressing need. It is simply the 9020sff/mt with mrc.bin

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
5c063cc8a7 mk: include rom.sh directly
remove it from mkhelper files, because rom.sh doesn't
initialise any variables globally, except one that
never changes.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
248bb2681c mk: Download vendorfiles before building release
Do it just after creating the src archive. This way,
everything is downloaded all at once.

Otherwise, a momentary lapse of internet uptime will
cause a release build to fail later on, and one of
lbmk's flaws is that this would then mean you must
re-build from scratch.

If we assume that the internet is working within a
short period of time, then this change would mitigate
that possibility. If something did happen during tar
archive creation, that's a much shorter amount of time
that is "wasted".

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
210aa3a6c2 lib.sh: Simplify rmgit()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
6f535cd391 lib.sh: support multiple arguments in remkdir()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
d1d1285e9c lib.sh: simplify remkdir()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
4c9c8dd7fa move x_() to lib.sh
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
73bd02e304 init.sh: move setvars/err_ to lib.sh
these functions make more sense in lib.sh

i made mk link lib.sh first, so that the
functions on init.sh can still use them.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
87f1a8d0da Restore SeaBIOS 9029a010 update, but with AHCI fix
I fixed the AHCI bug, with a patch that I wrote. It works by
restoring the old SeaBIOS AHCI initialisation behaviour, whereby
the AHCI controller is enabled from its current state; the patch
that broke AHCI in coreboot (tested on ThinkPad T420), changed
AHCI initialisation behaviour so that the controller's state is
first reset, prior to enablement.

However, my patch also retains the new AHCI initialisation
behaviour, when a CSM is in use. The AHCI reset patch was done,
by the author, specifically for SeaBIOS in CSM mode, so it makes
sense to only change the behaviour conditionally according to that.

This reverts commit 8245f0b321.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05 12:18:22 +01:00
Leah Rowe
647e2f3b40 Libreboot 25.04 rev1
Added missing txtmode config for T420

Rolled back the recent SeaBIOS revision update, which
therefore removes these SeaBIOS patches:

* 9029a010 kconfig: fix the check-lxdialog.sh to work with gcc 14+
* 8863cbbd ahci: add controller reset
* df9dd418 update pci_pad_mem64 handling
* a4fc1845 add romfile_loadbool()
* a2725e28 drop acpi tables and hex includes
* 35aa9a72 drop obsolete acpi table code
* 1b598a1d usb-hid: Support multiple USB HID devices by storing them in a linked list

Technically, I need only revert instead to revision df9dd418, but
that and the other revisions above contain changes that may possibly
cause other breakage.

We know the old revision worked, so roll back these 7 SeaBIOS commits.

Now I will re-compile the 25.04 release and re-upload it as rev1.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-01 14:48:16 +01:00
13 changed files with 55 additions and 84 deletions

View File

@@ -16,7 +16,7 @@ index 04d058f55..b1cc8f236 100644
grub_term_cls (term);
- msg_formatted = grub_xasprintf (_("GNU GRUB version %s"), PACKAGE_VERSION);
+ msg_formatted = grub_xasprintf (_("Libreboot 25.04 Corny Calamity (GRUB menu): https://libreboot.org/"));
+ msg_formatted = grub_xasprintf (_("Libreboot 25.04 rev1 (GRUB menu): https://libreboot.org/"));
if (!msg_formatted)
return;

View File

@@ -16,7 +16,7 @@ index 04d058f55..b1cc8f236 100644
grub_term_cls (term);
- msg_formatted = grub_xasprintf (_("GNU GRUB version %s"), PACKAGE_VERSION);
+ msg_formatted = grub_xasprintf (_("Libreboot 25.04 Corny Calamity (GRUB menu): https://libreboot.org/"));
+ msg_formatted = grub_xasprintf (_("Libreboot 25.04 rev1 (GRUB menu): https://libreboot.org/"));
if (!msg_formatted)
return;

View File

@@ -16,7 +16,7 @@ index 04d058f55..b1cc8f236 100644
grub_term_cls (term);
- msg_formatted = grub_xasprintf (_("GNU GRUB version %s"), PACKAGE_VERSION);
+ msg_formatted = grub_xasprintf (_("Libreboot 25.04 Corny Calamity (GRUB menu): https://libreboot.org/"));
+ msg_formatted = grub_xasprintf (_("Libreboot 25.04 rev1 (GRUB menu): https://libreboot.org/"));
if (!msg_formatted)
return;

View File

@@ -17,7 +17,7 @@ index 538b316d..9eed0b12 100644
// Write to screen.
- printf("SeaBIOS (version %s)\n", VERSION);
+ printf("Libreboot 25.04 Corny Calamity (SeaBIOS menu): https://libreboot.org/\n");
+ printf("Libreboot 25.04 rev1 (SeaBIOS menu): https://libreboot.org/\n");
display_uuid();
}

View File

@@ -18,7 +18,7 @@ index 84831915a2..8e26ec2aef 100644
ret |= scene_obj_set_pos(scn, OBJ_MENU, MARGIN_LEFT, 100);
ret |= scene_txt_str(scn, "title", OBJ_MENU_TITLE, STR_MENU_TITLE,
- "U-Boot - Boot Menu", NULL);
+ "Libreboot 25.04 Corny Calamity (U-Boot menu): https://libreboot.org/", NULL);
+ "Libreboot 25.04 rev1 (U-Boot menu): https://libreboot.org/", NULL);
ret |= scene_menu_set_title(scn, OBJ_MENU, OBJ_PROMPT);
logo = video_get_u_boot_logo();

View File

@@ -18,7 +18,7 @@ index 84831915a2..8e26ec2aef 100644
ret |= scene_obj_set_pos(scn, OBJ_MENU, MARGIN_LEFT, 100);
ret |= scene_txt_str(scn, "title", OBJ_MENU_TITLE, STR_MENU_TITLE,
- "U-Boot - Boot Menu", NULL);
+ "Libreboot 25.04 Corny Calamity (U-Boot menu): https://libreboot.org/", NULL);
+ "Libreboot 25.04 rev1 (U-Boot menu): https://libreboot.org/", NULL);
ret |= scene_menu_set_title(scn, OBJ_MENU, OBJ_PROMPT);
logo = video_get_u_boot_logo();

View File

@@ -18,7 +18,7 @@ index 84831915a2..8e26ec2aef 100644
ret |= scene_obj_set_pos(scn, OBJ_MENU, MARGIN_LEFT, 100);
ret |= scene_txt_str(scn, "title", OBJ_MENU_TITLE, STR_MENU_TITLE,
- "U-Boot - Boot Menu", NULL);
+ "Libreboot 25.04 Corny Calamity (U-Boot menu): https://libreboot.org/", NULL);
+ "Libreboot 25.04 rev1 (U-Boot menu): https://libreboot.org/", NULL);
ret |= scene_menu_set_title(scn, OBJ_MENU, OBJ_PROMPT);
logo = video_get_u_boot_logo();

View File

@@ -106,8 +106,7 @@ try_file()
eval "[ -$echk \"$cached\" ] || return 1"
if [ "$2" = "git" ]; then
[ -d "$5" ] || tmpclone "$cached" "$5" "$6" "$7" || \
err "Can't clone final repo in command: try_file $*"; :
[ -d "$5" ] || tmpclone "$cached" "$5" "$6" "$7" || err; :
else
bad_checksum "$6" "$cached" && x_ rm -f "$cached" && return 1
[ "$cached" != "$5" ] && x_ cp "$cached" "$5"

View File

@@ -38,7 +38,7 @@ inject()
esac
[ "$new_mac" = "keep" ] && new_mac=""
check_release
x_ e "$archive" f && check_release
check_target && patch_release
[ "$xchanged" = "y" ] && remktar
@@ -52,20 +52,14 @@ inject()
check_release()
{
[ -L "$archive" ] && err "'$archive' is a symlink"
e "$archive" f missing && err "'$archive' missing"
archivename="`basename "$archive"`" || err "Can't get '$archive' name"
[ -z "$archivename" ] && err "Can't determine archive name"
case "$archivename" in
*_src.tar.xz)
err "'$archive' is a src archive, silly!" ;;
grub_*|seagrub_*|custom_*|seauboot_*|seabios_withgrub_*)
err "'$archive' is a ROM image (it must be a tarball)" ;;
*_src.tar.xz) err "'$archive' is a src archive, silly!" ;;
*.tar.xz) _stripped_prefix="${archivename#*_}"
board="${_stripped_prefix%.tar.xz}" ;;
*)
err "'$archive': could not detect board type"
*) err "'$archive': could not detect board type" ;;
esac; :
}

View File

@@ -19,8 +19,7 @@ release()
done
reldest="$reldir/$version"
[ -e "$reldest" ] && \
err "already exists: \"$reldest\""
[ -e "$reldest" ] && err "already exists: \"$reldest\""
vdir="$XBMK_CACHE/relpwd/${xbtmp##*/}/$version"
rsrc="$vdir/${relname}_src"

View File

@@ -48,8 +48,7 @@ corebootpremake()
[ -n "$mode" ] || [ ! -f "$srcdir/.config" ] || $dry printf \
"CONFIG_CCACHE=y\n" >> "$srcdir/.config" || err "$srcdir: !cook"; :
fx_ check_coreboot_util printf "cbfstool\nifdtool\n"
printf "%s\n" "${version%%-*}" > "$srcdir/.coreboot-version" || \
err "!mk $srcdir .coreboot-version"
printf "%s\n" "${version%%-*}" > "$srcdir/.coreboot-version" || err
[ -z "$mode" ] && [ "$target" != "$tree" ] && \
x_ ./mk download "$target"; :
}
@@ -65,13 +64,9 @@ check_coreboot_util()
utilmode="" && [ -n "$mode" ] && utilmode="clean"
x_ make -C "$utilsrcdir" $utilmode -j$XBMK_THREADS $makeargs
[ -n "$mode" ] && x_ rm -Rf "$utilelfdir" && return 0
[ -z "$mode" ] || return 0
[ -f "$utilelfdir/$1" ] && return 0
x_ mkdir -p "$utilelfdir"
x_ cp "$utilsrcdir/$1" "$utilelfdir"
[ "$1" = "cbfstool" ] || return 0
x_ cp "$utilsrcdir/rmodtool" "$utilelfdir"
[ ! -f "$utilelfdir/$1" ] && x_ mkdir -p "$utilelfdir" && \
x_ cp "$utilsrcdir/$1" "$utilelfdir" && [ "$1" = "cbfstool" ] && \
x_ cp "$utilsrcdir/rmodtool" "$utilelfdir"; :
}
mkcorebootbin()

View File

@@ -45,8 +45,7 @@ trees()
[ -z "$_f" ] && err "missing flag ($flags)"
[ -z "$project" ] && fx_ "x_ ./mk $_f" x_ ls -1 config/git && return 1
[ -f "config/git/$project/pkg.cfg" ] || \
err "config/git/$project/pkg.cfg missing"
e "config/git/$project/pkg.cfg" f missing && err "$project: no pkg.cfg"
for d in "elf" "config/data" "config" "src"; do
eval "${d#*/}dir=\"$d/$project\""
@@ -75,9 +74,7 @@ build_project()
[ ! -f "$listfile" ] || $dry elfcheck || return 0
[ "$mode" = "distclean" ] && mode="clean"
run_make_command || return 0
[ -n "$mode" ] || $dry copy_elf; :
run_make_command && [ -z "$mode" ] && $dry copy_elf; :
}
build_targets()
@@ -89,13 +86,9 @@ build_targets()
unset CROSS_COMPILE
export PATH="$xbmkpath"
[ "$x" = "list" ] && x_ ls -1 "config/$project" && \
listfile="" && break
target="$x"
listfile="" && break; target="$x"
printf "'make %s', '%s', '%s'\n" "$mode" "$project" "$target"
x_ handle_defconfig
[ -n "$mode" ] || x_ $postmake
x_ handle_defconfig && [ -z "$mode" ] && x_ $postmake; :
done; :
}
@@ -120,8 +113,7 @@ handle_defconfig()
[ "$_f" = "-d" ] || defconfig="$y"
[ -n "$mode" ] || check_defconfig || continue
handle_makefile
[ -n "$mode" ] || $dry copy_elf
handle_makefile && [ -z "$mode" ] && $dry copy_elf; :
done; :
}
@@ -130,8 +122,7 @@ configure_project()
eval "`setvars "" cleanargs build_depend autoconfargs xtree postmake \
makeargs btype mkhelper bootstrapargs premake release xlang xarch \
badhash`"
_tcfg="$1/target.cfg"
[ -f "$_tcfg" ] || btype="auto"
_tcfg="$1/target.cfg" && [ ! -f "$_tcfg" ] && btype="auto"
e "$datadir/mkhelper.cfg" f && eval "`setcfg "$datadir/mkhelper.cfg"`"
while e "$_tcfg" f || [ "$cmd" != "build_project" ]; do
@@ -144,8 +135,7 @@ configure_project()
[ "$do_make" != "n" ] && break
[ "${_tcfg%/*/target.cfg}" = "${_tcfg%"/$tree/target.cfg"}" ] \
&& break
_tcfg="${_tcfg%/*/target.cfg}/$tree/target.cfg"
&& break; _tcfg="${_tcfg%/*/target.cfg}/$tree/target.cfg"
done
[ "$XBMK_RELEASE" = "y" ] && [ "$release" = "n" ] && return 1
[ -z "$btype" ] || [ "${mode%config}" = "$mode" ] || return 1
@@ -187,8 +177,7 @@ check_project_hashes()
[ "$pjhash" != "$old_pjhash" ] && badhash="y"
[ -f "$XBMK_CACHE/hash/$project$tree" ] || badhash="y"
printf "%s\n" "$pjhash" > "$XBMK_CACHE/hash/$project$tree" || \
err "!mk $XBMK_CACHE/hash/$project$tree"
printf "%s\n" "$pjhash" > "$XBMK_CACHE/hash/$project$tree" || err
[ "$badhash" != "y" ] || x_ rm -Rf "src/$project/$tree" \
"elf/$project/$tree" "elf/$project/$target"; :
@@ -295,15 +284,17 @@ run_make_command()
{
[ -n "$mode" ] || x_ $premake
$dry check_cmake "$srcdir" && [ -z "$mode" ] && \
$dry check_autoconf "$srcdir"
$dry check_cmake "$srcdir"
[ -n "$mode" ] || ( $dry check_autoconf "$srcdir" ) || err
$dry check_makefile "$srcdir" || return 1
$dry x_ make -C "$srcdir" $mode -j$XBMK_THREADS $makeargs
[ -n "$mode" ] || x_ $mkhelper
check_makefile "$srcdir" || return 0
[ "$mode" != "clean" ] || \
$dry make -C "$srcdir" $cleanargs distclean || :; :
$dry make -C "$srcdir" $cleanargs distclean || \
$dry x_ make -C "$srcdir" $cleanargs clean; :
}
check_cmake()
@@ -315,12 +306,10 @@ check_cmake()
check_autoconf()
{
(
x_ cd "$1"
[ -f "bootstrap" ] && x_ ./bootstrap $bootstrapargs
[ -f "autogen.sh" ] && x_ ./autogen.sh $autogenargs
[ -f "configure" ] && x_ ./configure $autoconfargs; :
) || err "can't bootstrap project: $1"; :
}
check_makefile()

View File

@@ -21,16 +21,15 @@ appdir="$vendir/app"
vfix="DO_NOT_FLASH_YET._FIRST,_INJECT_FILES_VIA_INSTRUCTIONS_ON_LIBREBOOT.ORG_"
# lbmk-specific extension to the "cv" variable (not suitable for cbmk)
cvchk="CONFIG_INCLUDE_SMSC_SCH5545_EC_FW CONFIG_HAVE_MRC CONFIG_HAVE_ME_BIN \
cvchk="CONFIG_SMSC_SCH5545_EC_FW_FILE CONFIG_MRC_FILE CONFIG_ME_BIN_PATH \
CONFIG_LENOVO_TBFW_BIN CONFIG_VGA_BIOS_FILE CONFIG_FSP_M_FILE \
CONFIG_FSP_S_FILE CONFIG_KBC1126_FW1 CONFIG_KBC1126_FW2"
# lbmk-specific extensions to the "cv" variable (not suitable for cbmk)
cvxbmk="CONFIG_ME_BIN_PATH CONFIG_SMSC_SCH5545_EC_FW_FILE CONFIG_FSP_FULL_FD \
cvxbmk="CONFIG_FSP_FULL_FD CONFIG_IFD_BIN_PATH CONFIG_FSP_M_CBFS \
CONFIG_KBC1126_FW1_OFFSET CONFIG_KBC1126_FW2_OFFSET CONFIG_FSP_USE_REPO \
CONFIG_VGA_BIOS_ID CONFIG_BOARD_DELL_E6400 CONFIG_FSP_S_CBFS \
CONFIG_HAVE_REFCODE_BLOB CONFIG_REFCODE_BLOB_FILE CONFIG_FSP_FD_PATH \
CONFIG_IFD_BIN_PATH CONFIG_MRC_FILE CONFIG_FSP_M_CBFS"
CONFIG_HAVE_REFCODE_BLOB CONFIG_REFCODE_BLOB_FILE CONFIG_FSP_FD_PATH"
# lbmk-specific extensions; mostly used for downloading vendor files
eval "`setvars "" has_hashes EC_hash DL_hash DL_url_bkup MRC_refcode_gbe vcfg \
@@ -52,32 +51,28 @@ download()
getfiles()
{
[ -z "$CONFIG_HAVE_ME_BIN" ] || fetch intel_me "$DL_url" \
"$DL_url_bkup" "$DL_hash" "$CONFIG_ME_BIN_PATH" curl "$ME_bin_hash"
[ -z "$CONFIG_INCLUDE_SMSC_SCH5545_EC_FW" ] || fetch sch5545ec \
"$SCH5545EC_DL_url" "$SCH5545EC_DL_url_bkup" "$SCH5545EC_DL_hash" \
"$CONFIG_SMSC_SCH5545_EC_FW_FILE" "curl" "$SCH5545EC_bin_hash"
[ -z "$CONFIG_KBC1126_FW1" ] || fetch kbc1126ec "$EC_url" \
"$EC_url_bkup" "$EC_hash" "$CONFIG_KBC1126_FW1" curl "$EC_FW1_hash"
[ -z "$CONFIG_KBC1126_FW2" ] || fetch kbc1126ec "$EC_url" \
"$EC_url_bkup" "$EC_hash" "$CONFIG_KBC1126_FW2" curl "$EC_FW2_hash"
[ -z "$CONFIG_VGA_BIOS_FILE" ] || fetch e6400vga "$E6400_VGA_DL_url" \
"$E6400_VGA_DL_url_bkup" "$E6400_VGA_DL_hash" \
"$CONFIG_VGA_BIOS_FILE" "curl" "$E6400_VGA_bin_hash"
[ -z "$CONFIG_HAVE_MRC" ] || fetch "mrc" "$MRC_url" "$MRC_url_bkup" \
"$MRC_hash" "$CONFIG_MRC_FILE" "curl" "$MRC_bin_hash"
[ -z "$CONFIG_REFCODE_BLOB_FILE" ] || fetch "refcode" "$MRC_url" \
"$MRC_url_bkup" "$MRC_hash" "$CONFIG_REFCODE_BLOB_FILE" "curl" \
"$REF_bin_hash"
[ -z "$CONFIG_LENOVO_TBFW_BIN" ] || fetch "tbfw" "$TBFW_url" \
"$TBFW_url_bkup" "$TBFW_hash" "$CONFIG_LENOVO_TBFW_BIN" "curl" \
"$TBFW_bin_hash"
[ -z "$CONFIG_FSP_M_FILE" ] || fetch "fsp" "$CONFIG_FSP_FD_PATH" \
"$CONFIG_FSP_FD_PATH" "$FSPFD_hash" "$CONFIG_FSP_M_FILE" "copy" \
"$FSPM_bin_hash"
[ -z "$CONFIG_FSP_S_FILE" ] || fetch "fsp" "$CONFIG_FSP_FD_PATH" \
"$CONFIG_FSP_FD_PATH" "$FSPFD_hash" "$CONFIG_FSP_S_FILE" "copy" \
"$FSPS_bin_hash"; :
fetch intel_me "$DL_url" "$DL_url_bkup" "$DL_hash" \
"$CONFIG_ME_BIN_PATH" curl "$ME_bin_hash"
fetch sch5545ec "$SCH5545EC_DL_url" "$SCH5545EC_DL_url_bkup" \
"$SCH5545EC_DL_hash" "$CONFIG_SMSC_SCH5545_EC_FW_FILE" curl \
"$SCH5545EC_bin_hash"
fetch kbc1126ec "$EC_url" "$EC_url_bkup" "$EC_hash" \
"$CONFIG_KBC1126_FW1" curl "$EC_FW1_hash"
fetch kbc1126ec "$EC_url" "$EC_url_bkup" "$EC_hash" \
"$CONFIG_KBC1126_FW2" curl "$EC_FW2_hash"
fetch e6400vga "$E6400_VGA_DL_url" "$E6400_VGA_DL_url_bkup" \
"$E6400_VGA_DL_hash" "$CONFIG_VGA_BIOS_FILE" curl \
"$E6400_VGA_bin_hash"
fetch mrc "$MRC_url" "$MRC_url_bkup" "$MRC_hash" "$CONFIG_MRC_FILE" \
curl "$MRC_bin_hash"
fetch refcode "$MRC_url" "$MRC_url_bkup" "$MRC_hash" \
"$CONFIG_REFCODE_BLOB_FILE" curl "$REF_bin_hash"
fetch tbfw "$TBFW_url" "$TBFW_url_bkup" "$TBFW_hash" \
"$CONFIG_LENOVO_TBFW_BIN" curl "$TBFW_bin_hash"
fetch fsp "$CONFIG_FSP_FD_PATH" "$CONFIG_FSP_FD_PATH" "$FSPFD_hash" \
"$CONFIG_FSP_M_FILE" copy "$FSPM_bin_hash"
fetch fsp "$CONFIG_FSP_FD_PATH" "$CONFIG_FSP_FD_PATH" "$FSPFD_hash" \
"$CONFIG_FSP_S_FILE" copy "$FSPS_bin_hash"; :
}
fetch()
@@ -86,7 +81,7 @@ fetch()
dl="$2"
dl_bkup="$3"
dlsum="$4"
_dest="${5##*../}"
_dest="${5##*../}" && [ -z "$_dest" ] && return 0
_pre_dest="$XBMK_CACHE/tmpdl/check" || err "!fetch, mktemp, $*"
dlop="$6"
binsum="$7"