zer0day
zer0day

Reputation: 49

Modify Linux kernel config file

How do I modify .config file in linux kernel?

When I type make device_defconfig a .config file is in created in the kernel directory. But when I type make menuconfig the .config file is modified. I would like to modify the <device>_defconfig in menuconfig.

Upvotes: 2

Views: 10984

Answers (1)

Luca Ceresoli
Luca Ceresoli

Reputation: 1661

The .config file is not generally supposed to be modified manually, event though you can.

The clean and simple way is:

  1. make <device>_defconfig
  2. make menuconfig
    • edit
    • exit saving changes
  3. make savedefconfig
    • creates a file named defconfig
  4. cp defconfig arch/$ARCH/configs/<device>_defconfig
    • where $ARCH is the CPU architecture, e.g. arm

A defconfig is similar to .config, except it contains only values that differ from their default values. As such they are much shorter and readable. The entire .config is very verbose but it's what make menuconfig edits and what the kernel needs to build.

Upvotes: 6

Related Questions