Subject: Re: [vserver] How to build kernel modules for host?
From: "Michael S. Zick" <mszick@morethan.org>
Date: Wed, 24 Sep 2008 14:57:31 -0500

On Wed September 24 2008, Daniel Hokka Zakrisson wrote:
> Roderick A. Anderson wrote:
> > And if that question isn't ambiguous enough I don't know what would be.
> >
> > So here goes.  I need to build a kernel module that is need by software
> > to run in a guest.  Specifically the zaptel(ztdummy) module for Asterisk.
> >
> > The instructions I'm using (http://www.telephreak.org/papers/vpa/) are
> > based on a debian install so since I use CentOS so my-mileage-will-vary.
> >
> > When I've installed Asterisk on standalone systems I remember needing to
> > install the kernel sources/headers.  That was a full Asterisk install so
> > I'm not sure if to build only the zaptel driver I need them -- the
> > source/headers.
> >
> > To be on the safe side I'd like to go ahead and install them.
> >
> > So the questions are:
> >   * Is the kernel*src*.rpm from Daniel's repository enough?
> 
> Not what you want.
> 
> >   * Would the L-V patches cause any problems when building other kernel
> > modules?
> 
> Not likely for zaptel, but maybe.
> 
> >   * Should I just install, via yum, the whole *-devel pile?
> 
> kernel-devel-`uname -r` is what you want.
>

Which will get you the kernel-devel-`for currently executing kernel`

If that is not the version you just built - then:

either first boot the version you just built - or:

check for `uname -r` in the build scripts and hardcode in
the version string.

Note: check the entire path where you replace the `uname -r`
commands - many scripts expect the source to be installed
(I.E: they follow either the /lib/modules/<version>/source 
link or the /lib/modules/<version>/build link)
and that at least "make prepare" has been run on that tree.

The "easy way out" - boot the kernel you want to build the
modules for - it is the common presumption that it is running.

Mike
>