Skip to content

uninstalling a DKMS package with an active OBSOLETE_BY messes the DKMS state up #565

@morgwai

Description

@morgwai

system info: dkms-3.3.0-1 (from Nvidia DC repos) on Debian-13

I maintain an unofficial Debian Trixie package, that backports ntsync kernel module to Trixie's 6.12 kernel: ntsync was merged to the mainline in 6.14 and enabled on Debian in 6.14.5. Therefore, I use OBSOLETE_BY="6.14.5" directive to avoid building for kernels that already have their own ntsync:

PACKAGE_NAME="ntsync"
PACKAGE_VERSION="1"
AUTOINSTALL=yes
OBSOLETE_BY="6.14.5"

BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
DEST_MODULE_LOCATION[0]="/kernel/drivers/misc/"

If I install this package on a pristine Trixie system with only its base 6.12.x kernel, then everything works fine.

However, If I install it on a system that also has some kernel >=6.14.5 (for example some 6.17.x from trixie-backports), then the package correctly skips the build on that kernel, but if I uninstall it later, it messes my DKMS state and dkms status reports ntsync/1: broken and Manual intervention is required!

An example full terminal output:

install the package:

$ sudo apt-get install ntsync-kernel-dkms 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
  winehq
The following NEW packages will be installed:
  ntsync-kernel-dkms
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 9,276 B of archives.
After this operation, 45.1 kB of additional disk space will be used.
Get:1 http://download.opensuse.org/repositories/home:/morgwai:/ntsync/Debian_13  ntsync-kernel-dkms 6.14.0~repack-2 [9,276 B]
Fetched 9,276 B in 0s (99.1 kB/s)              
Selecting previously unselected package ntsync-kernel-dkms.
(Reading database ... 285837 files and directories currently installed.)
Preparing to unpack .../ntsync-kernel-dkms_6.14.0~repack-2_all.deb ...
Unpacking ntsync-kernel-dkms (6.14.0~repack-2) ...
Setting up ntsync-kernel-dkms (6.14.0~repack-2) ...
Loading new ntsync/1 DKMS files...
Building for 6.12.57+deb13-amd64 and 6.17.8+deb13-amd64

Building initial module ntsync/1 for 6.12.57+deb13-amd64
Sign command: /lib/modules/6.12.57+deb13-amd64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module(s)... done.
Signing module /var/lib/dkms/ntsync/1/build/ntsync.ko
Installing /lib/modules/6.12.57+deb13-amd64/updates/dkms/ntsync.ko.xz
Running depmod... done.

Building initial module ntsync/1 for 6.17.8+deb13-amd64
Warning: The /var/lib/dkms/ntsync/1/6.17.8+deb13-amd64/x86_64/dkms.conf
for module ntsync/1 includes BUILD_EXCLUSIVE directives
which do not match this kernel/arch/config for any modules.
This indicates that it should not be built.

check the DKMS status:

$ sudo dkms status
ntsync/1, 6.12.57+deb13-amd64, x86_64: installed
nvidia/590.48.01, 6.12.57+deb13-amd64, x86_64: installed
nvidia/590.48.01, 6.17.8+deb13-amd64, x86_64: installed
tuxedo-drivers/4.18.1, 6.12.57+deb13-amd64, x86_64: installed
tuxedo-drivers/4.18.1, 6.17.8+deb13-amd64, x86_64: installed
tuxedo-yt6801/1.0.30tux5, 6.12.57+deb13-amd64, x86_64: installed
tuxedo-yt6801/1.0.30tux5, 6.17.8+deb13-amd64, x86_64: installed

remove the package:

$ sudo apt-get remove ntsync-kernel-dkms 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  ntsync-kernel-dkms
0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
After this operation, 45.1 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 285845 files and directories currently installed.)
Removing ntsync-kernel-dkms (6.14.0~repack-2) ...
Module ntsync/1 for kernel 6.12.57+deb13-amd64 (x86_64):
Before uninstall, this module version was ACTIVE on this kernel.
Deleting /lib/modules/6.12.57+deb13-amd64/updates/dkms/ntsync.ko.xz
Running depmod.... done.
Module ntsync/1 is not built for kernel  (). Skipping...

(please notice the empty kernel version in the line above)

DKMS status will report the error:

$ sudo dkms status
ntsync/1: broken

Error! ntsync/1: Missing the module source directory or the symbolic link pointing to it.
Manual intervention is required!
nvidia/590.48.01, 6.12.57+deb13-amd64, x86_64: installed
nvidia/590.48.01, 6.17.8+deb13-amd64, x86_64: installed
tuxedo-drivers/4.18.1, 6.12.57+deb13-amd64, x86_64: installed
tuxedo-drivers/4.18.1, 6.17.8+deb13-amd64, x86_64: installed
tuxedo-yt6801/1.0.30tux5, 6.12.57+deb13-amd64, x86_64: installed
tuxedo-yt6801/1.0.30tux5, 6.17.8+deb13-amd64, x86_64: installed

The situation may be manually fixed with the following commands:

$ sudo mkdir /usr/src/ntsync-1
$ sudo dkms remove ntsync/1 --all

After that the DKMS status is clean:

$ sudo dkms status
nvidia/590.48.01, 6.12.57+deb13-amd64, x86_64: installed
nvidia/590.48.01, 6.17.8+deb13-amd64, x86_64: installed
tuxedo-drivers/4.18.1, 6.12.57+deb13-amd64, x86_64: installed
tuxedo-drivers/4.18.1, 6.17.8+deb13-amd64, x86_64: installed
tuxedo-yt6801/1.0.30tux5, 6.12.57+deb13-amd64, x86_64: installed
tuxedo-yt6801/1.0.30tux5, 6.17.8+deb13-amd64, x86_64: installed

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions