mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] startup: point out that /env/bin/init is legacy
@ 2026-05-18  8:51 Ahmad Fatoum
  2026-05-18  8:51 ` [PATCH 2/2] doc: user: barebox: update typical barebox startup log Ahmad Fatoum
  2026-05-18 10:42 ` [PATCH 1/2] startup: point out that /env/bin/init is legacy Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2026-05-18  8:51 UTC (permalink / raw)
  To: barebox; +Cc: Mark Diener, Ahmad Fatoum

It's 7 years ago that commit 90df2a955e3c ("defaultenv: Convert init script
to C") changed the default to having the init in C instead of
/env/bin/init.

The latter is still supported, but not a good idea for new platforms, so
make it clearer by calling it "legacy" in barebox console output and in
the docs.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 Documentation/user/defaultenv-2.rst | 13 +++++++++++--
 common/startup.c                    |  2 +-
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/Documentation/user/defaultenv-2.rst b/Documentation/user/defaultenv-2.rst
index 2564eb959fcc..2b903afc14db 100644
--- a/Documentation/user/defaultenv-2.rst
+++ b/Documentation/user/defaultenv-2.rst
@@ -51,8 +51,8 @@ and their respective included directories in ``defaultenv/Makefile``:
 -------------
 
 The default init script is now written in C. However, you can still define
-your own ``/env/bin/init`` script and it will take precedence over the
-built-in C implementation.
+a legacy ``/env/bin/init`` script yourself and it will take precedence over
+the built-in C implementation.
 Example for simple init script:
 
 .. code-block:: sh
@@ -66,6 +66,15 @@ This script is also responsible for defining the boot timeout value
 Be careful making changes to this script: since it is executed before any user
 intervention, it might lock the system.
 
+.. note::
+
+   The built-in init does not only source init scripts, but also does
+   extra work like sourcing the relevant scripts under ``/env/bmode/``
+   according to the active reboot mode or creating ``/cmdline`` and
+   ``/external-devicetree`` files as appropriate.
+   If you define your own legacy init, these features and more will
+   not be available, unless explicitly provided by the custom init.
+
 /env/init/
 ----------
 
diff --git a/common/startup.c b/common/startup.c
index e630033e3505..98da24873e07 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -350,7 +350,7 @@ static int run_init(void)
 	/* Run legacy /env/bin/init if it exists */
 	env_bin_init_exists = stat(INITFILE, &s) == 0;
 	if (env_bin_init_exists) {
-		pr_info("running %s...\n", INITFILE);
+		pr_info("running legacy %s...\n", INITFILE);
 		run_command("source " INITFILE);
 		return 0;
 	}
-- 
2.47.3




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-18 10:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-18  8:51 [PATCH 1/2] startup: point out that /env/bin/init is legacy Ahmad Fatoum
2026-05-18  8:51 ` [PATCH 2/2] doc: user: barebox: update typical barebox startup log Ahmad Fatoum
2026-05-18 10:42 ` [PATCH 1/2] startup: point out that /env/bin/init is legacy Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox