Gentoo Archives: gentoo-user

From: Andrew Udvare <audvare@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] EFI booting problem - understanding it
Date: Fri, 03 Jul 2020 02:05:50
Message-Id: f4aaa4b6-2113-6fd2-7897-b22d83e43dd8@gmail.com
In Reply to: [gentoo-user] EFI booting problem - understanding it by Peter Humphrey
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

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] EFI booting problem - understanding it Michael <confabulate@××××××××.com>
Re: [gentoo-user] EFI booting problem - understanding it Peter Humphrey <peter@××××××××××××.uk>