diff options
author | Sam Mendoza-Jonas <sam@mendozajonas.com> | 2016-01-29 15:16:34 +1100 |
---|---|---|
committer | Sam Mendoza-Jonas <sam@mendozajonas.com> | 2016-02-10 16:21:08 +1100 |
commit | d531395a3ff60730238854b127925978f6eab289 (patch) | |
tree | e2dcc3ec892e43c0a3a2f5f03020a85f7fda7a31 /lib/pb-protocol | |
parent | d974c3c39237c8e94bb3a51d3511d18dea01043e (diff) | |
download | petitboot-d531395a3ff60730238854b127925978f6eab289.zip petitboot-d531395a3ff60730238854b127925978f6eab289.tar.gz |
Retrieve BMC version info via IPMI
On BMC machines the "Get Device ID" and "Get BMC Golden Side Version"
IPMI commands are available. If possible retrieve some interesting
version numbers and display them in the System Information screen.
Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'lib/pb-protocol')
-rw-r--r-- | lib/pb-protocol/pb-protocol.c | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/lib/pb-protocol/pb-protocol.c b/lib/pb-protocol/pb-protocol.c index e99ce86..3953ee1 100644 --- a/lib/pb-protocol/pb-protocol.c +++ b/lib/pb-protocol/pb-protocol.c @@ -232,6 +232,13 @@ int pb_protocol_system_info_len(const struct system_info *sysinfo) for (i = 0; i < sysinfo->n_other; i++) len += 4 + optional_strlen(sysinfo->platform_other[i]); + len += 4; + for (i = 0; i < sysinfo->n_bmc_current; i++) + len += 4 + optional_strlen(sysinfo->bmc_current[i]); + len += 4; + for (i = 0; i < sysinfo->n_bmc_golden; i++) + len += 4 + optional_strlen(sysinfo->bmc_golden[i]); + for (i = 0; i < sysinfo->n_interfaces; i++) { struct interface_info *if_info = sysinfo->interfaces[i]; len += 4 + if_info->hwaddr_size + @@ -412,6 +419,16 @@ int pb_protocol_serialise_system_info(const struct system_info *sysinfo, for (i = 0; i < sysinfo->n_other; i++) pos += pb_protocol_serialise_string(pos, sysinfo->platform_other[i]); + *(uint32_t *)pos = __cpu_to_be32(sysinfo->n_bmc_current); + pos += sizeof(uint32_t); + for (i = 0; i < sysinfo->n_bmc_current; i++) + pos += pb_protocol_serialise_string(pos, sysinfo->bmc_current[i]); + + *(uint32_t *)pos = __cpu_to_be32(sysinfo->n_bmc_golden); + pos += sizeof(uint32_t); + for (i = 0; i < sysinfo->n_bmc_golden; i++) + pos += pb_protocol_serialise_string(pos, sysinfo->bmc_golden[i]); + *(uint32_t *)pos = __cpu_to_be32(sysinfo->n_interfaces); pos += sizeof(uint32_t); @@ -827,7 +844,7 @@ int pb_protocol_deserialise_system_info(struct system_info *sysinfo, if (read_string(sysinfo, &pos, &len, &sysinfo->identifier)) goto out; - /* versions strings for openpower platforms */ + /* Platform version strings for openpower platforms */ if (read_u32(&pos, &len, &sysinfo->n_current)) goto out; sysinfo->platform_current = talloc_array(sysinfo, char *, @@ -848,6 +865,27 @@ int pb_protocol_deserialise_system_info(struct system_info *sysinfo, sysinfo->platform_other[i] = talloc_strdup(sysinfo, tmp); } + /* BMC version strings for openpower platforms */ + if (read_u32(&pos, &len, &sysinfo->n_bmc_current)) + goto out; + sysinfo->bmc_current = talloc_array(sysinfo, char *, + sysinfo->n_bmc_current); + for (i = 0; i < sysinfo->n_bmc_current; i++) { + if (read_string(sysinfo, &pos, &len, &tmp)) + goto out; + sysinfo->bmc_current[i] = talloc_strdup(sysinfo, tmp); + } + + if (read_u32(&pos, &len, &sysinfo->n_bmc_golden)) + goto out; + sysinfo->bmc_golden = talloc_array(sysinfo, char *, + sysinfo->n_bmc_golden); + for (i = 0; i < sysinfo->n_bmc_golden; i++) { + if (read_string(sysinfo, &pos, &len, &tmp)) + goto out; + sysinfo->bmc_golden[i] = talloc_strdup(sysinfo, tmp); + } + /* number of interfaces */ if (read_u32(&pos, &len, &sysinfo->n_interfaces)) goto out; |