discover/platform-powerpc: Read language configuration from NVRAM
authorJeremy Kerr <jk@ozlabs.org>
Thu, 18 Sep 2014 14:13:27 +0000 (22:13 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Thu, 18 Sep 2014 14:25:45 +0000 (22:25 +0800)
Implement load & save of the petitboot language configuration.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/platform-powerpc.c

index 642c93c1cdf453412959c415fa878bebdc17fad6..1f6f7250df8c4104b5e5f2f6a95e4f0feee53647 100644 (file)
@@ -37,6 +37,7 @@ static const char *known_params[] = {
        "petitboot,network",
        "petitboot,timeout",
        "petitboot,bootdev",
+       "petitboot,language",
        "petitboot,debug?",
        NULL,
 };
@@ -423,6 +424,9 @@ static void populate_config(struct platform_powerpc *platform,
                }
        }
 
+       val = get_param(platform, "petitboot,language");
+       config->lang = val ? talloc_strdup(config, val) : NULL;
+
        populate_network_config(platform, config);
 
        populate_bootdev_config(platform, config);
@@ -555,6 +559,9 @@ static int update_config(struct platform_powerpc *platform,
        if (tmp)
                talloc_free(tmp);
 
+       val = config->lang ?: "";
+       update_string_config(platform, "petitboot,language", val);
+
        update_network_config(platform, config);
 
        update_bootdev_config(platform, config);