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@%s\n", devpath, mountpoint);
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, mountpoint))
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 char *join_paths(const char *a, const char *b)
74 full_path = malloc(strlen(a) + strlen(b) + 2);
78 strcat(full_path, "/");
84 const char *generic_icon_file(enum generic_icon_type type)
88 return artwork_pathname("hdd.png");
90 return artwork_pathname("usbpen.png");
91 case ICON_TYPE_OPTICAL:
92 return artwork_pathname("cdrom.png");
93 case ICON_TYPE_NETWORK:
94 case ICON_TYPE_UNKNOWN:
97 return artwork_pathname("hdd.png");