#include <string.h>
#include <stdlib.h>
+#include <limits.h>
#include <sys/types.h>
#include <sys/wait.h>
static const char *known_params[] = {
"auto-boot?",
"petitboot,network",
+ "petitboot,timeout",
NULL,
};
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);
}