On Friday, 25 October 2019 16:33:07 BST Mick wrote:
> If you intend to have a list of available OS kernels displayed for you to
> choose from at boot time, then you need a Boot Manager (eLILO, GRUB,
> systemd- boot, et al.) and will *have* to follow the respective Boot
> Manager's conventions regarding its configuration and storage/naming of
> kernel images.
That's the key. It's clear that I haven't understood what was going on until
now. Mind you, I've not been helped by the plethora of mutually contradictory
wiki and other articles purporting to guide me through the boot process - for
instance, should my boot partition (FAT32) be mounted on /efi, /boot or
/boot/efi? All are recommended in various places. Mine is on /boot.
To sum up: I didn't need efibootmgr at all, except to remove an entry I'd
created before. I did need bootctl from sys-boot/systemd-boot, and I had to
'bootctl install' it without any configuration files under /boot. I also
needed a machine ID in /etc/machine-id, without which 'bootctl install'
refused to do anything.
The procedure was:
1. Format /dev/nvme0n1p2 as FAT32 and mount it on /boot.
2. Build and install the kernel.
3. Run bootctl install.
4. Write /boot/loader/loader.conf, and suitable .conf files under
/boot/loader/entries.
That still left an empty /boot/<machine-id> directory. I may risk removing it
some time.
I've assembled some notes on my /boot contents, attached.
> PS. Happy to discuss specifics off-list if you think this is less of a
> Gentoo issue.
Thanks Mick; that's generous. For the moment though I think I needn't trouble
You. :)
--
Regards,
Peter.
#### This is the layout of my FAT32 /boot partition:
# tree /boot
/boot
├── 4eec63dc92f83de25e1e2e485d7f6536
├── config-4.19.72-gentoo
├── config-4.19.72-gentoo-rescue
├── early_ucode.cpio
├── EFI
│ ├── BOOT
│ │ └── BOOTX64.EFI
│ └── systemd
│ └── systemd-bootx64.efi
├── intel-uc.img
├── loader
│ ├── entries
│ │ ├── 08-gentoo-4.19.72-rescue.conf
│ │ ├── 09-gentoo-4.19.72-rescue.nonet.conf
│ │ ├── 30-gentoo-4.19.72.conf
│ │ ├── 32-gentoo-4.19.72.nox.conf
│ │ └── 34-gentoo-4.19.72.nonet.conf
│ ├── loader.conf
│ └── random-seed
├── System.map-4.19.72-gentoo
├── System.map-4.19.72-gentoo-rescue
├── vmlinuz-4.19.72-gentoo
└── vmlinuz-4.19.72-gentoo-rescue
7 directories, 17 files
#### A couple of files:
# cat /boot/loader/loader.conf
default 30-gentoo-4.19.72
timeout 15
# cat /boot/loader/entries/30-gentoo-4.19.72.conf
title Gentoo Linux 4.19.72
linux /vmlinuz-4.19.72-gentoo
options root=/dev/nvme0n1p4 initrd=/intel-uc.img net.ifnames=0
#### What the NVRAM and boot programs know about the system:
# efibootmgr
BootCurrent: 0005
Timeout: 1 seconds
BootOrder: 0005,0003,0001,0002
Boot0001* CD/DVD Drive
Boot0002* Hard Drive
Boot0003* UEFI OS
Boot0005* Linux Boot Manager
#### (Boot0005 was created by 'bootctl install')
# bootctl status
System:
Firmware: UEFI 2.31 (American Megatrends 5.09)
Secure Boot: disabled
Setup Mode: user
Current Boot Loader:
Product: systemd-boot 243
Features: ✓ Boot counting
✓ Menu timeout control
✓ One-shot menu timeout control
✓ Default entry control
✓ One-shot entry control
✓ Support for XBOOTLDR partition
✓ Support for passing random seed to OS
ESP: /dev/disk/by-partuuid/c39faa8e-3fce-4113-bc7e-ab31cb896cf8
File: └─/EFI/systemd/systemd-bootx64.efi
Random Seed:
Passed to OS: no
System Token: not set
Exists: yes
Available Boot Loaders on ESP:
ESP: /boot (/dev/disk/by-partuuid/c39faa8e-3fce-4113-bc7e-ab31cb896cf8)
File: └─/EFI/systemd/systemd-bootx64.efi (systemd-boot 243)
File: └─/EFI/BOOT/BOOTX64.EFI
Boot Loaders Listed in EFI Variables:
Title: Linux Boot Manager
ID: 0x0005
Status: active, boot-order
Partition: /dev/disk/by-partuuid/c39faa8e-3fce-4113-bc7e-ab31cb896cf8
File: └─/EFI/systemd/systemd-bootx64.efi
Title: UEFI OS
ID: 0x0003
Status: active, boot-order
Partition: /dev/disk/by-partuuid/c39faa8e-3fce-4113-bc7e-ab31cb896cf8
File: └─/EFI/BOOT/BOOTX64.EFI
Boot Loader Entries:
$BOOT: /boot (/dev/disk/by-partuuid/c39faa8e-3fce-4113-bc7e-ab31cb896cf8)
Default Boot Loader Entry:
title: Gentoo Linux 4.19.72
id: 30-gentoo-4.19.72
source: /boot/loader/entries/30-gentoo-4.19.72.conf
linux: /vmlinuz-4.19.72-gentoo
options: root=/dev/nvme0n1p4 initrd=/intel-uc.img net.ifnames=0
#### End of bootctl status.