boot options
[*] Enable preboot
(xxx) preboot default value
xxx是填入的preboot cmd,启动时会自动执行。
xxx会存储在uboot环境变量中,printenv 可看到 preboot=xxx
uboot初始化完后会去取env中的preboot cmd ,并执行
// file : u-boot-2021.10/common/main.c
/* We come here after U-Boot is initialised and ready to process commands */
void main_loop(void)
{
const char *s;
bootstage_mark_name(BOOTSTAGE_ID_MAIN_LOOP, "main_loop");
if (IS_ENABLED(CONFIG_VERSION_VARIABLE))
env_set("ver", version_string); /* set version variable */
cli_init();
if (IS_ENABLED(CONFIG_USE_PREBOOT))
run_preboot_environment_command();
....
}