Kernel modules are not built when the kernel is upgraded
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dkms (Ubuntu) |
Fix Released
|
Medium
|
Alberto Milone |
Bug Description
When a new kernel is installed, a kernel hook in postinst.d is called and, in my case I saw that dkms_autoinstaller was called in the following way when I upgraded to linux-image 3.0.0-5-generic:
/usr/lib/
(dkms_autoinsta
However no module was built against the new kernel even though I have nvidia-current, nvidia-173 and fglrx installed on my system (the relevant kernel headers are installed too):
:~$ dkms status
fglrx, 8.861, 3.0-2-generic, x86_64: installed
nvidia-173, 173.14.30, 3.0-0-generic, x86_64: installed
nvidia-173, 173.14.30, 3.0-2-generic, x86_64: installed
nvidia-current, 275.09.07, 3.0-0-generic, x86_64: installed
nvidia-current, 275.09.07, 3.0-2-generic, x86_64: installed
I tried to get a log but it was pretty useless:
:~$ sudo /usr/lib/
Then I added "set -xv" in /usr/sbin/dkms to make it more verbose:
:~$ sudo /usr/lib/
In the log I noticed the following line:
++ make_command='make module KERNDIR=
The line comes from one of the Nvidia drivers' dkms.conf:
MAKE[0]="make module KERNDIR=
This (and some other lines in the log) clearly show that $kernelver is set to $(uname -r) in setup_kernel_
I ported my kernel detection work from the common.postinst template to the dkms script so as to make sure that we always build against the newest kernel when no kernel version is specified.
Apply the attached patch to dkms (and add set -xv) and then try to reproduce the problem:
:~$ sudo /usr/lib/
And here's the result:
:~$ dkms status
fglrx, 8.861, 3.0.0-5-generic, x86_64: installed
fglrx, 8.861, 3.0-2-generic, x86_64: installed
nvidia-173, 173.14.30, 3.0.0-5-generic, x86_64: installed
nvidia-173, 173.14.30, 3.0-0-generic, x86_64: installed
nvidia-173, 173.14.30, 3.0-2-generic, x86_64: installed
nvidia-current, 275.09.07, 3.0.0-5-generic, x86_64: installed
nvidia-current, 275.09.07, 3.0-0-generic, x86_64: installed
nvidia-current, 275.09.07, 3.0-2-generic, x86_64: installed
ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: dkms 2.2.0.1-0ubuntu1 [modified: usr/sbin/dkms]
ProcVersionSign
Uname: Linux 3.0-2-generic x86_64
NonfreeKernelMo
Architecture: amd64
Date: Tue Jul 19 17:57:44 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha amd64 (20110302)
PackageArchitec
ProcEnviron:
PATH=(custom, no user)
LANG=en_GB.UTF-8
SHELL=/bin/bash
SourcePackage: dkms
UpgradeStatus: Upgraded to oneiric on 2011-07-19 (0 days ago)
tags: | added: patch |
After discussing the issue with Mario, it turns out that a much simpler solution exists (as we're dealing with a regression). We should simply use the kernel version passed to the dkms_autoinstaller.
I ran the following command with my new patch and all went well:
sudo /usr/lib/ dkms/dkms_ autoinstaller start 3.0.0-5-generic &> dkms_simpler_ solution. log
:~$ dkms status
fglrx, 8.861, 3.0.0-5-generic, x86_64: installed
fglrx, 8.861, 3.0-2-generic, x86_64: installed
nvidia-173, 173.14.30, 3.0.0-5-generic, x86_64: installed
nvidia-173, 173.14.30, 3.0-0-generic, x86_64: installed
nvidia-173, 173.14.30, 3.0-2-generic, x86_64: installed
nvidia-current, 275.09.07, 3.0.0-5-generic, x86_64: installed
nvidia-current, 275.09.07, 3.0-0-generic, x86_64: installed
nvidia-current, 275.09.07, 3.0-2-generic, x86_64: installed