[PATCH] env: add Kconfig option for static flags list
Quentin Schulz
quentin.schulz at cherry.de
Mon May 11 14:33:01 CEST 2026
Hi James,
On 5/10/26 1:01 AM, James Hilliard wrote:
> Environment callbacks can already be configured from Kconfig with
> CONFIG_ENV_CALLBACK_LIST_STATIC, but static environment flags still
> require board headers to define CFG_ENV_FLAGS_LIST_STATIC.
>
> Add CONFIG_ENV_FLAGS_LIST_STATIC and append it to ENV_FLAGS_LIST_STATIC
> after the legacy CFG_ENV_FLAGS_LIST_STATIC value. Normalize existing
> CFG_ENV_FLAGS_LIST_STATIC definitions to end with a comma so the Kconfig
> list can be concatenated directly.
>
> This lets boards configure writeable-list policy and type validation
> from defconfig without adding a config header solely for env flags.
>
> Signed-off-by: James Hilliard <james.hilliard1 at gmail.com>
> ---
> README | 6 ++++++
> env/Kconfig | 13 +++++++++++++
> include/configs/capricorn-common.h | 2 +-
> include/configs/hmibsc.h | 2 +-
> include/configs/imx6q-bosch-acc.h | 2 +-
> include/configs/iot2050.h | 2 +-
> include/configs/socrates.h | 2 +-
> include/env_flags.h | 3 ++-
> 8 files changed, 26 insertions(+), 6 deletions(-)
>
> diff --git a/README b/README
> index 6836a917c79..b963ce23078 100644
> --- a/README
> +++ b/README
> @@ -1107,6 +1107,7 @@ Configuration Settings:
> Use buffered writes to flash.
>
> - CONFIG_ENV_FLAGS_LIST_DEFAULT
> +- CONFIG_ENV_FLAGS_LIST_STATIC
> - CFG_ENV_FLAGS_LIST_STATIC
Do we *really* need both? What about migrating CFG_ENV_FLAGS_LIST_STATIC
into a Kconfig symbol entirely? We've done this to a lot of CFG_
constants in the past so it's like there's no precedent.
> Enable validation of the values given to environment variables when
> calling env set. Variables can be restricted to only decimal,
> @@ -1133,11 +1134,16 @@ Configuration Settings:
> r - Read-only
> o - Write-once
> c - Change-default
> + w - Writeable if CONFIG_ENV_WRITEABLE_LIST is enabled
>
> - CONFIG_ENV_FLAGS_LIST_DEFAULT
> Define this to a list (string) to define the ".flags"
> environment variable in the default or embedded environment.
>
> + - CONFIG_ENV_FLAGS_LIST_STATIC
> + Define this to a list (string) to add to the static flags
> + list.
> +
> - CFG_ENV_FLAGS_LIST_STATIC
> Define this to a list (string) to define validation that
> should be done if an entry is not found in the ".flags"
> diff --git a/env/Kconfig b/env/Kconfig
> index 7abd82ab6f3..ca8f9aff19e 100644
> --- a/env/Kconfig
> +++ b/env/Kconfig
> @@ -34,6 +34,19 @@ config ENV_CALLBACK_LIST_STATIC
> If the callback name is not specified, then the callback is deleted.
> Spaces are also allowed anywhere in the list.
>
> +config ENV_FLAGS_LIST_STATIC
> + string "Static flags list"
> + default ""
> + help
> + The environment flags are associated with variables in a static
> + list. Define this list in the same format as
> + CFG_ENV_FLAGS_LIST_STATIC.
> +
I don't want to be looking for where this is explained, can you at the
very least point at where this information is available or even maybe
integrate it here?
Cheers,
Quentin
More information about the U-Boot
mailing list