Commit Graph

134 Commits (bd517a3d27f22ca2613634f1d6b7acf531f53dab)

Author SHA1 Message Date
Leah Rowe d08b175a0d rom.sh: re-add seabios-only roms and grub keymaps
this time, only handle multiple keymaps on seagrub
images. for images where seabios is first but does
not immediately load grub, whether grub is still
available in flash, just do one image (US Qwerty)

this still results in fewer images per target than
Libreboot 20240612, but should prevent most users
from being annoyed. i got a few people asking
repeatedly, and i hadn't documented yet how to add
keymap.gkb or how to remove bootorder, to get a
different keymap or disable seagrub respectively.

i anticipate that i'll get such questions a lot, even
if i do document it, so i'm reversing that decision.

it doesn't result in much extra code. the new design
in lbmk makes this sort of thing much simpler.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-22 09:32:21 +01:00
Leah Rowe f0c25c7258 include/rom.sh: use ccache when building coreboot
ccache now required, in build dependencies

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-21 22:30:53 +01:00
Alper Nebi Yasak a9997082d7 u-boot: Fix display initialization on gru boards
U-Boot has migrated to using upstream device-tree files for gru boards,
but the clock driver doesn't yet support setting rates for a certain
clock that upstream uses for the eDP display. It happens to work without
it, so for now remove the clock setting until the driver is fixed.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2024-07-12 16:41:34 +01:00
Alper Nebi Yasak 5b170de055 u-boot: Avoid breaking build for U-Boot-only binman images
Commit 46e01c0e1dad ("u-boot: Avoid building U-Boot-only binman images")
added a patch that prevents an error while building U-Boot, due to some
U-Boot images needing a copy of BL31 that we are not passing in.

Removing build instructions for these images isn't really necessary,
when we can instead tell the build tool that it shouldn't exit with an
error. It checks a BINMAN_ALLOW_MISSING environment variable for this,
but just unconditionally replace the check with the argument.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2024-07-12 16:41:25 +01:00
Alper Nebi Yasak d442d61f84 u-boot: Update to v2024.07
Set default U-Boot revision to v2024.07 and rebase patches on top of
that. One patch that fixes drawing box characters (UTF-8 to CP437) had
an alternative merged, another hack we have to fix regulator issues is
no longer neccessary as the issue is fixed, and my QEMU patches were
merged upstream, so drop these patches. One patch we have to disable
binman images can be replaced by a simpler alternative so drop it too.

Upstream kconfig status is still unstable, so updating configs with
`make oldconfig` would miss important upstream changes, since they rely
on carrying defaults via upstream defconfigs. Update the configs as
such, like before:

- Turn old configs into defconfigs (./update trees -s u-boot)
- Save the diff from old upstream defconfig (diffconfig $theirs $ours)
- Update U-Boot revision, rebase patches, and clean old trees
- Prepare new U-Boot tree (./update trees -f u-boot)
- Review the diffconfigs to see if any options were renamed upstream
- Copy over the new upstream defconfigs and apply earlier diff
- Turn new defconfigs into configs (./update trees -l u-boot)

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2024-07-12 16:40:44 +01:00
Leah Rowe a258eb231a trees: remove project-specific hacks
move the coreboot-specific includes into mkhelper.cfg
for that project.

on some projects, we need variables from mkhelper.cfg
to be global, so I was including serprog and coreboot
mkhelper.cfg files in this script.

instead, set a new variable "mkhelpercfg" pointing to
the config file. if it doesn't exist, create and then
point to a temporary (empty) mkhelper.cfg file.

the rom.sh include has been moved to coreboot mkhelper.cfg

The only remaining project-specific logic, in this trees
script, is now the coreboot crossgcc handling, but this
needs to be there as it's also used to build U-Boot.

The way this now works, certain includes are done twice.
For example, include/rom.sh will be included once globally,
outside of main(), and then again in configure_project().

This means that certain functions will be defined twice.
I'm uncertain if shell has anything equivalent to an ifdef
guard as in C, but we actually want this here anyway, and
it shouldn't cause any problems. It's a bit of a hack, but
otherwise results in much cleaner code.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-12 16:37:17 +01:00
Leah Rowe 4dbce8aef0 trees: support -d (dry run) for custom build logic
-d does the same as -b, except for actually building
anything! in effect, it does the same as -f (fetch)
except that the resulting variable assignments will
not be recursive (as with -f).

if -d is passed, configuration is still loaded, defconfig
files are still cycled through, and more importantly:

