summaryrefslogtreecommitdiff
path: root/script
AgeCommit message (Collapse)Author
2024-06-16roms: merge mkUbootRom() into build_uboot_roms()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16roms: simplify mkSeabiosRom()Leah Rowe
remove variables that are not meaningfully used Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16roms: simplify mkUbootRom()Leah Rowe
remove variables that are not meaningfully used Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16roms: simplify build_roms()Leah Rowe
cbcfg is already a global variable, so there's no reason to set it again at the start of this function. remove the check for whether the given coreboot config exists, to the calling function instead of build_roms(). Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16roms: remove unnecessary checkLeah Rowe
uboot_config is later only used if payload_uboot is set Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16roms: further clean up build_grub_roms()Leah Rowe
the tmpcfg variable will be useful elsewhere, for the same kind of change as before. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16roms: simplify timeout/scandisk insertionLeah Rowe
we don't need to call mktemp everytime. just use a staticly named file in tmpdir and keep overwriting it. these files are only small, and they get deleted when the build system exits later on. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16roms: simplify seagrub check in build_grub_romsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16roms: simplify mkserprog()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16roms: simplify the serprog build functionsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16script/roms: fix serprog build commandsLeah Rowe
forgot to shift Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-15roms: simplified ubootelf checkLeah Rowe
we check it twice, which we don't need to do. we only need to check it once! Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-15roms: simplify grubonly check in configure_targetLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-15roms: simplify seagrub check in configure_targetLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-15roms: don't use x_ to call build_grub_romsLeah Rowe
build_grub_roms never returns a non-zero value Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-15trees: simplify copy_elf()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-15trees: remove unnecessary check in copy_elfLeah Rowe
we don't need to check whether this variable is set, because checking an empty path will also cause the same return in the next line. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-15grub: insert background in memdisk insteadLeah Rowe
the background is only a few kb. the whole rationale before was to limit the space used in memdisk, but this decision was made when the background was much bigger; it has since been optimised greatly, and the grub modules were heavily reduce, so it should be safe. grub's memdisk breaks when you add too much data to it. as part of simplifying the rest of lbmk, this change removes some more bloat from the rest of lbmk. handling this in the memdisk is much simpler than handling it with cbfstool. 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-15roms: don't add grub keymaps at allLeah Rowe
if not inserted, the default keymap is usqwerty. don't waste ssd write cycles copying so many images, or cpu time compressing so many. the user can simply add a keymap.gkb file to cbfs and it will work fine. this will be documented in the next release. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-14roms: merge handle_coreboot_target into main()Leah Rowe
rely on return status per each of the three main rom functions, to then update the "targets" variable. use this as the basis to determine which targets were built, during final confirmation when the script exits. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-14roms: simplify target check (whether roms built)Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-14roms: simplify main() againLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-14roms: remove redundant check on grub_scan_diskLeah Rowe
the current validation check is extremely over-engineered, because the user override is no longer available and we're always very careful in how we modify target.cfg per board. remove the redundant code. trust that target.cfg is correct. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-14roms: remove dangerous runtime p/s/d optionsLeah Rowe
p = payload s = grub_scan_disk d = displaymode setting the payload is no longer safe, due to issue 216 and similar issues that might pop up in the future; it's best left only to target.cfg, per board, so that we know what config is safe/tested. don't let the user override it. scandisk isn't safe to override because the given machine may not have the type of device that the user specifies displaymode is actually ok to set, because it simply whitelists what configs pre-existing to actually use, but it's bloat basically, the rule is this: don't make it easy for the user to brick their hardware. make it harder instead. a user wily enough to go modifying their payload will probably have read docs/maintain/ anyway and knows how to edit target.cfg if they want another board configuration. 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-14roms: simplify main()Leah Rowe
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-09re-add ability to use cbfs grub.cfg as defaultLeah Rowe
i removed this before, when making grub multi-tree, because the design i used in an earlier version of the patch actually added the grub.elf generation to grub source itself, but then i decided to hack around the grub build system from lbmk/cbmk instead re-add this functionality, so that users can easily insert their own custom grub.cfg into cbfs without needing to re-build their image. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09trees: exit with error if project undefinedLeah Rowe
i was originally looser about this, because i also wanted the trees script to generically run "make" from any directory, but this behaviour was error-prone and it is no longer used in the build system. disable it, in the interest of stability. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09add crossgcc tarballs to config/submodules/Leah Rowe
support redundant downloads, and enable inclusion of these tarballs inside release archives, for offline builds. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07trees: simplified copy_elf() handlingLeah Rowe
don't create elfdir, create dest_dir, which is elfdir plus the location within it only create dest_dir within copy_elf, which is only called if actually compiling the code this avoids creating empty elf directories, and it generally cleans up all handling, unifying the handling of directories into a single function, namely copy_elf() which already exists Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07git.sh: download "depend" projects *before*Leah Rowe
don't do it after, because that means the main project is saved under src/ before we know whether the subrepo was downloaded. the "depend" variable (in config/git/) is no longer used for projects that go in subdirectories of a parent; now, we use config/submodules/ for this type of dependency. download the "depend" projects (as per config/git/) first. this way, if they fail, the main one will fail, but if they succeed and main fails, you can just run the main download again and it won't fail. this fixes a bug where, depending on how you download a set of projects and depending on the order which you do so, a given project can become un-downloadable on current design, because git will complain that a directory already exists. this fix is done not only in code (by this commit), but by prior configuration changes. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07trees: don't check empty path in copy_elf()Leah Rowe
it could lead to some whackiness later on Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07trees: fix build issue caused by bad elf checkLeah Rowe
we're not checking for bad elfs, but the check itself was bad due to a quirk in how sh works. really, really obscure bug. fixed now! if the given directory didn't actually exist, or there were no files in it, it'd be searching for the file named "*" which is obviously wrong Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07trees: fix listfile check in copy_elf()Leah Rowe
don't check that the variable is empty check that the file itself exists or not this should fix the recent build issues Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07trees: don't say check elf/ if build.list missingLeah Rowe
(on single tree projects. this complements the last patch) Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07trees: don't do elfcheck if build.list missingLeah Rowe
otherwise, some checks are done too soon, and nothing gets built. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-06trees: unified coreboot makeargsLeah Rowe
in particular, the coreboot build system may auto-download submodules when building cbfstool; vboot for instance. we do not want such unpredictable behaviour, so now we use UPDATED_SUBMODULES=1 when building coreboot utilities. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-06trees: use multiple threads to build cbutilsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-06move handle_coreboot_utils to script/treesLeah Rowe
it doesn't really make sense placed in lib.sh, because it's only called from script/trees Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-06put coreboot utils in elf/, not cbutils/Leah Rowe
one directory per util, under elf/ e.g. elf/cbfstool/ further split by tree name, e.g.: elf/cbfstool/default/ elf/cbfstool/foo/ Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-06trees: skip single-tree build if a build existsLeah Rowe
this replicates the same behaviour as multi-tree builds, checking for files inside the relevant elf/ directory Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-06use correct memtest86plus path in script/romsLeah Rowe
the previous change makes memtest.bin get cached in elf/ but the path was being prefixed with src/ by script/roms do away with the prefix Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-06put memtest86plus builds in elf/memtest86plus/Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-06trees: also print "DONE! check elf/dir" on singleLeah Rowe
e.g. ./update trees -b flashprog tell the user to check elf/flashprog Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-06trees: handle build-test on multi-tree projectsLeah Rowe
for example, now flashprog binaries could be placed in the elf/ directory, under elf/flashprog/ Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-06move cfgsdir/datadir variables to lib.shLeah Rowe
it's also used from script/roms, in addition to trees move these variables to a common file used everywhere Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-06handle build.list from config/data/, not config/Leah Rowe
certain code checks for build.list, to skip it, for example in items() we already use config/data/grub to store grub config data that applied to all trees create these directories too: config/data/coreboot config/data/u-boot config/data/seabios move the respective build.list files in here, and also to config/data/grub now multi-tree projects contain, per directory, just the target.cfg file and the patches directory. this is much cleaner, because some of the logic can be simplified more Signed-off-by: Leah Rowe <leah@libreboot.org>