]> git.baikalelectronics.ru Git - uboot.git/commit
cmd: env: Add `indirect` to indirectly set values
authorSamuel Dionne-Riel <samuel@dionne-riel.com>
Mon, 20 Dec 2021 23:31:56 +0000 (18:31 -0500)
committerTom Rini <trini@konsulko.com>
Thu, 7 Apr 2022 20:50:42 +0000 (16:50 -0400)
commiteacb7ee9d738fc18bd77118c68b98fbb5e3ae815
treeb8112d9b6b585183d99afcb49b0557f278e3b206
parent50292199aa5c8b1b073c93e4b349f52040d2abdf
cmd: env: Add `indirect` to indirectly set values

This allows an ergonomic-enough approximation of ${!variable} expansion.
This could be used the following way:

```
for target in ${boot_targets}; do
   env indirect target_name target_name_${target}
   # ...
done
```

Assuming `target_name_mmc0` and similar are set appropriately.

A default value can be optionally provided.

Note: this acts on environment variables, not hush variables.

Signed-off-by: Samuel Dionne-Riel <samuel@dionne-riel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: "Marek BehĂșn" <marek.behun@nic.cz>
[trini: Don't enable by default]
cmd/Kconfig
cmd/nvedit.c