summaryrefslogtreecommitdiff
path: root/include/tree.sh
AgeCommit message (Collapse)Author
10 dayssplit up include/Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysxbmk: remove xbmkdir()Leah Rowe
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>
12 daysmore cleanupLeah Rowe
this will be the last time, i promise Signed-off-by: Leah Rowe <leah@libreboot.org>
12 daysmore cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
12 daystree.sh: remove redundant TODOLeah Rowe
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>
12 daysxbmk: re-introduce condensed if statementsLeah Rowe
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>
13 daysxbmk: reintroduce setvar as newvar (init only)Leah Rowe
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>
14 daysRevert "xbmk: general code cleanup"Leah Rowe
This reverts commit 1b65e8914c4ad1e140b573fa6bc8feead14542ad. 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>
2026-07-30xbmk: general code cleanupLeah Rowe
make the code much easier to read i also cleaned up the recent git identity check Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-03-29Revert "lbmk: use mkhtemp in libreboot's build system"Leah Rowe
This reverts commit e54862fcccca0325da8ae2879c1fa965267d3df0. nope. not ready yet. will fix it later.
2026-03-29lbmk: use mkhtemp in libreboot's build systemLeah Rowe
i added a fake -t option, which doesn't actually read optarg, so that -t usage can just override the normal template. mkhtemp isn't ready for distros yet, but it's ready for lbmk. i hacked the makefile to also copy the binary to mktemp, and i set PATH in lbmk so that this binary is used insttead of the one on your system. that way, upstream projects use it. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-11-15tree.sh: tidy up check_gnu_pathLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-17Revert "get.sh: make forcepull a macro"Leah Rowe
This reverts commit b3232a7c4a6466381d798d7beda56fd020d86d54.
2025-10-17get.sh: make forcepull a macroLeah Rowe
: Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-17tree.sh: unify -f/-F in case/switch handlingLeah Rowe
they're the same commands, but -F does forcepull Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-17tree.sh: convert do_make into a macroLeah Rowe
use it similarly to if_dry_build/if_not_dry_build there is nothing cooler than an sh macro : Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-16xbmk: sort global variables alphabeticallyLeah Rowe
also separate some of the special ones. this makes the variables easier to read/find. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-07tree.sh: add missing -F flagLeah Rowe
i support -F, but didn't include it in the actual getopt string. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-06rom.sh/tree.sh: clean up if_not_dry_buildLeah Rowe
the way it was used is messy, and a relic of the old chained command coding style, from before when i recently loosened that requirement. the new focus is simple, readable code, regardless of size. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-06rom.sh: use if_dry_build macroLeah Rowe
instead of checking if_not_dry_build. use it here the same way. yes. shell script macros. it's how i roll. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-04xbmk: don't call mkdir. use xbmkdir (new function)Leah Rowe
xbmkdir checks if a directory exists, before running mkdir, and then still uses -p i was testing xbmk on arch linux today, and noticed that it errored out when a directory already exists. i'm mitigating against buggy or differently behaving mkdir implementations this way, by wrapping around it. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-04xbmk: use sbase sha512sum, not host sha512sumLeah Rowe
the --status flag seems to be a GNUism as stated in the previous commit, i import sbase suckless now, so as to have a consistent implementation of sha512sum. this ensures that its output is reliable, when i'm using the output of this command within backticks. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-04tree.sh: rename xtree to xgcctree, for clarityLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-04tree.sh: rename btype to buildtype, for clarityLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-04tree.sh: rename _f to flag, for code clarityLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-04xbmk: rename the "dry" variable to if_not_dry_runLeah Rowe
and add a line break where it is used now it is essentially a macro of sorts, used in terms of syntax, to mean the same as: if [ "$dry" != ":" ]; do thing fi in this case, we say: $if_not_dry_build \ thing yes. macros in sh are a thing. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-04xbmk: remove even more eval statementsLeah Rowe
in one or two cases, the use of eval is retained, but modified so as to be safer. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-04xbmk: remove the setcfg functionLeah Rowe
this allows me to remove several eval calls, and the errors relating to configs can now show exactly which function they occured in, allowing for easier debugging. once again, eval should be used sparingly if at all. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-04xbmk: clean up a few err callsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-04xbmk: general cleanup: unroll condensed code linesLeah Rowe
i overlooked a number of lines, during previous cleanup Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-02tree.sh: remove superfluous eval statementsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-01get.sh: allow force-pull via -F instead of -fLeah Rowe
use of ./mk -F behaves the same as -f before the previous commit. this can be useful, during development when we want to update revisions. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-01tree.sh: break up check_gnu_path to subfunctionsLeah Rowe
this whole check could probably be removed, honestly. it was only put in place during the debian trixie testing release cycle, before they finally updated gnat just before the stable release of trixie came out. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-26xbmk: tidy up some if statementsLeah Rowe
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-24make notices a bit more readableLeah Rowe
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-24xbmk: cleanup of recent code refactoringLeah Rowe
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-23tree.sh: unroll condensed commandsLeah Rowe
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-18Revert "xbmk: don't use backticks for command substitution"Leah Rowe
This reverts commit 4999a49de39667b3239fc2010d0e99c958b29417.
2025-09-14tree.sh: fix bad variable referenceLeah Rowe
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-13xbmk: much more verbose error messagesLeah Rowe
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-11xbmk: don't use backticks for command substitutionLeah Rowe
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-07tree.sh: don't combine remkdir/cd gnupathLeah Rowe
it's stupid. separate them, to make the code readable. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-07init.sh/tree.sh: put PATH dirs in xbtmpLeah Rowe
e.g. gnupath, xbmkpath these currently go in XBMK_CACHE/, which is bad because they're meant to be temporary. XBMK_CACHE is for permanent files. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-04Revert "get.sh: put tmpclone dirs in xbtmp"Leah Rowe
This reverts commit 01a779d4ebcdfc7df406263aeb1dffb800eb0220. This commit broke ./mk -d coreboot for vendor files in lbmk.
2025-09-04Revert "tree.sh: add missing colon at the end of trees()"Leah Rowe
This reverts commit 568887cd5efd5df519c7f4f593300eb3ae2beaae. This commit broke ./mk -d coreboot for vendor files in lbmk.
2025-09-02tree.sh: add missing colon at the end of trees()Leah Rowe
this is because when using chained commands at the end of functions, sometimes you have to explicitly terminate the line. the way i do it in this patch is common across the build system, to mitigate this sh quirk. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-02get.sh: put tmpclone dirs in xbtmpLeah Rowe
and generate them, don't hardcode them - this reduces the chance of race conditions, which we have seen in the past and which current execution flow in xbmk even mitigates in a few places, by doing things in a certain order. this change makes the code more robust and easier to maintain. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-08-23tree.sh: tidy up check_cross_compilerLeah Rowe
group related operations together, without whitespace. declare all variables at the start of the function. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-08-23tree.sh: don't re-check xgcc needlesslyLeah Rowe
instead, create a file indicating that a given xgcc target had already been built successfully, within a given coreboot tree. this will considerably speed up the building of release archives, especially when there are a lot of boards. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-08-23tree.sh: check xgcc AFTER checking elfdirLeah Rowe
if e.g. elf/coreboot/default/w500_16mb contains readied images from before, crossgcc is still being checked. if you already built all the coreboot images, and wanted to just modify all the payloads for example, this would result in a much slower re-build process, because it is needlessly re-checking crossgcc every time. by doing it this way, we need up the testing of payloads quite considerably, during xbmk development. Signed-off-by: Leah Rowe <leah@libreboot.org>