Kernel Headers

Jeremy Utley jutley3 at
Fri Nov 1 14:28:23 PST 2002

On Fri, Nov 01, 2002 at 12:32:01PM -0600, 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?
> 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?

Perfectly safe.  The reason to leave the old header files in /usr/include/{linux,asm} is that these are the header files which glibc was compiled against - replacing them with different ones could in theory cause all kinds of nastiness.

> 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.

Once the make modules_install is run at the end of the kernel build, all defined kernel modules are copied to /lib/modules/(kernel-version).  Again, once the kernel and modules are installed and operational, there's usually no need to keep the source around.  I do, however, recommend saving a copy of the .config file to serve as a starting point for future builds of the kernel.

Hope this helps1

Unsubscribe: send email to listar at
and put 'unsubscribe lfs-support' in the subject header of the message

More information about the lfs-support mailing list