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: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 16/16] boot: make bootsource the default boot target if enabled
Date: Tue,  1 Apr 2025 12:48:06 +0200	[thread overview]
Message-ID: <20250401104806.3959859-17-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20250401104806.3959859-1-a.fatoum@pengutronix.de>

bootsource now expands to the cdev that barebox booted from if
that could be determined.

This makes it a useful default for $global.boot.default.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/boot.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/common/boot.c b/common/boot.c
index cb16a9a2b508..6aa2b1394961 100644
--- a/common/boot.c
+++ b/common/boot.c
@@ -134,7 +134,12 @@ static char *global_user;
 
 static int init_boot(void)
 {
-	global_boot_default = global_boot_default ? : xstrdup("net");
+	if (!global_boot_default)
+		global_boot_default = xstrdup(
+			IF_ENABLED(CONFIG_BOOT_DEFAULTS, "bootsource ")
+			"net"
+		);
+
 	globalvar_add_simple_string("boot.default", &global_boot_default);
 	globalvar_add_simple_int("boot.watchdog_timeout",
 				 &boot_watchdog_timeout, "%u");
-- 
2.39.5




      parent reply	other threads:[~2025-04-01 11:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-01 10:47 [PATCH 00/16] boot: implement generic bootsource target Ahmad Fatoum
2025-04-01 10:47 ` [PATCH 01/16] boot: change bootentry_register_provider to take struct argument Ahmad Fatoum
2025-04-01 10:47 ` [PATCH 02/16] boot: move nfs:// parsing out of bootloader spec code Ahmad Fatoum
2025-04-01 10:47 ` [PATCH 03/16] blspec: remove unused blspec_scan_devices Ahmad Fatoum
2025-04-01 10:47 ` [PATCH 04/16] blspec: don't export blspec functions Ahmad Fatoum
2025-04-01 10:47 ` [PATCH 05/16] blspec: factor out generic parts into bootscan helper Ahmad Fatoum
2025-04-01 10:47 ` [PATCH 06/16] common: bootscan: add scan_disk callback Ahmad Fatoum
2025-04-01 10:47 ` [PATCH 07/16] blspec: support boot /dev/virtioblkX Ahmad Fatoum
2025-04-01 10:47 ` [PATCH 08/16] bootm: associate bootm overrides with struct bootentry Ahmad Fatoum
2025-04-01 10:47 ` [PATCH 09/16] boot: split off bootarg API into new bootargs.h header Ahmad Fatoum
2025-04-01 10:48 ` [PATCH 10/16] block: add get_rootarg block op into block_device_ops Ahmad Fatoum
2025-04-01 10:48 ` [PATCH 11/16] block: fixup rootwait argument when needed by default Ahmad Fatoum
2025-04-01 10:48 ` [PATCH 12/16] of: implement stub for of_cdev_find Ahmad Fatoum
2025-04-01 10:48 ` [PATCH 13/16] bootsource: implement bootsource_of_cdev_find Ahmad Fatoum
2025-04-01 10:48 ` [PATCH 14/16] common: bootdef: add new boot entry provider Ahmad Fatoum
2025-04-01 10:48 ` [PATCH 15/16] kconfig: implement IF_ENABLED helper Ahmad Fatoum
2025-04-01 10:48 ` Ahmad Fatoum [this message]

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=20250401104806.3959859-17-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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