方便起见,我直接安装了虚拟机使用,安装版本:CentOS-7-x86_64-Minimal-1611
一切安装就绪后,先更新系统,然后建议以非 root 用户启动进行编译。
yum update
yum install git -y
yum install perl -y
1、下载源码,可使用如下命令下载最新版本。由于这样下载缓慢,我直接从网页下载了zip包,解压后直接 winSCP 上传到虚拟主机上,速度快很多。
git clone https://github.com/openwrt/openwrt.git
svn checkout https://github.com/openwrt/openwrt.git
2、下载feeds
//在openwrt目录中执行
./scripts/feeds update -a
./scripts/feeds install -a
3、make defconfig,检查依赖项,报错,以及解决方法如下:
Build dependency: Please install the GNU C Compiler (gcc)
yum -y install gcc
Build dependency: Please reinstall the GNU C Compiler - it appears to be broken
Build dependency: Please install the GNU C++ Compiler (g++)
Build dependency: Please reinstall the GNU C++ Compiler - it appears to be broken
yum -y install gcc-c++
Build dependency: Please install ncurses. (Missing libncurses.so or ncurses.h)
yum -y install ncurses-devel
Build dependency: Please install a static zlib. (Missing libz.a or zlib.h)
yum -y install zlib-static
Build dependency: Please install the openssl library (with development headers)
yum -y install openssl-devel
Build dependency: Please install the Perl Thread::Queue module
yum -y install perl-Thread-Queue
Build dependency: Please install GNU 'patch'
yum -y install patch
Build dependency: Please install 'unzip'
yum -y install unzip
Build dependency: Please install 'bzip2'
yum -y install bzip2
Build dependency: Please install GNU 'wget'
yum -y install wget
Build dependency: Please install the Subversion client
yum -y install svn