Re: Building a single kernel module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/20/05, J. K. Cliburn <jcliburn@xxxxxxxxx> wrote:
> Instructions for (re)building a single kernel module in FC4 are simple
> and outlined in the Release Notes thusly.
>
> ********************************************
> For example, to build the foo.ko module, create the following 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) M=$(PWD) modules
>
> Issue the make command to build the foo.ko module.
> ********************************************
>
> I've done this in the past, but for some reason, today it doesn't
> work.  I'm trying to rebuild the via-velocity kernel module.
>
> [root@osprey net]# uname -r
> 2.6.14-1.1653_FC4
> [root@osprey net]# pwd
> /usr/src/redhat/BUILD/kernel-2.6.14/linux-2.6.14/drivers/net
> [root@osprey net]# ls -l via-velocity.c
> -rw-r--r--  2 root root 88213 Dec 20 08:09 via-velocity.c
> [root@osprey net]# cat Makefile
> obj-m := via-velocity.o
>
> KDIR  := /lib/modules/$(shell uname -r)/build
> PWD   := $(shell pwd)
>
> default:
>     $(MAKE) -C $(KDIR) M=$(PWD) modules
> [root@osprey net]# make
> make: Nothing to be done for `default'.

Well, never mind.  I went to the $(KDIR) directory (above, as shown in
the Makefile) and got the module built.  (Still don't know why it
wouldn't work the other way.)

[root@osprey build]# cd /lib/modules/2.6.14-1.1653_FC4/build
[root@osprey build]# make
M=/usr/src/redhat/BUILD/kernel-2.6.14/linux-2.6.14/drivers/net modules
  CC [M]  /usr/src/redhat/BUILD/kernel-2.6.14/linux-2.6.14/drivers/net/via-velocity.o
  Building modules, stage 2.
  MODPOST
  CC      /usr/src/redhat/BUILD/kernel-2.6.14/linux-2.6.14/drivers/net/via-velocity.mod.o
  LD [M]  /usr/src/redhat/BUILD/kernel-2.6.14/linux-2.6.14/drivers/net/via-velocity.ko


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux