mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] bootm: adapt help text and naming for bootm.provide_machine_id
@ 2020-11-18 18:22 Ahmad Fatoum
  2020-11-19  8:42 ` Bastian Krause
  2020-11-23 16:45 ` Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2020-11-18 18:22 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum, Bastian Krause

The Kconfig help text as well the function name
machine_id_set_bootarg() suggest that enabling the Kconfig option is
sufficient to have barebox pass the machine id to the kernel.

This is not the case, so change the naming/documentation to make this
clearer.

Cc: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/Kconfig      | 19 ++++++++++---------
 common/bootm.c      |  2 +-
 common/machine_id.c |  4 ++--
 3 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/common/Kconfig b/common/Kconfig
index 9b73aa84549c..ffdce2f96c59 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -989,19 +989,20 @@ config RESET_SOURCE
 	  useful for any kind of system recovery or repair.
 
 config MACHINE_ID
-	bool "pass machine-id to kernel"
+	bool "compute unique machine-id"
 	depends on FLEXIBLE_BOOTARGS
 	depends on SHA1
 	help
-	  Sets the linux.bootargs.machine_id global variable with a value of
-	  systemd.machine_id=UID. The UID is a persistent device-specific
-	  id. It is a hash over device-specific information provided by various
-	  sources.
+	  Compute a persistent machine-specific id and store it to $global.machine_id.
+	  The id is a hash of device-specific information added via
+	  machine_id_set_hashable(). If multiple sources are available, the
+	  information provided by the last call prior to the late initcall
+	  set_machine_id() is used to generate the machine id from. Thus when
+	  updating barebox the machine id might change.
 
-	  Note: if multiple sources provide hashable device-specific information
-	  (via machine_id_set_hashable()) the information provided by the last call
-	  prior to the late initcall set_machine_id() is used to generate the
-	  machine id from. Thus when updating barebox the machine id might change.
+	  global.bootm.provide_machine_id may be used to automatically set
+	  the linux.bootargs.machine_id global variable with a value of
+	  systemd.machine_id=${global.machine_id}
 
 	  Note: if no hashable information is available no machine id will be passed
 	  to the kernel.
diff --git a/common/bootm.c b/common/bootm.c
index f70ef10100b0..59efc610997f 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -856,4 +856,4 @@ BAREBOX_MAGICVAR(global.bootm.verify, "bootm default verify level");
 BAREBOX_MAGICVAR(global.bootm.verbose, "bootm default verbosity level (0=quiet)");
 BAREBOX_MAGICVAR(global.bootm.appendroot, "Add root= option to Kernel to mount rootfs from the device the Kernel comes from (default, device can be overridden via global.bootm.root_dev)");
 BAREBOX_MAGICVAR(global.bootm.root_dev, "bootm default root device (overrides default device in global.bootm.appendroot)");
-BAREBOX_MAGICVAR(global.bootm.provide_machine_id, "If true, add systemd.machine_id= with value of global.machine_id to Kernel");
+BAREBOX_MAGICVAR(global.bootm.provide_machine_id, "If true, append systemd.machine_id=$global.machine_id to Kernel command line");
diff --git a/common/machine_id.c b/common/machine_id.c
index c1309ccafdd2..6480806cd287 100644
--- a/common/machine_id.c
+++ b/common/machine_id.c
@@ -24,7 +24,7 @@ void machine_id_set_hashable(const void *hashable, size_t len)
 	__machine_id_hashable_length = len;
 }
 
-static int machine_id_set_bootarg(void)
+static int machine_id_set_globalvar(void)
 {
 	struct digest *digest = NULL;
 	unsigned char machine_id[SHA1_DIGEST_SIZE];
@@ -64,6 +64,6 @@ out:
 	return ret;
 
 }
-late_initcall(machine_id_set_bootarg);
+late_initcall(machine_id_set_globalvar);
 
 BAREBOX_MAGICVAR(global.machine_id, "Persistent device-specific, hexadecimal, 32-character id");
-- 
2.29.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] bootm: adapt help text and naming for bootm.provide_machine_id
  2020-11-18 18:22 [PATCH] bootm: adapt help text and naming for bootm.provide_machine_id Ahmad Fatoum
