ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
I got the impression a while back that using "/usr/src/linux" causes problem and you shouldn't use it as a link. I am only seeing everyone using links to "/usr/src/linux". Has someone changed their mind?
There's nothing actually wrong with having /usr/src/linux be a link to the source tree it just isn't the canonical location anymore (that's /lib/modules/`uname -r`/build). I generally build kernels in /usr/src/linux-`uname -r` with /usr/src/linux being a symlink to the current kernel. It's quicker to type and I know what it means however scripts shouldn't use it as there's no guarantee that it exists or is correct (the /lib/modules path is created by kernel makefiles (make modules_install I think) and so is (almost) guaranteed to be correct).
I generally go by what the README in my source files says. Like for making the kernel:
Quote:
When compiling the kernel all output files will per default be
stored together with the kernel source code.
Using the option "make O=output/dir" allow you to specify an alternate
place for the output files (including .config).
Example:
kernel source code: /usr/src/linux-2.6.N
build directory: /home/name/build/kernel
To configure and build the kernel use:
cd /usr/src/linux-2.6.N
make O=/home/name/build/kernel menuconfig
make O=/home/name/build/kernel
sudo make O=/home/name/build/kernel modules_install install
Please note: If the 'O=output/dir' option is used then it must be
used for all invocations of make.
Originally posted by keefaz Why not just extract the kernel sources in /home/name/build/kernel in this case ?
I have done that in the past but prefer the proper place with root ownership. If I want to start again I know I have the untouched kernel source still in /usr/src. It's the german in me!
the prohabition against using /usr/src/linux is something old
once a glibc developer practice of having some of the user space includes as symlinks to i think /usr/src/linux/asm or something got mistakenly bled into some distributions..
this caused the kernel developers to freak out and declare /usr/src/linux as a wrong thing
since /usr/src/linux is something left over from the very begining of building linux systems people sometimes associate these old wrongs with /usr/src/linux itself
there are still to this day especially solaris style builds and third paty junk like nvidia drivers that look for currently running linux kernel headers in /usr/src/linux so it can be a big help to have it there
just make sure if you use it you keep it current with what kernel you are running
on modern systems /usr/src/linux is not a problem
often people say scripts from outside Linux circles shouldn't use it but they do and it causes no harm so i don't see the problem.
a box without /usr/src/linux well just feels like some preconfigured appliance used to deliver adds to it's user ala M$
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.