[Pkg-zfsonlinux-devel] Bug#1051187: Bug#1051187: Avoid building module for kernels that have appropriate zfs-modules-<kernelversion> package installed

Andras Korn korn-debbugs at elan.rulez.org
Fri Jan 5 20:46:45 GMT 2024


On Fri, Jan 05, 2024 at 07:04:02AM +0000, 陈 晟祺 wrote:

Hi,

> > zfs-dkms is the failsafe in case the zfs-modules-<kernelversion> package is *not* installed
> > (for example, because this is the first slow box I'm installing this kernel or this version of
> > zfs-dkms on and I don't yet have a corresponding zfs-modules package).
> 
> Let's imagine you install modules pkg first, then dkms pkg, which skips building because you have
> "same" modules installed. After some days you accidentally uninstalled the modules pkg, then how
> would the dkms pkg know and start the building? There is no such mechanism according to my knowledge.

I'd like to start by saying that installing a zfs-modules-<kernelversion> package is something only few people would probably do, people who have good reasons for going off the beaten path.

I submit that it's not unreasonable to expect such people to be extra careful and be aware of the risks inherent in what they are doing.

That said, I suppose a dpkg trigger could be used; or the postrm script of the zfs-modules-<kernelversion> package could trigger the module build if zfs-dkms is installed. But frankly, I'm a great believer in allowing people to shoot themselves in the foot if they so desire. Expert features (which this would be) don't call for nanny automation.

> Even though such mechanism can be implemented by dkms, let's dig deeper into details: how would dkms
> know that your prebuilt version and dkms source files are "the exact same" and decide to skip? Designing
> such a mechanism would be either cumbersome for developers, or confusing for users, I suppose.

I don't think it needs to do that. If the zfs-modules-<kernelversion> package is installed, that means the admin is taking care of things.

If they have outdated kernel modules installed, it's their problem and not up to dkms or zfs-dkms maintainers to fix for them. You don't have to do everything for everyone.

I'd say it would be sufficient to document that installing a zfs-modules-<kernelversion> package is not officially supported, and has the following consequences:

 1. zfs-dkms won't build a new module for <kernelversion>;
 2. if you subsequently remove zfs-modules-<kernelversion>, you'll be left without a zfs module for <kernelversion> unless you trigger a zfs-dkms build yourself.

FWIW, you could also look at it from a green angle: building the modules when it's not necessary consumes extra electricity and is thus wasteful.

Best regards,

András

-- 
                  I break into song if I can't find the key.



More information about the Pkg-zfsonlinux-devel mailing list