Well, here I'm not giving anything from the sky or vanishing anything like a magician, but trying to show a Utility tool (you can't say exactly it's a tool, better it can be consider as one option ;) ) which already available :0 .
All you have to do is, to try some geeky way (though very simple) only at once and do the magic always.
The key tool which you have to enable is "fw_printenv" from the U-boot.
Follow the below steps to make the wonders in U-boot from your own lovely Linux console ;)
- Step 1: Generate the "fw_printenv" utility tool in U-boot
- give 'env' (optional parameter) in u-boot and compile it. Be patient for the compilation ;)
- The above step generate the 'fw_printenv' in the U-Boot directory tools/env
- Copy the 'fw_env.config' file too.
- Copy fw_printenv to /sbin on the root file system of your own board.
- The interesting thing here is that the fw_printenv binary also contains the code for fw_setenv. The functions of fw_setenv are run when the program is invoked with the name "fw_setenv". this is most easily accomplished by creating a symbolic link from fw_printenv to fw_setenv, as in "ln -sf /sbin/fw_printenv /sbin/fw_setenv"
- Remember, you copied 'fw_env.config' from 'u-boot/tools/env/' path? But you didn't play with it yet right? ;) Well, this is the right time for that! All you have to do is, copy the fw_env.config into /etc path. Finished? Relaxed? No...remember, this is a geeky professional way dude ;)
- Open the 'fw_env.config' and make required changes related to env size, flash sector size and number of sectors according to flash which you are using. You have to change the with respect to your system modification rather than simply putting it into /etc you can easily check this from /proc/mtd.
From the Linux console, you can print the u-boot setting by giving the fw_printenv where as with fw_setenv , you can edit the u-boot settings!!! Easy right?
Well, I would like to share two good web links also for your better understanding..