All of lore.kernel.org
 help / color / mirror / Atom feed
From: frisky_linux <frisky_linux@163.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] autoscr can't execute script in u-boot 1.2.0
Date: Wed, 26 Sep 2007 16:25:52 +0800	[thread overview]
Message-ID: <200709261625514208013@163.com> (raw)
In-Reply-To: 20070926072939.51D782405D@gemini.denx.de

Yes! You are right!
My test.txt has one '0x0D' at the end of the line:( It should be '0x0A',not '0x0D 0x0A'.
I have copied a DOS text file.
Thank you!

Frisky Li
2007-09-26



???? Wolfgang Denk
????? 2007-09-26 15:29:45
???? frisky_linux
??? U-Boot-Users
??? Re: [U-Boot-Users] autoscr can't execute script in u-boot 1.2.0

In message  <200709261025129335711@163.com > you wrote:
>
> I have tested the autoscr command and found that autoscr can't execute script in u-boot 1.2.0. 
> The steps follow here:
> 1. Generate autos.img
>  1) echo "printenv serverip"  > >test.txt

Note that you *append* to "test.txt" here, so you probably already
have garbage in that file... ?

>  2) mkimage
> [frisky at FC6 test]$ mkimage -A ppc -O linux -T script -C none -a 0 -e 0  -n "auto script example"  -d test.txt autos.img && rm -rf /tftpboot/coreblade/autos.img &&  cp autos.img /tftpboot/coreblade/ 
> Image Name:   auto script example
> Created:      Wed Sep 26 10:17:46 2007
> Image Type:   PowerPC Linux Script (uncompressed)
> Data Size:    27 Bytes = 0.03 kB = 0.00 MB
> Load Address: 0x00000000
> Entry Point:  0x00000000
> Contents:
>    Image 0:       19 Bytes =    0 kB = 0 MB

This looks wrong to me.

If you execute the commands above with an empty/nonexisting file
"test.txt", the result should be:

- > ls -l test.txt
-rw-rw-r-- 1 wd wd 18 Sep 26 08:44 test.txt

i.e. the file should be 18 bytes, not 19 as in your case.

It seems you already had one byte of garbage in "test.txt"

>  3) Run it!!
> coreblade = > autoscr 200000
> ## Executing script at 00200000
> " not definedrverip
> 
>  4) But I can see the serverip defined.
> coreblade = > printe serverip
> serverip=10.3.8.66 
> 
> I don't know what's the problem.  Could you please help me? Thank you very much!

This works fine for me:

= > md 200000
00200000: 27051956 321bc087 46f9ffe1 0000001a    '..V2...F.......
00200010: 00000000 00000000 e68800bd 05070600    ................
00200020: 6175746f 20736372 69707420 6578616d    auto script exam
00200030: 706c6500 00000000 00000000 00000000    ple.............
00200040: 00000012 00000000 7072696e 74656e76    ........printenv
00200050: 20736572 76657269 700a0000 00000000     serverip.......
00200060: 00000000 00000000 00000000 00000000    ................
00200070: 00000000 00000000 00000000 00000000    ................
00200080: 00000000 00000000 00000000 00000000    ................
...
= > imi 200000

## Checking Image at 00200000 ...
   Image Name:   auto script example
   Image Type:   PowerPC Linux Script (uncompressed)
   Data Size:    26 Bytes =  0 kB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
= > autoscr 200000
## Executing script at 00200000
serverip=192.168.1.1
= >

I thing what you see is a GIGO effect (garbage in, garbage out)...

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 at denx.de
There's no honorable way to kill, no gentle way to destroy.  There is
nothing good in war.  Except its ending.
-- Abraham Lincoln, "The Savage Curtain", stardate 5906.5

  reply	other threads:[~2007-09-26  8:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-26  2:25 [U-Boot-Users] autoscr can't execute script in u-boot 1.2.0 frisky_linux
2007-09-26  7:29 ` Wolfgang Denk
2007-09-26  8:25   ` frisky_linux [this message]
2007-09-26  9:01     ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200709261625514208013@163.com \
    --to=frisky_linux@163.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.