Package: dkms
Version: 2.8.7-2
Severity: important

Dear Maintainer,

When upgrading the kernel (with unattended upgrades) on a system with a 
dkms-built module, dkms fails to build the new module. This is the excerpt from 
"/var/log/apt/term.log":

Selecting previously unselected package linux-image-5.10.0-0.bpo.9-amd64.
[...]
Preparing to unpack 
.../linux-image-5.10.0-0.bpo.9-amd64_5.10.70-1~bpo10+1_amd64.deb ...(Reading 
database ... 149449 files and directories currently installed.)
Unpacking linux-image-5.10.0-0.bpo.9-amd64 (5.10.70-1~bpo10+1) 
...~bpo10+1_amd64.deb ...
Preparing to unpack .../linux-image-amd64_5.10.70-1~bpo10+1_amd64.deb ...
Unpacking linux-image-amd64 (5.10.70-1~bpo10+1) over (5.10.46-4~bpo10+1) ...
Setting up linux-image-5.10.0-0.bpo.9-amd64 (5.10.70-1~bpo10+1) ...10+1) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-5.10.0-0.bpo.8-amd64
I: /initrd.img.old is now a symlink to boot/initrd.img-5.10.0-0.bpo.8-amd64
I: /vmlinuz is now a symlink to boot/vmlinuz-5.10.0-0.bpo.9-amd64po.8-amd64
I: /initrd.img is now a symlink to boot/initrd.img-5.10.0-0.bpo.9-amd64
/etc/kernel/postinst.d/dkms:ink to boot/initrd.img-5.10.0-0.bpo.9-amd64
Error! Your kernel headers for kernel 5.10.0-0.bpo.9-amd64 cannot be found.
Please install the linux-headers-5.10.0-0.bpo.9-amd64 package,not be found.
or use the --kernelsourcedir option to tell DKMS where it's located
/etc/kernel/postinst.d/initramfs-tools:tell DKMS where it's located
update-initramfs: Generating /boot/initrd.img-5.10.0-0.bpo.9-amd64
/etc/kernel/postinst.d/zz-update-grub:trd.img-5.10.0-0.bpo.9-amd64
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.10.0-0.bpo.9-amd64
Found initrd image: /boot/initrd.img-5.10.0-0.bpo.9-amd64
Found linux image: /boot/vmlinuz-5.10.0-0.bpo.8-amd64md64
Found initrd image: /boot/initrd.img-5.10.0-0.bpo.8-amd64
Found linux image: /boot/vmlinuz-5.10.0-0.bpo.7-amd64md64
Found initrd image: /boot/initrd.img-5.10.0-0.bpo.7-amd64
Found linux image: /boot/vmlinuz-5.10.0-0.bpo.5-amd64md64
Found initrd image: /boot/initrd.img-5.10.0-0.bpo.5-amd64
Adding boot menu entry for EFI firmware configurationmd64
doneng boot menu entry for EFI firmware configuration
Setting up linux-image-amd64 (5.10.70-1~bpo10+1) ...
Log ended: 2021-11-01  06:26:47.10.70-1~bpo10+1) ...
Log ended: 2021-11-01  06:26:47

Log started: 2021-11-01  06:26:50
Selecting previously unselected package linux-headers-5.10.0-0.bpo.9-common.
[...]
Preparing to unpack 
.../linux-headers-5.10.0-0.bpo.9-common_5.10.70-1~bpo10+1_all.deb ...
Unpacking linux-headers-5.10.0-0.bpo.9-common (5.10.70-1~bpo10+1) ...
Selecting previously unselected package linux-headers-5.10.0-0.bpo.9-amd64.
Preparing to unpack 
.../linux-headers-5.10.0-0.bpo.9-amd64_5.10.70-1~bpo10+1_amd64.deb ...
Unpacking linux-headers-5.10.0-0.bpo.9-amd64 (5.10.70-1~bpo10+1) ...
Preparing to unpack .../linux-headers-amd64_5.10.70-1~bpo10+1_amd64.deb ...
Unpacking linux-headers-amd64 (5.10.70-1~bpo10+1) over (5.10.46-4~bpo10+1) ...
Setting up linux-headers-5.10.0-0.bpo.9-common (5.10.70-1~bpo10+1) ...0+1) ...
Setting up linux-headers-5.10.0-0.bpo.9-amd64 (5.10.70-1~bpo10+1) ....
Setting up linux-headers-amd64 (5.10.70-1~bpo10+1) ...-1~bpo10+1) ...
Log ended: 2021-11-01  06:27:32(5.10.70-1~bpo10+1) ...
Log ended: 2021-11-01  06:27:32

This appareantly happens because unatteneded upgrade unnecessarily splits the 
upgrades of the kernel image and linux-headers
into two separate apt calls, as there is no dependency between them (in either 
way). With a bit of bad luck the installation
of the headers happens afterwards and the trigger from dkms fails to rebuild 
the module.

I observed this with several versions of dkms.

I've set the severity to "important", because the failed dkms upgrade does not 
seem to fail the upgrade which together
with unattended upgrades sneakily "removes" a module from the most recent 
kernel which will lead to the next boot failing
if correct booting requires that module.

Reply via email to