Ask Your Question

How do I compile fedora 16 kernel modules?

asked 2011-11-28 09:44:23 -0500

urilabob gravatar image

updated 2015-01-15 20:08:46 -0500

mether gravatar image

I'm trying to compile source kernel modules for a rocketraid controller against the 3.1.2-1.fc16.x86_64 kernel. I get an error:

/lib/modules/3.1.2-1.fc16.x86_64/build/include/linux/linkage.h:5:25: fatal error: asm/linkage.h: No such file or directory

However /lib/modules/3.1.2-1.fc16.x86_64/build/arch/x86/include/asm/linkage.h (which I presume is what it is looking for) exists. The overall structure looks almost identical to an F15 installation, where the compilation works fine. Is this something I am doing wrong? Or is there an F16 environment setup problem (I can see quite a lot of similar inquiries on the web about missing asm/xxx.h files, but no answers).

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2011-11-28 09:53:59 -0500

lzap gravatar image

updated 2011-11-28 10:22:27 -0500

It's looking for a different file - asm/linkage.h. Could be this one, try locate.

locate linkage.h
edit flag offensive delete link more


Depends, see the g++ call (the last one before your error). Paste it to the original question please. Look for -I options. Add output of the "uname -a" and full paths of your files.

lzap gravatar imagelzap ( 2011-11-28 12:02:54 -0500 )edit

answered 2012-11-13 07:42:34 -0500

Pascal76 gravatar image

It is quite simple to compile a kernel, and as I do this very often, here is a short description:

  1. login to an terminal as root user
  2. cd /usr/src
  3. remove the linux symlink:

rm linux


  1. Load the necessary kernel sources from e.g. with this command:


  1. Extract the sources with this command:

tar xjf linux-3.6.6.tar.bz2

  1. Make a new symlink:

ln -s linux-3.6.6 linux

  1. cd linux

  2. Now you are in the new sources directory. After extraction we need to clean it.

  3. make distclean (this is like make clean && make mrproper)

  4. Now we have really clean kernel sources and we can think about how to go on. One step that is really interseting is: a.) See README file for option.

What maybe nice is make localmodconfig

This checks the current system and loads modules for every running system component.

b.) download and apply a patch:

(download patch-2.6.33-rt7.bz2) tar xjf patch-2.6.33-rt7.bz2 patch -p1 <patch-2.6.33-rt7< p="">

after this I recommend to make a

make menuconfig

for at least changing the name of your new kernel build.

c.) What else can be done In Fedora you have the last and current sources for the kernel in subdirectories under:

/usr/src/kernels/ There you also find a .config file you can take for an own kernel compilation.

You can try to take the most recent 3.x.y kernel for your system runnung a 3.x kernel and use this and the above mentioned .config file.

The most necessary steps would be:

make oldyesconfig make menuconfig ( In this make the following steps: a. load the .config file b. add an own kernel description, this is in the general options menu c. save the .configfile and exit) make make modules_install make install

for the single make entry it is very useful to add something like

-j4 for a doublecore-cpu -j8 for a quadcore


output.log for reducing local output.

In /usr/src/linux you find the README file by Linux Torvalds for more hints on how to compile a kernel.

edit flag offensive delete link more

answered 2012-11-12 11:09:49 -0500

praneeth gravatar image
edit flag offensive delete link more

Question Tools


Asked: 2011-11-28 09:44:23 -0500

Seen: 5,910 times

Last updated: Nov 13 '12