[PATCH v3 12/32] env: Split out non-command code into a new file

Simon Glass sjg at chromium.org
Wed Oct 18 05:30:51 CEST 2023


Hi Tom,

On Tue, 17 Oct 2023 at 07:40, Tom Rini <trini at konsulko.com> wrote:
>
> 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 at 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.

OK, fine, but can I do it later? That seems like an excellent
follow-on but is it essential for the purpose of this already-large
series?

Regards,
Simon


More information about the U-Boot mailing list