Open primeos opened 3 years ago
So a quick way to find places where issues will pop up, is to look at previously successfully builds (The log of modules-shrunk.drv
). Every FATAL
error message from modinfo in these logs corresponds to a missing module, that will now cause the build to abort.
Should we add a NixOS option for allowMissing that defaults to false? Reasoning for this idea: We can fix regressions on Hydra and users could contribute fixes for other architectures but we cannot consider all custom kernel configurations (and minimal kernel configs will miss a lot of modules!)
We should consider this as a temporary stop gap measure, but what we really want to do here is make the module system less opinionated on the list of default modules.
Perhaps have two lists? One where failure is OK and another one where failure is fatal?
Perhaps have two lists? One where failure is OK and another one where failure is fatal?
The thing is, we actually do want the build to fail, if somebody makes a typo in their config. So if we have a list of "optional" modules, we should somehow distinguish those cases. Moreover if somebody explicitly adds a module to their config, we should detect if its not there. But this can probably be computed in the module system. Taking the difference of the "optional default modules" minus the explicitly given modules, and only allow those to be missing.
@delroth since you have a custom kernel setup, would it help if the list in nixos/modules/profiles/all-hardware.nix
could be separately switched off?
I think all-hardware.nix is only really used in rare situations e.g. building installer images or livecd or such, I personally don't really care about it.
Really the main issue is that the NixOS module system allows for modules merging things into a list but not for modules filtering things out of a list -- given that I have a "weird" config due to having to use a custom built kernel, I would be OK with having to manually filter out the default modules I don't have, but that's not something that can easily be done :(
(mkForce overrides the list completely, so that breaks the "other modules merging things into the list" part of the problem.)
One way I can imagine is to convert the lists into attrsets. That's seems the usual approach to cases when you have a list in NixOS config and you actually need to remove parts.
The image builder profile adds modules to the available kernel modules:
This profile is also used by the Raspberry Pi 4 sd image, which uses an alternate kernel and configuration. In turn, see #111683, this module is not present on that specialized configuration.
The solution should make it possible for users of the NixOS options to "maybe add modules" too. Just saying in case it wasn't the foregone and obvious conclusion :).
An update to my last comment:
The image builder does not do this anymore. The all-hardware.nix
profile is used instead.
We also do not have the Pi 4 SD image files anymore.
I marked this as stale due to inactivity. → More info
This is a meta issue to track the changes that are required since we've merged #78430 (resulted in some channel blockers: #109252).
This is important for everything that is part of
modulesClosure
(allowMissing
is nowfalse
):But for missing firmware we only print a warning: 49130f93b73e61a9e3dff31c3c13c5a9096fa969
Relevant commits:
Open/unresolved issues to consider:
Potential improvements:
allowMissing
that defaults tofalse
?