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.

  • @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

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.

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

  • I've been looking for something like this for a while... thanks alot! – Jafar Kofahi Dec 11 '14 at 18:28
  • Which version of Linux did this arrive? Just curious. I'm currently handling an old version (3.0) and it doesn't have it yet. – clacke Dec 21 '16 at 17:43
  • 1
    This should be the correct answer. – suprjami Apr 17 '17 at 23:48

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:



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.

  • 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

make silentoldconfig

  • 2
    make silentoldconfig is still interactive, it is just less verbose – Laurent Parenteau Feb 24 '10 at 18:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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