[PATCH v2 1/2] env: setenv add resolve value option

Simon Glass sjg at chromium.org
Thu Nov 25 01:13:06 CET 2021


On Thu, 18 Nov 2021 at 21:37, Artem Lapkin <email2tema at gmail.com> wrote:
>
> Add possibility setup env variable with additional resolving vars inside
> value.
>
> Usage examples:
>
> => setenv a hello; setenv b world; setenv c '${a} ${b}'
> => setenv -r d '${c}! ${a}...'
> => printenv d
> d=hello world! hello...
>
> /* internal usage example */
> env_resolve("d", "${c}! ${a}...");
> /* d="hello world! hello..." */
>
> Signed-off-by: Artem Lapkin <art at khadas.com>
> ---
> V2 changes:
> _ fix comments style
> _ add comment include/exports.h
> _ remake strcpy to strdup
> _ env_resolve minimize
> ---
>  cmd/nvedit.c       | 43 ++++++++++++++++++++++++++++++++++++++++++-
>  include/_exports.h |  1 +
>  include/env.h      | 11 +++++++++++
>  include/exports.h  |  2 ++
>  4 files changed, 56 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list