[Novalug] kernel module building on Fedora

Mike Miller mike.t.miller at gmail.com
Sat Oct 24 12:09:02 EDT 2009


On Fri, 2009-10-23 at 21:22 -0400, greg pryzby wrote: 
> It appears that things are different for Fedora in preparing the kernel 
> to build modules.
> 
> In the past (non-Fedora)
>     cd /usr/src/linux
>     make oldconfig
>     make modules_prepare
> 
> Well, there is an extra level
>     cd /usr/src/kernel/<version>
>     make oldconfig
>     make modules_prepare
>     .... dies and complains about missing-syscalls
> 
> Searching wasn't too helpful.
> 
> So I thought I would ask before I start looking around and figuring out 
> how to use the rpmbuild tools (damn you American Dave, next months topic!).
> 
> Anyone who would like to help, I am ready to learn the Fedora way ;)

Hi, new to the list.  We do exactly that as part of our build, we have a
handful of drivers built and rpm'd for RHEL and Fedora.

Under Fedora you *should* only need to install the kernel-devel package
for your kernel version, which includes all the header files, Makefiles,
and configs built at the same time as the kernel image, no prep needed.
Assuming that's installed correctly

make -C /lib/modules/`uname -r`/build M=$PWD modules
make -C /lib/modules/`uname -r`/build M=$PWD modules_install

should work.

As far as a "Fedora way" to build an rpm for drivers, I don't know if
there is any in the official distro.  We use a hacked version of the
kmdl[1] rpm macros to build rpms, it's been working for us so far, from
RHEL4 through Fedora 10.

[1] http://fedoraproject.org/wiki/AxelThimm/kmdls

-- 
mike :: mike.t.miller at gmail dot com




More information about the Novalug mailing list