mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] defaultenv: boot/bnet: fallback to booting generic 2nd stage FIT image
@ 2025-04-09 13:19 Ahmad Fatoum
  2025-04-10  7:34 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2025-04-09 13:19 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

With CONFIG_BOARD_GENERIC_FIT enabled, barebox generates a FIT image
containing a generic DT-based second-stage barebox images as well as all
enabled DTs.

Add it as fallback if the image with the hostname is missing, example:

  Board-specific image: afa-barebox-lxa-mc1
   Arch-specific image: afa-barebox-arm

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/globalvar.c                     | 3 +++
 defaultenv/defaultenv-2-base/boot/bnet | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/common/globalvar.c b/common/globalvar.c
index 5f5b7d44ae62..26202f2b493d 100644
--- a/common/globalvar.c
+++ b/common/globalvar.c
@@ -680,6 +680,8 @@ static int globalvar_init(void)
 	if (strlen(buildsystem_version_string) > 0)
 		globalvar_add_simple("buildsystem.version", buildsystem_version_string);
 
+	globalvar_add_simple("arch", CONFIG_ARCH_LINUX_NAME);
+
 #ifdef __BIG_ENDIAN
 	endianness = "big";
 #elif defined(__LITTLE_ENDIAN)
@@ -698,6 +700,7 @@ BAREBOX_MAGICVAR(global.version, "The barebox version");
 BAREBOX_MAGICVAR(global.buildsystem.version,
 		 "version of buildsystem barebox was built with");
 BAREBOX_MAGICVAR(global.endianness, "The barebox endianness");
+BAREBOX_MAGICVAR(global.arch, "Name of architecture as used by Linux");
 
 /**
  * nvvar_save - save NV variables to persistent environment
diff --git a/defaultenv/defaultenv-2-base/boot/bnet b/defaultenv/defaultenv-2-base/boot/bnet
index e378acd1e65a..b2eeab93d9b8 100644
--- a/defaultenv/defaultenv-2-base/boot/bnet
+++ b/defaultenv/defaultenv-2-base/boot/bnet
@@ -5,3 +5,6 @@
 path="/mnt/tftp"
 
 global.bootm.image="${path}/${global.user}-barebox-${global.hostname}"
+if [ ! -f "${global.bootm.image}" ]; then
+      global.bootm.image="${path}/${global.user}-barebox-${global.arch}"
+fi
-- 
2.39.5




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

* Re: [PATCH] defaultenv: boot/bnet: fallback to booting generic 2nd stage FIT image
  2025-04-09 13:19 [PATCH] defaultenv: boot/bnet: fallback to booting generic 2nd stage FIT image Ahmad Fatoum
@ 2025-04-10  7:34 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2025-04-10  7:34 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Wed, 09 Apr 2025 15:19:14 +0200, Ahmad Fatoum wrote:
> With CONFIG_BOARD_GENERIC_FIT enabled, barebox generates a FIT image
> containing a generic DT-based second-stage barebox images as well as all
> enabled DTs.
> 
> Add it as fallback if the image with the hostname is missing, example:
> 
>   Board-specific image: afa-barebox-lxa-mc1
>    Arch-specific image: afa-barebox-arm
> 
> [...]

Applied, thanks!

[1/1] defaultenv: boot/bnet: fallback to booting generic 2nd stage FIT image
      https://git.pengutronix.de/cgit/barebox/commit/?id=4ebbbe27c0fb (link may not be stable)

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




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

end of thread, other threads:[~2025-04-10  8:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-09 13:19 [PATCH] defaultenv: boot/bnet: fallback to booting generic 2nd stage FIT image Ahmad Fatoum
2025-04-10  7:34 ` Sascha Hauer

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