LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Why build a kernel outside the traditional /usr/src area? (https://www.linuxquestions.org/questions/linux-general-1/why-build-a-kernel-outside-the-traditional-usr-src-area-477446/)

ssenuta 08-25-2006 10:07 PM

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.

aus9 08-26-2006 02:59 AM

you are alluding to this
http://linuxmafia.com/faq/Kernel/usr...x-symlink.html

syg00 08-26-2006 03:36 AM

Who is this Torvalds fellow anyway ... ??? :eek: :eek:

Us Gentoo users have a habit of using /usr/src/linux
Guilty as charged ...

Matir 08-26-2006 10:17 AM

Quote:

Originally Posted by syg00
Who is this Torvalds fellow anyway ... ??? :eek: :eek:

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.

Bruce Hill 08-26-2006 11:32 AM

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.


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