Package: linux-headers-6.8.9-amd64
Version: 6.8.9-1

When installing a new kernel (images & headers) packages, dkms modules for
that kernel version are compiled twice - once for the linux image package, and
again (almost immediately afterwards) for the linux headers package.



I'm not entirely sure if this bug belongs to the dkms package or to the
linux-image-*-amd64 or linux-headers-*-amd64 packages. I think the latter.
It should check if the current versions of any module(s) have already been
compiled for the current kernel version before re-compiling & installing
it/them again.

Seems to be because BOTH /var/lib/dpkg/info/linux-headers-6.8.9-amd64.postinst
AND /var/lib/dpkg/info/linux-image-6.8.9-amd64.postinst execute run-parts on
/etc/kernel/postinst.d/, and the "dkms" script in there deletes the compiled
modules when run from "*header_postinst.d*" (that script belongs to the dkms
package, so maybe this bug should be re-assigned to dkms).


NOTE: this hasn't just started with this kernel version (6.8.9), I have
noticed it several times in the past, just haven't had the free time until now
to investigate and make a properly detailed bug report.




BTW, aside from wasting CPU power and electricity and generating heat & noise,
this isn't a *huge* problem....but I have one system (an AMD FX-8150) where
compiling the zfs module in particular sometimes causes the CPU to exceed
temperature limits for too long causing the system to lock up until I can get
to it and power-cycle it.  Compiling zfs-dkms twice in a row makes the lockup
far more likely.

Yes, I should replace the cooler on that CPU.  I will one day. Or, more
likely, I'll just upgrade the motherboard & cpu (and cooler) to something more
modern....an FX-8150 is pretty much near the end of its useful life, but for
now it's still more than adequate for the job I built that system for.



Here's a summary followed by an excerpted transcript showing the problem
(search for ### to see my comments):

0. system is an AMD FX-8150 that needs both nvidia-kernel-dkms and zfs-dkms

1. compile & install modules for the linux-image-6.8.9-amd64 package

2. delete those modules and compile & install them again for
linux-headers-6.8.9-amd64



kali:~# time apt-get -u install linux-image-amd64 linux-headers-amd64 ; 
apt-mark hold linux-image-amd64 linux-headers-amd64
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  linux-headers-6.8.9-amd64 linux-headers-6.8.9-common linux-image-6.8.9-amd64 
linux-kbuild-6.8.9
Suggested packages:
  linux-doc-6.8 debian-kernel-handbook
The following NEW packages will be installed:
  linux-headers-6.8.9-amd64 linux-headers-6.8.9-common linux-image-6.8.9-amd64 
linux-kbuild-6.8.9
The following held packages will be changed:
  linux-headers-amd64 linux-image-amd64
The following packages will be upgraded:
  linux-headers-amd64 linux-image-amd64
2 upgraded, 4 newly installed, 0 to remove and 16 not upgraded.
Need to get 113 MB of archives.
After this operation, 172 MB of additional disk space will be used.
Do you want to continue? [Y/n] 

[...]

###
### Compile nvidia-kernel-dkms and zfs-dkms the first time
###

Setting up linux-headers-6.8.9-common (6.8.9-1) ...
Setting up linux-image-6.8.9-amd64 (6.8.9-1) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-6.7.12-amd64
I: /initrd.img.old is now a symlink to boot/initrd.img-6.7.12-amd64
I: /vmlinuz is now a symlink to boot/vmlinuz-6.8.9-amd64
I: /initrd.img is now a symlink to boot/initrd.img-6.8.9-amd64
/etc/kernel/postinst.d/dkms:
dkms: running auto installation service for kernel 6.8.9-amd64.
Sign command: /lib/modules/6.8.9-amd64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module:
Cleaning build area...
Building module(s).........
Signing module /var/lib/dkms/nvidia-current/545.23.06/build/nvidia.ko
Signing module /var/lib/dkms/nvidia-current/545.23.06/build/nvidia-modeset.ko
Signing module /var/lib/dkms/nvidia-current/545.23.06/build/nvidia-drm.ko
Signing module /var/lib/dkms/nvidia-current/545.23.06/build/nvidia-uvm.ko
Signing module /var/lib/dkms/nvidia-current/545.23.06/build/nvidia-peermem.ko
Cleaning build area...

[...]

   - Installing to /lib/modules/6.8.9-amd64/updates/dkms/
[...]
Building module(s).......
Signing module /var/lib/dkms/zfs/2.2.4/build/module/zfs.ko
Signing module /var/lib/dkms/zfs/2.2.4/build/module/spl.ko
[...]

Running the post_build script:
Cleaning build area...

zfs.ko.xz:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.8.9-amd64/updates/dkms/

spl.ko.xz:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.8.9-amd64/updates/dkms/
depmod....
dkms autoinstall on 6.8.9-amd64/x86_64 succeeded for nvidia-current zfs
dkms: autoinstall for kernel: 6.8.9-amd64.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.8.9-amd64
W: Couldn't identify type of root file system for fsck hook
I: The initramfs will attempt to resume from /dev/nvme1n1p4
I: (UUID=b78dc3e1-861f-4a80-b1bd-2ea0bdbb4a96)
I: Set the RESUME variable to override this.
/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.8.9-amd64
Found initrd image: /boot/initrd.img-6.8.9-amd64
Found linux image: /boot/vmlinuz-6.7.12-amd64
Found initrd image: /boot/initrd.img-6.7.12-amd64
Found linux image: /boot/vmlinuz-6.7.9-amd64
Found initrd image: /boot/initrd.img-6.7.9-amd64
done


###
### OK, it has finished the first compilation and installation of both dkms
### modules
###

Setting up linux-kbuild-6.8.9 (6.8.9-1) ...
Setting up linux-image-amd64 (6.8.9-1) ...


###
### Now it deletes the compiled modules for this kernel, compiles them all and
### installs them again:
###

Setting up linux-headers-6.8.9-amd64 (6.8.9-1) ...
/etc/kernel/header_postinst.d/dkms:
Module nvidia-current-545.23.06 for kernel 6.8.9-amd64 (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.

nvidia-current.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/6.8.9-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

nvidia-current-modeset.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/6.8.9-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

nvidia-current-drm.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/6.8.9-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

nvidia-current-uvm.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/6.8.9-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

nvidia-current-peermem.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/6.8.9-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.
depmod....
Module zfs-2.2.4 for kernel 6.8.9-amd64 (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.

zfs.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/6.8.9-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

spl.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/6.8.9-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.
depmod....
dkms: running auto installation service for kernel 6.8.9-amd64.
Sign command: /lib/modules/6.8.9-amd64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

[...]

depmod....
dkms autoinstall on 6.8.9-amd64/x86_64 succeeded for nvidia-current zfs
dkms: autoinstall for kernel: 6.8.9-amd64.
Setting up linux-headers-amd64 (6.8.9-1) ...

real 3m4.300s   user 16m20.516s sys 1m21.171s



craig

Reply via email to