Re: Support 2.4 modules features in 2.6

From: Robert Hancock
Date: Tue Dec 12 2006 - 19:33:06 EST


Jaswinder Singh wrote:
you only need include/* for this in 2.6

you can't do this at all with 2.4 kernels, it needs the whole lot.

(in both cases the code and headers are needed so that your module can
use the data structures and compile in the kernel code you select to use
from inlines)
>
>

Really!!

This is my Makefile :-
obj-m += hello-1.o

all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean


Now do one thing:-
# mv /lib/modules/$(uname -r)/build /lib/modules/$(uname -r)/build0

now make it.

Of course you can't, there are no kernel header files left.


If you want point to your header files in /usr/include and then try to build.

Those are userspace header files, not for building modules. They may have worked in certain setups for doing this in the past but this was never recommended. Current distributions no longer include any kernel-internal headers in /usr/include anymore.

You do need at least a partial kernel source tree to build modules against.

--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@xxxxxxxxxxxxx
Home Page: http://www.roberthancock.com/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/