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 2/7] boot: move global.linux.bootargs.dyn. to common code
Date: Fri, 14 Feb 2025 11:48:12 +0100	[thread overview]
Message-ID: <20250214104817.2975052-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20250214104817.2975052-1-a.fatoum@pengutronix.de>

Instead of clearing these options by select boot targets prior to boot,
let's instead clear them directly after the boot aborting.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/blspec.c   | 1 -
 common/boot.c     | 3 ++-
 common/fastboot.c | 1 -
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/common/blspec.c b/common/blspec.c
index ea334e18718a..8a7f996e78d2 100644
--- a/common/blspec.c
+++ b/common/blspec.c
@@ -81,7 +81,6 @@ static int blspec_boot(struct bootentry *be, int verbose, int dryrun)
 		.dryrun = dryrun,
 	};
 
-	globalvar_set_match("linux.bootargs.dyn.", "");
 	globalvar_set("bootm.image", "");
 	globalvar_set("bootm.oftree", "");
 	globalvar_set("bootm.initrd", "");
diff --git a/common/boot.c b/common/boot.c
index ced3b3a3477c..42818c6e2154 100644
--- a/common/boot.c
+++ b/common/boot.c
@@ -83,7 +83,6 @@ static int bootscript_boot(struct bootentry *entry, int verbose, int dryrun)
 
 	globalvar_add_simple("linux.bootargs.dyn.ip", NULL);
 	globalvar_add_simple("linux.bootargs.dyn.root", NULL);
-	globalvar_set_match("linux.bootargs.dyn.", "");
 
 	ret = run_command(bs->scriptpath);
 	if (ret) {
@@ -162,6 +161,8 @@ int boot_entry(struct bootentry *be, int verbose, int dryrun)
 	if (ret && ret != -ENOMEDIUM)
 		pr_err("Booting entry '%s' failed: %pe\n", be->title, ERR_PTR(ret));
 
+	globalvar_set_match("linux.bootargs.dyn.", "");
+
 	return ret;
 }
 
diff --git a/common/fastboot.c b/common/fastboot.c
index 66b59ab9b0d7..acc91490a553 100644
--- a/common/fastboot.c
+++ b/common/fastboot.c
@@ -419,7 +419,6 @@ static void __maybe_unused cb_boot(struct fastboot *fb, const char *opt)
 
 	fastboot_tx_print(fb, FASTBOOT_MSG_INFO, "Booting kernel..\n");
 
-	globalvar_set_match("linux.bootargs.dyn.", "");
 	globalvar_set("bootm.image", "");
 
 	data.os_file = fb->tempname;
-- 
2.39.5




  parent reply	other threads:[~2025-02-14 10:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-14 10:48 [PATCH 0/7] commands: boot: add support for overriding boot artifacts Ahmad Fatoum
2025-02-14 10:48 ` [PATCH 1/7] bootm: add helper functions for checking if FIT image is used Ahmad Fatoum
2025-02-14 10:48 ` Ahmad Fatoum [this message]
2025-02-14 10:48 ` [PATCH 3/7] blspec: don't clobber bootm.image on boot attempt Ahmad Fatoum
2025-02-14 10:48 ` [PATCH 4/7] fastboot: drop useless bootm.image clobber Ahmad Fatoum
2025-02-14 10:48 ` [PATCH 5/7] bootm: don't clobber global.bootm. variables after script boot fails Ahmad Fatoum
2025-02-14 10:48 ` [PATCH 6/7] bootm: retire bootm_has_initrd Ahmad Fatoum
2025-02-14 20:02   ` [PATCH] fixup! " Ahmad Fatoum
2025-02-14 10:48 ` [PATCH 7/7] commands: boot: add support for overriding boot artifacts Ahmad Fatoum
2025-02-15 12:29   ` [PATCH] fixup! " Ahmad Fatoum
2025-02-17  9:27 ` [PATCH 0/7] " 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=20250214104817.2975052-3-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