mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] bootm: make dryrun controllable via global variable
@ 2024-10-28 16:34 Stefan Kerkmann
  2024-10-28 16:43 ` Ahmad Fatoum
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Kerkmann @ 2024-10-28 16:34 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>
---
 common/bootm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/common/bootm.c b/common/bootm.c
index b6ab358426..91e33b3f6b 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,

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

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




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

* Re: [PATCH] bootm: make dryrun controllable via global variable
  2024-10-28 16:34 [PATCH] bootm: make dryrun controllable via global variable Stefan Kerkmann
@ 2024-10-28 16:43 ` Ahmad Fatoum
  2024-10-29  8:26   ` Stefan Kerkmann
  0 siblings, 1 reply; 3+ messages in thread
From: Ahmad Fatoum @ 2024-10-28 16:43 UTC (permalink / raw)
  To: Stefan Kerkmann, Sascha Hauer, BAREBOX

Hello Stefan,

Thanks for your patch.

On 28.10.24 17:34, 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.
> 
> Signed-off-by: Stefan Kerkmann <s.kerkmann@pengutronix.de>
> ---
>  common/bootm.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/common/bootm.c b/common/bootm.c
> index b6ab358426..91e33b3f6b 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);

Please add a BAREBOX_MAGICVAR(global.bootm.dryrun, "some descriptive text").

See the end of the file for examples.

Cheers,
Ahmad

>  	globalvar_add_simple_int("bootm.verbose", &bootm_verbosity, "%u");
>  
>  	globalvar_add_simple_enum("bootm.verify", (unsigned int *)&bootm_verify_mode,
> 
> ---
> base-commit: 59658c877bcc605fe3ca36653b4f40f57856b81a
> change-id: 20241028-feature-dryrun-global-09e9222847df
> 
> Best regards,


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

* Re: [PATCH] bootm: make dryrun controllable via global variable
  2024-10-28 16:43 ` Ahmad Fatoum
@ 2024-10-29  8:26   ` Stefan Kerkmann
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Kerkmann @ 2024-10-29  8:26 UTC (permalink / raw)
  To: Ahmad Fatoum, Sascha Hauer, BAREBOX

Hi Ahmad,

On 28.10.24 17:43, Ahmad Fatoum wrote:
> Hello Stefan,
> 
> Thanks for your patch.
> 
> On 28.10.24 17:34, 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.
>>
>> Signed-off-by: Stefan Kerkmann <s.kerkmann@pengutronix.de>
>> ---
>>  common/bootm.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/common/bootm.c b/common/bootm.c
>> index b6ab358426..91e33b3f6b 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);
> 
> Please add a BAREBOX_MAGICVAR(global.bootm.dryrun, "some descriptive text").
> 

Done in v2.

> See the end of the file for examples.
> 
> Cheers,
> Ahmad
> 
>>  	globalvar_add_simple_int("bootm.verbose", &bootm_verbosity, "%u");
>>  
>>  	globalvar_add_simple_enum("bootm.verify", (unsigned int *)&bootm_verify_mode,
>>
>> ---
>> base-commit: 59658c877bcc605fe3ca36653b4f40f57856b81a
>> change-id: 20241028-feature-dryrun-global-09e9222847df
>>
>> Best regards,
> 
> 

Cheers,
Stefan

-- 
Pengutronix e.K.                       | Stefan Kerkmann             |
Steuerwalder Str. 21                   | https://www.pengutronix.de/ |
31137 Hildesheim, Germany              | Phone: +49-5121-206917-128  |
Amtsgericht Hildesheim, HRA 2686       | Fax:   +49-5121-206917-9    |




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

end of thread, other threads:[~2024-10-29  8:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-28 16:34 [PATCH] bootm: make dryrun controllable via global variable Stefan Kerkmann
2024-10-28 16:43 ` Ahmad Fatoum
2024-10-29  8:26   ` Stefan Kerkmann

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