[PATCH 0/5] cmd: provide command to display SMBIOS information

U-Boot may supply an SMBIOS table or they may be copied from QEMU.
Provide a command to display the SMBIOS information.
Currently only type 1 and 2 are translated to human readable text. Other types may be added later. Currently only a hexdump and the list of strings is provided for these.
The following prerequisites had to be fixed:
* The definition of SMBIOS type 2 lacked a field.
Heinrich Schuchardt (5): smbios: correct definition of gd_smbios_start() macro smbios: type2: contained object handles cmd: provide command to display SMBIOS information doc: man-page for smbios command test: unit test for smbios command
cmd/Kconfig | 7 ++ cmd/Makefile | 1 + cmd/smbios.c | 191 ++++++++++++++++++++++++++++++ doc/usage/cmd/smbios.rst | 93 +++++++++++++++ doc/usage/index.rst | 1 + include/asm-generic/global_data.h | 2 +- include/smbios.h | 1 + test/py/tests/test_smbios.py | 47 ++++++++ 8 files changed, 342 insertions(+), 1 deletion(-) create mode 100644 cmd/smbios.c create mode 100644 doc/usage/cmd/smbios.rst create mode 100644 test/py/tests/test_smbios.py
-- 2.43.0

gd_smbios_start() currently points to a non-existent field. It should return the field written by gd_set_smbios_start().
Fixes: 50834884a815 ("Record the position of the SMBIOS tables") Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de --- include/asm-generic/global_data.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index e8c6412e3f..c1f7818817 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -553,7 +553,7 @@ static_assert(sizeof(struct global_data) == GD_SIZE); #endif
#ifdef CONFIG_SMBIOS -#define gd_smbios_start() gd->smbios_start +#define gd_smbios_start() gd->arch.smbios_start #define gd_set_smbios_start(addr) gd->arch.smbios_start = addr #else #define gd_smbios_start() 0UL -- 2.43.0

Hi Heinrich,
On Sat, Dec 23, 2023 at 12:44 AM Heinrich Schuchardt xypron.glpk@gmx.de wrote:
gd_smbios_start() currently points to a non-existent field. It should return the field written by gd_set_smbios_start().
Fixes: 50834884a815 ("Record the position of the SMBIOS tables") Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
include/asm-generic/global_data.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
See:
https://patchwork.ozlabs.org/project/uboot/patch/20231015024511.3995580-5-sj...
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index e8c6412e3f..c1f7818817 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -553,7 +553,7 @@ static_assert(sizeof(struct global_data) == GD_SIZE); #endif
#ifdef CONFIG_SMBIOS -#define gd_smbios_start() gd->smbios_start +#define gd_smbios_start() gd->arch.smbios_start #define gd_set_smbios_start(addr) gd->arch.smbios_start = addr #else
#define gd_smbios_start() 0UL
2.43.0
Regards, SImon

The type 2 structure must include information about the contained objects. It is fine to set the number of contained object handles to 0.
Add the missing field.
Fixes: 721e992a8af5 ("x86: Add SMBIOS table support") Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de --- include/smbios.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/include/smbios.h b/include/smbios.h index e601283d29..88c19ae062 100644 --- a/include/smbios.h +++ b/include/smbios.h @@ -139,6 +139,7 @@ struct __packed smbios_type2 { u8 chassis_location; u16 chassis_handle; u8 board_type; + u8 number_contained_objects; char eos[SMBIOS_STRUCT_EOS_BYTES]; };
-- 2.43.0

Hi Heinrich,
On Sat, Dec 23, 2023 at 12:49 AM Heinrich Schuchardt xypron.glpk@gmx.de wrote:
The type 2 structure must include information about the contained objects. It is fine to set the number of contained object handles to 0.
Add the missing field.
Fixes: 721e992a8af5 ("x86: Add SMBIOS table support") Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
include/smbios.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/include/smbios.h b/include/smbios.h index e601283d29..88c19ae062 100644 --- a/include/smbios.h +++ b/include/smbios.h @@ -139,6 +139,7 @@ struct __packed smbios_type2 { u8 chassis_location; u16 chassis_handle; u8 board_type;
u8 number_contained_objects; char eos[SMBIOS_STRUCT_EOS_BYTES];
};
-- 2.43.0
I thought I already saw this patch elsewhere, but this one is not a v2?
Regards, Simon

On 12/26/23 10:50, Simon Glass wrote:
Hi Heinrich,
On Sat, Dec 23, 2023 at 12:49 AM Heinrich Schuchardt xypron.glpk@gmx.de wrote:
The type 2 structure must include information about the contained objects. It is fine to set the number of contained object handles to 0.
Add the missing field.
Fixes: 721e992a8af5 ("x86: Add SMBIOS table support") Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
include/smbios.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/include/smbios.h b/include/smbios.h index e601283d29..88c19ae062 100644 --- a/include/smbios.h +++ b/include/smbios.h @@ -139,6 +139,7 @@ struct __packed smbios_type2 { u8 chassis_location; u16 chassis_handle; u8 board_type;
};u8 number_contained_objects; char eos[SMBIOS_STRUCT_EOS_BYTES];
-- 2.43.0
I thought I already saw this patch elsewhere, but this one is not a v2?
I should have marked it as re-sent.
Best regards
Heinrich

On Sat, Dec 23, 2023 at 01:44:26AM +0100, Heinrich Schuchardt wrote:
The type 2 structure must include information about the contained objects. It is fine to set the number of contained object handles to 0.
Add the missing field.
Fixes: 721e992a8af5 ("x86: Add SMBIOS table support") Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
include/smbios.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/include/smbios.h b/include/smbios.h index e601283d29..88c19ae062 100644 --- a/include/smbios.h +++ b/include/smbios.h @@ -139,6 +139,7 @@ struct __packed smbios_type2 { u8 chassis_location; u16 chassis_handle; u8 board_type;
- u8 number_contained_objects; char eos[SMBIOS_STRUCT_EOS_BYTES];
};
-- 2.43.0
Reviewed-by: Ilias Apalodimas ilias.apalodimas@linaro.org

