FS#48355 - [dkms] all DKMS modules get removed on kernel update

Attached to Project: Arch Linux
Opened by Matthias Dienstbier (fs4000) - Saturday, 27 February 2016, 11:47 GMT
Last edited by Sébastien Luttringer (seblu) - Sunday, 06 March 2016, 22:53 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Sébastien Luttringer (seblu)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

I updated the linux package from version 4.4.2-1 to 4.4.3-1. The transaction finished successfully but all DKMS modules were removed aftwerwards.

/var/lib/dkms/ just contains the dkms_dbversion file and "dkms status" outputs nothing.
This task depends upon

Closed by  Sébastien Luttringer (seblu)
Sunday, 06 March 2016, 22:53 GMT
Reason for closing:  Fixed
Additional comments about closing:  dkms-2.2.0.3+git151023-6
Comment by Doug Newgard (Scimmia) - Saturday, 27 February 2016, 15:01 GMT
Right, then they should have been rebuilt after the transaction. What's in /usr/src/?
Comment by Matthias Dienstbier (fs4000) - Saturday, 27 February 2016, 17:28 GMT
In /usr/src/ I have:
- vboxhost-5.0.14_OSE (community-testing/virtualbox-host-dkms)
- phc-intel-0.3.2 (https://aur.archlinux.org/packages/phc-intel)
- compal-laptop-0.2.10 (http://eko.one.pl/?p=compal-laptop merged with intree module by myself)

Yes, it should rebuild all DKMS added modules after the transaction, but the 70-dkms-remove.hook *removes* all modules from DKMS before the transaction. So afterwards there are no modules to install anymore because they were removed in the first place. I guess the modules should only be *uninstalled* before a kernel update so that they are still registered in DKMS.
Comment by Doug Newgard (Scimmia) - Sunday, 28 February 2016, 01:08 GMT
Yes, 70-dkmd-remove removes the modules, then 70-dkms-install rebuilds them post-transaction. Seems to work fine for me.
Comment by Matthias Dienstbier (fs4000) - Sunday, 28 February 2016, 12:57 GMT
Then how does this happen?

[root@zepto ~]# pacman -Q dkms virtualbox-host-dkms phc-intel
dkms 2.2.0.3+git151023-5
virtualbox-host-dkms 5.0.14-3
phc-intel 0.3.2.12.19-2
[root@zepto ~]# dkms status
compal-laptop, 0.2.10, 4.4.2-1-ARCH, x86_64: installed
phc-intel, 0.3.2, 4.4.2-1-ARCH, x86_64: installed
vboxhost, 5.0.14_OSE, 4.4.2-1-ARCH, x86_64: installed
[root@zepto ~]# ls -l /var/lib/dkms/
total 4
drwxr-xr-x 1 root root 64 Feb 28 13:44 compal-laptop
-rw-r--r-- 1 root root 6 Feb 21 13:06 dkms_dbversion
drwxr-xr-x 1 root root 62 Feb 28 13:43 phc-intel
drwxr-xr-x 1 root root 72 Feb 28 13:45 vboxhost
[root@zepto ~]# find /usr/lib/modules/ -name vboxdrv.ko -o -name phc-intel.ko -o -name compal-laptop.ko
/usr/lib/modules/4.4.2-1-ARCH/kernel/misc/vboxdrv.ko
/usr/lib/modules/4.4.2-1-ARCH/extra/phc-intel.ko
/usr/lib/modules/4.4.2-1-ARCH/updates/compal-laptop.ko
[root@zepto ~]# pacman -Su
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...

Package (2) Old Version New Version Net Change

testing/linux 4.4.2-1 4.4.3-1 -0.12 MiB
testing/linux-headers 4.4.2-1 4.4.3-1 0.00 MiB

Total Installed Size: 108.02 MiB
Net Upgrade Size: -0.12 MiB

:: Proceed with installation? [Y/n]
(2/2) checking keys in keyring [######################] 100%
(2/2) checking package integrity [######################] 100%
(2/2) loading package files [######################] 100%
(2/2) checking for file conflicts [######################] 100%
(2/2) checking available disk space [######################] 100%
:: Running pre-transaction hooks...
(1/1) Remove DKMS modules
:: Processing package changes...
(1/2) upgrading linux [######################] 100%
>>> Updating module dependencies. Please wait ...
>>> Generating initial ramdisk, using mkinitcpio. Please wait...
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> Starting build: 4.4.3-1-ARCH
-> Running build hook: [systemd]
==> Generating module dependencies
==> Creating lz4-compressed initcpio image: /boot/initramfs-linux.img
==> Image generation successful
(2/2) upgrading linux-headers [######################] 100%
:: Running post-transaction hooks...
(1/1) Install DKMS modules
[root@zepto ~]# dkms status
[root@zepto ~]# ls -l /var/lib/dkms/
total 4
-rw-r--r-- 1 root root 6 Feb 21 13:06 dkms_dbversion
[root@zepto ~]# find /usr/lib/modules/ -name vboxdrv.ko -o -name phc-intel.ko -o -name compal-laptop.ko
[root@zepto ~]#
Comment by Evangelos Foutras (foutrelis) - Sunday, 06 March 2016, 12:09 GMT
This appears to be an issue with /usr/lib/dkms/alpm-hook; when headers are removed/installed it checks /var/lib/dkms/*/*/source for which modules it needs to remove/install.

/var/lib/dkms is populated when the removal version of the hook runs, but it's empty when it tries to reinstall the modules so we end up with no modules.

You can easily reproduce the issue by removing and then reinstalling linux-headers.
Comment by Sébastien Luttringer (seblu) - Sunday, 06 March 2016, 13:22 GMT
ok, this is happening when you have only one kernel installed. Others kernels prevent un-registering of modules in /var/lib/dkms/ and make things apparently works.

Should be fixed in dkms-2.2.0.3+git151023-6. Could you confirm all is ok?
Comment by Evangelos Foutras (foutrelis) - Sunday, 06 March 2016, 13:46 GMT
It now works for me with one kernel and virtualbox-host-dkms as the only DMKS modules on the system.

Loading...