Commit Graph

413 Commits (32e1b1341612cb071b544885e1f9e2dc318d2e6f)

Author SHA1 Message Date
Leah Rowe 3097a9e97a roms: merge build_uboot_payload to build_payloads
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-19 00:09:29 +01:00
Leah Rowe ccb330ec09 roms: simplify payload_uboot y/n check
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-19 00:09:23 +01:00
Leah Rowe 49c41411bd roms: simplify the check for serprog srcdir
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-18 02:34:08 +01:00
Leah Rowe 8136b640b9 roms: simplify the loop for building serprog roms
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-18 02:34:03 +01:00
Leah Rowe 6976a4edb2 roms: shorten variable serprog_boards_dir
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-18 02:33:57 +01:00
Leah Rowe 4a3ab3ad1c roms: simplified serprog image copy
use eval to avoid having two mv commands

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-18 01:52:25 +01:00
Leah Rowe 64ce81d2b6 roms: rename picosrc variable to rp2040src
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-18 01:52:18 +01:00
Leah Rowe e3471b22e7 roms: remove useless confirmation in mkserprogfw
the user knows where to look. replace it with a single
declaration.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-18 01:52:12 +01:00
Leah Rowe a8fb99a750 roms: merge serprog build into one function
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-18 01:52:06 +01:00
Leah Rowe b1ec5ad719 roms: remind the user about gkb files
nowadays, we don't insert GRUB keymaps automatically, for
sake of efficiency; without one, the default is US QWERTY.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-17 15:52:18 +01:00
Leah Rowe a93f519799 roms: rename x variable to it in for loop
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-17 15:07:56 +01:00
Leah Rowe faff6f0348 roms: don't use x_ to call cproms()
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-16 18:00:05 +01:00
Leah Rowe f43525d14f roms build_uboot_roms(): move rom, don't copy
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-16 17:59:59 +01:00
Leah Rowe dd2854b3e8 roms cproms(): allow other commands besides cp
e.g. the operator might specify mv instead

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16 17:59:49 +01:00
Leah Rowe a8f44ab80a unify coreboot elfdir (DO_NOT_FLASH)
use a common string when setting this path

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16 17:58:50 +01:00
Leah Rowe be04f59602 roms: merge mkUbootRom() into build_uboot_roms()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16 17:58:44 +01:00
Leah Rowe a9819d7385 roms: simplify mkSeabiosRom()
remove variables that are not meaningfully used

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16 13:26:47 +01:00
Leah Rowe 19baf8d1a7 roms: simplify mkUbootRom()
remove variables that are not meaningfully used

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16 13:26:42 +01:00
Leah Rowe 935958e6a4 roms: simplify build_roms()
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-16 13:26:37 +01:00
Leah Rowe acd5d16961 roms: remove unnecessary check
uboot_config is later only used if payload_uboot is set

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16 13:26:30 +01:00
Leah Rowe 6094542663 build: remove unused variables
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16 12:39:30 +01:00
Leah Rowe 94b9bd44e4 roms: further clean up build_grub_roms()
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-16 01:20:00 +01:00
Leah Rowe 167f81a993 roms: simplify timeout/scandisk insertion
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-16 01:19:55 +01:00
Leah Rowe d958b16369 roms: simplify seagrub check in build_grub_roms
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16 01:19:49 +01:00
Leah Rowe 726b56b2f1 roms: simplify mkserprog()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16 00:54:24 +01:00
Leah Rowe dd59f2daba roms: simplify the serprog build functions
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16 00:54:18 +01:00
Leah Rowe 9897bc748d script/roms: fix serprog build commands
forgot to shift

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-16 00:54:13 +01:00
Leah Rowe 3269e0c097 roms: simplified ubootelf check
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-15 23:59:59 +01:00
Leah Rowe 7265b9f112 roms: simplify grubonly check in configure_target
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-15 23:59:54 +01:00
Leah Rowe c29b3ec3fc roms: simplify seagrub check in configure_target
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-15 23:59:50 +01:00
Leah Rowe f07aa84d49 roms: don't use x_ to call build_grub_roms
build_grub_roms never returns a non-zero value

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-15 23:59:45 +01:00
Leah Rowe ed921d7890 trees: simplify copy_elf()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-15 23:19:02 +01:00
Leah Rowe 293777fb99 trees: remove unnecessary check in copy_elf
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-15 23:18:57 +01:00
Leah Rowe b50a588cba grub: insert background in memdisk instead
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-15 23:18:51 +01:00
Leah Rowe 7f5adffc02 roms: unify all add-payload commands
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-15 23:18:47 +01:00
Leah Rowe 82c6a352df roms: don't add grub keymaps at all
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-15 23:18:41 +01:00
Leah Rowe f1aea87141 roms: merge handle_coreboot_target into main()
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-15 23:18:35 +01:00
Leah Rowe ae9dce889b roms: simplify target check (whether roms built)
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-15 23:18:30 +01:00
Leah Rowe bb4f0995d1 roms: simplify main() again
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-15 23:18:24 +01:00
Leah Rowe 59392ea0bb roms: remove redundant check on grub_scan_disk
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-15 23:17:51 +01:00
Leah Rowe e96d85dc76 roms: remove dangerous runtime p/s/d options
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-15 23:17:46 +01:00
Leah Rowe bb7b04cb59 unified checks for variable initialisation
new function chkvars() does the job

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-15 23:17:27 +01:00
Leah Rowe 1399f2137f lib.sh: remove the items() function
it's pretty much just doing the same thing as ls -1

remove it!

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-15 23:17:06 +01:00
Leah Rowe 4ed6e41221 roms: simplify main()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-15 23:16:45 +01:00
Leah Rowe 250f59bfb1 Canoeboot 20240612 release
Signed-off-by: Leah Rowe <info@minifree.org>
2024-06-12 10:38:51 +01:00
Leah Rowe a2de05cf8e coreboot nasm: use coreboot mirror as backup
don't use the macports mirror, because it's not certain
whether those tarballs will always be there. use the
coreboot one as a backup instead, and nasm.us as main

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-12 09:23:53 +01:00
Leah Rowe 581d4a66ac grub: only enable nvme if needed on a board
remove nvme support from the "default" grub tree

now there are three trees:

* default: no xhci or nvme patches
* nvme: contains nvme support
* xhci: contains xhci and nvme support

this is in case a bug like lbmk issue #216 ever occurs
again, as referenced before during lbmk audit 5

there is no indication that the nvme patch causes any
issues, but after previous experience i want to be sure

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-12 09:17:27 +01:00
Leah Rowe dc9f5a6e48 fix nasm download path for coreboot/fam15h
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-11 10:45:59 +01:00
Leah Rowe 4f6fbfde81 minor code cleanup in the build system
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09 19:18:41 +01:00
Leah Rowe 070aee6728 re-add ability to use cbfs grub.cfg as default
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-09 16:35:12 +01:00