Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a defconfig file from a .config?

I have done make menuconfig for a board defconfig and modified few configurations. When I select save, a new .config was created in the Kernel top directory.

I want to create new defconfig for this .config file created.

Can I copy the .config as a new defconfig and copy to arch/arm/configs/?

$ cp .config arch/arm/configs/board_new_defconfig
like image 885
user3693586 Avatar asked Jan 12 '15 09:01

user3693586


People also ask

Where is the Defconfig file in Linux?

The platform's defconfig contains all of the Linux kconfig settings required to properly configure the kernel build (features, default system parameters, etc) for that platform. Defconfig files are typically stored in the kernel tree at arch/*/configs/ .

What is Defconfig in Linux?

defconfig. Generates a new kernel configuration with the default answer being used for all options. The default values are taken from a file located in the arch/$ARCH/defconfig file, where $ARCH refers to the specific architecture for which the kernel is being built.

What make Oldconfig does?

make oldconfig takes the current kernel configuration in the . config file, and updates it based on the new kernel release. To do this, it prints out all configuration questions, and provides an answer for them if the option is already handled in the configuration file.

What is the make Menuconfig in Linux?

make menuconfig is one of five similar tools that can configure Linux source, a necessary early step needed to compile the source code. make menuconfig , with a menu-driven user interface, allows the user to choose the features of Linux (and other options) that will be compiled.


2 Answers

I think you have to do just one command and use the created file as you want to.

% make savedefconfig  % cp defconfig arch/arm/configs/my_cool_defconfig 

(Pay attention to the filename template that is used for defconfig)

To get all possible targets just run

% make help 

As noted by Adam Miller followed by Jeremy, users of Buildroot distribution can use wrappers for that purpose, i.e. (per Buildroot manual, section 8.1):

  • linux-savedefconfig for linux
  • barebox-savedefconfig for barebox bootloader
  • uboot-savedefconfig for U-Boot bootloader

make savedefconfig minimizes the generated defconfig skipping redundant configs that are implied by others.

like image 163
0andriy Avatar answered Oct 01 '22 18:10

0andriy


For your platform, in a new defconfig file, yes. In fact this is the safest way to create a new defconfig. If you manually remove config entries from an existing config file to create a new one, you are likely to get dependency issues and during build, it might restart the kernel config and give you prompts for selecting individual config options.

like image 31
subin Avatar answered Oct 01 '22 18:10

subin