Kconfig is the Linux kernel’s configuration system. Before you compile the kernel, you use Kconfig to choose which subsystems, drivers, and features to include—either built directly into the kernel image (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DeelerDev/linux/llms.txt
Use this file to discover all available pages before exploring further.
y), compiled as loadable modules (m), or excluded entirely (n). The result is a .config file that controls the entire build.
What Kconfig is and how it works
The kernel source tree contains thousands ofKconfig files, one in almost every subdirectory. Each file describes a set of configuration symbols with their types, default values, dependencies, and help text. Running any make *config target reads all of these files and presents them together as a single configuration database organized in a tree.
Every symbol has a type: bool (y/n), tristate (y/m/n), string, int, or hex. Tristate is unique to the kernel and allows the middle state m, meaning “build as a module.” Dependencies between symbols are declared with depends on and select, so enabling one option may automatically enable or restrict others.
The final configuration is written to .config in the kernel source root. The build system converts this file to include/generated/autoconf.h, which every C source file includes to pick up the #ifdef CONFIG_* guards.
Configuration interfaces
The kernel provides several frontends for generating and editing.config.
menuconfig
Text-based TUI in the terminal. Requires ncurses development headers. The most widely used interactive tool.
xconfig
Qt5-based graphical interface. Requires Qt5 development headers. Useful for browsing the full tree visually.
nconfig
Alternative text interface with function-key navigation. Requires ncurses. Shows function key hints at the bottom.
defconfig
Loads the architecture default configuration. A clean starting point for a given CPU architecture.
menuconfig requires libncurses-dev (Debian/Ubuntu) or ncurses-devel (Fedora/RHEL). xconfig requires qtbase5-dev or equivalent.The .config file format
The.config file is a plain text file. Each line is either a comment or a symbol assignment:
| Value | Meaning |
|---|---|
=y | Built into the kernel image |
=m | Compiled as a loadable module (.ko file) |
# CONFIG_FOO is not set | Disabled — the symbol evaluates to n |
y are compiled unconditionally into vmlinuz. Symbols set to m produce a .ko file in /lib/modules/<version>/ that can be loaded on demand with modprobe.
Searching for symbols in menuconfig
Insidemenuconfig, press / to open the search dialog. You can search by symbol name fragment or use regular expressions. The result list shows each match, its current value, and where it appears in the menu hierarchy. Press the number shown next to a result to jump directly to that entry.
Updating an existing config
When you move to a newer kernel version, new symbols are introduced that your old.config does not know about. Use make oldconfig to step through each new symbol interactively, or make olddefconfig to accept all defaults silently:
Update to the new kernel's symbols
Accept defaults silently:Or review each new symbol interactively:
Building a minimal config with localmodconfig
make localmodconfig reads the list of currently loaded kernel modules (via lsmod) and disables every module that is not in use. This dramatically reduces compile time on distributions that ship universal kernels with hundreds of drivers.
Important configuration categories
CPU and architecture
CPU and architecture
Found under
Processor type and features (x86) or the equivalent for your architecture. Key options include:CONFIG_SMP— symmetric multiprocessing support (required on multi-core systems)CONFIG_X86_64— 64-bit x86 supportCONFIG_NUMA— non-uniform memory access support (servers with multiple CPU sockets)CONFIG_HZ— kernel timer frequency (100, 250, or 1000 Hz)CONFIG_PREEMPT— kernel preemption model (none, voluntary, or full)
File systems
File systems
Found under
File systems. Enable as modules any filesystem you mount occasionally:CONFIG_EXT4_FS— ext4 (common Linux root filesystem)CONFIG_XFS_FS— XFS (common on RHEL/Fedora)CONFIG_BTRFS_FS— Btrfs (snapshots, RAID, checksums)CONFIG_VFAT_FS— FAT32/VFAT (USB drives, EFI partition)CONFIG_NTFS3_FS— NTFS read/write (Windows partitions)CONFIG_NFS_FS— NFS client support
Networking
Networking
Found under
Networking support:CONFIG_NET— core networking (almost always required)CONFIG_IPV6— IPv6 supportCONFIG_NETFILTER— iptables/nftables packet filteringCONFIG_BRIDGE— network bridge support (VMs, containers)CONFIG_TUN— TUN/TAP virtual devices (VPN software)CONFIG_WIRELESS— 802.11 wireless LAN support
Security
Security
Found under
Security options:CONFIG_SECURITY— enables the Linux Security Module (LSM) frameworkCONFIG_SECURITY_SELINUX— SELinux mandatory access controlCONFIG_SECURITY_APPARMOR— AppArmor profile-based MACCONFIG_STACKPROTECTOR_STRONG— stack canary buffer overflow protectionCONFIG_STRICT_KERNEL_RWX— enforce read-only kernel text segmentsCONFIG_MODULE_SIG— require module signature verification
Kernel hacking and debug
Kernel hacking and debug
Found under
Kernel hacking. Useful for development builds, but increase kernel size and reduce performance:CONFIG_DEBUG_INFO— DWARF debug symbols (needed to decode stack traces withgdb)CONFIG_DYNAMIC_DEBUG— runtime-selectablepr_debug()messagesCONFIG_KGDB— kernel debugger over serial or networkCONFIG_LOCKDEP— lock dependency tracking (detects deadlocks)CONFIG_KASAN— kernel address sanitizer (detects memory corruption)
Configuration for common use cases
Server
A minimal server kernel avoids desktop drivers and focuses on throughput and stability:Desktop
Desktop builds benefit from full preemption and audio/video drivers:Embedded / minimal
For embedded targets, start withallnoconfig and enable only what you need:
