进阶-源码编译的相关知识

1.在路径 /trunk/tools/firmware-utils/src/mktplinkfw.c 这个文件里边有个“fw max len”,默认3c0000是4M的,请改成7c0000 (这一步把固件最大限制改成8M),如果是16mflash,请改成fc0000(最大限制改成16m)。

2、修改target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr841n.c(找相应文件)

4M:
 41 .name = "u-boot",
 42 .offset = 0,
 43 .size = 0x020000,
 44 .mask_flags = MTD_WRITEABLE,
 45 }, {
 46 .name = "kernel",
 47 .offset = 0x020000,
 48 .size = 0x140000,
 49 }, {
 50 .name = "rootfs",
 51 .offset = 0x160000,
 52 .size = 0x290000,
 53 }, {
 54 .name = "art",
 55 .offset = 0x3f0000,
 56 .size = 0x010000,
 57 .mask_flags = MTD_WRITEABLE,
 58 }, {
 59 .name = "firmware",
 60 .offset = 0x020000,
 61 .size = 0x3d0000,
 62 }
 63 };

8M::
 41 .name = "u-boot",
 42 .offset = 0,
 43 .size = 0x020000,
 44 .mask_flags = MTD_WRITEABLE,
 45 }, {
 46 .name = "kernel",
 47 .offset = 0x020000,
 48 .size = 0x140000,
 49 }, {
 50 .name = "rootfs",
 51 .offset = 0x160000,
 52 .size = 0x690000,
 53 }, {
 54 .name = "art",
 55 .offset = 0x7f0000,
 56 .size = 0x010000,
 57 .mask_flags = MTD_WRITEABLE,
 58 }, {
 59 .name = "firmware",
 60 .offset = 0x020000,
 61 .size = 0x7d0000,
 62 }
 63 };

16M::
 41 .name = "u-boot",
 42 .offset = 0,
 43 .size = 0x020000,
 44 .mask_flags = MTD_WRITEABLE,
 45 }, {
 46 .name = "kernel",
 47 .offset = 0x020000,
 48 .size = 0x140000,
 49 }, {
 50 .name = "rootfs",
 51 .offset = 0x160000,
 52 .size = 0xe90000,
 53 }, {
 54 .name = "art",
 55 .offset = 0xff0000,
 56 .size = 0x010000,
 57 .mask_flags = MTD_WRITEABLE,
 58 }, {
 59 .name = "firmware",
 60 .offset = 0x020000,
 61 .size = 0xfd0000,
 62 }
 63 };

8M::
 0x000000000000-0x000000020000 : "u-boot"
 0x000000020000-0x000000160000 : "kernel"
 0x000000160000-0x0000007f0000 : "rootfs"
 0x000000620000-0x0000007f0000 : "rootfs_data"
 0x0000007f0000-0x000000800000 : "art"
 0x000000020000-0x0000007f0000 : "firmware"

4M::
 0x000000000000-0x000000020000 : "u-boot"
 0x000000020000-0x000000160000 : "kernel"
 0x000000160000-0x0000003f0000 : "rootfs"
 0x000000304000-0x0000003f0000 : "rootfs_data"
 0x0000003f0000-0x000000400000 : "art"
 0x000000020000-0x0000003f0000 : "firmware"

16M::
 0x000000000000-0x000000020000 : "u-boot"
 0x000000020000-0x000000160000 : "kernel"
 0x000000160000-0x000000ff0000 : "rootfs"
 0x000000380000-0x000000ff0000 : "rootfs_data"
 0x000000ff0000-0x000001000000 : "art"
 0x000000020000-0x000000ff0000 : "firmware"

全部恢复后再 ./scripts/feeds update -a 安装最新源码 ./scripts/feeds install -a
更新版本号 svn up
进入编译组件包菜单 make menuconfig
 开始编译 make V=99

你可能感兴趣的:(进阶-源码编译的相关知识)