Re: [PATCH] scripts: kconfig: implement a sort method

From: Felipe Balbi
Date: Wed Apr 12 2017 - 03:50:19 EST



Hi,

Randy Dunlap <rdunlap@xxxxxxxxxxxxx> writes:
> On 04/11/17 04:12, Felipe Balbi wrote:
>> With a growing amount of Kernel configuration, it's
>> getting ever more difficult to find anything on
>> menuconfig. Because of that, implement mergesort for
>> kconfig to make it a little easier for anybody
>> building kernels.
>
> Search works for me, but I don't mind Sort either.

yes, it works. It does a different thing, though. Here's what happens
when I want to find DWC3:

/ DWC3 RET

| Symbol: USB_DWC3 [=m] â
â Type : tristate â
â Prompt: DesignWare USB3 DRD Core Support â
â Location: â
â -> Device Drivers â
â (1) -> USB support (USB_SUPPORT [=y]) â
â Defined at drivers/usb/dwc3/Kconfig:1 â
â Depends on: USB_SUPPORT [=y] && (USB [=y] || USB_GADGET [=y]) && HAS_DMA â
â Selects: USB_XHCI_PLATFORM [=m] â
â â
â â
â Symbol: USB_DWC3_DUAL_ROLE [=n] â
â Type : boolean â
â Prompt: Dual Role mode â
â Location: â
â -> Device Drivers â
â -> USB support (USB_SUPPORT [=y]) â
â -> DesignWare USB3 DRD Core Support (USB_DWC3 [=m]) â
â (2) -> DWC3 Mode Selection (<choice> [=y]) â
â Defined at drivers/usb/dwc3/Kconfig:41 â
â Depends on: <choice> && (USB [=y]=y || USB [=y]=USB_DWC3 [=m]) && (USB_G â
â â
â â
â Symbol: USB_DWC3_EXYNOS [=n] â
â Type : tristate â
â Prompt: Samsung Exynos Platform â
â Location: â
â -> Device Drivers â
â -> USB support (USB_SUPPORT [=y]) â
â (3) -> DesignWare USB3 DRD Core Support (USB_DWC3 [=m]) â
â Defined at drivers/usb/dwc3/Kconfig:63 â
â Depends on: USB_SUPPORT [=y] && USB_DWC3 [=m] && (ARCH_EXYNOS || COMPILE â
â â
â â
â Symbol: USB_DWC3_GADGET [=y] â
â Type : boolean â
â Prompt: Gadget only mode â
â Location: â
â -> Device Drivers â
â -> USB support (USB_SUPPORT [=y]) â
â -> DesignWare USB3 DRD Core Support (USB_DWC3 [=m]) â
â (4) -> DWC3 Mode Selection (<choice> [=y]) â
â Defined at drivers/usb/dwc3/Kconfig:34 â
â Depends on: <choice> && (USB_GADGET [=y]=y || USB_GAD

Now I know where DWC3 is defined, so I navigate to Device Driver, USB
Support and search for DesignWare USB3 DRD Core Support:

â â <M> USB Test and Measurement Class support â â
â â *** NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may ***â â
â â *** also be needed; see USB_STORAGE Help for more info *** â â
â â <M> USB Mass Storage support â â
â â [ ] USB Mass Storage verbose debug â â
â â <M> Realtek Card Reader support â â
â â [*] Realtek Card Reader autosuspend support â â
â â <M> Datafab Compact Flash Reader support â â
â â <M> Freecom USB/ATAPI Bridge support â â
â â <M> ISD-200 USB/ATA Bridge support â â
â â <M> USBAT/USBAT02-based storage support â â
â â <M> SanDisk SDDR-09 (and other SmartMedia, including DPCM) supâ â
â â <M> SanDisk SDDR-55 SmartMedia support â â
â â <M> Lexar Jumpshot Compact Flash Reader â â
â â <M> Olympus MAUSB-10/Fuji DPC-R1 support â â
â â <M> Support OneTouch Button on Maxtor Hard Drives â â
â â <M> Support for Rio Karma music player â â
â â <M> SAT emulation on Cypress USB/ATA Bridge with ATACB â â
â â <M> USB ENE card reader support â â
â â <M> USB Attached SCSI â â
â â *** USB Imaging devices *** â â
â â < > USB Mustek MDC800 Digital Camera support â â
â â < > Microtek X6USB scanner support â â
â â < > USB/IP support â â
â â < > Inventra Highspeed Dual Role Controller (TI, ADI, AW, ...) â â
â â < > DesignWare USB3 DRD Core Support â â
â â < > DesignWare USB2 DRD Core Support â â
â â < > ChipIdea Highspeed Dual Role Controller â â
â â < > NXP ISP 1760/1761 support â â
â â *** USB port drivers *** â â
â â <M> USB Serial Converter support ---> â â
â â *** USB Miscellaneous drivers *** â â
â â < > EMI 6|2m USB Audio interface support â â
â â < > EMI 2|6 USB Audio interface support â â
â â < > ADU devices from Ontrak Control Systems â â
â â < > USB 7-Segment LED Display â â
â â < > USB Diamond Rio500 support â â
â â < > USB Lego Infrared Tower support â â
â â < > USB LCD driver support â â

Compare that to the sorted view of this same entry:

â â --- USB support â â
â â < > ADU devices from Ontrak Control Systems â â
â â < > Apple Cinema Display support â â
â â < > ChaosKey random number generator driver support â â
â â < > ChipIdea Highspeed Dual Role Controller â â
â â < > Cypress CY7C63xxx USB driver support â â
â â < > Cypress USB thermometer driver support â â
â â < > DesignWare USB2 DRD Core Support â â
â â < > DesignWare USB3 DRD Core Support â â
â â < > EMI 2|6 USB Audio interface support â â
â â < > EMI 6|2m USB Audio interface support â â
â â < > Elan PCMCIA CardBus Adapter USB Client â â
â â {M} Functions for loading firmware on EZUSB chips â â
â â < > IO Warrior driver support â â
â â < > Inventra Highspeed Dual Role Controller (TI, ADI, AW, ...) â â
â â < > NXP ISP 1760/1761 support â â
â â < > PlayStation 2 Trance Vibrator driver support â â
â â < > Siemens ID USB Mouse Fingerprint sensor support â â
â â <*> Support for Host-side USB â â
â â < > BCMA usb host driver â â
â â < > Cypress C67x00 HCD support â â
â â [*] Dynamic USB minor allocation â â
â â < > EHCI HCD (USB 2.0) support â â
â â [*] Enable USB persist by default â â
â â < > FOTG210 HCD support â â
â â [ ] HCD test mode support â â
â â < > ISP116X HCD support â â
â â < > ISP1362 HCD support â â
â â < > Microtek X6USB scanner support â â
â â *** Miscellaneous USB options *** â â
â â *** NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may ***â â
â â < > OHCI HCD (USB 1.1) support â â
â â [ ] OTG support â â
â â < > OXU210HP HCD support â â
â â < > R8A66597 HCD support â â
â â [ ] Rely on OTG and EH Targeted Peripherals List â â
â â < > SL811HS HCD support â â
â â < > SSB usb host driver â â
â â < > Support WUSB Cable Based Association (CBA) â â

much easier to find, don't you think?

> Why only menuconfig? Is it the one that you use mostly?

shouldn't be difficult to port to nconfig.

> Any Help text for Sort? or is it obvious what it does? (no)

wait, it's not obvious what "Sort" means?

> In an 80x25 terminal (window), the < Sort > option wraps around
> past column 80.

not what I see here [1]

> I haven't looked at the source code (lately), but I think that it
> would OK to not have the (extra) spaces inside the <...> brackets.
> I.e., instead of
> â <Select> < Exit > < Help > < Save > < Load > < Sort
> >
> just have
> â <Select> <Exit> <Help> <Save> <Load> <Sort>
>
> Or the <Select> does not need to be indented as much as it is.

I changed that for this very reason

> And BTW, Yann made kconfig an orphan today. :(

oh well

[1] https://imgur.com/a/qyvG6

--
balbi

Attachment: signature.asc
Description: PGP signature