Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Symlink [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2609

PostPosted: Thu Aug 23, 2007 2:47 am    Post subject: Symlink [SOLVED] Reply with quote

Hello all,

I just did an emerge --update --deep world, and it merged the new kernel (2.6.22-gentoo-r5). I don't think that there's anything I would like to change about my kernel, but how do I update everything to make it realize the new kernel. I assume there are new patches, and thus, the update. The idea behind the symlink and the new kernel sources is actually still a little fuzzy to me.

Thanks preemptively,
Zach
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---


Last edited by NathanZachary on Fri Aug 24, 2007 3:01 pm; edited 3 times in total
Back to top
View user's profile Send private message
IQgryn
l33t
l33t


Joined: 05 Sep 2005
Posts: 764
Location: WI, USA

PostPosted: Thu Aug 23, 2007 3:47 am    Post subject: Reply with quote

Code:
cd /usr/src/linux-<oldversion>
cp -a .config ../linux-2.6.22-gentoo-r5


If you do NOT have the symlink USE flag enabled:
Code:
cd /usr/src
rm linux
ln -s linux-2.6.22-gentoo-r5 linux


Either way:
Code:
cd /usr/src/linux
make oldconfig
make && make modules_install && module-rebuild -X rebuild && make install


NOTE: if you normally copy the kernel images manually, you may prefer to do that instead of make install. I personally prefer make install, as it lets me set up my grub.conf to point to vmlinuz and vmlinuz.old, which are automatically symlinked by make install to the latest and second-latest kernel images. If you still want to copy the images manually, you will also need to update your bootloader configuration file.

NOTE #2: To run module-rebuild, you will have to have it installed (emerge module-rebuild). Before the first time you run it as listed above, run it with the populate option (I don't recall the exact argument; run module-rebuild --help to find it).

I'll be happy to explain any and all of that in detail if you'd like (just ask!).
Back to top
View user's profile Send private message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2609

PostPosted: Thu Aug 23, 2007 3:55 am    Post subject: Reply with quote

To me, the first way makes more sense. I would cd to /usr/src/linux-2.6.22-gentoo-r2, and then copy my .config file to a new folder with an absolute path of /usr/src/linux-2.6.22-gentoo-r5. Then I would remove the symlink of linux, and make a new one by using ln -s linux-2.6.22-gentoo-r5 linux. Then I should be good to go, right? If I just copy over the old .config file, I shouldn't have to run the other commands like make oldconfig?

Also, how would I do it I wanted to make changes to the kernel before creating the symlink? Does it always merge into a folder called:

/usr/src/linux-<version>

?
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---
Back to top
View user's profile Send private message
IQgryn
l33t
l33t


Joined: 05 Sep 2005
Posts: 764
Location: WI, USA

PostPosted: Thu Aug 23, 2007 4:02 am    Post subject: Reply with quote

gentoo_zach wrote:
To me, the first way makes more sense. I would cd to /usr/src/linux-2.6.22-gentoo-r2, and then copy my .config file to a new folder with an absolute path of /usr/src/linux-2.6.22-gentoo-r5. Then I would remove the symlink of linux, and make a new one by using ln -s linux-2.6.22-gentoo-r5 linux. Then I should be good to go, right? If I just copy over the old .config file, I shouldn't have to run the other commands like make oldconfig?

I assume by the first way, you mean without the symlink USE flag.
You MUST run make oldconfig if you want to be sure to have a working kernel when you're done. It will configure the new kernel as close to the old kernel as possible, only asking you about new items, but you need to run it. If you don't, you will eventually have a kernel that fails to either compile or boot.

gentoo_zach wrote:
Also, how would I do it I wanted to make changes to the kernel before creating the symlink? Does it always merge into a folder called:

/usr/src/linux-<version>

?

I'm not sure what you mean by making changes to the kernel. The symlink simply indicates which kernel source is considered the "in-use" one. You can change the configuration of the new kernel source before, after, or both before and after you change the symlink without any ill effects. You can even install the new kernel before you change the symlink. You are not even really required to have the symlink, but some ebuilds depend on it being there and correct (generally kernel modules).
Back to top
View user's profile Send private message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2609

PostPosted: Thu Aug 23, 2007 4:18 am    Post subject: Reply with quote

So I could just:

Code:

cd /usr/src/linux-<new version>
make menuconfig


Then make my kernel configurations, build the kernel and copy it:

Code:

make && make modules_install
cp arch/i386/boot/bzImage /boot/kernel-2.6.22-gentoo-r5


Then, update the symlink by doing:

Code:

cd /usr/src
rm linux
ln -s 2.6.22-gentoo-r5 linux


And lastly, update it in my grub.conf file? Sorry to have you actually spell it out to me, but this concept makes very little sense to me, and I'm just trying to understand. I really appreciate you taking the time to help me! :) One last question, is there an easier way to edit the grub.conf file? Right now, I'm using the installation disc and chrooting back into the environment, because I can't seem to get to the file any other way.

Thanks again,
Zach
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---
Back to top
View user's profile Send private message
IQgryn
l33t
l33t


Joined: 05 Sep 2005
Posts: 764
Location: WI, USA

PostPosted: Thu Aug 23, 2007 4:26 am    Post subject: Reply with quote

gentoo_zach wrote:
So I could just:

Code:

cd /usr/src/linux-<new version>
make menuconfig

That way will work, yes. You can also do as I mentioned above, and run make menuconfig after make oldconfig if there are additional changes you wish to make. Do whichever you prefer, just know that if you're mostly happy with your current kernel config, make oldconfig will save you a lot of time.


gentoo_zach wrote:
And lastly, update it in my grub.conf file? Sorry to have you actually spell it out to me, but this concept makes very little sense to me, and I'm just trying to understand. I really appreciate you taking the time to help me! :) One last question, is there an easier way to edit the grub.conf file? Right now, I'm using the installation disc and chrooting back into the environment, because I can't seem to get to the file any other way.

You need to either add an entry or modify an existing entry to point to the new kernel image (kernel-2.6.22-gentoo-r5). If you use grub as your bootloader (it is the preferred bootloader, so you would know if you weren't using it), then you simply need to edit /boot/grub/grub.conf with your favorite text editor. What issues are you having with getting to the file?
Back to top
View user's profile Send private message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2609

PostPosted: Thu Aug 23, 2007 4:30 am    Post subject: Reply with quote

The way I see it, the more times I configure my kernel manually, the better. :) Also, about GRUB, I can't seem to find the grub.conf file. I know that when I chroot, it is located at /boot/grub/grub.conf, but when I do:

Code:

nano /boot/grub/grub.conf


In my normal booted environment, it says the file doesn't exist. :?
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---
Back to top
View user's profile Send private message
IQgryn
l33t
l33t


Joined: 05 Sep 2005
Posts: 764
Location: WI, USA

PostPosted: Thu Aug 23, 2007 4:33 am    Post subject: Reply with quote

Perhaps your /boot partition has the noauto option in /etc/fstab? Try running mount /boot as root before attempting to edit the file. If that doesn't work, post the contents of /etc/fstab and the output of
Code:
ls -l / /boot
and I'll look at it in the morning.
Back to top
View user's profile Send private message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2609

PostPosted: Thu Aug 23, 2007 4:36 am    Post subject: Reply with quote

I will try mounting it manually. I really appreciate all of your help. Thank you so much! :)
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---
Back to top
View user's profile Send private message
Ehnvis
Guru
Guru


