LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Gentoo
User Name
Password
Gentoo This forum is for the discussion of Gentoo Linux.

Notices

Reply
 
Search this Thread
Old 05-30-2009, 04:51 AM   #1
PlatinumX
Member
 
Registered: May 2008
Location: France
Distribution: Debian / Fedora / Gentoo
Posts: 178

Rep: Reputation: 15
Question [Gentoo] Kernel update / recompilation


Hey all,

I am running Gentoo with a customized kernel configuration.
I know Gentoo is optimised to recompile newpackage source based on a predefinied profile.

However, concerning the kernel, is there a way to recompile new kernel when they are released based on my actual kernel config ?

Or do I have to manually tune and recompile each new kernel (lot of adminstrative task if many PCs).

Thanks
 
Old 05-30-2009, 05:44 AM   #2
verdeboy2k
Member
 
Registered: Jan 2004
Location: /dev/random
Distribution: Gentoo amd64, CrunchBang amd64
Posts: 350

Rep: Reputation: 32
my recommendation to copy your .config from your previous installation into the new kernel's directory, and just make sure nothing major has changed. It saves a lot of work.
 
Old 05-30-2009, 06:27 AM   #3
PlatinumX
Member
 
Registered: May 2008
Location: France
Distribution: Debian / Fedora / Gentoo
Posts: 178

Original Poster
Rep: Reputation: 15
OK.

There is no special tool to manage this ?
I mean, everytime a new kernel is realeased, you have to manually config each server then ?

(compared to package update, that you can automate)
 
Old 06-02-2009, 06:24 AM   #4
d2_racing
Gentoo support team
 
Registered: May 2009
Location: Ste-Foy,Québec,Canada
Distribution: Gentoo
Posts: 115

Rep: Reputation: 17
Hi, yes there is one.

You need to run this command after copying your new .config inside your new kernel directory :

Code:
# make oldconfig
 
Old 06-02-2009, 08:12 AM   #5
monsm
Member
 
Registered: Feb 2005
Location: London, UK
Distribution: Gentoo
Posts: 568

Rep: Reputation: 37
Heared about Pappy Mcfae on the gentoo forums?
He has made some kernel seeds. This is ready made .configs with optimised settings. He has put them on his website.

Only thing you have to do is to set the options for your hardware (with make menuconfig). Get some quite good kernels this way.

I tend to choose my hardware options each time, but I guess ones you have made one kernel, you can use "make oldconfig" to make the next one. Unless the options have changed for your hardware...

Mons
 
Old 06-02-2009, 06:14 PM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,037

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Most times, copying .config and doing "make oldconfig" is all you need. Then just "make && make install modules_install" as always or do whatever you are used to do.

This will work most of the times. But you should always check your menuconfig and see that the minimum required to boot is still there, things like the support for your chipset and the fs's you require to boot. There's no easy way that this could be automated in an universal way.
 
Old 06-14-2009, 03:11 AM   #7
jimerickso
Member
 
Registered: Mar 2007
Location: ames, iowa
Distribution: gentoo
Posts: 74

Rep: Reputation: 15
Code:
zcat /proc/config.gz > .config
thats really all you need.
 
Old 06-14-2009, 07:48 AM   #8
PlatinumX
Member
 
Registered: May 2008
Location: France
Distribution: Debian / Fedora / Gentoo
Posts: 178

Original Poster
Rep: Reputation: 15
Question

Thanks all.
Seems it is possible to automate it through scripting.

One more question, what's happening with "make oldconfig" when there are new option in the kernel ?
Options for which i never made any choice before ?

Is there a default behaviour ?

Thanks
 
Old 06-14-2009, 08:30 AM   #9
NeddySeagoon
Gentoo support team
 
Registered: May 2009
Location: 56N 3W
Distribution: Gentoo
Posts: 178

Rep: Reputation: 40
PlatinumX,

Code:
make oldconfig
silently drops configuration flags that have been removed and asks you about new ones. That way it produces a legal config file for he new kernel.

Normally its safe to answer N to new options but not always. For example, when the
Code:
[*]   ATA SFF support
option was introduced, saying N, turned off most of the SATA drivers. There were a lot of questions in #gentoo about that.

More subutily, things can change, like the wireless stack. You should be saying N to the old one and Y to the new one.

These sorts of things make it difficult to automate kernel updates.
 
Old 06-15-2009, 02:30 AM   #10
PlatinumX
Member
 
Registered: May 2008
Location: France
Distribution: Debian / Fedora / Gentoo
Posts: 178

Original Poster
Rep: Reputation: 15
OK, I see.

One more question: when I install my gentoo, i choose a profile that configures the kernel without me tuning each option.
For example, when I choose hardened profile, it configures all needed option in the kernel.
I don't, myself, review each option.

So, when new kernels are released, can't I use the same process?
That is to say, don't Gentoo update the profile to fit with new kernels ? So I can, as during an install, use the config file provided by the distro and compile the kernel with ?

