diff options
author | Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> | 2015-08-21 15:18:48 +1000 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> | 2015-08-31 14:58:14 +1000 |
commit | 70907c3fc4b344d00ce900e6a536e9cc16a35216 (patch) | |
tree | d723cafda2c6f32675c9e1ff52c55bce283e4aa5 /lib/types/types.c | |
parent | 74ca9eaf3d0dd64560c3eaa132df2e854b51bcdd (diff) | |
download | talos-petitboot-70907c3fc4b344d00ce900e6a536e9cc16a35216.tar.gz talos-petitboot-70907c3fc4b344d00ce900e6a536e9cc16a35216.zip |
Recognise storage devices on USB bus
Users may want to prioritise USB-attached storage devices differently to
other devices. Detect if a device is USB-attached and add a new device
type to identify it.
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Diffstat (limited to 'lib/types/types.c')
-rw-r--r-- | lib/types/types.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/types/types.c b/lib/types/types.c index 95a3a48..611f2a1 100644 --- a/lib/types/types.c +++ b/lib/types/types.c @@ -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"))) |