summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
6 daysvendor.sh: more cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysvendor.sh: minor cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysvendor.sh: simplify process_release_romsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysvendor.sh: remove unnecessary checkLeah Rowe
the next part checks whether the file is below 512k, so there's no point checking if it's below 2, because the lowest a file size can be is zero, and expr will produce a result of -1 if decrementing from zero. Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysgit.sh: remove unnecessary commentLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysgit.sh: remove link_crossgcc()Leah Rowe
merge it with git_prep Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysgit.sh: remove move_repo()Leah Rowe
merge it with git_prep, since it's only a small function and only called from there. the merged code still makes sense and its purpose is still quite clear on casual reading. Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysgit.sh: remove prep_submodule()Leah Rowe
merge it with git_prep, since it's only a tiny function and only called from there. the for loop moved to the if block still makes sense on casual reading. Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysgit.sh: make git_prep command clearerLeah Rowe
the "u" argument can actually be any thing. git_prep handles git submodules only for single-tree projects, under any candition, or on multi-tree projects if the number of arguments to git_prep is above four. "u" is the 5th argument, meant to enable submodule downloads. it really doesn't matter what this string says, so let's just make it as clear as possible. Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysmrc.sh: Make proper use of variable inside printfLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
7 dayssimplify a few file checksLeah Rowe
the combination of x_ with the "e" function enables for much simpler file-check error handling, which is a unique innovation of lbmk as it pertains to sh. Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysrom.sh: remove unnecessary checkLeah Rowe
the cbfs function will call cbfstool, which will perform the same check, and the same error condition would cause the same exit behaviour in lbmk. the error message would also provide output that is just as useful for debugging. Signed-off-by: Leah Rowe <leah@libreboot.org>
7 dayslbmk: minor cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
8 dayslib.sh mktarball: stricter tar error handlingLeah Rowe
There was no error handling, *at all*, on the actual tar command, due to the lack of set -o pipefail, which we cannot rely on in sh. The x_ wrapper can be used in this case, as a mitigation. Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysvendor.sh: don't err on bruteforce me extractLeah Rowe
it wouldn't exit with error status anyway, since i'm setting +e here, but if that accidentally changed in the future, i still wouldn't want this to exit. the bruteforce me extraction naturally throws a lot of errors, hence +e, because of how the extraction works, but the result is checked at the end of the process, to compensate. hence +e, because otherwise this brute force extraction would never work. therefore, this is an extremely theoretical bug fix, the most quintessential of preemptive bug fixes, to the point that it is actually rather pedantic. The ":" in "|| :" will likely *never* be executed, but it handles the theoretical case where the subshell exits with non-zero status and +e is set; subshells aren't meant to behave this way anyway, but who knows what cursed sh implementation the user is on? Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysmk 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>
10 daysvendor.sh: remove unnecessary xchanged="y"Leah Rowe
in these if clauses, what follows afterward is exactly the same: set xchanged and return. Therefore, these lines are redundant and they can be removed. Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysvendor.sh: set need_files="n" if skipping patchLeah Rowe
This change finally ensures that no insertions will be attempted, on the basis that readkconfig failed; this covers the instance whereby vcfg was set, but no scanned items were indicated e.g. Intel ME files not specified. Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysvendor.sh: Don't handle vendor files if not neededLeah Rowe
This should speed up automated tests. Otherwise, it goes through all the extra checks that aren't needed, for each individual type of vendor file, and also errors out when handling pico serprog images; during automated testing, on the bin directory, you might try on every tarball, one of which is the pico tarball and this patch makes lbmk skip that one too. In general, we must not perform unnecessary tasks. Doing so may even cause other bugs that we couldn't easily detect. Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysRevert "lib.sh: use eval for the command in x_"Leah Rowe
This reverts commit 3bfdecdc75bbc77f795736ac282f858f2eb7ab94. The commit that this reverses, caused sch5545 ec firmware downloads to fail, due to globbing.
11 dayslib.sh: fix bad eval writing resized fileLeah Rowe
x_ cannot be used, where output is redirectod to a file; only the conventional piping can be used. same as the last change. this and the other fix were caught during testing. Signed-off-by: Leah Rowe <leah@libreboot.org>
11 dayslib.sh: fix bad eval writing version/versiondateLeah Rowe
x_ cannot be used, where output is redirected to a file; only the convention piping can be used, for errors. relying on x_ in these cases will cause unpredictable bugs. Signed-off-by: Leah Rowe <leah@libreboot.org>
11 dayslib.sh: use eval for the command in x_Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysmk: 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>
11 daysmk: tidy up the switch/case block in main()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysmk: tidier error handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
11 dayslib.sh: tidy up the error handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysrom.sh: tidy up error handlingLeah Rowe
same as the last change Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysvendor.sh: tidy up error handlingLeah Rowe
x_ can be used nowadays on any function, because it properly handles globbing. Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysvendor.sh: tidy up decat_fspfd()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysgit.sh: clean up fetch_project()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysmk: 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>
11 daysvendor.sh: properly call err_ in fail_injectLeah Rowe
i can't call $err (variable), because it's set to fail_inject. fix this infinite loop, which was an oversight in the previous commit. Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysremove 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>
11 dayslib.sh: define x_ right after err_Leah Rowe
because the top-down function order isn't as reliable in lib.sh, since this is what first runs, included in every other script Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysmk: minor cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
11 dayslib.sh: minor cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysmrc.sh: minor cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysrom.sh: minor cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysvendor.sh: tidy up check_release()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysvendor.sh: tidy up vendor_inject()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysvendor.sh: tidy up readcfg()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysvendor.sh: tidy up patch_release_roms()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysvendor.sh: tidy up process_release_roms()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysvendor.sh: tidy up patch_rom()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysvendor.sh: tidy up inject()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysvendor.sh: tidy up modify_mac_addresses()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysscript/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>
11 daysmk: 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>
11 dayslib.sh: write version/versiondate to dotfilesLeah Rowe
write to .version and .versiondate, instead of version and versiondate. this will hide them to avoid visual clutter while analysing files within lbmk. Signed-off-by: Leah Rowe <leah@libreboot.org>