LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-18-2009, 06:49 AM   #1
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
/usr/src/linux symlink


Back in the old days, some of the headers under /usr/include would symlink into /usr/src/linux, which would itself be a symlink to the versioned kernel source directory. These days, the headers under /usr/include are kept in sync with those used when the C libraries were built and /usr/include no longer contains symlinks into /usr/src/linux.

My question is; does the /usr/src/linux symlink have a purpose any more? And, if it does, is it more correct to point it at the source for the current running kernel version, or to leave it pointing back at the original kernel in the same way that the headers in /usr/include are frozen in time?

Last edited by GazL; 02-18-2009 at 06:51 AM.
 
Old 02-18-2009, 07:11 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Have a read of this.
It's old, but the fella that posted it seems to know what he was on about.
 
Old 02-18-2009, 07:11 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Damn - duplicate post deleted.

Last edited by syg00; 02-18-2009 at 07:12 AM.
 
Old 02-18-2009, 07:21 AM   #4
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Original Poster
Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Quote:
Originally Posted by syg00 View Post
Have a read of this.
It's old, but the fella that posted it seems to know what he was on about.
Yes, thanks syg00, I'd read that before posting. I think that what Linus describes in that post is from back in the day when the symlinks under /usr/include still existed and pointed into /usr/src/linux, so the only way to keep the includes frozen instep with the libraries would be to keep /usr/src/linux frozen as Linus explained. I'm not sure whether it's the same for all distributions these days, but in Slackware /usr/include is now self contained and doesn't refer back to /usr/src/linux in any way, which is why I asked the question.

Last edited by GazL; 02-18-2009 at 07:23 AM. Reason: edit: typos
 
Old 02-18-2009, 07:27 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
mmmm - I thought this was pretty explicit
Quote:
I would suggest that people who compile new kernels should:
NOT do so in /usr/src. Leave whatever kernel (probably only the header files) that the distribution came with there, but don't touch it.
 
Old 02-18-2009, 07:52 AM   #6
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by syg00 View Post
mmmm - I thought this was pretty explicit
Yes, but in the same post he explains why this was needed:

Quote:
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.
In Slackware, this is not applicable at all. As GazL also pointed out, the /usr/include/linux directory is not a symlink pointing into /usr/src/linux-* kernel source at all. Slackware's /usr/include/linux is always a directory with the set of kernel header files against which glibc was compiled.

So, (1) there is nothing against compiling your own kernel in /usr/src . I build mine there, and all Slackware kernels are built in -usr/src/linux-<version> as well. And (2) the /usr/src/linux symlink is no longer needed, since all modern-day programs check the "/lib/modules/`uname -r`/build" symlink instead of /usr/src/linux to locate the source of from which the running kernel was compiled.

Eric
 
Old 02-18-2009, 08:10 AM   #7
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Original Poster
Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Quote:
Originally Posted by syg00 View Post
mmmm - I thought this was pretty explicit
It is, but that answer is from a time when the headers within /usr/src/linux were actually used to compile stuff other than the kernel (i.e. they were targets of symlinks from within the /usr/include tree) and since the header files in /usr/include are now independent copies, it's not really relevant to my question.


What I'm saying is; the /usr/src/linux symlink appears to be redundant Am I correct in thinking this?

Now, the reason I'm asking is that there may be some program source out there that is coded to reference /usr/src/linux/include/something_or_other.h directly for some strange reason I don't know of (perhaps a kernel module source might do this, I really don't know). This is what my question is getting at, and it's not explicitly answered in that post from Linus.
 
Old 02-18-2009, 08:13 AM   #8
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Original Poster
Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Quote:
Originally Posted by Alien Bob View Post
So, (1) there is nothing against compiling your own kernel in /usr/src . I build mine there, and all Slackware kernels are built in -usr/src/linux-<version> as well. And (2) the /usr/src/linux symlink is no longer needed, since all modern-day programs check the "/lib/modules/`uname -r`/build" symlink instead of /usr/src/linux to locate the source of from which the running kernel was compiled.

Eric
Thankyou Eric, that's exactly what I was trying to understand.
 
Old 02-18-2009, 08:37 AM   #9
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Quote:
Originally Posted by GazL View Post
What I'm saying is; the /usr/src/linux symlink appears to be redundant Am I correct in thinking this?

Now, the reason I'm asking is that there may be some program source out there that is coded to reference /usr/src/linux/include/something_or_other.h directly for some strange reason I don't know of (perhaps a kernel module source might do this, I really don't know). This is what my question is getting at, and it's not explicitly answered in that post from Linus.
It should be redundant for the most part, but just a year or perhaps two ago, iptables would crap out when building if you didn't have a /usr/src/linux.... Wait. I think it crapped out if you had one. Some other source code did the same exact thing so I started removing that symlink.

The only reason I like to still keep it there is it's less typing when I want to cd into my kernel source tree... Any properly coded Makefile will check /lib/modules/$(uname -r)/build instead of looking to /usr/src/linux

Last edited by jong357; 02-18-2009 at 08:38 AM.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FreeBSD 6.2, no /usr/src/tools and /usr/src/usr.bin, failed to build world. Mr_Shameless *BSD 4 05-16-2008 08:43 AM
where is /usr/src/linux matt_w_lambert Mandriva 5 12-26-2003 12:29 AM
/usr/src/linux player_dos Linux - Newbie 2 07-20-2003 10:49 PM
/usr/src/linux ?? Ekpyrotic Linux - Newbie 6 07-16-2003 10:14 AM
Creating /usr/src/linux-<xx> from kernel.<xx>.src.rpm jmourik Linux - Newbie 2 02-19-2003 03:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:08 PM.

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