HOWTO build a kernel module

Paul Howarth paul at
Fri Feb 18 18:06:35 UTC 2005

BZ Benny wrote:
> Hi,
> Did somone know a good HOWTO build a kernel module in FC3

There's one in the release notes:


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)

	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

Issue the make command to build the foo.ko module.


That's all that's needed...


More information about the users mailing list