From ec57bd745470fc47b278c21d2eebc95c27c442e5 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Mon, 20 Dec 2021 18:31:56 -0500 Subject: cmd: env: Add `indirect` to indirectly set values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Cc: Simon Glass Cc: "Marek BehĂșn" [trini: Don't enable by default] --- cmd/Kconfig | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cmd/Kconfig') diff --git a/cmd/Kconfig b/cmd/Kconfig index 7bd95466131..c5eb71cea6c 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -518,6 +518,9 @@ config CMD_NVEDIT_EFI If enabled, we are allowed to set/print UEFI variables using "env" command with "-e" option without knowing details. +config CMD_NVEDIT_INDIRECT + bool "env indirect - Sets environment value from another" + config CMD_NVEDIT_INFO bool "env info - print or evaluate environment information" help -- cgit v1.2.3