Bug 1467427 - dracut hostonly misses modules that are built-in or renamed from the running kernel
dracut hostonly misses modules that are built-in or renamed from the running ...
Status: POST
Product: Fedora
Classification: Fedora
Component: dracut (Show other bugs)
27
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: dracut-maint-list
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-03 16:16 EDT by Andy Lutomirski
Modified: 2017-08-15 03:00 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Andy Lutomirski 2017-07-03 16:16:52 EDT
I'm filing this here because upstream doesn't appear to have a bug tracker.  This bug also bit me because I sometimes run home-built kernels on Fedora 25.

Dracut does this:

static bool check_module_hostonly(struct kmod_module *mod)
{
        const char *name = kmod_module_get_name(mod);

        if (check_hashmap(modules_loaded, name))
                return true;

        return false;
}

This is prone to false negatives.  A much better approach would be to also accept the module if its modalias matches anything on the running system.  Basically, dracut should do the equivalent of:

find /sys -name modalias |xargs cat

and then check if any of the modalias lines in `modinfo $module` match any of the modaliases on the system.

The specific failure I'm seeing is that I ran a kernel that had nvme built in and then allowed dnf to install a new kernel.  The new kernel's initramfs was missing nvme-core and nvme.  I suspect this could bite non kernel devs who upgrade to a kernel that renames a module, though.
Comment 1 Yanko Kaneti 2017-07-04 09:56:40 EDT
https://github.com/dracutdevs/dracut
Issue tracker and Pull requests seem attended
Comment 2 Harald Hoyer 2017-07-07 07:10:42 EDT
(In reply to Andy Lutomirski from comment #0)
> I'm filing this here because upstream doesn't appear to have a bug tracker. 
> This bug also bit me because I sometimes run home-built kernels on Fedora 25.
> 
> Dracut does this:
> 
> static bool check_module_hostonly(struct kmod_module *mod)
> {
>         const char *name = kmod_module_get_name(mod);
> 
>         if (check_hashmap(modules_loaded, name))
>                 return true;
> 
>         return false;
> }
> 
> This is prone to false negatives.  A much better approach would be to also
> accept the module if its modalias matches anything on the running system. 
> Basically, dracut should do the equivalent of:
> 
> find /sys -name modalias |xargs cat
> 
> and then check if any of the modalias lines in `modinfo $module` match any
> of the modaliases on the system.
> 
> The specific failure I'm seeing is that I ran a kernel that had nvme built
> in and then allowed dnf to install a new kernel.  The new kernel's initramfs
> was missing nvme-core and nvme.  I suspect this could bite non kernel devs
> who upgrade to a kernel that renames a module, though.

Yeah, you are right with your analysis. Will try to implement your suggestion.
Comment 5 Jan Kurik 2017-08-15 03:00:22 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.

Note You need to log in before you can comment on or make changes to this bug.