ui/ncurses: Use pmenu_item destrutor to free ncurses ITEMs
[petitboot] / discover / platform.c
index db0ea61dd025c7fd6dabb93c51e12a9d434115cb..d74571230bbcdc63df6d75edf9da2bd2c1884511 100644 (file)
@@ -11,6 +11,23 @@ void                 *platform_ctx;
 static struct platform *platform;
 static struct config   *config;
 
 static struct platform *platform;
 static struct config   *config;
 
+static const char *device_type_name(enum device_type type)
+{
+       switch (type) {
+       case DEVICE_TYPE_DISK:
+               return "disk";
+       case DEVICE_TYPE_OPTICAL:
+               return "optical";
+       case DEVICE_TYPE_NETWORK:
+               return "network";
+       case DEVICE_TYPE_ANY:
+               return "any";
+       case DEVICE_TYPE_UNKNOWN:
+       default:
+               return "unknown";
+       }
+}
+
 static void dump_config(struct config *config)
 {
        unsigned int i;
 static void dump_config(struct config *config)
 {
        unsigned int i;
@@ -52,6 +69,15 @@ static void dump_config(struct config *config)
        }
        for (i = 0; i < config->network.n_dns_servers; i++)
                pb_log("  dns server %s\n", config->network.dns_servers[i]);
        }
        for (i = 0; i < config->network.n_dns_servers; i++)
                pb_log("  dns server %s\n", config->network.dns_servers[i]);
+
+       if (config->n_boot_priorities)
+               pb_log(" boot priority order:\n");
+
+       for (i = 0; i < config->n_boot_priorities; i++) {
+               struct boot_priority *prio = &config->boot_priorities[i];
+               pb_log(" %10s: %d\n", device_type_name(prio->type),
+                                       prio->priority);
+       }
 }
 
 void config_set_defaults(struct config *config)
 }
 
 void config_set_defaults(struct config *config)