From bf38f89f99de8c6becfd040e511373a0835766d0 Mon Sep 17 00:00:00 2001 From: "Stephen J. Kiernan" Date: Wed, 10 Aug 2016 18:23:23 +0000 Subject: [PATCH] Add kernel environment variables under smbios.system for the following SMBIOS Type 1 fields: smbios.system.sku - SKU Number (SMBIOS 2.4 and above) smbios.system.family - Family (SMBIOS 2.4 and above) Add kernel environment variables under smbios.planar for the following SMBIOS Type 2 fields: smbios.planar.tag - Asset Tag smbios.planar.location - Location in Chassis Reviewed by: jhb, grembo Approved by: sjg (mentor) MFC after: 2 weeks Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D7453 --- sys/boot/i386/libi386/smbios.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/boot/i386/libi386/smbios.c b/sys/boot/i386/libi386/smbios.c index 7a7ce4ba4f56..4a8f3bc4ef08 100644 --- a/sys/boot/i386/libi386/smbios.c +++ b/sys/boot/i386/libi386/smbios.c @@ -238,6 +238,10 @@ smbios_parse_table(const caddr_t addr) smbios_setenv("smbios.system.serial", addr, 0x07); smbios_setuuid("smbios.system.uuid", addr + 0x08, smbios.ver); #endif + if (smbios.major >= 2 && smbios.minor >= 4) { + smbios_setenv("smbios.system.sku", addr, 0x19); + smbios_setenv("smbios.system.family", addr, 0x1a); + } break; case 2: /* 3.3.3 Base Board (or Module) Information (Type 2) */ @@ -246,7 +250,9 @@ smbios_parse_table(const caddr_t addr) smbios_setenv("smbios.planar.version", addr, 0x06); #ifdef SMBIOS_SERIAL_NUMBERS smbios_setenv("smbios.planar.serial", addr, 0x07); + smbios_setenv("smbios.planar.tag", addr, 0x08); #endif + smbios_setenv("smbios.planar.location", addr, 0x0a); break; case 3: /* 3.3.4 System Enclosure or Chassis (Type 3) */