Re: Invalid module format in Fedora core2

From: Payasam Manohar
Date: Sat Feb 26 2005 - 22:11:51 EST



hai sam,
thanks for ur valuable info reg. 2.6 module insertion.




Thanks&Regards,

P.Manohar,
n Fri, 25 Feb 2005, it was written:


There are new books that you are supposed to buy which will
tell you how to re-write all your modules to interface with
the new crap.
Whats wrong with the free articles at lwn.net?


I attached a typical makefile so you can see how complicated
this new crap is.
This is utterly crap.

There is no difference in the Makefile being in-kernel or for an
external module if the Makefile is used solely to specify content of the
Module.

So for a sample module named mymodule you need:

Makefile:
obj-m := mymodule.o
mymodule-y := file1.o file2.o file3.o

Here assuming 3 files are needed to build the actual module.
If you then want some wrapping to make things a bit easier you can add a
second file:


makefile:
VERS := $(shell uname -r)
CDIR := $(shell pwd)

all:
$(MAKE) V=1 -C /usr/src/linux-$(VERS) SUBDIRS=$(CDIR) modules
strip -x -R .note -R .comment mymodule.ko

And nothing special is needed with respect to vermagic etc. The kernel
do it for you.

Please keep in mind the original poster did not ask for a method that
could be used for both 2.4 _and_ 2.6.

Sam

-
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/