Re: [U-Boot] Booting different kernel from U-Boot based on time stamp

I have made changes in cmd_bootm.c file. Is it fine? Does it affect the performance or reliability? please answer me ASAp. thank you.
Regards, Hemal Patel
On Monday 21 January 2013 07:15 PM, Hemal Patel wrote:
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 messageassp.0730d63214.50F9164E.7070301@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

Dear Hemal Patel,
In message assp.07332d33d6.50FD4712.8050405@slscorp.com you wrote:
I have made changes in cmd_bootm.c file. Is it fine?
Probably only very few people are interested in this, so please keep this is board specific code for now.
Does it affect the performance or reliability?
I cannot guess - I haven't seen your code...
please answer me ASAp.
Um... Please see http://catb.org/esr/faqs/smart-questions.html#urgent
Best regards,
Wolfgang Denk
participants (2)
-
Hemal Patel
-
Wolfgang Denk