summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-09-02handle/make/file: fix uefitool buildsLeah Rowe
the current check only worked if it had already been built, when checking for the Makefile however, running this during build/release/src caused problems, hence the current check so: perform the same check, but as a fallback for cmake failing (and if that check fails, only then will err be called) Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-02handle TMPDIR from include/export.shLeah Rowe
it looks a bit cluttered just sitting there in the main script. make it an include. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-01don't do cmake on uefitool if the Makefile existsLeah Rowe
nasty little hack to fix another nasty little hack, which i call script/build/release/src Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-01build/release/src: bugfix: actually copy cb/ub/sbLeah Rowe
coreboot, seabios and u-boot were not being copied at all Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-01build/release/src: copy handle symlinkLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-01build/release/src: remove Makefile referenceLeah Rowe
lbmk never needed a makefile, because the build system is all shell scripting; the former makefile simply called those scripts, in a way that was mostly superfluous build/release/src was still trying to copy it, so let's remove it from that file Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-01build/release/src: fix bad variable referenceLeah Rowe
it's i, not 1 Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-01update build/release/src based on lbmk changesLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-01update the fetch scripts themselvesLeah Rowe
the fetch scripts call themselves, for dependencies Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-01build/coreboot/utils: exit 1 if target.cfg missingLeah Rowe
it was previously trying to "continue", despite not being inside a loop. the correct instruction would have been "return 0", but then I thought it'd be better to err here Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-01handle project downloads in main lbmk scriptLeah Rowe
this means the unified /tmp handling is now provided for in both the former "fetch" and "fetch_trees" script, which are now (respectively): ./update project repo ./update project trees if the fetch scripts weren't cleaning /tmp before, they now are, because lbmk handles it Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-01lbmk script: always clean up /tmp filesLeah Rowe
export TMPDIR to scripts, and handle it in a way that we know lbmk set it delete it at the end of the parent process, but not child processes; when the lbmk script calls itself, child processes will not delete the tmp directory. some scripts in lbmk weren't cleaning up the tmpfiles they made, and they still don't, but this mitigates that. now in follow-up commits, i can start cleaning up those scripts too. not handled by this patch: if the user cancels lbmk (ctrl+c), the tmp directory will still be there. this too will be handled, in subsequent patches Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-31only remove microcode in build/release/romsLeah Rowe
libreboot's build system, lbmk, *is* available to use in releases aswell (use the _src tarball), but it is mostly intended for development, in lbmk.git well, there's not much point wasting time / disk space generating no-microcode roms within lbmk they should be generated only at release time, alongside the default ones this patch implements that, thus speeding up the build process and saving disk usage during development the other alternative was to add a new option in build/boot/roms, -m, that would opt in to removing them, but this is extra complexity for something that is ill advised and only provided to appease certain people Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-31move build/boot/rom moverom to handle/make/configLeah Rowe
most of these steps do not need to be repeated, per image. move it into handle/make/config, so that the steps are performed on files that go under elf/coreboot (this will save on build time). the logic for handling 4MB ROM images on sandy/ivy was unused, and has been removed. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-31build/release/roms: fix syntax errorLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-31re-add /dev/null redirect on . ${1}Leah Rowe
the error messages that it shows are benign, but users see them and worry that something went wrong this patch reduces the number of people asking pointless questions on irc Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-29build/release/src: copy the include/ directoryLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-29grub: all one grub.elf containing keymaps and cfgLeah Rowe
new behaviour: * grub.cfg and grubtest.cfg no longer inserted to cbfs * grub.cfg in memdisk instead * grub.cfg in memdisk defers to cbfs/grub.cfg if added (not added by default, anymore) * does not defer to grubtest.cfg even if available * only shows link to grubtest.cfg if available, as a menuentry item keymaps: if /keymap.gkb exists in cbfs, it uses that by default, but by default this isn't added. instead, it looks for a file named keymap.cfg and sources that, which then sets the keymap to one that is located under memdisk. this file is inserted for each rom, per layout. if keymap.gkb and keymap.cfg both absent, grub.cfg in memdisk shall defer to usqwerty as the default keymap grub_scan_disk: grub.cfg looks for cbfs file "scan.cfg" and sources that if found, which will be inserted with the string: set grub_scandisk=setting_goes_here (based on target.cfg, generated by build/boot/roms automatically). If no scan.cfg is found, it defaults to "both" The "background.png" file remains unchanged, and present in CBFS, used by grub.cfg if present (and it is, by default) This change actually *saves* space in CBFS, due to compression, and means that the grub.cfg is now compressed heavily. This is also safer, because now the user overrides grub.cfg by adding it, and they can still add grubtest.cfg for testing first. If they accidentally delete both configs from cbfs, Libreboot will fall back to the one in memdisk which would presumably not be deleted. This also means that lbmk can now more easily be used by other build systems, that just want the GRUB part to re-use in their own project. For example, people who want to build custom coreboot images without using Libreboot's build system. This change also *speeds* up the build process considerably, on the parts where ROM images are copied. It's less than half a second now, whereas previously it took about 30-45 seconds for ROM images to copy, because of grub.elf being re-added in each ROM via cbfstool, where compression is used; I believe the compression part is what caused slowness. Much, much faster, more versatile builds. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-28lbmk: run ./build dependencies *before* root checkLeah Rowe
After that, do not allow anything to run if the user is root. This logic flow is more robust, and reduces the chance of bugs in the future. We must not permit the user to run lbmk as root. Running it as root *is* possible, by just removing the check, and wily enough users will do that, but this behaviour in lbmk is good practise because it prevents accidentally running as root. If the user went into root just for installing dependencies, they might accidentally forget to switch back. This is a safeguard against such folly. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-28build/boot/roms: fix bad variable assignmentLeah Rowe
this was an oversight, in a previous commit. there was a space, between variable name and the equals sign, and then another space, so it was trying to *execute* the rom Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-28dependencies/ubuntu2004: update based on debianLeah Rowe
ttf-unifont instead of fonts-unifont Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-28fix: don't require git config for dependenciesLeah Rowe
this was an oversight on my part. the script cannot be run as root, except to install distro dependencies e.g.: as root: ./build dependencies debian however, ./checkgit was being run *before* checking that, making it required to set git config as root. this patch fixes that bug. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-28build/boot/roms: simplify ich9m ifd handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-28build/boot/roms ich9m ifd: use fast dd commandLeah Rowe
bs=block size and count=1, rather than bs=1 and count=block size Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-28build/boot/roms: use the new coding styleLeah Rowe
lbmk's new style is inspired by the bsd coding styles: top-down logic, main simplified to a skeleton showing overall program structure, variables well-defined, rigorous (yet deceptively simple) error checking. this was attempted before, but caused problems; coreboot wasn't being cleaned properly, and rather than audit it, i simply reverted this back to the old style. this is actually attempt number 5, because i made 3 more attempts between then and this one. i've build-tested this using "./build boot roms all" (which is what b0rked on the first attempt, months ago). it should be stable(tm). the code is much nicer to read / work on now. this is the beating heart of lbmk. get this script wrong, and you break all of libreboot. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-28Remove superfluous GRUB modules (save CBFS space)Leah Rowe
With this change, about 54KB of compressed space is saved inside of CBFS, on setups that use the GRUB payload. The uncompressed saving is about 720KB, but payloads are compressed inside each coreboot image, so the compressed saving is much smaller. That 54KB saving means a lot, especially on small (1MB or smaller) flash sizes. The following modules were removed: adler32, afsplitter, aout, archelp, backtrace, blocklist, bswap_test, cat, cmdline_cat_test, cmosdump, cmostest, cmp, cmp_test, cpuid, cs5536, ctz_test, date, datehook, datetime, disk, diskfilter, div, div_test, dm_nv, efiemu, eval, exfctest, extcmd, file, fshelp, functional_test, gdb, gettext, gptsync, hashsum, hdparm, hello, hfspluscomp, http, json, json, ldm, loadenv, macbless, macho, mda_text, morse, mpi, msdospart, mul_test, net, ntfscomp, offsetio, part_acorn, part_amiga, part_apple, part_dvh, part_plan, part_sun, part_sunpc, parttool, pbkdf2, pbkdf2_test, pci, play, priority_queue, probe, progress, random, rdmsr, read, relocator, setjmp, setjmp_test, shift_test, signature_test, sleep, sleep_test, smbios, strtoull_test, terminal, terminfo, test_blockarg, testload, testspeed, tftp, tga, time, tr, trig, usbtest, video_bochs, video_cirrus, videoinfo, videotest, videotest_checksum, wrmsr, xnu_uuid, xnu_uuid_test These were retained, but moved to modules instead of install modules: geli, udf, ufs1, ufs1_be, ufs2 Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-27fix typo in error message ("as not permitted")Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-27.gitcheck: re-write entirely. force global config.Leah Rowe
the way the old script worked was extremely hacky it's cleaner just to make the user configure git i haven't used anything from the old .gitcheck script, which is now deleted. i completely re-wrote this, in a much simpler way. this is less maintenance now, when things change in the upstream projects. coreboot makes heavy use of git within its build system Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-27move resources/scripts/ to script/Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-27enable memtest86plus on various boardsLeah Rowe
d510mo, g43t-am3 and ga-g41m-es2l did not have the memtest86+ payload enabled enable it! Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-27x86 desktops: only enable seabios_withgrubLeah Rowe
and only where grub was already enabled; on boards that did not enable grub, grub is still disabled on desktops, it's possible that the user may insert a graphics card. if their first payload was grub, it won't work because lbmk doesn't configure coreboot itself to execute vga roms at present i found when testing t1650 (dell) that if a vgarom is loaded from seabios (from a graphics card), the grub payload still works; if booting in corebootfb mode, text mode is still used when booting with the card to decrease the probability of bricks with any given set of users, make seabios the only payload that starts first, but make grub available in the esc menu on seabios it's possible to add a bootorder file and disable the seabios menu, if you only want a grub payload accessible Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-27unified list command for all scriptsLeah Rowe
e.g. ./build boot roms list ./update blobs inject listboards ./build boot list ./build clean list also this is now possible: ./build list or maybe ./update list ^ would list directories in resources/scripts/build and resources/scripts/update respectively this script is added: resources/scripts/build/command/options call it like so, e.g. ./build command options resources/coreboot this script is now used, for list functions in other scripts. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-27handle/make/config: add missing pipes for errLeah Rowe
i forgot to add these! without them, the script will always exit with an error Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-27delete the MakefileLeah Rowe
we don't use it in lbmk. it's there mostly because it was technically feasible, and it still is however, i've been doing massive re-factoring of lbmk and the makefile and i just don't feel like constantly patching up the makefile if someone wants to re-add it, that's fine. but i don't see the point in maintaining something that we don't need. the makefile is not needed. all it did was call lbmk directly. the makefile had no logic itself. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-27handle/config/file: rename to handle/make/configLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-27handle/config: fix errant "handle src for" callLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-27"handle src for" - change to handle make fileLeah Rowe
an oversight, in a previous edit Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-27handle/config: add missing error handleLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-27build/src/for: rename to handle/make/fileLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-27handle/config/file: unified distclean handlingLeah Rowe
use build/src/for -c which does the same thing, specifically: try distclean, then clean, or fail Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-27build/src/for: use -j for multithreaded buildsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-27build/release/src: update based on recent changesLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-27scripts: put quotes around file/directory namesLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-26much, much stricter, more verbose error handlingLeah Rowe
lbmk is much more likely to crash now, in error conditions, which is a boon for further auditing. also: in "fetch", remove the downloaded program if fail() was called. this would also be done for gnulib, when downloading grub, but done in such a way that gnulib goes first. where calls to err write "ERROR" in the string, they no longer say "ERROR" because the "err" function itself now does that automatically. also: listmodes/listoptions (in "lbmk") now reports an error if no scripts and/or directories are found. also: where a warning is given, but not an error, i've gone through in some places and redirected the output to stderr, not stdout as part of error checks: running anything as root, except for the "./build dependencies *" commands, is no longer permitted and lbmk will throw an error mrc downloads: debugfs output no longer redirected to /dev/null, and stderr no longer redirected to stdout. everything is verbose. certain non-error states are also more verbose. for example, patch_rom in blobs/inject will now state when injection succeeds certain actual errors(bugs) were fixed: for example, build/release/roms now correctly prepares the blobs hash files for a given target, containing only the files and checksums in the list. Previously, a printf message was included. Now, with this new code: blobutil/inject rightly verifies hashes. doing all of this in one giant patch is cleaner than 100 patches changing each file. even this is yet part of a much larger audit going on in the Libreboot project. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-24.gitcheck: continue if no .git (don't break)Leah Rowe
the user may have re-downloaded a coreboot tree, in a release. this is supported. therefore, some may have .git, and some will not Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-24.gitcheck: must stricter error handlingLeah Rowe
we also run it in releases, so to compensate: it now checks for .git/, but only in project directories, not the main lbmk directory of the git repository or a release. this is because in a release, it's possible that the user may still delete coreboot/ directories and re-download coreboot trees this is not intended, but we must not assume that users use libreboot the way it's intended! "much stricter" because there was previously none, intentionally, due to the above fact. the checking of .git/ should mitigate this (the script will exit with zero status if it isn't there) Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-24.gitcheck: only redirect stdout to /dev/nullLeah Rowe
do not redirect stderr this will help us for debugging purposes Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-24use the new coding style in scriptsLeah Rowe
there were stragglers left over from the last audit, and these stragglers still exist even after all the major re-factoring as of late the new style is: bsd-like coding style and error handling. verbose yet simple error handling. we use an "err" function in a way reminiscent of most C programs that you see in openbsd base (err.h) this style is very clean, resulting in readable code Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-23scripts: never exit 1, always call err insteadLeah Rowe
this same change has been applied, selectively, to certain return statements. the general rule is this: the return statement should only be used to direct logic within a script, where certain non-errors states are used to skip certain actions; the exit command should *never* be used to return non-zero, except by err(). in so doing, we ensure easier debugging of the build system also: strip_rom_image in build/release/roms was running "continue" when a rom file didn't exist, despite not being a while/for loop. i make it return (non-error condition) instead it's ok for a script to exit 0, where appropriate, but perhaps a function could also be written for it Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-08-23blobs/download: copy dl_path, don't move itLeah Rowe
moving it defeats the purpose of the caching mechanism that's in place. this should avoid unnecessary downloads Signed-off-by: Leah Rowe <leah@libreboot.org>