@@ -1333,6 +1333,12 @@ static int get_sysinfo(struct platform *p, struct system_info *sysinfo)
sysinfo->type = talloc_steal(sysinfo, buf);
talloc_free(filename);
+ filename = talloc_asprintf(platform, "%smodel-name", devtree_dir);
+ rc = read_file(platform, filename, &buf, &len);
+ if (rc == 0)
+ sysinfo->name = talloc_steal(sysinfo, buf);
+ talloc_free(filename);
+
filename = talloc_asprintf(platform, "%ssystem-id", devtree_dir);
rc = read_file(platform, filename, &buf, &len);
if (rc == 0)
@@ -246,6 +246,7 @@ int pb_protocol_system_info_len(const struct system_info *sysinfo)
unsigned int len, i;
len = 4 + optional_strlen(sysinfo->type) +
+ 4 + optional_strlen(sysinfo->name) +
4 + optional_strlen(sysinfo->identifier) +
4 + 4;
@@ -495,6 +496,7 @@ int pb_protocol_serialise_system_info(const struct system_info *sysinfo,
unsigned int i;
pos += pb_protocol_serialise_string(pos, sysinfo->type);
+ pos += pb_protocol_serialise_string(pos, sysinfo->name);
pos += pb_protocol_serialise_string(pos, sysinfo->identifier);
*(uint32_t *)pos = __cpu_to_be32(sysinfo->n_primary);
@@ -1012,10 +1014,13 @@ int pb_protocol_deserialise_system_info(struct system_info *sysinfo,
len = message->payload_len;
pos = message->payload;
- /* type and identifier strings */
+ /* type, name, and identifier strings */
if (read_string(sysinfo, &pos, &len, &sysinfo->type))
goto out;
+ if (read_string(sysinfo, &pos, &len, &sysinfo->name))
+ goto out;
+
if (read_string(sysinfo, &pos, &len, &sysinfo->identifier))
goto out;
@@ -133,6 +133,7 @@ struct firmware_version {
struct system_info {
char *type;
+ char *name;
char *identifier;
struct firmware_version *platform_primary;
@@ -64,6 +64,7 @@ static void sysinfo_screen_populate(struct sysinfo_screen *screen,
line("%-12s %s", _("System type:"), sysinfo->type ?: "");
line("%-12s %s", _("System id:"), sysinfo->identifier ?: "");
+ line("%-12s %s", _("System name:"), sysinfo->name ?: "");
if (sysinfo->n_primary) {
line(NULL);
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> --- discover/platform-powerpc.c | 6 ++++++ lib/pb-protocol/pb-protocol.c | 7 ++++++- lib/types/types.h | 1 + ui/ncurses/nc-sysinfo.c | 1 + 4 files changed, 14 insertions(+), 1 deletion(-)