diff --git a/common/startup.c b/common/startup.c index 511675e..7e0f7d6 100644 --- a/common/startup.c +++ b/common/startup.c @@ -281,19 +281,8 @@ return autoboot_state; } -static int run_init(void) +static int register_autoboot_vars(void) { - DIR *dir; - struct dirent *d; - const char *initdir = "/env/init"; - bool env_bin_init_exists; - enum autoboot_state autoboot; - struct stat s; - - /* - * Register autoboot variables here as they might be altered by - * init scripts. - */ globalvar_add_simple_enum("autoboot_abort_key", &global_autoboot_abort_key, global_autoboot_abort_keys, @@ -305,6 +294,19 @@ global_autoboot_states, ARRAY_SIZE(global_autoboot_states)); + return 0; +} +postcore_initcall(register_autoboot_vars); + +static int run_init(void) +{ + DIR *dir; + struct dirent *d; + const char *initdir = "/env/init"; + bool env_bin_init_exists; + enum autoboot_state autoboot; + struct stat s; + setenv("PATH", "/env/bin"); /* Run legacy /env/bin/init if it exists */