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

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

A 12-year old console log is not the best look and it also less useful
now as it differs from what one would normally see on modern platforms.

Replace it with the output from barebox v2026.04.0 on a ROCK-3A instead.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 Documentation/user/barebox.rst | 36 ++++++++++++++++++++--------------
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/Documentation/user/barebox.rst b/Documentation/user/barebox.rst
index 67cf93eb71c8..4bb33d7db19a 100644
--- a/Documentation/user/barebox.rst
+++ b/Documentation/user/barebox.rst
@@ -275,27 +275,33 @@ This is a typical barebox startup log:
 
 .. code-block:: console
 
-  barebox 2014.06.0-00232-g689dc27-dirty #406 Wed Jun 18 00:25:17 CEST 2014
+  barebox 2026.04.0 #1 2026-04-01T00:00:00+00:00
+  Buildsystem version: DistroKit-2026.04.0
 
 
-  Board: Genesi Efika MX Smartbook
-  detected i.MX51 revision 3.0
-  mc13xxx-spi mc13892@00: Found MC13892 ID: 0x0045d0 [Rev: 2.0a]
-  m25p80 m25p800: sst25vf032b (4096 Kbytes)
-  ata0: registered /dev/ata0
-  imx-esdhc 70004000.esdhc: registered as 70004000.esdhc
-  imx-esdhc 70008000.esdhc: registered as 70008000.esdhc
-  imx-ipuv3 40000000.ipu: IPUv3EX probed
-  netconsole: registered as cs2
-  malloc space: 0xabe00000 -> 0xafdfffff (size 64 MiB)
+  Board: Radxa ROCK 3A
+  rockchip-dmc memory-controller.of: Detected memory size: 0x80000000
+  netconsole: registered as netconsole-1
+  psci psci.of: detected version 1.1
+  xHCI xHCI0: USB XHCI 1.10
+  ehci fd800000.usb@fd800000.of: USB EHCI 1.00
+  ehci fd880000.usb@fd880000.of: USB EHCI 1.00
+  rk808 rk8090: chip id: 0x8090
+  dw_mmc fe000000.mmc@fe000000.of: registered as mmc2
+  mdio_bus: miibus0: probed
+  dw_mmc fe2b0000.mmc@fe2b0000.of: registered as mmc1
+  rk3568-dwcmshc-sdhci fe310000.mmc@fe310000.of: registered as mmc0
+  rockchip_saradc fe720000.saradc@fe720000.of: registered as aiodev0
   mmc1: detected SD card version 2.0
   mmc1: registered mmc1
-  barebox-environment environment-sd.7: setting default environment path to /dev/mmc1.barebox-environment
-  running /env/bin/init...
+  state: New state registered 'state'
+  state: Using bucket 0@0x00000000
+  malloc space: 0x40300000 -> 0x7fbfffff (size 1017 MiB)
+  found force-builtin environment, using defaultenv
 
-  Hit any key to stop autoboot:  3
+  Hit m for menu or any to stop autoboot:    3
 
-  barebox@Genesi Efika MX Smartbook:/
+  barebox@Radxa ROCK3 Model A:/
 
 Without intervention, barebox will continue booting after 3 seconds. If interrupted
 by pressing a key, you will find yourself at the :ref:`shell <hush>`.
-- 
2.47.3




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

* Re: [PATCH 1/2] startup: point out that /env/bin/init is legacy
  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 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2026-05-18 10:42 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum; +Cc: Mark Diener


On Mon, 18 May 2026 10:51:31 +0200, Ahmad Fatoum wrote:
> 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.
> 
> [...]

Applied, thanks!

[1/2] startup: point out that /env/bin/init is legacy
      https://git.pengutronix.de/cgit/barebox/commit/?id=cf2f67645ad2 (link may not be stable)
[2/2] doc: user: barebox: update typical barebox startup log
      https://git.pengutronix.de/cgit/barebox/commit/?id=f30ef429a8cb (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ 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