@ 2020-11-19  8:42 ` Bastian Krause
  2020-11-23 16:45 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Bastian Krause @ 2020-11-19  8:42 UTC (permalink / raw)
  To: Ahmad Fatoum, barebox

On 11/18/20 7:22 PM, Ahmad Fatoum wrote:
> The Kconfig help text as well the function name
> machine_id_set_bootarg() suggest that enabling the Kconfig option is
> sufficient to have barebox pass the machine id to the kernel.
> 
> This is not the case, so change the naming/documentation to make this
> clearer.
> 
> Cc: Bastian Krause <bst@pengutronix.de>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  common/Kconfig      | 19 ++++++++++---------
>  common/bootm.c      |  2 +-
>  common/machine_id.c |  4 ++--
>  3 files changed, 13 insertions(+), 12 deletions(-)

Thanks!

Reviewed-by: Bastian Krause <bst@pengutronix.de>

Bastian


> 
> diff --git a/common/Kconfig b/common/Kconfig
> index 9b73aa84549c..ffdce2f96c59 100644
> --- a/common/Kconfig
> +++ b/common/Kconfig
> @@ -989,19 +989,20 @@ config RESET_SOURCE
>  	  useful for any kind of system recovery or repair.
>  
>  config MACHINE_ID
> -	bool "pass machine-id to kernel"
> +	bool "compute unique machine-id"
>  	depends on FLEXIBLE_BOOTARGS
>  	depends on SHA1
>  	help
> -	  Sets the linux.bootargs.machine_id global variable with a value of
> -	  systemd.machine_id=UID. The UID is a persistent device-specific
> -	  id. It is a hash over device-specific information provided by various
> -	  sources.
> +	  Compute a persistent machine-specific id and store it to $global.machine_id.
> +	  The id is a hash of device-specific information added via
> +	  machine_id_set_hashable(). If multiple sources are available, the
> +	  information provided by the last call prior to the late initcall
> +	  set_machine_id() is used to generate the machine id from. Thus when
> +	  updating barebox the machine id might change.
>  
> -	  Note: if multiple sources provide hashable device-specific information
> -	  (via machine_id_set_hashable()) the information provided by the last call
> -	  prior to the late initcall set_machine_id() is used to generate the
> -	  machine id from. Thus when updating barebox the machine id might change.
> +	  global.bootm.provide_machine_id may be used to automatically set
> +	  the linux.bootargs.machine_id global variable with a value of
> +	  systemd.machine_id=${global.machine_id}
>  
>  	  Note: if no hashable information is available no machine id will be passed
>  	  to the kernel.
> diff --git a/common/bootm.c b/common/bootm.c
> index f70ef10100b0..59efc610997f 100644
> --- a/common/bootm.c
> +++ b/common/bootm.c
> @@ -856,4 +856,4 @@ BAREBOX_MAGICVAR(global.bootm.verify, "bootm default verify level");
>  BAREBOX_MAGICVAR(global.bootm.verbose, "bootm default verbosity level (0=quiet)");
>  BAREBOX_MAGICVAR(global.bootm.appendroot, "Add root= option to Kernel to mount rootfs from the device the Kernel comes from (default, device can be overridden via global.bootm.root_dev)");
>  BAREBOX_MAGICVAR(global.bootm.root_dev, "bootm default root device (overrides default device in global.bootm.appendroot)");
> -BAREBOX_MAGICVAR(global.bootm.provide_machine_id, "If true, add systemd.machine_id= with value of global.machine_id to Kernel");
> +BAREBOX_MAGICVAR(global.bootm.provide_machine_id, "If true, append systemd.machine_id=$global.machine_id to Kernel command line");
> diff --git a/common/machine_id.c b/common/machine_id.c
> index c1309ccafdd2..6480806cd287 100644
> --- a/common/machine_id.c
> +++ b/common/machine_id.c
> @@ -24,7 +24,7 @@ void machine_id_set_hashable(const void *hashable, size_t len)
>  	__machine_id_hashable_length = len;
>  }
>  
> -static int machine_id_set_bootarg(void)
> +static int machine_id_set_globalvar(void)
>  {
>  	struct digest *digest = NULL;
>  	unsigned char machine_id[SHA1_DIGEST_SIZE];
> @@ -64,6 +64,6 @@ out:
>  	return ret;
>  
>  }
> -late_initcall(machine_id_set_bootarg);
> +late_initcall(machine_id_set_globalvar);
>  
>  BAREBOX_MAGICVAR(global.machine_id, "Persistent device-specific, hexadecimal, 32-character id");
> 


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

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] bootm: adapt help text and naming for bootm.provide_machine_id
  2020-11-18 18:22 [PATCH] bootm: adapt help text and naming for bootm.provide_machine_id Ahmad Fatoum
  2020-11-19  8:42 ` Bastian Krause
@ 2020-11-23 16:45 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2020-11-23 16:45 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox, Bastian Krause

