Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
u-boot-cubieboard2
0018-smbios-Provide-serial-number.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0018-smbios-Provide-serial-number.patch of Package u-boot-cubieboard2
From 10f3bcd0ae173e5fdab71127374c719851a8dddf Mon Sep 17 00:00:00 2001 From: Alexander Graf <agraf@suse.de> Date: Sun, 7 Aug 2016 18:29:12 +0200 Subject: [PATCH] smbios: Provide serial number If the system has a valid "serial#" environment variable set (which boards that can find it out programatically set automatically), use that as input for the serial number and UUID fields in the SMBIOS tables. Signed-off-by: Alexander Graf <agraf@suse.de> --- v1 -> v2: - Also populate UUID --- lib/smbios.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/smbios.c b/lib/smbios.c index 4d85155..2d0df23 100644 --- a/lib/smbios.c +++ b/lib/smbios.c @@ -111,11 +111,16 @@ static int smbios_write_type1(uintptr_t *current, int handle) { struct smbios_type1 *t = (struct smbios_type1 *)*current; int len = sizeof(struct smbios_type1); + char *serial_str = getenv("serial#"); memset(t, 0, sizeof(struct smbios_type1)); fill_smbios_header(t, SMBIOS_SYSTEM_INFORMATION, len, handle); t->manufacturer = smbios_add_string(t->eos, CONFIG_SMBIOS_MANUFACTURER); t->product_name = smbios_add_string(t->eos, CONFIG_SMBIOS_PRODUCT_NAME); + if (serial_str) { + strncpy((char*)t->uuid, serial_str, sizeof(t->uuid)); + t->serial_number = smbios_add_string(t->eos, serial_str); + } len = t->length + smbios_string_table_len(t->eos); *current += len;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor