Openwrt配置与编译指南
首先安装基本开发环境:
sudo apt-get install ssh vim samba tftp nfs
安装编译openwrt须要的包:
解压openwrt包编译出错:
Build dependency: Please install the GNU C++ Compiler (g++).
Build dependency: Please install ncurses. (Missing libncurses.so or ncurses.h) Build dependency: Please install zlib. (Missing libz.so or zlib.h)
Build dependency: Please install GNU awk. https://www.360docs.net/doc/8714390839.html,
Build dependency: Please install flex.
Build dependency: Please install patch.
Build dependency: Please install git (git-core).
Build dependency: Please install the subversion client.
安装编译openwrt须要的包:
sudo apt-get install libncurses5-dev zlib1g-dev gawk flex patch git-core g++ subversion
然后直接make
工作目录,并将openwrt 最新代码包解压到openwrt 工作目录下
mkdir openwrt cd openwrt tar zvxf ~/trunk.tar.gz
配置openwrt 编译选项,在 openwrt/trunk/目录下运行命令
make menuconfig
选择s3c24xx[2.6]
在 Target Images 中选择 jffs2、tgz 和ext2
选择 Advanced configuration options (for developers)
并在高级配置选项中的Toolchain Options 选择使用eglibc
在 Utilities 选项下选择 udev 软件包以及udevextras 软件包
保存配置并退出GEC 在配置好编译工具链和目标板镜像功能包以后,
我们可以开始构建目标板根系统镜像。默认情况下,openwrt 编译脚本会自动从Internet 上获取所需要的软件包源代码,
并把下载的源码包存放在当前目录的 dl/ 目录中;在 build_dir/ 目录中存放编译中使用的软件包,在 staging_dir/ 目录用于存放构建目标系统镜像的工具软件,
包括:宿主系统使用的工具,存放在 staging_dir/host/ 目录下目标系统使用的软件包,存放在 staging_dir/target-arm_eglibc-2.8/ 目录下
交叉编译工具链,存放在 staging_dir/toolchain-arm_gcc-4.1.2_eglibc-2.8/ 目录下
在此,我们关心的是交叉编译工具链,我们可以使用符号链接将交叉编译工具命令放入到$PATH 路径中,
这样在gec 用户的任意目录下我们可以使用交叉编译工具来构建目标板上运行的应用程序。
GEC openwrt openwrt 将编译生成的目标系统镜像文件放在其根目录的 bin/ 目录下
我们可以使用flash 烧写工具将目标系统镜像写入目标板的NAND flash 中运行。