U-Boot can either generated an SMBIOS table or copy it from a prior boot stage, e.g. QEMU.
Provide a command to display the SMBIOS information.
Currently only type 1 and 2 are translated to human readable text. Other types may be added later. Currently only a hexdump and the list of strings is provided for these.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de --- cmd/Kconfig | 7 ++ cmd/Makefile | 1 + cmd/smbios.c | 191 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 199 insertions(+) create mode 100644 cmd/smbios.c
diff --git a/cmd/Kconfig b/cmd/Kconfig index 5a7678f0ac..580aeec8ee 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -206,6 +206,13 @@ config CMD_SBI help Display information about the SBI implementation.
+config CMD_SMBIOS + bool "smbios" + depends on SMBIOS + default y + help + Display the SMBIOS information. + endmenu
menu "Boot commands" diff --git a/cmd/Makefile b/cmd/Makefile index 5ed0e4011d..8a5dfd8ca9 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -168,6 +168,7 @@ obj-$(CONFIG_CMD_SETEXPR) += setexpr.o obj-$(CONFIG_CMD_SETEXPR_FMT) += printf.o obj-$(CONFIG_CMD_SPI) += spi.o obj-$(CONFIG_CMD_STRINGS) += strings.o +obj-$(CONFIG_CMD_SMBIOS) += smbios.o obj-$(CONFIG_CMD_SMC) += smccc.o obj-$(CONFIG_CMD_SYSBOOT) += sysboot.o obj-$(CONFIG_CMD_STACKPROTECTOR_TEST) += stackprot_test.o diff --git a/cmd/smbios.c b/cmd/smbios.c new file mode 100644 index 0000000000..63f908e92c --- /dev/null +++ b/cmd/smbios.c @@ -0,0 +1,191 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * The 'smbios' command displays information from the SMBIOS table. + * + * Copyright (c) 2023, Heinrich Schuchardt xypron.glpk@gmx.de + */ + +#include <command.h> +#include <hexdump.h> +#include <mapmem.h> +#include <smbios.h> +#include <tables_csum.h> +#include <asm/global_data.h> + +DECLARE_GLOBAL_DATA_PTR; + +/** + * smbios_get_string() - get SMBIOS string from table + * + * @table: SMBIOS table + * @index: index of the string + * Return: address of string, may point to empty string + */ +static const char *smbios_get_string(void *table, int index) +{ + const char *str = (char *)table + + ((struct smbios_header *)table)->length; + + if (!*str) + ++str; + for (--index; *str && index; --index) + str += strlen(str) + 1; + + return str; +} + +static struct smbios_header *next_table(struct smbios_header *table) +{ + const char *str; + + if (table->type == SMBIOS_END_OF_TABLE) + return NULL; + + str = smbios_get_string(table, 0); + return (struct smbios_header *)(++str); +} + +static void smbios_print_generic(struct smbios_header *table) +{ + char *str = (char *)table + table->length; + + if (CONFIG_IS_ENABLED(HEXDUMP)) { + printf("Header and Data:\n"); + print_hex_dump("\t", DUMP_PREFIX_OFFSET, 16, 1, + table, table->length, false); + } + if (*str) { + printf("Strings:\n"); + for (int index = 1; *str; ++index) { + printf("\tString %u: %s\n", index, str); + str += strlen(str) + 1; + } + } +} + +void smbios_print_str(const char *label, void *table, u8 index) +{ + printf("\t%s: %s\n", label, smbios_get_string(table, index)); +} + +static void smbios_print_type1(struct smbios_type1 *table) +{ + printf("System Information\n"); + smbios_print_str("Manufacturer", table, table->manufacturer); + smbios_print_str("Product Name", table, table->product_name); + smbios_print_str("Version", table, table->version); + smbios_print_str("Serial Number", table, table->serial_number); + if (table->length >= 0x19) { + printf("\tUUID %pUl\n", table->uuid); + smbios_print_str("Wake Up Type", table, table->serial_number); + } + if (table->length >= 0x1b) { + smbios_print_str("Serial Number", table, table->serial_number); + smbios_print_str("SKU Number", table, table->sku_number); + } +} + +static void smbios_print_type2(struct smbios_type2 *table) +{ + u16 *handle; + + printf("Base Board Information\n"); + smbios_print_str("Manufacturer", table, table->manufacturer); + smbios_print_str("Product Name", table, table->product_name); + smbios_print_str("Version", table, table->version); + smbios_print_str("Serial Number", table, table->serial_number); + smbios_print_str("Asset Tag", table, table->asset_tag_number); + printf("\tFeature Flags: 0x%2x\n", table->feature_flags); + smbios_print_str("Chassis Location", table, table->chassis_location); + printf("\tChassis Handle: 0x%2x\n", table->chassis_handle); + smbios_print_str("Board Type", table, table->board_type); + printf("\tContained Object Handles: "); + handle = (void *)table->eos; + for (int i = 0; i < table->number_contained_objects; ++i) + printf("0x%04x ", handle[i]); + printf("\n"); +} + +static void smbios_print_type127(struct smbios_type127 *table) +{ + printf("End Of Table\n"); +} + +static int do_smbios(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) +{ + ulong addr; + void *entry; + u32 size; + char version[12]; + struct smbios_header *table; + static const char smbios_sig[] = "_SM_"; + static const char smbios3_sig[] = "_SM3_"; + size_t count = 0; + u32 max_struct_size; + + addr = gd_smbios_start(); + if (!addr) { + log_warning("SMBIOS not available\n"); + return CMD_RET_FAILURE; + } + entry = map_sysmem(addr, 0); + if (!memcmp(entry, smbios3_sig, sizeof(smbios3_sig) - 1)) { + struct smbios3_entry *entry3 = entry; + + table = (void *)(uintptr_t)entry3->struct_table_address; + snprintf(version, sizeof(version), "%d.%d.%d", + entry3->major_ver, entry3->minor_ver, entry3->doc_rev); + table = (void *)(uintptr_t)entry3->struct_table_address; + size = entry3->length; + max_struct_size = entry3->max_struct_size; + } else if (!memcmp(entry, smbios_sig, sizeof(smbios_sig) - 1)) { + struct smbios_entry *entry2 = entry; + + snprintf(version, sizeof(version), "%d.%d", + entry2->major_ver, entry2->minor_ver); + table = (void *)(uintptr_t)entry2->struct_table_address; + size = entry2->length; + max_struct_size = entry2->max_struct_size; + } else { + log_err("Unknown SMBIOS anchor format\n"); + return CMD_RET_FAILURE; + } + if (table_compute_checksum(entry, size)) { + log_err("Invalid anchor checksum\n"); + return CMD_RET_FAILURE; + } + printf("SMBIOS %s present.\n", version); + + for (struct smbios_header *pos = table; pos; pos = next_table(pos)) + ++count; + printf("%zd structures occupying %d bytes\n", count, max_struct_size); + printf("Table at 0x%llx\n", (unsigned long long)map_to_sysmem(table)); + + for (struct smbios_header *pos = table; pos; pos = next_table(pos)) { + printf("\nHandle 0x%04x, DMI type %d, %d bytes at 0x%llx\n", + pos->handle, pos->type, pos->length, + (unsigned long long)map_to_sysmem(pos)); + switch (pos->type) { + case 1: + smbios_print_type1((struct smbios_type1 *)pos); + break; + case 2: + smbios_print_type2((struct smbios_type2 *)pos); + break; + case 127: + smbios_print_type127((struct smbios_type127 *)pos); + break; + default: + smbios_print_generic(pos); + break; + } + } + + return CMD_RET_SUCCESS; +} + +U_BOOT_LONGHELP(smbios, "- display SMBIOS information"); + +U_BOOT_CMD(smbios, 1, 0, do_smbios, "display SMBIOS information", + smbios_help_text); -- 2.43.0

