openwrt的8m固件attitude_adjustment和trunck版源码修改

这个方法适用与2012年冬季之后的attitude_adjustment和trunck版的openwrt。

我这里是参考了一下之由在csdn上的一篇文章

==========================================================
trunk/tools/firmware-utils/src/mktplinkfw.c
static struct flash_layout layouts[] = {
{
.id = "4M",
.fw_max_len = 0x3c0000,
.kernel_la = 0x80060000,
.kernel_ep = 0x80060000,
.rootfs_ofs = 0x140000,
}, {
.id = "4Mlzma",
.fw_max_len = 0x3c0000,
.kernel_la = 0x80060000,
.kernel_ep = 0x80060000,
.rootfs_ofs = 0x100000,
}, {
.id = "8M",
.fw_max_len = 0x7c0000,
.kernel_la = 0x80060000,
.kernel_ep = 0x80060000,
.rootfs_ofs = 0x140000,
}, {
.id = "8Mlzma",
.fw_max_len = 0x7c0000,
.kernel_la = 0x80060000,
.kernel_ep = 0x80060000,
.rootfs_ofs = 0x100000,
}, {
/* terminating entry */
}
};

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

新版只用改fw的大小,分区表会自动认,不用像老版自己定义每个分区大小了。

比如8m flash就是把相应的.layout_id改了就可以了。

==========================================================

然后在打开./target/linux/ar71xx/image/Makefile

找到相应设备所在行,把4m改为8m,这里一定要把所有的相应型号设备的所有硬件设备的所在行都改了,比如编译wr941n就要把wr941 v2 v3 v4所在行都改了

 

$(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR941NV2,tl-wr941nd-v2,TL-WR941ND,ttyS0,115200,0x09410002,2,8M))
$(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR941NV3,tl-wr941nd-v3,TL-WR941ND,ttyS0,115200,0x09410002,2,8M))
$(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR941NV4,tl-wr941nd-v4,TL-WR741ND,ttyS0,115200,0x09410004,1,8M))

这样可以避免image too big的问题。

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注