Re: [U-Boot] stopping u-boot from booting an old image in RAM.

2009-10-26 Thread David Collier

now that I have read TFM...

I find that the easier way to do this, rather than installing hush and
using  would have been to 

define 
setenv x mmcinit
setenv y 
setenv z bootm 

setenv bootcmd run x y z

in which case y would only run if x succeeded.

but I like hush and don't regret doing it

David


In article memo.20091021160842.44...@postmaster+dexdyne.com.cix.co.uk,
from_denx_ub...@dexdyne.com (David Collier) wrote:

 *From:* David Collier from_denx_ub...@dexdyne.com
 *To:* u-boot@lists.denx.de
 *Date:* Wed, 21 Oct 2009 16:08 +0100 (BST)
 
 If I boot this unit, then remove the SD card it booted from and 
 reset it,
 it happily boots some Linux image which is lying around in memory.
 
 It even does it after a short power-off power-on sequence.
 
 I think that's horrible behaviour.
 
 I was told I could use  instead of ; between the commands in the
 bootcmd string to stop this, but that barfed, and then I was told 
 that
 maybe  only existed if scripting is enabled
 
 Could anyone please talk me through the steps of either
 
 1. doing what it takes to enable this  feature, so that if it 
 fails to
 find the card, it doesn't go on and try to boot.
 
 or
 
 2. something else that will do it, such as so effectively buggering 
 up an
 image that has been booted from that it will never be re-used
 
  :-)
 
 TVM
 
 David Collier
 
 www.dexdyne.com
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot
 


David Collier

www.dexdyne.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] stopping u-boot from booting an old image in RAM.

2009-10-21 Thread Thompson, Nick (GE EntSol, Intelligent Platforms)


 -Original Message-
 From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de] On 
 Behalf Of David Collier
 Sent: 21 October 2009 16:08
 To: u-boot@lists.denx.de
 Subject: [U-Boot] stopping u-boot from booting an old image in RAM.
 
 If I boot this unit, then remove the SD card it booted from and reset it,
 it happily boots some Linux image which is lying around in memory.
 
 It even does it after a short power-off power-on sequence.
 
 I think that's horrible behaviour.
 
 I was told I could use  instead of ; between the commands in the
 bootcmd string to stop this, but that barfed, and then I was told that
 maybe  only existed if scripting is enabled
 
 Could anyone please talk me through the steps of either
 
 1. doing what it takes to enable this  feature, so that if it fails to
 find the card, it doesn't go on and try to boot.
 
 or
 
 2. something else that will do it, such as so effectively buggering up an
 image that has been booted from that it will never be re-used
 
  :-)
 
 TVM
 
 David Collier

Probably a simple mw (memory write) to the entry point of linux, before
You attempt to reload the image, would do the trick?

Usage:
mw [.b, .w, .l] address value [count]

Nick.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] stopping u-boot from booting an old image in RAM.

2009-10-21 Thread Wolfgang Denk
Dear David Collier,

In message memo.20091021160842.44...@postmaster+dexdyne.com.cix.co.uk you 
wrote:
 If I boot this unit, then remove the SD card it booted from and reset it,
 it happily boots some Linux image which is lying around in memory.

Maybe you should start reading the documentation?

 It even does it after a short power-off power-on sequence.

It takes time until memory loses it's content, and as long as the
checksums are OK the image is still valid. It is up to you to provide
a sane boot command which checks for error code.

 I think that's horrible behaviour.

Indeed - but that's not U-Boot's fault, it's horrible programming by
the user, i. e. yourself.

 I was told I could use  instead of ; between the commands in the
 bootcmd string to stop this, but that barfed, and then I was told that

You really should read the documentation, at least the FAQ, for
example 14.2.16. How the Command Line Parsing Works at
http://www.denx.de/wiki/view/DULG/CommandLineParsing

 maybe  only existed if scripting is enabled

Whoever told you that used poor language. What he meant was: if the
Hush shell is configured as command line parser for your board.

 Could anyone please talk me through the steps of either
 
 1. doing what it takes to enable this  feature, so that if it fails to
 find the card, it doesn't go on and try to boot.

To enable the hush shell, you have to set (at least) the
CONFIG_SYS_HUSH_PARSER configuration option in your board config
file. But even the old, simple command line parser can be used to do
what you want. Just RTFM.

 2. something else that will do it, such as so effectively buggering up an
 image that has been booted from that it will never be re-used

I cannot parse that. If an image has been booted, U-Boot is gone and
out of the way, and whatever code was in the image is running.

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: w...@denx.de
Just Say No.   - Nancy Reagan
No.- Ronald Reagan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] stopping u-boot from booting an old image in RAM.

2009-10-21 Thread Wolfgang Denk
Dear Thompson, Nick (GE EntSol, Intelligent Platforms),

In message 610d18d1f0bb204d8ab39bb1c42187e8041e7...@lonmlvem09.e2k.ad.ge.com 
you wrote:
 
  2. something else that will do it, such as so effectively buggering up an
  image that has been booted from that it will never be re-used
...
 Probably a simple mw (memory write) to the entry point of linux, before
 You attempt to reload the image, would do the trick?

This is not needed. Commands return return codes, and the command line
parser provides ways to act on these. It's all written in the
documentation.

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: w...@denx.de
Substitute damn every time you're inclined to write very; your
editor will delete it and the writing will be just as it should be.
- Mark Twain
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] stopping u-boot from booting an old image in RAM.

2009-10-21 Thread David Collier
In article
610d18d1f0bb204d8ab39bb1c42187e8041e7...@lonmlvem09.e2k.ad.ge.com,
nick.thomp...@gefanuc.com (Thompson, Nick (GE EntSol, Intelligent
Platforms)) wrote:

 *From:* Thompson, Nick (GE EntSol, Intelligent Platforms) 
 nick.thomp...@gefanuc.com
 *To:* from_denx_ub...@dexdyne.com, u-boot@lists.denx.de
 *Date:* Wed, 21 Oct 2009 16:39:18 +0100
 
  -Original Message-
  From: u-boot-boun...@lists.denx.de 
  [mailto:u-boot-boun...@lists.denx.de] On Behalf Of David Collier
  Sent: 21 October 2009 16:08
  To: u-boot@lists.denx.de
  Subject: [U-Boot] stopping u-boot from booting an old image in 
  RAM.
  
  If I boot this unit, then remove the SD card it booted from and 
  reset it,
  it happily boots some Linux image which is lying around in memory.
  
  It even does it after a short power-off power-on sequence.
  
  I think that's horrible behaviour.
  
  I was told I could use  instead of ; between the commands in the
  bootcmd string to stop this, but that barfed, and then I was told 
  that
  maybe  only existed if scripting is enabled
  
  Could anyone please talk me through the steps of either
  
  1. doing what it takes to enable this  feature, so that if it 
  fails to
  find the card, it doesn't go on and try to boot.
  
  or
  
  2. something else that will do it, such as so effectively 
  buggering up an
  image that has been booted from that it will never be re-used
  
   :-)
  
  TVM
  
  David Collier
 
 Probably a simple mw (memory write) to the entry point of linux, 
 before
 You attempt to reload the image, would do the trick?
 
 Usage:
 mw [.b, .w, .l] address value [count]
 
 Nick.
 
so something like

#define CONFIG_BOOTCOMMAND  \
mmcinit ; mw 0x1040 55 ; ext2load mmc 0:1 0x1040  /boot/uImage 
;
bootm 0x1040



That looks simple enough

David Collier

www.dexdyne.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot