2 #include <petitboot-paths.h>
8 extern struct parser native_parser;
9 extern struct parser yaboot_parser;
10 extern struct parser kboot_parser;
12 /* array of parsers, ordered by priority */
13 static struct parser *parsers[] = {
20 void iterate_parsers(const char *devpath, const char *mountpoint)
24 pb_log("trying parsers for %s\n", devpath);
26 for (i = 0; parsers[i]; i++) {
27 pb_log("\ttrying parser '%s'\n", parsers[i]->name);
28 /* just use a dummy device path for now */
29 if (parsers[i]->parse(devpath))
32 pb_log("\tno boot_options found\n");
35 /* convenience functions for parsers */
36 void free_device(struct device *dev)
45 free(dev->description);
51 void free_boot_option(struct boot_option *opt)
58 free(opt->description);
61 if (opt->boot_image_file)
62 free(opt->boot_image_file);
64 free(opt->initrd_file);
70 const char *generic_icon_file(enum generic_icon_type type)
74 return artwork_pathname("hdd.png");
76 return artwork_pathname("usbpen.png");
77 case ICON_TYPE_OPTICAL:
78 return artwork_pathname("cdrom.png");
79 case ICON_TYPE_NETWORK:
80 case ICON_TYPE_UNKNOWN:
83 return artwork_pathname("hdd.png");