Commit Graph

890 Commits

Author SHA1 Message Date
Leah Rowe
8e8f29c2e5 vendor.sh: remove false error message
mkdst cycles through a bunch of outputted files
when running an extract function, to find the
right file as per defined checksums; if one is
found, it can still show errors for the others,
leading the user to think something is wrong.

remove their fear by removing this benign error.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-28 02:29:04 +01:00
Leah Rowe
4075c8be38 vendor.sh: use bsdtar, not unar
unar is buggy and crap

and bsdtar has superior licensing

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-28 01:56:05 +01:00
Leah Rowe
e527820ceb vendor.sh: don't use unrar
the only practical way to use it is to to use
the non-free version; currently used as a
fallback if unar fails.

however, i'm also going to scrap unar and
use bsdtar instead.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-28 01:45:36 +01:00
Riku Viitanen
b4c3bafb0e New mainboard: X2E_N150
Patch in Gerrit: https://review.coreboot.org/c/coreboot/+/89281
Not working: USB3 ports only work at USB2 speeds.

IFD:
Modified the original by:
- Removing Device Exp2 region (empty anyway)
- Enlarging the BIOS region to use this freed space
- Setting the HAP bit in PCHSTRP55 using a fork of
  me_cleaner: https://github.com/XutaxKamay/me_cleaner

Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-28 02:21:15 +03:00
Leah Rowe
fa6c3512d6 rom.sh: remove TODO note
the return is necessary when release=n while doing
release builds, because it prevents a build error
since the given images don't exist in that scenario.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-26 00:25:13 +01:00
Leah Rowe
574fd30cde inject.sh: don't exit from patch_release
return instead. xbmk's coding style specifically
prohibits anything other than x_ or err from
running "exit".

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-26 00:21:40 +01:00
Leah Rowe
4fbafaaa46 init.sh: remove comment in pybin
the following checks on the path mitigates the
lack of error handling in the findpath command
that sets pypath.

this was all thought of when i initially wrote
this code. it's perfectly fine.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-26 00:14:45 +01:00
Leah Rowe
204e310f5a get.sh: remove unnecessary check in try_copy
the check for whether a file is present is unnecessary,
because the following cp command would also print the
file name if it doesn't exist, and exit with the same
non-zero status.

let cp do the work.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-26 00:13:17 +01:00
Leah Rowe
b4fbdb448d get.sh: rename try_file to try_fetch
the previous function name was misleading, because
this tries multiple methods including git and curl.

therefore, this was renamed to match what it dose.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-26 00:12:21 +01:00
Leah Rowe
e42cb4f4cd xbmk: tidy up some if statements
this is an extension of the previous work to unroll
most of the condensed code lines.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-26 00:09:46 +01:00
Leah Rowe
f5060232e1 init.sh: remove TODO note
on further inspection, the following check ensures that the
python version number is 3.

if anything went wrong, the possibility alluded to in the
comment wouldn't actually matter in practise.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-25 23:54:16 +01:00
Leah Rowe
0303167e25 init.sh: create TMPDIR *after* suid check
otherwise, it may get created as the root user, disabling
further use of lbmk until manual user intervention.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-25 02:26:48 +01:00
Leah Rowe
1a74172a17 release.sh: use cache src on release builds
use what's in cache/clone/ from the main directory

this speeds up the build process

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-25 02:25:59 +01:00
Leah Rowe
6bb4e2c72a init.sh: remove symlink check on XBMK_CACHE
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-24 23:34:12 +01:00
Leah Rowe
dc722b5bb8 init.sh: switch back to old TMPDIR checks
the new check is still retained, to the extent that
the lock file still contains the TMPDIR string, and
it's checked whether this changed during execution.

however, the current TMPDIR handling is over-engineered
and prevents the re-use of project source caches when
doing release builds; this means that the release builds
happen much more slowly, especially for slow internet
connections.

this change *fixes* that bug. now release builds once
again re-use the main cache/ directory.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-24 23:26:11 +01:00
Leah Rowe
4686ba8a4a make notices a bit more readable
add line breaks, so that the license and author are
visually separated. this makes it easier to read.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-24 20:14:51 +01:00
Leah Rowe
5a8f350bc7 release.sh: fix typo in script: ./mk, not ./mx
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-24 18:19:48 +01:00
Leah Rowe
8347e2c85d xbmk: cleanup of recent code refactoring
be a bit less pedantic about if else clauses. leave the
big ones still with then on separate lines, where else
is specified.