helper functions are still processed.

the grub, serprog and coreboot helper functions have
been modified to return early (zero status) if -d is
passed.

example usage:

./update trees -d coreboot x230_12mb

this would download the files, NOT build coreboot, and
NOT build the payloads.

there is one additional benefit to doing it this way:

the utils command has been removed, e.g.
./update trees -b coreboot utils default

the equivalent is now:
./update trees -d coreboot default

the overall effect of this change is that the trees script
no longer contains any project-specific logic, except for
the crossgcc build logic.

it does include some config/data mkhelper files at the top,
for serprog and coreboot, so that those variables defined in
those files can be global, but another solution to mitigate
that will also be implemented in a future commit.

the purpose of this and other revisions (in the final push
to complete lbmk audit 6 / cbmk audit 2) is to generalise as
much logic as possible, removing various ugly hacks.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-12 16:34:46 +01:00
Leah Rowe e01995d491 rom.sh: new file, to replace script/roms
stub it from the trees script. the way it works now,
there is less code in the build system.

./build roms

this is no longer a thing

./build roms serprog

this is also no longer a thing. instead, do:

./update trees -b coreboot targetnamehere

./update trees -b pico-serprog

./update trees -b stm32-vserprog

the old commands still works, which causes the new
commands to run

coreboot roms now appear in elf/, not bin/, as before,
but those images now contain payloads.

NOTE: to contradict the above: ./build roms is no
longer a thing, in that it's now deprecated, but
backward compatibility is present for now. it will
be removed in a future release.

./build roms list also still works! it will do:
./update trees -b coreboot list

also:
./update trees -b grub list
this is now possible too

if a target "list" is provided, for multi-tree sources,
the targets are shown.

there is another difference: seagrub roms are now seagrub_,
instead of seabios_withgrub.

seabios-only roms are no longer provided, where grub is also
enabled; only seagrub is used. the user can easily remove
the bootorder file, if they want seabios to not try grub first.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-08 01:37:26 +01:00
Leah Rowe e5262da7ca coreboot: set build_depend on target.cfg files
set a default one in mkhelper.cfg

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-08 01:34:52 +01:00
Leah Rowe 1b75d738bf GRUB: only load xhci from grub.cfg
don't put it in the install modules.

this works around a hanging issue on haswell thinkpads.

when any usb device is inserted, GRUB will sometimes
hang if started from the SeaBIOS payload, *while* the
USB device is plugged in.

plugging in the USB device after GRUB starts worked.
it will have to be investigated more at a later date,
but this simply configuration change works.

the xhci module is already loaded explicitly, in grub.cfg

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-08 01:33:51 +01:00
Leah Rowe bfeab80a8d trees: just do makeargs on coreboot, not cbmakearg
stick the makeargs in mkhelper

i previously did cbmakeargs because the old revisions
had to define makeargs per-target otherwise. mkhelper
was done specifically to solve that problem.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-08 01:33:35 +01:00
Leah Rowe 1fe126501a GRUB: use mkhelper.cfg for common variables
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-01 03:36:10 +01:00
Leah Rowe 7451fa629c trees: don't hardcode use of mkpayload_grub
instead, make it a helper function, defined in target.cfg

this means that we can also do the same with other projects
in the future, and it is expected that we will have to.

these helper functions are used in cases where we want
additional actions to be performed.

actually, the helper could be anything. for example, you
could write:

mkhelper="./build foo bar"

and it would do that (at the point of execution, PWD
is the root directory of the build system)

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27 23:19:08 +01:00
Leah Rowe cf4f828dbe trees: avoid kconfig make commands generically
don't hardcode the check based on whether the current
project is grub. instead, define "btype" in target.cfg

if unset, we assume kconfig and permit kconfig commands
e.g. make menuconfig, make silentoldconfig, etc

this is to avoid the deadliest of sins:
project-specific hacks

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27 16:23:37 +01:00
Leah Rowe 8a02aef1d8 remove unused git modules
bios_extract, biosutilities and uefitool are used
by lbmk, but not by cbmk.

remove these. they were accidentally added during
cherry-picking of lbmk patches.

no harm done, because they are freue software packages
so they don't violate canoeboot's policy, but they are
nonetheless superfluous in the canoeboot project.

Signed-off-by: Leah Rowe <info@minifree.org>
2024-06-23 11:49:42 +01:00
Leah Rowe 852eb1db4f roms: only support SeaBIOS/SeaGRUB on x86
Never, ever build images where GRUB is the primary payload.

