[U-Boot] Booting different kernel from U-Boot based on time stamp
Hemal Patel
hemal.patel at slscorp.com
Mon Jan 21 14:45:49 CET 2013
1.What do you mean by board specific ?
2.Which file should I modify?
3.From which file this bootm command is called?And where do I find this
file in stack?
Regards,
Hemal Patel
On Monday 21 January 2013 06:19 PM, Wolfgang Denk wrote:
> Dear Hemal Patel,
>
> In message<assp.0730d63214.50F9164E.7070301 at slscorp.com> you wrote:
>> For example:-
>>
>> |If kernel-1 is new, U-Boot will boot Kernel-1. and leave kernel-2 as it is.
>> If kernel-2 is new, U-Boot will boot kernel-2. and leave kernel-2 as it is.
>> |
>>
>> Questions:-
>>
>> |Is it possible to do so?
> This is software,so everything is possible, if you assign sufficient
> resources to the task ;-)
>
>> How can I add such functionality in U-boot?
> Yes, this is not difficult.
>
>> Where to chage the code for the same?
> The clean way would be to add a (board specific) command to either
> make accessable (so you can use the itest command on them) or to
> compare (so that you can use plain "if") the time stamps of two
> images.
>
> Assume your command "is_newer_img" takes the addresses of two legacy
> image files and returns true (i. e. with a zero return code) if this
> is the case, then you could just write:
>
> if is_newer_img ${kernel_1_addr} ${kernel_2_addr}
> then bootm ${kernel_1_addr}
> else bootm ${kernel_2_addr}
> fi
>
> Alternatively, for a quick& dirty test or show case, you could of
> course peek directly at the ih_time entry of the image_header
> structure. This would not even need any new code, existing features
> would be sufficient.
>
> Best regards,
>
> Wolfgang Denk
>
More information about the U-Boot
mailing list