nandwrite problem in writing uboot env (/dev/mtd2)

giacomo "giotti" mariani giacomomariani at yahoo.it
Fri May 8 17:34:59 CEST 2009


Hello list,
some day ago I decided to change some uboot environment variable (ext2
fs in ext3 fs) from my OM2008.12 booted from the uSD.
I started with:

cat /dev/mtd2 > uboot_env.bin

(the same as nanddump /dev/mtd2 uboot_env_dump.bin as diff confirmed).
A edited it with vim and changed the 2 of ext2 into a 3, flashed it with

nandwrite -p /dev/mtd2 uboot_env.bin.new

but, on reboot, the mobile stopped at the uboot menu (it looked empty to it) and I noticed:

root at om-gta02:~/ubootenv# ls -l
-rw-r--r--    1 root     root       262144 Mar 26 00:09 uBoot_env.bin
-rw-r--r--    1 root     root       262145 Mar 26 00:18 uBoot_env.bin.new

so I edited with vim -b obtaining:

root at om-gta02:~/ubootenv# ls -l
-rw-r--r--    1 root     root       262144 Mar 26 00:09 uBoot_env.bin
-rw-r--r--    1 root     root       262144 Mar 26 00:18 uBoot_env.bin.new

but the same result at boot time.
Using xxd and diff I obtained:

--- uBoot_env.bin.new.xxd       Thu Mar 26 00:40:13 2009
+++ uBoot_env.bin.xxd   Thu Mar 26 00:40:00 2009
@@ -16,10 +16,10 @@
 00000f0: 3230 3030 3030 3000 626f 6f74 6465 6c61  2000000.bootdela
 0000100: 793d 3100 6d65 6e75 5f31 3d42 6f6f 7420  y=1.menu_1=Boot 
 0000110: 6672 6f6d 206d 6963 726f 5344 2028 4641  from microSD (FA
-0000120: 542b 6578 7433 293a 2073 6574 656e 7620  T+ext3): setenv 
+0000120: 542b 6578 7432 293a 2073 6574 656e 7620  T+ext2): setenv 
 0000130: 626f 6f74 6172 6773 2024 7b62 6f6f 7461  bootargs ${boota
 0000140: 7267 735f 6261 7365 7d20 726f 6f74 6673  rgs_base} rootfs
-0000150: 7479 7065 3d65 7874 3320 726f 6f74 3d2f  type=ext3 root=/
+0000150: 7479 7065 3d65 7874 3220 726f 6f74 3d2f  type=ext2 root=/
 0000160: 6465 762f 6d6d 6362 6c6b 3070 3220 726f  dev/mmcblk0p2 ro
 0000170: 6f74 6465 6c61 793d 3520 247b 6d74 6470  otdelay=5 ${mtdp
 0000180: 6172 7473 7d20 726f 3b20 6d6d 6369 6e69  arts} ro; mmcini


And flashing back the old env:

nandwrite -p /dev/mtd2 uboot_env.bin

it boot fine again.
Where am I wrong?
Thank you very much and excuse me for my bad english.



-- 
/_\ The ASCII		        Per comunicare in modo riservato:
\_/ Ribbon Campaign         gpg --keyserver  pool.sks-keyservers.net \
 X  Against HTML                --recv-keys 20611EAD	
/_\ Email!	                 
----------------------------------------------------------------------
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html





More information about the community mailing list