extern struct parser native_parser;
extern struct parser yaboot_parser;
+extern struct parser kboot_parser;
static FILE *logf;
static int sock;
static struct parser *parsers[] = {
&native_parser,
&yaboot_parser,
+ &kboot_parser,
NULL
};
log("\ttrying parser '%s'\n", parsers[i]->name);
/* just use a dummy device path for now */
if (parsers[i]->parse(devpath, mountpoint))
- return;
+ /*return*/;
}
log("\tno boot_options found\n");
}
const char *bus = getenv("ID_BUS");
if (type && streq(type, "cd"))
return ICON_TYPE_OPTICAL;
+ if (!bus)
+ return ICON_TYPE_UNKNOWN;
if (streq(bus, "usb"))
return ICON_TYPE_USB;
if (streq(bus, "ata") || streq(bus, "scsi"))
}
return rc;
}
+
+/* convenience function for parsers */
+char *join_paths(const char *a, const char *b)
+{
+ char *full_path;
+
+ full_path = malloc(strlen(a) + strlen(b) + 2);
+
+ strcpy(full_path, a);
+ if (b[0] != '/')
+ strcat(full_path, "/");
+ strcat(full_path, b);
+
+ return full_path;
+}
+