How to save or export a custom Linux kernel configuration?

Just copy .config file from source directory. This file contains your current configuration.

Also when updating sources you can do make oldconfig to preserve old changes and only decide what to do with new stuff, it will only ask about new configuration options (updates current configuration). You still need to move in your old .config file before you can use this.


One option is:

make savedefconfig

which will create a file named defconfig in your current directory. You can now copy this file to arch/<architecture>/configs/my_defconfig (take care that the file name has to end with _defconfig), e.g.:

cp defconfig arch/x86/configs/my_defconfig

When you've done this you can type the following to generate the .config from your configuration (for the provided architecture):

export ARCH=x86
make my_defconfig

I think this is preferred way to store kernel configurations and once it is set up it is easier to maintain since you can easily switch from one configuration to another.


You can either save the config file to a custom location directly in menuconfig and load a custom one there as well or you can save the .config file from the kernel source location eg /usr/src/linux/.config

To save directly in menuconfig scroll down to the last two options Load / Save an Alternate Configuration File

Tags:

Linux

Kernel