summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-05-05lbmk: unified execution on find commandsLeah Rowe
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-05NEW MAINBOARD: Dell Precision T1700 SFF and MTLeah Rowe
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-05mk: include rom.sh directlyLeah Rowe
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-05mk: Download vendorfiles before building releaseLeah Rowe
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-05lib.sh: Simplify rmgit()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05lib.sh: support multiple arguments in remkdir()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05lib.sh: simplify remkdir()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05move x_() to lib.shLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05init.sh: move setvars/err_ to lib.shLeah Rowe
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-05Restore SeaBIOS 9029a010 update, but with AHCI fixLeah Rowe
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 8245f0b3211812ac818adadd6526b0b39c63f3f0. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05mk: Fix bad error handling for gnu_setverLeah Rowe
I mixed logical OR and AND by mistake. Oops! Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05GRUB: Mark E820 reserved on coreboot memoryLeah Rowe
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-05inject.sh: simplify extract_intel_me_bruteforce()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05inject.sh: Remove unnecessary checkLeah Rowe
_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-05inject.sh extract_intel_me(): reduce indentationLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05inject.sh: Move FSP extraction only to extract_fspLeah Rowe
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-05inject.sh: tidy up intel me handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05inject.sh: tidy up the deguard commandLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05lib.sh: set -u -e in err()Leah Rowe
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-04lib.sh: Provide error message where none is givenLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04init.sh: Silence the output of git config --globalLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04init.sh: Run git name/email check before initLeah Rowe
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-04lib.sh: stricter xbmk_err check in err()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04lib.sh: simplify err-not-set handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04lib.sh: Add warning if x_ is called without argsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04lib.sh: simplify err()Leah Rowe
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-04init.sh: single-quote xbmklock in xbmk_lock()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04init.sh: define lock file in a variable insteadLeah Rowe
don't hardcode it. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04init.sh: tidy up xbmk_child_exec()Leah Rowe
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-04lib.sh err: add missing redirect to stderrLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04lbmk: MUCH safer err functionLeah Rowe
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-04lib.sh: rename errx to xmsgLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04lib.sh: Make x_ err if first arg is emptyLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04lib.sh: Make err_ always exit no matter whatLeah Rowe
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-04inject.sh: tidy up TBFW handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04inject.sh: remove useless comment blockLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04init.sh: tidy up the python version checkLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04init.sh: move non-init functions to lib.shLeah Rowe
these were missed in a previous cleanup Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04init.sh: simplify dependencies handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04rom.sh: tidy up copyps1bios()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04mk: tidy up xgccargs handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04mk: remove useless codeLeah Rowe
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-04init.sh: tidy up pathdir creationLeah Rowe
we can use remkdir here. it does the same thing. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04mk: re-make gnupath/ after handling crossgccLeah Rowe
instead of deleting every file within Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04mk: tidy up check_cross_compilerLeah Rowe
only initialise variables at the point they're needed. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04mk: re-make gnupath/ for each cross compilerLeah Rowe
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-04mk: reduce indentation in check_cross_compiler()Leah Rowe
we only call it in one place. the resulting code is still quite clear. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-03mk: Allow use of x_ on prefix functionsLeah Rowe
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-03mk: tidy up check_project_hashes() sha512sum checkLeah Rowe
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-03mk: simplify check_gnu_path()Leah Rowe
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>