1 |
On Sun, 29 Sep 2019 11:59:00 +0100, Mick wrote: |
2 |
|
3 |
> As I understand it, 'bootctl --update' can be used to update |
4 |
> systemd-boot boot manager's menu and it is looking for bootable |
5 |
> kernels by scanning /efi, /boot, and /boot/efi, or the directory set |
6 |
> by passing the '--path' option to it. Manual addition of bootable |
7 |
> kernels must be set via /loader/entries/*.conf (one file per kernel |
8 |
> image) and then setting the default kernel to be booted in |
9 |
> /loader/loader.conf. I find all this to be unnecessary complication |
10 |
> for maintaining a boot manager manually, compared to using say |
11 |
> efibootmgr. However, it is handy to be able to press 'e' to edit the |
12 |
> default entry at boot time, or if new kernels are always stored where |
13 |
> expected by the scripts of binary distros. |
14 |
> |
15 |
> For Peter's use case, OS and kernel resides on secondary disk, the |
16 |
> solutions I can think are: |
17 |
> |
18 |
[snip GRUB bit] |
19 |
|
20 |
> 2. Use systemd-boot. Copy each kernel from the secondary disk to |
21 |
> /boot/EFI/ creating the corresponding /loader/entries/*.conf, adding |
22 |
> the kernel .conf name and the OS root partition's path on the |
23 |
> secondary disk. The root path can also/instead be included in the |
24 |
> kernel itself (CONFIG_CMDLINE). |
25 |
|
26 |
That's not how the systemd boot manager works. It is a bootable image |
27 |
which then reads the config from /boot/loader and presents a boot menu. |
28 |
As far as the firmware is concerned, it is always booting the same image. |
29 |
|
30 |
The loader files are analogous to grub.cfg, but a thousand times simpler |
31 |
(I may be understating that in my desire to avoid hyperbole). For |
32 |
example, loader.conf here is |
33 |
|
34 |
timeout 3 |
35 |
default 00-* |
36 |
|
37 |
This never needs to be modified, it simply boots the first entry after 3 |
38 |
seconds. That entry here is |
39 |
|
40 |
title Desktop |
41 |
version 5.3.1-gentoo |
42 |
linux /vmlinuz-5.3.1-gentoo |
43 |
options root=LABEL=yooden rd.luks.uuid=luks-d879a686-39f3-4331-b35e-7744468b5ce3 rootfstype=btrfs rootflags=rw,noatime,ssd,space_cache rd.shell net.ifnames=0 init=/lib/systemd/systemd |
44 |
initrd /intel-uc.img |
45 |
initrd /initramfs-5.3.1-gentoo.img |
46 |
|
47 |
As you can see, the only vaguely complex part is the list of kernel |
48 |
options, and most of that is options for the root filesystem which the |
49 |
kernel would need for any bootloader. |
50 |
|
51 |
Incidentally, I use a short shell script to regenerate the menu entries |
52 |
after a kernel change, like grub-update but the predictable orders of |
53 |
magnitude shorter, so even that is trivial. |
54 |
|
55 |
I have tried reFind and AFAIR it works in a similar way, although I |
56 |
stopped using it as I wasn't interested in the fancy graphical boot menu. |
57 |
|
58 |
|
59 |
-- |
60 |
Neil Bothwick |
61 |
|
62 |
Why is bra singular and pants plural? |