[PATCH 0/2] cmd: allow bootd without bootm

Mehmet Fide <[email protected]>
Newsgroups gmane.comp.boot-loaders.u-boot
Message-ID <[email protected]>
From: Mehmet Fide <[email protected]>

The bootd command is a two line wrapper around run_command(env_get("bootcmd")),
but its code lives in cmd/bootm.c, so it only links when CMD_BOOTM is enabled.
Commit 1fd04cf46baf ("cmd: Correct dependencies for CMD_BOOTD") expressed that
in Kconfig as "depends on CMD_BOOTM". The build reason is real, but the
dependency reads as a functional one, and it leaves the boards that disable
CMD_BOOTM without "boot" or "bootd" even though the implementation works there.

Patch 1 moves the command into cmd/bootd.c and drops the dependency, keeping
the current default so that no board in tree changes. Patch 2 adds the test
that bootd never had.

While testing I noticed something unrelated that this series does not touch:
on sandbox the "avoid bootd recursion" guard in cmd_process() never fires, so
a bootcmd of "bootd" recurses until the stack is exhausted. That behaves
identically before and after this series.

Mehmet Fide (2):
  cmd: allow bootd without bootm
  test: cmd: add a test for bootd

 cmd/Kconfig       |  3 +--
 cmd/Makefile      |  1 +
 cmd/bootd.c       | 30 ++++++++++++++++++++++++++++++
 cmd/bootm.c       | 24 ------------------------
 test/cmd/Makefile |  3 +++
 test/cmd/bootd.c  | 35 +++++++++++++++++++++++++++++++++++
 6 files changed, 70 insertions(+), 26 deletions(-)
 create mode 100644 cmd/bootd.c
 create mode 100644 test/cmd/bootd.c


base-commit: 94b349bd902d9e38e1846c157fadd9054c34680a
-- 
2.54.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.