Skip to contentSkip to conversation

is it possible to make the booting sequence in U-boot?

U-Boot-Users Bin 3 participants 9 messages Oct 4, 2007 – Oct 5, 2007

lore
Share & tools
lore

Bin

author
#0 lore raw

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

Signature · 2 lines
View this message in context: http://www.nabble.com/is-it-possible-to-make-the-booting-sequence-in-U-boot--tf4571860.html#a13049956
Sent from the Uboot - Users mailing list archive at Nabble.com.
#1 lore raw

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?? <[email protected]> a ?crit?:

Quoted 17 lines

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

#7 lore raw
In reply to Bin
Quoted 8 lines · In message <[email protected]> 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

Signature · 6 lines
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 at denx.de
"Life and death are seldom logical."
"But attaining a desired goal always is."
	-- McCoy and Spock, "The Galileo Seven", stardate 2821.7
author
#8 lore raw

This one sounds great! I will try this one first, and will get the feedback here, thanks a lot!

Regards,

Bin

Quoted 25 lines

To: xubin0712 at hotmail.com
CC: u-boot-users at lists.sourceforge.net
From: wd at 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

Quoted 8 lines · In message <[email protected]> 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".

Quoted 16 lines

That's all.

See also the manual for additional bells and whistles like watchdog support, boot counter etc.

Best regards,

Wolfgang Denk

Signature · 6 lines
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 at 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_OctWLtagline
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20071004/9726c221/attachment.htm

author
#2 lore raw
In reply to Jean-Christophe PLAGNIOL-VILLARD

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

Quoted 45 lines

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 at jcrosoft.com
To: xubin0712 at hotmail.com; u-boot-users at 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

Quoted 22 lines

Best Regards
Le 5/10/07 0:17, ? Bin ? <[email protected]> a ?crit :

Quoted 17 lines

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20071004/a48a0d6b/attachment.htm

#3 lore raw
Quoted 4 lines · In message <[email protected]> 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:

Quoted 23 lines
Quoted 23 lines

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

Quoted 8 lines
Quoted 8 lines

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

Signature · 5 lines
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 at denx.de
If I had to live my life again,  I'd  make  the  same  mistakes, only
sooner.                                          -- Tallulah Bankhead
#4 lore raw

Le 5/10/07 1:02, ??Wolfgang Denk?? <[email protected]> a ?crit?:

Quoted 42 lines
Quoted 4 lines · In message <[email protected]> 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:

Quoted 23 lines
Quoted 23 lines

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

Quoted 8 lines
Quoted 8 lines

if watchdog timeout
Error Message No system available
else
Banzai System Start
endif
endif
endif
endif

Quoted 1 line

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

Quoted 4 lines

Best regards,

Wolfgang Denk

author
#5 lore raw

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

Quoted 60 lines

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 at jcrosoft.com
To: wd at denx.de; xubin0712 at hotmail.com
CC: u-boot-users at lists.sourceforge.net

Le 5/10/07 1:02, ? Wolfgang Denk ? <[email protected]> a ?crit :

Quoted 42 lines
Quoted 4 lines · In message <[email protected]> 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:

Quoted 23 lines
Quoted 23 lines

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

Quoted 8 lines
Quoted 8 lines

if watchdog timeout
Error Message No system available
else
Banzai System Start
endif
endif
endif
endif

Quoted 1 line

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

Quoted 21 lines

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

Quoted 4 lines

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_OctWLtagline
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20071004/89a3ce1a/attachment.htm

#6 lore raw
Quoted 7 lines · In message <[email protected]> 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

Signature · 5 lines
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 at denx.de
Quote from the Boss... "I didn't say it was your fault.  I said I was
going to blame it on you."