On Wed, Nov 18, 2020 at 07:22:16PM +0100, Ahmad Fatoum wrote:
> The Kconfig help text as well the function name
> machine_id_set_bootarg() suggest that enabling the Kconfig option is
> sufficient to have barebox pass the machine id to the kernel.
> 
> This is not the case, so change the naming/documentation to make this
> clearer.
> 
> Cc: Bastian Krause <bst@pengutronix.de>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  common/Kconfig      | 19 ++++++++++---------
>  common/bootm.c      |  2 +-
>  common/machine_id.c |  4 ++--
>  3 files changed, 13 insertions(+), 12 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/common/Kconfig b/common/Kconfig
> index 9b73aa84549c..ffdce2f96c59 100644
> --- a/common/Kconfig
> +++ b/common/Kconfig
> @@ -989,19 +989,20 @@ config RESET_SOURCE
>  	  useful for any kind of system recovery or repair.
>  
>  config MACHINE_ID
> -	bool "pass machine-id to kernel"
> +	bool "compute unique machine-id"
>  	depends on FLEXIBLE_BOOTARGS
>  	depends on SHA1
>  	help
> -	  Sets the linux.bootargs.machine_id global variable with a value of
> -	  systemd.machine_id=UID. The UID is a persistent device-specific
> -	  id. It is a hash over device-specific information provided by various
> -	  sources.
> +	  Compute a persistent machine-specific id and store it to $global.machine_id.
> +	  The id is a hash of device-specific information added via
> +	  machine_id_set_hashable(). If multiple sources are available, the
> +	  information provided by the last call prior to the late initcall
> +	  set_machine_id() is used to generate the machine id from. Thus when
> +	  updating barebox the machine id might change.
>  
> -	  Note: if multiple sources provide hashable device-specific information
> -	  (via machine_id_set_hashable()) the information provided by the last call
> -	  prior to the late initcall set_machine_id() is used to generate the
> -	  machine id from. Thus when updating barebox the machine id might change.
> +	  global.bootm.provide_machine_id may be used to automatically set
> +	  the linux.bootargs.machine_id global variable with a value of
> +	  systemd.machine_id=${global.machine_id}
>  
>  	  Note: if no hashable information is available no machine id will be passed
>  	  to the kernel.
> diff --git a/common/bootm.c b/common/bootm.c
> index f70ef10100b0..59efc610997f 100644
> --- a/common/bootm.c
> +++ b/common/bootm.c
> @@ -856,4 +856,4 @@ BAREBOX_MAGICVAR(global.bootm.verify, "bootm default verify level");
>  BAREBOX_MAGICVAR(global.bootm.verbose, "bootm default verbosity level (0=quiet)");
>  BAREBOX_MAGICVAR(global.bootm.appendroot, "Add root= option to Kernel to mount rootfs from the device the Kernel comes from (default, device can be overridden via global.bootm.root_dev)");
>  BAREBOX_MAGICVAR(global.bootm.root_dev, "bootm default root device (overrides default device in global.bootm.appendroot)");
> -BAREBOX_MAGICVAR(global.bootm.provide_machine_id, "If true, add systemd.machine_id= with value of global.machine_id to Kernel");
> +BAREBOX_MAGICVAR(global.bootm.provide_machine_id, "If true, append systemd.machine_id=$global.machine_id to Kernel command line");
> diff --git a/common/machine_id.c b/common/machine_id.c
> index c1309ccafdd2..6480806cd287 100644
> --- a/common/machine_id.c
> +++ b/common/machine_id.c
> @@ -24,7 +24,7 @@ void machine_id_set_hashable(const void *hashable, size_t len)
>  	__machine_id_hashable_length = len;
>  }
>  
> -static int machine_id_set_bootarg(void)
> +static int machine_id_set_globalvar(void)
>  {
>  	struct digest *digest = NULL;
>  	unsigned char machine_id[SHA1_DIGEST_SIZE];
> @@ -64,6 +64,6 @@ out:
>  	return ret;
>  
>  }
> -late_initcall(machine_id_set_bootarg);
> +late_initcall(machine_id_set_globalvar);
>  
>  BAREBOX_MAGICVAR(global.machine_id, "Persistent device-specific, hexadecimal, 32-character id");
> -- 
> 2.29.2
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

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

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2020-11-23 16:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-18 18:22 [PATCH] bootm: adapt help text and naming for bootm.provide_machine_id Ahmad Fatoum
2020-11-19  8:42 ` Bastian Krause
2020-11-23 16:45 ` Sascha Hauer

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