summaryrefslogtreecommitdiff
path: root/mk
AgeCommit message (Collapse)Author
2025-04-13mk check_project_hashes: handle error on sha512sumLeah Rowe
We can't do set -o pipefail in POSIX sh, which we're using, but the build system has x_ which wraps around a command and executes it, exiting with non-zero status if it does. This fact enables lbmk to have functionality that is actually superior to pipefail, since you can more easily control specifically which parts error. For example: foo | bar | foo2 | bar2 | $err "error" ERROR exits with non-zero status, but foo2, bar and foo would not exit on error, only bar2 would. In *bash*, which we avoid, set -o pipefail would make all of them exit on error, but what if you wanted "bar" to not exit? With lbmk, you could do, in the above example, and with the above question asked ("what if you wanted bar not to exit"): x_ foo | bar | x_ foo2 | bar2 > file | $err "error" of course, you could also do, if not outputting to "file": x_ foo | bar | x_ foo2 | x_ bar2 NOTE: in lbmk, $err is a variable containing the name of a function that does something (whatever you want) and then exits with non-zero status. This entire explanation is beyond the scope of simply providing (and explaining) this fix, but I also wanted to use this commit as an example of the power of lbmk with regards to POSIX shell scripting. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-04-13mk: use eval to run mkhelp commandsLeah Rowe
directly quoting it and running it quoted means that the shell way try to execute it as a file. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-04-12mk: tidy up the switch/case block in main()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-04-12mk: tidier error handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-04-12mk: Remove unnecessary argument checks on trees()Leah Rowe
These checks are no longer necessary, because these checks are already properly handled in main(). Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-04-12remove xbmk_parent, handle forking in lib.shLeah Rowe
I was using a complicated method of knowing whether the current instance was parent or a child, to know whether the lock file and TMPDIR needed to be purged. It was quite error-prone too. Instead, I'm now handling it directly from within the if statement that previously initialised xbmk_parent=y, forking ./mk from there. The forked instance would not trigger that if clause again, since then TMPDIR is created, thus avoiding recursion. This is an improvement because it doesn't rely on how the parent handles exit statuses, and it ensures that the lock/tmp files are never accidentally deleted. Even if a given program/script that lbmk runs would export TMPDIR, it doesn't matter because lbmk doesn't, so it would be unaffected. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-04-12mk: minor cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-04-12script/trees: merge with mk and delete script/Leah Rowe
script/ no longer exists. this means that the only executable script in lbmk is now mk. script/trees was never called directly; instead, we used ./update trees in the past, then just ./mk. this is part of a larger audit to simplify lbmk, in preparation for the next Libreboot release. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-04-12mk: remove the legacy "roms" commandLeah Rowe
we don't need it. the documentation only tells you now to run ./mk -b coreboot target1 target2 etc Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-04-12move build to mkLeah Rowe
i'm removing all the backward-compatibility in the build system, so that only the ./mk command is available Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-22support ./mk in place of ./update treesLeah Rowe
it's a shortcut command. a new symlink. ./update trees -b flashprog can instead do: ./mk -b flashprog Signed-off-by: Leah Rowe <leah@libreboot.org>