]> git.ozlabs.org Git - petitboot/blobdiff - lib/pb-config/pb-config.c
lib/pb-config: Add autoboot timeout to configuration vars
[petitboot] / lib / pb-config / pb-config.c
index 5cd303b06d257e6292fc49a87f918ba24308db78..53ed6d6e2b31ebab2df2abaf13e11bb7401f9909 100644 (file)
@@ -13,6 +13,7 @@ static struct config_storage  *storage;
 static void config_set_defaults(struct config *config)
 {
        config->autoboot_enabled = true;
+       config->autoboot_timeout_sec = 10;
        config->network.interfaces = NULL;
        config->network.n_interfaces = 0;
 }
@@ -23,10 +24,13 @@ static void dump_config(struct config *config)
 
        pb_log("configuration:\n");
 
-       pb_log(" autoboot: %s\n",
-                       config->autoboot_enabled ? "enabled" : "disabled");
+       if (config->autoboot_enabled)
+               pb_log(" autoboot: enabled, %d sec\n",
+                               config->autoboot_timeout_sec);
+       else
+               pb_log(" autoboot: disabled\n");
 
-       if (config->n_network_configs > 0)
+       if (config->network.n_interfaces || config->network.n_dns_servers)
                pb_log(" network configuration:\n");
 
        for (i = 0; i < config->network.n_interfaces; i++) {
@@ -53,6 +57,8 @@ 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]);
 }
 
 int config_init(void *ctx)