summaryrefslogtreecommitdiffstats
path: root/discover
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-08-07 14:39:40 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-08-07 14:39:40 +0800
commitd6166b471a9356355ed16747de3c0febd4b8cd3e (patch)
treef7cb0113174e607469f7ddf9b06201a5aa3ddf03 /discover
parentcdaae762f23d137eef7de73f2226f55090ddbec0 (diff)
downloadtalos-petitboot-d6166b471a9356355ed16747de3c0febd4b8cd3e.tar.gz
talos-petitboot-d6166b471a9356355ed16747de3c0febd4b8cd3e.zip
discover/yaboot: implement default options
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover')
-rw-r--r--discover/yaboot-parser.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/discover/yaboot-parser.c b/discover/yaboot-parser.c
index 81ab83d..c0750fe 100644
--- a/discover/yaboot-parser.c
+++ b/discover/yaboot-parser.c
@@ -87,6 +87,7 @@ static struct resource *create_yaboot_devpath_resource(
static void yaboot_finish(struct conf_context *conf)
{
struct yaboot_state *state = conf->parser_info;
+ const char *default_label;
struct boot_option *opt;
assert(state->opt);
@@ -143,6 +144,11 @@ static void yaboot_finish(struct conf_context *conf)
conf_strip_str(opt->boot_args);
conf_strip_str(opt->description);
+ default_label = conf_get_global_option(conf, "default");
+ if (default_label &&
+ !strcasecmp(state->opt->option->name, default_label))
+ state->opt->option->is_default = true;
+
discover_context_add_boot_option(conf->dc, state->opt);
}
@@ -302,6 +308,7 @@ static struct conf_global_option yaboot_global_options[] = {
{ .name = "video" },
{ .name = "literal" },
{ .name = "ramdisk" },
+ { .name = "default" },
{ .name = NULL },
};
OpenPOWER on IntegriCloud