Kernel Headers

Tushar T tush at yahoo.com
Fri Nov 1 11:16:48 PST 2002


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. 
>
Correct. By keeping the linux headers in /usr/include, we are free to 
mess with /usr/src as we see fit.

>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?
>
If you follow the book in copying the headers, yes you may delete 
/usr/src/linux*.

>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?
>
Nope, also it is not even neccessary to use /usr/src/linux for compiling 
the kernel, you can use any directory you wish.

>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.
>
Compiled modules are stored in /lib/modules.

>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.
>  
>
 From the book:

    The essential part is where Linus states that the header files
    should be/the ones which glibc was compiled against/. These are the
    headers that should be used when you later compile other packages,
    as they are the ones that match the object-code library files. By
    copying the headers, we ensure that they remain available if later
    you upgrade your kernel.

    Note, by the way, that it is perfectly all right to have the kernel
    sources in /usr/src/linux, as long as you don't have the
    /usr/include/{linux,asm}symlinks.

Me suggests removing Linus' quote from the book (with maybe a pointer to 
the original message) and replaced by why the headers are copied over 
instead of using symlinks. Since the quote mentions symlinks, it causes 
confusion.

-- 
Tushar Teredesai
LFS ID: 1377
http://tushar.lfsforum.org/


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfromscratch.org/pipermail/lfs-support/attachments/20021101/91f7797f/attachment.html>


More information about the lfs-support mailing list