summaryrefslogtreecommitdiff
path: root/script
AgeCommit message (Collapse)Author
3 dayslbmk: allow easier sync with cbmkLeah Rowe
an equivalent change has been made in cbmk. certain lbmk-specific variable names have been made generic, with certain functions and other variables moved around. i maintain sync between libreboot and canoeboot, where both projects can have the same behaviours, and most of the merge conflicts have to do with variable names containing "LBMK", "lbmk", "cbmk" or "CBMK", or indeed "canoeboot" and "libreboot" LBMK/lbmk/CBMK/cbmk variables between canoeboot and libreboot now contain the string XBMK/xbmk it should now be *much* easier to merge build system changes between lbmk and cbmk. Signed-off-by: Leah Rowe <leah@libreboot.org>
4 daysremove help commands (user should read docs)Leah Rowe
i always say, code should never document itself. that's what documentation is for. the releases contain documentation under docs/ but the git repository does not; for that, use the website. (in practise, lbmk usually needs internet anyway) Signed-off-by: Leah Rowe <leah@libreboot.org>
4 daysremove check_project() (always set variables)Leah Rowe
in lbmk, we call check_project() to set variables such as projectname, version, version date this is unnecessary, because all main scripts use this functionality anyway do it by default Signed-off-by: Leah Rowe <leah@libreboot.org>
4 daysbuild/roms: clean up tarball handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
4 daysbuild/roms: create full release tarball nameLeah Rowe
set relname from option.sh under check_project() now the release logic simply has to move a directory Signed-off-by: Leah Rowe <leah@libreboot.org>
4 daysunified sha512sum creation for tarballsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
4 daysmove rom tarball creation to script/romsLeah Rowe
export LBMK_RELEASE="y" if this is done, the tarball is created instead of a directory, and the rom images are nuked using ./vendor inject with the nuke option, inserting the correct version files; the rom directory is deleted now the release script logic simple renames existing tarballs. the benefit of this change is fewer lines of code, and now lbmk doesn't use an insane amount of disk space when building a *lot* of release images (the uncompressed directories are deleted after each build) Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysremove all status checks. only handle release.Leah Rowe
the release variable is all we need, turning a target on or off for a given release. the status checks were prone to bugs, and unnecessary; it also broke certain benchmark scripts. it's better to keep the lbmk logic simpler. board status will be moved to the documentation instead. Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysmove script/*/* to script/Leah Rowe
there are only two scripts under script/ now, and there probably won't be many more. lbmk's design has simplified to such a degree that the two-level directory structure is no longer necessary. the existing command structure has not changed. for example: ./build roms list ./update trees -f coreboot default these will still work, but the symlinks to "build" are now strictly for backwards compatibility; they may be removed at a later date, but i'll keep the current design for now. this also leads to a quirk, for example: ./build roms all ./update roms all these now do the exact same thing, whereas "./update roms all" would have previously been an invalid command. Signed-off-by: Leah Rowe <leah@libreboot.org>
7 daysmerge script/vendor/* into include/vendor.shLeah Rowe
stub it from the main build script the commands remain identical: ./vendor download arguments_here ./vendor inject arguments_here Signed-off-by: Leah Rowe <leah@libreboot.org>
8 daysmerge script/update/release into buildLeah Rowe
the main script isn't that big, and since the main purpose of lbmk is geared toward the releases, it makes sense to reduce the number of scripts by merging into the main one the way this works, "./update release" still works afterward so, the way lbmk is used shall remain unchanged Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daysbuild/roms: print serprog helpLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daysmerge script/build/serprog with script/build/romsLeah Rowe
previous command: ./build serprog now it is: ./build roms serprog after that, it's the same arguments e.g. ./build roms serprog stm32 ./build roms serprog rp2040 further cleanup to commence Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daysbuild/roms: remove unnecessary commandLeah Rowe
there is no need to return 0 at the end of a function. sh does that anyway Signed-off-by: Leah Rowe <leah@libreboot.org>
12 daysmerge include/err.sh with include/option.shLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
13 daysbuild/roms: don't rely on x in handle_targetLeah Rowe
x is part of the for loop in main() and may or not still be available from handle_target, depending on your implementation of sh, but this should not be assumed do it properly Signed-off-by: Leah Rowe <leah@libreboot.org>
14 daysbuild/roms: don't use exit status from skip_boardLeah Rowe
the printf could potentially return non-zero, which might make the script not skip a given target Signed-off-by: Leah Rowe <leah@libreboot.org>
14 daysbuild/roms: split up main()Leah Rowe
it's starting to get a big big, so break it up Signed-off-by: Leah Rowe <leah@libreboot.org>
14 daysbuild/roms: allow searching status by mismatchLeah Rowe
for example: ./build roms list stable this lists all images that are marked "stable" now: ./build roms list _stable this lists all images that are *not* marked stable this will help me keep track during development Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-04Libreboot 20240504 release20240504Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-04build/roms: more useful status warningsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-03update/release: purge test/lib/strlcat.c in u-bootLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-03update/release: say when an archive is being madeLeah Rowe
without this change, the user might think lbmk crashed Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-29build/roms: simplified list handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-28build/roms: if release, allow all non-broken romsLeah Rowe
this includes untested roms Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-28build/roms: always display warningsLeah Rowe
(even if status=stable) Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-28build/roms: reduce indentation in skip_board()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-28build/roms: simplified status handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-28build/roms: simplified seagrub handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-28build/roms: support SeaGRUB *with menu enabled*Leah Rowe
This is useful on desktops, where you want GRUB to automatically start, but you still want access to the GRUB menu, in the case where you rely on SeaBIOS to execute the VGA ROM inside your graphics card. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-28update/trees: simplified defconfig copyingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-27update/release: disable status checkingLeah Rowe
just to ensure that nothing goes wrong. we don't rely on the status variable for releases, because there is another variable, release, that target.cfg files declare, e.g. release="n" release="y" you can just omit the variable, because it defaults to y, so you only need declare it when it needs to be "n" Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-27build/roms: tell the user how to ignore statusLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-27allow disabling status checks during buildsLeah Rowe
export LBMK_STATUS=n if not set, the status checks and confirmation dialogs persist. if set to y they persist. if you set it to n, all checks are disabled, so e.g.: ./build roms all this would once again build all targets, regardless of status. this is if you want the old behaviour. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-26build/roms: update help, pertaining to statusLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-26build/roms: let "list" specify status typesLeah Rowe
for example: ./build roms list this will list every now, still. same behaviour. now see: ./build roms list stable this will list all stable roms ./build roms list untested this lists untested roms. but wait! ./build roms list untested broken unstable ./build roms list broken unstable yes. it works this way. now you can use lbmk to easily see what rom status are, during maintenance. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-26erroneous returnLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-26build/roms: report status when building imagesLeah Rowe
export LBMK_VERSION_TYPE=x x can be: stable, unstable in target.cfg files, specify: status=x x can be: stable, unstable, broken, untested if unset, lbmk defaults to "unknown" if LBMK_VERSION_TYPE is set, no confirmation is asked if the given target matches what's set (but what's set in that environmental variable can only be stable or unstable) if LBMK_RELEASE="y", no confirmation is asked, unless the target is something other than stable/unstable "unstable" means it works, but has a few non-breaking bugs, e.g. broken s3 on dell e6400 whereas, if raminit regularly fails or it is so absolutely unreliable as to be unusable, then the board should be declared "broken" untested means: it has not been tested With this change, it should now be easier to track whether a given board is tested, in preparation for releases. When working on trees/boards, status can be set for targets. Also: in the board directory, you can add a "warn.txt" file which will display a message. For example, if a board has a particular quirk to watch out for, write that there. The message will be printed during the build process, to stdout. If status is anything *other* than stable, or it is unstable but LBMK_VERSION_TYPE is not set to "unstable", and not building a release, a confirmation is passed. If the board is not specified as stable or unstable, during a release build, the build is skipped and the ROM is not provided in that release; this is in *addition* to release="n" or release="y" that can be set in target.cfg, which will skip the release build for that target if "n" Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-25build/roms: add missing deletion of tmp fileLeah Rowe
the temporary rom per build was not being deleted after finishing the current target. this adds up in /tmp during large builds, when building for many targets. fix this! Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-04-24haswell: only provide NRI-based ROMs in releasesLeah Rowe
release="n" is set in target.cfg on haswell build targets that use mrc.bin script/update/release exports LBMK_RELEASE="y" script/build/roms skips building a given target if release="n" in target.cfg *and* LBMK_RELEASE="y" you could also do the export yourself before running ./build roms, for example: export LBMK_RELEASE="y" ./build roms all This would skip these ROM images. The native haswell raminit is now stable enough in my testing, that I wish to delete the MRC-based targets. This is in line with Libreboot's Binary Blob Reduction Policy, which states: if a blob can be avoided, it should be avoided. The problem is that users often run the inject script in *lbmk* from Git, instead of from the src release archive. I forsee some users running this on modern lbmk with older release images. If the mrc-based target isn't there, the user may use an NRI-based target name, and think it works; they will insert without MRC. I foresaw this ages ago, which is why Caleb and I ensured that the script checks hashes, and hashes are included in releases. Therefore: for the time being, keep the MRC-based configs in lbmk but do not include images for them in releases. This can be done indefinitely, but I'll probably remove those configs entirely at some point. On the following boards, Libreboot now will *only* provide NRI-based ROM images for the following machines: * Dell OptiPlex 9020 SFF * Dell OptiPlex 9020 MT * Lenovo ThinkPad T440p * Lenovo ThinkPad W541/W540 I now recommend exclusive use of NRI-based images, on Haswell hardware. It's stable enough in my testing, and now supports S3. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-03-27allow users to specify number of build threadsLeah Rowe
lbmk otherwise uses nproc to set the number of build threads, in these places: * generic make commands in script/update/trees * crossgcc make command in script/update/trees the -T0 option is also used in script/update/release, when running tar. with this change, you can do: export LBMK_THREADS=x where x is the number of threads. when you then run lbmk, your chosen number of threads will override the default. this may be useful on a host that does not have a lot of memory. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-03-27safer, simpler error handling in lbmkLeah Rowe
in shell scripts, a function named the same as a program included in the $PATH will override that program. for example, you could make a function called ls() and this would override the standand "ls". in lbmk, a part of it was first trying to run the "fail" command, deferring to "err", because some scripts call fail() which does some minor cleanup before calling err. in most cases, fail() is not defined, and it's possible that the user could have a program called "fail" in their $PATH, the behaviour of which we could not determine, and it could have disastrous effects. lbmk error handling has been re-engineered in such a way that the err function is defined in a variable, which defaults to err_ which calls err_, so defined under include/err.sh. in functions that require cleanup prior to error handling, a fail() function is still defined, and err is overridden, thus: err="fail" this change has made xx_() obsolete, so now only x_ is used. the x_ function is a wrapper that can be used to run a command and exit with non-zero status (from lbmk) if the command fails. the xx_ command did the same thing, but called fail() which would have called err(); now everything is $err example: rm -f "$filename" || err "could not delete file" this would now be: rm -f "$filename" || $err "could not delete file" overriding of err= must be done *after* including err.sh. for example: err="fail" . "include/err.sh" ^ this is wrong. instead, one must do: . "include/err.sh" err="fail" this is because err is set as a global variable under err.sh the new error handling is much cleaner, and safer. it also reduces the chance of mistakes such as: calling err when you meant to call fail. this is because the standard way is now to call $err, so you set err="fail" at the top of the script and all is well. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-02-25Libreboot 2024022520240225Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-02-07support making u-boot-only tarballs in releasesLeah Rowe
./update release -m u-boot if someone just wants to make u-boot, they can use this and it tars up all the trees. Signed-off-by: Leah Rowe <info@minifree.org>
2024-01-26Libreboot 2024012620240126Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-26update/trees: reset xtree/tree_depend before buildLeah Rowe
in some cases, the build system was needlessly, and sometimes erroneously, creating crossgcc symlinks, which then caused an issue, namely: in lbmk release builds, dell e6400 is build before fam15h boards, and it sets xtree, but fam15h_rdimm doesn't, and later this would cause fam15h_rdimm boards to use xtree="default" (because they don't set xtree), causing the newer toolchain to be used on coreboot 4.11. this patch fixes the issue. quite a simple problem, actually. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-23script/vendor/inject: remove erroneous checkLeah Rowe
the boarddir variable is only set *after* detect_board is run, and is in fact checked after that. this check, removed by this patch, is too early and causes lbmk to exit with error states. this patch fixes the error. the error was that lbmk was then searching for a file that is at an empty path. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-21don't download projects on release archivesLeah Rowe
the changelog file is only present in releases, so use the presence of this file for the test. someone who wants to fetch projects within a release archive can simply use the git repo, or delete the file. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-21update/release: generate changelogsLeah Rowe
use the git log, as follows: git log --graph --pretty=format:'%Cred%h%Creset %s %Creset' --abbrev-commit this creates a nice, uniform list of changes. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-21allow multitree projects to define xgcc treeLeah Rowe
let them specific it, rather than falling back to coreboot/default (can also be used for coreboot boards) Signed-off-by: Leah Rowe <leah@libreboot.org>