mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] blspec: fix dryrun support
@ 2025-04-07  8:55 Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2025-04-07  8:55 UTC (permalink / raw)
  To: Barebox List

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..c35f2b670e 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(dryrun, data.dryrun);
 	data.os_file = data.oftree_file = data.initrd_file = NULL;
 	data.verbose = max(verbose, data.verbose);
 
-- 
2.39.5




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

* [PATCH] blspec: fix dryrun support
@ 2025-04-07 13:05 Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2025-04-07 13:05 UTC (permalink / raw)
  To: Barebox List

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




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

end of thread, other threads:[~2025-04-07 13:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-07  8:55 [PATCH] blspec: fix dryrun support Sascha Hauer
2025-04-07 13:05 Sascha Hauer

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