[U-Boot-Users] is it possible to make the booting sequence in U-boot?

Hi, All,
I am trying to make two different booting methods with some booting sequence in u-boot, like the bios in PC does. Basically I have kernel Image 1 in NAND and File system 1 on hard drive, kernel image 2 and File system 2 also on the same NAND Flash. The goal here is try to boot the system from Image 1 and file system 1 first, and if the hard drive fails, the bootloader (u-boot) will try to boot from Image 2 and File system 2 *automatically*. My question is, is it possible to achieve this in uboot? If so, any hints?
Any suggestions are appreciated.
Thanks and Regards,
Bin

You can try to boot your first kernel image and if it does not found your kernel switch to the other with the "if" command.
And if you have a watchdog you can incrise your ttl and if your system does not boot in a predefine laps time you reboot and try your second image.
This the algo Set env try First Boot From First if not enter in entry point Set env try First Boot From second if not enter in entry point Error Message No system available else if watchdog timeout Error Message No system available else Banzai System Start endif endif else if watchdog timeout Error Message No system available else Set env try First Boot From second if not enter in entry point Error Message No system available else if watchdog timeout Error Message No system available else Banzai System Start endif endif endif endif
Best Regards Le 5/10/07 0:17, « Bin » xubin0712@hotmail.com a écrit :
Hi, All,
I am trying to make two different booting methods with some booting sequence in u-boot, like the bios in PC does. Basically I have kernel Image 1 in NAND and File system 1 on hard drive, kernel image 2 and File system 2 also on the same NAND Flash. The goal here is try to boot the system from Image 1 and file system 1 first, and if the hard drive fails, the bootloader (u-boot) will try to boot from Image 2 and File system 2 *automatically*. My question is, is it possible to achieve this in uboot? If so, any hints?
Any suggestions are appreciated.
Thanks and Regards,
Bin

Hi, Jean,
Thanks a lot! But I am not sure, is there the "if " command in uboot? I read the manual and did not find it. I am just work on it for a few weeks, so...
Thanks and Regards,
Bin
Date: Fri, 5 Oct 2007 00:30:42 +0200 Subject: Re: [U-Boot-Users] is it possible to make the booting sequence in U-boot? From: plagnioj@jcrosoft.com To: xubin0712@hotmail.com; u-boot-users@lists.sourceforge.net
You can try to boot your first kernel image and if it does not found your kernel switch to the other with the "if" command.
And if you have a watchdog you can incrise your ttl and if your system does not boot in a predefine laps time you reboot and try your second image.
This the algo Set env try First Boot From First if not enter in entry point Set env try First Boot From second if not enter in entry point Error Message No system available else if watchdog timeout Error Message No system available else Banzai System Start endif endif else if watchdog timeout Error Message No system available else Set env try First Boot From second if not enter in entry point Error Message No system available else if watchdog timeout Error Message No system available else Banzai System Start endif endif endif endif
Best Regards Le 5/10/07 0:17, « Bin » xubin0712@hotmail.com a écrit :
Hi, All,
I am trying to make two different booting methods with some booting sequence in u-boot, like the bios in PC does. Basically I have kernel Image 1 in NAND and File system 1 on hard drive, kernel image 2 and File system 2 also on the same NAND Flash. The goal here is try to boot the system from Image 1 and file system 1 first, and if the hard drive fails, the bootloader (u-boot) will try to boot from Image 2 and File system 2 *automatically*. My question is, is it possible to achieve this in uboot? If so, any hints?
Any suggestions are appreciated.
Thanks and Regards,
Bin
_________________________________________________________________ Peek-a-boo FREE Tricks & Treats for You! http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us

In message BAY124-W1322E27AA87E199D7EB970A3A80@phx.gbl you wrote:
Thanks a lot! But I am not sure, is there the "if " command in uboot? I rea d the manual and did not find it. I am just work on it for a few weeks, so. ..
Yes, there is, if you configure the hush shell as command line parser.
But then:
Set env try First Boot From First if not enter in entry point Set env try First Boot From second if not enter in entry point Error Message No system available else if watchdog timeout Error Message No system available else Banzai System Start endif endif else if watchdog timeout Error Message No system available else Set env try First Boot From second if not enter in entry point Error Message No system available else if watchdog timeout Error Message No system available else Banzai System Start endif endif endif endif
This is overly complex and not needed at all.
Best regards,
Wolfgang Denk

Le 5/10/07 1:02, « Wolfgang Denk » wd@denx.de a écrit :
In message BAY124-W1322E27AA87E199D7EB970A3A80@phx.gbl you wrote:
Thanks a lot! But I am not sure, is there the "if " command in uboot? I rea d the manual and did not find it. I am just work on it for a few weeks, so. ..
Yes, there is, if you configure the hush shell as command line parser.
But then:
Set env try First Boot From First if not enter in entry point Set env try First Boot From second if not enter in entry point Error Message No system available else if watchdog timeout Error Message No system available else Banzai System Start endif endif else if watchdog timeout Error Message No system available else Set env try First Boot From second if not enter in entry point Error Message No system available else if watchdog timeout Error Message No system available else Banzai System Start endif endif endif endif
This is overly complex and not needed at all.
Complex, maybe but its allow you to known the current state of your boot and it just a timeline algo not script the run boot_nand; run boot_flash;print $error_message
Can be represent as fallow
Set env try First Boot From First if not enter in entry point Set env try First Boot From second if not enter in entry point Error Message No system available else Banzai System Start endif endif else Banzai System Start endif
Best regards,
Wolfgang Denk

