mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2] bootm: make dryrun controllable via global variable
@ 2024-10-29  8:24 Stefan Kerkmann
  2024-11-04 11:27 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Kerkmann @ 2024-10-29  8:24 UTC (permalink / raw)
  To: Sascha Hauer, BAREBOX; +Cc: Stefan Kerkmann

When the bootm code is not called directly by the bootm command it is
useful to control the dryrun with a globalvar. This introduces
global.bootm.dryrun for this purpose.

Signed-off-by: Stefan Kerkmann <s.kerkmann@pengutronix.de>
---
Changes in v2:
- Added bootm.dryrun as BAREBOX_MAGICVAR
- Link to v1: https://lore.kernel.org/r/20241028-feature-dryrun-global-v1-1-5529ac1e133e@pengutronix.de
---
 common/bootm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/common/bootm.c b/common/bootm.c
index b6ab358426f60d3bd2c0ae8f1170d5d45a839d98..bc917081d7d1c9ed8ecbcb70974608fdc6dd1402 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -42,6 +42,7 @@ static struct image_handler *bootm_find_handler(enum filetype filetype,
 }
 
 static int bootm_appendroot;
+static int bootm_dryrun;
 static int bootm_earlycon;
 static int bootm_provide_machine_id;
 static int bootm_provide_hostname;
@@ -64,6 +65,7 @@ void bootm_data_init_defaults(struct bootm_data *data)
 	data->provide_machine_id = bootm_provide_machine_id;
 	data->provide_hostname = bootm_provide_hostname;
 	data->verbose = bootm_verbosity;
+	data->dryrun = bootm_dryrun;
 }
 
 static enum bootm_verify bootm_verify_mode = BOOTM_VERIFY_HASH;
@@ -1032,6 +1034,7 @@ static int bootm_init(void)
 	if (bootm_signed_images_are_forced())
 		bootm_verify_mode = BOOTM_VERIFY_SIGNATURE;
 
+	globalvar_add_simple_bool("bootm.dryrun", &bootm_dryrun);
 	globalvar_add_simple_int("bootm.verbose", &bootm_verbosity, "%u");
 
 	globalvar_add_simple_enum("bootm.verify", (unsigned int *)&bootm_verify_mode,
@@ -1062,6 +1065,7 @@ BAREBOX_MAGICVAR(global.bootm.initrd, "bootm default initrd");
 BAREBOX_MAGICVAR(global.bootm.initrd.loadaddr, "bootm default initrd loadaddr");
 BAREBOX_MAGICVAR(global.bootm.oftree, "bootm default oftree");
 BAREBOX_MAGICVAR(global.bootm.tee, "bootm default tee image");
+BAREBOX_MAGICVAR(global.bootm.dryrun, "bootm default dryrun level");
 BAREBOX_MAGICVAR(global.bootm.verify, "bootm default verify level");
 BAREBOX_MAGICVAR(global.bootm.verbose, "bootm default verbosity level (0=quiet)");
 BAREBOX_MAGICVAR(global.bootm.earlycon, "Add earlycon option to Kernel for early log output");

---
base-commit: 59658c877bcc605fe3ca36653b4f40f57856b81a
change-id: 20241028-feature-dryrun-global-09e9222847df

Best regards,
-- 
Stefan Kerkmann <s.kerkmann@pengutronix.de>




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

* Re: [PATCH v2] bootm: make dryrun controllable via global variable
  2024-10-29  8:24 [PATCH v2] bootm: make dryrun controllable via global variable Stefan Kerkmann
@ 2024-11-04 11:27 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-11-04 11:27 UTC (permalink / raw)
  To: BAREBOX, Stefan Kerkmann


On Tue, 29 Oct 2024 09:24:52 +0100, Stefan Kerkmann wrote:
> When the bootm code is not called directly by the bootm command it is
> useful to control the dryrun with a globalvar. This introduces
> global.bootm.dryrun for this purpose.
> 
> 

Applied, thanks!

[1/1] bootm: make dryrun controllable via global variable
      https://git.pengutronix.de/cgit/barebox/commit/?id=491a885e721e (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




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

end of thread, other threads:[~2024-11-04 11:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-29  8:24 [PATCH v2] bootm: make dryrun controllable via global variable Stefan Kerkmann
2024-11-04 11:27 ` Sascha Hauer

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