1 |
On Friday, 3 July 2020 03:05:34 BST Andrew Udvare wrote: |
2 |
> Morning all, |
3 |
> |
4 |
> I'm trying to set the default boot entry via bootctl or efibootmgr. I know I |
5 |
> can set it directly by pressing D at the boot selection screen, and the |
6 |
> system does boot properly; I just want to understand the setup a bit |
7 |
> better. I don't have the rest of systemd: this is an openrc box. |
8 |
> |
9 |
> # tree -L 3 /boot |
10 |
> /boot |
11 |
> ├── config-5.4.48-gentoo |
12 |
> ├── config-5.4.48-gentoo-rescue |
13 |
> ├── config-5.7.6-gentoo |
14 |
> ├── config-5.7.7-gentoo |
15 |
> ├── early_ucode.cpio |
16 |
> ├── EFI |
17 |
> │ ├── Boot |
18 |
> │ │ └── bootx64.efi |
19 |
> │ ├── Linux |
20 |
> │ ├── Microsoft |
21 |
> │ │ ├── Boot |
22 |
> │ │ └── Recovery |
23 |
> │ └── systemd |
24 |
> │ └── systemd-bootx64.efi |
25 |
> ├── intel-uc.img |
26 |
> ├── loader |
27 |
> │ ├── entries |
28 |
> │ │ ├── 08-gentoo-5.4.48-rescue.conf |
29 |
> │ │ ├── 09-gentoo-5.4.48-rescue.nonet.conf |
30 |
> │ │ ├── 30-gentoo-5.7.7.conf |
31 |
> │ │ ├── 32-gentoo-5.7.7.nox.conf |
32 |
> │ │ ├── 34-gentoo-5.7.7.nonet.conf |
33 |
> │ │ ├── 40-gentoo-5.4.48.conf |
34 |
> │ │ ├── 42-gentoo-5.4.48.nox.conf |
35 |
> │ │ └── 44-gentoo-5.4.48.nonet.conf |
36 |
> │ ├── loader.conf |
37 |
> │ └── random-seed |
38 |
> ├── System.map-5.4.48-gentoo |
39 |
> ├── System.map-5.4.48-gentoo-rescue |
40 |
> ├── System.map-5.7.6-gentoo |
41 |
> ├── System.map-5.7.7-gentoo |
42 |
> ├── vmlinuz-5.4.48-gentoo |
43 |
> ├── vmlinuz-5.4.48-gentoo-rescue |
44 |
> ├── vmlinuz-5.7.6-gentoo |
45 |
> └── vmlinuz-5.7.7-gentoo |
46 |
> |
47 |
> # bootctl status |
48 |
> --->8 |
49 |
> Default Boot Loader Entry: |
50 |
> title: Gentoo 5.4.48 (No network) |
51 |
> id: 44-gentoo-5.4.48.nonet.conf |
52 |
> --->8 |
53 |
> |
54 |
> 44-gentoo-5.4.48.nonet.conf is the last entry in /boot/loader/entries. |
55 |
> |
56 |
> Man bootctl says: |
57 |
> set-default ID, set-oneshot ID |
58 |
> Sets the default boot loader entry. Takes a single boot loader entry ID |
59 |
> string as argument... |
60 |
> |
61 |
> But then, |
62 |
> # bootctl set-default 30-gentoo-5.7.7.conf |
63 |
> Failed to update EFI variable: Invalid argument |
64 |
> |
65 |
> ...in spite of this: |
66 |
> # cat /boot/loader/entries/30-gentoo-5.7.7.conf |
67 |
> title Gentoo 5.7.7 |
68 |
> version 5.7.7-gentoo |
69 |
> linux vmlinuz-5.7.7-gentoo |
70 |
> initrd=intel-uc.img |
71 |
> options root=/dev/nvme0n1p4 net.ifnames=0 raid=noautodetect |
72 |
> |
73 |
> ...and this: |
74 |
> # mount | grep efi |
75 |
> efivarfs on /sys/firmware/efi/efivars type efivarfs |
76 |
> (rw,nosuid,nodev,noexec,relatime) |
77 |
> |
78 |
> I've also tried telling efibootmgr to set the default. |
79 |
> |
80 |
> # efibootmgr |
81 |
> BootNext: 0007 |
82 |
> BootCurrent: 0007 |
83 |
> Timeout: 2 seconds |
84 |
> BootOrder: 000B,0007,0006,0000,000C,000D |
85 |
> Boot0000* Windows Boot Manager |
86 |
> Boot0006* UEFI OS |
87 |
> Boot0007* Linux Boot Manager |
88 |
> Boot000B* CD/DVD Drive |
89 |
> Boot000C* Hard Drive |
90 |
> Boot000D* Removable Drive |
91 |
> |
92 |
> Efibootmgr -n 7 seems to make no difference, as expected, but: |
93 |
> # efibootmgr -N 7 |
94 |
> Boot entry 0001 does not exist |
95 |
|
96 |
I can't comment on the systemd's bootctl, because I don't use it, by as I |
97 |
understand it 'efibootmgr --delete-bootnext' will clear the BootNext entry in |
98 |
UEFI settings and does not take a boot entry number as a variable on the CLI. |
99 |
I can't answer why "7" in your entry above returns a comment about "Boot entry |
100 |
0001" ... which is obviously absent. |