Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 838871 - sys-kernel/dracut - 'dracut-install: Failed to find module 'dm_delay' with CONFIG_MODULE_COMPRESS_ZSTD=y
Summary: sys-kernel/dracut - 'dracut-install: Failed to find module 'dm_delay' with CO...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Patrick McLean
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-17 04:25 UTC by Maxim Fomin
Modified: 2022-04-18 02:59 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim Fomin 2022-04-17 04:25:40 UTC
Dracut v055-r4 does not support kernel module compression, it has no USE flag to enable it.

See also https://forums.gentoo.org/viewtopic-t-1112566-highlight-dracut.html
Comment 1 Mike Gilbert gentoo-dev 2022-04-17 13:21:24 UTC
Please describe the problem you are experiencing, and provide steps to reproduce it.
Comment 2 Alexander Tsoy 2022-04-17 13:37:07 UTC
I suspect you didn't enabled nessessary USE flags for sys-apps/kmod
Comment 3 Maxim Fomin 2022-04-17 14:26:04 UTC
I have enabled relevant USE flags (zstd). This is ouput from 'equery uses kmod'

[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for sys-apps/kmod-29:
 U I
 - - debug                     : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see
                                 https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
 - - doc                       : Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
 + + lzma                      : Enable support for XZ compressed modules 
 - - pkcs7                     : Enable PKCS#7 signature parsing for modinfo. 
 - - python                    : Add optional support/bindings for the Python language
 - - python_targets_python3_10 : Build with Python 3.10
 - - python_targets_python3_8  : Build with Python 3.8
 + + python_targets_python3_9  : Build with Python 3.9
 - - static-libs               : Build static versions of dynamic libraries as well
 + + zlib                      : Enable support for gzipped modules 
 + + zstd                      : Enable support for ZSTD compression

Steps to reproduce.
1. Compile vanilla-sources with Arch config (enables module compression with zstd)
2. Run dracut.

Dracut will report errors like
'dracut-install: Failed to find module 'dm_delay' /lib/modules/5.17.3//kernel/drivers/md/dm-delay.ko.zst'

for each kernel module. Running dracut with '--verbose' flag shows that it did not include any kernel module (image folder /lib/modules/ only contains dummy files like ''module.symver' etc).

When I initially posted message at gentoo forum at May 2020 Arch was using xz compression and I enabled 'lzma' USE flag - result was the same. So, it seems that something blocks using compressed modules by dracut and this is not kmod.
Comment 4 Maxim Fomin 2022-04-17 15:21:44 UTC
P.S. I have noticed the double slash at '5.17.3//kernel' and appended dracut parameter '-k /lib/modules/5.17.3' (without ending slash) to fix this - it didn't yield anything. I also rechecked several times that listed in dracut output kernel modules are present.

There is interesting thread: https://github.com/dracutdevs/dracut/issues/945. According to it dracut received zstd support in 2021 in version 28, so it should work. However it does not work in my setup and in May 2020 the xz compression didn't work either, so this problem is not specific to zstd. 

In October 2021 in that thread one user reported that '-o busybox' dracut option can be used as a fix (because 'its modprobe overwrites kmod's, and doesn't support zst modules'), but it didn't worked for me.
Comment 5 Maxim Fomin 2022-04-17 15:26:09 UTC
P.P.S Removing compression in kernel config file resolves the issue, but it is obviously not a solution. This shows that the problem is not in some obscure (unrelated to compression) kernel config option which causes the problem.
Comment 6 Alexander Tsoy 2022-04-17 16:44:47 UTC
dracut-install uses libkmod to search modules, so this doesn't look like a dracut issue right now. Could you check if modules can be loaded with 'modprobe' command?
Comment 7 Maxim Fomin 2022-04-17 17:46:08 UTC
I cannot check because this is initial install and I cannot create initramfs which is needed to boot.
Comment 8 Mike Gilbert gentoo-dev 2022-04-17 18:01:53 UTC
Is "modinfo dm_delay" able to find the compressed module file? That should tell us if the libkmod functions are working.
Comment 9 Mike Gilbert gentoo-dev 2022-04-17 18:11:43 UTC
For reference: Support for modules compressed with zstd was added in dracut-054.

https://github.com/dracutdevs/dracut/commit/ce9af251af5fca08ea206ef980005853a4dac36e
Comment 10 Alexander Tsoy 2022-04-17 18:31:56 UTC
(In reply to Mike Gilbert from comment #8)
This is the correct command, since this is initial install and running kernel is different:
modinfo -k 5.17.3 dm_delay
Comment 11 Mike Gilbert gentoo-dev 2022-04-18 02:59:37 UTC
I was able to create an initramfs using dracut containing modules compressed using zstd without any issues.

To test, I created the config snippet below:

> % cat /etc/kernel/config.d/zstd.config
> CONFIG_MODULE_COMPRESS_ZSTD=y

I then installed sys-kernel/vanilla-kernel-5.15.34. Many .ko.zst files were installed in /lib/modules/5.15.34-dist.

> % find /lib/modules/5.15.34-dist -name '*.ko.zst' | wc -l
> 3945

I then generated an initramfs using dracut:

> % sudo dracut --kver 5.15.34-dist /tmp/foo.img

This completed without any errors.

Running lsinitrd on the resulting file shows many .ko.zst files.

> % sudo lsinitrd /tmp/foo.img | grep -F '.ko.zst' | wc -l
> 947