test/py: test_fs: add tests for creating/deleting many files
[oweals/u-boot.git] / common / main.c
index 07b34bf2b05d3df5ad15fc8d256ccc815e30968d..a94df7ae042ffcb1dafd3e92581481127fc1973e 100644 (file)
@@ -9,7 +9,9 @@
 #include <common.h>
 #include <autoboot.h>
 #include <cli.h>
+#include <command.h>
 #include <console.h>
+#include <env.h>
 #include <version.h>
 
 /*
@@ -19,7 +21,6 @@ __weak void show_boot_progress(int val) {}
 
 static void run_preboot_environment_command(void)
 {
-#ifdef CONFIG_PREBOOT
        char *p;
 
        p = env_get("preboot");
@@ -34,7 +35,6 @@ static void run_preboot_environment_command(void)
                if (IS_ENABLED(CONFIG_AUTOBOOT_KEYED))
                        disable_ctrlc(prev);    /* restore Ctrl-C checking */
        }
-#endif /* CONFIG_PREBOOT */
 }
 
 /* We come here after U-Boot is initialised and ready to process commands */
@@ -49,7 +49,8 @@ void main_loop(void)
 
        cli_init();
 
-       run_preboot_environment_command();
+       if (IS_ENABLED(CONFIG_USE_PREBOOT))
+               run_preboot_environment_command();
 
        if (IS_ENABLED(CONFIG_UPDATE_TFTP))
                update_tftp(0UL, NULL, NULL);