
Dear Ravi Shekhar,
In message OFFE8B8C82.0B75DDB4-ON652576B6.001CDB45-652576B6.001D0D2F@lntemsys.com you wrote:
My board has two boot-loaders namely, primary bootloader and secondary bootloader. however the image file name for both the bootloaders are same, u-boot.bin. Now, I want to make a check before loading u-boot to flash whether its a primary bootloader or secondary bootloader. What i thought is, why not to append primary or secondary string after the version in the uboot..bin but I am not sure how it works. Can anyone please give me some Ideas on this.
You have to be more specific.
Why do both your images have the same file name? Wouldit not besimple enough to rename at least one of them?
I understand the images are different (otherwise changing the version string would not work).
You write "check before loading u-boot to flash" - in this case, how does modifying the version string inside the image help you? You would need a tool to "look inside" the images so it can locate and extract this string.
Assuming you are using U-Boot to load the images and write these to flash, you might create U-Bot images (using mkimage with "-T firmware" and "-O u-boot") and use these. Here it is trivial to assign names to the images, which can easily be extrated (using "mkimage -l" on the command line or "iminfo" in U-Boot).
Or, with a little more effort, but a lot additional flexibility, you could create a single FIT image which holds both your primary and secondary image, so these can be installed in one go.
If I were you I would try the FIT image approach.
Best regards,
Wolfgang Denk