]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[smbios] Expose board serial number as ${board-serial}
authorDale Hamel <dale.hamel@srvthe.net>
Mon, 10 Mar 2014 22:48:37 +0000 (18:48 -0400)
committerMichael Brown <mcb30@ipxe.org>
Thu, 12 Jun 2014 16:59:52 +0000 (17:59 +0100)
With blade servers, the chassis serial number (exposed via ${serial})
may not be unique.  Expose ${board-serial} as a named setting to
provide easy access to a more meaningful serial number.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/ipxe/smbios.h
src/interface/smbios/smbios_settings.c

index 1a34ac04c63d5a7ee9d3e15c9ffd6d15fccf2366..ef5892a214c13ac3758f24711821226d6736f623 100644 (file)
@@ -116,6 +116,23 @@ struct smbios_system_information {
 /** SMBIOS system information structure type */
 #define SMBIOS_TYPE_SYSTEM_INFORMATION 1
 
+/** SMBIOS base board information structure */
+struct smbios_base_board_information {
+       /** SMBIOS structure header */
+       struct smbios_header header;
+       /** Manufacturer string */
+       uint8_t manufacturer;
+       /** Product string */
+       uint8_t product;
+       /** Version string */
+       uint8_t version;
+       /** Serial number string */
+       uint8_t serial;
+} __attribute__ (( packed ));
+
+/** SMBIOS base board information structure type */
+#define SMBIOS_TYPE_BASE_BOARD_INFORMATION 2
+
 /** SMBIOS enclosure information structure */
 struct smbios_enclosure_information {
        /** SMBIOS structure header */
index 5dcf00201a98a90c723f2b1ec7f3027797ff2d30..83e4320e9ea7871d111937e487ff7ba5743815c3 100644 (file)
@@ -241,3 +241,15 @@ const struct setting asset_setting __setting ( SETTING_HOST_EXTRA, asset ) = {
        .type = &setting_type_string,
        .scope = &smbios_settings_scope,
 };
+
+/** Board serial number setting (may differ from chassis serial number) */
+const struct setting board_serial_setting __setting ( SETTING_HOST_EXTRA,
+                                                     board_serial ) = {
+       .name = "board-serial",
+       .description = "Base board serial",
+       .tag = SMBIOS_STRING_TAG ( SMBIOS_TYPE_BASE_BOARD_INFORMATION,
+                                  struct smbios_base_board_information,
+                                  serial ),
+       .type = &setting_type_string,
+       .scope = &smbios_settings_scope,
+};