Kernel Headers

Scot Mc Pherson scot at linuxfromscratch.org
Fri Nov 1 11:10:18 PST 2002


On Fri, 01 Nov 2002 13:30:37 -0500, David C wrote:

> Not sure if this is the right place for this, but here goes.
> 
> I've had this question for awhile now, and thought I sort of knew the
> answer.
> 
> The LFS book features a quote from Linus regarding various issues
> regarding the Kernel headers. I gather from it that the proper place to
> store the headers is in /usr/include/linux, rather than in
> /usr/src/linux with symlinks to them from the former. I also understand
> that those headers should baically be left alone, even if you upgrade
> your kernel, as they need to be the headers that glibc was compiled
> against.
> 
> Ok so far, but is it safe to delete the /usr/src/linux* directory or
> untar a fresh tar.gz of the same version of it in the same directory
> (thus overwriting the old one) when I'm going to recompile? And further
> what to do when compiling a different version kernel?

Yes it's quite safe to deleete the /usr/src/linux directory. In fact the
reason why we copy the linux and asm headers is so that we don't require
the /usr/src/linux directory any longer.  We used to symlink to the
headers in the kernel source tree, which then it WAS unsafe to to make
changes to the kernel tree.  So yes, go ahead and rm -r
/usr/src/linux{,*}. And go ahead and untar another kernel and compiling
it and build it and install it...Just leave /usr/include/{linux,asm}
alone and you are ok.

> In other words, I guess I'm asking if the (/mnt/lfs)/usr/src/linux*
> directory is used for anything once the kernel is already compiled and
> installed?
> 
> Also, where are modules stored? In both my RH 8.0 host and in LFS, the
> /usr/include/linux directory does not have a modules directory, but the
> /usr/src/linux/include/linux directory does. Hence my confusion as to if
> it's ok to delete the kernel directory or not.
>

Modules are usually stored in /lib/modules/2.4{or other kernel version
number}


> Sorry if my message is convoluted and hard to understand. I'm new to
> Linux internals, but thanks to LFS I am learning quite rapidly.
> 
> Thanks,
 
No Problem. Glad LFS has been helpful.

Scot Mc Pherson
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-support' in the subject header of the message



More information about the lfs-support mailing list