U-Boot的使用与配置全解析
1. U-Boot环境变量的使用
U-Boot启动并运行后,可通过设置相应的环境变量对其进行配置。U-Boot环境变量的使用与Unix shell(如bash)中的环境变量使用非常相似。要查看目标设备上环境变量的当前值,可使用 printenv
命令。以下是OpenMoko GTA01开发硬件上部分环境变量的示例:
GTA01Bv4 # printenv
bootargs=
bootdelay=3
baudrate=115200
usbtty=cdc_acm
bootargs_base=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8
stdin=serial
stdout=serial
stderr=serial
dontask=y
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; bootm 0x30100000
menu_1=Set console to USB: setenv stdin usbtty; setenv stdout usbtty; se
menu_2=Set console to serial: setenv stdin serial; setenv stdout serial; \
setenv stderr serial
menu_3=Power off: neo1973 power-off
splashimage=nand read.e 0x36000000 spl