flash image from SD card
Willie Chen
willie_chen at openmoko.com
Tue Apr 1 19:01:25 CEST 2008
Werner Almesberger wrote:
> I wrote:
>
>> - I can write a special erase tool that preserves the OOB data
>>
>
> Even better, I can simply write a tool to set the environment pointer.
> I just did that :-)
>
> svn.openmoko.org/trunk/src/target/dynenv/
> (revision 4288)
>
> Example session:
>
> # First, we erase the u-boot partition and put the new u-boot there.
>
> root at om-gta02:~# flash_eraseall /dev/mtd1
> Erasing 128 Kibyte @ 20000 -- 50 % complete.
> root at om-gta02:~# nandwrite -p /dev/mtd1 u-boot.udfu
> Writing data to block 0
> Writing data to block 20000
>
> # Let's check the environment pointer.
>
> root at om-gta02:~# ./dynenv /dev/mtd1
> environment pointer marker is absent
>
> # Nothing there, of course. Now we put it back, taking into account
> # that the offset of the environment partition is just the size of
> # the u-boot partition.
>
> root at om-gta02:~# ./dynenv /dev/mtd1 0x`awk '/mtd1/{print $2}' </proc/mtd`
>
> # Lo and behold, it's back now.
>
> root at om-gta02:~# ./dynenv /dev/mtd1
> 0x40000
>
> - Werner
>
Hi Werner,
Yeah, Thanks for your help. Now we can erase the uboot image.
Regards,
Willie
More information about the openmoko-kernel
mailing list