public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Peter Humphrey <peter@prh.myzen.co.uk>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] EFI booting problem - understanding it
Date: Fri, 03 Jul 2020 15:52:46 +0100	[thread overview]
Message-ID: <12579080.uLZWGnKmhe@peak> (raw)
In-Reply-To: <f4aaa4b6-2113-6fd2-7897-b22d83e43dd8@gmail.com>

On Friday, 3 July 2020 03:05:34 BST Andrew Udvare wrote:
> On 02/07/2020 06:56, Peter Humphrey wrote:
> > But then,
> > # bootctl set-default 30-gentoo-5.7.7.conf
> > Failed to update EFI variable: Invalid argument
> 
> Probably the kernel is blocking write access to EFI. This is on purpose
> for safety as you can damage your firmware quite easily. systemd-boot
> and others do not have this restriction.

Is there some way for me to remove this restriction temporarily?

> You also should be careful writing to the EFI too much as the NVRAM flash may
> not be of high quality.

Yes, I do only write to it when I have to. I hope Asus would use decent-
quality components though.

> https://lwn.net/Articles/674940/

Interesting - thanks.

> You can try using `chattr -i` against the files like:
> 
> chattr -i /sys/firmware/efi/efivars/Boot*
> 
> Then you can try with bootctl and others, but this is not guaranteed to
> work.

Those files were already among the 17 that were mutable. It seems I need to find 
which of the other 117 files I need to make mutable.

> On my ASUS motherboard I haven't been able to write to EFI variables
> from within Linux for a long time. I have to add my keys in the BIOS and
> set the default in systemd-boot.

Looks like I'm in the same boat. Except that setting the default in systemd-
boot is exactly what I can't do!

> The logic to write to a file in efivars is here:
> 
> https://github.com/torvalds/linux/blob/master/fs/efivarfs/file.c#L15
> 
> If you use strace with bootctl you'll probably see one of these errno
> values.

I think what I'm seeing comes from this:

if (attributes & ~(EFI_VARIABLE_MASK))
	return -EINVAL;

Perhaps I should just stop here and revert to setting the default at the UEFI 
boot-choice screen.

Many thanks for your help, Andrew.

-- 
Regards,
Peter.





  parent reply	other threads:[~2020-07-03 14:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-02 10:56 [gentoo-user] EFI booting problem - understanding it Peter Humphrey
2020-07-03  2:05 ` Andrew Udvare
2020-07-03  8:36   ` Michael
2020-07-03 14:52   ` Peter Humphrey [this message]
2020-07-03 20:57     ` Sid Spry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12579080.uLZWGnKmhe@peak \
    --to=peter@prh.myzen.co.uk \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox