소스 검색

[smbios] Expose board serial number as ${board-serial}

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>
tags/v1.20.1
Dale Hamel 10 년 전
부모
커밋
7fe0735170
2개의 변경된 파일29개의 추가작업 그리고 0개의 파일을 삭제
  1. 17
    0
      src/include/ipxe/smbios.h
  2. 12
    0
      src/interface/smbios/smbios_settings.c

+ 17
- 0
src/include/ipxe/smbios.h 파일 보기

116
 /** SMBIOS system information structure type */
116
 /** SMBIOS system information structure type */
117
 #define SMBIOS_TYPE_SYSTEM_INFORMATION 1
117
 #define SMBIOS_TYPE_SYSTEM_INFORMATION 1
118
 
118
 
119
+/** SMBIOS base board information structure */
120
+struct smbios_base_board_information {
121
+	/** SMBIOS structure header */
122
+	struct smbios_header header;
123
+	/** Manufacturer string */
124
+	uint8_t manufacturer;
125
+	/** Product string */
126
+	uint8_t product;
127
+	/** Version string */
128
+	uint8_t version;
129
+	/** Serial number string */
130
+	uint8_t serial;
131
+} __attribute__ (( packed ));
132
+
133
+/** SMBIOS base board information structure type */
134
+#define SMBIOS_TYPE_BASE_BOARD_INFORMATION 2
135
+
119
 /** SMBIOS enclosure information structure */
136
 /** SMBIOS enclosure information structure */
120
 struct smbios_enclosure_information {
137
 struct smbios_enclosure_information {
121
 	/** SMBIOS structure header */
138
 	/** SMBIOS structure header */

+ 12
- 0
src/interface/smbios/smbios_settings.c 파일 보기

241
 	.type = &setting_type_string,
241
 	.type = &setting_type_string,
242
 	.scope = &smbios_settings_scope,
242
 	.scope = &smbios_settings_scope,
243
 };
243
 };
244
+
245
+/** Board serial number setting (may differ from chassis serial number) */
246
+const struct setting board_serial_setting __setting ( SETTING_HOST_EXTRA,
247
+						      board_serial ) = {
248
+	.name = "board-serial",
249
+	.description = "Base board serial",
250
+	.tag = SMBIOS_STRING_TAG ( SMBIOS_TYPE_BASE_BOARD_INFORMATION,
251
+				   struct smbios_base_board_information,
252
+				   serial ),
253
+	.type = &setting_type_string,
254
+	.scope = &smbios_settings_scope,
255
+};

Loading…
취소
저장