FS#72135 - [dkms] Pacman hook fails to clean modules in 'added' status
Attached to Project:
Arch Linux
Opened by gamezelda (gamezelda) - Tuesday, 14 September 2021, 19:33 GMT
Last edited by Sébastien Luttringer (seblu) - Tuesday, 16 November 2021, 05:39 GMT
Opened by gamezelda (gamezelda) - Tuesday, 14 September 2021, 19:33 GMT
Last edited by Sébastien Luttringer (seblu) - Tuesday, 16 November 2021, 05:39 GMT
|
Details
(NOTE: This looks similar to
Description: In addition to the 'built' and 'installed' status, DKMS can show an 'added' status for on 'dkms status' output, for kernel modules that have been added to DKMS but has not been successfully built for any kernel version. An easy (and probably common) way to leave a module in 'added' status is to build a package containing a DKMS module that does never build. For convenience I attach a package with a broken module that you can use for testing. Ideally the DKMS pacman hook should be able to completely clean up the broken module from DKMS when the package with the broken module is uninstalled, but currently when attempting to remove the package, the DKMS module will print messages saying it can't be removed, the module will remain in status 'added' in 'dkms status' and leftover files will remain in /var/lib/dkms/. (The module can be cleaned manually with 'dkms remove modulename/1.2.3 --all'). Additional info: * package version(s): dkms 2.8.5-1 * config and/or log files etc.: N/A / Check below * link to upstream bug report, if any: Not an upstream bug Steps to reproduce: $ tar xf broken-dkms.tar.gz $ cd broken-dkms/ $ makepkg -si --noconfirm ... (2/2) Install DKMS modules ==> dkms install --no-depmod -m broken -v 1.0.0 -k 5.14.2-arch1-2 Error! Bad return status for module build on kernel: 5.14.2-arch1-2 (x86_64) Consult /var/lib/dkms/broken/1.0.0/build/make.log for more information. ==> Warning, `dkms install --no-depmod -m broken -v 1.0.0 -k 5.14.2-arch1-2' returned 10 ==> depmod 5.14.2-arch1-2 $ sudo dkms status broken, 1.0.0: added $ pacman -Rns broken-dkms ... (1/1) Remove DKMS modules ==> Unable to remove module broken/1.0.0 for kernel 5.14.2-arch1-2: Not found in dkms status output. ... $ sudo dkms status broken, 1.0.0: added $ ls /var/lib/dkms/broken/1.0.0/ build source $ # Manual cleanup $ sudo dkms remove broken/1.0.0 --all ------------------------------ Deleting module version: 1.0.0 completely from the DKMS tree. ------------------------------ Done. $ sudo dkms status $ ls /var/lib/dkms/broken/1.0.0/ ls: cannot access '/var/lib/dkms/broken/1.0.0/': No such file or directory |
This task depends upon
Closed by Sébastien Luttringer (seblu)
Tuesday, 16 November 2021, 05:39 GMT
Reason for closing: Fixed
Tuesday, 16 November 2021, 05:39 GMT
Reason for closing: Fixed
I think the logic should be:
If removing a kernel = all paths in usr/lib/modules/... => Call dkms remove -m "$mod" -v "$mver" -k "$kver" (current logic)
If removing a module = at least one path in usr/src/... => Call dkms remove -m "$mod" -v "$mver" --all" (missing logic)
--
EDIT 2021-11-21: A bit late for the feedback as the task is already closed, but I can confirm that the issue no longer reproduces for me on dkms 3.0.1-1