]> git.ozlabs.org Git - petitboot/blobdiff - ui/ncurses/nc-cui.c
ui/ncurses: Add setlocale call
[petitboot] / ui / ncurses / nc-cui.c
index 82e534db817e4f5f8e6252b25bb20fe5731d6658..3f82f85fe1bbe1fbba70f362afcc698535514c5f 100644 (file)
@@ -22,6 +22,7 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
+#include <locale.h>
 #include <sys/ioctl.h>
 
 #include "log/log.h"
@@ -158,6 +159,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 +377,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 +437,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 +505,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: