Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/usr/src/linux symlink to kernel directory
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
chatgris
Guru
Guru


Joined: 14 Oct 2002
Posts: 383
Location: Canada

PostPosted: Wed Feb 05, 2003 3:52 pm    Post subject: /usr/src/linux symlink to kernel directory Reply with quote

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 8)
_________________
Open your mind. Open your source.

Due credit for avatar from http://www.aikida.net
Back to top
View user's profile Send private message
rtn
Guru
Guru


Joined: 15 Nov 2002
Posts: 427

PostPosted: Wed Feb 05, 2003 4:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
red_over_blue
Guru
Guru


Joined: 16 Dec 2002
Posts: 310

PostPosted: Wed Feb 05, 2003 4:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Wed Feb 05, 2003 9:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
chatgris
Guru
Guru


Joined: 14 Oct 2002
Posts: 383
Location: Canada

PostPosted: Thu Feb 06, 2003 1:06 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum