diff options
-rw-r--r-- | lib/pb-config/storage-powerpc-nvram.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/pb-config/storage-powerpc-nvram.c b/lib/pb-config/storage-powerpc-nvram.c index 7c8b9e1..fa2437c 100644 --- a/lib/pb-config/storage-powerpc-nvram.c +++ b/lib/pb-config/storage-powerpc-nvram.c @@ -1,6 +1,7 @@ #include <string.h> #include <stdlib.h> +#include <limits.h> #include <sys/types.h> #include <sys/wait.h> @@ -29,6 +30,7 @@ struct powerpc_nvram_storage { static const char *known_params[] = { "auto-boot?", "petitboot,network", + "petitboot,timeout", NULL, }; @@ -301,12 +303,24 @@ static void populate_config(struct powerpc_nvram_storage *nv, struct config *config) { const char *val; + char *end; + unsigned long timeout; /* if the "auto-boot?' property is present and "false", disable auto * boot */ val = get_param(nv, "auto-boot?"); config->autoboot_enabled = !val || strcmp(val, "false"); + val = get_param(nv, "petitboot,timeout"); + if (val) { + timeout = strtoul(val, &end, 10); + if (end != val) { + if (timeout >= INT_MAX) + timeout = INT_MAX; + config->autoboot_timeout_sec = (int)timeout; + } + } + populate_network_config(nv, config); } |