分享

感谢分享,这样就能不拆FALSH来备份了。

 怡窝馆 2013-12-24

感谢分享,这样就能不拆FALSH来备份了。

F_FX

编程器固件、uboot、fullflash

:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00020000 00010000 "RedBoot"
mtd1: 007c0000 00010000 "linux"
mtd2: 00270000 00010000 "rootfs"
mtd3: 00410000 00010000 "ddwrt"
mtd4: 00010000 00010000 "nvram"
mtd5: 00010000 00010000 "board_config"
mtd6: 00800000 00010000 "fullflash"
mtd7: 00020000 00010000 "fullboot"
:~#

DDWRT备份成编程器固件命令(前提是有fullash分区)

:~# dd if=/dev/mtd6 of=/tmp/741_fullflash.bin
16384+0 records in
16384+0 records out
:~#

刷成编程器固件命令(前提是有fullash分区)

:~# mtd -r write fullflash /tmp/741_fullflash.bin
16384+0 records in
16384+0 records out
:~#

 

编程openwrt固件时修改mach-tl-mr3x20.c(对应3420)增加一个fullash

}, {
  .name  = "fullflash",
  .offset  = 0,
  .size  = 0x800000,

  .mask_flags = MTD_WRITEABLE,

}

  .size  = 0x800000, 这个是flash大小8M

去掉  .mask_flags = MTD_WRITEABLE,是分区可以写,否者只可读

 

 

编程器固件包含uboot+内核固件+art/board_config (适用于ar 3240固件等)

一、准备uboot、内核固件(firmware)、art/board_config
  1、登录路由
  2、切换到tmp目录,
  3、使用dd命令备份uboot、firmware、art/board_config,
  4、使用cat命令将文件合并,假设新文件名为xxx.bin
  5、使用WinSCP将文件复制到电脑

root@OpenWrt:~# cd /tmp
root@OpenWrt:/tmp# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00020000 00010000 "u-boot"
mtd1: 00140000 00010000 "kernel"
mtd2: 00690000 00010000 "rootfs"
mtd3: 00460000 00010000 "rootfs_data"
mtd4: 00010000 00010000 "art"
mtd5: 007d0000 00010000 "firmware"
root@OpenWrt:/tmp# dd if=/dev/mtd0 of=uboot.bin
root@OpenWrt:/tmp# dd if=/dev/mtd5 of=firmware.bin
root@OpenWrt:/tmp# dd if=/dev/mtd4 of=art.bin
root@OpenWrt:/tmp# cat uboot.bin firmware.bin art.bin > fullflash.bin

相当于windows下   copy /b 1.txt+2.txt 3.txt

 

区分固件是否带uboot

用Uedit32打开固件

这个是有uboot的

这个是有没有uboot的的openwrt固件

去掉固件的uboot  (也就是删除固件前成128k数据)
这个是有uboot的



128K*1024 =131072

 

固件加uboot

copy /b uboot.bin+固件.bin 新固件.bin

 

 

uboot下刷机

打开tftpd32 把固件放tftpd32设置的目录下
打开SecureCRT 波特率115200

这是7240 uboot下刷4M编程器的固件
ar7240> printenv
ar7240> setenv ipaddr 192.168.1.222
ar7240> setenv serverip 192.168.1.2           #PC设置网卡IP为192.168.1.2
ar7240> tftpboot 0x80000000 150r.bin
ar7240> erase 0x9f000000 +0x3fffff
ar7240> cp.b 0x80000000 0x9f000000 0x3fffff
ar7240> bootm

ubnt uboot刷机
tftpboot 0x80000000 1508m.bin

erase 0xbf000000 +0x3fffff

cp.b 0x80000000 0xbf000000 0x3fffff
bootm

普通的uboot 和 ubnt的uboot的刷机都搞定了

 

普通的uboot一个是 0x9f000000开始

,ubnt是 0xbf000000开始

 

 

 

 

 

 

刷编程器固件
setenv ipaddr 192.168.1.111
setenv serverip 192.168.1.2
tftpboot 0x80000000 741V3_factory_all.bin
erase 0x9f000000 +0x400000
cp.b 0x80000000 0x9f000000 0x400000

刷普通固件
tftpboot 0x80000000 op.bin
erase 0x9f020000 +0x400000
cp.b 0x80000000 0x9f020000 0x400000
bootm

 

 

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多