Bug 152129
Summary: | kernel needs /lib/modules/`uname -r`/build subdirectory | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 4 | Reporter: | David Kewley <david_kewley> |
Component: | kernel | Assignee: | Rik van Riel <riel> |
Status: | CLOSED NOTABUG | QA Contact: | Brian Brock <bbrock> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 4.0 | CC: | davej, dwmw2, jbaron, riel, smithj4 |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2005-04-01 20:01:54 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
David Kewley
2005-03-25 03:44:30 UTC
A little followup: The Release Notes state: "An exploded source tree is not required to build kernel modules against the currently in-use kernel. For example, to build the foo.ko module, create the following file (named Makefile) in the directory containing the foo.c file: obj-m := foo.o KDIR := /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) default: $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules Issue the make command to build the foo.ko module." This isn't possible at present out of the box. And an update: Even with the kernel build tree provided by kernel-devel in /usr/src/kernels/<kernel name>, 'make' doesn't work, so I can't change the config and make an SMP tree for building external modules against. At this point I'm left with getting the src.rpm and starting from that. Possible, but unfriendly. Could you please give me an example of an out-of-tree driver that I can try building here, so I can see exactly why it breaks and how to get it fixed ? Sure. I am currently working on the latest 3Ware 9xxx series driver. You can get it from: http://www.3ware.com/support/download_9.2.asp?SNO=490 Best I can tell, I *could* attach this because it'd GPL'd, but I'll be a little cautious and just point to the 3ware site. :) You should be able to make it with e.g. make SRC=/lib/modules/`uname -r`/build As described earlier, look at what happens when you try to build for UP and SMP kernels (at least on x86_64, probably all arches). There is a minor packaging/naming issue which is somewhat related to this that I would like to report. It appears that the kernel-devel packages write into directories like: /usr/src/kernels/`uname -r`-$ARCH except for the smp kernel packages, which add an extra - between the EL in the kernel release number and smp. For example, this is what I currently have: $ ls /usr/src/kernels 2.6.9-5.0.3.EL-i686 2.6.9-5.0.3.EL-smp-i686 2.6.9-5.EL-i686 2.6.9-5.EL-smp-i686 This looks like a mistake to me since it would make much more sense to remove the - before smp and just use `uname -r`-$ARCH. Comment #4 was addressed in bug #145914. *** Bug 152130 has been marked as a duplicate of this bug. *** Just now I learned that the UP package kernel-devel has an SMP sibling kernel-smp-devel. With that installed, I believe all my objections are answered -- it is then possible to compile UP and SMP external modules the "easy" way that I suggested when I opened this bug. Sorry for the waste of time; I like to think I'm a reasonably thorough researcher, but I missed kernel-smp-devel. |