summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSam Mendoza-Jonas <sam@mendozajonas.com>2016-02-26 10:39:55 +1100
committerSam Mendoza-Jonas <sam@mendozajonas.com>2016-02-26 12:39:37 +1100
commit72928ed32ab3684be74e4a3b90329dee7cfa6bbb (patch)
tree27a1237cee90d222e0dc7b0e361e4c683270ec57 /lib
parent11284780b9aa525dd659bd85d6374040630db008 (diff)
downloadtalos-petitboot-72928ed32ab3684be74e4a3b90329dee7cfa6bbb.tar.gz
talos-petitboot-72928ed32ab3684be74e4a3b90329dee7cfa6bbb.zip
Use 'Primary' instead of 'Current' for flash sides
When queried libflash will return the 'first' flash side (ie. the one with the lowest TOC address), however we label this the 'Current' side which is incorrect if the machine has booted from the alternate side. A future fix will inlcude additional platform logic to determine which flash side is current; in the interim label the first flash side as 'Primary' instead of 'Current'. Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/pb-protocol/pb-protocol.c20
-rw-r--r--lib/types/types.h4
2 files changed, 12 insertions, 12 deletions
diff --git a/lib/pb-protocol/pb-protocol.c b/lib/pb-protocol/pb-protocol.c
index 3953ee1..9091709 100644
--- a/lib/pb-protocol/pb-protocol.c
+++ b/lib/pb-protocol/pb-protocol.c
@@ -226,8 +226,8 @@ int pb_protocol_system_info_len(const struct system_info *sysinfo)
4 + 4;
len += 4;
- for (i = 0; i < sysinfo->n_current; i++)
- len += 4 + optional_strlen(sysinfo->platform_current[i]);
+ for (i = 0; i < sysinfo->n_primary; i++)
+ len += 4 + optional_strlen(sysinfo->platform_primary[i]);
len += 4;
for (i = 0; i < sysinfo->n_other; i++)
len += 4 + optional_strlen(sysinfo->platform_other[i]);
@@ -409,10 +409,10 @@ int pb_protocol_serialise_system_info(const struct system_info *sysinfo,
pos += pb_protocol_serialise_string(pos, sysinfo->type);
pos += pb_protocol_serialise_string(pos, sysinfo->identifier);
- *(uint32_t *)pos = __cpu_to_be32(sysinfo->n_current);
+ *(uint32_t *)pos = __cpu_to_be32(sysinfo->n_primary);
pos += sizeof(uint32_t);
- for (i = 0; i < sysinfo->n_current; i++)
- pos += pb_protocol_serialise_string(pos, sysinfo->platform_current[i]);
+ for (i = 0; i < sysinfo->n_primary; i++)
+ pos += pb_protocol_serialise_string(pos, sysinfo->platform_primary[i]);
*(uint32_t *)pos = __cpu_to_be32(sysinfo->n_other);
pos += sizeof(uint32_t);
@@ -845,14 +845,14 @@ int pb_protocol_deserialise_system_info(struct system_info *sysinfo,
goto out;
/* Platform version strings for openpower platforms */
- if (read_u32(&pos, &len, &sysinfo->n_current))
+ if (read_u32(&pos, &len, &sysinfo->n_primary))
goto out;
- sysinfo->platform_current = talloc_array(sysinfo, char *,
- sysinfo->n_current);
- for (i = 0; i < sysinfo->n_current; i++) {
+ sysinfo->platform_primary = talloc_array(sysinfo, char *,
+ sysinfo->n_primary);
+ for (i = 0; i < sysinfo->n_primary; i++) {
if (read_string(sysinfo, &pos, &len, &tmp))
goto out;
- sysinfo->platform_current[i] = talloc_strdup(sysinfo, tmp);
+ sysinfo->platform_primary[i] = talloc_strdup(sysinfo, tmp);
}
if (read_u32(&pos, &len, &sysinfo->n_other))
diff --git a/lib/types/types.h b/lib/types/types.h
index 63c1c7c..6ff4620 100644
--- a/lib/types/types.h
+++ b/lib/types/types.h
@@ -93,9 +93,9 @@ struct blockdev_info {
struct system_info {
char *type;
char *identifier;
- char **platform_current;
+ char **platform_primary;
char **platform_other;
- unsigned int n_current;
+ unsigned int n_primary;
unsigned int n_other;
char **bmc_current;
char **bmc_golden;
OpenPOWER on IntegriCloud