umount /mnt/modules
umount /mnt/app
umount /mnt/mylib
umount /mnt/chunyu
echo "erase all mtd devices ............"
flash_eraseall /dev/mtd3
flash_eraseall /dev/mtd4
flash_eraseall /dev/mtd5
flash_eraseall /dev/mtd6
echo "update all mtd devices............"

nandwrite -a -o /dev/mtd3 /mnt/usbdisk/sti7105_mtd3_yaffs2_modules.img
nandwrite -a -o /dev/mtd4 /mnt/usbdisk/sti7105_mtd4_yaffs2_app.img
nandwrite -a -o /dev/mtd5 /mnt/usbdisk/sti7105_mtd5_yaffs2_mylib.img
nandwrite -a -o /dev/mtd6 /mnt/usbdisk/sti7105_mtd6_yaffs2_chunyu.img

#mount -t yaffs  /dev/mtdblock6 -rw /mnt/chunyu

#mkdir -p /mnt/chunyu/plugins
#mkdir -p /mnt/chunyu/database
#mkdir -p /mnt/chunyu/config
#cp /mnt/usbdisk/biss.key /mnt/chunyu/plugins
#cp /mnt/usbdisk/patch.key /mnt/chunyu/plugins
#cp /mnt/usbdisk/plugins.cfg /mnt/chunyu/plugins
#cp /mnt/usbdisk/setip.sh /mnt/chunyu
#cp /mnt/usbdisk/app_args.ini /mnt/chunyu/config

#umount /mnt/chunyu

reboot


