U-Boot使用指南:环境变量、脚本与镜像操作
1. 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 splash 0x50