我有一个TL-WR841NV14(US)路由器。因此,我从那里的官方网站下载了GPL代码。 然后,我尝试按照README文件中的说明编译固件。但这根本没有用。
自述文件
README:
1. To Build both Toolchain and Firmware image:
1.1 Host Ubuntu 12.04 or higher (Linux kernel 3.2.0) on x86 machine
1.2 Compiling tool version: gcc 4.6.3 or higher, GNU Make version 3.81
2. Put the package TL-WR841NV14.tar.gz to a directory such as /home/TP-LINK, then extract the compressed files.
$ cd /home/TP-LINK
$ tar xzvf TL-WR841NV14.tar.gz
To Build Firmware image:
1.1 Go to TL-WR841NV14 build folder and execute make.
$ cd /home/TP-LINK/TL-WR841NV14/build
Do as:
Take WR841NV14 for example
1. sudo make MODEL=WR841NV14 env_build
2. make MODEL=WR841NV14 boot_build
3. make MODEL=WR841NV14 kernel_build(kernel_menuconfig)
4. make MODEL=WR841NV14 modules_build
4.1 "modules_build" include some sub target,like kernel_modules,misc_modules,wlan_modules...
4.2 For most people only need to make kernel_modules
5. make MODEL=WR841NV14 apps_build
6. make MODEL=WR841NV14 fs_build
7. make MODEL=WR841NV14 image_build
will generate the DEV_NAME_(xxx).bin, under TL-WR841NV14/targets/image_MODEL folder.
xxx refers to flash or up_boot, with specific time-stamp and version info.
所以当我运行第一个命令时:
root@XXX:/home/TP-LINK/TL-WR841NV14/build# make
toolchain buildroot-gcc463 exists.
env_build done!
然后当我运行第二条命令时出现错误:
..
....
make[2]: Entering directory `/home/TP-LINK/TL-WR841NV14/mtk_ApSoC_4320/Uboot/tools'
gcc -I./ -DUSE_HOSTCC -c mkimage.c
In file included from mkimage.c:61:0:
./image.h:210:1: warning: ‘packed’ attribute ignored [-Wattributes]
} dram_header_t __attribute__ ((packed));
^
./image.h:218:1: warning: ‘packed’ attribute ignored [-Wattributes]
} nand_badblock_info1_t __attribute__ ((packed));
^
./image.h:232:1: warning: ‘packed’ attribute ignored [-Wattributes]
} nand_info_1_t __attribute__ ((packed));
^
./image.h:246:1: warning: ‘packed’ attribute ignored [-Wattributes]
} nand_header_t __attribute__ ((packed));
^
./image.h:266:1: warning: ‘packed’ attribute ignored [-Wattributes]
} image_header_t __attribute__((packed));
^
gcc -I./ -DUSE_HOSTCC -c crc32.c
crc32.c:15:18: fatal error: zlib.h: No such file or directory
compilation terminated.
make[2]: *** [crc32.o] Error 1
make[2]: Leaving directory `/home/TP-LINK/TL-WR841NV14/mtk_ApSoC_4320/Uboot/tools'
make[1]: *** [tools] Error 2
make[1]: Leaving directory `/home/TP-LINK/TL-WR841NV14/mtk_ApSoC_4320/Uboot'
make: *** [boot_build] Error 2
root@XXX:/home/TP-LINK/TL-WR841NV14/build#
PS:我已经安装了ubuntu 16 x84,我的gcc编译器版本是gcc版本5.4.0 20160609,而GNU make版本是3.81