conf_strip_str(opt->boot_args);
conf_strip_str(opt->description);
- /* opt is persistent, so must be associated with device */
-
discover_context_add_boot_option(conf->dc, state->opt);
-
- state->opt = discover_boot_option_create(conf->dc, conf->dc->device);
- state->opt->option->boot_args = talloc_strdup(state->opt->option, "");
}
static struct resource *create_yaboot_devpath_resource(
if (streq(name, "image")) {
/* First finish any previous image. */
- if (opt->boot_image)
+ if (opt)
yaboot_finish(conf);
+ opt = discover_boot_option_create(conf->dc, conf->dc->device);
+ opt->option->boot_args = talloc_strdup(opt->option, "");
+
/* Then start the new image. */
opt->boot_image = create_yaboot_devpath_resource(conf,
value, &state->desc_image);
+ state->opt = opt;
+
return;
}
if (suse_fp) {
/* First finish any previous image. */
-
- if (opt->boot_image)
+ if (opt)
yaboot_finish(conf);
/* Then start the new image. */
+ opt = discover_boot_option_create(conf->dc, conf->dc->device);
+ opt->option->boot_args = talloc_strdup(opt->option, "");
+
+ state->opt = opt;
+
if (*value == '/') {
opt->boot_image = create_yaboot_devpath_resource(
conf, value, &state->desc_image);
state->known_names = yaboot_known_names;
- /* opt is persistent, so must be associated with device */
-
- state->opt = discover_boot_option_create(conf->dc, conf->dc->device);
- state->opt->option->boot_args = talloc_strdup(state->opt->option, "");
+ state->opt = NULL;
conf_parse_buf(conf, buf, len);
}
static struct parser yaboot_parser = {
- .name = "yaboot",
- .parse = yaboot_parse,
- .filenames = yaboot_conf_files,
+ .name = "yaboot",
+ .method = CONF_METHOD_LOCAL_FILE,
+ .parse = yaboot_parse,
+ .filenames = yaboot_conf_files,
+ .resolve_resource = resolve_devpath_resource,
};
register_parser(yaboot_parser);