X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ui%2Fncurses%2Fnc-sysinfo.c;h=5ced871127b33a2ea01391a07a04e892a5af9e75;hb=e90189081c52496a9db6fd0b8a0c4899f51b9049;hp=0d362e481d493ce88fa6ed4ca4478855f6cc6ddb;hpb=494988c501287e03da3becba5c03cbce7c3d9d20;p=petitboot diff --git a/ui/ncurses/nc-sysinfo.c b/ui/ncurses/nc-sysinfo.c index 0d362e4..5ced871 100644 --- a/ui/ncurses/nc-sysinfo.c +++ b/ui/ncurses/nc-sysinfo.c @@ -35,7 +35,7 @@ struct sysinfo_screen { struct text_screen text_scr; }; -extern const char *sysinfo_help_text; +extern const struct help_text sysinfo_help_text; struct nc_scr *sysinfo_screen_scr(struct sysinfo_screen *screen) { @@ -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); @@ -78,20 +79,27 @@ 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"); + line(_("Network interfaces")); } 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)); line("%s:", info->name); line(_(" MAC: %s"), macbuf); - line(_(" link: %s"), info->link ? "up" : "down"); + /* TRANSLATORS: these "up" / "down" strings refer to the + * link status for a network connection. */ + line(_(" link: %s"), info->link ? _("up") : _("down")); line(NULL); } @@ -102,7 +110,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, @@ -115,7 +127,7 @@ struct sysinfo_screen *sysinfo_screen_init(struct cui *cui, text_screen_init(&screen->text_scr, cui, _("Petitboot System Information"), on_exit); text_screen_set_help(&screen->text_scr, - _("System Information"), sysinfo_help_text); + _("System Information"), &sysinfo_help_text); sysinfo_screen_update(screen, sysinfo);