node-feature-discovery: `kernel.loadedmodule` doesn't work on all OS

What would you like to be added: Currently, kernel.loadedmodule feature only check for the content of /proc/modules for modules compiled as module and not built in tree module. Maybe there’s a way to check for built-in kernel that is in /lib/modules/<kernel-version>/modules.builtin. I think this can be done by either improve the function getLoadedModules or allow the user to choose what kind of test to get the information.

Why is this needed:

Currently Talos Linux will just silently not creating nodeFeatureRule when I put matchFeatures that check for kernel.loadedmodule even if the module is loaded.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Should this replace the current check or a choice for the users? Because the problem is the current kernel.loadedmodule doesn’t mean the module is truly loaded.

At a quick thought I think we could/should leave kernel.loadedmodule as is, just clearly document that it lists loaded dynamic kernel modules. Just have a new feature for listing all modules, dynamic and builtin which would be practically a union of kernel.loadedmodule and modules.builtin. WDYT?