[2008.X] Flashing the kernel live

Tore Martin Hagen thagen at slb.com
Mon Sep 29 07:20:50 CEST 2008


Kelvie Wong wrote:
>
> [root at om-gta02 ~] $ flash_eraseall /dev/mtd3
>
> Erasing 128 Kibyte @ 7e0000 -- 98 % complete.
>
> [root at om-gta02 ~] $ cat uImage.bin > /dev/mtd3
>
> cat: write error: Invalid argument
>
>
The problem is that the mtd driver will only accept writes with length 
equal a multiple of 2048, so the last write operation will always fail 
(unless you are very lucky with the size). To get past the problem you 
have to pad the uImage file with some extra 0xff.

You can write a program that does this nicely or you can just do the 
following hack:
Run the following command for a while (stop it with ctrl-c) to generate 
a file containing only 0xff
  while true ; do echo -n xx | tr 'x' '\377' >> ff.file; done
The size should be at least 2048 bytes, but it does not matter if it is 
too big. Then pad the kernel
  cat uImage.bin ff.file > uImagePad.bin
And now you can download the kernel with
  cat uImagePad.bin > /dev/mtd3
You will still get the error message, but it is after the end of the 
code so it does not matter.

Tore



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openmoko.org/pipermail/community/attachments/20080929/8a51c7c0/attachment-0001.htm 


More information about the community mailing list