mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH] blspec: fix dryrun support
Date: Mon,  7 Apr 2025 15:05:49 +0200	[thread overview]
Message-ID: <20250407130549.2859220-1-s.hauer@pengutronix.de> (raw)

The dryrun field set in the static initializer is immediately
overwritten in bootm_data_init_defaults(), so the dryrun parameter ends
up without effect. Set it after calling bootm_data_init_defaults().

Fixes: 491a885e721e ("bootm: make dryrun controllable via global variable")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/blspec.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/common/blspec.c b/common/blspec.c
index 1cbadf8963..689f3ac4d8 100644
--- a/common/blspec.c
+++ b/common/blspec.c
@@ -77,11 +77,10 @@ static int blspec_boot(struct bootentry *be, int verbose, int dryrun)
 	const char *overlays;
 	const char *appendroot;
 	char *old_fws, *fws;
-	struct bootm_data data = {
-		.dryrun = dryrun,
-	};
+	struct bootm_data data = {};
 
 	bootm_data_init_defaults(&data);
+	data.dryrun = max_t(int, dryrun, data.dryrun);
 	data.os_file = data.oftree_file = data.initrd_file = NULL;
 	data.verbose = max(verbose, data.verbose);
 
-- 
2.39.5




             reply	other threads:[~2025-04-07 13:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07 13:05 Sascha Hauer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-04-07  8:55 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=20250407130549.2859220-1-s.hauer@pengutronix.de \
    --to=s.hauer@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