summaryrefslogtreecommitdiff
path: root/script/roms
AgeCommit message (Collapse)Author
2024-06-17roms: rename x variable to it in for loopaudit6-merge1Leah Rowe
there are two for loops that use x as a variable anme, and an idiosyncrasy of certain sh implementations is that these become global; the result in this case was that when you finish building every target in "./build roms", it would print "libgfxinit" repeatedly, comma separated, instead of a comma-separated list of the targets that were built. work around it by renaming the variable in one of the loops. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16roms: don't use x_ to call cproms()Leah Rowe
cproms() never returns non-zero, so it doesn't make sense to use x_ here Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16roms build_uboot_roms(): move rom, don't copyLeah Rowe
that way, we don't have to delete the temporary file. just move it entirely. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16roms cproms(): allow other commands besides cpLeah Rowe
e.g. the operator might specify mv instead 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-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-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-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-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-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-03better help text on invalid commandsLeah Rowe
adding help again is a bad idea. code should never document itself; that's what documentation is for. so, make the code do a better job telling the user where to find documentation. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-02make GRUB multi-tree and re-add xhci patchesLeah Rowe
Re-add xHCI only on haswell and broadwell machines, where they are needed. Otherwise, keep the same GRUB code. The xHCI patches were removed because they caused issues on Sandybridge-based Dell Latitude laptops. See: https://codeberg.org/libreboot/lbmk/issues/216 The issue was not reported elsewhere, including on the Haswell/Broadwell hardware where they are needed, but the build system could only build one version of GRUB. The older machines do not need xHCI patches, because they either do not have xHCI patches, or work (in GRUB) because they're in EHCI mode when running the payload. So, the problem is that we need the xHCI patches for GRUB on Haswell/Broadwell hardware, but the patches break Sandybridge hardware, and we only had the one build of GRUB. To mitigate this problem, the build system now supports building multiple revisions of GRUB, with different patches, and each given coreboot target can say which GRUB tree to use by setting this in target.cfg: grubtree="xhci" In the above example, the "xhci" tree would be used. Some generic GRUB config has been moved to config/data/grub/ and config/grub/ now looks like config/coreboot/ - also, the grub.cfg file (named "payload" in each tree) is copied to the GRUB source tree as ".config", then added to GRUB's memdisk in the same way, as grub.cfg. Several other design changes had to be made because of this: * grub.cfg in memdisk no longer automatically jumps to one in CBFS, but now shows a menuentry for it if available * Certain commands in script/trees are disabled for GRUB, such as *config make commands. * gnulib is now defined in config/submodule/grub/, instead of config/git/grub - and this mitigates an existing bug where downloading gnulib first would make grub no longer possible to download in lbmk. The coreboot option CONFIG_FINALIZE_USB_ROUTE_XHCI has been re-enabled on: Dell OptiPlex 9020 MT, Dell OptiPlex 9020 SFF, Lenovo ThinkPad T440p and Lenovo ThinkPad W541 - now USB should work again in GRUB. The GRUB payload has been re-enabled on HP EliteBook 820 G2. This change will enable per-board GRUB optimisation in the future. For example, we hardcode what partitions and LVMs GRUB scans because * is slow on ICH7-based machines, due to GRUB's design. On other machines, * is reasonably fast, for automatically enumerating the list of devices for boot. Use of * (and other wildcards) could enable our GRUB payload to automatically boot more distros, with minimal fuss. This can be done at a later date, in subsequent revisions. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-28roms: allow user override of grub_scan_diskLeah Rowe
this effectively lets you change the boot order. example: ./build roms -s "nvme ata" t1650_12mb the above example would set: grub_scan_disk="nvme ata" another example: ./build roms -s nvme t1650_12mb this would set: grub_scan_disk="nvme" this overrides what's set in target.cfg for the given target. useful for quick reconfiguration if building from source Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-28roms: fix bad eval when comparing optionsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-27grub.cfg: use grub_scan_disk to set boot orderLeah Rowe
Previously, grub_scan_disk could set ata, ahci or "both", which would make both be tried (ahci first). This worked when we only dealt with ata and ahci devices, but now we support nvme devices so the logic is inherently flawed. Instead, use grub_scan_disk to store the boot order, e.g.: grub_scan_disk="ahci nvme ata" grub_scan_disk="nvme ata" In the first example, it would make GRUB scan ahci first, then nvme and then ata. In the secontd example, it would make GRUB scan nvme first, and then ata. If "both" is set, or anything other than ahci/ata/nvme, grub_scan_disk is now changed to "nvme ahci ata". Actual grub_scan_disk entries in target.cfg files will now be modified, to match each machine. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-27minor correctionLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-27roms: make grubfirst if seabios_withgrub=yLeah Rowe
rather than if seabios_grubonly=y if grubonly=y, still make the grubonly rom this complements the previous commit Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-26rename include/option.sh to include/lib.shLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-26roms: rename bstr variableLeah Rowe
i forgot to do this in the recent cleanup. it is now initialised as a variable named "x" Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-26general code cleanup in the build systemLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-21fix building coreboot images on i686 hostsLeah Rowe
firstly, memtest86+ is currently not cross compiled and relies on 64-bit headers (x86_64 only). a 32-bit distro is unlikely to be able to build 64-bit binaries. secondly: vboot throws a build error due to -Werror when building on 32-bit hosts. we rely on vboot code to build cbfstool, so turn off -Werror on vboot that's all. 32-bit hosts are not recommended; it is assumed that you are building on an x86_64 host. work will go into the build system at a later date to make it more portable, by cross compiling everything, but this should fix 32-bit for now. there are some x60/t60 users who still want to build roms, so let's allow them that possibility. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-19build/roms: skip target if config/ dir missingLeah Rowe
fixes a regression when running ./build roms all now it should work again Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-19option.sh: mktar_release to mkrom_tarballLeah Rowe
that's all it's used for, to compress the rom images Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-19build/roms: rename moverom to copyromLeah Rowe
it copies, it doesn't move, so name it right Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-19minor code cleanup in the build systemLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-18build/roms: simplify serprog list commandLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>