[Ksummit-discuss] [PATCH 2/2] kconfig: new command line kernel configuration tool

Krzysztof Kozlowski krzk at kernel.org
Fri Jul 7 05:55:27 UTC 2017


On Thu, Jul 6, 2017 at 4:42 PM, Dan Carpenter <dan.carpenter at oracle.com> wrote:
> This tool barely works, it's just a rough draft.
>
> Sometimes I want to search for a config so I have to load menuconfig,
> then search for the config entry, then exit.  With this script I
> simply run:
>
>     ./scripts/kconfig/kconfig search COMEDI
>
> Quite often I find myself trying to enable a feature by doing this:
>
>     echo CONFIG_FEATURE=y >> .config
>
> But when I try to boot the new kernel, I find that the feature isn't
> there because the kernel runs `make oldconfig` and I didn't have all
> the depends selected so it silently removed it.  With this feature
> what you can do is:
>
>     ./scripts/kconfig/kconfig set FEATURE=y

Sounds useful. I need to enable few options from scripts and if
dependencies change they could be silently skipped.

Probably it would be nice to print what was effectively enabled to get
your feature in. However why not extending existing scripts/config? It
already has the feature for setting kconfig options (without looking
at dependencies - so like >> of yours).

Best regards,
Krzysztof

>
> It helps you enable the dependencies or it at least prints an error
> if it can't enable the feature.
>
> But this code isn't all implemented.  1) It doesn't calculate the
> dependencies well.  See expr_parse() for more details.  2)  It
> doesn't work well for things like:
>
>         ./scripts/kconfig/kconfig set BT_INTEL=m
>
> because those aren't visible, they can only be using depend
> statements.  Or say you try to set FEATURE=m when something else
> depends on it be set =y then the error message is wrong.  The
> other problem is that I don't know how to print the help text.
> Again, this is just a rough draft.
>
> Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>
> ---
>  scripts/kconfig/Makefile |   6 +-
>  scripts/kconfig/kconfig  |  33 +++++
>  scripts/kconfig/lconf.c  | 332 +++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 370 insertions(+), 1 deletion(-)
>  create mode 100755 scripts/kconfig/kconfig
>  create mode 100644 scripts/kconfig/lconf.c
>


More information about the Ksummit-discuss mailing list