-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
kmod-setup: load efivarfs early #39330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
/* This one we need to load explictly, since auto-loading would happen too late for generators | ||
* like systemd-gpt-auto-generator to read the EFI vars. */ | ||
// FIXME: should warn_if_unavailable be `is_efi_boot()` or always `true` or always `false`? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Just want to draw attention to this question)
/* This one we need to load explictly, since auto-loading would happen too late for generators | ||
* like systemd-gpt-auto-generator to read the EFI vars. */ | ||
// FIXME: should warn_if_unavailable be `is_efi_boot()` or always `true` or always `false`? | ||
{ "efivarfs", NULL, true, false, is_efi_boot }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I didn't guard this inside #if HAVE_EFI
since is_efi_boot
always returns false if HAVE_EFI
is not defined, but that's a trivial change I could make.
3b62eba
to
ca06c35
Compare
Some parts of systemd, such as the systemd-gpt-auto-generator, rely on the efivarfs kernel module being loaded. However, some kernels don't compile it in, so we need to load it as early as possible to facilitate things in the initrd that run early like generators
ca06c35
to
befef56
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, shouldn't this be loaded in mount_setup()? We mount efivarfs as part of the API vfs setup, prior to generator run, hence I don't see how the situation you're describing can happen? Can you elaborate?
let's take a step back on this. why in heaven would sombody compile a kernel without this built-in? which distro is this? |
Because legacy systems still exist. There is life beyond EFI.
SUSE |
So you penalize the common, odern case, in order to optimize the uncommon legacy case by a tiny tiny bit? Sorry, but that's not precisely good engineering. and why does this pop up in 2025 for the first time? does suse have a new project of making the system boot slower, and creating artifical churn so they figured out they could turn this into a module? The list is a list that would ideally not exist. I am not convinced we should add anything to it unless a very good case can be presented. I don't think this here qualifies. |
@cole-h are you on NixOS? The fact that it is a module is a bit of a hassle, but everything should still work with kernel actively forking off modprobe to load the fs driver. I guess NixOS broke this, and that's something you'll need to look into. |
TL;DR: Make sure @YHNdnzj Thanks so much for the hint, this is so embarrassing 😅 Sorry for wasting everyone's time -- the REAL issue was that I was creating a custom initrd, the default modprobe (according to I was naively trying to configure this with a Again, sorry for the noise 🙇♂️ |
Some parts of systemd, such as the systemd-gpt-auto-generator, rely on the efivarfs kernel module being loaded. However, some kernels don't compile it in, so we need to load it as early as possible to facilitate things in the initrd that run early like generators