diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-05-01 10:03:31 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-05-06 09:02:12 +0800 |
commit | 100cb2cfc3ee4040ab969215e3cd8cc885f9efeb (patch) | |
tree | 74c2d3423339c0e197c46dd8693dff21915770e9 /ui | |
parent | 375c81a1b9aa8904dfdd0b1195fe99a1e4a2fa9d (diff) | |
download | talos-petitboot-100cb2cfc3ee4040ab969215e3cd8cc885f9efeb.tar.gz talos-petitboot-100cb2cfc3ee4040ab969215e3cd8cc885f9efeb.zip |
cui: Show incoming status messages
Add a callback to handle and display boot status messages from the
discover server.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/ncurses/nc-cui.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/ui/ncurses/nc-cui.c b/ui/ncurses/nc-cui.c index c26819f..f165637 100644 --- a/ui/ncurses/nc-cui.c +++ b/ui/ncurses/nc-cui.c @@ -147,11 +147,7 @@ static int cui_boot(struct pmenu_item *item) reset_prog_mode(); redrawwin(cui->current->main_ncw); - if (!result) { - clear(); - mvaddstr(1, 0, "system is going down now..."); - refresh(); - } else { + if (result) { nc_scr_status_printf(cui->current, "Failed: boot %s", cod->bd->image); } @@ -492,10 +488,22 @@ static void cui_device_remove(struct device *dev, void *arg) cui->current->post(cui->current); } +static void cui_update_status(struct boot_status *status, void *arg) +{ + struct cui *cui = cui_from_arg(arg); + + nc_scr_status_printf(cui->current, + "%s: %s", + status->type == BOOT_STATUS_ERROR ? "Error" : "Info", + status->message); + +} + static struct discover_client_ops cui_client_ops = { .device_add = NULL, .boot_option_add = cui_boot_option_add, .device_remove = cui_device_remove, + .update_status = cui_update_status, }; /** |