5 #include <talloc/talloc.h>
7 #include "pb-protocol/pb-protocol.h"
10 #include "device-handler.h"
11 #include "parser-utils.h"
13 void device_add_boot_option(struct device *device,
14 struct boot_option *boot_option)
16 pb_log("%s: %s\n", __func__, device->id);
17 pb_log(" id '%s'\n", boot_option->id);
18 pb_log(" name '%s'\n", boot_option->name);
19 pb_log(" descr '%s'\n", boot_option->description);
20 pb_log(" icon '%s'\n", boot_option->icon_file);
21 pb_log(" image '%s'\n", boot_option->boot_image_file);
22 pb_log(" initrd '%s'\n", boot_option->initrd_file);
23 pb_log(" args '%s'\n", boot_option->boot_args);
24 list_add(&device->boot_options, &boot_option->list);
25 talloc_steal(device, boot_option);
28 const char *generic_icon_file(enum generic_icon_type type)
32 return artwork_pathname("hdd.png");
34 return artwork_pathname("usbpen.png");
35 case ICON_TYPE_OPTICAL:
36 return artwork_pathname("cdrom.png");
37 case ICON_TYPE_NETWORK:
38 case ICON_TYPE_UNKNOWN:
41 return artwork_pathname("hdd.png");
44 enum generic_icon_type guess_device_type(struct discover_context *ctx)
47 const char *type, *bus;
51 type = event_get_param(event, "ID_TYPE");
52 bus = event_get_param(event, "ID_BUS");
54 if (type && streq(type, "cd"))
55 return ICON_TYPE_OPTICAL;
57 return ICON_TYPE_UNKNOWN;
58 if (streq(bus, "usb"))
60 if (streq(bus, "ata") || streq(bus, "scsi"))
61 return ICON_TYPE_DISK;
62 return ICON_TYPE_UNKNOWN;