These options have been removed from target.cfg handling:

* seabios_withgrub
* grub_withseabios

The "payload_grub" variable now does the same thing as
the old "seabios_withgrub" variable, if set.

The "grubonly" configuration is retained, and enabled by
default when SeaGRUB is enabled (non-grubonly also available).

Due to lbmk issue #216, it is no longer Libreboot policy to
make GRUB the primary payload on any board. GRUB's sheer size
and complexity, plus the large number of memory corruption issues
similar to it that *have* been fixed over the years, tells me
that GRUB is a liability when it is the primary payload.

SeaBIOS is a much safer payload to run as primary, on x86, due
to its smaller size and much more conservative development; it
is simply far less likely to break.

If GRUB breaks in the future, the user's machine is not
bricked. This is because SeaBIOS is the default payload.

Since I no longer wish to ever provide GRUB as a primary
payload, supporting it in lbmk adds needless bloat that
will later probably break anyway due to lack of testing,
so let's just assume SeaGRUB in all cases where the user
wants to use a GRUB payload.

You can mitigate potential security issues with SeaBIOS
by disabling option ROM execution, which can be done at
runtime by inserting integers into CBFS. The SeaBIOS
documentation says how to do this.

Libreboot's GRUB hardening guide still says how to add
a bootorder file in CBFS, making SeaBIOS only load GRUB
from CBFS, and nothing else. This, combined with the
disablement of option ROM execution (if using Intel
graphics), pretty much provides the same security benefits
as GRUB-as-primary, for example when setting a GRUB password
and GPG checks, with encrypted /boot as in the hardening guide.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-23 01:19:47 +01:00
Leah Rowe dec9ae9b43 lib.sh: more unified config handling
replace it with logic that simply uses "." to load
files directly.

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-22 13:50:43 +01:00
Leah Rowe c2ca92a169 roms: don't insert timeout.cfg
this is bloat, because it's something the user can already
do at runtime configuration anyway.

set it to a reasonable default of 8 seconds instead of 5,
and don't honour the timeout variable in target.cfg.

this will be documented in the next release.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-19 14:34:19 +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 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
fuel-pcbox 323a17d0c8 Add dependency scripts for Fedora 40 and Ubuntu 24.04 2024-06-09 07:44:45 +01:00
Leah Rowe 62b2310a28 add crossgcc tarballs to config/submodules/
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-09 07:38:03 +01:00
Leah Rowe 8a34a0d338 git.sh: support downloading *files* as submodules
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-09 07:35:15 +01:00
Leah Rowe 99418a7e82 define mdfiles/images in config/submodules/docs/
again: the "depend" variable must never be used for subprojects
that point to a subdirectory of the main project, because there's
no clean way of handling this in case of error conditions.

make it a submodule under config/submodules/. this is for the
documentation, including static site generator documentation,
and image files (photos).

as of this revision, there are now only those "depend" projects
defined in config/git/, where the destination directory of the
subject is not a subdirectory of the main project, so:

in a subsequest revision, i will mitigate an existing bug whereby
failure of the dependency project leaves the main one still
intact, breaking builds; this revision enables that to be done.

from now on, subproject-to-subdirectory-of-main-project will
be avoided in config/git/; config/submodules/ will be used.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07 17:37:41 +01:00
Leah Rowe 83d84797d8 libopencm3 to config/submodules/ on stm32-vserprog
same as the previous patch, we must no longer use "define"
variables in config/git/ when the path is a subdirectory of
a given project, because it means that the download can only
happen after the main one, and currently if that fails, the
download of the main repo would remain intact, breaking future
builds in ways that we can't control - to be clear, it could
be controlled, but with added code complexity in the build
system, so:

put it in config/submodules/

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07 17:34:24 +01:00
Leah Rowe c3cabcddf9 add tinyusb to config/submodule/ for pico-sdk
don't define it as a "depend" variable in config/git/,
because it means putting the files in a subdirectory of
an existing project was was already then downloaded, and
that means it can't be downloaded first; if the download
of it fails, the old download is left intact.

this bug isn't currently fixed in the build system, at all,
so this and other patches are being made to mitigate it.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07 17:34:18 +01:00
Leah Rowe 4749a5a29f put memtest86plus builds in elf/memtest86plus/
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07 17:31:00 +01:00
Leah Rowe 0e9d9b33b2 put flashprog builds in elf/flashprog/
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07 17:30:55 +01:00
Leah Rowe 7d99786a1a handle build.list from config/data/, not config/
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>
2024-06-07 17:27:45 +01:00
Leah Rowe 4e25e335ed bump untitled revision again
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-04 14:17:04 +01:00
Leah Rowe 44ef38b335 bump untitled revision in git config
it imports the same environmental variable fix because
i had the same buggy TMPDIR check there. i fixed that
upstream in untitled.