also unroll a few condensed code lines where i missed
a few.

sloccount 2303 in lbmk. that's still only slightly bigger
than libreboot 20260907 which was 2180, and still much
smaller than libreboot 20230625 which was 3322.

this is *without* the condensed codelines, so now the only
thing that's reduced is the overall amount of logic present
in the build system.

and i should clarify that lbmk is presently much more powerful
than both of those two versions (20160907/20230625).

the 2016 one is useful for comparison historically, since that
was the last major version of libreboot prior to the great
second coming of leah in 2021; and the 2023 june release was
basically the last one before the great audits of 2023 to
2025 began.

not to brag (not much anyway), but all of this means that lbmk
is an insanely efficient build system, considering all the
features it has and what it does.

i unrolled the condensed code style in lbmk, making the scripts
a lot easier to read, because i received complainst about the
condensed style previously used; nicholas chin and alper nebi
yasak both told me that it sucked, and riku viitanen had hinted
at that same fact several months prior.

so hopefully now, lbmk is a bit nicer. those and other people
often find it challenging to challenge me because for reason
they assume i'll get upset and fly off the handle, but it's the
opposite. i want constant criticism, so that i know to improve!

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-24 13:19:23 +01:00
Leah Rowe
0275c60111 get.sh: unroll condensed code lines
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-24 08:40:45 +01:00
Leah Rowe
193001bc71 init.sh: unroll condensed code lines
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-24 06:54:36 +01:00
Leah Rowe
ace167445f inject.sh: unroll condensed code lines
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-24 03:13:42 +01:00
Leah Rowe
94ab695457 lib.sh: unroll condensed code lines
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-24 02:15:41 +01:00
Leah Rowe
8d5d6a3e2a mrc.sh: unroll condensed code lines
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-23 12:19:47 +01:00
Leah Rowe
45c4d4045c release.sh: unroll condensed code lines
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-23 12:18:15 +01:00
Leah Rowe
f5c91ff0ee rom.sh: unroll condensed code lines
ditto to last commit

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-23 11:47:25 +01:00
Leah Rowe
e282586427 tree.sh: unroll condensed commands
i went further than in the previosu commit. in this
commit, i also provide indentation inside subshells,
to make it clearer that soomething is being done
inside a subshell.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-23 05:55:18 +01:00
Leah Rowe
8b3f476b57 vendor.sh: unroll condensed code lines
this is part of a general effort to make lbmk
easier for novices to understand.

more commits to follow (one for every script).

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-23 02:34:00 +01:00
Leah Rowe
6b796e2b4c init.sh: make TMPDIR *after* calling xbmkpkg
otherwise, running ./mk dependencies as root will
create xbmkwd/ (temporary directories) as root,
which will then prevent non-root instances of lbmk
from being able to make temporary files.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-21 19:52:14 +01:00
Leah Rowe
c11c5a7a14 Revert "xbmk: don't use backticks for command substitution"
This reverts commit 4999a49de3.
2025-09-18 23:35:12 +01:00
Leah Rowe
fe301a019b vendor.sh: add missing error handle on sha512sum
it's still outputting to a file, with an error handle
there, but use of x_ on the sha512sum command itself
adds further assurance of reliability.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-17 17:27:39 +01:00
Leah Rowe
c734a6e757 tree.sh: fix bad variable reference
we didn't want to say a variable name here.
we only wanted to say "trees".

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-14 19:23:40 +01:00
Leah Rowe
995963baf4 xbmk: much more verbose error messages
use the new functionality in err(), whereby a given
function name and arguments can be provided, for
debugging purposes.

something similar was already done in a few places,
and replaced with this unified functionality.

this patch will make xbmk much easier to debug, under
fault conditions.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-13 13:27:47 +01:00
Leah Rowe
7bed68f5b7 lib.sh: use xprintf in err()
if more than one argument is provided, it is interpreted
as a command, and the command is outputted.

this means that now for example, where you have:

ls -l foo | err "could not list directory"

you could do:

ls -l foo | err "could not list directory" "$@"

this would show all the arguments given to the calling
function that tried to run "ls"

