Gentoo Archives: gentoo-user

From: Michael <confabulate@××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Exact setting in grub to default to a kernel by name?
Date: Sun, 13 Jun 2021 18:46:48
Message-Id: 12790259.uLZWGnKmhe@lenovo.localdomain
In Reply to: Re: [gentoo-user] Exact setting in grub to default to a kernel by name? by Neil Bothwick
1 On Sunday, 13 June 2021 19:05:29 BST Neil Bothwick wrote:
2 > On Sun, 13 Jun 2021 09:33:57 -0400, Walter Dnes wrote:
3 > > On Sun, Jun 13, 2021 at 06:46:15AM +0200, Hund wrote
4 > >
5 > > > >Let me rephrase the question more generally... given a
6 > > > >kernel "/boot/vmlinuz-fubar" how and where do I specify it by name as
7 > > > >the default boot kernel?
8 > > >
9 > > > What about this?
10 > > >
11 > > > https://www.stephenrlang.com/2017/06/setting-default-kernel-in-grub2/
12 > > >
13 > > Is /boot/grub/grub.cfg the file that actually controls bootup, and is
14 > >
15 > > all 154 lines of verbosity really necessary? For menu entries I see...
16 >
17 > Not necessary, but does no harm either. The first 90% of the file is
18 > automated setup, which you can replace with hard coded entries or just
19 > leave it to its own devices. The only part you need to think about is the
20 > menuentry sections.
21 >
22 > > I'd be tempted to do a manual gub.cfg if I had documentation.
23 >
24 > GRUB has extensive documentation. it's not the best written but every
25 > configuration option is described.
26 >
27 > Isn't this a new laptop? If so, why torment yourself with GRUB when you
28 > have UEFI available to you? The only real justification for using GRUB in
29 > such a situation is that you are completely familiar with it and don't
30 > want to learn something else. But if you have to learn something, you may
31 > as well learn the 2/3 line configs of systemd-boot.
32 >
33 > Note that systemd-boot doesn't require systemd, it's just the gummiboot
34 > boot manager that was merged into systemd taken out again. Or you could
35 > use rEFInd if you prefer a prettier boot menu.
36
37 I do like rEFInd, feels AppleMac-like. :-)
38
39 However, I have abandoned all boot managers these days on UEFI MoBos and just
40 use the native UEFI firmware to boot with.[1] It's simpler, lighter and
41 faster. However, I don't boot into different OS/kernels unless I have to and
42 when I do I have to use the UEFI menu GUI to switch OS/kernels, so this won't
43 suit all use cases.
44
45 This approach requires to enable the 'EFI boot stub' option in the kernel, so
46 that the UEFI firmware can recognise and load the kernel directly as an EFI
47 executable.[2] Then it is a matter of using the efibootmgr on the CLI to set
48 up my boot menu labels and OS/kernel order.[3]
49
50 [1] https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/
51 Bootloader#Alternative_2:_efibootmgr
52 [2] https://wiki.gentoo.org/wiki/EFI_Stub
53 [3] https://wiki.gentoo.org/wiki/Efibootmgr

Attachments

File name MIME type
signature.asc application/pgp-signature