[PATCH v2 11/13] smbios: Fill UUID from sysinfo when available

Tom Rini trini at konsulko.com
Tue Oct 29 01:04:49 CET 2024


On Mon, Oct 28, 2024 at 07:12:46AM +0100, Jan Kiszka wrote:
> On 25.10.24 03:08, Tom Rini wrote:
> > On Tue, Oct 22, 2024 at 08:04:28AM +0200, Jan Kiszka wrote:
> > 
> >> From: Jan Kiszka <jan.kiszka at siemens.com>
> >>
> >> Allow for the sysinfo drivers to provide a system UUID to SMBIOS. Will
> >> be first used by the IOT2050 boards.
> >>
> >> Based on original patch by Li Hua Qian.
> >>
> >> Signed-off-by: Jan Kiszka <jan.kiszka at siemens.com>
> >> Reviewed-by: Simon Glass <sjg at chromium.org>
> >> ---
> >>  include/sysinfo.h | 1 +
> >>  lib/smbios.c      | 4 ++++
> >>  2 files changed, 5 insertions(+)
> >>
> >> diff --git a/include/sysinfo.h b/include/sysinfo.h
> >> index 8a77ef44856..1c5008b5f23 100644
> >> --- a/include/sysinfo.h
> >> +++ b/include/sysinfo.h
> >> @@ -49,6 +49,7 @@ enum sysinfo_id {
> >>  	SYSINFO_ID_SMBIOS_SYSTEM_SERIAL,
> >>  	SYSINFO_ID_SMBIOS_SYSTEM_SKU,
> >>  	SYSINFO_ID_SMBIOS_SYSTEM_FAMILY,
> >> +	SYSINFO_ID_SMBIOS_SYSTEM_UUID,
> >>  	SYSINFO_ID_SMBIOS_BASEBOARD_MANUFACTURER,
> >>  	SYSINFO_ID_SMBIOS_BASEBOARD_PRODUCT,
> >>  	SYSINFO_ID_SMBIOS_BASEBOARD_VERSION,
> >> diff --git a/lib/smbios.c b/lib/smbios.c
> >> index 7c24ea129eb..1441fa4cde6 100644
> >> --- a/lib/smbios.c
> >> +++ b/lib/smbios.c
> >> @@ -387,6 +387,7 @@ static int smbios_write_type1(ulong *current, int handle,
> >>  	struct smbios_type1 *t;
> >>  	int len = sizeof(struct smbios_type1);
> >>  	char *serial_str = env_get("serial#");
> >> +	char uuid[sizeof(t->uuid)];
> >>  
> >>  	t = map_sysmem(*current, len);
> >>  	memset(t, 0, sizeof(struct smbios_type1));
> >> @@ -409,6 +410,9 @@ static int smbios_write_type1(ulong *current, int handle,
> >>  						      SYSINFO_ID_SMBIOS_SYSTEM_SERIAL,
> >>  						      NULL);
> >>  	}
> >> +	if (!sysinfo_get_str(ctx->dev, SYSINFO_ID_SMBIOS_SYSTEM_UUID,
> >> +			     sizeof(uuid), uuid))
> >> +		strncpy((char *)t->uuid, uuid, sizeof(t->uuid));
> >>  	t->wakeup_type = SMBIOS_WAKEUP_TYPE_UNKNOWN;
> >>  	t->sku_number = smbios_add_prop_si(ctx, "sku",
> >>  					   SYSINFO_ID_SMBIOS_SYSTEM_SKU, NULL);
> > 
> > This commit leads to sandbox (and sandbox with clang) failing a ton of
> > tests:
> > https://source.denx.de/u-boot/u-boot/-/jobs/929474
> > 
> > Without this commit in the series, iot2050 fails to build.
> > 
> 
> Strange on first sight - we will look into this. As this patch and the
> following 2 are only adding a feature, maybe you could already merge the
> first 10 patches? Would make v3 shorter for us.

OK, I'll see how just the first 10 go shortly.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20241028/54a9eff1/attachment.sig>


More information about the U-Boot mailing list