SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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
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.
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.
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.
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.