Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > Your Distro > Gentoo Linux Help
Reload this Page compiling a new kernel
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Gentoo Linux Help For help and discussion related to Gentoo Linux

Reply
 
Thread Tools Display Modes
Old 03-24-2008   #1 (permalink)
Tralfas
Just Joined!
 
Join Date: Jan 2008
Location: 127.0.0.1
Posts: 29
Send a message via AIM to Tralfas
compiling a new kernel

ok this is my first time compiling the kernel since i installed gentoo. first i downloaded the new kernel source with this command ......

Code:
emerge gentoo-sources
now im having trouble getting to the next step in upgrading
(taken from this page TIP Upgrading your kernel - Gentoo Linux Wiki)
Code:
cp <old-source>/.config linux/.config
my question is how do i find out what the old source was so i can make the old config file part of the new source that way i dont have to go back through and redo the kernel?
Tralfas is offline   Reply With Quote
Old 03-24-2008   #2 (permalink)
i92guboj
Linux Engineer
 
Join Date: Nov 2007
Location: Córdoba (Spain)
Posts: 1,016
Quote:
Originally Posted by Tralfas View Post
ok this is my first time compiling the kernel since i installed gentoo. first i downloaded the new kernel source with this command ......

Code:
emerge gentoo-sources
now im having trouble getting to the next step in upgrading
(taken from this page TIP Upgrading your kernel - Gentoo Linux Wiki)
Code:
cp <old-source>/.config linux/.config
my question is how do i find out what the old source was so i can make the old config file part of the new source that way i dont have to go back through and redo the kernel?
In Gentoo, when you emerge a kernel it sits into /usr/src/, under that directory you will have many subdirectories with the different kernel sources that you installed.

You can cd into that dir, and then use ls to see the installed kernel trees. Then use uname -r to see what version you are currently using. Whith the info from this two commands, you should be able to find which is the right thing to do.

I leave that as an exercise. If you can't find the way yourself, just post the output of these two commands here, and I will try to help:

Quote:
$ ls -l /usr/src/
$ uname -r
i92guboj is offline   Reply With Quote
Old 03-24-2008   #3 (permalink)
andrew.walker
Just Joined!
 
Join Date: Nov 2004
Posts: 2
Not necessarily the correct way to do it but I just copy
/usr/src/linux-{current kernel}/.config to /usr/src/linux-{name of new kernel}/.config
or you can just go into the new kernel and do
make menuconfig
and load the previous .config file that way.

eselect kernel list should highlight the current kernel version unless you have changed it with eselect kernel set and uname -r should tell you what kernel you are currently running.
andrew.walker is offline   Reply With Quote
Old 03-24-2008   #4 (permalink)
dxqcanada
Linux Newbie
 
dxqcanada's Avatar
 
Join Date: Sep 2006
Posts: 132
You can also copy the current running config to .config by:
Code:
# zcat /proc/config.gz > /usr/src/<kernel>/.config
... assuming that a config.gz file was created by the kernel.

Here are a couple of references:

Gentoo Wiki
Gentoo Handbook
__________________

Men occasionally stumble over the truth,
but most of them pick themselves up
and hurry off as if nothing had happened.

Winston Churchill


... then the Unix-Gods created "man" ...
dxqcanada is offline   Reply With Quote
Old 03-24-2008   #5 (permalink)
i92guboj
Linux Engineer
 
Join Date: Nov 2007
Location: Córdoba (Spain)
Posts: 1,016
Having options is always a good thing. But since it seems that right now, the problem is that he can't find the source tree on his filesystems, I think we should keep this simple for now. Having too much info when you can't even do the basic can be a bit overwhelming, in my humble opinion.
i92guboj is offline   Reply With Quote
Old 03-26-2008   #6 (permalink)
Tralfas
Just Joined!
 
Join Date: Jan 2008
Location: 127.0.0.1
Posts: 29
Send a message via AIM to Tralfas
thanks for all the help
i used cp to copy the old config to the new kernel source
then i used make oldconfig and went through all the questions
i compiled the kernel and copied the bzImage to /boot
then i changed grub to include the new kernel name
everything works and loads up except i think i need to use module rebuild so that alsa a nvidia works, because as of now i dont have a desktop just cli.
Tralfas is offline   Reply With Quote
Old 03-26-2008   #7 (permalink)
i92guboj
Linux Engineer
 
Join Date: Nov 2007
Location: Córdoba (Spain)
Posts: 1,016
Quote:
Originally Posted by Tralfas View Post
thanks for all the help
i used cp to copy the old config to the new kernel source
then i used make oldconfig and went through all the questions
i compiled the kernel and copied the bzImage to /boot
then i changed grub to include the new kernel name
everything works and loads up except i think i need to use module rebuild so that alsa a nvidia works, because as of now i dont have a desktop just cli.
The nvidia drivers (and any other drivers that's not part of the kernel itself) need to be re-emerged each time you install a new kernel. Make sure that /usr/src/linux is pointing to the right kernel, because most of these packages use that link to choose the kernel that they will link against.

There are automatic tools for this, such as module-rebuild or whatever it's called. I can't comment on them because I never used them (for no particular reason, just laziness :P ).
i92guboj is offline   Reply With Quote
Old 03-26-2008   #8 (permalink)
Tralfas
Just Joined!
 
Join Date: Jan 2008
Location: 127.0.0.1
Posts: 29
Send a message via AIM to Tralfas
i just used symlink in my make file so that it points to the right kernel instead of updating the symbolic link.
Tralfas is offline   Reply With Quote
Old 03-27-2008   #9 (permalink)
Tralfas
Just Joined!
 
Join Date: Jan 2008
Location: 127.0.0.1
Posts: 29
Send a message via AIM to Tralfas
module-rebuild is pretty nice!

just
Code:
emerge module-rebuild
you just populate the list of modules that you need to reinstall(i only had an nvidia one)
Code:
module-rebuild populate
then rebuild the modules
Code:
module-rebuild rebuild
pretty easy!

thanks for the help once again!
Tralfas is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 08:20 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0