[PATCH] blspec: fix dryrun support

Sascha Hauer s.hauer at pengutronix.de
Mon Apr 7 06:05:49 PDT 2025


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 at 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




More information about the barebox mailing list