加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

[OpenWrt] Flash 由4M改8M(或者16M), openwrt源码的修改

发布时间:2020-12-15 18:23:27 所属栏目:百科 来源:网络整理
导读:http://www.right.com.cn/forum/thread-75309-1-1.html trunk/tools/firmware-utils/src/mktplinkfw.c 只修改fw_max_len为0xfc0000,16M flash ? ?? ?? ?? ?? ? .id? ?? ?? ?? ?? ? = "4M", ? ?? ?? ?? ?? ? .fw_max_len? ?? ???= 0xfc0000, ? ?? ?? ?? ?? ?
http://www.right.com.cn/forum/thread-75309-1-1.html

trunk/tools/firmware-utils/src/mktplinkfw.c
只修改fw_max_len为0xfc0000,16M flash

? ?? ?? ?? ?? ? .id? ?? ?? ?? ?? ? = "4M",
? ?? ?? ?? ?? ? .fw_max_len? ?? ???= 0xfc0000,
? ?? ?? ?? ?? ? .kernel_la? ?? ???= 0x80060000,
? ?? ?? ?? ?? ? .kernel_ep? ?? ???= 0x80060000,
? ?? ?? ?? ?? ? .rootfs_ofs? ?? ???= 0x140000,
新版只用改fw的大小,分区表会自动认,不用像老版自己定义每个分区大小了。

==========================================================
trunk/tools/firmware-utils/src/mktplinkfw.c


点击(此处)折叠或打开

  1. static struct flash_layout layouts[]?=?{
  2. ????{
  3. ????????.id????????=?"4M",
  4. ????????.fw_max_len????=?0x3c0000.kernel_la????=?0x80060000.kernel_ep????.rootfs_ofs????=?0x140000
  5. ????}"4Mlzma"=?0x100000"8M"=?0x7c0000"8Mlzma"/*?terminating entry?*/
  6. ????}
  7. ;

  8. static struct board_info boards"TL-MR3020v1".hw_id????????=?HWID_TL_MR3020_V1.hw_rev????????=?1.layout_id????"TL-MR3220v1"=?HWID_TL_MR3220_V1"TL-MR3420v1"=?HWID_TL_MR3420_V1"TL-WA701Nv1"=?HWID_TL_WA701N_V1"TL-WA901NDv1"=?HWID_TL_WA901ND_V1.id?"TL-WA901NDv2".hw_id?=?HWID_TL_WA901ND_V2.hw_rev?"TL-WR741NDv1"=?HWID_TL_WR741ND_V1"TL-WR741NDv4"=?HWID_TL_WR741ND_V4"TL-WR740Nv1"=?HWID_TL_WR740N_V1"TL-WR740Nv3"=?HWID_TL_WR740N_V3"TL-WR743NDv1"=?HWID_TL_WR743ND_V1"TL-WR841Nv1.5"=?HWID_TL_WR841N_V1_5=?2"TL-WR841NDv3"=?HWID_TL_WR841ND_V3=?3"TL-WR841NDv5"=?HWID_TL_WR841ND_V5"TL-WR841NDv7"=?HWID_TL_WR841ND_V7"TL-WR941NDv2"=?HWID_TL_WR941ND_V2"TL-WR941NDv4"=?HWID_TL_WR941ND_V4"TL-WR1043NDv1"=?HWID_TL_WR1043ND_V1"TL-WR2543Nv1"=?HWID_TL_WR2543N_V1"TL-WR703Nv1"=?HWID_TL_WR703N_V1//-->8Mlzma
  9. ????;

Part Three: Compile your openwrt firmware:

1. Checkout trunk and update feeds as other common tutorials
2. Modify Openwrt code to support and partition your flash:

/trunk/tools/firmware-utils/src/mktplinkfw.c

fw_max_len = 0x7c0000 /* for 8M Flash,use 0xfc0000 for 16M flash*/




3. menuconfig and make your image as common tutorials. save the image openwrt-ar71xx-generic-tl-mr3420-v1-squashfs-factory.bin for future usage.
4. back up your 64k art (wirelss driver data,without it your wireless does not work.) this is important! you can also use the backup one from other tp-link ar7241 chipset routers.


http://www.right.com.cn/forum/thread-75309-1-1.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读