must have current kernel's headers to build kernel version for module

Bug #928007 reported by Scott Moser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dkms (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

$ sudo dkms ldtarball --archive=madwifi-0.9.4+4178-source-only.dkms.tar.gz
$ dpkg-query --show | grep linux.*headers
linux-headers-3.2.0-14 3.2.0-14.23
linux-headers-3.2.0-14-generic 3.2.0-14.23
linux-headers-3.2.0-14-virtual 3.2.0-14.23
linux-headers-generic 3.2.0.14.14
$ 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=3.2.0-14-virtual modules KERNDIR=/lib/modules/3.2.0-14-virtual....(bad exit status: 2)
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/dkms/madwifi/0.9.4+4178/build/make.log for more information.

$ cat /var/lib/dkms/madwifi/0.9.4+4178/build/make.log
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/3.2.0-12-virtual/build
Makefile.inc:66: *** /lib/modules/3.2.0-12-virtual/build is missing, please set KERNELPATH. Stop.

$ ls -l /lib/modules/3.2.0-14-virtual/build
lrwxrwxrwx 1 root root 39 Feb 4 00:20 /lib/modules/3.2.0-14-virtual/build -> /usr/src/linux-headers-3.2.0-14-virtual
$ ls -l /lib/modules/3.2.0-12-virtual/build
ls: cannot access /lib/modules/3.2.0-12-virtual/build: No such file or directory

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-12-virtual/build', but I'm trying to build for 3.2.0-14-virtual.

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
ProcVersionSignature: User Name 3.2.0-12.21-virtual 3.2.2
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
Ec2AvailabilityZone: nova
Ec2InstanceType: m1.small
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: dkms
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
Scott Moser (smoser) wrote :
description: updated
description: updated
Revision history for this message
Adam Conrad (adconrad) wrote :

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
+++ madwifi-0.9.4/dkms.conf 2010-12-04 22:33:11.000000000 +0000
@@ -43,5 +43,5 @@
 BUILT_MODULE_NAME[13]="ath_rate_onoe"
 BUILT_MODULE_LOCATION[13]="ath_rate/onoe"
 DEST_MODULE_LOCATION[13]="/kernel/drivers/net/wireless"
-MAKE[0]="make modules KERNDIR=/lib/modules/$kernelver"
+MAKE[0]="make modules KERNELPATH=/lib/modules/$kernelver/build"
 AUTOINSTALL="yes"

Changed in dkms (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.