Le 10/09/2017 à 17:24, Greg Troxel a écrit :
[...]
Reading maxv@'s suggestion, I wondered about autoload of non-built-in
modules (but maybe that is already disabled).  My quick reaction is that
it would be nice if the "don't autoload" flag had the same behavior for
builtin and non-builtin modules, so that builtin/not is just a linking
style thing, and not more.

Modules can be autoloaded from the filesystem, in exec_autoload(). In such
a case, we want the kernel to do a MODULE_CMD_INIT on them, regardless of
whether they have the MODINFO_BUILTIN_NOLOAD flag set or not.

This flag must be parsed exclusively for the builtin modules, and not the rest.

[...]
   expand config(8) to be able to set "noautoload", so that if a module
   is included as part of a kernel, it will be marked noautoload if and
   noly if the flag is on the line, regardless of defaults.  This would
   not affect the modules in stand; they'd still have the default value
   of the noautoload flag from the default

This would be good. But I guess it entails introducing a new "module" keyword,
as opposed to the current "options" used for a certain number of drivers.

Another short-term alternative would be to add options that set
MODINFO_BUILTIN_NOLOAD.

Something like:

#ifdef COMPAT_LINUX_BUILTIN_NOLOAD
        MD1 MD2 MD3, MODINFO_BUILTIN_NOLOAD);
#else
        MD1 MD2 MD3, 0);
#endif

        options         COMPAT_LINUX
        options         COMPAT_LINUX_BUILTIN_NOLOAD

People that want the module builtin+loaded would comment the second line. Note
that this is similar to the notion that shipping functions for a kernel module
and dynamically registering them for use are two different unrelated options -
which is more or less what was suggested earlier in this thread.

But it indeed becomes a bit more complicated to understand and use...

Maxime

Reply via email to