let's say that function was called bar, you might do:

ls -l foo | err "could not list directory" bar "$@"

right now, it's not easy to provide good debug info
where err is used, unless it was called with x_, which
provides the command/arguments that was bugging out.

with this, we now have an easy and readable/maintainable
way to do the same thing everywhere in xbmk.

this will now be done, in a follow-up commit.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-13 12:09:55 +01:00
Leah Rowe
edcf8cead8 lib.sh: use xprintf in x_
don't echo the arguments

this new logic shows quotes, in error outputs.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-13 11:50:44 +01:00
Leah Rowe
333739961a lib.sh: check args for errors in fx_ and dx_
check that there are at least two arguments, and ensure that
they are not empty.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-13 11:47:10 +01:00
Leah Rowe
ce5127e46b inject.sh: add missing semicolon in case
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-11 12:16:33 +01:00
Leah Rowe
0deac58e41 vendor.sh: tidy up apply_deguard_hack()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-11 11:26:19 +01:00
Leah Rowe
c738698cca vendor.sh: tidy up extract_intel_me()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-11 11:20:35 +01:00
Leah Rowe
e9c7338cda vendor.sh: clean out 7ztest on startup
otherwise, some files from a previous me.bin scan
might still be there, which could lead to the wrong
me.bin being found.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-11 10:55:18 +01:00
Leah Rowe
07cda7fa12 vendor.sh: remove unnecessary rm -Rf command
this file being deleted was never created.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-11 10:53:38 +01:00
Leah Rowe
4999a49de3 xbmk: don't use backticks for command substitution
the newer way handles escaped characters better, and it
can be nested more easily. it's also more readable.

personally, i prefer the old way, because it's more
minimalist, but it occurs to me that a lot of people
nowadays don't know about backticks, but they do know
of the modern way.

to make the code more readable, i have modernised it.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-11 10:29:59 +01:00
Leah Rowe
5cfe54b06d Revert "inject.sh: put tmpromdel in xbtmp, not cache/"
This reverts commit a444910bf2.
2025-09-09 19:59:46 +01:00
Leah Rowe
269fa65b93 init.sh: write-protect the lock file on startup
you can still remove it with the -f flag on rm, but
xbmk only does that on exit from the main parent
instance, or after each build stage in release.sh

because of this, the user could still manually override
the lock file; this would cause running instances of lbmk
to restart wrongly as parent instances.

there's no way to fix any of this, but users don't normally
put -f in their rm commands.

however, this is also a preventative bug fix. if a bug
is ever caused in the future, where the lock file is
created erroneously, the write protection will prevent that,
so long as *it* is still done.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-09 11:56:36 +01:00
Leah Rowe
a00f4153c6 Revert "vendor.sh: put _pre_dest in xbtmp, not cache/"
This reverts commit 69934d18cc.
2025-09-07 19:13:50 +01:00
Leah Rowe
2873ed5e7e Revert "vendor.sh: put appdir in xbtmp"
This reverts commit 4c74311eae.
2025-09-07 19:13:36 +01:00
Leah Rowe
53491bdca2 tree.sh: don't combine remkdir/cd gnupath
it's stupid. separate them, to make the code readable.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-07 17:49:12 +01:00
Leah Rowe
c4cd9c08df release.sh: delete xbmkwd on src tarballs
the previously deleted tmp/ directory was a relic
from prior to recent tmpdir changes.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-07 17:45:36 +01:00
Leah Rowe
4c74311eae vendor.sh: put appdir in xbtmp
do away with redundant variable "vendir"

the "appdir" directory is for files extracted from
vendor updates, which are then further processed to
create the real files that we need, such as me.bin
images processed via me_cleaner.

thus, appdir should go in xbtmp.

the appdir currently clutters vendorfiles/, which is
not ideal.

we want it to be that the vendorfiles/ directory only
contains the final firmwares.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-07 17:34:24 +01:00
Leah Rowe
a444910bf2 inject.sh: put tmpromdel in xbtmp, not cache/
cache/ is meant for permanent cached files, not for
temporary files.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-07 17:28:19 +01:00
Leah Rowe
69934d18cc vendor.sh: put _pre_dest in xbtmp, not cache/
XBMK_CACHE (cache/) is meant for permanently cached
files, not temporary files.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-07 15:26:35 +01:00