Joined: 13 Jun 2006
Posts: 305
Location: /dev/random

PostPosted: Thu Aug 23, 2007 6:42 am    Post subject: Reply with quote

Another way to handle the symlink instead of doing the manual ln -s is to use "eselect kernel list" and "eselect kernel set <number>" which handles the symlink nice.
_________________
HP NC 4010, Pentium-M 725 1.6GHz w/ 1Gb RAM, 60Gb Hitachi Travelstar.
Running Gentoo-2.6.21-r4 (again as 2.6.22 kernels hogs CPU), all but SD reader works fine.
Back to top
View user's profile Send private message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2609

PostPosted: Thu Aug 23, 2007 6:51 pm    Post subject: Reply with quote

I was wondering about using eselect, because I saw it some guide a while ago. I think that should work nicely. I also have one more question though. After I finished this procedure and got the new kernel working, I couldn't start X because it couldn't load the nvidia module. My really asinine way around that problem was to unmerge the nvidia-drivers and emerge them again. Then I followed the rest of the process listed in the nvidia guide. While my method worked, I know that it was terribly inefficient. Is there an easier method that I can use the next time I update my kernel/symlink?

Thanks again,
Zach
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---
Back to top
View user's profile Send private message
Ehnvis
Guru
Guru


Joined: 13 Jun 2006
Posts: 305
Location: /dev/random

PostPosted: Fri Aug 24, 2007 7:43 am    Post subject: Reply with quote

emerge module-rebuild

Next time you update your kernel and have built it run "module-rebuild rebuild" and it will rebuild the modules/drivers like madwifi, nvidia and others for you.
_________________
HP NC 4010, Pentium-M 725 1.6GHz w/ 1Gb RAM, 60Gb Hitachi Travelstar.
Running Gentoo-2.6.21-r4 (again as 2.6.22 kernels hogs CPU), all but SD reader works fine.
Back to top
View user's profile Send private message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2609

PostPosted: Fri Aug 24, 2007 3:01 pm    Post subject: Reply with quote

Thanks for that information; I knew there had to be some easy solution. :)
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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