]> git.ozlabs.org Git - petitboot/blobdiff - ui/ncurses/nc-sysinfo.c
Display VERSION partition info on BMC machines
[petitboot] / ui / ncurses / nc-sysinfo.c
index bde8b331ce2b05fbe9ced376f5736fd31a78226f..c01b35275ea6572bb0ad481673321f8712f124db 100644 (file)
@@ -51,6 +51,7 @@ static void if_info_mac_str(struct interface_info *info,
 static void sysinfo_screen_populate(struct sysinfo_screen *screen,
                const struct system_info *sysinfo)
 {
+       char macbuf[32];
        unsigned int i;
 
        text_screen_clear(&screen->text_scr);
@@ -64,6 +65,22 @@ static void sysinfo_screen_populate(struct sysinfo_screen *screen,
        line("%-12s %s", _("System type:"), sysinfo->type ?: "");
        line("%-12s %s", _("System id:"),   sysinfo->identifier ?: "");
 
+       if (sysinfo->n_current) {
+               line(NULL);
+               line("%s", _("Current platform versions:"));
+               for (i = 0; i < sysinfo->n_current; i++) {
+                       line("\t%s", sysinfo->platform_current[i] ?: "");
+               }
+       }
+
+       if (sysinfo->n_other) {
+               line(NULL);
+               line("%s", _("Alternate platform versions:"));
+               for (i = 0; i < sysinfo->n_other; i++) {
+                       line("\t%s", sysinfo->platform_other[i] ?: "");
+               }
+       }
+
        if (sysinfo->n_blockdevs) {
                line(NULL);
                line(_("Storage devices"));
@@ -78,6 +95,12 @@ static void sysinfo_screen_populate(struct sysinfo_screen *screen,
                line(NULL);
        }
 
+       if (sysinfo->bmc_mac) {
+               mac_str(sysinfo->bmc_mac, HWADDR_SIZE, macbuf, sizeof(macbuf));
+               line(_("Management (BMC) interface"));
+               line(_(" MAC:  %s"), macbuf);
+       }
+
        if (sysinfo->n_interfaces) {
                line(NULL);
                line(_("Network interfaces"));
@@ -85,7 +108,6 @@ static void sysinfo_screen_populate(struct sysinfo_screen *screen,
 
        for (i = 0; i < sysinfo->n_interfaces; i++) {
                struct interface_info *info = sysinfo->interfaces[i];
-               char macbuf[32];
 
                if_info_mac_str(info, macbuf, sizeof(macbuf));
 
@@ -104,7 +126,11 @@ void sysinfo_screen_update(struct sysinfo_screen *screen,
                const struct system_info *sysinfo)
 {
        sysinfo_screen_populate(screen, sysinfo);
-       text_screen_draw(&screen->text_scr);
+
+       if (screen->text_scr.cui->help_screen)
+               screen->text_scr.need_update = true;
+       else
+               text_screen_draw(&screen->text_scr);
 }
 
 struct sysinfo_screen *sysinfo_screen_init(struct cui *cui,