totally useless function. all it does is print
quotes. just printf the args into awk
this does literally the same thing. the output
will literally be the same.
unclear thinking == unclear code
right thinking == this patch
Signed-off-by: Leah Rowe <leah@libreboot.org>
do it from mk instead. we don't need to run pwd
anymore, because we just get the path and cd
to it, setting that as the path.
Signed-off-by: Leah Rowe <leah@libreboot.org>
it should be clear on first reading, what the actual
control flow is. hiding the call in init.sh obscures
first reading.
now it is absolutely clear on first reading, that
xbmk_init is called before going through everything
else in mk.
Signed-off-by: Leah Rowe <leah@libreboot.org>
coreboot has this now:
commit c421847fe2fef61586eb313206a4be0f2e491974
Author: Matt DeVillier <matt.devillier@gmail.com>
Date: Mon Dec 29 10:12:17 2025 -0600
util/crossgcc: Fix GNAT detection for gnat-15
this one is advisory instead, telling the user to
create such a symlink as we did. this is much less
invasive.
our own check was bad, because it basically silences
what is otherwise an error. coreboot's approach is
more correct, so we will defer to that instead.
note that this means older coreboot (for fam15h) is
no longer covered, but those trees don't use gnat
anyway as libgfxinit is unused on those targets
this lbmk patch removes 61 sloc of dead code, which
makes me very happy.
Signed-off-by: Leah Rowe <leah@libreboot.org>
mk is so tiny now, and will likely never get
bigger. tree.sh is effectively the main script
now, so let's treat it as such.
i'll start splitting tree.sh instead. e.g.
move gcc setup to its own file.
Signed-off-by: Leah Rowe <leah@libreboot.org>
this solves a bug that does not yet manifest, because
this bug *can't* currently trigger any error due to
lbmk's design. this is therefore a preventative fix,
for reasons that will become clear.
we previously put arguments in a variable, in a way
that didn't handle globbing. now we avoid a variable
and use "$@" instead, which solves the problem.
this also means that the main logic in mk can be
cleaner, as trees-specific control logic is now
placed entirely in tree.sh's main.
this means that we can now also wrap x_ around trees()
this was never a problem in the past, because all of
the arguments for trees commands never have globbing;
config names are always e.g. foo_bar, not foo bar
in commands where globbing did need to be handled,
those commands were never trees commands. e.g.
you had ./mk inject filename
yes, this is a design improvement, or a preventative
bug fix. pick your poison.
Signed-off-by: Leah Rowe <leah@libreboot.org>
the previous design flaw was fixed by recent
refactors, such that i can now . include all
of lbmk at once, and have control logic right
after that.
Signed-off-by: Leah Rowe <leah@libreboot.org>
just do includes in mk again. common.sh was stupidly
small, just pointless.
replace the entire command dispatcher with eval, printf
and awk, because i can, and it further reduces sloccount.
Signed-off-by: Leah Rowe <leah@libreboot.org>
not needed at the moment, since we ensure that
the functions always exit with error under fault
condition. they always return zero.
nevertheless, this might catch some unexpected
behaviour in the future.
Signed-off-by: Leah Rowe <leah@libreboot.org>
we don't need a main here. it's so generic that we
can just leave it really small like it is now. now
it's much clearer what it actually does.
Signed-off-by: Leah Rowe <leah@libreboot.org>
commands now fed from a file, include/common.sh
which in turn also includes other lib files
this makes mk completely generic, and means
that changes will now be completely in sync
with cbmk, ensuring a lack of merge conflicts,
though the file was already pretty small anyway.
Signed-off-by: Leah Rowe <leah@libreboot.org>
i made several modificatinos to several files
thus for in 2026, in the main part of the build system.
i've added 2026 to the ones that i modified.
Signed-off-by: Leah Rowe <leah@libreboot.org>
now you can put lbmk somewhere on your system,
and symlink to the mk script from PATH
e.g. /usr/local/bin/lbmk -> /home/leah/lbmk/mk
lbmk will cd to itself, including from PATH,
because the string will then be passed through
readlink, which gets the real path.
Signed-off-by: Leah Rowe <leah@libreboot.org>
i need only now implement a check for sys dirs
e.g. /etc/lbmk.cfg and check if it defines
e.g. other location for config/ and include/
then mk is a generic dispatcher and i can one
day make mk possible to install. for example, if
you have a bsd ports system and you want to
install lbmk
i could make it check user dirs too, overriding
defaults. for example /usr/local/etc/lbmk, but
then i might have ~/.config/lbmk
you no longer need to be in the xbmk directory
to run xbmk. it'll cd to itself, with this patch
Signed-off-by: Leah Rowe <leah@libreboot.org>
with this new function, i can turn commands on and
off by virtue of config. for now, behaviour is
unchanged, but this new design means i will be
able to disable certain commands in child processes
Signed-off-by: Leah Rowe <leah@libreboot.org>
This reverts commit 1b65e8914c.
NOTE: cleanup of xbmk_git_init was retained
this "cleanup" actually made the code harder to read.
Signed-off-by: Leah Rowe <leah@libreboot.org>
I intend to merge every Chromebook that Mrchromebox supports,
into Libreboot, ready for the Libreboot 25.12 release. Work
is still ongoing, and several changes need to happen in lbmk.
I started working on it a few weeks ago (today is
14 November 2025 as I push this).
Still TODO:
* Automatically create lbmk coreboot targets, based
on the configs present in MrChromebox git
* Re-work git repository management in lbmk, such that
a list of upstreams is used, instead of a hardcoded
list per configuration; this will allow us to use
different remotes across the same project, even where
they diverge. This would then allow us to use the
MrChromebook repository directly, instead of cherry-picking
patches into upstream coreboot
* The note above about remotes would also mean that we can
use MrChromebox's own edk2 repository directly. All of this
would reduce the burden on lbmk.git
* Support building edk2 payloads, exactly mirroring the
setups used on MrChromebox builds
There are some things that need to be checked first, for
boards that use MMC-based or eMMC-based storage, for the
GRUB and SeaBIOS payloads, also U-Boot, because I will
also be using these.
As such, this current script shall sit in lbmk master, but
it is not yet finished.
Signed-off-by: Leah Rowe <leah@libreboot.org>
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>
we check if the first argument is "./mk" and bail if not,
which forces you to be in the xbmk work directory.
however, this check is flawed because symlinks were still
possible.
this patch prevents a same-named symlink "mk" pointing to
the real mk from being used.
this hardening is necessary, due to several built-in
assumptions inherent within the design of xbmk.
Signed-off-by: Leah Rowe <leah@libreboot.org>
we no longer separate them. xbloc was the on-disk
tmp directory, whereas xbtmp used to be in /tmp
which we assumed to be tmpfs (it may not be, but
often is on many workstation setups - and our
documentation recommended doing this).
as mentioned in the previous commit, benchmarking
shows little speed difference using tmpfs /tmp
versus on-disk /tmp, for our purposes at least.
therefore, the handling of tmp files is being
greatly simplified.
Signed-off-by: Leah Rowe <leah@libreboot.org>
it's still not perfect, but now it's unambiguous.
the previous generic check was written based on the
fact that xbmk's main script used to also be called
via several symlinks, which is no longer the case.
Signed-off-by: Leah Rowe <leah@libreboot.org>
it now handles more than just git, and i forsee
it handling even more in the future, e.g. rsync,
ftp, bittorrent.
Signed-off-by: Leah Rowe <leah@libreboot.org>
in cbmk, it's only used from there.
in lbmk, it's also used from vendor.sh.
however, i plan to further expand git.sh at
some point, tidying it up so that git cloning
is also done from xbmkget, with dlop=git and
git.sh would then be renamed to get.sh
Signed-off-by: Leah Rowe <leah@libreboot.org>
to the extent feasible, keep lbmk-specific parts on
inject.sh to a minimum. this will later be used to
re-sync cbmk's inject.sh with lbmk's, because cbmk's
one doesn't handle vendor files.
the way this is designed now, with this patch, will
make cherry-picking lbmk to cbmk easier in the future,
when keeping this part of cbmk in sync with lbmk.
Signed-off-by: Leah Rowe <leah@libreboot.org>
that way, with set -u -e, we aren't risking some
buggy sh implementations from causing an error exit
where it shouldn't.
Signed-off-by: Leah Rowe <leah@libreboot.org>
The idea with mk is that it's meant to basically be a
stub for running everything else, while mainly having
the trees logic within it (what was once script/trees).
Signed-off-by: Leah Rowe <leah@libreboot.org>