
Ajay,
On Wed, 2006-08-23 at 21:36 +0530, Ajay Jain wrote:
Hi,
I have an elementary doubt regarding u-boot scripts. I will explain this by taking an example. Let the script be setenv my_script setenv a 5 ; setenv b 5 ; On the u-boot prompt, I can run this script as "run my_script". Is it possible to save this script in some way in the uboot image itself, so that when I download uboot, I have this variable set in the environment. Basically I am looking for some kind of compile time support, the way it happens for bootcmd. I went through the documentation, but it only talked about running scripts by downloading a text-file after u-boot is up. I am looking for some kind of compile time support.
The command 'setenv' means 'set the value of an environment variable'. Your script can be an environment variable as long as you excape it properly. Typing 'saveenv' afterwards will save this to wherever you store your environment variables (either in separate flash sectors, the U-boot sector or EEPROM). It will then be available persistently. You can of course hard-code default environment variables. Look through the code - you'll see lots of examples.
regards, Ben