Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm currently running Arch Linux on linux-3.0-ARCH and I'm looking to compile kernel modules written for linux-2.6.22.14.

I've only compiled kernel modules on a pre-configured debian. So all I had to know was the location for the kernel source and how to edit the module's Makefile accordingly.

But since I'm trying this on my machine now, I downloaded the source for 2.6.22.14 and put it in /root/. I changed the Makefile for the module to point to this and I executed 'make'. All I get now is:

Makefile:1443: *** mixed implicit and normal rules. Stop.

Someone once said I'd have to compile this kernel source. If so, is there an easier way to obtain the compiled version, to plug here instead of the source code?

share|improve this question

migrated from stackoverflow.com Nov 13 '11 at 0:08

This question came from our site for professional and enthusiast programmers.

3 Answers 3

Your module may not run well under your 3.0-something Linux kernel -- the scheduler, for example, underwent a major overhaul in 2.6.23. Perhaps your module made some assumptions about the scheduler environment, perhaps not, but there is no guarantee that it will work on the newer system.

You can't build a module against a kernel source tree that isn't yet configured and built. Easiest is to use the /lib/modules/$(uname -r)/build/ symbolic link that most distribution-provided kernel packages supply with enough headers and configuration material to build external modules.

If you want to try building your module for your current kernel, change directory into the module's source directory and run the following:

make -C /lib/modules/`uname -r`/build M=$PWD

This will invoke the kbuild mechanism to build your module correctly. For more details, see Documentation/kbuild/modules.txt in the kernel sources.

share|improve this answer

You may be missing the kernel headers package: pacman -S linux-headers

That should get you the appropriate kernel headers.

share|improve this answer

2.6.22 is too old a kernel to be compatible with 3.0

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.