Commit Graph

84 Commits (ef7db2054639d9dde6e23186c63d83a11b3310a4)

Author SHA1 Message Date
Leah Rowe 430918ee78 grub.cfg: handle btrfs subvols for extlinux.conf
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-18 08:31:38 +00:00
Leah Rowe d74c6c7114 grub.cfg: scan extlinux/extlinux.conf
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-18 08:16:21 +00:00
Leah Rowe f1d6c14367 grub.cfg: support grub and extlinux on ata/ahci
there are special menuentries just for loading
configs, without handling luks, lvm and whatnot.
it's intended for users of cd/dvd drives. well,
now we support both extlinux and grub, with this patch.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-18 08:14:06 +00:00
Leah Rowe 6db94c1a11 grub.cfg: merge isolinux/grub usb menuentries
many modern distros use grub in their installer images,
so scan for grub.cfg first.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-18 08:05:37 +00:00
Leah Rowe c4544e04bb grub.cfg: handle extlinux in the default menuentry
isolinux/syslinux/extlinux config files should all work,
using the syslinux parser function in grub

the current behaviour is to only search for grub.cfg,
so extlinux users can't use the default libreboot setup.
with this change, their systems should hopefully work.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-18 07:58:31 +00:00
Leah Rowe eaa1341b9e grub.cfg syslinux: support ESP and extlinux.conf
the so-called EFI System Partition (ESP) is used
on many UEFI-based setups. some users may be
migrating to libreboot, so let's support it.

on BIOS setups, it would be e.g.
/boot/syslinux/syslinux.conf

on UEFI setups, it would be e.g.

/boot/EFI/syslinux/syslinux.conf

