NULL
};
-static int grub2_parse(struct discover_context *dc)
+static int grub2_parse(struct discover_context *dc, char *buf, int len)
{
struct conf_context *conf;
struct grub2_state *state;
- int rc;
conf = talloc_zero(dc, struct conf_context);
conf->dc = dc;
conf_init_global_options(conf);
- conf->conf_files = grub2_conf_files,
conf->get_pair = conf_get_pair_space;
conf->process_pair = grub2_process_pair;
conf->finish = grub2_finish;
state->opt = talloc_zero(conf->dc->device, struct boot_option);
state->opt->boot_args = talloc_strdup(state->opt, "");
- rc = conf_parse(conf);
+ conf_parse_buf(conf, buf, len);
talloc_free(conf);
- return rc;
+ return 1;
}
-define_parser(grub2, grub2_parse);
+struct parser __grub2_parser = {
+ .name = "grub2",
+ .parse = grub2_parse,
+ .filenames = grub2_conf_files,
+};