分类: LINUX
2012-11-14 09:46:58
点击(此处)折叠或打开
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*/
target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-mr3x20.c
4M:
.name = "u-boot",
.offset = 0,
.size = 0x020000,
.mask_flags = MTD_WRITEABLE,
}, {
.name = "kernel",
.offset = 0x020000,
.size = 0x140000,
}, {
.name = "rootfs",
.offset = 0x160000,
.size = 0x290000,
}, {
.name = "art",
.offset = 0x3f0000,
.size = 0x010000,
.mask_flags = MTD_WRITEABLE,
}, {
.name = "firmware",
.offset = 0x020000,
.size = 0x3d0000,
}
};
8M:
.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,
}
};
16M:
.name = "u-boot",
.offset = 0,
.size = 0x020000,
.mask_flags = MTD_WRITEABLE,
}, {
.name = "kernel",
.offset = 0x020000,
.size = 0x140000,
}, {
.name = "rootfs",
.offset = 0x160000,
.size = 0xe90000,
}, {
.name = "art",
.offset = 0xff0000,
.size = 0x010000,
.mask_flags = MTD_WRITEABLE,
}, {
.name = "firmware",
.offset = 0x020000,
.size = 0xfd0000,
}
};
0x000000000000-0x000000020000 : "u-boot" //128k
0x000000020000-0x000000160000 : "kernel" ///1280K
0x000000160000-0x000000ff0000 : "rootfs" //14912K
0x0000008c0000-0x000000ff0000 : "rootfs_data" //7360k
0x000000ff0000-0x000001000000 : "art" //64k
0x000000020000-0x000000ff0000 : "firmware" //16192k
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.