Thanks
 
Old 06-15-2009, 02:50 AM   #11
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,684

Rep: Reputation: 54
Quote:
So I can, as during an install, use the config file provided by the distro and compile the kernel with ?
You provided this profile - by configuring the kernel the way you wanted it. You normally have to do that at least once.
Then for every new kernel-version you can use the described procedure:
take the old .config - do "make oldconfig" - and beware of things like the ones NeddySeagoon mentioned.
That way you end up with a valid configuration representing your "profile".

(hope I got the direction of question right...)

ps: reading the next post I also want to make this more clear

I assumed that the word "profile" was used here by the OP to describe the configuration of the kernel - which can be misleading because that term is used for a different concept in Gentoo which has nothing to do with kernel-config.
See the "ps" of the next post.

Last edited by jomen; 06-15-2009 at 03:05 AM.
 
Old 06-15-2009, 02:51 AM   #12
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,037

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Quote:
Originally Posted by PlatinumX View Post
OK, I see.

One more question: when I install my gentoo, i choose a profile that configures the kernel without me tuning each option.
For example, when I choose hardened profile, it configures all needed option in the kernel.
I don't, myself, review each option.

So, when new kernels are released, can't I use the same process?
That is to say, don't Gentoo update the profile to fit with new kernels ? So I can, as during an install, use the config file provided by the distro and compile the kernel with ?

Thanks
The profile doesn't configure your kernel at all. Maybe you used genkernel or something. Genkernel is the way to go if you want to automate the process. It doesn't autodetect anything either, other that the basic stuff that the make scripts themselves autodetect, which has nothing to do with Genkernel. All it does is to build a generic kernel that, -hopefully- will work on 99% of the computers. Just like the kernels that binary distros ship. It will include almost everything so it's generic enough.

Maybe the profile sets hardened-sources as the default, instead of gentoo-sources. I am not sure about this, and I don't think it did in the past. At least I remember having to merge hardened-sources by hand on my server. But that's about it. It won't configure your kernel for you.

PS. Reading what someone just posted... I wanted to clear a thing up: when I speak the profile I am talking about portage profiles (not kernel configs or anything else). Those profiles that you set using "eselect profile set <whatever>", that's it.

Last edited by i92guboj; 06-15-2009 at 02:53 AM.
 
Old 06-15-2009, 06:52 AM   #13
PlatinumX
Member
 
Registered: May 2008
Location: France
Distribution: Debian / Fedora / Gentoo
Posts: 178

Original Poster
Rep: Reputation: 15
Thanks for info.

Right, I used the word "profile" in the bad context.

I remember when i installed Gentoo hardened, that during the kernel configuration, in the ncruse mode, i choosed the "hardened server" level, and it configured the kernel (removal of Linux Kernel Modules....).

However, I am maybe misunderstanding the scope of this kernel tuning.
 
Old 06-15-2009, 08:51 AM   #14
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,037

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Quote:
Originally Posted by PlatinumX View Post
Thanks for info.

Right, I used the word "profile" in the bad context.

I remember when i installed Gentoo hardened, that during the kernel configuration, in the ncruse mode, i choosed the "hardened server" level, and it configured the kernel (removal of Linux Kernel Modules....).

However, I am maybe misunderstanding the scope of this kernel tuning.
I think that you are talking about the grsecurity stuff that you can configure in menuconfig (or xconfig or whatever you choose) before compiling your kernel. This stuff is just like the rest of the kernel configuration options: when you enable some option that can influence in the rest of the config in the sense that disabling a given option will also disable others that depend on this one not being set to be available.

But that doesn't mean that setting that option will autoconfigure your kernel or something like that. You still need to check yourself and make sure that the things you need are there. Either that, or use genkernel and compile everything.
 
Old 06-15-2009, 09:32 AM   #15
Lionhard
LQ Newbie
 
Registered: May 2007
Location: Brasilia, BR
Distribution: Gentoo
Posts: 17

Rep: Reputation: 0
Quote:
Originally Posted by PlatinumX View Post
Thanks all.
Seems it is possible to automate it through scripting.
Thanks
Well... There IS a tool that can ease the kernel compiling work... (And I feel that a lot of people will be angry with me now)... It is called genkernel. I think it can generate new kernels based on old ones.

I prefer doing it manually, though.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Recompilation of the kernel? Nalec Linux - Newbie 1 12-19-2007 07:46 PM
kernel recompilation shrishailnk Linux - Networking 2 04-30-2006 10:05 PM
kernel recompilation shrishailnk Linux - General 4 04-11-2006 11:54 PM
Get agpgart as a loadalbe kernel module, without kernel recompilation? TruongAn Linux - Software 3 03-28-2006 10:44 AM
Kernel Recompilation Thomas_Delrue Linux - General 1 08-30-2001 04:11 PM


All times are GMT -5. The time now is 07:44 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration