Where to put Linux kernel source tree

DJ Lucas dj_me at swbell.net
Sun Feb 23 12:04:40 PST 2003


Ian Molton wrote:
> On Sun, 23 Feb 2003 18:49:59 +0100
> Florian Teply <root at localhost.localdomain> wrote:
>
>>
>> I'm just at the installation of my very first LFS system, and i'm
>> just wondering where the kernel sources should go. The book (4.0)
>> mentions only that it shall not go into /usr/src/linux
>
> It does? why? whats wrong with /usr/src/linux ???

It mentions that this is _old practice_ so to speak.  Quoting from the
book:

#Begin Quote

_Why we copy the kernel headers and don't symlink them_

In the past it was common practice to symlink the
/usr/include/{linux,asm} directories to
/usr/src/linux/include/{linux,asm}. This was a bad practice, as the
following extract from a post by Linus Torvalds to the Linux Kernel
Mailing List points out:

"I would suggest that people who compile new kernels should:

 - not have a single symbolic link in sight (except the one that the
   kernel build itself sets up, namely the "linux/include/asm" symlink
   that is only used for the internal kernel compile itself)

And yes, this is what I do. My /usr/src/linux still has the old 2.2.13
header files, even though I haven't run a 2.2.13 kernel in a _loong_
time. But those headers were what glibc was compiled against, so those
headers are what matches the library object files.

And this is actually what has been the suggested environment for at
least the last five years. I don't know why the symlink business keeps
on living on, like a bad zombie. Pretty much every distribution still
has that broken symlink, and people still remember that the linux
sources should go into "/usr/src/linux" even though that hasn't been
true in a _loong_ time."

#End Quote

The relevant part, for this thread anyways, is where Linus stated:
"and people still remember that the linux sources should go into
"/usr/src/linux" even though that hasn't been true in a _loong_ time."

End result is that it really dosen't matter, save for badly designed
checks in a few packages' configure scripts.  Personally I remove the
kernel sources altogether, and keep the tarball around should I actually
need them after I complete my system's build.

DJ

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



More information about the lfs-chat mailing list