Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recursively disabling CONFIG dependencies on linux kernel builds

When configuring a Linux kernel, I normally start with my distribution's kernel config file. I often want to turn off some entries, but they are sometimes unchangeable because other CONFIG options that depend on it are enabled.

I can look up the dependencies manually, which often have dependencies of their own. It can be pretty time consuming to did through them all, especially if you're trying to turn off something like CONFIG_KALLSYMS.

Question: Is there a way to specify a CONFIG option you want gone, and have all dependencies automatically selected/disselected as nessisary for you? I looked through all the make options and in the scripts directory, and didn't see anything available for this.

UPDATE: Someone answered saying make oldconfig should do the job after removing (deleting) the desired CONFIG options from the .config file, but that didn't work (his answer then disappeared):

$ make oldconfig
scripts/kconfig/conf -o arch/x86/Kconfig
*
* Restart config...
*
*
* Configure standard kernel features (for small systems)
*
Configure standard kernel features (for small systems) (EMBEDDED) [N/y/?] n
  Load all symbols for debugging/ksymoops (KALLSYMS) [Y/?] (NEW) y
    Include all symbols in kallsyms (KALLSYMS_ALL) [Y/?] (NEW) y
    Do an extra kallsyms pass (KALLSYMS_EXTRA_PASS) [N/y/?] (NEW) 

It automatically said "y" two the first two, and I'm trying to find an automated way to remove them and keep them gone.

like image 955
Corey Henderson Avatar asked Jun 26 '11 01:06

Corey Henderson


People also ask

What is KConfig Linux?

What is KConfig? KConfig is a selection-based configuration system originally developed for the Linux kernel. It is commonly used to select build-time options and to enable or disable features, and has now found use in other projects beyond the Linux kernel.

What is kbuild?

kbuild is an assortment of scripts that are built-in inside the kernel's sources, and the kernel build process does not depend on anything named kmk. The kernel build system depends only on the standard GNU make, and it takes care of compiling its own helper programs, most of which are located under scripts/ directory.

How kbuild works?

Kbuild is a good example of recursive make. By dividing source files into different modules/components, each component is managed by its own makefile. When you start building, a top makefile invokes each component's makefile in the proper order, builds the components, and collects them into the final executive.

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.


1 Answers

For anyone that might stumble upon this, Kconfiglib now lives at https://github.com/ulfalizer/Kconfiglib and has been polished and updated for the latest Kconfig version as of writing (Linux 3.7.0-rc8). The installation has also been greatly simplified.

Update:

Kconfiglib has been updated for Linux v4.0-rc3 now, and the test suite passes in obsessive mode. A new option allnoconfig_y option (for leaving certain symbols as y during make allnoconfig) was added that it barfed on.

Sorry for letting Kconfiglib bitrot for a while! :/

Feel free to post any Kconfig-related questions (not necessarily related to Kconfiglib) you might have and link them here by the way (or notify me in some other way). Kconfig has a lot of obscure corners.

like image 57
Ulfalizer Avatar answered Sep 27 '22 21:09

Ulfalizer