]> git.ozlabs.org Git - petitboot/blobdiff - ui/ncurses/nc-cui.c
configure: Update to use AX_WITH_CURSES
[petitboot] / ui / ncurses / nc-cui.c
index 82e534db817e4f5f8e6252b25bb20fe5731d6658..4baaec17d52ca4c9e242b45669c7d5b01bdce776 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include "config.h"
+
 #define _GNU_SOURCE
 
 #include <assert.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
+#include <locale.h>
 #include <sys/ioctl.h>
 
 #include "log/log.h"
@@ -158,6 +161,7 @@ static void cui_boot_editor_on_exit(struct boot_editor *boot_editor, enum boot_e
                pb_log("%s: updating opt '%s'\n", __func__, cod->name);
                pb_log(" image  '%s'\n", cod->bd->image);
                pb_log(" initrd '%s'\n", cod->bd->initrd);
+               pb_log(" dtb    '%s'\n", cod->bd->dtb);
                pb_log(" args   '%s'\n", cod->bd->args);
        }
 
@@ -375,6 +379,7 @@ static int cui_boot_option_add(struct device *dev, struct boot_option *opt,
 
        cod->bd->image = talloc_strdup(cod->bd, opt->boot_image_file);
        cod->bd->initrd = talloc_strdup(cod->bd, opt->initrd_file);
+       cod->bd->dtb = talloc_strdup(cod->bd, opt->dtb_file);
        cod->bd->args = talloc_strdup(cod->bd, opt->boot_args);
 
        pmenu_item_setup(cui->main, i, insert_pt, cod->name);
@@ -434,9 +439,8 @@ static void cui_device_remove(struct device *dev, void *arg)
 
        list_for_each_entry(&dev->boot_options, opt, list) {
                struct pmenu_item *i = pmenu_item_from_arg(opt->ui_info);
-               struct cui_opt_data *cod = cod_from_item(i);
 
-               assert(pb_protocol_device_cmp(dev, cod->dev));
+               assert(pb_protocol_device_cmp(dev, cod_from_item(i)->dev));
                pmenu_remove(cui->main, i);
        }
 
@@ -503,6 +507,8 @@ struct cui *cui_init(void* platform_info,
        cui->platform_info = platform_info;
        cui->waitset = waitset_create(cui);
 
+       setlocale(LC_ALL, "");
+
        /* Loop here for scripts that just started the server. */
 
 retry_start: