print bootcmd
# Output:bootcmd=mmc dev ${mmcdev}; if mmc rescan; thenif run loadbootscript; then run bootscript; elseif test ${sec_boot}= yes; thenif run loadcntr; then run mmcboot; else run netboot; fi; elseif run loadimage; then run mmcboot; else run netboot; fi; fi; fi; else booti ${loadaddr} - ${fdt_addr}; fi
整理過後, 我們可以觀察到它真正會執行到的指令為 run loadimage ,接著會是 run mmcboot
bootcmd= mmc dev ${mmcdev};
if mmc rescan; thenif run loadbootscript; then run bootscript;
elseif test ${sec_boot}= yes; thenif run loadcntr; then run mmcboot;
else run netboot;
fi;
elseif run loadimage; then run mmcboot;
else run netboot;
fi;
fi;
fi;
else booti ${loadaddr} - ${fdt_addr};
fi
mmcboot=
echo Booting from mmc ...;
run mmcargs;
if test ${sec_boot} = yes; then
if run auth_os; then
run boot_os;
else
echo ERR: failed to authenticate;
fi;
else
if test ${boot_fdt} = yes || test ${boot_fdt} = try; then
if run loadfdt; then
run boot_os;
else
echo WARN: Cannot load the DT;
fi;
else
echo wait for boot;
fi;
fi;