mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Mark Diener <markdiener10@gmail.com>,
	Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 1/2] startup: point out that /env/bin/init is legacy
Date: Mon, 18 May 2026 10:51:31 +0200	[thread overview]
Message-ID: <20260518085134.139464-1-a.fatoum@pengutronix.de> (raw)

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




             reply	other threads:[~2026-05-18  8:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-18  8:51 Ahmad Fatoum [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260518085134.139464-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=markdiener10@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox