Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Kernel recompile: does it save previous changes? [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
Steve S.
Tux's lil' helper
Tux's lil' helper


Joined: 22 Sep 2005
Posts: 131

PostPosted: Wed Mar 10, 2010 12:13 pm    Post subject: Kernel recompile: does it save previous changes? [SOLVED] Reply with quote

Ok, this should be an easy answer for one of you kernel compiling super-stars: if I recompile the kernel, do I have to start from scratch with menuconfig or does it keep the previous settings I've done with menuconfig?

I've got my Gentoo box set up exactly like I want, except I got no sound. Alsaconf says there are no cards and all the set up instructions I see say that I gotta recompile with alsa support (thought I did that, but oh, well). I can recompile, no problem, just don't want to go back through all the settings I did the last time and have to recall what they were and get them set up again. Hoping that I can just go in, change the alsa settings, compile, then get out.

Please advise and, if I don't need to recompile, what do I need to do to get sound working?


Last edited by Steve S. on Thu Mar 11, 2010 1:46 am; edited 1 time in total
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6069
Location: Removed by Neddy

PostPosted: Wed Mar 10, 2010 12:17 pm    Post subject: Reply with quote

recompiling a kernel will use (if present) the .config file in the kernel src directory

kernel upgrading can be pre-seeded with old settings as well
_________________
#define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0;
Back to top
View user's profile Send private message
pdr
l33t
l33t


Joined: 20 Mar 2004
Posts: 618

PostPosted: Wed Mar 10, 2010 12:19 pm    Post subject: Reply with quote

After running "make menuconfig" you have a new file /usr/src/linux/.config - this is all your kernel config settings. So - yes, they are remembered.

And if you upgrade the kernel you can do the usual (remove the current /usr/src/linux symlink and point it to the new kernel's directory) but then copy that old .config file into the new kernel's directory and run "make oldconfig" - it will an settings you had before that still apply, and ask you about any new items in the new kernel.
Back to top
View user's profile Send private message
Steve S.
Tux's lil' helper
Tux's lil' helper


Joined: 22 Sep 2005
Posts: 131

PostPosted: Wed Mar 10, 2010 12:20 pm    Post subject: Reply with quote

Naib wrote:
recompiling a kernel will use (if present) the .config file in the kernel src directory

kernel upgrading can be pre-seeded with old settings as well


Wow; love how quick you guys are with an answer on this forum.

Thanks, Naib, but just for full clarification: if that file is present, I can just sneak in, make sure alsa is set up, recompile and I will still have my previous settings along with the newly configured alsa, right?
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Wed Mar 10, 2010 1:35 pm    Post subject: Reply with quote

You still need to run make oldconfig on the old .config file to be sure to catch other changes in the new kernel version.

See /usr/src/linux/README -> CONFIGURING the kernel:
Back to top
View user's profile Send private message
Steve S.
Tux's lil' helper
Tux's lil' helper


Joined: 22 Sep 2005
Posts: 131

PostPosted: Wed Mar 10, 2010 3:22 pm    Post subject: Reply with quote

Thanks to Naib, Mike and pdr: the quick responses are very appreciated.

Ok, I'll check out the README and go through the steps you have all outlined.

As per correct forum protocol, I'll post back the results and call this thread solved or not, etc.

I plan on recompiling tonight, so hopefully all will be well when I post back later...
Back to top
View user's profile Send private message
Steve S.
Tux's lil' helper
Tux's lil' helper


Joined: 22 Sep 2005
Posts: 131

PostPosted: Wed Mar 10, 2010 3:51 pm    Post subject: Reply with quote

I know it is poor form to reply to myself, but I been doing some further reading.

According to this:

Quote:

A much safer upgrading method is to copy your config as previously shown, and then simply run make menuconfig. This avoids the problems of make oldconfig mentioned previously, as make menuconfig will load up your previous configuration as much as possible into the menu. Now all you have to do is go through each option and look for new sections, removals, and so on. By using menuconfig, you gain context for all the new changes, and can easily view the new choices and review help screens much easier. You can even use this for upgrades such as 2.6.8 to 2.6.9; just make sure you read through the options carefully. Once you've finished, compile and install your kernel as normal.


I know that is referring to upgrading, but I think the concept applies, yes? So I plan on running
Code:

make menuconfig


with the old (only by a couple of days) sources using the old config file and that should keep the changes and allow me to make the alsa mod then run

Code:

make

and I should be good to go, eliminating the need to run oldconfig.

If that is incorrect, please advise, otherwise I will run that tonight and go from there. Any feedback at all is, of course, very greatly appreciated, as this whole compiling thing is something unique to me with this install of Gentoo, even after my first install of Gentoo 5 + years ago and many linux's since.
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Wed Mar 10, 2010 4:05 pm    Post subject: Reply with quote

Yes, make menuconfig is a much more efficient way to do it.
The make oldconfig option is a shortcut that works quite well, but a full make menuconfig is essential from time to time.
Generally the unwritten rule of thumb is to do make oldconfig for minor version updates, i.e. from -r6 to -r7
and run make menuconfig for major version updates.
Back to top
View user's profile Send private message
Steve S.
Tux's lil' helper
Tux's lil' helper


Joined: 22 Sep 2005
Posts: 131

PostPosted: Wed Mar 10, 2010 4:13 pm    Post subject: Reply with quote

Mike Hunt wrote:
Yes, make menuconfig is a much more efficient way to do it.
The make oldconfig option is a shortcut that works quite well, but a full make menuconfig is essential from time to time.
Generally the unwritten rule of thumb is to do make oldconfig for minor version updates, i.e. from -r6 to -r7
and run make menuconfig for major version updates.


But since I am not doing an upgrade but instead just adding one modification, menuconfig should still be good, right? Logically it looks like that will work fine...I'll run make menuconfig after the old config file has been copied over (isn't it already in the correct place?) and just check to see if some of the mod's I did last time are selected or not, then get alsa going then run make and it should be all good, in theory. Again, please correct me if I'm wrong...
Back to top
View user's profile Send private message
Steve S.
Tux's lil' helper
Tux's lil' helper


Joined: 22 Sep 2005
Posts: 131

PostPosted: Wed Mar 10, 2010 4:24 pm    Post subject: Reply with quote

Again, I know it is poor form, but I have a different yet related question: do I need to be using the livecd to run a kernel recompile?

I was assuming up to this point to use the instructions from here and run the livecd then chroot in then run make menuconfig as previously discussed.

But I hate assuming, so I am just going to ask to make certain that is necessary. If it isn't and I can simply log in as root and take care of this, it certainly would make my life easier, but I didn't know if there would be complications in doing it that way rather by using the livecd...


...sorry for all the questions, but this whole recompiling things makes me nervous, especially since I did some work getting this wireless xfce gentoobox all set up thus far...
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Wed Mar 10, 2010 4:25 pm    Post subject: Reply with quote

Well yes, obviously I misunderstood what you wanted to do. I was thinking it was about compiling a new kernel version update from new sources.
Changes to the current version are done via make menuconfig.
Remember to mount your /boot (if applicable) before copying over the new kernel.
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Wed Mar 10, 2010 4:27 pm    Post subject: Reply with quote

Generally not a bad idea, if you like the kernel configuration, to save
the .config file as eg: config.32-r1.ok so that you can copy it back
and re-use it if things go wrong.

Will
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Wed Mar 10, 2010 4:30 pm    Post subject: Reply with quote

You can configure, compile and install a new kernel and it's modules on the currently running system. No need to reboot a CD.
Back to top
View user's profile Send private message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2609

PostPosted: Wed Mar 10, 2010 4:34 pm    Post subject: Reply with quote

Moved from Installing Gentoo to Kernel & Hardware, as kernel recompilations typically happen after the Gentoo base system is installed. :)
_________________
“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
Steve S.
Tux's lil' helper
Tux's lil' helper


Joined: 22 Sep 2005
Posts: 131

PostPosted: Wed Mar 10, 2010 4:38 pm    Post subject: Reply with quote

Thanks to all, especially for you patience.

...and thanks for moving.

I'll post back with results... 8)
Back to top
View user's profile Send private message
Steve S.
Tux's lil' helper
Tux's lil' helper


Joined: 22 Sep 2005
Posts: 131

PostPosted: Thu Mar 11, 2010 1:46 am    Post subject: Reply with quote

Recompiled, nothin' to it, thanks to info from this thread. Very well done, all...I'm listening to stuff right now, so we are wired for sound! Thanks and call this solved... 8)
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