Recognise storage devices on USB bus
[petitboot] / lib / types / types.c
index 95a3a48cb4fca9571fa9a6eac54449b9c2378c2e..611f2a1018dba2f772b90ad245508339aa07dc53 100644 (file)
@@ -27,6 +27,8 @@ const char *device_type_display_name(enum device_type type)
        switch (type) {
        case DEVICE_TYPE_DISK:
                return _("Disk");
+       case DEVICE_TYPE_USB:
+               return _("USB");
        case DEVICE_TYPE_OPTICAL:
                return _("Optical");
        case DEVICE_TYPE_NETWORK:
@@ -44,6 +46,8 @@ const char *device_type_name(enum device_type type)
        switch (type) {
        case DEVICE_TYPE_DISK:
                return "disk";
+       case DEVICE_TYPE_USB:
+               return "usb";
        case DEVICE_TYPE_OPTICAL:
                return "optical";
        case DEVICE_TYPE_NETWORK:
@@ -60,6 +64,8 @@ enum device_type find_device_type(const char *str)
 {
        if (!strncmp(str, "disk", strlen("disk")))
                return DEVICE_TYPE_DISK;
+       if (!strncmp(str, "usb", strlen("usb")))
+               return DEVICE_TYPE_USB;
        if (!strncmp(str, "optical", strlen("optical")))
                return DEVICE_TYPE_OPTICAL;
        if (!strncmp(str, "network", strlen("network")))