Ibook kernel headers

Stefan Bruda yellowdog-general@lists.terrasoftsolutions.com
Tue Feb 18 18:29:01 2003


At 23:48 +0100 on 2003-2-18 Serafim Dahl wrote:
 >
 > Yes, but the headers are in the include directory. What is it that you 
 > want to compile? Is there a Makefile? In that case, fix the Makefile to 
 > look for the headers in /usr/src/linux-2.4.20-0.7d/include instead of
 > /usr/include. It should work.

Correct, but here is a solution that does not ask you to change
makefiles all the time.

As a matter of fact, I actually sidestepped the kernel headers rpm.
You see, I have the kernel source (in fact, for reasons that do not
need explring I build my own kernel from sources instead of using
precompiled versions so I must have the sources), case in which the
headers rpm is no longer useful.

So I did something like this: my kernel sources are in
/usr/src/linux-2.4-benh (yours are somewhere else, probably
/usr/src/linux-2.4.20-0.7d, anyway you get the idea).  I then
symlinked /usr/src/linux to this directory (as it is customary).

(Note: when I say "symlink x to y" I mean do ln -s y x not the other
way around.)

After this I simply got rid of the headers installed by the (old)
headers rpm by zapping /usr/include/linux and /usr/include/asm (i.e.,
doing rm -rf on them)--if you don't dare doing this, just move them
someplace else so that you can recover their content if things go
wrong).

Finally, I symlinked /usr/include/linux to
/usr/src/linux/include/linux and /usr/include/asm to
/usr/src/linux/include/asm and that's it.  I do not really understand
the purpose of keeping a separate set of headers, since you are in for
big trouble (as you know already) in this setting as soon as you
upgrade the kernel and you don't have the right rpm for the headers.

The supplementary beauty of all of this is that as soon as I get a new
tarball/rpm (as the case might be) with kernel sources all I do is
expand it in /usr/src and update /usr/src/linux (if necessary!--if you
download a new version of the same source tree and/or if you use rsync
or cvs to update you don't even need this).  And that's it, you are
back in business, only with a new kernel _and_ a new set of kernel
headers.  I have been running under this setting as long as I remember
using Linux, and everything was (and is) nice and dandy, no more
double update (kernel sources + headers).

Hope this helps,
Stefan

-- 
If it was so, it might be; and if it were so, it would be; but as
it isn't, it ain't. That's logic.
    --Lewis Carroll, Through the Looking-Glass