找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 4342|回复: 8

求助breed错刷在了firmware分区里

[复制链接]
发表于 2017-11-18 12:41 | 显示全部楼层 |阅读模式
近期在学习ImageBuilder生成openwrt自定义固件 方法,、
因为一次刷机把breed刷没了
在网上找了大部分资料,发现Openwrt下用命令刷固件的方法
工具:winscp、Putty
利用winscp把固件传入/tmp目录下
然后使用mtd命令刷入:
cat /proc/mtd 查看分区
              mtd0: 00020000 00010000 "u-boot"
              mtd1: 00140000 00010000 "kernel"
              mtd2: 00690000 00010000 "rootfs"
              mtd3: 00200000 00010000 "rootfs_data"
              mtd4: 00010000 00010000 "art"
              mtd5: 007d0000 00010000 "firmware"
然后
cd /tmd
mtd write breed.bin firmware
这里我把breed刷入了系统固件中了,本应该是
mtd write breed.bin u-boot  才对
这样也能启动breed,可是我只能刷4M的固件,编程器固件刷入了启动不了,
后来发觉这问题应该是我刷错了breed的分区位置
然后又
mtd write breed.bin u-boot
结果
Could not open mtd device: u-boot
Can't open device for writing!
查了很多资料才知道openwrt的uboot是锁死不给刷的,必须从新编译固件
修改: target/linux/ar71xx/files/drivers/mtd/tplinkpart.c
找到
{
              .name            = "u-boot",
              .offset           = 0,
              .size              = 0x020000,
              .mask_flags  = MTD_WRITEABLE,
       }, {
              .name            = "kernel",
              .offset           = 0x020000,
              .size              = 0x140000,
       }, {
              .name            = "rootfs",
              .offset           = 0x160000,
              .size              = 0x690000,
       }, {
              .name            = "art",
              .offset           = 0x7f0000,
              .size              = 0x010000,
              .mask_flags  = MTD_WRITEABLE,
       }, {
              .name            = "firmware",
              .offset           = 0x020000,
              .size              = 0x7d0000,
       }
};

      刚好openwr里的 mtd 对uboot和 art都不能操作,尝试把art分区里
         .mask_flags   = MTD_WRITEABLE这行注释掉,编译it。
       经过漫长的编译之后,刷新it,果然,art块可以刷了。。。。。刷进去art.bin 再刷

个openwrt系统,果然,无线恢复正常。再刷回 那行没注释的openwrt,省得下次不小新破坏了


         .mask_flags      = MTD_WRITEABLE   原来是标识不可写。。。。。这名字取得。

。。我了个去
         好了,结束了。
顺便说一句:技术本来就应该共享。

how to restore art partition? (Page 1) — General Discussion — OpenWrt 沿途见识[4]
You need to (re)compile the kernel and remove the write protection from the mtd

partition:
--- target/linux/ar71xx/files/arch/mips/ar71xx/mach-wrt160nl.c (revision 26848)
+++ target/linux/ar71xx/files/arch/mips/ar71xx/mach-wrt160nl.c (working copy)
@@ -60,7 +60,6 @@
         .name = "ART",
         .offset = 0x7f0000,
         .size = 0x010000,
- .mask_flags = MTD_WRITEABLE,
     }, {
         .name = "firmware",
         .offset = 0x040000,
Oh and by the way - its "ART", not "art".


但是编译那速度真心太慢了,
请问在官方的ImageBuilder里如何才能修改这种情况呢?求大神指点一下。


我的恩山、我的无线 The best wifi forum is right here.
头像被屏蔽
发表于 2017-11-18 12:48 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2017-11-18 12:55 | 显示全部楼层
zxbmuyu 发表于 2017-11-18 12:48
直接breed里面升级一下breed,然后刷个固件就好了

我下载了新的breed重刷了,刷不了大于3.4M的固件。我的flash是16m的
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

头像被屏蔽
发表于 2017-11-18 13:13 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2017-11-18 13:33 | 显示全部楼层
zxbmuyu 发表于 2017-11-18 13:13
看一下breed里面识别多大闪存,理论上来说,可以刷16m的编程器固件才对

现在启动的breed是在固件分区里的,uboot分区里应该还有openwrt自带的uboot文件,估计是这样,我手头现在没编程器,得想办法把uboot分区刷掉,在固件分区中的breed也能进的,只是刷固件被uboot分区的限制在3.4M以内了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-11-18 17:00 | 显示全部楼层
breed很大吗?我记得不到100k吧!?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-11-18 17:01 | 显示全部楼层
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2017-11-18 18:09 | 显示全部楼层
wj44wj 发表于 2017-11-18 17:01
https://breed.hackpascal.net/

谢谢,刷死了,还是老实的用编程器了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2017-11-23 17:15 | 显示全部楼层
wj44wj 发表于 2017-11-18 17:00
breed很大吗?我记得不到100k吧!?

breed不大,我说的是openwrt image builder制作出来的固件默认是锁死uboot的,固件被uboot限制在3.44m
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-3-29 02:58

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表