diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2020-09-15 14:08:31 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-09-18 11:01:19 +0200 |
commit | 932481a005cc7b2933791a349a312af0149b6c94 (patch) | |
tree | f2ad8701e842a301c97cffcfa0c40539aa42c0d9 /commands/Kconfig | |
parent | fbf145dc86832846465a317619dd4d61af3897b3 (diff) | |
download | barebox-932481a005cc7b2933791a349a312af0149b6c94.tar.gz barebox-932481a005cc7b2933791a349a312af0149b6c94.tar.xz |
commands: setenv: allow use with hush shell
setenv was so far restricted to the simple shell, because with hush,
users could just do dev.var=VAL for setting variables in the
environment. The hush syntax doesn't allow for setting all kinds of
environment variables though, e.g.
5c00a000.tamp@5c00a000:reboot-mode.of.param
can't be set with hush, because of the special characters. It could
still be read by using the ${variable} syntax though.
Allow setting these variables by making the setenv command generally
available. The default is chosen to be 'y', because the command is
deemed small and useful enough to have it there by default.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/Kconfig')
-rw-r--r-- | commands/Kconfig | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/commands/Kconfig b/commands/Kconfig index 3789f33c3b..1399f04d8b 100644 --- a/commands/Kconfig +++ b/commands/Kconfig @@ -718,6 +718,19 @@ config CMD_SAVEENV /dev/env0. Note that envfs can only handle files, directories are being skipped silently. +config CMD_SETENV + tristate + default y + depends on !CONFIG_SHELL_NONE + prompt "setenv" + help + Set environment variable + + Usage: setenv NAME [VALUE] + + Set environment variable NAME to VALUE. + If VALUE is ommitted, then the variable is deleted. + # end Environment commands endmenu |