
Le 05/08/2010 16:22, Bas Mevissen a écrit :
On Thu, 5 Aug 2010 15:41:35 +0200, Lasse Skovlasko@kk-electronic.com wrote:
Hi
Im working on a target where I use the u-boot and think a little about good techniques for upgrade the BSP on the target and to make it fails saft.
Is ther any helpeful things I can use in uboot for this.?
My plan is to split my flash I 4 levels.
High Filesystem BSP_2 BSP_1 uBoot Low
And then let uBoot make a checksum on BSP_2 and boot this. If it's not is possible then boot BSP_1.
Another option is to build in a telnet session or something in the bootloader so ist possible to upgrade remote on only a Ethernet
connection.
But it think the best is to keep the bootloader "simple".
/Lasse
You could add a command to u-boot to do checksum stuff and store the result in an environment variable. Then you have the boot command be something like:
bootcmd='check_boot; bootm $(pref_bsp_addr)'
If the BSPs are in uImage format (i.e., supposed to be copied to RAM then booted), for which integrity checking already exists. A dirty test on my edminiv2 says that the bollowing u-boot command:
bootm 200000; bootm 300000
tries to boot an uImage from address 200000 and if it fails, tries to boot from 300000. Of course there may be smarter ways, but the basics are there already. Note that this does not protect agains the first BSP being buggy once booted, though, but there's little one can do against this.
As for the remote telnet, the existing netconsole might fit the bill.
Amicalement,