View previous topic :: View next topic |
Author |
Message |
chatgris Guru


Joined: 14 Oct 2002 Posts: 383 Location: Canada
|
Posted: Wed Feb 05, 2003 3:52 pm Post subject: /usr/src/linux symlink to kernel directory |
|
|
While installing on my laptop I came across a portion of the install doc that said a symlink from /usr/src/linux to the kernel directory is required.
I WAS going to try and use a beta kernel, but it created a directory /usr/src/linux-beta..
Why is the /usr/src/linux symlink required? As far as I can see in grub, you just specify the link to the kernel bzImage..
And if the /usr/src/linux is required, how do you get multiple kernels without having to change the symlink every time?
Basically I'ma kernel newbie trying to figure some stuff out  _________________ Open your mind. Open your source.
Due credit for avatar from http://www.aikida.net |
|
Back to top |
|
 |
rtn Guru

Joined: 15 Nov 2002 Posts: 427
|
Posted: Wed Feb 05, 2003 4:42 pm Post subject: |
|
|
Since the kernel headers are kept in sys-kernel/linux-headers now, I'm not
sure it's really that critical, except that some applications and such expect
that the kernel sources in /usr/src/linux are those that are acutally being run.
I just tend to move the link when I'm playing with a new kernel for any length
of time.
--rtn |
|
Back to top |
|
 |
red_over_blue Guru


Joined: 16 Dec 2002 Posts: 310
|
Posted: Wed Feb 05, 2003 4:57 pm Post subject: |
|
|
The symbolic link /usr/src/linux points to the kernel that you want everything compiled against.
For example, if you want to run kernel 2.4.50 then do a
Code: |
ln -s /usr/src/linux-2.4.50 /usr/src/linux
cd /usr/src/linux
make menuconfig
...you get the idea
|
Then when you emerge modules and such, they are compiled against the 2.4.50 kernel, and will be stored within /usr/src/linux-2.4.50/drivers and those are the modules that are loaded when you boot the 2.4.50 kernel.
Once all this is done, and you move the bzImage to /boot, nothing really cares what /usr/src/linux points to anymore. You don't have to change anything, as your kernel image is in the directory /boot, and the modules.autoload knows where to go when you boot that kernel.
It's actually a real time saver, and you only change the symlink when you want to tinker with recompiling the kernel or playing with modules, otherwise you don't even need the symlink. |
|
Back to top |
|
 |
rac Bodhisattva


Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Wed Feb 05, 2003 9:03 pm Post subject: |
|
|
One important reason is that all kernel module ebuilds (lm-sensors, alsa, nvidia-kernel, etc.) rely on /usr/src/linux. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
 |
chatgris Guru


Joined: 14 Oct 2002 Posts: 383 Location: Canada
|
Posted: Thu Feb 06, 2003 1:06 am Post subject: |
|
|
Thanks that explained a lot to me!
Is there any reason though the beta kernels have a linux-beta symlink? _________________ Open your mind. Open your source.
Due credit for avatar from http://www.aikida.net |
|
Back to top |
|
 |
|