mbox

[bug#40662,0/2] Add efivarfs support.

Message ID 20200416150436.3274-1-m.othacehe@gmail.com
Headers show

Message

Mathieu Othacehe April 16, 2020, 3:04 p.m. UTC
Hello,

Here's a small serie to add support for efivarfs and fix the issue reported
here: https://lists.gnu.org/archive/html/bug-guix/2020-04/msg00274.html.

The first patch is a bit hacky, so I didn't bother to write the documentation,
in case we find another solution.

Thanks,

Mathieu

Mathieu Othacehe (2):
  file-system: Add mount-may-fail? option.
  file-system: Add efivarfs support.

 gnu/build/file-systems.scm  | 49 +++++++++++++++++++++----------------
 gnu/system/file-systems.scm | 23 ++++++++++++++---
 gnu/system/install.scm      |  1 +
 3 files changed, 49 insertions(+), 24 deletions(-)

Comments

pelzflorian (Florian Pelz) April 30, 2020, 12:46 p.m. UTC | #1
On Thu, Apr 16, 2020 at 05:04:36PM +0200, Mathieu Othacehe wrote:
> Hello,
> 
> Here's a small serie to add support for efivarfs and fix the issue reported
> here: https://lists.gnu.org/archive/html/bug-guix/2020-04/msg00274.html.

I have no idea why I only ever got the [Patch 0/2] e-mail delivered to
my inbox.  I look at <https://issues.guix.info/issue/40662#1> now.


> [PATCH 2/2] file-system: Add efivarfs support.
> […]
> Tools such as efibootmgr rely on the deprecated /sys/firmware/efi/vars API as
> well as on the new /sys/firmware/efi/efivars API. The later needs to be
> mounted.

Typo: The latter needs to be mounted.


Well I had no issues with efivars on install without your patch.  I
will try to provoke the error by adding more efivars.  I did not yet
manage to create a new efivar via dd or via the efivar program though.

Regards,
Florian
pelzflorian (Florian Pelz) April 30, 2020, 3:41 p.m. UTC | #2
On Thu, Apr 30, 2020 at 02:46:18PM +0200, pelzflorian (Florian Pelz) wrote:
> On Thu, Apr 16, 2020 at 05:04:36PM +0200, Mathieu Othacehe wrote:
> > Here's a small serie to add support for efivarfs and fix the issue reported
> > here: https://lists.gnu.org/archive/html/bug-guix/2020-04/msg00274.html.
> Well I had no issues with efivars on install without your patch.  I
> will try to provoke the error by adding more efivars.  I did not yet
> manage to create a new efivar via dd or via the efivar program though.

Actually I see no reason to test after provoking Keyhenge’s error.
How does your patch fix a full NVRAM?  I thought Keyhenge resolved
their error by deleting “files” from the full NVRAM.  Do I
misunderstand Keyhenge’s issue?

But /sys/firmware/efi/efivars probably should be mounted anyway.

Do you know why

efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)

is mounted even without your patch once I add %desktop-services to my
config.scm?

Regards,
Florian
Mathieu Othacehe May 1, 2020, 9:16 a.m. UTC | #3
Hey Florian,

Thanks a lot for having a look.

> Actually I see no reason to test after provoking Keyhenge’s error.
> How does your patch fix a full NVRAM?  I thought Keyhenge resolved
> their error by deleting “files” from the full NVRAM.  Do I
> misunderstand Keyhenge’s issue?

I think the full NVRAM is only one part of the issue. There could also
be errors for variables > 1024 bytes using the legacy sysfs API, see:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=933523.

> is mounted even without your patch once I add %desktop-services to my
> config.scm?

Oh, it seems that elogind has support to mount efivarfs.

Mathieu
Mathieu Othacehe May 1, 2020, 9:39 a.m. UTC | #4
> guix system: error: exception caught while executing 'start' on service 'file-system-/sys/firmware/efi/efivars':
> Throw to key `match-error' with args `("match" "no matching pattern" ("efivarfs" "/sys/firmware/efi/efivars" "efivarfs" () #f #t #f))
>
> I don’t know why it happens.

Seems like an ABI incompatibility between the running shepherd and this
patch adding a new field in "file-system->spec" procedure. Not sure it
can be worked around.

Mathieu
Mathieu Othacehe July 31, 2020, 12:19 p.m. UTC | #5
Hello,

I just pushed this one to master. Closing!

Mathieu