7

When I run make menuconfig inside /usr/src/linux directory, the kernel configuration wizard appears. How can I search through the menu entries inside the make menuconfig wizard? I've tested /, but / it appears that / searches only through the .config file. I.e. when I search for "pci dma", there are no results, however there exists an appropriate kernel menu entry to enable DMA for PCI devices.

I was able to find the text of the menu entries inside Kconfig files. The Kconfig files are located in many subdirectories of /usr/src/linux directory. Still, searching through Kconfig files doesn't give me the actual "tree" view of the option I want to find. The command I used to find that one out:

grep -i --directories=recurse 'kprobes' /usr/src/linux --color=always | less

How can I search through the menu entries inside the make menuconfig wizard?

enter image description here

//edit: A working solution:

find /usr/src/linux/ -name 'Kconfig' -exec egrep -i -B 1 '(tristate|bool|menu)' '{}' \; | grep -i -B 1 --color=always 'Device Drivers'

This will show up, what kernel .config name contains the .config label specified. All I have to do now is to look for the config name inside make menuconfig (by using /).

colemik
  • 1,361
  • 2
  • 11
  • 11
  • 1
    For other readers: I just learned that, when you do a `/` search, the number next to each result is meaningful. Type that number on the keyboard to go directly to that result. https://web.archive.org/web/20190802182621/https://www.spinics.net/lists/linux-kbuild/msg07097.html – cxw Aug 02 '19 at 18:28

1 Answers1

11

When you press /, it says

Enter CONFIG_ (sub)string to search for (with or without "CONFIG_") 

which means it's looking for the names of the options, not the labels of the options.

With Linux 3.3, I found your option using grep...

$ find . -name Kconfig -exec grep 'config.*PCI' {} + | grep DMA
./drivers/ide/Kconfig:config BLK_DEV_IDEDMA_PCI

And then opened the file ./drivers/ide/Kconfig to see more information

config BLK_DEV_IDEDMA_PCI
    bool
    select BLK_DEV_IDEPCI
    select BLK_DEV_IDEDMA_SFF

Since it doesn't have a tristate or bool line like the others, that suggests it doesn't appear in the menu.

Searching in the same file for BLK_DEV_IDEDMA_PCI, you can see lots of entries that refer to it, e.g.

config BLK_DEV_AMD74XX
    tristate "AMD and nVidia IDE support"
    depends on !ARM
    select IDE_TIMINGS
    select BLK_DEV_IDEDMA_PCI

So it looks like you're not supposed to enable DMA explicitly: the drivers that need DMA will enable it automatically.

Mikel
  • 56,387
  • 13
  • 130
  • 149
  • Thanks for the response.I've also found out that the information I need is inside Kconfig files. Check this out: find /usr/src/linux/ -iname 'Kconfig' -exec grep --color=always -i -H -A 3 -B 3 'kprobes' '{}' \; -exec echo \; | less . To search through kernel source files for the information is a little cumbersome way though. – colemik May 06 '12 at 16:37