#include "log/log.h"
#include "talloc/talloc.h"
-#include "pb-protocol/pb-protocol.h"
+#include "types/types.h"
#include "parser-conf.h"
#include "parser-utils.h"
#include "paths.h"
static void yaboot_finish(struct conf_context *conf)
{
struct yaboot_state *state = conf->parser_info;
+ struct device *dev = conf->dc->device->device;
if (!state->desc_image) {
- pb_log("%s: %s: no image found\n", __func__,
- conf->dc->device->id);
+ pb_log("%s: %s: no image found\n", __func__, dev->id);
return;
}
/* opt is persistent, so must be associated with device */
- device_add_boot_option(conf->dc->device, state->opt);
- state->opt = talloc_zero(conf->dc->device, struct boot_option);
+ discover_context_add_boot_option(conf->dc, state->opt);
+
+ state->opt = talloc_zero(conf->dc, struct boot_option);
state->opt->boot_args = talloc_strdup(state->opt, "");
}
"%s%s", g_boot, value);
} else {
state->opt->boot_image_file = resolve_path(state->opt,
- value, conf->dc->device_path);
+ value, conf->dc->device->device_path);
state->desc_image = talloc_strdup(state->opt, value);
}
if (*value == '/') {
state->opt->boot_image_file = resolve_path(state->opt,
- value, conf->dc->device_path);
+ value, conf->dc->device->device_path);
state->desc_image = talloc_strdup(state->opt, value);
} else {
state->opt->boot_image_file = resolve_path(state->opt,
- suse_fp->image, conf->dc->device_path);
+ suse_fp->image, conf->dc->device->device_path);
state->desc_image = talloc_strdup(state->opt,
suse_fp->image);
state->opt->initrd_file = resolve_path(state->opt,
- suse_fp->initrd, conf->dc->device_path);
+ suse_fp->initrd, conf->dc->device->device_path);
state->desc_initrd = talloc_asprintf(state, "initrd=%s",
suse_fp->initrd);
}
"initrd=%s%s", g_boot, value);
} else {
state->opt->initrd_file = resolve_path(state->opt,
- value, conf->dc->device_path);
+ value, conf->dc->device->device_path);
state->desc_initrd = talloc_asprintf(state, "initrd=%s",
value);
}
if (streq(name, "label")) {
state->opt->id = talloc_asprintf(state->opt, "%s#%s",
- conf->dc->device->id, value);
+ conf->dc->device->device->id, value);
state->opt->name = talloc_strdup(state->opt, value);
return;
}
return rc;
}
-define_parser(yaboot, yaboot_parse);
+struct parser __yaboot_parser = {
+ .name = "yaboot",
+ .parse = yaboot_parse,
+ .filenames = yaboot_conf_files,
+};