Re: [PATCH v3 1/2] cmd: allow bootd without bootm
Tom Rini <[email protected]>
| Newsgroups | gmane.comp.boot-loaders.u-boot.general,gmane.comp.boot-loaders.u-boot |
|---|---|
| Message-ID | <20260822165723.GA4173838@bill-the-cat> |
On Fri, Aug 14, 2026 at 11:30:28PM +0200, Mehmet Fide wrote: > From: Mehmet Fide <[email protected]> > > do_bootd() runs the "bootcmd" environment variable through run_command() > and does nothing else. It uses no bootm functionality, and neither does > the "bootd" recursion guard in cmd_process(). doc/usage/cmd/bootd.rst > documents it that way, with an example that sets bootcmd to > "echo Hello World". > > Commit 1fd04cf46baf ("cmd: Correct dependencies for CMD_BOOTD") made > CMD_BOOTD depend on CMD_BOOTM because the build fails otherwise: > common/command.c is compiled unconditionally and references do_bootd(), > whose definition sits in cmd/bootm.c, which is only compiled when > CMD_BOOTM=y. The dependency therefore describes where the code lives > rather than what it needs, and the boards that disable CMD_BOOTM > (colibri_vf, iot_devkit, mx6memcal and r8a78000_ironhide_cm33) cannot > offer "boot" or "bootd" at all, although the implementation would work > there. > > Move do_bootd() and its two command registrations into cmd/bootd.c, > compiled from CMD_BOOTD, and drop the artificial dependency. To leave > every board in tree unchanged, CMD_BOOTD now defaults to y only when > CMD_BOOTM is enabled, which is precisely the set of boards that have it > today. Boards without bootm can enable it deliberately. > > Tested on sandbox: bootd, the "boot" alias, the return value taken from > a failing bootcmd and the recursion guard all behave as before. Also > tested on a Colibri VF50 (vf610) board built with CMD_BOOTM=n and > CMD_BOOTD=y, a combination that could not be selected before: "boot" and > "bootd" run bootcmd and bring up the OS, and a bootcmd of "false" > returns 1. A colibri_vf_defconfig build with CMD_BOOTD left off is byte > identical to the previous one apart from the version string; enabling > CMD_BOOTD costs 272 bytes. > > Reviewed-by: Tom Rini <[email protected]> > Reviewed-by: Simon Glass <[email protected]> > Signed-off-by: Mehmet Fide <[email protected]> For the series, applied to u-boot/next, thanks! -- Tom
signature.asc
(application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTzzqh0PWDgGS+bTHor4qD1Cr/kCgUCaonU8AAKCRAr4qD1Cr/k CnxGAP9zuwNF1nyVyiV1ODji4ss+4rdYuY+4nqLo8MXAE9V6DQEAjidebg/ZFWMr uwc7GXogxG4ZUUCoCDYnWZH4PkXY/Ac= =iSz2 -----END PGP SIGNATURE-----