Re: How to manage build process under autotools for kernel module



On Tue, 18 Sep 2006, john.calcote@xxxxxxxxx wrote:

My problem is packaging - I've never written a kernel module as an open
source project, and so I just don't know what's being done out there to
distribute such code. The user space portion of my project is based on
autotools, but as for the kernel module portion - well, I'm open to
suggestion ...

If you are using 2.6 kernel, it is common that the out-of-tree modules
also use the Kbuild (linux kernel build system). Let's say you have
hello.c and want to compile it against currently running kernel's source
as a module. The only Makefile you needs should then be something similar
to:

obj-m += hello.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

issuing 'make' will the use the kernel build system, headers,
configuration, etc. to build and link your hello.c into hello.ko.

--
Jiri Kosina
.



Relevant Pages

  • Re: Checkpoint/restart (was Re: [PATCH 0/4] - v2 - Object creation with a specified id)
    ... kernel representation. ... If the state can be inferred from user space it is visible to user ... In the worst case today we can restore a checkpoint by replaying all of ... Checkpoints coordinated between multiple containers or real ...
    (Linux-Kernel)
  • Re: [OT] ALSA userspace API complexity
    ... Why we have X servers in user space (and only some supporting code is in the kernel) then? ... Can you do this with ALSA way? ... comercial OSS have ALSA emulation and ALSA have OSS emulation. ...
    (Linux-Kernel)
  • Re: Things that Longhorn seems to be doing right
    ... Updating a user space database every time ... >is just as bad as putting an SQL optimizer into the kernel. ... Well, since I don't think that SQL belongs in the filesystem, and I ...
    (Linux-Kernel)
  • Re: [OT] ALSA userspace API complexity
    ... >> It means that you are saying that kernel should be bigger and bigger. ... Why we have X servers in user space (and ... > All abstraction are NOW coded but some parts of this abstraction are on ... > If you have sound device without this soft mixing is moved to user space ...
    (Linux-Kernel)
  • Re: [Devel] Re: [PATCH 0/9] OpenVZ kernel based checkpointing/restart
    ... That is why we prefer in OpenVZ to do all the job in kernel. ... with the same distribution. ... The distributed protocol used for restart is ... from user space, ...
    (Linux-Kernel)