Hi, Jean and Wolfgang ,
Thanks a lot for your reply.
I think there is some problem here. For boot method 1, the kernel image is in NAND and file system in hard drive; for boot method 2, the kernel image and file system is also in the same nand. so if there are some problems with the hard drive, the system is already booted, passed uboot and kernel image loading procedure, and will hang with the hard drive filesystem, while the uboot won't know this.
So maybe I have to consider Jean's suggestion...
Any comments?
Thanks and Regards,
Bin
Date: Fri, 5 Oct 2007 01:19:45 +0200 Subject: Re: [U-Boot-Users] is it possible to make the booting sequence in U-boot? From: plagnioj@jcrosoft.com To: wd@denx.de; xubin0712@hotmail.com CC: u-boot-users@lists.sourceforge.net
Le 5/10/07 1:02, « Wolfgang Denk » wd@denx.de a écrit :
In message BAY124-W1322E27AA87E199D7EB970A3A80@phx.gbl you wrote:
Thanks a lot! But I am not sure, is there the "if " command in uboot? I rea d the manual and did not find it. I am just work on it for a few weeks, so. ..
Yes, there is, if you configure the hush shell as command line parser.
But then:
Set env try First Boot From First if not enter in entry point Set env try First Boot From second if not enter in entry point Error Message No system available else if watchdog timeout Error Message No system available else Banzai System Start endif endif else if watchdog timeout Error Message No system available else Set env try First Boot From second if not enter in entry point Error Message No system available else if watchdog timeout Error Message No system available else Banzai System Start endif endif endif endif
This is overly complex and not needed at all.
Complex, maybe but its allow you to known the current state of your boot and it just a timeline algo not script the run boot_nand; run boot_flash;print $error_message
Can be represent as fallow
Set env try First Boot From First if not enter in entry point Set env try First Boot From second if not enter in entry point Error Message No system available else Banzai System Start endif endif else Banzai System Start endif
Best regards,
Wolfgang Denk
_________________________________________________________________ Help yourself to FREE treats served up daily at the Messenger Café. Stop by today. http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWL...

In message BAY124-W4625D166497D1409005763A3A80@phx.gbl you wrote:
I think there is some problem here. For boot method 1, the kernel image is in NAND and file system in hard drive; for boot method 2, the kernel image and file system is also in the same nand. so if there are some problems wit h the hard drive, the system is already booted, passed uboot and kernel ima ge loading procedure, and will hang with the hard drive filesystem, while t he uboot won't know this.
This is where the watchdog and boot counter enter the game.
Best regards,
Wolfgang Denk

In message 13049956.post@talk.nabble.com you wrote:
I am trying to make two different booting methods with some booting sequence in u-boot, like the bios in PC does. Basically I have kernel Image 1 in NAND and File system 1 on hard drive, kernel image 2 and File system 2 also on the same NAND Flash. The goal here is try to boot the system from Image 1 and file system 1 first, and if the hard drive fails, the bootloader (u-boot) will try to boot from Image 2 and File system 2 *automatically*. My question is, is it possible to achieve this in uboot? If so, any hints?
This is possible, and actually trivial.
Define two environment variables, say "boot_disk" and "boot_nand" to boot from disk or NAND, respectively, such that "run boot_disk" will perform a disk boot the way you want it, and "run boot_nand" will boot form NAND.
Then define "bootcmd" as "run boot_disk;run "boot_nand".
That's all.
See also the manual for additional bells and whistles like watchdog support, boot counter etc.
Best regards,
Wolfgang Denk

This one sounds great! I will try this one first, and will get the feedback here, thanks a lot!
Regards,
Bin
To: xubin0712@hotmail.com CC: u-boot-users@lists.sourceforge.net From: wd@denx.de Subject: Re: [U-Boot-Users] is it possible to make the booting sequence in U-boot? Date: Fri, 5 Oct 2007 00:32:38 +0200
In message 13049956.post@talk.nabble.com you wrote:
I am trying to make two different booting methods with some booting sequence in u-boot, like the bios in PC does. Basically I have kernel Image 1 in NAND and File system 1 on hard drive, kernel image 2 and File system 2 also on the same NAND Flash. The goal here is try to boot the system from Image 1 and file system 1 first, and if the hard drive fails, the bootloader (u-boot) will try to boot from Image 2 and File system 2 *automatically*. My question is, is it possible to achieve this in uboot? If so, any hints?
This is possible, and actually trivial.
Define two environment variables, say "boot_disk" and "boot_nand" to boot from disk or NAND, respectively, such that "run boot_disk" will perform a disk boot the way you want it, and "run boot_nand" will boot form NAND.
Then define "bootcmd" as "run boot_disk;run "boot_nand".
That's all.
See also the manual for additional bells and whistles like watchdog support, boot counter etc.
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 "Life and death are seldom logical." "But attaining a desired goal always is." -- McCoy and Spock, "The Galileo Seven", stardate 2821.7
_________________________________________________________________ Help yourself to FREE treats served up daily at the Messenger Café. Stop by today. http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWL...
participants (4)
-
Bin
-
Bin Xu
-
Jean-Christophe PLAGNIOL-VILLARD
-
Wolfgang Denk