Depmod warning, missing files in /lib/modules/kernel* when running dracut

Hey folks!

After a messy btrfs replace, upgrading my OS drive to a bigger one (which now works), im left with an error.

When i run dracut -f to rebuild initramfs i get this error:

depmod: WARNING: could not open modules.order at /var/tmp/dracut.pqTDcf/initramfs/lib/modules/6.2.7-200.fc37.x86_64: No such file or directory
depmod: WARNING: could not open modules.builtin at /var/tmp/dracut.pqTDcf/initramfs/lib/modules/6.2.7-200.fc37.x86_64: No such file or directory
depmod: WARNING: could not open modules.builtin.modinfo at /var/tmp/dracut.pqTDcf/initramfs/lib/modules/6.2.7-200.fc37.x86_64: No such file or directory

Running depmod -a shows where the files should be:

depmod: WARNING: could not open modules.order at /lib/modules/6.2.7-200.fc37.x86_64: No such file or directory
depmod: WARNING: could not open modules.builtin at /lib/modules/6.2.7-200.fc37.x86_64: No such file or directory
depmod: WARNING: could not open modules.builtin.modinfo at /lib/modules/6.2.7-200.fc37.x86_64: No such file or directory

On running rpm -qf /lib/modules/6.2.7-200.fc37.x86_64/modules.builtin it show that the file belongs to:

kernel-modules-core-6.2.7-200.fc37.x86_64

When i try to reinstall the package i get the same error:

[user@fedora ~]$ sudo dnf reinstall kernel-modules-core
Last metadata expiration check: 1:03:03 ago on lör 25 mar 2023 19:48:43.
Dependencies resolved.
=====================================================================================================================================================================================================================================================
 Package                                                            Architecture                                          Version                                                       Repository                                              Size
=====================================================================================================================================================================================================================================================
Reinstalling:
 kernel-modules-core                                                x86_64                                                6.2.7-200.fc37                                                updates                                                 37 M

Transaction Summary
=====================================================================================================================================================================================================================================================

Total download size: 37 M
Installed size: 36 M
Is this ok [y/N]: y
Downloading Packages:
kernel-modules-core-6.2.7-200.fc37.x86_64.rpm                                                                                                                                                                         14 MB/s |  37 MB     00:02    
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                                 11 MB/s |  37 MB     00:03     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                                                             1/1 
  Reinstalling     : kernel-modules-core-6.2.7-200.fc37.x86_64                                                                                                                                                                                   1/2 
  Cleanup          : kernel-modules-core-6.2.7-200.fc37.x86_64                                                                                                                                                                                   2/2 
  Running scriptlet: kernel-modules-core-6.2.7-200.fc37.x86_64                                                                                                                                                                                   2/2 
depmod: WARNING: could not open modules.order at /lib/modules/6.2.7-200.fc37.x86_64: No such file or directory
depmod: WARNING: could not open modules.builtin at /lib/modules/6.2.7-200.fc37.x86_64: No such file or directory
depmod: WARNING: could not open modules.builtin.modinfo at /lib/modules/6.2.7-200.fc37.x86_64: No such file or directory

  Verifying        : kernel-modules-core-6.2.7-200.fc37.x86_64                                                                                                                                                                                   1/2 
  Verifying        : kernel-modules-core-6.2.7-200.fc37.x86_64                                                                                                                                                                                   2/2 

Reinstalled:
  kernel-modules-core-6.2.7-200.fc37.x86_64                                                                                                                                                                                                          

Complete!

i then tried to restore the missing files from an earlier btrfs snapshot, and tried running dracut again and it works, no problem.

After this i tried to reinstall kernel-modules-core again, i monitor the directory where the files are at and can see that during the installation it removes quite a few files including the files that where previously missing. But it doesnt install the files again. And since they are now missing again, depmod warns during running scriptlet-phase (same as above log). Same three files modules.builtin, modules.builtin.modinfo and modules.order.

Some background:
When i moved my btrfs partition from the old drive to the new one with btrfs replace, i set up new EFI and boot partitions, not restoring these partitions from the old drive. Could this be the problem?

ideas and suggestions are most welcome.

Best regards

sudo dnf download kernel-modules-core
sudo rpm --force -i kernel-modules-core-*.rpm
2 Likes

That did work!

But running dnf reinstall again results in the same problem as before. Im thinking this might become a problem next time there is a kernel update?

Is there something that controls what gets installed in a package and what doesnt, what modules that are included etc?

Thanks for your help again Vlad!

1 Like

To be fair, this looks like a bug triggering on an attempt to reinstall the kernel-modules-core package.

If you boot an older kernel, remove the latest one, and upgrade, then the latest kernel installs normally, so the problem does not occur on upgrade.

Update.

I just tried to update to kernel 6.2.8, and as you said it all went fine. Modules still ok after update.

I then tried to reinstall kernel-modules-core and got the same problem as before.

So upgrade works but reinstall doesnt. Is this something that should report?

2173984 – depmod: WARNING: could not open modules.order at /lib/modules/6.2.0-63.fc38.x86_64

2 Likes