summaryrefslogtreecommitdiff
path: root/script/update
AgeCommit message (Collapse)Author
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-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-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>
2024-01-12REMOVE MAINBOARD: lenovo x201Leah Rowe
with neutered ME, fan control fails. while there are ways to mitigate it, many users will not, and will likely see their system overheat, which is very dangerous. this bug (failed fan control on neutered ME) only affects arrandale machines such as lenovo x201. the newer machines are not affected by this. other arrandale machines will probably not be added to libreboot because of this, or they will be subject to further testing. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-01add copyright 2024 leah rowe to edited filesLeah Rowe
i forgot to add 2024 on the copyright years, for my copyright files that i edited on 1 january 2024 Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-01git.sh: unify am/submodule and tree copyingLeah Rowe
do it all in a single function! Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-01git.sh: clean up handling of tmp_git_dirLeah Rowe
delete it once once, and delete it much sooner, right at the start of script/update/trees main() Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-30update/trees: clean up the coreboot-version checkLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-30update/trees: support custom make/autogen argumentLeah Rowe
this is now used in grub, for the FS_PAYLOAD_MODULES option in the make command lbmk should generalise as much logic as possible. in some parts of it, logic is hurrently hardcoded, specific to a given project that lbmk uses, but lbmk is essentially a source-based package manager, like what you might find on a small linux distro, so we need to try to be as generic as possible. lbmk is the "build system of build systems", so it has to work generically with as many of them as possible Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-30update/trees: generic cmake handlingLeah Rowe
it is no longer hardcoded just to be handled for uefiextract. it is now defined as cmakedir in target.cfg, for a single or multi tree project. if multi tree, it is applied to the specific tree, and has to be defined per tree the way it works is: as per cmakelist, a project will define which directory is to be built, and it will then generate a makefile in the main source tree (the build tree in cmake language, where the main CMakeLists.txt file exists) when the makefile has been generated, the project is then treated like any other project. the way cmake works, if a makefile has already been generated by it, in a given directory, running it again will fail and not affect anything; if it fails but the makefile doesn't exist, then something is wrong, but if the makefile does exist, then it's all fine and nothing happens at present, this is only used for uefiextract, which is part of src/uefitool Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-30update/trees: avoid namespace clash in functionLeah Rowe
the logic of the previous commit was correct, but one of the functions was named the same as another function used in this file, causing a namespace conflict, and a build error Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-30update/trees: dont hardcode autoconf/bootstrap argLeah Rowe
at present, the bootstrap and configure script is only directly executed for grub, because grub is the only project that uses them in lbmk however, when i start adding linuxboot support, i will have to start building a lot of projects, some of which make use autoconf and bootstrap scripts e.g. ./bootstrap --foo ./configure --bar the "bootstrap" script is often used on GNU programs, because they like to over-engineer absolutely everything Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-30unify script/update/trees and script/build/grubLeah Rowe
the script can now also handle autoconf build systems, whereas this could previously only be done for grub. with this change, the overall sloccount is also lower Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-28lbmk scripts: general code cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-27lbmk scripts: general code cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-27update/trees: further simplify crossgcc handlingLeah Rowe
arch no longer needs to be set, on multi-tree projects, and it has been renamed to xarch the new behaviour is: if xarch is set, treat it as a list of crossgcc targets and go through the list. set the first one as the target, for what lbmk builds, but build all of the defined crossgccc targets crossgcc_ada is now xlang, and defines which languages to build, rather than whether to build gcc-gnat Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-24lbmk scripts: shorter code linesLeah Rowe
while seemingly pedantic, this does actually make code easier to read. mostly just switching to shorthand for variable names, where no expansions or patterns are used Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-24lbmk scripts: general code cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23set version/projectname properlyLeah Rowe
lbmk used to set version/versiondate directly in err.sh, but now it's handled there by a function, which is called by the main script. script/update/release hadn't yet been adapted. the only change necessary is to call check_project() script/update/trees also makes use of it script/build/roms is using "projectname" Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23update/trees: fix infinite loopLeah Rowe
when make-all is being executed on a coreboot tree, the "./vendor download target" command is used, where target is the tree/board name. that script then checks whether cbfstool and ifdtool are built, and if they're not, they then call ./update trees -b coreboot utils bla bla bla in this scenario, project=coreboot and mode="", meaning make-all, and the same check that checks whether the vendor download script should be run, is executed, which in turn then checks cbutils again fix the infinite loop by checking whether it was coreboot utils, as opposed to *firmware*, that is to be built, before running ./vendor download Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23don't delete microcode updates in rom imagesLeah Rowe
at present, lbmk can remove microcode updates on images for a given target, if the target specifies microcode_required="n" in target.cfg lbmk then provides images with microcode, and images without, in a given release. although the user can also remove them manually, this just makes it a bit more convenient, for those users who do wish to run without the updates. this functionality is provided only on those platforms where no-microcode is tested. well, this behaviour implements a compromise on libreboot policy, which is to always include microcode updates by default. see: Binary Blob Reduction Policy the *canoeboot* project now exists, developed in parallel with libreboot, and it ships without microcode updates, on the same targets where lbmk also handled this. running without microcode updates is foolish, and should not be encouraged. clean up lbmk by not providing this kludge. the libreboot documentation will be updated, telling such users to try canoeboot instead, or to remove the update from a given libreboot rom - this is still possible, and mitigations such as PECI disablement on GM45 are still in place (and will be kept), so that this continues to work well. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23update/release: don't test ./vendor injectLeah Rowe
the purpose of script/update/release is not to test the build system, but to build release archives. testing of lbmk is done during the course of development. remove this bloat from the release script. we run the nuke mode anyway, to scrub blobs from releases, which will more or less test the logic in that script (the only difference is that it runs e.g. ifdtool --nuke instead of -i). Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23update/release: don't insert crossgcc tarballsLeah Rowe
why are we distributing gcc at all? the coreboot build system downloads it at build time, and the GNU rsync mirrors aren't going anywhere. simplify script/update/release by not handling gcc. this means: release archives will no longer contain gcc. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23lbmk scripts: general code cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-22general code cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-21build/roms: remove modify_coreboot_rom()Leah Rowe
don't handle "romtype" at all, in board target.cfg files add /dev/null as pike2008 rom on amd boards. this serves the same purpose, adding them as empty vga roms, to add an empty rom in cbfs. pike2008 cards cause seabios to hang, when their oproms are executed, so we insert a fake rom on i945 thinkpads, use the coreboot config option: CONFIG_INTEL_ADD_TOP_SWAP_BOOTBLOCK when set, this enables the same bootblock copy, for use with bucts. these two cases, namely pike2008 roms and i945 bootblock copies, no longer need to be handled in code Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-21update/trees crossgcc: call err if arch isn't setLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-21update/trees: simplified crossgcc handlingLeah Rowe
only call crossgcc for coreboot and u-boot, but use hostcc for everything else. simplify the checking of which architecture to compile for. "arch" in target.cfg files has been modified, to allow further simplification. without this patch, the logic currently only *barely* avoids using crossgcc on things like utils, and only works in practise because, in practise, lbmk only works on x86_64 anyway. the new logic, as per this patch, is simpler and more robust. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-19update/release: minor cleanupLeah Rowe
remove unnecessary "continue" command. it's written at the end of a for loop, where it'll continue anyway Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-16remove DEBUG handling in lbmk (not needed)Leah Rowe
all it did was set -v in the shell, which doesn't yield very useful results. this is a relic of very old design in the libreboot build system, that is no longer needed. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-16fix several shellcheck warningsLeah Rowe
lbmk didn't quote certain arguments in commands, or used ! -z instead of -n, things like that. simple fixes. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-11handle errors on exits from subshellsLeah Rowe
most of these are probably redundant, and will never be called, but lbmk needs to be as safe as possible under fault conditions. fail early, fail hard. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-08lbmk: don't use status for unconditional returnsLeah Rowe
in cases where lbmk must always return from a function, there are some cases where it relies on non-zero exit status, which in practise is always the case, but may change in the future if the relevant part is modified e.g. do_something && return 0 the proper form is: do_something return 0 also do this for unconditional exits Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-06Libreboot 2023110620231106Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-06put docs under docs/ in releases (not src/docs/)Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-01Libreboot 2023110120231101Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-31update/release: insert fake x201 me.binLeah Rowe
this makes the build work, for releases. this is not done during regular builds, only releases. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-25include/option.sh: fix i945 bootblock copyLeah Rowe
it wasn't being copied right the roms under elf/ were being copied, but not the ones under bin/ - i need to audit it further for now, i run modify_coreboot_roms from build/roms instead of update/trees so, the ones under elf/ no longer have bootblocks copied. it's only done in bin/ Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-2220231021hotfix: replace x_ with err in some places20231021fixLeah Rowe
keymaps weren't being set in keymay.cfg of cbfs, due to use of x_ in the rom script, and x_ doesn't handle quotes or spaces in arguments well. i'm going to remove use of x_ and xx_ (it's in my todo), for next release. for now, hot patch the release. i've gone through and replaced use of x_ with || err, in some places. not just the keymap.cfg command, but others too. in case there are more issues we missed. this commit is being tagged "20231021fix" and i'm using this tag to re-build the 20231021 release. i'll just replace the tarballs in rsync and add errata to the news page announcing the release. all i did was break peoples umlauts, i didn't brick their machines fortunately! very minor bug. anyway, x_/xx_ is a great idea, but sh isn't really designed for that style of programming. i'll go back to using just || err in the next release. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-21Libreboot 2023102120231021Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-20update/release: clean up temporary crossgcc dirLeah Rowe
clean it up after copying the tarballs i really hate how this logic is written, it's clunky but it should work; the only issue is that it's quite slow, and inefficient on use of disk space. however, i've not yet figured out how to reproducible add files to a tarball, once the tarball has been created, and i rely on sorting (of file names) when creating them. it's really not a problem because normal people won't use this script, only i or anyone who wants to test out the libreboot release infrastructure. this script is largely intended to *work* but i'm still annoyed by how crappy it is. i'll fix it after the Libreboot 20231021 release. Signed-off-by: Leah Rowe <leah@libreboot.org>