must have current kernel's headers to build kernel version for module
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dkms (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
$ sudo dkms ldtarball --archive=
$ dpkg-query --show | grep linux.*headers
linux-headers-
linux-headers-
linux-headers-
linux-headers-
$ uname -r
3.2.0-12-virtual
$ sudo dkms -k 3.2.0-14-virtual build madwifi -v 0.9.4+4178
Kernel preparation unnecessary for this kernel. Skipping...
Building module:
cleaning build area....(bad exit status: 2)
make KERNELRELEASE=
ERROR (dkms apport): binary package for madwifi: 0.9.4+4178 not found
Error! Bad return status for module build on kernel: 3.2.0-14-virtual (x86_64)
Consult /var/lib/
$ cat /var/lib/
DKMS make.log for madwifi-0.9.4+4178 for kernel 3.2.0-14-virtual (x86_64)
Tue Feb 7 03:08:13 UTC 2012
/bin/sh: 1: cd: can't cd to /lib/modules/
Makefile.inc:66: *** /lib/modules/
$ ls -l /lib/modules/
lrwxrwxrwx 1 root root 39 Feb 4 00:20 /lib/modules/
$ ls -l /lib/modules/
ls: cannot access /lib/modules/
Basically, above I tried to build a dkms module for a version of the kernel other than the current running version.
That failed because I did not have the kernel headers for the current running version.
Ie, it dies saying It needs '3.2.0-
After rebooting into 3.2.0-14-virtual, the same 'build' command above succeeds.
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: dkms 2.2.0.3-1
ProcVersionSign
Uname: Linux 3.2.0-12-virtual x86_64
ApportVersion: 1.91-0ubuntu1
Architecture: amd64
Date: Tue Feb 7 03:03:13 2012
Ec2AMI: ami-00000138
Ec2AMIManifest: FIXME
Ec2Availability
Ec2InstanceType: m1.small
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
PackageArchitec
ProcEnviron:
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: dkms
UpgradeStatus: No upgrade log present (probably fresh install)
If I recall correctly, I had this same problem with madwifi on my machines, and it's not a bug in dkms at all, it's cargo-culting a broken dkms.conf (which I did as well). Fixing your dkms.conf like so will make it actually build for the version you requested, rather than the running version:
--- dkms_source_ tree/dkms. conf 2012-02-07 02:56:37.000000000 +0000 0.9.4/dkms. conf 2010-12-04 22:33:11.000000000 +0000 MODULE_ NAME[13] ="ath_rate_ onoe" MODULE_ LOCATION[ 13]="ath_ rate/onoe" LOCATION[ 13]="/kernel/ drivers/ net/wireless" /lib/modules/ $kernelver" /lib/modules/ $kernelver/ build"
+++ madwifi-
@@ -43,5 +43,5 @@
BUILT_
BUILT_
DEST_MODULE_
-MAKE[0]="make modules KERNDIR=
+MAKE[0]="make modules KERNELPATH=
AUTOINSTALL="yes"