Dear Maintainer, It appears that some modes of kmod (modprobe, modinfo) require the liblzma.so.5 library in order to operate with compressed kernel modules (module.ko.xz). However, liblzma.so.5 does not show up in the output of "ldd /usr/bin/kmod", so this library is not included in initramfs images created by the initramfs-tools package. This prevents loading compressed modules in early userspace using modprobe. I recommend modifying "/usr/share/initramfs-tools/hooks/kmod" to explicitly copy the liblzma.so.5 library into initramfs images using the copy_file function. Thanks for your work supporting Debian.
I can confirm that copy_exec /lib/<architecture>/liblzma.so.5 in /usr/share/initramfs-tools/hooks/kmod fixes the problem for me. —Ethan
We believe that the bug you reported is fixed in the latest version of
kmod, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 1099801@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Marco d'Itri <md@linux.it> (supplier of updated kmod package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Fri, 25 Apr 2025 11:50:41 +0200
Source: kmod
Architecture: source
Version: 34.2-2
Distribution: unstable
Urgency: medium
Maintainer: Marco d'Itri <md@linux.it>
Changed-By: Marco d'Itri <md@linux.it>
Closes: 1099801
Changes:
kmod (34.2-2) unstable; urgency=medium
.
* kmod.initramfs-hook: if compressed modules have been copied to the
initramfs and CONFIG_MODULE_DECOMPRESS=n (which is not the default
in Debian kernels) then also copy the compression libraries needed
by kmod to load them. (Closes: #1099801)
Checksums-Sha1:
c87862acf41acf478696d7ebd34432bc17f75c49 1819 kmod_34.2-2.dsc
cae7eeaa09da06449a3202ebd921fc87d477ef4b 12144 kmod_34.2-2.debian.tar.xz
b6fae61c0814fa89c9d0eed3f7f130f8ba573940 8820 kmod_34.2-2_amd64.buildinfo
Checksums-Sha256:
a36884eceaccc3647b5181233282578548d1f1fc39bfb5c1d4459982fb52505a 1819 kmod_34.2-2.dsc
93c9d227cf07a7c18a7292a79e51c94a6ea23e0ef4626ab2c31b5d711c73cefe 12144 kmod_34.2-2.debian.tar.xz
2687876426bd4c2189d4397e0e790880551443207f140602a1d9bedb24f135db 8820 kmod_34.2-2_amd64.buildinfo
Files:
7187fe05cd92c03f94151a48c0c32e31 1819 admin important kmod_34.2-2.dsc
18d0e2c97cb725b68830650ce5b5d1ea 12144 admin important kmod_34.2-2.debian.tar.xz
2a777caf82f3f2d8bbacfbd79bd7cc46 8820 admin important kmod_34.2-2_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----
iHUEARYKAB0WIQQnKUXNg20437dCfobLPsM64d7XgQUCaAtewgAKCRDLPsM64d7X
gQgfAQDl9La0sWS8OnyGyt3BxxMWCs0m1F60UPlU+bLNlL+bhAEA+g3T26u1oepR
BBxoUDuWVjuZeE+PjBTDMECn/5Ih7gc=
=VCZI
-----END PGP SIGNATURE-----
Dear Maintainer,
The fix for this is incomplete, and breaks initramfs generation for
architectures that do not end in linux-gnu.
One one of those systems, it is not quickly apparent what the issue is as you
simply get the following output during initramfs generation:
E: /usr/share/initramfs-tools/hooks/kmod failed with return 1.
The problem is that for example, on armel or armhf, the multiarch directory
exist as /usr/lib/arm-linux-gnueabi for armel, and /usr/lib/arm-linux-gnueabihf
as armhf, and we only glob at the start, not the ending.
One potential workaround is to add a glob at the end ala '*-linux-gnu*' but
another could be to use a find on /usr/lib something like
find /usr/lib/ -path "*/liblzma.so.5" -type f -exec copy_exec {} \;
I do not know how that would work on a system that actually does have
multiple architectures installed but I would assume it would copy in all of
the enabled architecture's liblzma.so.5 files.
I think the double glob would be the fastest fix, even if it does seem
inelegant.
Hello Marco,
you brought this bug up on #debian-arm. It was there discovered,
that the current implementation is broken on multiarch systems, for
example amd64 + i386, which seems popular.
On such installs, users can end up with the wrong liblzma.so.5.x.y in
the initramfs.
interpolate $(DEB_HOST_MULTIARCH) at build-time of the kmod debian
package into debian/kmod.initramfs-hook.
So that this:
copy_exec /usr/lib/*-linux-gnu/liblzma.so.5
becomes during build time:
copy_exec /usr/lib/amd64-linux-gnu/liblzma.so.5
Including /usr/share/dpkg/architecture.mk in d/rules should make
DEB_HOST_MULTIARCH available.
I hope this is enough info for you to figure out the nitty gritty
details.
Best,
Chris
We believe that the bug you reported is fixed in the latest version of
kmod, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 1103478@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Marco d'Itri <md@linux.it> (supplier of updated kmod package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sun, 08 Nov 2026 17:45:14 +0100
Source: kmod
Architecture: source
Version: 34.3-1
Distribution: unstable
Urgency: medium
Maintainer: Marco d'Itri <md@linux.it>
Changed-By: Marco d'Itri <md@linux.it>
Closes: 1059518 1103478 1124327
Changes:
kmod (34.3-1) unstable; urgency=medium
.
* New upstream release.
* Backport an upstram bug fix for using modprobe --show-depends with
softdeps. (Closes: #1059518)
* When CONFIG_MODULE_DECOMPRESS=n on multiarch systems, copy the
correct version of the compression libraries to the initramfs.
(Closes: #1103478)
* Build-depend on different kernel headers on sh4. (Closes: #1124327)
Checksums-Sha1:
1fef36d30727488139b5aacae65fd869bf964d7f 2715 kmod_34.3-1.dsc
c933ec9414820308cff38908cb7dc015250bb630 192680 kmod_34.3.orig.tar.xz
c5490352917ba22463951439ccfaf3ff0d2bedea 11880 kmod_34.3-1.debian.tar.xz
68336b622271cf1bf0f98a7d46bf9c15e5e10e74 453544 kmod_34.3-1.git.tar.xz
b01e7dce9146617626e19d6d0654752f631e81f1 17721 kmod_34.3-1_source.buildinfo
Checksums-Sha256:
75f3b8bc4cea2230409468f6e8fca508ee4d6d18682f06055d2bced10e726aa5 2715 kmod_34.3-1.dsc
21768efd014d5569b5aac349c40c64047a6d804ccff7f338328f3326dbe4a1f7 192680 kmod_34.3.orig.tar.xz
5a9dcbd814a137b7d3b484d4311a07fcacb3b1adaded4eb48afb7848f4139d52 11880 kmod_34.3-1.debian.tar.xz
fe1123e43da1255ffc7c6947dd1a2584bc9870765de8e604873b25de1401c63e 453544 kmod_34.3-1.git.tar.xz
4208cd5a010bc73c53d1bac939e5b8cbf1759e585a07c5091ca32592b7b1bd05 17721 kmod_34.3-1_source.buildinfo
Files:
03dc9b6d71557cc5cf1d14c89e28a9af 2715 admin important kmod_34.3-1.dsc
d58a43edcc7b5355e011b0adf03817b9 192680 admin important kmod_34.3.orig.tar.xz
c52f5da06b5e873c767aed1e72c9ef92 11880 admin important kmod_34.3-1.debian.tar.xz
6101fb7b467463ee9aff7c3e9e91680f 453544 admin important kmod_34.3-1.git.tar.xz
42f47093c7b63323f5a7df55b784e3c8 17721 admin important kmod_34.3-1_source.buildinfo
Git-Tag-Info: tag=96be292752f43d8d1f5c854be9ac452dfb09781b fp=272945cd836d38dfb7427e86cb3ec33ae1ded781
Git-Tag-Tagger: Marco d'Itri <md@linux.it>
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEEN02M5NuW6cvUwJcqYG0ITkaDwHkFAmrwqlEACgkQYG0ITkaD
wHmZiw//VAK5Z6ezL/znyEnrHJ3vlEAFPxLt+aWnJfw/BIegsbKtj0PFnc6QHmNY
8paVEX3qW9hqrcUJMwD1FqsE02TvoRoGJcRpy8pCWu+txjVNQmb31mxRn3ot7s7T
kmBtXBOsNaOruXtH8ccveTEJSUPLyVsq/RDN6bFGwg4FIIyo4KilODNOnBLe0eHs
qQKk4uq+l5QRhWor3JKyZPJURmMHRD4necpjJ7G9Fcm13x0qJ+lCS39m4k/PSIkx
DILzUTPDNqlozssa9FRrF7+GHjI5SP7r431IWC6Xojuzgq+iZL5ASX0z7PV1jd3o
1Dk9BGGCs4CJzB/1LLzP86ZDpvJdJrW7JUUnkM+T/FvoP06yf5LUT42NgCcLbFUd
wnBo8fHbFb5XyN+BpHWgeO1PJIUC+jVgvooOWCdeENpatSB1bbhV7DILADJXSzyP
VZ6hcu32kkLcWydtHB5Hqos/Nr2TmLI4l2SFSvcLzQ+Z57WPCvUWhZaqjUCt5EfH
RG1B3OPjj0FUyyzwAx5TMmsT88zOW6o3Ur7kv9Md4/R4nWJ7Av0oYhceUtkfIQD5
wexUdxpvd11rP+MOdKTetF1hDJ+SoUhdWfE7+3ICN7vPTRtsf/7adDBolRelODi0
trXlfs/XKhMrjp2v71xM41nYoOAnvZdy2TbSh4eYQmTd1mk1TqA=
=nqI7
-----END PGP SIGNATURE-----
|@Marco: Your fix seems to have introduced an error: mkinitramfs: copy_file: binary '/usr/lib/x86_64-linux-gnu/*-linux-gnu/libzstd.so.1' not found E: /usr/share/initramfs-tools/hooks/kmod failed with return 1.|
Indeed, this was seriously stupid. I am uploading 34.3-2 with a fix.
I tried your fix and experienced the same error. I had to change to: copy_exec "$libdir"/libzstd.so.1
34.3-3 fixes the original issue and the one I reported. Thank you for the quick response.