summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
5 daysmk: tidy up check_cmakeLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
5 daysvariable ./mk location, based on user inputLeah Rowe
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>
5 daysmk: fix check_cross_compiler callLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
5 daysmk: move config back to getoptLeah Rowe
really pointless doing it here. do it in the loop. Signed-off-by: Leah Rowe <leah@libreboot.org>
5 daysfix build error on no-makefile projectsLeah Rowe
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>
5 daysmk: clean up getopt flagsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
5 daysmk: simplify single_tree_buildLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
5 daysRevert "init.sh: re-initialise upstream src .git"Leah Rowe
This reverts commit cf079dbd1775bb6270ee1cd8d36ce6c8aaa5a17c. we don't need it anymore. we don't bother cleaning sources for releases, because tehy're never dirtied. we build using ./mk release which does everything fresh. the git-clean feature was only used on ./mk -c, which was removed because it's not needed for the same reason as above. lbmk always cleans and re-builds everything when metadata changes, otherwise storing builds out of tree in a cache directory. get rid of this dead code. Signed-off-by: Leah Rowe <leah@libreboot.org>
5 daysmk: remove -c and -x commands (clean/xgcc-clean)Leah Rowe
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>
5 daysmk: skip build if makefile check failsLeah Rowe
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>
5 dayssimplified make-clean handlingLeah Rowe
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>
5 dayseven more tidy up run_make_commandLeah Rowe
tidy it all the way up Signed-off-by: Leah Rowe <leah@libreboot.org>
5 daysmk: tidy up run_make_commandLeah Rowe
yeah, this reverses the last change Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysmk: optimise make-clean checkLeah Rowe
only check makefiles if if_not_make_clean is set this avoids unnecessary disk usage Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysmk: remove unnecessary checkLeah Rowe
on dry builds, if_not_make_clean will also be empty Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysmk: abuse an absurd number of sh macrosLeah Rowe
just the right amount of absurd this is why i don't need to use python Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysadd dir checkLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysinit.sh: re-initialise upstream src .gitLeah Rowe
we have git-clean in use for projects, but that only affects lbmk.git now we re-initialise .git in upstream projects, when .git is missing. this ensures consistent cleaning behaviour between lbmk.git and the libreboot releases. Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysmk: use correct elddir for coreboot xgccLeah Rowe
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>
7 daysmk: turn on git-clean by default, except corebootLeah Rowe
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>
7 daysmk: remove u-boot-specific git-clean handlingLeah Rowe
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>
7 daysmk: remove cleanargs from git-cleanLeah Rowe
totally worthless Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysmk: redirect readlink err to /dev/nullLeah Rowe
i had this before. forgot to add it in the new design. oops. Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysmk: ruthlessly simplify findpath()Leah Rowe
i love eval, printf and awk eval, printf and awk are the best things ever Signed-off-by: Leah Rowe <leah@libreboot.org>
7 dayserr even louderLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysmk: further simplify err()Leah Rowe
yes, just awk everything, double-quoted Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysmk: add error check on xbmkpwd initLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysmk: simplified findpath()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysmk: simplified error functionsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysmk: remove xprintfLeah Rowe
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>
7 daysmove findpath and err functions to mkLeah Rowe
otherwise, it's totally broken. i also now include lib.sh later. Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysinit.sh: remove redundant sha512sum initLeah Rowe
it's done in xbmk_init. the initial value is never used. Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysmk: simplify xbmkpwd initialisationLeah Rowe
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>
7 daysmk: include lib.sh earlierLeah Rowe
this means we can now cd to wrkdir using findpath, and it means the cd command can be wrapped in x_ Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysmk: call xbmk_init through x_Leah Rowe
the function never returns 1 at the moment, but this is a useful future trap. Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysmk: run xbmk_init here, not from init.shLeah Rowe
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>
7 daysdelete stragglerLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysmk: remove gcc/gnat matching logic (obsolete)Leah Rowe
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>
7 daysmk: rename trees() to main()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysmerge tree.sh into mkLeah Rowe
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>
7 daysuse -mindepth alongside -maxdepth in findLeah Rowe
use of maxdepth 1 does not exclude the main directory, which is undesired in these contexts, though excluded in practise due to how find is actually used. technically, mindepth should be used, just in case, as a defensive measure. the context here is files and directories within a main directory, used as arguments in other commands. Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daystree.sh: fix globbing in multi-tree command argsLeah Rowe
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>
7 daysmk: clean up printf commandLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysmk: put all includes in one placeLeah Rowe
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>
7 daysmk: simplified command handlingLeah Rowe
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>
7 dayscommon.h: re-order includesLeah Rowe
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>
7 days79 linesLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysuse awk insteadLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysinit.sh: tidy up main loopLeah Rowe
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>
8 dayssplit up include/Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>