- Searching with “/” in menuconfig reveals paths, dependencies, and the state of each symbol.
- Start with a working .config file and update it using oldconfig/olddefconfig or localmodconfig.
- Safely compile and install: modules_install, initramfs, and GRUB update.
- Avoid typical errors (outside the kernel tree, mixed toolchains, hidden dependencies).

If you are trying to find out How to search for configurations in `make menuconfig` And while you're at it, get your kernel ready for your machine. Here's a comprehensive and practical guide. We start with the basics so you don't get lost with menus, symbols, and dependencies, and finish with compilation and installation, including Tricks in Gentoo, Debian and derivatives.
The goal is for you to be able to navigate the kernel configurator with ease, locate any option using the search function, and understand the symbol formats and their dependenciesand avoid common errors during compilation and installation. All of this is illustrated with real-world examples. drivers (network, wifi, sound, video, cameras, touch screens), recommendations for containers like Docker and important notices about Kbuild and toolchains.
What is `make menuconfig` and what is it used for?
The kernel toolset includes several configurable frontends, being make menuconfig One of the most popular due to its ncurses-based text interface. It allows you to activate features such as those integrated into the kernel (Y), as a module (M), or disabled (N), as well as navigate through categories and submenus using the keyboard.
Before we begin, it's helpful to know your hardware so as not to disable anything essential. Commandos , the lspci, lspci -k, dmesg A simple `lsmod` command to view loaded modules can help you identify which drivers you need. It's good practice to copy the current configuration to the sources folder and use it as a base.
A typical preparation involves going to your source tree (for example, in /usr/src/linux or the specific version you are using), and copy the running kernel file: cp -v /boot/config-$(uname -r) .configWith that foundation, you can launch make menuconfig and start adjusting options without starting from scratch.
In the interface you will see categories such as Device Drivers, File systems, Networking support or CPU/virtualization. Move the cursor with the arrow keys, switch between buttons with Tab, and toggle the state of an option with the spacebar or the Y, M, and N keys. Each item usually includes context-sensitive help accessible with H or the Help button.
Search for options within menuconfig (symbols, paths, and dependencies)
The built-in search function is key to avoiding confusion. Press / (forward slash) within menuconfig and enter the symbol name (for example, BT_HCIBTUSB o IPVLANor a keyword from the prompt text. The result shows the symbol (CONFIG_…), its description, its location in the menu, its dependencies and where it is defined.
Interpret the results carefully: you'll see sections like "Location" (menu path), "Depends on" (conditions that must be met), and "Selects" (items that this option activates). If an option is hidden, it's likely that a dependency is missing; enable it first by following the search engine's clues.
Once you've located the option, navigate to the path indicated in "Location" to reach it. If it's offered as integrated () or module (<M>Choose what suits you best. Modules are more flexible, but certain critical functionalities (for example, root disk controllers or file systems for the BootIt is advisable to have them integrated.
The help (H or Help) is worthwhile: it explains the driver's purpose, its stability, and often suggests whether it's better to activate it as a module or an integrated driver. Tags like (NEW), (EXPERIMENTAL), (DEPRECATED) or (OBSOLETE) They guide you on the status of each option.
Navigation and symbols: what Y/M/N mean and menu notation
The configurator entries use visual notations to indicate their status. You'll see y when the element can be deactivated or activated monolithically; and < >, , <*> when it also allows compilation as a module. Each spacebar (or Y/M/N) keystroke rotates the state as permitted.
It is also common to see {M} or {*} when it is not possible to completely disable an option (there are upstream dependencies), and formats such as -M- or -*- These indicate that the state requires a different option. If you detect this, use the search function and help to determine which dependency you need to enable or disable.
To move quickly, the A through Z keys jump to the next line containing that letter in bold. The spacebar toggles the state, Tab cycles through the buttons (Select, Exit, Help, Save), and Enter enters submenus. This set of keyboard shortcuts It speeds up the work a lot.
When you're finished, save with Save. The .config file will be placed in the sources directory; if it already exists, the previous version will be renamed. .config.oldwhich is very practical for comparing changes or quickly going back.
Prepare the source tree: reuse and update your .config
The most efficient approach is to start from a known configuration that already worksCopy the current .config file from /boot as mentioned and update it to the new version with make oldconfig (it will ask you for updates), or more quickly with make olddefconfig (It accepts default values for the new version without asking you.) Both approaches save time when migrating between versions.
Another very practical option is make localmodconfigThis generates a configuration based on the modules you currently have loaded (what lsmod sees). It's ideal for fine-tuning for your current hardware, although if you're compiling for a different machine, you'll need to manually check additional options.
If you need to return to the starting point, make defconfig It generates the default configuration for your architecture. And if you want to see the frontend alternatives, besides menuconfig there are make nconfig (modern incurses), make xconfig (Qt) or make gconfig (GTK), useful if you prefer a graphical interface.
In Gentoo, it's important to make sure the link /usr/src/linux point to the correct sources with eselect kernel list y eselect kernel setIf you use distribution kernels, you will get secure default configurations, reducing risks on critical systems.
Compilation and installation: safe commands and best practices
After saving your .config file, launch the compilation with make -j$(nproc) to use all CPU coresDepending on your hardware and the number of options selected, the process can take anywhere from tens of minutes to more than an hour.
If you enabled features such as modules, install afterwards with make modules_installThis will copy the modules to /lib/modules/$(version). Then, make install It will place the kernel and associated files in /boot and, in many distros, will automatically update the boot manager entry.
To generate the initramfs (necessary when using certain modules, for example, controllers of storage or ZFS/NVIDIA), in Gentoo you can use genkernel –install initramfsand in other environments tools such as dracut o update-initramfs. Do not forget update GRUB if your distribution system doesn't do it automatically.
In Debian and derivatives it is common to run update-initramfs -u y update GRUB (for example, with update-grub) or grub-mkconfig -o /boot/grub/grub.cfgIn systems with multiple kernels, maintaining distinct names (for example, by adding a label to EXTRAVERSION) helps to do not overwrite stable versions that you still need.
In Debian and derivatives it is common to run update-initramfs -u y update-grub o grub-mkconfig -o /boot/grub/grub.cfgIn systems with multiple kernels, maintaining distinct names (for example, by adding a label to EXTRAVERSION) helps to do not overwrite stable versions that you still need.
Activate common drivers: where to find them in the menu
- For Ethernet network cards: go to Device Drivers > Network device support > Ethernet driver support and choose the corresponding chipset driver. You can integrate it or leave it as a separate module if it's not essential for booting.
- For Wi-Fi: check Device Drivers > Network device support > Wireless LAN and marks the specific driver (Atheros, Intel(Broadcom, etc.). It is often practical to compile it as module to facilitate updates or testing.
- Graphics: enter Device Drivers > Graphics support. For NVIDIA With Nouveau or AMD GPUs with amdgpu, check the corresponding support; on hybrid systems, check the switching options. It's a good idea to read the help documentation for each driver to decide between a module or integrated graphics.
- Sound: goes through Device Drivers > Sound card support > Advanced Linux Sound Architecture (ALSA)Choose the specific driver for your card and enable general ALSA support. If you're unsure, leaving it as modules offers more flexibility.
- Webcams: access Device Drivers > Multimedia support, enable “Cameras/video grabbers” and within “Media USB "Adapters" active USB Video Class (UVC) if your webcam is UVC standard.
- Touchscreens: Enter Device Drivers > HID support > Special HID drivers and enables HID Multitouch for common multi-touch panels.
Filesystems, security and virtualization: key choices
En File systems You will be able to enable EXT4 (with encryption if needed), XFS, Btrfs, NTFSVFAT/EXFAT, ISO/UDF, and network systems like NFS or CIFS. For your boot root filesystem, it's common to integrate it into the kernel to avoid relying on modules in the initramfs.
In terms of security, consider options such as SELinuxkernel keys (KEYS), or integrity technologies such as EVM. Some features may impact performance, but they offer additional layers of protection in sensitive environments.
The section Virtualization It includes KVM and other elements necessary for hypervisors. On modern CPUs, enabling KVM and the specific Intel/AMD flags is usually trivial and very beneficial for Virtual machines.
In cryptography (Cryptographic APIYou can enable CPU-accelerated algorithms (SSE2/SSSE3/AVX/AVX2) if your hardware supports them. This speeds up encryption, compression, and various protocol operations.
Kernel for Docker and orchestrators: essential options
If you plan to run containers (Docker, Docker Swarm, etc.), make sure to enable namespaces and cgroups. Among the usual options: CONFIG_NAMESPACES, CONFIG_NET_NS, CONFIG_PID_NS, CONFIG_IPC_NS, CONFIG_UTS_NS and CONFIG_CGROUPS with its subcomponents (CPUACCT, DEVICE, FREEZER, SCHED, CPUSETS, MEMCG).
For container networks, they are key CONFIG_VETH (virtual ethernet), bridge and netfilter. For example: CONFIG_BRIDGE, CONFIG_BRIDGE_NETFILTER, CONFIG_NETFILTER_XT_MATCH_CONNTRACK, CONFIG_NETFILTER_XT_MATCH_ADDRTYPE, CONFIG_NETFILTER_XT_MATCH_IPVS, CONFIG_NF_NAT and targets like CONFIG_IP_NF_TARGET_MASQUERADEMany of these options can be compiled as modules.
The driver CONFIG_IPVLAN This is common in advanced container networking scenarios. If in doubt, use the search function with "/" and validate dependencies. Compiling as a module allows you to load it only when needed.
There is a script A popular way to check the compatibility of your .config file with Docker is to use `check-config.sh`. After granting permissions and pointing it to your... .configIt will tell you what's missing for a complete container experience.
Kbuild and toolchains: important notices
The kernel build system (Kbuild) allows you to parameterize the build with environment variables. For example, LLVM=1 Compile with Clang/LLVM. But be careful: don't cross-mix GNU tools with LLVM (for example, CC=gcc LD=ld.lld), why You will break the build in ways that are not at all obvious.
If you want to compile entirely with LLVM, define LLVM=1 or use CC=clang and the rest of the consistent binutils (ar, nm, ld, etc.). Always check the documentation for the kernel you are using, because certain flags or aggressive optimizations may not be recommended in production.
In very old branches (like 2.4) steps such as make dep o make clean before building; nowadays it's not usually necessary, but if you're coming from problematic previous setups, make mrproper This returns the tree to a clean state. Make a backup of your .config file before cleaning.
To distinguish custom kernels, many administrators add a tag to EXTRAVERSION (Makefile) or use unique image names. This prevents accidentally overwriting the stable kernel you boot with every day.
“make: *** No rule to make target 'menuconfig'. Stop.” Why does this happen?
That error appears when you run make menuconfig outside of the sources tree of the kernel or in a project that does not include the Kconfig/mconf infrastructure. The “menuconfig” target is provided by the kernel Makefile along with the corresponding scripts; if you are not in that tree, no such rule exists.
Typical solutions: make sure you're in /usr/src/linux (or in the folder of the uncompressed version) and that there is a kernel Makefile with the target “menuconfig”. If you want to use Kconfig in a small project of your own (for example, a “hello-world” with Kconfig), you need to incorporate the tools of scripts/kconfig (or use packages like kconfig-frontends) and a Makefile that correctly invokes mconf/nconf. Without that infrastructure, the command won't know what to do.
Practical conclusion: menuconfig is part of the kernelDon't confuse it with a generic Makefile. To "play" with Kconfig in a minimal project, include the appropriate dependencies or develop your own workflow using separately compiled Kconfig utilities.
Download sources: mainline, stable, longterm and linux-next
You can get the kernel from your distribution's package manager or from the official website. At kernel.org you'll see branches Mainline (latest updates and recent patches), Stable (tested for daily use) and Long-term (LTS, ideal for businesses or those who prioritize stability), in addition to linux-next to follow what's coming.
Si downloads Extract a tar.xz file and navigate to the folder to work there. Compiling to /usr/src is not mandatory; the build It works on any route provided you have the dependencies installed (compilers, headers, binutils, etc.). On Debian/Ubuntu, a metapackage like build-essential and related utilities are usually required.
In Gentoo, “emerge -s sources” lists source packages (for example, gentoo-sources). When installing with emerge -a gentoo-sourcesThe tree is created in /usr/src and you can select the active version with eselect kernelChange the symbolic link /usr/src/linux to the desired version before configuring and compiling.
Remember that if you use tools like genkernel for initramfs, the /usr/src/linux link must point to the correct sources. Otherwise, you could generate an initramfs incompatible with the kernel you just compiled.
Compare configurations and clean up the environment
When you update to a new version, make oldconfig It guides you through the new; make olddefconfig It accepts the default values of what has been added. To check what has changed compared to the architecture's defconfig, you can generate a defconfig file separately and compare it to your .config file using diff.
If you've tinkered a lot and something still doesn't fit, consider running make mrproper To start clean. Note: This removes compilation artifacts and configuration files, so save your .config file beforehand. If the tree is cluttered with old builds, a timely cleanup will prevent unexpected errors.
A recommended practice is to save versions of .config with names (for example, .config-01, .config-02…) before overwriting the active configuration. This allows you to revert to a stable configuration while testing changes in parallel.
If you use external drivers (such as NVIDIA or ZFS), rebuild external modules and regenerate the initramfs after installing the new kernel. This is the best way to avoid booting with missing functionality or black screens due to an unpaired driver.
By mastering the search with “/”, understanding the meaning of Y/M/N and its notation, and taking advantage of flows like olddefconfig or localmodconfig, configuring and compiling the kernel ceases to be a labyrinth. With a known .config base, sensible tree cleaning, and attention to dependenciesYou'll have a kernel tuned to your hardware, ready for production or for experimenting with the latest features without losing control of the system.
Passionate writer about the world of bytes and technology in general. I love sharing my knowledge through writing, and that's what I'll do on this blog, show you all the most interesting things about gadgets, software, hardware, tech trends, and more. My goal is to help you navigate the digital world in a simple and entertaining way.
