summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--discover/device-handler.c2
-rw-r--r--discover/device-handler.h2
-rw-r--r--lib/pb-config/pb-config.c8
-rw-r--r--lib/pb-config/pb-config.h1
4 files changed, 8 insertions, 5 deletions
diff --git a/discover/device-handler.c b/discover/device-handler.c
index ccc7cc3..a06dafc 100644
--- a/discover/device-handler.c
+++ b/discover/device-handler.c
@@ -419,7 +419,7 @@ static void set_default(struct device_handler *handler,
return;
handler->default_boot_option = opt;
- handler->sec_to_boot = DEFAULT_BOOT_TIMEOUT_SEC;
+ handler->sec_to_boot = config_get()->autoboot_timeout_sec;
pb_log("Boot option %s set as default, timeout %u sec.\n",
opt->option->id, handler->sec_to_boot);
diff --git a/discover/device-handler.h b/discover/device-handler.h
index 693f5e4..0cd9c59 100644
--- a/discover/device-handler.h
+++ b/discover/device-handler.h
@@ -3,8 +3,6 @@
#include <list/list.h>
-#define DEFAULT_BOOT_TIMEOUT_SEC 10
-
struct device_handler;
struct discover_device;
struct discover_server;
diff --git a/lib/pb-config/pb-config.c b/lib/pb-config/pb-config.c
index 315d990..53ed6d6 100644
--- a/lib/pb-config/pb-config.c
+++ b/lib/pb-config/pb-config.c
@@ -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,8 +24,11 @@ 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->network.n_interfaces || config->network.n_dns_servers)
pb_log(" network configuration:\n");
diff --git a/lib/pb-config/pb-config.h b/lib/pb-config/pb-config.h
index 6a64ef1..c74fa1b 100644
--- a/lib/pb-config/pb-config.h
+++ b/lib/pb-config/pb-config.h
@@ -32,6 +32,7 @@ struct network_config {
struct config {
bool autoboot_enabled;
+ int autoboot_timeout_sec;
struct network_config network;
};
OpenPOWER on IntegriCloud