1 |
On 09/06/2020 12:07, Peter Humphrey wrote: |
2 |
> On Tuesday, 9 June 2020 15:56:52 BST Peter Humphrey wrote: |
3 |
> # cat /boot/loader/entries/30-gentoo-5.7.1.conf |
4 |
> title Gentoo Linux 5.7.1initrd=/intel-uc.img |
5 |
> linux /vmlinuz-5.7.1-gentoo |
6 |
> options root=/dev/nvme0n1p4 initrd=/intel-uc.img net.ifnames=0 raid=noautodetect |
7 |
|
8 |
Since you are using systemd-boot or something that fulfils that |
9 |
specification[1], you can also build your kernel with EFI stub enabled |
10 |
(CONFIG_EFI_STUB) and then simply put the binary in: |
11 |
|
12 |
${ESP}/EFI/Linux/vmlinuz-5.7.1-gentoo.efi |
13 |
|
14 |
You can then run `bootctl set-default vmlinuz-5.7.1-gentoo.efi` or on |
15 |
the menu, select it and press d to set it within systemd-boot. |
16 |
|
17 |
(My ASUS motherboard for some reason never lets me write EFI variables |
18 |
from within Linux so I have to do it from within systemd-boot.) |
19 |
|
20 |
You can specify the options in the kernel configuration as well: |
21 |
|
22 |
CONFIG_CMDLINE="root=/dev/nvme0n1p4 initrd=/intel-uc.img net.ifnames=0 |
23 |
raid=noautodetect" |
24 |
|
25 |
To add the /intel-uc.img to this configuration you either have to |
26 |
include that in kernel configuration or you can use Dracut to build an |
27 |
EFI image. |
28 |
|
29 |
Kernel config: |
30 |
|
31 |
CONFIG_INITRAMFS_SOURCE="/boot/intel_uc.img" |
32 |
|
33 |
Or with Dracut: |
34 |
|
35 |
dracut --force --uefi --uefi-stub |
36 |
'/usr/lib/systemd/boot/efi/linuxx64.efi.stub' ... |
37 |
|
38 |
Dracut will automatically pick up your kernel installed to /boot (from |
39 |
kernel `make install`) and /boot/intel-uc.img (and other similar |
40 |
things). It will also automatically place the file into |
41 |
|
42 |
In both cases, you have to remember to update the EFI image/rebuild and |
43 |
reinstall the kernel whenever you update intel-microcode. |
44 |
|
45 |
The benefit to this is you don't have to maintain entries files, and you |
46 |
keep configuration generally in one place: the kernel config. Then you |
47 |
just drop in EFI binaries into the correct place and they will appear in |
48 |
the menu. You could have always keep two Linux EFI binaries in |
49 |
${ESP}/EFI/Linux/ in case the newest one fails. |
50 |
|
51 |
If you want to do this semi-automatically as part of updates and with |
52 |
UEFI secure boot signing, use my project: https://github.com/tatsh/upkeep |
53 |
|
54 |
[1] https://systemd.io/BOOT_LOADER_SPECIFICATION/ |
55 |
|
56 |
-- |
57 |
Andrew |