Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When building a new kernel based on a previous config, is there a way to automate the 'make oldconfig' process so that it sets new options to their default values?

Edit: What I mean is that when using a .config (from /boot/config-* or /proc/config.gz) on a newer kernel, the 'make oldconfig' process will ask wether or not you want to enable options that were not available in your older kernel. You can answer Y/n/m or press enter to accept default. I would like to accept defaults automatically with no user interaction.

share|improve this question
    
Do you mean something like: echo '\n' | make oldconfig –  jscott Feb 24 '10 at 16:48
    
@jscott This would only "press enter" for the first question, not all of them. You can use the 'yes' command to have a string printed indifinitly. –  Laurent Parenteau Feb 24 '10 at 18:34

4 Answers 4

up vote 10 down vote accepted

Use the command :

yes "" | make oldconfig

The 'yes' command repeatedly output a line with all specified string, or 'y' by default.

So, you can use it to simply "press enter", which will result in using the defaults value for the 'make oldconfig' command.

share|improve this answer
    
Ahh, I didn't know the 'yes' command could output any string. Thank you! –  Jean-Francois Chevrette Feb 24 '10 at 18:35

make olddefconfig

is what you want. From the help (make help in the kernel source dir)

olddefconfig - Same as silentoldconfig but sets new symbols to their default value

share|improve this answer

make silentoldconfig

share|improve this answer
1  
make silentoldconfig is still interactive, it is just less verbose –  Laurent Parenteau Feb 24 '10 at 18:32

Yes. It's stored in ".config" in the top level of the source directory.

Additionally, if using distribution kernel, some distributions such as RedHat store it in /boot/config-$(uname -r). (kernel version) [1]

Finally, if compiled in the kernel you're running, it's available in /proc/config.gz. I forget what version introduced this option.

[1] These options:

CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y 

Edit

Check out /usr/src/linux/kernel/Documentation/kbuild/kconfig.txt (or appropriate path). You can use some of their recommendations to script a solution. I would use a combination of scripting and textutils to accomplish what you describe.

Edit 2

As an additional note, this is a bad idea. What if optional hardware support unique to your environment changes but isn't default? What if a negatively impacting changes occurs? This really is something that should be interactive. You can make the config and automate the rest.

"make silentoldconfig" is a little less verbose, which might be helpful. It is still interactive.

share|improve this answer
    
That's not what I meant. I have added more details to my question to explain what I want to achieve. –  Jean-Francois Chevrette Feb 24 '10 at 16:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.