summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2014-03-10 10:39:52 +0800
committerJeremy Kerr <jk@ozlabs.org>2014-03-14 15:14:20 +0800
commit90d16d056b4d7c6b8e2afb6b3406babd38f6c9e5 (patch)
treeb8972ace732802c5eb86695a27fc90564631d156
parent34c5230774ee2797b9f80b7f483e009cbb9f25f5 (diff)
downloadpetitboot-90d16d056b4d7c6b8e2afb6b3406babd38f6c9e5.zip
petitboot-90d16d056b4d7c6b8e2afb6b3406babd38f6c9e5.tar.gz
discover: Include boot priorities in configuration dump
To help debug boot priority issues, it'd be useful to include the priority data in the configuration dump. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r--discover/platform.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/discover/platform.c b/discover/platform.c
index db0ea61..d745712 100644
--- a/discover/platform.c
+++ b/discover/platform.c
@@ -11,6 +11,23 @@ void *platform_ctx;
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;
@@ -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]);
+
+ 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)
OpenPOWER on IntegriCloud