Re: [PATCH v1 03/10] kconfig-checker: Add the configuration checker code

From: Ahmed S. Darwish

Date: Mon Nov 09 2026 - 08:04:22 EST


On Sun, 08 Nov 2026, Julian Braha wrote:
>
> On 11/6/26 09:19, Ahmed S. Darwish wrote:
> > +
> > +class KernelConfig:
> > + """.config file parser"""
...
> > +
> > + def _parse_symbols(self) -> dict[str, str]:
> > + """Extract CONFIG_* symbol assignments from .config"""
> > + symbol_set = re.compile(r'^(CONFIG_[A-Za-z0-9_]+)=([ym])$')
> > + symbol_unset = re.compile(r'^# (CONFIG_[A-Za-z0-9_]+) is not set$')
>
> What does this do for Kconfig's int, hex, and string options?
>

So far, the tool only supports stating whether an option is enabled,
disabled, or have a neutral 'allowed' policy.

But there's nothing stopping us from supporting something like:

- name: CONFIG_PANIC_TIMEOUT
expected: int
expected_value: 10

- name: CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE
expected: hex
expected_value: 0x1

- name: CONFIG_NLS_DEFAULT
expected: string
expected_value: "utf-8"

In v2 of this series, I'll make the schema explicitly versioned. This way,
new features like the above can be cleanly added.

P.S., I can definitely implement such support, but I'm a bit hesitant to
adding features that are not yet needed by the existing mainline policies.

Thanks!

--
Ahmed S. Darwish
Linutronix GmbH