Skip to content

Commit

Permalink
dmi: add system-serial-number, sku; ignore a few more placeholders
Browse files Browse the repository at this point in the history
Signed-off-by: Burt P <pburt0@gmail.com>
  • Loading branch information
bp0 authored and lpereira committed Dec 3, 2018
1 parent 4afc76f commit 54ece20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion hardinfo/dmi_util.c
Expand Up @@ -31,13 +31,19 @@ static int ignore_placeholder_strings(gchar **pstr) {
return -1;
#define DMI_IGNORE(m) if (strcasecmp(m, *pstr) == 0) { g_free(chk); g_free(*pstr); *pstr = NULL; return 1; }
DMI_IGNORE("To be filled by O.E.M.");
DMI_IGNORE("Default String");
DMI_IGNORE("System Product Name");
DMI_IGNORE("System Manufacturer");
DMI_IGNORE("System Version");
DMI_IGNORE("Default String");
DMI_IGNORE("System Serial Number");
DMI_IGNORE("Rev X.0x"); /* ASUS board version nonsense */
DMI_IGNORE("x.x"); /* Gigabyte board version nonsense */
DMI_IGNORE("NA");
DMI_IGNORE("SKU");

/* noticed on an HP x360 */
DMI_IGNORE("Type2 - Board Asset Tag");
DMI_IGNORE("Type1ProductConfigId");

/* Zotac version nonsense */
p = chk;
Expand Down Expand Up @@ -113,6 +119,7 @@ char *dmi_get_str_abs(const char *id_str) {
{ "system-product-family", "id/product_family" },
{ "system-version", "id/product_version" },
{ "system-uuid", "product_uuid" },
{ "system-sku", "id/product_sku" }, /*dmidecode doesn't actually support this one*/
{ "chassis-type", "id/chassis_type" },
{ "chassis-serial-number", "id/chassis_serial" },
{ "chassis-manufacturer", "id/chassis_vendor" },
Expand Down
2 changes: 2 additions & 0 deletions modules/devices/dmi.c
Expand Up @@ -38,6 +38,8 @@ DMIInfo dmi_info_table[] = {
{ N_("Family"), "system-product-family", 0 },
{ N_("Vendor"), "system-manufacturer", 0 },
{ N_("Version"), "system-version", 0 },
{ N_("Serial Number"), "system-serial-number", 0 },
{ N_("SKU"), "system-sku", 0 },
{ N_("BIOS"), NULL, 1 },
{ N_("Date"), "bios-release-date", 0 },
{ N_("Vendor"), "bios-vendor", 0 },
Expand Down

0 comments on commit 54ece20

Please sign in to comment.