On Sat, Dec 23, 2023 at 12:49 AM Heinrich Schuchardt xypron.glpk@gmx.de wrote:
U-Boot can either generated an SMBIOS table or copy it from a prior boot stage, e.g. QEMU.
Provide a command to display the SMBIOS information.
Currently only type 1 and 2 are translated to human readable text. Other types may be added later. Currently only a hexdump and the list of strings is provided for these.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
cmd/Kconfig | 7 ++ cmd/Makefile | 1 + cmd/smbios.c | 191 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 199 insertions(+) create mode 100644 cmd/smbios.c
Reviewed-by: Simon Glass sjg@chromium.org

On Sat, Dec 23, 2023 at 12:53 AM Heinrich Schuchardt xypron.glpk@gmx.de wrote:
U-Boot can either generated an SMBIOS table or copy it from a prior boot stage, e.g. QEMU.
Provide a command to display the SMBIOS information.
Currently only type 1 and 2 are translated to human readable text. Other types may be added later. Currently only a hexdump and the list of strings is provided for these.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
cmd/Kconfig | 7 ++ cmd/Makefile | 1 + cmd/smbios.c | 191 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 199 insertions(+) create mode 100644 cmd/smbios.c
diff --git a/cmd/Kconfig b/cmd/Kconfig index 5a7678f0ac..580aeec8ee 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -206,6 +206,13 @@ config CMD_SBI help Display information about the SBI implementation.
+config CMD_SMBIOS
bool "smbios"
depends on SMBIOS
default y
Should this be default? Maybe default if SMBIOS or similar?
help
Display the SMBIOS information.
endmenu
menu "Boot commands" diff --git a/cmd/Makefile b/cmd/Makefile index 5ed0e4011d..8a5dfd8ca9 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -168,6 +168,7 @@ obj-$(CONFIG_CMD_SETEXPR) += setexpr.o obj-$(CONFIG_CMD_SETEXPR_FMT) += printf.o obj-$(CONFIG_CMD_SPI) += spi.o obj-$(CONFIG_CMD_STRINGS) += strings.o +obj-$(CONFIG_CMD_SMBIOS) += smbios.o obj-$(CONFIG_CMD_SMC) += smccc.o obj-$(CONFIG_CMD_SYSBOOT) += sysboot.o obj-$(CONFIG_CMD_STACKPROTECTOR_TEST) += stackprot_test.o diff --git a/cmd/smbios.c b/cmd/smbios.c new file mode 100644 index 0000000000..63f908e92c --- /dev/null +++ b/cmd/smbios.c @@ -0,0 +1,191 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/*
- The 'smbios' command displays information from the SMBIOS table.
- Copyright (c) 2023, Heinrich Schuchardt xypron.glpk@gmx.de
- */
+#include <command.h> +#include <hexdump.h> +#include <mapmem.h> +#include <smbios.h> +#include <tables_csum.h> +#include <asm/global_data.h>
+DECLARE_GLOBAL_DATA_PTR;
+/**
- smbios_get_string() - get SMBIOS string from table
- @table: SMBIOS table
- @index: index of the string
- Return: address of string, may point to empty string
- */
+static const char *smbios_get_string(void *table, int index) +{
const char *str = (char *)table +
((struct smbios_header *)table)->length;
if (!*str)
++str;
for (--index; *str && index; --index)
str += strlen(str) + 1;
return str;
+}
+static struct smbios_header *next_table(struct smbios_header *table) +{
const char *str;
if (table->type == SMBIOS_END_OF_TABLE)
return NULL;
str = smbios_get_string(table, 0);
return (struct smbios_header *)(++str);
+}
+static void smbios_print_generic(struct smbios_header *table) +{
char *str = (char *)table + table->length;
if (CONFIG_IS_ENABLED(HEXDUMP)) {
printf("Header and Data:\n");
print_hex_dump("\t", DUMP_PREFIX_OFFSET, 16, 1,
table, table->length, false);
}
if (*str) {
printf("Strings:\n");
for (int index = 1; *str; ++index) {
printf("\tString %u: %s\n", index, str);
str += strlen(str) + 1;
}
}
+}
+void smbios_print_str(const char *label, void *table, u8 index) +{
printf("\t%s: %s\n", label, smbios_get_string(table, index));
+}
+static void smbios_print_type1(struct smbios_type1 *table) +{
printf("System Information\n");
smbios_print_str("Manufacturer", table, table->manufacturer);
smbios_print_str("Product Name", table, table->product_name);
smbios_print_str("Version", table, table->version);
smbios_print_str("Serial Number", table, table->serial_number);
if (table->length >= 0x19) {
printf("\tUUID %pUl\n", table->uuid);
smbios_print_str("Wake Up Type", table, table->serial_number);
}
if (table->length >= 0x1b) {
smbios_print_str("Serial Number", table, table->serial_number);
smbios_print_str("SKU Number", table, table->sku_number);
}
+}
+static void smbios_print_type2(struct smbios_type2 *table) +{
u16 *handle;
printf("Base Board Information\n");
smbios_print_str("Manufacturer", table, table->manufacturer);
smbios_print_str("Product Name", table, table->product_name);
smbios_print_str("Version", table, table->version);
smbios_print_str("Serial Number", table, table->serial_number);
smbios_print_str("Asset Tag", table, table->asset_tag_number);
printf("\tFeature Flags: 0x%2x\n", table->feature_flags);
smbios_print_str("Chassis Location", table, table->chassis_location);
printf("\tChassis Handle: 0x%2x\n", table->chassis_handle);
smbios_print_str("Board Type", table, table->board_type);
printf("\tContained Object Handles: ");
handle = (void *)table->eos;
for (int i = 0; i < table->number_contained_objects; ++i)
printf("0x%04x ", handle[i]);
printf("\n");
+}
+static void smbios_print_type127(struct smbios_type127 *table) +{
printf("End Of Table\n");
+}
+static int do_smbios(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
+{
ulong addr;
void *entry;
u32 size;
char version[12];
struct smbios_header *table;
static const char smbios_sig[] = "_SM_";
static const char smbios3_sig[] = "_SM3_";
size_t count = 0;
u32 max_struct_size;
addr = gd_smbios_start();
if (!addr) {
log_warning("SMBIOS not available\n");
return CMD_RET_FAILURE;
}
entry = map_sysmem(addr, 0);
if (!memcmp(entry, smbios3_sig, sizeof(smbios3_sig) - 1)) {
struct smbios3_entry *entry3 = entry;
table = (void *)(uintptr_t)entry3->struct_table_address;
snprintf(version, sizeof(version), "%d.%d.%d",
entry3->major_ver, entry3->minor_ver, entry3->doc_rev);
table = (void *)(uintptr_t)entry3->struct_table_address;
size = entry3->length;
max_struct_size = entry3->max_struct_size;
} else if (!memcmp(entry, smbios_sig, sizeof(smbios_sig) - 1)) {
struct smbios_entry *entry2 = entry;
snprintf(version, sizeof(version), "%d.%d",
entry2->major_ver, entry2->minor_ver);
table = (void *)(uintptr_t)entry2->struct_table_address;
size = entry2->length;
max_struct_size = entry2->max_struct_size;
} else {
log_err("Unknown SMBIOS anchor format\n");
return CMD_RET_FAILURE;
}
if (table_compute_checksum(entry, size)) {
log_err("Invalid anchor checksum\n");
return CMD_RET_FAILURE;
}
printf("SMBIOS %s present.\n", version);
for (struct smbios_header *pos = table; pos; pos = next_table(pos))
++count;
printf("%zd structures occupying %d bytes\n", count, max_struct_size);
printf("Table at 0x%llx\n", (unsigned long long)map_to_sysmem(table));
for (struct smbios_header *pos = table; pos; pos = next_table(pos)) {
printf("\nHandle 0x%04x, DMI type %d, %d bytes at 0x%llx\n",
pos->handle, pos->type, pos->length,
(unsigned long long)map_to_sysmem(pos));
switch (pos->type) {
case 1:
smbios_print_type1((struct smbios_type1 *)pos);
break;
case 2:
smbios_print_type2((struct smbios_type2 *)pos);
break;
case 127:
smbios_print_type127((struct smbios_type127 *)pos);
break;
default:
smbios_print_generic(pos);
break;
}
}
return CMD_RET_SUCCESS;
+}
+U_BOOT_LONGHELP(smbios, "- display SMBIOS information");
+U_BOOT_CMD(smbios, 1, 0, do_smbios, "display SMBIOS information",
smbios_help_text);
-- 2.43.0

Provide a man-page for the smbios command.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de --- doc/usage/cmd/smbios.rst | 93 ++++++++++++++++++++++++++++++++++++++++ doc/usage/index.rst | 1 + 2 files changed, 94 insertions(+) create mode 100644 doc/usage/cmd/smbios.rst
diff --git a/doc/usage/cmd/smbios.rst b/doc/usage/cmd/smbios.rst new file mode 100644 index 0000000000..1ffd706d7d --- /dev/null +++ b/doc/usage/cmd/smbios.rst @@ -0,0 +1,93 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later: + +smbios command +============== + +Synopsis +-------- + +:: + + smbios + +Description +----------- + +The smbios command displays information from the SMBIOS tables. + +Examples +-------- + +The example below shows an example output of the smbios command. + +:: + + => smbios + SMBIOS 2.8.0 present. + 8 structures occupying 81 bytes + Table at 0x6d35018 + + Handle 0x0100, DMI type 1, 27 bytes at 0x6d35018 + System Information + Manufacturer: QEMU + Product Name: Standard PC (i440FX + PIIX, 1996) + Version: pc-i440fx-2.5 + Serial Number: + UUID 00000000-0000-0000-0000-000000000000 + Wake Up Type: + Serial Number: + SKU Number: + + Handle 0x0300, DMI type 3, 22 bytes at 0x6d35069 + Header and Data: + 00000000: 03 16 00 03 01 01 02 00 00 03 03 03 02 00 00 00 + 00000010: 00 00 00 00 00 00 + Strings: + String 1: QEMU + String 2: pc-i440fx-2.5 + + Handle 0x0400, DMI type 4, 42 bytes at 0x6d35093 + Header and Data: + 00000000: 04 2a 00 04 01 03 01 02 63 06 00 00 fd ab 81 07 + 00000010: 03 00 00 00 d0 07 d0 07 41 01 ff ff ff ff ff ff + 00000020: 00 00 00 01 01 01 02 00 01 00 + Strings: + String 1: CPU 0 + String 2: QEMU + String 3: pc-i440fx-2.5 + + Handle 0x1000, DMI type 16, 23 bytes at 0x6d350d7 + Header and Data: + 00000000: 10 17 00 10 01 03 06 00 00 02 00 fe ff 01 00 00 + 00000010: 00 00 00 00 00 00 00 + + Handle 0x1100, DMI type 17, 40 bytes at 0x6d350f0 + Header and Data: + 00000000: 11 28 00 11 00 10 fe ff ff ff ff ff 80 00 09 00 + 00000010: 01 00 07 02 00 00 00 02 00 00 00 00 00 00 00 00 + 00000020: 00 00 00 00 00 00 00 00 + Strings: + String 1: DIMM 0 + String 2: QEMU + + Handle 0x1300, DMI type 19, 31 bytes at 0x6d35125 + Header and Data: + 00000000: 13 1f 00 13 00 00 00 00 ff ff 01 00 00 10 01 00 + 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + + Handle 0x2000, DMI type 32, 11 bytes at 0x6d35146 + Header and Data: + 00000000: 20 0b 00 20 00 00 00 00 00 00 00 + + Handle 0x7f00, DMI type 127, 4 bytes at 0x6d35153 + End Of Table + +Configuration +------------- + +The command is only available if CONFIG_CMD_SMBIOS=y. + +Return value +------------ + +The return value $? is 0 (true) on success, 1 (false) otherwise. diff --git a/doc/usage/index.rst b/doc/usage/index.rst index 1a626c03c2..eb2b2311f8 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -102,6 +102,7 @@ Shell commands cmd/size cmd/sleep cmd/sm + cmd/smbios cmd/sound cmd/source cmd/temperature -- 2.43.0

On Sat, Dec 23, 2023 at 12:49 AM Heinrich Schuchardt xypron.glpk@gmx.de wrote:
Provide a man-page for the smbios command.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
doc/usage/cmd/smbios.rst | 93 ++++++++++++++++++++++++++++++++++++++++ doc/usage/index.rst | 1 + 2 files changed, 94 insertions(+) create mode 100644 doc/usage/cmd/smbios.rst
Reviewed-by: Simon Glass sjg@chromium.org
diff --git a/doc/usage/cmd/smbios.rst b/doc/usage/cmd/smbios.rst new file mode 100644 index 0000000000..1ffd706d7d --- /dev/null +++ b/doc/usage/cmd/smbios.rst @@ -0,0 +1,93 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later:
+smbios command +==============
+Synopsis +--------
+::
smbios
+Description +-----------
+The smbios command displays information from the SMBIOS tables.
+Examples +--------
+The example below shows an example output of the smbios command.
+::
It doesn't matter, but can't that :: go on the previous line?
- => smbios
- SMBIOS 2.8.0 present.
- 8 structures occupying 81 bytes
- Table at 0x6d35018
- Handle 0x0100, DMI type 1, 27 bytes at 0x6d35018
- System Information
Manufacturer: QEMU
Product Name: Standard PC (i440FX + PIIX, 1996)
Version: pc-i440fx-2.5
Serial Number:
UUID 00000000-0000-0000-0000-000000000000
Wake Up Type:
Serial Number:
SKU Number:
- Handle 0x0300, DMI type 3, 22 bytes at 0x6d35069
- Header and Data:
00000000: 03 16 00 03 01 01 02 00 00 03 03 03 02 00 00 00
00000010: 00 00 00 00 00 00
- Strings:
String 1: QEMU
String 2: pc-i440fx-2.5
- Handle 0x0400, DMI type 4, 42 bytes at 0x6d35093
- Header and Data:
00000000: 04 2a 00 04 01 03 01 02 63 06 00 00 fd ab 81 07
00000010: 03 00 00 00 d0 07 d0 07 41 01 ff ff ff ff ff ff
00000020: 00 00 00 01 01 01 02 00 01 00
- Strings:
String 1: CPU 0
String 2: QEMU
String 3: pc-i440fx-2.5
- Handle 0x1000, DMI type 16, 23 bytes at 0x6d350d7
- Header and Data:
00000000: 10 17 00 10 01 03 06 00 00 02 00 fe ff 01 00 00
00000010: 00 00 00 00 00 00 00
- Handle 0x1100, DMI type 17, 40 bytes at 0x6d350f0
- Header and Data:
00000000: 11 28 00 11 00 10 fe ff ff ff ff ff 80 00 09 00
00000010: 01 00 07 02 00 00 00 02 00 00 00 00 00 00 00 00
00000020: 00 00 00 00 00 00 00 00
- Strings:
String 1: DIMM 0
String 2: QEMU
- Handle 0x1300, DMI type 19, 31 bytes at 0x6d35125
- Header and Data:
00000000: 13 1f 00 13 00 00 00 00 ff ff 01 00 00 10 01 00
00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- Handle 0x2000, DMI type 32, 11 bytes at 0x6d35146
- Header and Data:
00000000: 20 0b 00 20 00 00 00 00 00 00 00
- Handle 0x7f00, DMI type 127, 4 bytes at 0x6d35153
- End Of Table
+Configuration +-------------
+The command is only available if CONFIG_CMD_SMBIOS=y.
+Return value +------------
+The return value $? is 0 (true) on success, 1 (false) otherwise. diff --git a/doc/usage/index.rst b/doc/usage/index.rst index 1a626c03c2..eb2b2311f8 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -102,6 +102,7 @@ Shell commands cmd/size cmd/sleep cmd/sm
- cmd/smbios cmd/sound cmd/source cmd/temperature
-- 2.43.0
Regards, Simon

On Sat, 23 Dec 2023 at 02:57, Heinrich Schuchardt xypron.glpk@gmx.de wrote:
Provide a man-page for the smbios command.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
doc/usage/cmd/smbios.rst | 93 ++++++++++++++++++++++++++++++++++++++++ doc/usage/index.rst | 1 + 2 files changed, 94 insertions(+) create mode 100644 doc/usage/cmd/smbios.rst
diff --git a/doc/usage/cmd/smbios.rst b/doc/usage/cmd/smbios.rst new file mode 100644 index 0000000000..1ffd706d7d --- /dev/null +++ b/doc/usage/cmd/smbios.rst @@ -0,0 +1,93 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later:
+smbios command +==============
+Synopsis +--------
+::
smbios
+Description +-----------
+The smbios command displays information from the SMBIOS tables.
+Examples +--------
+The example below shows an example output of the smbios command.
+::
- => smbios
- SMBIOS 2.8.0 present.
- 8 structures occupying 81 bytes
- Table at 0x6d35018
- Handle 0x0100, DMI type 1, 27 bytes at 0x6d35018
- System Information
Manufacturer: QEMU
Product Name: Standard PC (i440FX + PIIX, 1996)
Version: pc-i440fx-2.5
Serial Number:
UUID 00000000-0000-0000-0000-000000000000
Wake Up Type:
Serial Number:
SKU Number:
- Handle 0x0300, DMI type 3, 22 bytes at 0x6d35069
- Header and Data:
00000000: 03 16 00 03 01 01 02 00 00 03 03 03 02 00 00 00
00000010: 00 00 00 00 00 00
- Strings:
String 1: QEMU
String 2: pc-i440fx-2.5
- Handle 0x0400, DMI type 4, 42 bytes at 0x6d35093
- Header and Data:
00000000: 04 2a 00 04 01 03 01 02 63 06 00 00 fd ab 81 07
00000010: 03 00 00 00 d0 07 d0 07 41 01 ff ff ff ff ff ff
00000020: 00 00 00 01 01 01 02 00 01 00
- Strings:
String 1: CPU 0
String 2: QEMU
String 3: pc-i440fx-2.5
- Handle 0x1000, DMI type 16, 23 bytes at 0x6d350d7
- Header and Data:
00000000: 10 17 00 10 01 03 06 00 00 02 00 fe ff 01 00 00
00000010: 00 00 00 00 00 00 00
- Handle 0x1100, DMI type 17, 40 bytes at 0x6d350f0
- Header and Data:
00000000: 11 28 00 11 00 10 fe ff ff ff ff ff 80 00 09 00
00000010: 01 00 07 02 00 00 00 02 00 00 00 00 00 00 00 00
00000020: 00 00 00 00 00 00 00 00
- Strings:
String 1: DIMM 0
String 2: QEMU
- Handle 0x1300, DMI type 19, 31 bytes at 0x6d35125
- Header and Data:
00000000: 13 1f 00 13 00 00 00 00 ff ff 01 00 00 10 01 00
00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- Handle 0x2000, DMI type 32, 11 bytes at 0x6d35146
- Header and Data:
00000000: 20 0b 00 20 00 00 00 00 00 00 00
- Handle 0x7f00, DMI type 127, 4 bytes at 0x6d35153
- End Of Table
+Configuration +-------------
+The command is only available if CONFIG_CMD_SMBIOS=y.
+Return value +------------
+The return value $? is 0 (true) on success, 1 (false) otherwise. diff --git a/doc/usage/index.rst b/doc/usage/index.rst index 1a626c03c2..eb2b2311f8 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -102,6 +102,7 @@ Shell commands cmd/size cmd/sleep cmd/sm
- cmd/smbios cmd/sound cmd/source cmd/temperature
-- 2.43.0
Reviewed-by: Ilias Apalodimas ilias.apalodimas@linaro.org

Provide a unit test for the smbios command.
Provide different test functions for QEMU, sandbox, and other systems.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de --- test/py/tests/test_smbios.py | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 test/py/tests/test_smbios.py
diff --git a/test/py/tests/test_smbios.py b/test/py/tests/test_smbios.py new file mode 100644 index 0000000000..86d8d07539 --- /dev/null +++ b/test/py/tests/test_smbios.py @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +"""Test smbios command""" + +import pytest + +@pytest.mark.buildconfigspec('cmd_smbios') +@pytest.mark.notbuildconfigspec('qfw_smbios') +@pytest.mark.notbuildconfigspec('sandbox') +def test_cmd_smbios(u_boot_console): + """Run the smbios command""" + output = u_boot_console.run_command('smbios') + assert 'DMI type 0,' in output + assert 'String 1: U-Boot' in output + assert 'DMI type 1,' in output + assert 'DMI type 2,' in output + assert 'DMI type 3,' in output + assert 'DMI type 4,' in output + assert 'DMI type 127,' in output + +@pytest.mark.buildconfigspec('cmd_smbios') +@pytest.mark.buildconfigspec('qfw_smbios') +@pytest.mark.notbuildconfigspec('sandbox') +# TODO: +# QEMU v8.2.0 lacks SMBIOS support for RISC-V +# Once support is available in our Docker image we can remove the constraint. +@pytest.mark.notbuildconfigspec('riscv') +def test_cmd_smbios_qemu(u_boot_console): + """Run the smbios command on QEMU""" + output = u_boot_console.run_command('smbios') + assert 'DMI type 1,' in output + assert 'Manufacturer: QEMU' in output + assert 'DMI type 127,' in output + +@pytest.mark.buildconfigspec('cmd_smbios') +@pytest.mark.buildconfigspec('sandbox') +def test_cmd_smbios_sandbox(u_boot_console): + """Run the smbios command on the sandbox""" + output = u_boot_console.run_command('smbios') + assert 'DMI type 0,' in output + assert 'String 1: U-Boot' in output + assert 'DMI type 1,' in output + assert 'Manufacturer: sandbox' in output + assert 'DMI type 2,' in output + assert 'DMI type 3,' in output + assert 'DMI type 4,' in output + assert 'DMI type 127,' in output -- 2.43.0

Hi Heinrich,
On Sat, Dec 23, 2023 at 12:49 AM Heinrich Schuchardt xypron.glpk@gmx.de wrote:
Provide a unit test for the smbios command.
Provide different test functions for QEMU, sandbox, and other systems.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
test/py/tests/test_smbios.py | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 test/py/tests/test_smbios.py
Can you please write this test in C?
Regards, Simon

On 12/26/23 10:47, Simon Glass wrote:
Hi Heinrich,
On Sat, Dec 23, 2023 at 12:49 AM Heinrich Schuchardt xypron.glpk@gmx.de wrote:
Provide a unit test for the smbios command.
Provide different test functions for QEMU, sandbox, and other systems.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
test/py/tests/test_smbios.py | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 test/py/tests/test_smbios.py
Can you please write this test in C?
Regards, Simon
According to our documentation we can use either Python or C tests. We generally use Python tests for testing the CLI.
I cannot see any benefit in trying to write this in C.
Best regards
Heinrich

Hi Heinrich,
On Tue, Dec 26, 2023 at 10:11 AM Heinrich Schuchardt xypron.glpk@gmx.de wrote:
On 12/26/23 10:47, Simon Glass wrote:
Hi Heinrich,
On Sat, Dec 23, 2023 at 12:49 AM Heinrich Schuchardt xypron.glpk@gmx.de wrote:
Provide a unit test for the smbios command.
Provide different test functions for QEMU, sandbox, and other systems.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
test/py/tests/test_smbios.py | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 test/py/tests/test_smbios.py
Can you please write this test in C?
Regards, Simon
According to our documentation we can use either Python or C tests. We generally use Python tests for testing the CLI.
Not really...there are lots of C tests for the CLI. It is actually easier to code, in most cases.
I cannot see any benefit in trying to write this in C.
I did go to some effort to document this:
https://docs.u-boot.org/en/latest/develop/tests_writing.html#test-types
Regards, Simon

Am 27. Dezember 2023 08:40:40 MEZ schrieb Simon Glass sjg@chromium.org:
Hi Heinrich,
On Tue, Dec 26, 2023 at 10:11 AM Heinrich Schuchardt xypron.glpk@gmx.de wrote:
On 12/26/23 10:47, Simon Glass wrote:
Hi Heinrich,
On Sat, Dec 23, 2023 at 12:49 AM Heinrich Schuchardt xypron.glpk@gmx.de wrote:
Provide a unit test for the smbios command.
Provide different test functions for QEMU, sandbox, and other systems.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
test/py/tests/test_smbios.py | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 test/py/tests/test_smbios.py
Can you please write this test in C?
Regards, Simon
According to our documentation we can use either Python or C tests. We generally use Python tests for testing the CLI.
Not really...there are lots of C tests for the CLI. It is actually easier to code, in most cases.
I cannot see any benefit in trying to write this in C.
I did go to some effort to document this:
https://docs.u-boot.org/en/latest/develop/tests_writing.html#test-types
As described in that document C is most adequate for testing on the sandbox. I want to run this test on QEMU and real boards with release U-Boot firmware, i.e. without deviating configuration.
Best regards
Heinrich
Regards, Simon

On Thu, Dec 28, 2023 at 06:06:23PM +0100, Heinrich Schuchardt wrote:
Am 27. Dezember 2023 08:40:40 MEZ schrieb Simon Glass sjg@chromium.org:
Hi Heinrich,
On Tue, Dec 26, 2023 at 10:11 AM Heinrich Schuchardt xypron.glpk@gmx.de wrote:
On 12/26/23 10:47, Simon Glass wrote:
Hi Heinrich,
On Sat, Dec 23, 2023 at 12:49 AM Heinrich Schuchardt xypron.glpk@gmx.de wrote:
Provide a unit test for the smbios command.
Provide different test functions for QEMU, sandbox, and other systems.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
test/py/tests/test_smbios.py | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 test/py/tests/test_smbios.py
Can you please write this test in C?
Regards, Simon
According to our documentation we can use either Python or C tests. We generally use Python tests for testing the CLI.
Not really...there are lots of C tests for the CLI. It is actually easier to code, in most cases.
I cannot see any benefit in trying to write this in C.
I did go to some effort to document this:
https://docs.u-boot.org/en/latest/develop/tests_writing.html#test-types
As described in that document C is most adequate for testing on the sandbox. I want to run this test on QEMU and real boards with release U-Boot firmware, i.e. without deviating configuration.
The important part is that we have a test. And I really don't want to re-read too much of that doc right now as I feel like it gets things a bit wrong.

Hi Heinrich,
On Thu, Dec 28, 2023 at 5:11 PM Heinrich Schuchardt xypron.glpk@gmx.de wrote:
Am 27. Dezember 2023 08:40:40 MEZ schrieb Simon Glass sjg@chromium.org:
Hi Heinrich,
On Tue, Dec 26, 2023 at 10:11 AM Heinrich Schuchardt xypron.glpk@gmx.de wrote:
On 12/26/23 10:47, Simon Glass wrote:
Hi Heinrich,
On Sat, Dec 23, 2023 at 12:49 AM Heinrich Schuchardt xypron.glpk@gmx.de wrote:
Provide a unit test for the smbios command.
Provide different test functions for QEMU, sandbox, and other systems.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
test/py/tests/test_smbios.py | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 test/py/tests/test_smbios.py
Can you please write this test in C?
Regards, Simon
According to our documentation we can use either Python or C tests. We generally use Python tests for testing the CLI.
Not really...there are lots of C tests for the CLI. It is actually easier to code, in most cases.
I cannot see any benefit in trying to write this in C.
I did go to some effort to document this:
https://docs.u-boot.org/en/latest/develop/tests_writing.html#test-types
As described in that document C is most adequate for testing on the sandbox. I want to run this test on QEMU and real boards with release U-Boot firmware, i.e. without deviating configuration.
Are you checking that the compiler works? Most such tests are a waste of time, IMO. Anyway, any test is better than no test, as Tom says, so:
Reviewed-by: Simon Glass sjg@chromium.org
Regards, SImon

On Sat, Dec 23, 2023 at 01:44:29AM +0100, Heinrich Schuchardt wrote:
Provide a unit test for the smbios command.
Provide different test functions for QEMU, sandbox, and other systems.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
test/py/tests/test_smbios.py | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 test/py/tests/test_smbios.py
diff --git a/test/py/tests/test_smbios.py b/test/py/tests/test_smbios.py new file mode 100644 index 0000000000..86d8d07539 --- /dev/null +++ b/test/py/tests/test_smbios.py @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: GPL-2.0-or-later
+"""Test smbios command"""
+import pytest
+@pytest.mark.buildconfigspec('cmd_smbios') +@pytest.mark.notbuildconfigspec('qfw_smbios') +@pytest.mark.notbuildconfigspec('sandbox') +def test_cmd_smbios(u_boot_console):
- """Run the smbios command"""
- output = u_boot_console.run_command('smbios')
- assert 'DMI type 0,' in output
- assert 'String 1: U-Boot' in output
- assert 'DMI type 1,' in output
- assert 'DMI type 2,' in output
- assert 'DMI type 3,' in output
- assert 'DMI type 4,' in output
- assert 'DMI type 127,' in output
+@pytest.mark.buildconfigspec('cmd_smbios') +@pytest.mark.buildconfigspec('qfw_smbios') +@pytest.mark.notbuildconfigspec('sandbox') +# TODO: +# QEMU v8.2.0 lacks SMBIOS support for RISC-V +# Once support is available in our Docker image we can remove the constraint. +@pytest.mark.notbuildconfigspec('riscv') +def test_cmd_smbios_qemu(u_boot_console):
- """Run the smbios command on QEMU"""
- output = u_boot_console.run_command('smbios')
- assert 'DMI type 1,' in output
- assert 'Manufacturer: QEMU' in output
- assert 'DMI type 127,' in output
+@pytest.mark.buildconfigspec('cmd_smbios') +@pytest.mark.buildconfigspec('sandbox') +def test_cmd_smbios_sandbox(u_boot_console):
- """Run the smbios command on the sandbox"""
- output = u_boot_console.run_command('smbios')
- assert 'DMI type 0,' in output
- assert 'String 1: U-Boot' in output
- assert 'DMI type 1,' in output
- assert 'Manufacturer: sandbox' in output
- assert 'DMI type 2,' in output
- assert 'DMI type 3,' in output
- assert 'DMI type 4,' in output
- assert 'DMI type 127,' in output
-- 2.43.0
Acked-by: Ilias Apalodimas ilias.apalodimas@linaro.org

On Sat, Dec 23, 2023 at 01:44:29AM +0100, Heinrich Schuchardt wrote:
Provide a unit test for the smbios command.
Provide different test functions for QEMU, sandbox, and other systems.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de Acked-by: Ilias Apalodimas ilias.apalodimas@linaro.org Reviewed-by: Simon Glass sjg@chromium.org
test/py/tests/test_smbios.py | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 test/py/tests/test_smbios.py
-- 2.43.0
diff --git a/test/py/tests/test_smbios.py b/test/py/tests/test_smbios.py new file mode 100644 index 0000000000..86d8d07539 --- /dev/null +++ b/test/py/tests/test_smbios.py @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: GPL-2.0-or-later
+"""Test smbios command"""
+import pytest
+@pytest.mark.buildconfigspec('cmd_smbios') +@pytest.mark.notbuildconfigspec('qfw_smbios') +@pytest.mark.notbuildconfigspec('sandbox') +def test_cmd_smbios(u_boot_console):
- """Run the smbios command"""
- output = u_boot_console.run_command('smbios')
- assert 'DMI type 0,' in output
- assert 'String 1: U-Boot' in output
- assert 'DMI type 1,' in output
- assert 'DMI type 2,' in output
- assert 'DMI type 3,' in output
- assert 'DMI type 4,' in output
- assert 'DMI type 127,' in output
+@pytest.mark.buildconfigspec('cmd_smbios') +@pytest.mark.buildconfigspec('qfw_smbios') +@pytest.mark.notbuildconfigspec('sandbox') +# TODO: +# QEMU v8.2.0 lacks SMBIOS support for RISC-V +# Once support is available in our Docker image we can remove the constraint. +@pytest.mark.notbuildconfigspec('riscv') +def test_cmd_smbios_qemu(u_boot_console):
- """Run the smbios command on QEMU"""
- output = u_boot_console.run_command('smbios')
- assert 'DMI type 1,' in output
- assert 'Manufacturer: QEMU' in output
- assert 'DMI type 127,' in output
+@pytest.mark.buildconfigspec('cmd_smbios') +@pytest.mark.buildconfigspec('sandbox') +def test_cmd_smbios_sandbox(u_boot_console):
- """Run the smbios command on the sandbox"""
- output = u_boot_console.run_command('smbios')
- assert 'DMI type 0,' in output
- assert 'String 1: U-Boot' in output
- assert 'DMI type 1,' in output
- assert 'Manufacturer: sandbox' in output
- assert 'DMI type 2,' in output
- assert 'DMI type 3,' in output
- assert 'DMI type 4,' in output
- assert 'DMI type 127,' in output
This fails on coreboot: https://source.denx.de/u-boot/u-boot/-/jobs/771654
participants (5)
-
Heinrich Schuchardt
-
Ilias Apalodimas
-
Peter Robinson
-
Simon Glass
-
Tom Rini