make config vs oldconfig vs defconfig vs menuconfig vs savedefconfig

Building the Linux Kernel is a two-step process:

  1. Configuring the Kernel options
  2. Building the Kernel with those options.
There are many methods available for configuring the kernel.

make config:
  • Text-based Configuration. 
  • Options are prompted one after another.
  • All options need to be answered
  • Access to former options is not possible


make menuconfig:


  • Menu-driven user interface
  • Allows to navigate forwards and backward directly between features
  • Allows to load and save files with filenames different from ".config"
  • Provides search feature
  • It uses ncurses library for GUI. If the ncurses library is not installed, make menuconfig option fails. To install ncurses library on Ubuntu: sudo apt-get install libncurses5-dev

make defconfig:

Creates a ".config" file with default options from the ARCH supplied defconfig

Configurations are generally stored in the directory: arch/$(ARCH)/configs


$ ls arch/x86/configs/
i386_defconfig  tiny.config  x86_64_defconfig  xen.config


When you run "make defconfig" on "x86" machine, it copies the configuration options from "i386_defconfig". On "X86_64" machine, it copies the configuration options from "x86_64_defconfig".


My system was "x86_64", so it copied kernel configuration from 'x86_64_defconfig'

When you are cross compiling, and there will be default configuration for that particular board in arch/(ARCH)/configs folder.



make oldconfig:

  • Reads the existing .config file and prompts the user for options in the current kernel source not found in the .config file.
  • Useful when you are moving the existing kernel configuration to a new kernel version.
  • If you run 'make oldconfig' second time after you have run it once, the second time will not ask you any options

make savedefconfig:

  • Creates a 'defconfig' file for you in the current directory.
  • Used when you do a 'make defconfig' and modified few configuration changes as per your new board


Note: New defconfig file name should end with "_defconfig"




Comments

Popular posts from this blog

bb.utils.contains yocto

Difference between RDEPENDS and DEPENDS in Yocto