summaryrefslogtreecommitdiffstats
path: root/common/boot.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-07-03 13:41:59 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-07-03 16:40:50 +0200
commit815189dd4c8be39b9caae6c06a75a994f1956140 (patch)
tree46330adbcf4484b3b88d97dd6a009ef6f9b4e66e /common/boot.c
parenta1ee6140bcfd15d5ab2fef05898a3c361ab1b9e4 (diff)
downloadbarebox-815189dd4c8be39b9caae6c06a75a994f1956140.tar.gz
startup: Create boot related variables where they are used
global.boot.default, global.linux.bootargs.base and global.user are used in the boot code, so create them there. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/boot.c')
-rw-r--r--common/boot.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/common/boot.c b/common/boot.c
index 84b2ff9..14d4fe9 100644
--- a/common/boot.c
+++ b/common/boot.c
@@ -119,12 +119,22 @@ void boot_set_watchdog_timeout(unsigned int timeout)
boot_watchdog_timeout = timeout;
}
-static int init_boot_watchdog_timeout(void)
+static char *global_boot_default;
+static char *global_user;
+
+static int init_boot(void)
{
- return globalvar_add_simple_int("boot.watchdog_timeout",
- &boot_watchdog_timeout, "%u");
+ global_boot_default = xstrdup("net");
+ globalvar_add_simple_string("boot.default", &global_boot_default);
+ globalvar_add_simple_int("boot.watchdog_timeout",
+ &boot_watchdog_timeout, "%u");
+ globalvar_add_simple("linux.bootargs.base", NULL);
+ global_user = xstrdup("none");
+ globalvar_add_simple_string("user", &global_user);
+
+ return 0;
}
-late_initcall(init_boot_watchdog_timeout);
+late_initcall(init_boot);
BAREBOX_MAGICVAR_NAMED(global_watchdog_timeout, global.boot.watchdog_timeout,
"Watchdog enable timeout in seconds before booting");