]> git.ozlabs.org Git - petitboot/blobdiff - discover/platform.c
discover/udev: Don't call udev_set_log_fn()
[petitboot] / discover / platform.c
index a6bd74c7a0757b0a2f2de8da38eac4c5e9ce8e81..fc0930db29a1cd67d6223d891f9fa9a865e064e6 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <fcntl.h>
 #include <string.h>
+#include <locale.h>
 
 #include <log/log.h>
 #include <file/file.h>
@@ -59,6 +60,7 @@ static void dump_config(struct config *config)
                        pb_log("   static:\n");
                        pb_log("    ip:  %s\n", ifconf->static_config.address);
                        pb_log("    gw:  %s\n", ifconf->static_config.gateway);
+                       pb_log("    url:  %s\n", ifconf->static_config.url);
 
                }
        }
@@ -102,6 +104,8 @@ static bool config_debug_on_cmdline(void)
 
 void config_set_defaults(struct config *config)
 {
+       const char *lang;
+
        config->autoboot_enabled = true;
        config->autoboot_timeout_sec = 10;
        config->autoboot_enabled = true;
@@ -110,7 +114,6 @@ void config_set_defaults(struct config *config)
        config->network.dns_servers = NULL;
        config->network.n_dns_servers = 0;
        config->safe_mode = false;
-       config->lang = NULL;
        config->allow_writes = true;
        config->disable_snapshots = false;
 
@@ -126,6 +129,14 @@ void config_set_defaults(struct config *config)
        config->ipmi_bootdev_persistent = false;
 
        config->debug = config_debug_on_cmdline();
+
+       lang = setlocale(LC_ALL, NULL);
+       pb_log("lang: %s\n", lang);
+       if (lang && strlen(lang))
+               config->lang = talloc_strdup(config, lang);
+       else
+               config->lang = NULL;
+
 }
 
 int platform_init(void *ctx)