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>
the new order more reliably indicates which order
everything is executed in, by virtue of the functions
provided in each file.
Signed-off-by: Leah Rowe <leah@libreboot.org>
the new loop is incredibly novel in nature, and will
break if anyone but me ever touches it. it also
reduces sloccount by two lines.
i did it because i can, and it's perfectly safe.
Signed-off-by: Leah Rowe <leah@libreboot.org>
literally the point of -p in mkdir is to, you know,
check whether the directory already exists
unclear thinking = unclear code
Signed-off-by: Leah Rowe <leah@libreboot.org>
it occured to me that this style of check was bad. it
only works when checking if both variables are set
my bad
Signed-off-by: Leah Rowe <leah@libreboot.org>
pointless function. literally pointless. it is literally
the most pointless function ever written in the history
of functions. literally pointless in every possible way.
Signed-off-by: Leah Rowe <leah@libreboot.org>
this removed the need to check it in xbmk_set_version
as it calls update_xbmkver, which in turn performs
the same check.
this increases the general reliability and safety of
xbmk when recording its own version after update.
Signed-off-by: Leah Rowe <leah@libreboot.org>
we don't pull anything from supermicro's site.
we did briefly, in an earlier port for that
one supermicro board.
don't maintain dead code. dead code has one purpose:
be deleted.
Signed-off-by: Leah Rowe <leah@libreboot.org>
i will be adding chromebooks, but not using this script,
which is why i never finished the script. i previously
had the plan to patch upstream coreboot, by importing
patches from mrchromebox, but that results in an extreme
number of patches. several hundred patches, in fact.
more efficient is to add multi-upstream support in
include/get.sh, for using different upstreams including
forks, on a given multi-tree project. i haven't done
this yet, but this is what will be done, and then
adding each chromebook will be a matter of importing
configs from mrchromebox alongside edk2 integration.
a script will still need to be written, for the initial
import, and imported chromebooks will be set release=n
until and when each target is fully tested.
Signed-off-by: Leah Rowe <leah@libreboot.org>
infinite loop detection was here before. i removed it
because it was bloat. we don't take general user input
here, so careful configuration is all we need.
infinite loops are harmless to the user. they are merely
annoying. they would never be introduced to the user,
because configs are always tested before release.
before commit, even.
we can save the user a few watts of electricity, or we
can Keep It Simple.
Signed-off-by: Leah Rowe <leah@libreboot.org>
this one is unnecessary, because we're not taking general input
from the user. we mitigate this carefully by being, you know,
careful.
implementing the TODO would have bloated the code, in ways that
might only introduce other serious bugs.
the current logic is fine, and great care will always be taken
by me to keep the code safe, while i'm in charge.
Signed-off-by: Leah Rowe <leah@libreboot.org>
only the author date was being set before
with this change, at least on my system, i
now get the same commit ID and date each time
on the following test:
NOTE: . is lbmk (main work directory)
NOTE: here, we are copying the current clone
git clone . lbmktest
cd lbmktest
./mk version
rm -Rf .git
./mk version
git log
same output each time. we have thus eliminated
timestamps as a variable. this is but a part of
in a series of changes that will eventually lead
to libreboot being built reproducibly.
Signed-off-by: Leah Rowe <leah@libreboot.org>
don't even call the date util at all, to fix the
portability issues. now we don't need GNU date
anymore.
git itself can just take an epoch, and it will
do whatever it will do. yes.
Signed-off-by: Leah Rowe <leah@libreboot.org>
even if i unset PATH before running lbmk, it is
reinitialised because of the shebang. if no PATH
exists, then it's either a broken system and you
have bigger problems, or you have some weird
system that uses something else.
our job is not to fix the world. there was no
scenario in which this check would even trigger
an error or fallback, so just remove it.
Signed-off-by: Leah Rowe <leah@libreboot.org>
i've been careful to makely only use it on AND operations,
not onse that use OR. a lot of blocks are not condensed,
unlike previously when this design was used.
i removed the condensed design because it made the code
allegedly easier to read, but i found it harder to read
and found the code looked dirty. this change makes it
clean again, but i've done it in a way where the shorthand
conditional statements are easy to understand for most
people. this strikes a compromise; i would go further.
Signed-off-by: Leah Rowe <leah@libreboot.org>
use the simpler logic recently introduced, generalised
but it only sets variables to empty. this is safer than
the previous design, and brings the same reduction in
sloccount overall since i wasn't doing anything other
than emptying variables anyway, when it was used before.
i didn't like the long list of variables inside files,
so this makes everything more readable.
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>