LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-25-2006, 10:07 PM   #1
ssenuta
Member
 
Registered: Mar 2006
Location: NYS
Distribution: Mandriva-2006
Posts: 123

Rep: Reputation: 16
Why build a kernel outside the traditional /usr/src area?


The README file of new kernel source pkgs tells us not to use the /usr/src directory when we unpack & compile a kernel. This is a break from tradition & I am trying to understand why this in now necessary.

I think it has something to do with APPLICATION-HEADERS stored in the /usr/include directory getting mixed up with KERNEL-HEADERS in the /usr/src/linux/include. It seems that some linux distributions use symbolic links that point to the /usr/src/linux/include area for their APPLICATION-HEADERS instead of an isolated standalone /usr/include directory.

This is probably valid as long as a user never changes his distribution's stock kernel. But, if a new kernel is introduced into the /usr/src area, there is a possibility that previously valid symbolic links will point to the new kernel headers and not to the stock kernel headers. This would be a mistake because applications should stay associated with the headers used to build them.

Therefore, it is my perception that because linux distributions do not handle their /usr/include APPLICATION-HEADERS uniformly, we users are told not to use the /usr/src area to build kernels. ---Remember, this is only my perception & I could be wrong.

Plesae let me know why you think we are being told to build kernels outside the traditional /usr/src area. Thank you.

Last edited by ssenuta; 08-25-2006 at 10:09 PM.
 
Old 08-26-2006, 02:59 AM   #2
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
you are alluding to this
http://linuxmafia.com/faq/Kernel/usr...x-symlink.html
 
Old 08-26-2006, 03:36 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Who is this Torvalds fellow anyway ... ???

Us Gentoo users have a habit of using /usr/src/linux
Guilty as charged ...
 
Old 08-26-2006, 10:17 AM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Quote:
Originally Posted by syg00
Who is this Torvalds fellow anyway ... ???

Us Gentoo users have a habit of using /usr/src/linux
Guilty as charged ...
Yes, but at least Gentoo doesn't do the symlink nonsense. /usr/include is maintained by glibc, not the kernel.

Though Linus is right, we should be configuring and compiling as a user, not root.
 
Old 08-26-2006, 11:32 AM   #5
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
Originally posted by ssenuta
Quote:
The README file of new kernel source pkgs tells us not to use the /usr/src directory when we unpack & compile a kernel. This is a break from tradition & I am trying to understand why this in now necessary.
First, it's not really that new. My first experience rebuilding
a kernel was in 2003, the README file contained that suggestion,
as I remember discussing it with a veteran *nixer. The earliest
kernel source I have on my server atm is 2.4.0, which was released
on 01/05/2001, and it was in there:
Quote:
mingdao@silas:~/kernel$ less linux/README
INSTALLING the kernel:

- If you install the full sources, put the kernel tarball in a
directory where you have permissions (eg. your home directory) and
unpack it:

gzip -cd linux-2.4.XX.tar.gz | tar xvf -

Replace "XX" with the version number of the latest kernel.

Do NOT use the /usr/src/linux area! This area has a (usually
incomplete) set of kernel headers that are used by the library header
files. They should match the library, and not get messed up by
whatever the kernel-du-jour happens to be.
Look at the date on the thread (Thu Jul 27 2000 - 02:39:51 EST),
and in it Linus said, "And this is actually what has been the
suggested environment for at least the last five years."

Second, whose tradition are we following?

Though it's not absolutely necessary with Slackware, it's still
good practice to leave /usr/src/linux alone and compile in /home.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel includes at /usr/src/linux/include do not match current kernel. blanny Red Hat 1 03-09-2006 07:53 AM
rpmbuild doesn't produce the source code in /usr/src/redhat/BUILD Niceman2005 Linux - Software 2 11-29-2004 05:58 PM
compiling a kernel somewhere other than /usr/src h/w Linux - Newbie 4 09-07-2003 06:34 PM
Creating /usr/src/linux-<xx> from kernel.<xx>.src.rpm jmourik Linux - Newbie 2 02-19-2003 03:24 PM
no kernel in usr/src/Linux elite Linux - General 11 10-28-2002 05:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration