UPDATE: Additional facts on trigger-path theory

My 2026-08-05 comment suggested kernel-triggered DKMS builds (dkms
autoinstall) come out uncompressed while driver-only package upgrades
(dkms build/dkms install) come out compressed. Further testing (two
machines, both AMD/Nvidia) shows that theory was incomplete — kernel-
triggered builds can produce compressed output too. Here's the
underlying mechanism, confirmed by reading /usr/sbin/dkms
(3.0.11-1ubuntu13) and comparing apt logs across two kernel installs.

DKMS doesn't read CONFIG_MODULE_COMPRESS_ZSTD from the kernel config. At
build time it checks whether the target kernel's
/lib/modules/<kernel>/modules.dep already has .zst entries, and mirrors
that compression for its own output:

# /usr/sbin/dkms, lines 223-225
grep -q '\.zst:' /lib/modules/$kernel_test/modules.dep 2>/dev/null && 
module_compressed_suffix=".zst"

modules.dep reads .zst entries from depmod, run by linux-
modules-<kernel>/linux-image-<kernel>'s postinst. DKMS itself runs from
linux-headers-<kernel>'s postinst (/etc/kernel/header_postinst.d/dkms).
Whether DKMS sees those entries depends on whether linux-modules/linux-
image were configured by dpkg *before* linux-headers — and that order
isn't fixed across apt transactions.

So, while the previous investigation seemed that just driver-only
upgrades were affected, in fact, it can be kernel-triggered upgrades as
well; it is just a timing issue as noted.

Log comparison on the same machine shows the flip directly:

Kernel 7.0.0-30-generic (2026-08-24, uncompressed — no bug):
Setting up linux-headers-7.0.0-30-generic ...
/etc/kernel/header_postinst.d/dkms:              <- DKMS checks modules.dep here
Setting up linux-modules-7.0.0-30-generic ...    <- depmod runs after

Kernel 7.0.0-31-generic (2026-09-03, compressed — bug reproduced):
Setting up linux-modules-7.0.0-31-generic ...    <- depmod runs first
Setting up linux-headers-7.0.0-31-generic ...
/etc/kernel/header_postinst.d/dkms:              <- DKMS checks modules.dep 
here, finds .zst

Same dkms version, same nvidia driver version, same kernel config, same
machine — only the dpkg configuration order differed.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2154307

Title:
  DKMS modules installed as .ko.zst; are not included in initramfs

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/2154307/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to