
On Mon, Oct 16, 2023 at 04:28:03PM -0600, Simon Glass wrote:
It is not possible to set environment variables without having CONFIG_CMD_NVEDIT enabled. When CONFIG_CMDLINE is disabled, we need a way to set variables.
Split the setting code out into its own file, so that env_set() is available even when CONFIG_CMDLINE is not. If it is never called, the code will be dropped at link time.
Update the Makefile rule to only include the env commands when CONFIG_CMD_NVEDIT is enabled.
Signed-off-by: Simon Glass sjg@chromium.org
(no changes since v1)
cmd/Makefile | 2 +- cmd/nvedit.c | 122 ++----------------------------------- env/Makefile | 1 + env/env_set.c | 132 +++++++++++++++++++++++++++++++++++++++++ include/env_internal.h | 23 +++++++ 5 files changed, 161 insertions(+), 119 deletions(-) create mode 100644 env/env_set.c
This feels like it's partly but not entirely correct. We need to split cmd/nvedit.c in to cmd/env.c and env/nvedit.c instead I think. And keep in mind that SPL + ENV (and so - CMDLINE I believe) does work today.