Re: [PATCH v1 03/10] kconfig-checker: Add the configuration checker code
From: Ahmed S. Darwish
Date: Mon Nov 16 2026 - 05:52:47 EST
Hi Julian,
On Thu, 12 Nov 2026, Julian Braha wrote:
> On 11/9/26 13:00, Ahmed S. Darwish wrote:
> >
> > In v2 of this series, I'll make the schema explicitly versioned. This
> > way, new features like the above can be cleanly added.
> >
>
> Adding schema versioning would be great.
Yup.
> > 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.
>
> I suppose it's not necessary to support these option types at the start,
> as there are few of them, relatively speaking. But it would be good to
> add some input validation in case a user attempts this.
>
> So I've finally had some time to sit down and test this:
>
> I created my own policy with these other types, and sure enough, if I
> specify them as 'disabled' in the policy like this:
>
> rules:
> - name: CONFIG_LOG_BUF_SHIFT
> expected: n
> severity: high
>
> - name: CONFIG_PHYSICAL_START
> expected: n
> severity: high
>
> - name: CONFIG_DEFAULT_HOSTNAME
> expected: n
> severity: high
>
> and my .config has these values:
> CONFIG_LOG_BUF_SHIFT=17
> CONFIG_PHYSICAL_START=0x1000000
> CONFIG_DEFAULT_HOSTNAME="example"
>
> then the config passes the check -- but it would probably be better to
> provide a warning or something about these options.
>
> Also, if I modify my policy to set 'expected' to 'y' for these, it
> reports "not in .config" (which would likely be confusing to the user).
>
> This regex stmt should match all int, hex, and string options for you:
> unsupported = re.compile(r'^(CONFIG_[A-Za-z0-9_]+)=[0-9a-fA-F"-]')
> by checking the first character of its value.
>
You're definitely correct here, thanks.
If a symbol is expected as enabled or disabled in the policy, but the
.config has it as an int, hex, or a string, then the report must include
that as a policy mismatch.
So for the above case, the tool should report something like:
* Below option is set as an integer:
CONFIG_LOG_BUF_SHIFT
But it's expected to be disabled instead.
And similarly for the other symbols.
I'll fix that in v2.
> The included preempt_rt policy worked as expected (nice).
Glad to hear!
All the best,
--
Ahmed S. Darwish
Linutronix GmbH