summaryrefslogtreecommitdiffstats
path: root/ui/ncurses
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-08-21 15:18:48 +1000
committerSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-08-31 14:58:14 +1000
commit70907c3fc4b344d00ce900e6a536e9cc16a35216 (patch)
treed723cafda2c6f32675c9e1ff52c55bce283e4aa5 /ui/ncurses
parent74ca9eaf3d0dd64560c3eaa132df2e854b51bcdd (diff)
downloadtalos-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 'ui/ncurses')
-rw-r--r--ui/ncurses/nc-config.c2
-rw-r--r--ui/ncurses/nc-menu.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/ui/ncurses/nc-config.c b/ui/ncurses/nc-config.c
index 6363bb9..f7c6b8c 100644
--- a/ui/ncurses/nc-config.c
+++ b/ui/ncurses/nc-config.c
@@ -762,7 +762,7 @@ static void config_screen_setup_widgets(struct config_screen *screen,
widget_subset_add_option(screen->widgets.boot_order_f, label);
}
- for (i = DEVICE_TYPE_NETWORK; i < DEVICE_TYPE_NETWORK + 4; i++) {
+ for (i = DEVICE_TYPE_NETWORK; i < DEVICE_TYPE_UNKNOWN; i++) {
char *label;
if (i == DEVICE_TYPE_ANY)
diff --git a/ui/ncurses/nc-menu.c b/ui/ncurses/nc-menu.c
index b8f9a35..b42dc23 100644
--- a/ui/ncurses/nc-menu.c
+++ b/ui/ncurses/nc-menu.c
@@ -253,6 +253,7 @@ struct pmenu_item *pmenu_find_device(struct pmenu *menu, struct device *dev,
switch (dev->type) {
case DEVICE_TYPE_OPTICAL:
case DEVICE_TYPE_DISK:
+ case DEVICE_TYPE_USB:
/* Find block info */
for (i = 0; sys && i < sys->n_blockdevs; i++) {
bd = sys->blockdevs[i];
@@ -263,8 +264,9 @@ struct pmenu_item *pmenu_find_device(struct pmenu *menu, struct device *dev,
}
if (matched) {
snprintf(buf,sizeof(buf),"[%s: %s / %s]",
- dev->type == DEVICE_TYPE_DISK ?
- _("Disk") : _("CD/DVD"),
+ dev->type == DEVICE_TYPE_OPTICAL ?
+ _("CD/DVD") :
+ device_type_display_name(dev->type),
bd->name, bd->uuid);
}
break;
OpenPOWER on IntegriCloud