Control: tags -1 + patch

Thorsten Glaser writes ("Re: Bug#783990: efivarfs is a separate fs and needs 
moutning"):
> /sys/firmware/efi does not exist for me.

Cool.

> >> I suggest the following approach in mountkernfs:
> 
> 1.    See if /sys/firmware/efi/efivars/somefile exists;
>       if it does, it’s already mounted, and there’s
>       nothing to do.

It turns out that the domount function in mount-functions.sh already
uses a utility called `mountpoint` to check if something is already
mounted, so I think it's probably best just to go with that.

> Is /sys/firmware/efi also a mountpoint, or is it a mere directory?
> Does it always contain an efivars subdirectory? (Though, if it
> doesn’t, we can’t create it anyway, I guess.)

On my EFI system, /sys/firmware is just a directory in /sys.  Likewise
/sys/firmware/efi.  Ie, the mountpoints are just /sys and
/sys/firmware/efi/efivars (and of course various other things in /sys
like /sys/fs/pstore or whatever).

Indeed, I don't think we can create the efivars subdir.

> Sure¹, but let’s hold out a bit, we need some fixed file within
> /sys/firmware/efi/efivars/ to test for… or see if it’s empty,
> depending. I might have a look at the kernel source if needed.

As I say, I don't think we need that.  I tested my patched script and
on my system it is silently idempotent.

Also, I looked in mjy /sys/firmware/efivars and OMG.  It's full of
crazy stuff with names coming from EFI0land and I don't think there
would be anything sensible to test in it.

>  I just switched all my systems from sid to bullseye to avoid
>   the latest TC decision, but I can just live-patch the file
>   in question.

Here you go, in diff format and also a file you can just run.  I
haven't rebooted with it (yet), but I did manually unmount the efivars
subdir and verify that the new mountkernfs script remounts it.

I notice that my added section is very similar to the pstore section
immediately above - and this happened without me copying it :-), which
gives me confidence.

Ian.

Attachment: 0001-mountkernfs-Mount-sys-firmware-efi-efivars-if-necess.patch
Description: Binary data

Attachment: mountkernfs.sh
Description: Binary data


-- 
Ian Jackson <ijack...@chiark.greenend.org.uk>   These opinions are my own.  

Pronouns: they/he.  If I emailed you from @fyvzl.net or @evade.org.uk,
that is a private address which bypasses my fierce spamfilter.

Reply via email to