import the new untitled revision.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-04 14:06:57 +01:00
Leah Rowe eb4ac3c334 make GRUB multi-tree and re-add xhci patches
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, but we still don't
need xHCI support in Canoeboot's GRUB because none of the
available coreboot targets have xHCI support. However, we
may want it in the future and it helps to keep Canoeboot
in sync with Libreboot (this patch is adapted from lbmk).

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.

There is another reason for merging this design change from
lbmk, and that reasoning also applies to lbmk. Specifically:

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-06-02 22:41:46 +01:00
Leah Rowe 347a104ae6 u-boot on qemu: remove currently unused x86 target
it doesn't build, at present, but isn't used by any
coreboot targets, so the build issue does not come up
during release builds, but i did find it laying around
during my audits.

x86 qemu is on todo for libreboot, on all x86 boards,
but the current config is broken, so: remove it.

it's very much a requirement that anything in lbmk should
work.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-02 22:29:11 +01:00
Leah Rowe 23e66c113d grub.cfg: scan /boot/grub.cfg last
very unlikely to exist. in fact, should i remove it?

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-02 22:29:05 +01:00
Leah Rowe 6151316b91 grub.cfg: scan grub2/ last
it's very unlikely that someone would use this
directory name nowadays, and i had half a mind
to remove it altogether

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-02 22:28:59 +01:00
Leah Rowe 36b3be95cf grub.cfg: search a reduced list of devs/partitions
in practise, the machines we support don't have
the option of including so many disks; 8 seems like
the most reasonable default. additionally, it's
unreasonable to expect *20 partitions*

this hardcoding is done to avoid using *, which is
slow in grub on some machines (the grub kernel always
re-enumerates the devices during every operation,
without caching any of it)

yet, the hardcoding is also slow; balance it a bit
better by searching fewer permutations, but not so few
that it would likely break a lot of setups

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-02 22:28:53 +01:00
Leah Rowe 71a17efc06 grub.cfg: scan grub.cfg from ESP
we already supported syslinux but not grub

support grub by scanning for the most common paths,
based on the most popular distros

we don't hardcode this with * because it slows down
the boot, and in practise many distros still use the
same grub.cfg location as in BIOS systems (the EFI
one is often just a link to the BIOS one)

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-02 22:28:46 +01:00
Leah Rowe 8bc7e3a539 grub.cfg: split up try_user_config
in the next revision, i will add ESP paths

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-02 22:28:39 +01:00
Leah Rowe cb4bacc9d9 grub.cfg: don't search for *_grub.cfg
this is a relic from the old days when we didn't
automated the grub.cfg logic as much. these days,
the grub.cfg logic is able to boot almost all distros
without any manual intervention or override.

removing these entries will speed up the boot in general

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-02 22:28:13 +01:00
Leah Rowe ea7e6e1659 grub.cfg: remove unnecessary path for isolinux
the path "/boot/EFI" is unnecessary because the ESP
is always a FAT32 partition, so we don't need to
scan it as a subdirectory within a subdirectory.

the ESP is always mounted as its own partition,
FAT32, and EFI/ is always at the root of it

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-02 22:27:14 +01:00
Leah Rowe 1beca3b781 grub.cfg: don't scan EFI on btrfs subvols
the esp is always a fat32 partition so this makes no sensgrub.cfg: don't scan EFI on btrfs subvols

the esp is always a fat32 partition so this makes no sense

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-02 22:27:05 +01:00
Luke T. Shumaker 0662519cca Fix building vboot on i686 2024-06-02 22:26:42 +01:00
Leah Rowe 2c1f6f5e7a do not allow dashes in coreboot target names
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-29 10:27:22 +01:00
Leah Rowe bcb65846d3 grub.cfg: actually support setting boot order
replace variables ahcidev/atadev/nvmedev with a single
one named bootdev

the for loop goes through grub_scan_disk, so now it is
effectively a bootorder configuration

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-29 10:25:58 +01:00
Leah Rowe 724dbfe0ce grub.cfg: add spdx header
it has always been gpl 3 or later, but it helps to have
the license declaration within the file

there's a copying file anyway. put spdx in the config

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-27 23:36:33 +01:00