2010-04-12 05:58:18 u-boot environment variables
Filip Vanalme (BELGIUM)
Message: 88320
Is there a way to pass custom u-boot environment variables to the kernel ? E.g. in u-boot, I do "setenv myVar 1" and "saveenv".
In the Kernel configuration, in "Default bootloader kernel arguments" I tried by adding "test=$(myVar)" or "test=${myVar}" but that doesn't seem to work.
TranslateQuoteReplyEditDelete
2010-04-12 08:26:19 Re: u-boot environment variables
Mike Frysinger (UNITED STATES)
Message: 88328
the kernel config controls arguments compiled into the kernel and thus ignores anything from u-boot. dont do that.
look at the default env of u-boot on all ADI boards. variables are passed on the fly to the kernel command line with all of them.
bfin> print bootcmd
bootcmd=run ramboot
bfin> print ramboot
ramboot=tftp $(loadaddr) $(ramfile);run ramargs;run addip;bootm
bfin> print ramargs
ramargs=set bootargs root=/dev/mtdblock0 rw clkin_hz=25000000 earlyprintk=serial,uart0,57600 console=ttyBF0,57600
bfin> print addip
addip=set bootargs $(bootargs) ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname):eth0:off
QuoteReplyEditDelete
2010-04-12 09:39:37 Re: u-boot environment variables
Filip Vanalme (BELGIUM)
Message: 88332
Thanks Mike.
I removed it from the Kernel's configuration and looked for it in the U-boot. I found a define CONFIG_EXTRA_ENV_SETTINGS that obviously is intended to add custom environment settings. But how can I retrieve this from the kernel ? Or do I have to add it to an other environment setting e.g. bootargs ?
TranslateQuoteReplyEditDelete
2010-04-12 09:43:02 Re: u-boot environment variables
Mike Frysinger (UNITED STATES)
Message: 88333
as i showed, you have to do it on the fly from u-boot. use the run command to expand variables into their values.