Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] UEFI data corruption? [FIXED]
Date: Mon, 30 Sep 2019 09:03:19
Message-Id: CAGOe-ezySvzVFnsNwvmk7q_pvZadCf64WW1=fKkg4wvn28oV2g@mail.gmail.com
In Reply to: Re: [gentoo-user] UEFI data corruption? [FIXED] by Neil Bothwick
1 On Sun, 29 Sep 2019 at 13:25, Neil Bothwick <neil@××××××××××.uk> wrote:
2 >
3 > On Sun, 29 Sep 2019 11:59:00 +0100, Mick wrote:
4 >
5 > > As I understand it, 'bootctl --update' can be used to update
6 > > systemd-boot boot manager's menu and it is looking for bootable
7 > > kernels by scanning /efi, /boot, and /boot/efi, or the directory set
8 > > by passing the '--path' option to it. Manual addition of bootable
9 > > kernels must be set via /loader/entries/*.conf (one file per kernel
10 > > image) and then setting the default kernel to be booted in
11 > > /loader/loader.conf. I find all this to be unnecessary complication
12 > > for maintaining a boot manager manually, compared to using say
13 > > efibootmgr. However, it is handy to be able to press 'e' to edit the
14 > > default entry at boot time, or if new kernels are always stored where
15 > > expected by the scripts of binary distros.
16 > >
17 > > For Peter's use case, OS and kernel resides on secondary disk, the
18 > > solutions I can think are:
19 > >
20 > [snip GRUB bit]
21 >
22 > > 2. Use systemd-boot. Copy each kernel from the secondary disk to
23 > > /boot/EFI/ creating the corresponding /loader/entries/*.conf, adding
24 > > the kernel .conf name and the OS root partition's path on the
25 > > secondary disk. The root path can also/instead be included in the
26 > > kernel itself (CONFIG_CMDLINE).
27 >
28 > That's not how the systemd boot manager works. It is a bootable image
29 > which then reads the config from /boot/loader and presents a boot menu.
30 > As far as the firmware is concerned, it is always booting the same image.
31
32 Thanks Neil, I bow to your superior knowledge on systemd-boot - I've
33 only come across it on binary distros and did not have to interfere
34 with its settings. I think we're saying the same thing. I understand
35 that using a predictable naming convention for *.conf files will load
36 the corresponding kernel images in turn, but the default kernel can be
37 overwritten in loader.conf instead of using a wildcard which will pick
38 up the first *.conf file in line. Also, these .conf files will not be
39 created with 'bootctl --update' unless all requisite OS kernel images
40 have been stored in the ESP.
41
42 > The loader files are analogous to grub.cfg, but a thousand times simpler
43 > (I may be understating that in my desire to avoid hyperbole). For
44 > example, loader.conf here is
45 >
46 > timeout 3
47 > default 00-*
48 >
49 > This never needs to be modified, it simply boots the first entry after 3
50 > seconds.
51
52 Right, but if the OP wants to boot some other kernel (which happens to
53 be on his second disk) systemd-boot's image picking up the first
54 *.conf file won't be of use. He'll need to select another kernel from
55 the menu or set this in the loader.conf as a semi-permanent solution.
56 Please correct as necessary if I got this wrong.
57
58
59 > Incidentally, I use a short shell script to regenerate the menu entries
60 > after a kernel change, like grub-update but the predictable orders of
61 > magnitude shorter, so even that is trivial.
62
63 Yes, I expect Peter will also need to use some script of sorts if he
64 wishes to automate this process, or manage it manually.
65
66 --
67 Regards,
68 Mick

Replies

Subject Author
Re: [gentoo-user] UEFI data corruption? [FIXED] Neil Bothwick <neil@××××××××××.uk>