uboot CONFIG_SYS_HUSH_PARSER 选项

u-boot中配置选项众多,有些配置选择提供了很好的功能,CONFIG_SYS_HUSH_PARSER 选项就提供了比较实用的功能,


看看一个例子:
在CONFIG_SYS_HUSH_PARSER 选项没有打开之前的运行结果:
环境变量配置如下:
 bootcmd:
"setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath" \
      "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off" \
       "console=$consoledev,$baudrate$othbootargs;" \
       "tftp $loadaddr $bootfile;"\
       "tftp $fdtaddr $fdtfile;"\
       "bootm $loadaddr -$fdtaddr"
...
bootfile=uImage
loadaddr=0x01000000
       fdtaddr=0x00c00000
       fdtfile=EVM440.dtb
...


EVM440:/#boot
Setting the MAC address 0:11:3c:6e:f3:5f
TFTP from server 10.159.201.10; our IP address is10.141.179.215
Filename '$bootfile'.
Load address: 0x0
Loading: ## Warning: gatewayip needed but not set
T
TFTP error: 'File not found' (1)
Not retrying...
Setting the MAC address 0:11:3c:6e:f3:5f
TFTP from server 10.159.201.10; our IP address is10.141.179.215
Filename '$fdtfile'.
Load address: 0x0
Loading: ## Warning: gatewayip needed but not set

TFTP error: 'File not found' (1)
Not retrying...


配置CONFIG_SYS_HUSH_PARSER选项后,结果是:

EVM440:/#boot
Setting the MAC address 0:11:3c:6e:f3:5f
TFTP from server 10.159.201.10; our IP address is10.141.179.215
Filename 'uImage'.
Load address: 0x1000000
Loading: ## Warning: gatewayip needed but not set
T
TFTP error: 'File not found' (1)
Not retrying...
Setting the MAC address 0:11:3c:6e:f3:5f
TFTP from server 10.159.201.10; our IP address is10.141.179.215
Filename 'EVM440.dtb'.
Load address: 0xc00000
Loading: ## Warning: gatewayip needed but not set

TFTP error: 'File not found' (1)
Not retrying...

也就是说没有配置CONFIG_SYS_HUSH_PARSER选项则不会解析,直接使用$loadaddr,而CONFIG_SYS_HUSH_PARSER选项配置后,$loadaddr被解析成0x1000000,CONFIG_SYS_HUSH_PARSER选项为u-boot环境变量配置提供了更灵活的机制.

你可能感兴趣的:(最新64位uboot)