summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
7 daystree.sh: add sha512 error for check_project_hashesHEADmasterLeah Rowe
handle errors on sha512sum - also handle awk errors inside the mini subshell, and provide overall error handling. we know that the project.hash file should always exist, and always be read no matter what; technically, the find command that proceeds it might not yield any results, but an empty file would then be produced. the edge case of an empty file would have lead to an error beforehand, when configuring the project in function, configure_project(), so we've already got that covered. Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daystree.sh: add error check in check_project_hashes()Leah Rowe
when reading old_pjhash, we need to error out where a read error occurs. such an error is unlikely, but could occur under certain edge cases. Signed-off-by: Leah Rowe <leah@libreboot.org>
8 daysRevert "inject.sh: simplify remktar()"Leah Rowe
This reverts commit 28f03d39cb1a7cfa8db46b3875557a530aebdd46. The commit that this reverts, broke building release roms. Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daystree.sh: simplify configure_project()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daysvendor.sh: simplify getfiles()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daystree.sh: simplify check_autoconf()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daystree.sh: more reliable clean in run_make_commandLeah Rowe
Don't do no-op if it fails; fall back to "clean" instead, and fail if that fails. The no-op was there was not all projects have distclean, but we do intend for them all to be cleaned. We mitigate further error by only running make-clean if a makefile exists. Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daystree.sh: condense build_targets()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daystree.sh: condense configure_project()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daystree.sh: simplify build_targets()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daystree.sh: simplify handle_defconfig()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daystree.sh: simplify build_project()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daysxbmk: simplify a few err callsLeah Rowe
many of the messages are redundant, because errors caused by the commands they handle would produce similar messages. Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daysrom.sh: simplify check_coreboot_utilLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daysinject.sh: simplify remktar()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daysinject.sh: simplify. and remove unnecessary checkLeah Rowe
checking whether archivename is empty isn't needed, because the case/switch afterward would catch this condition. Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daysinject.sh: add missing semicolonsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daysinject.sh: condense check_releaseLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daysinject.sh: remove unnecessary checkLeah Rowe
we don't handle single images anymore, so we don't need to check for it at all. Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daysvendor.sh: fix bad cbfstool pathLeah Rowe
i overlooked this one in the previous commit there is always one. Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daysput coreboot utils in elf/coreboot/TREELeah Rowe
not elf/UTIL/TREE This way, they are automatically deleted when a tree has to be re-built. Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daysrelease.sh: use printf to create version filesLeah Rowe
Don't copy the files directly, because we might be doing this from a work directory that has no files; in this case, generic "unknown" variables are used, without generating any files, so the current logic would produce an error. However, we do need to create those dot files, because we then rely on them for building release binaries. The new logic maintains current behaviour, while fixing this technical edge-case scenario via mitigation. Signed-off-by: Leah Rowe <leah@libreboot.org>
10 dayslib.sh: simplify setvars()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
10 dayslib.sh: simplify chkvars()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysget.sh: simplify fetch_project()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysget.sh: simplify try_copy()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysget.sh: tidy up bad_checksum()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysget.sh: simplify fetch_targets()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysgeneral cleanup in get.sh and vendor.shLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysxbmk: rename xbmklocal/xbmktmp variablesLeah Rowe
shorten them Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysget.sh: consolidate printf statementsLeah Rowe
stick it in git_prep, which both single- and multi-tree projects will use, when downloading git repositories. Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysget.sh: remove redundant printf in fetch_projectLeah Rowe
The following execution will result in another printf that says exactly what is being downloaded. There is no need to inform the user twice about what is being downloaded. Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysget.sh: remove superfluous command in try_git()Leah Rowe
A git-pull is performed immediately after git-fetch. Git-pull already performs git-fetch as a prerequisite. Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysvendor.sh: simplify fetch()Leah Rowe
the checks at the end of the function are mostly superfluous, because bad_checksum() is immediately called just beforehand, and performs the same checks. Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysinit.sh: error out if .git/ is a symlinkLeah Rowe
the current behaviour is a relic from the older lbmk design, before recent auditing. the current logic would cause xbmk to continue execution, going into a child process with .git/ being a symlink. The .git/ directory should never be a symlink, because it is extremely error-prone. Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysget.sh: Properly error out if tmpclone failsLeah Rowe
We rely on a non-zero exit on other try_ commands, which works fine there because we then check the file afterward and error out accordingly. For git repositories, we assume that both mirrors are identical and therefore once we get to the first clone attempt, we assume that it must succeed. Therefore, if it does not succeed, we must fail. This fixes a regression I found in testing, where sometimes a failed patching attempt would not result in an error exit, and would therefore result in broken sources being present. In practise, I always very closely watch the terminal when testing xbmk, especially when updating project patches, so we probably didn't introduce any broken sources in practice. Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daystree.sh: Don't auto-run make-oldconfigLeah Rowe
This code was introduced to provide fault tolerance, so that if I forgot to manually update the configs myself, builds would still succeed, e.g. coreboot builds. However, there have been cases in the past where this introduces settings we don't want, and in general we do want to know when there is an error in the configs. The policy should always be: fail early, fail hard. This also mitigates bugs in U-Boot's build system; for example, when I last attempted to update the U-Boot tree for x86, make-oldconfig introduced a lot of junk settings unrelated, which then introduced code that would brick the board if you tried it on one, e.g. it broke booting most Linux kernels via bootflow. With this change, U-Boot will be easier to handle, which normally requires manual configuration; the automated make-oldconfig reconfiguration feature breaks U-Boot. This will no longer occur, since we no longer run it manually. On the other hand, this feature has also prevented other disastrous bugs in the past, such as when I forgot to properly set the SPD size on T480; it was set to 256 bytes, not 512 as is correct. Therefore, this new design change means I must also be more vigilant about config changes in project trees. Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysrom.sh: simplify mkcoreboottar()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysrom.sh: rename mkvendorfilesLeah Rowe
it mainly does general tasks, like handling utils and enabling ccache. the vfiles are a small part. rename the function accordingly. it is called by premake, so let's call it corebootpremake. this change will also make sense when cherry-picked into cbmk, which does not handle vfiles at all. Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysrom.sh: simplify ccache handling for corebootLeah Rowe
we simply do not need to run the make-oldconfig command at all, and after removing it, the "cook" function seemed quite redundant so i merged it with mkvendorfiles() Signed-off-by: Leah Rowe <leah@libreboot.org>
11 daysrom.sh: simplify u-boot payload handlingLeah Rowe
define it with a single variable, rather than several. this allows several checks to be greatly simplified. Signed-off-by: Leah Rowe <leah@libreboot.org>
14 daysget.sh: Always update git remotesLeah Rowe
Right now, if cache/clone/PROJECT/ already exists, the logic for pulling new changes doesn't execute, and neither does the logic for updating remotes. This is bad when updating revisions, because then manual updating is required, defeating the purpose of xbmk's own automation in this regard. Fix it by only checking the cached download on files, not Git repositories; the try_git function itself will already perform this check, before updating remotes and pulling in new commits from upstream. The updating only happens when a given target directory doesn't exist, e.g. src/flashprog/ or src/grub/default/, so this won't slow down release builds for example. Signed-off-by: Leah Rowe <leah@libreboot.org>
14 daysget.sh: re-generate remotes every timeLeah Rowe
that way, when a remote changes in config/, it will be updated automatically, without user intervention. Signed-off-by: Leah Rowe <leah@libreboot.org>
14 daysrelease.sh: copy version files to rsrcLeah Rowe
Otherwise, an "unknown" version number is created. This regression was caused by the recent optimisation that reduces the amount of extra work done by init.sh on child instances of xbmk. As a result of those changes, now release.sh has to do some minor initialisation of its own, such as this. Signed-off-by: Leah Rowe <leah@libreboot.org>
14 daysvendor.sh: add colon at the end of a for loopLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-22rom.sh: skip copyps1bios on dry buildsLeah Rowe
otherwise, ./mk -d (without arguments) will fail. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-22tree.sh: Don't run make-clean on dry runsLeah Rowe
Otherwise, ./mk -d (without arguments) fails for GRUB, which first requires running autoconf to get a Makefile. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-20Revert "vendor.sh: optimise find_me()"Leah Rowe
This reverts commit fb7aaa78bb080a473bdf0edf449bf08045e8366c. it caused a few issues. will re-do later the old code isn't really broken, just inefficient, because several files are scanned twice, but in practise the overhead isn't that great The error occurs sometimes, when bruteforcing me.bin: ERROR ./mk: Unhandled error for: mv /home/user/lbmk/tmp/me.bin /home/user/lbmk/cache/tmpdl/check This revert should fix the issue, for now.
2025-05-20vendor.sh: optimise find_me()Leah Rowe
i'm adding characters to 7ztest, which isn't being passed on through because everything runs in subshells; the next pass would default back to the original string, so a given file may be checked multiple times. fix this by mitigation; use the random string from mktemp as a suffix instead. in practice, this has not affected performance much, but it will nevertheless avoid unnecessary work by xbmk. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-19get.sh: add missing check in fetch_project()Leah Rowe
we check the main url, but not backup urls. this patch fixes that oversight. Signed-off-by: Leah Rowe <leah@libreboot.org>