Openwrt路由器折腾之编程器固件还原
转自:http://www.newbandeng.com/thread-10946-1-1.html
所需软件:WINSCP ; PUTTY
双击运行winscp
这里可能会更新¥#¥#%%¥¥#¥%key,更新即可
小白可以看看
继续小白看
把新固件拖到/tmp目录
上面的步骤的目的只是把固件传到路由器/tmp目录,下面的putty才是主菜。注意:C:\Program Files (x86)\PuTTY 目录内如果没有putty程序的话,通过下图的方法启动putty,会提示会失败的。你可以单独下载putty程序,运行,效果是一样的。
putty运行后,第一次一样要导入。。。key~
登陆名:root 密码:admin
输入:cd /tmp (还可以输入 ls 命令,看看刚刚新固件拷贝到tmp目录没)
最后输入如下命令:
可以看到最后括号内(e)(w)不断切换,应该是正在写入FLASH
出现如下提示说明写入完毕,你会发现没有任何提示,路由器也没任何反应~ 重启路由器就会变成新固件了哦~
重启后...
结论: (以下内容都是我自己想的,对与不对我也不知道,仅供参考哈~
不用设置本机IP地址,不用网线连接LAN口,也能用这个方法刷机~ 看来newifi 真的很好刷{:soso_e113:}(建议还是连网线的好哈,别和我学)
路由器启动应该是把16M的flash内容读取到内存,然后正常启动运行功能。本贴的刷入过程呢,就是以ROOT权限,把新固件写入Flash。内存内的老系统还在运行,并不管flash内是否发生了变化。
既然
mtd write xxx.bin firmware 是升级固件部分,那么
mtd write xxx.bin u-boot 是不是就是升级UBOOT呢?
mtd write xxx.bin Factory 是不是就能升级art 分区呢?
mtd write xxx.bin fullflash 是不是就是刷编程器固件呢?
下帖是备份分区的方法:
https://t522.com/openwrt/753.html
备份的分区,就可以用本贴的方法还原了~
2014.09.03 12:00更新:
经过测试,mtd write xxx.bin fullflash 就是刷编程器固件的命令,所以不用编程器完全可以刷编程器固件的哦~
本着测试的目的,这次更新编程器固件时,用的网线连接,自动获取IP.经过这几次折腾,发现newifi真的很好折腾,不论无线连接路由器还是网线连接路由器,不论自己设IP还是自动获取IP,都能用本贴的方法,刷新固件。
所以,强烈建议还没大折腾的新手,赶紧备份个自己的 编程器固件哦!
导入固件到路由器就不再上图了,帖子上面有,就是用winscp。我的编程器固件改名为:full.bin 请自己灵活输命令哈~
输入:mtd write full.bin fullflash 回车
正在刷入!
下图刷入完成!
最后输入:reboot 就会重启路由器了,恢复了编程器固件,连之前的无线密码也恢复了。但是我忘记了,冏,还要恢复出厂下
最后说下
mtd命令解释:
Usage: mtd [<options> ...] <command> [<arguments> ...] <device>
The device is in the format of mtdX (eg: mtd4) or its label.
mtd recognizes these commands:
unlock unlock the device
refresh refresh mtd partition
erase erase all data on device
write <imagefile>- write <imagefile> (use - for stdin) to device
jffs2write <file> append <file> to the jffs2 partition on the device
Following options are available:
-q quiet mode (once: no [w] on writing,
twice: no status messages)
-r reboot after successful command
-f force write without trx checks
-e <device> erase <device> before executing the command
-d <name> directory for jffs2write, defaults to "tmp"
-j <name> integrate <file> into jffs2 data when writing an image