1 |
On 02/07/2020 06:56, Peter Humphrey wrote: |
2 |
> But then, |
3 |
> # bootctl set-default 30-gentoo-5.7.7.conf |
4 |
> Failed to update EFI variable: Invalid argument |
5 |
|
6 |
Probably the kernel is blocking write access to EFI. This is on purpose |
7 |
for safety as you can damage your firmware quite easily. systemd-boot |
8 |
and others do not have this restriction. You also should be careful |
9 |
writing to the EFI too much as the NVRAM flash may not be of high quality. |
10 |
|
11 |
https://lwn.net/Articles/674940/ |
12 |
|
13 |
You can try using `chattr -i` against the files like: |
14 |
|
15 |
chattr -i /sys/firmware/efi/efivars/Boot* |
16 |
|
17 |
Then you can try with bootctl and others, but this is not guaranteed to |
18 |
work. |
19 |
|
20 |
On my ASUS motherboard I haven't been able to write to EFI variables |
21 |
from within Linux for a long time. I have to add my keys in the BIOS and |
22 |
set the default in systemd-boot. |
23 |
|
24 |
The logic to write to a file in efivars is here: |
25 |
|
26 |
https://github.com/torvalds/linux/blob/master/fs/efivarfs/file.c#L15 |
27 |
|
28 |
If you use strace with bootctl you'll probably see one of these errno |
29 |
values. |
30 |
|
31 |
Andrew |