+static struct resource *create_yaboot_devpath_resource(
+ struct yaboot_state *state,
+ struct conf_context *conf,
+ const char *path)
+{
+ struct discover_boot_option *opt = state->opt;
+ const char *dev, *part;
+ struct resource *res;
+ char *devpath;
+
+ dev = state->device;
+ part = state->partition;
+
+ if (!dev)
+ dev = conf_get_global_option(conf, "device");
+ if (!part)
+ part = conf_get_global_option(conf, "partition");
+
+ if (strchr(path, ':')) {
+ devpath = talloc_strdup(conf, path);
+
+ } else if (dev && part) {
+ devpath = talloc_asprintf(conf,
+ "%s%s:%s", dev, part, path);
+ } else if (dev) {
+ devpath = talloc_asprintf(conf, "%s:%s", dev, path);
+ } else {
+ devpath = talloc_strdup(conf, path);
+ }
+
+ res = create_devpath_resource(opt, conf->dc->device, devpath);
+
+ talloc_free(devpath);
+
+ return res;
+}
+