note: mecleaner check removed in vendor.sh, because
it's already guaranteed to be fetched. the check will
never indicate failure, so we can just assume that
the me cleaner python script exists.
Signed-off-by: Leah Rowe <leah@libreboot.org>
when calling ./mk, or from PATH, an absolute path
is created to ./mk
this will likely be different than mk, but it might
be a different script. perhaps the operator is making
a copy of the mk script temporarily - obviously not
advised, no, but here we have a problem because then
lbmk is still running ./mk everywhere
run arg0 instead, now called "mk"
./mk is still hardcoded in release.sh, because we
do need to make sure we're using the right script
there
Signed-off-by: Leah Rowe <leah@libreboot.org>
e.g. biosutilities
the subshell screws up error handling. this
patch changes it to old behaviour.
some projects don't have makefiles. the
non-zero exit also prevents further call
to copy_elf when no binaries are created,
as in this example.
Signed-off-by: Leah Rowe <leah@libreboot.org>
the user never runs these. it's not needed. the design
of lbmk already cleans everything, or caches everything,
between builds. everything cached out of tree.
it's not expected to ever need to clean manually, so just
remove the option. knobs are for nobs.
releases don't need it either, because we tar everything
before building, thus eliminating all build artifacts.
we do this on a fresh copy of lbmk on ./mk release
Signed-off-by: Leah Rowe <leah@libreboot.org>
this was the previous behaviour, and prevents
single-tree builds from proceeding with
use of copy_elf
otherwise you get a bunch of build errors
Signed-off-by: Leah Rowe <leah@libreboot.org>
no point using distclean, because the context there
is providing clean sources for distribution, but we
use ./mk release which tars everything up before ever
running any build commands.
make-clean is enough
distclean is a stupid gnuism anyway, and most makefiles
that have it will just do the same as clean anyway
Signed-off-by: Leah Rowe <leah@libreboot.org>
in practise, it was always correct because on projects
that used coreboot xgcc, the tree would always be called
default.
however, this is a bug. the logic uses a correct directory
name for coreboot in src/, but not elf/
this patch makes the two consistent, programattically.
this is therefore a preventative bugfix.
Signed-off-by: Leah Rowe <leah@libreboot.org>
libreboot's policy is to thoroughly clean sources per
build, because we cache builds out of tree and avoid
re-builds if they exist; these and the sources are
deleted if metadata in config/ changes per project,
tree and/or target.
the problem is that this change only affects lbmk.git
it doesn't affect release archives, where project sources
do not have git-init applied to them. this will be
addressed.
can't use it on coreboot, because it will delete xgcc
tarballs in a way currently not handled, and handling
it will mean adding a project-specific hack.
the xgcc tarballs could be built out-of-tree, and this
will have to be done, otherwise coreboot will have to be
made gitclean="y" for now.
everything else is fair game.
Signed-off-by: Leah Rowe <leah@libreboot.org>
yes, make it generalised. use a new variable in
mkhelper.cfg, gitclean and gitcleanargs
not enabled by default, but u-boot enables it. i'm
considering whether to use this by default, as it
is the general policy of lbmk to clean everything
just after a build, as builds are cached out of
tree. this way, we can do re-builds safely for each
project. there are probably a lot of subtle bugs that
might be fixed if we used this
the problem is that this is currently only used on
lbmk.git, but not on libreboot release archives which
lack .git directories; the main one is initialised in
lbmk, but not in upstream sources. we could just initialise
those.
in fact, that is probably what i'm going to do.
Signed-off-by: Leah Rowe <leah@libreboot.org>
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>