summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2024-06-27git.sh: remove unnecessary checkLeah Rowe
the trees script itself will check that the directory exists, and exit with zero status if it does, without doing anything else other than the return. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27lib.sh: move git_err() to buildLeah Rowe
it's only used in the main build script, so move it there. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27lib.sh: condense singletree() a bitLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27lib.sh: add a return to the end of check_defconfigLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27lib.sh: condense e() a bitLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27lib.sh: make elf/coreboot* a dot directoryLeah Rowe
we don't want the user to flash coreboot from elf/, because those images do not contain payloads. the user must flash from bin/ ample warning is given, at build time, but the warning is written in english. therefore, some people may not understand it, because they may not even speak english. hide the coreboot elf/ directory, to mitigate this possibility. in most cases, this will probably prevent the average user from flashing those images, since they likely won't see it. the "DO NOT FLASH" warning is still included in that directory name, while creating it. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27lib.sh: simplified TMPDIR handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27lib.sh: condense setcfg() if/else logicLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-25lib.sh: introduce mandatory check of projectnameLeah Rowe
error out if it's not set. ditto projectsite. that way, if the files are accidentally deleted, or not added in a derivative of the build system, you'll know. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-25lib.sh: condense setvars() a bitLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-25simplified lock messageLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-25lib.sh: simplify reading of version filesLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-25lib.sh: simplify use of environment variablesLeah Rowe
don't have a separate variable for them. just export them directly and use them directly. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-23lib.sh: fix error running ./build dependenciesLeah Rowe
the e() and setvars() functions need to be declared before the dependencies function. also: after calling install_packages, it was doing a return when it should have done an exit. this is all fixed now. i apologise to anyone who previously ran into trouble with this! Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-22use backticks on eval commands, not subshellsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-22lib.sh: remove badcmd()Leah Rowe
it's bloat. telling the user to rtfm is something that we already do on irc; they will still ask how to do everything, and ignore the message from badcmd(), or they will automatically know to rtfm. i'm on a massive purge, removing bloat from lbmk as part of Libreboot Build System Audit 6. all bloat must go. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-22lib.sh: more unified config handlingLeah Rowe
replace it with logic that simply uses "." to load files directly. for this, "vcfg" is added as a variable in coreboot target.cfg files, referring to a directory in config/vendor/ containing a file named pkg.cfg, and this file then contains the same variables as the erstwhile config/vendor/sources config/git files are now directories, also containing pkg.cfg files each with the same variables as before, such as repository link and commit hash this change results in a noticeable reduction in code complexity within the build system. unified reading of config files: new function setcfg() added to lib.sh setcfg checks if a config exists. if a 2nd argument is passed, it is used as a return value for eval, otherwise a string calling err is passed. setcfg output is passed through eval, to set strings based on config; eval must be used, so that the variables are set within the same scope, otherwise they'd be set within setcfg which could lead to some whacky results. there's still a bit more more to do, but this single change results in a substantial reduction in code complexity. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-20vendor.sh: more cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-20vendor.sh: correction (s/scancfg/scan_config)Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-20git.sh: revert modification to for loopLeah Rowe
i tried to be clever with this one, but it just made the script exit with an error. revert back to the old check (check whether one of either repo or repo backup is set) Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-20vendor.sh: minor code cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-20minor code cleanup in the build systemLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-20git.sh: general code cleanup in fetch_submodule()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-20git.sh: reduced indentation on repo/file checkLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-20git.sh: simplified repo/backup checkLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-17roms: remind the user about gkb filesLeah Rowe
nowadays, we don't insert GRUB keymaps automatically, for sake of efficiency; without one, the default is US QWERTY. a user will only want one keymap in particular, so this is more efficient. in practise, they're either building from source anyway, or using the inject scripts which compile cbfstool anyway, so the user will already have cbfstool. also output this message from the inject script. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16unify coreboot elfdir (DO_NOT_FLASH)Leah Rowe
use a common string when setting this path Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-15roms: unify all add-payload commandsLeah Rowe
add a generic function that can insert payloads with lzma compression, or raw files without compression Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-14unified checks for variable initialisationLeah Rowe
new function chkvars() does the job Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-14lib.sh: remove the items() functionLeah Rowe
it's pretty much just doing the same thing as ls -1 remove it! Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09minor code cleanup in the build systemLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09lib.sh: more useful lock messageLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09create a lock file during buildsLeah Rowe
prevent duplicate main instances of the build system from running the lock file is deleted when the parent process exits, alongside the tmpdir deletion the build system must only ever be run ot one instance at a time, per work directory Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09git.sh: hide e() output on for loopLeah Rowe
this for loop is a hack to make sure that all the sources get nuked (using nuke.list files). hide the messages so that they do not appear when running just any command in the trees script. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09lib.sh: fix regressionLeah Rowe
i was being a bit too clever about some optimisations revert this change. otherwise, nothing will download or build Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09git.sh: download xtree *before*, not afterLeah Rowe
downloading it after means that if an error occurs when downloading the xtree project, the main project will still be there and nothing will mandate the downloading of the xtree project. whereas, if we grab the xtree project first, then the main project won't get saved to src/ this makes the build system a bit more resilient under fault conditions, but otherwise doesn't change behaviour. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09git.sh: fix deletion path in nuke()Leah Rowe
i accidentally forgot to include src/ in the prefix Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09lib.sh: less confusing error in download()Leah Rowe
don't say "file missing", because it may be present! instead, say that the download failed. this covers both contexts: internet failed and thus no file present, or the file is present but checksum verification failed. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09lib.sh: hide stderr on download()Leah Rowe
on the initial check, the output is confusing because it will say "checksum verification failed" if the file doesn't already exist, but then goes to download. only say checksum failed if a download occured, and the check failed, otherwise report nothing except that the file already exists. this will not reduce the ability to debug issues later on, and it will reduce the amount of confusion for users. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09lib.sh: simplify download()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09lib.sh: fix redundancy in download()Leah Rowe
it was only downloading the main url, even when it should use the backup. fix it by actually using the for loop variable. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09lib.sh: simplify singletree()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09git.sh: further simplify nuke()Leah Rowe
it's a very compact nuke Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09git.sh: simplify link_crossgcc()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09git.sh: simplify nuke()Leah Rowe
do not over-engineer such a trivial thing. seriously. all we're doing is nuking some files. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-08git.sh: support downloading *files* as submodulesLeah Rowe
when we download coreboot, we currently don't have a way to download crossgcc tarballs, so we rely on coreboot to do it, which means running the coreboot build system to do it; which means we don't get them in release archives, unless we add very hacky logic (which did exist and was removed). the problem with coreboot's build system is that it does not define backup links for each given tarball, instead relying on gnu.org exclusively, which seems OK at first because the gnu.org links actually return an HTTP 302 response leading to a random mirror, HOWEVER: the gnu.org 302 redirect often fails, and the download fails, causing an error. a mitigation for this has been to patch the coreboot build system to download directly from a single mirror that is reliable (in our case mirrorservice.org). while this mitigation mostly works, it's not redundant; the kent mirror is occasionally down too, and again we still have the problem of not being able to cleanly provide crossgcc tarballs inside release archives. do it in config/submodules, like so: module.list shall say the relative path of a given file, once downloaded, relative to the given source tree. module.cfg shall be re-used, in the same way as for git submodules, but: subfile="url" subfile_bkup="backup url" do this, instead of: subrepo="url" subrepo_bkup="backup url" example entries in module.list: util/crossgcc/tarballs/binutils-2.41.tar.xz util/crossgcc/tarballs/gcc-13.2.0.tar.xz util/crossgcc/tarballs/gmp-6.3.0.tar.xz util/crossgcc/tarballs/mpc-1.3.1.tar.gz util/crossgcc/tarballs/mpfr-4.2.1.tar.xz util/crossgcc/tarballs/nasm-2.16.01.tar.bz2 util/crossgcc/tarballs/R06_28_23.tar.gz the "subrev" variable (in module.cfg) has been renamed to "subhash", so that this makes sense, and that name is common to both subfile/subrepo. the download logic from the vendor scripts has been re-used for this purpose, and it verifies files using sha512sum. therefore: when specifying subrepo(git submodule), subhash will still be a sha1 checksum, but: when specifying subfile(file, e.g. tarball), subhash will be a sha512 checksum the logic for both (subrepo and subfile) is unified, and has this rule: subrepo* and subfile* must never *both* be declared. the actual configuration of coreboot crossgcc tarballs will be done in a follow-up commit. this commit simply modifies the code to accomodate this. over time, this feature could be used for many other files within source trees, and could perhaps be expanded to allow extracting source tarballs in leiu of git repositories, but the latter is not yet required and thus not implemented. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-08git.sh: remove unnecessary line breakLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-08vendor.sh: add a return at the end of mkdirsLeah Rowe
i don't like that it's not there, because of the quirks in sh behaviour. put it there to put my mind at ease. otherwise, this doesn't change any behaviour. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-08vendor.sh: move download logic to lib.shLeah Rowe
in future revisions, i will make tarballs become subfiles, to complement submodules. e.g. crossgcc tarballs in coreboot Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-08lib.sh: shorten a string in e()Leah Rowe
line exceeds 80 characters Signed-off-by: Leah Rowe <leah@libreboot.org>