+ if (streq(name, "parititon")) {
+ state->partition = talloc_strdup(state, value);
+ return;
+ }
+
+ if (streq(name, "append")) {
+ opt->option->boot_args = talloc_asprintf_append(
+ opt->option->boot_args, "%s ", value);
+ return;
+ }
+
+ if (streq(name, "initrd-size")) {
+ state->initrd_size = talloc_strdup(state, value);
+ return;
+ }
+
+ if (streq(name, "literal")) {
+ state->literal = talloc_strdup(state, value);
+ return;
+ }
+
+ if (streq(name, "ramdisk")) {
+ state->ramdisk = talloc_strdup(state, value);
+ return;
+ }
+
+ if (streq(name, "read-only")) {
+ state->read_only = true;
+ return;
+ }
+
+ if (streq(name, "read-write")) {
+ state->read_write = true;
+ return;
+ }
+
+ if (streq(name, "root")) {
+ state->root = talloc_strdup(state, value);
+ return;
+ }
+
+ pb_debug("%s: unknown name: %s\n", __func__, name);
+}
+
+static struct conf_global_option yaboot_global_options[] = {
+ { .name = "root" },
+ { .name = "device" },
+ { .name = "partition" },
+ { .name = "initrd" },
+ { .name = "initrd_size" },
+ { .name = "video" },
+ { .name = "literal" },
+ { .name = "ramdisk" },
+ { .name = "default" },
+ { .name = NULL },
+};
+
+static const char *const yaboot_conf_files[] = {
+ "/yaboot.conf",
+ "/yaboot.cnf",
+ "/etc/yaboot.conf",
+ "/etc/yaboot.cnf",
+ "/suseboot/yaboot.cnf",
+ "/YABOOT.CONF",
+ "/YABOOT.CNF",
+ "/ETC/YABOOT.CONF",
+ "/ETC/YABOOT.CNF",
+ "/SUSEBOOT/YABOOT.CNF",
+ NULL
+};
+
+static int yaboot_parse(struct discover_context *dc)
+{
+ const char * const *filename;
+ struct yaboot_state *state;
+ struct conf_context *conf;
+ int len, rc;
+ char *buf;
+
+ /* Support block device boot only at present */
+ if (dc->event)
+ return -1;
+
+ conf = talloc_zero(dc, struct conf_context);
+
+ if (!conf)
+ return -1;
+
+ conf->dc = dc;
+ conf->global_options = yaboot_global_options,
+ conf_init_global_options(conf);
+ conf->get_pair = conf_get_pair_equal;
+ conf->process_pair = yaboot_process_pair;
+ conf->finish = yaboot_finish;
+ conf->parser_info = state = talloc_zero(conf, struct yaboot_state);
+
+ state->opt = NULL;
+
+ for (filename = yaboot_conf_files; *filename; filename++) {
+ rc = parser_request_file(dc, dc->device, *filename, &buf, &len);
+ if (rc)
+ continue;
+
+ conf_parse_buf(conf, buf, len);
+ talloc_free(buf);
+ }
+
+ talloc_free(conf);
+ return 0;