[U-Boot-Users] bootcmd

Hi,
I'm trying to figure out how to make my software field update process robust. Currently, my bootcmd is 'fsload 20000000 uImage; bootm 20000000'
Is there anyway for u-boot to determine, in one of these commands, that some command failed, and to do something else instead?
For example, if I failed to load uImage, could I check for its existence, and boot that instead?
My update process will copy the new image into the same partition as uImage, as uImage.new, and then rename uImage to uImage.old, rename uImage.new to uImage, and then delete uImage.old.
If something untoward should happen (like the idiot turns off the power in the middle of the update), I'm wondering how I can have u-boot get around this.
Thanks,
Matt

Matt Gessner wrote:
Hi,
I'm trying to figure out how to make my software field update process robust. Currently, my bootcmd is 'fsload 20000000 uImage; bootm 20000000'
Is there anyway for u-boot to determine, in one of these commands, that some command failed, and to do something else instead?
fsload 20000000 uImage && bootm 20000000

In message 465DE93D.1010907@freescale.com you wrote:
Matt Gessner wrote:
Hi,
I'm trying to figure out how to make my software field update process robust. Currently, my bootcmd is 'fsload 20000000 uImage; bootm 20000000'
Is there anyway for u-boot to determine, in one of these commands, that some command failed, and to do something else instead?
fsload 20000000 uImage && bootm 20000000
Or, without using the hush shell:
=> sete kaddr 20000000 => sete kload 'fsload ${kaddr} uImage' => sete kboot 'bootm ${kaddr}' => save
followed by "run kload kboot"
See http://www.denx.de/wiki/view/DULG/CommandLineParsing for details.
Best regards,
Wolfgang Denk

Thanks Wolfgang & Timur,
I think I want something like this:
setenv addr 20000000 fsload $addr uImage || fsload $addr uImage.new && bootm $addr
If the bootloader can't find uImage, try to find uImage.new.
Does that make sense? I'm using u-boot 1.2.0.
Matt
-----Original Message----- From: wd@denx.de [mailto:wd@denx.de] Sent: Wednesday, May 30, 2007 7:23 PM To: Timur Tabi Cc: Matt Gessner; u-boot-users@lists.sourceforge.net Subject: Re: [U-Boot-Users] bootcmd
In message 465DE93D.1010907@freescale.com you wrote:
Matt Gessner wrote:
Hi,
I'm trying to figure out how to make my software field update process robust. Currently, my bootcmd is 'fsload 20000000 uImage; bootm 20000000'
Is there anyway for u-boot to determine, in one of these commands,
that
some command failed, and to do something else instead?
fsload 20000000 uImage && bootm 20000000
Or, without using the hush shell:
=> sete kaddr 20000000 => sete kload 'fsload ${kaddr} uImage' => sete kboot 'bootm ${kaddr}' => save
followed by "run kload kboot"
See http://www.denx.de/wiki/view/DULG/CommandLineParsing for details.
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de Es sind überhaupt nur die Dummköpfe, die sich den Befehlen der Mäch- tigen widersetzen. Um sie zu ruinieren ist es genug, ihre Befehle treu zu erfüllen. - Peter Hacks: "Die schöne Helena"

In message 131AF8573CF31945B5B11E4201D3F1E142BC78@mail3.Avidyne.com you wrote:
setenv addr 20000000 fsload $addr uImage || fsload $addr uImage.new && bootm $addr
If the bootloader can't find uImage, try to find uImage.new.
Does that make sense? I'm using u-boot 1.2.0.
Sure, why not? Just enable the hush shell in your board config file.
Best regards,
Wolfgang Denk

OK, I tried something slightly different but it doesn't boot.
fsload $addr uImage || chpart nand0,1 || fsload $addr uImage && bootm $addr
I can tell it didn't find uImage in the first partition and that it switched over to the second partition (b/c mtddevnum changes). Then it loaded uImage from the second partition, but then I get a prompt back.
Any suggestions??
Thanks,
Matt
-----Original Message----- From: wd@denx.de [mailto:wd@denx.de] Sent: Thursday, May 31, 2007 10:02 AM To: Matt Gessner Cc: u-boot-users@lists.sourceforge.net Subject: Re: [U-Boot-Users] bootcmd
In message 131AF8573CF31945B5B11E4201D3F1E142BC78@mail3.Avidyne.com
you
wrote:
setenv addr 20000000 fsload $addr uImage || fsload $addr uImage.new && bootm $addr
If the bootloader can't find uImage, try to find uImage.new.
Does that make sense? I'm using u-boot 1.2.0.
Sure, why not? Just enable the hush shell in your board config file.
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de "There are three principal ways to lose money: wine, women, and en- gineers. While the first two are more pleasant, the third is by far the more certain." -- Baron Rothschild, ca. 1800

In message 131AF8573CF31945B5B11E4201D3F1E142BC7A@mail3.Avidyne.com you wrote:
OK, I tried something slightly different but it doesn't boot.
fsload $addr uImage || chpart nand0,1 || fsload $addr uImage && bootm $addr
Try:
=> sete load_alt 'chpart nand0,1 && fsload $addr uImage' => sete load_img 'fsload $addr uImage || run load_alt' => run load_img && bootm
Best regards,
Wolfgang Denk
participants (3)
-
Matt Gessner
-
Timur Tabi
-
Wolfgang Denk