Merge patch series "env: migrate static flags list to Kconfig"

This series from James Hilliard <james.hilliard1@gmail.com> converts the
static flags list for the environment to be configured via Kconfig and
updates the documentation.

Link: https://lore.kernel.org/r/20260511182036.50453-1-james.hilliard1@gmail.com
This commit is contained in:
Tom Rini
2026-05-25 13:44:45 -06:00
18 changed files with 72 additions and 230 deletions
+40
View File
@@ -49,3 +49,43 @@ The signature of the callback functions is::
include/search.h
The return value is 0 if the variable change is accepted and 1 otherwise.
Flags for environment variables
-------------------------------
Environment flags validate the values given to environment variables and
restrict how environment variables can be changed.
The static list is configured with CONFIG_ENV_FLAGS_LIST_STATIC. The list
must be in the following format::
type_attribute = [s|d|x|b|i|m]
access_attribute = [a|r|o|c|w]
attributes = type_attribute[access_attribute]
entry = variable_name[:attributes]
list = entry[,list]
The type attributes are:
* s - String (default)
* d - Decimal
* x - Hexadecimal
* b - Boolean ([1yYtT|0nNfF])
* i - IP address, if networking is enabled
* m - MAC address, if networking is enabled
The access attributes are:
* a - Any (default)
* r - Read-only
* o - Write-once
* c - Change-default
* w - Writeable, if CONFIG_ENV_WRITEABLE_LIST is enabled
CONFIG_ENV_FLAGS_LIST_DEFAULT defines the ``.flags`` variable in the
default or embedded environment. Any association in ``.flags`` overrides
an association in the static list.
If CONFIG_REGEX is defined, the variable name is evaluated as a regular
expression. This allows multiple variables to define the same flags without
explicitly listing them all.