additionally, support scanning for extlinux.conf

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-18 07:46:14 +00:00
Leah Rowe b817001e29 grub.cfg: don't boot linux without a grub.cfg
the fallback code in the main menuentry is
potentially unsafe, depending on user config.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-18 06:45:56 +00:00
Leah Rowe 2d6e5ca4c4 grub.cfg: scan lvm volumes last
lvm/* is slow to resolve in grub, on some machines,
because grub enumeration is very slow in general.

however, many people will install distros with any
number of lvm configurations, so we should try to
support them.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-18 05:11:06 +00:00
Leah Rowe 49eed9ac46 Revert "grub.cfg: try luks2/crypto-lvm before non-crypto"
This reverts commit 20389655e4.

If the user actually has encryption, but has /boot unencrypted,
this will considerably slow down the boot, so the patch has
been reverted.

The patch was originally meant to favour encrypted /boot
setups, but the old behaviour also still works there.
2023-12-18 04:17:05 +00:00
Leah Rowe 20389655e4 grub.cfg: try luks2/crypto-lvm before non-crypto
when the user sets up an encrypted machine, grub.cfg
defaults to non-encrypted setups if found, first

this patch reverses the order, deferring to
non-encrypted installations only when encrypted ones
are unavailable

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-18 02:55:25 +00:00
semigel ababbc09f0 Update config/grub/config/grub.cfg
grub.cfg: add BTRFS subvol support
2023-12-18 00:56:48 +00:00
Leah Rowe 39aad57873 grub: re-add fat/nt file system modules
apparently some people use fat file systems for /boot
on linux systems

this is apparently a thing

it's ridiculous, but also a thing

a user reported they could not boot their t400 because
of those, because they have such a distro installed
on their machine

apparently it was a gentoo user

i don't really care. re-add 1980s dos file system support.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-13 22:59:33 +00:00
Leah Rowe c4d9008753 add grub mods: diskfilter,hashsum,loadenv,setjmp
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-06 18:08:46 +00:00
Leah Rowe d0d6decb56 re-add grub modules: f2fs, json, read, scsi, sleep
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-06 18:08:43 +00:00
Leah Rowe 931d646df7 Libreboot 20231106
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-06 00:55:49 +00:00
Leah Rowe 80b70d899c grub: avoid printing empty error messages
this replaces the previous behaviour, which erred
on a specific value of grub_errno, which was a
problem if other types of errors used that value.

due to the way i patch out the prefix error messages,
this new patch ensures that only those errors are
silenced. all other messages will be printed.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-05 21:59:52 +00:00
Leah Rowe ada4de5f54 further silence grub prefix errors
it still printed "error: ." on screen, instead
of the prefix message.

now it's silent. it just says:

Welcome to GRUB!

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-05 17:30:33 +00:00
Leah Rowe dd03a87b68 grub: don't print messages if a module isn't found
it can annoy some users, so just silence it. we don't need
a lot of modules so we only have a few, but some distro
grub configs can load modules frivilously.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-05 16:39:48 +00:00
Leah Rowe ab57e7a488 grub: don't print prefix errors on the screen
still set grub_errno, and behave the same, but don't
print anything. just carry on execution as normal.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-05 16:29:35 +00:00
Leah Rowe 1f1498be74 Libreboot 20231101
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-01 16:36:16 +00:00
Leah Rowe ed27ab8a2b grub.cfg: use better description in menu entries
more user friendly, especially the GRUB (USB) one

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-01 07:24:08 +00:00
Leah Rowe 026d57fff4 GRUB: don't spew "Unknown key 0xff" in error
Faulty keyboards make GRUB unusable. Normally it happens
when a user plugs in a faulty USB keyboard, but if it's
the laptop keyboard, then GRUB becomes unusable and the
user cannot boot anything.

So, your laptop keyboard is a ticking timebomb if you use
GRUB; with this patch, that's no longer the case.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-31 10:36:16 +00:00
Leah Rowe 9606c68c5b fix grub keyboard init on dell e6400 and e6430
also, enable seabios_withgrub on e6400, but not grubfirst;
right now, we also support dgpu which would brick on
grubfirst. on my tested nvidia model, loading grub from
seabios worked, so i'm going to re-add seabios_grubfirst
functionality like in older libreboot revisions, enabled
selectively on a given target.

e6430 currently only has igpu support anyway, but i've done
the same thing there, in anticipation of future dgpu support.

e6400 and e6430 ec report scancode set 2 with translation
by default, but only actually output scancode set 1

grub is trying to use scancode set 2 without scancode
translation, so the key inputs get messed up

fix it by forcing scancode set 2 with translation, but
only on coreboot; other build targets on GRUB will
retain the same behaviour as before

courtesy goes to Nicholas Chin who inspired me, and
helped me to fix this. tested on Nicholas's E6400
and E6430, and my E6400; Riku also tested it on
non-Dell, as did I (some thinkpads), and all seems OK.

The new behaviour in coreboot GRUB is essentially no
different to that of SeaBIOS, which does the same.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-31 07:30:02 +00:00
Leah Rowe 23958f4eae Libreboot 20231021
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-21 02:08:12 +01:00
Leah Rowe a06c38ce15 change default volname in grub.cfg
it's been a while since we did encrypted /boot
and the current name sucks.

it's unlikely that anyone still uses it, but
people will soon

change the default assumed lvm name to grubcrypt
and stick to that.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-21 00:02:15 +01:00
Leah Rowe 2e60e11798 grub.cfg: disable the pager
The pager causes trouble in some cases, where the user has
to press enter at boot time depending on the configuration.

Interactive use is one thing, but we should leave this
disabled for smoother experience. If the user *wishes* to
use the shell, they can always just enable the pager
themselves by doing:

set pager=1

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 22:03:10 +01:00
Leah Rowe eae173ec13 split up grub patches into subdirectories
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-25 12:03:07 +01:00
Leah Rowe 208620198c Update email address for Leah Rowe copyrights
also, some of them were out of date; years now updated.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-25 02:27:26 +01:00
Leah Rowe a69e8548b3 set grub.cfg timeout to 5s (10 on some boards)
target.cfg can now specify e.g.

grub_timeout=20

this would then be inserted as timeout.cfg in cbfs,
containing the instruction:
set timeout=20

HP laptops need a bit of extra time, due to the delay
caused by the EC bug workaround deployed in GRUB

desktops in general need extra time. this too is set to
10s, like the HP laptops.

only insert timeout.cfg if actually needed (declared in
target.cfg), otherwise grub.cfg will default to 5s

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-09 00:01:22 +01:00
Leah Rowe 7e8465bec8 grub: re-add module: play
for example, the beep sound in debian's installer needs
this module.

the cute ding in the arch/artix menu also needs it

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-06 09:39:44 +01:00
Leah Rowe c92a596cb9 grub: remove xnu module
this causes a saving of about 131KB uncompressed, when
i tested. we don't need mach kernel support. nobody will
ever use it.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-04 04:22:58 +01:00
Leah Rowe e659ddd849 grub: remove legacy file system modules
this causes a 6.7% decrease in the payload size

these file systems are microsoft(fat, ntfs) or mostly
oldschool amiga and beos file systems

also remove minix modules, and some old linux file
systems that nobody will use in 2023

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-04 04:16:45 +01:00
Leah Rowe cf5357856c re-add grub modules cat, eval and pbkdf2
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-04 03:49:03 +01:00
Leah Rowe da3c9bb3c5 merge config/ and resources/
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-04 02:47:25 +01:00