[U-Boot-Users] autoscr can't execute script in u-boot 1.2.0
Wolfgang Denk
wd at denx.de
Wed Sep 26 09:29:39 CEST 2007
In message <200709261025129335711 at 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
More information about the U-Boot
mailing list