centos 7 安装及搭建openwrt开发环境

一、安装完centos 7系统后,开启上网功能。
#vi /etc/sysconfig/network-scripts/ifcfg-eno16777736
注意:ifcfg-eno后面的数字为随机数,根据你的系统而定
把ONBOOT=no改为ONBOOT=yes后保存退出
然后重启网络,启用网卡
# systemctl restart network
即可正常联网。

二、# yum upgrade

三、安装ifconfig命令
# yum install net-tools

四、安装svn
# yum install subversion

五、下载源码(开发版)
切换到openwrt目录下后执行以下命令
# svn co https://github.com/openwrt/openwrt/trunk
如果下载慢或者网络中断,
svn cleanup ./trunk/
后重新检出
六、安装openwrt开发环境所需的软件

yum install -y git gcc gcc-c++ wget binutils bzip2 python perl make grep unzip gawk zlib zlib-devel zlib-static patch ncurses-devel perl-Thread-Queue openssl openssl-devel gettext ncurses-term autoconf bison flex grep sharutils

find diff getopt libc

七、
make prereq
make defconfig

Checking ‘working-make’… ok.
Checking ‘case-sensitive-fs’… ok.
Checking ‘gcc’… ok.
Checking ‘working-gcc’… ok.
Checking ‘g++’… ok.
Checking ‘working-g++’… ok.
Checking ‘ncurses’… ok.
Checking ‘zlib’… ok.
Checking ‘libssl’… ok.
Checking ‘perl-thread-queue’… ok.
Checking ‘tar’… ok.
Checking ‘find’… ok.
Checking ‘bash’… ok.
Checking ‘patch’… ok.
Checking ‘diff’… ok.
Checking ‘cp’… ok.
Checking ‘seq’… ok.
Checking ‘awk’… ok.
Checking ‘grep’… ok.
Checking ‘getopt’… ok.
Checking ‘stat’… ok.
Checking ‘md5sum’… ok.
Checking ‘unzip’… ok.
Checking ‘bzip2’… ok.
Checking ‘wget’… ok.
Checking ‘perl’… ok.
Checking ‘python’… ok.
Checking ‘svn’… ok.
Checking ‘git’… ok.
Checking ‘file’… ok.
Checking ‘openssl’… ok.
Checking ‘ldconfig-stub’… ok.
Collecting package info: done
Collecting target info: done
#
# configuration written to .config
#

安装privoxy-3.0.26-stable出错:id: privoxy: no such user解决办法

错误代码:
Installing templates to /var/openwrt/openwrt/trunk/build_dir/target-arm_cortex-a53+neon-vfpv4_musl-1.1.16_eabi/privoxy-3.0.26-stable/ipkg-install/etc/privoxy/templates
id: privoxy: no such user
******************************************************************
WARNING! WARNING! installing config files as root!
It is strongly recommended to run privoxy as a non-root user,
and to install the config files as that user and/or group!
Please read INSTALL, and create a privoxy user and group!
*******************************************************************
make[4]: *** [install] Error 1
make[4]: Leaving directory `/var/openwrt/openwrt/trunk/build_dir/target-arm_cortex-a53+neon-vfpv4_musl-1.1.16_eabi/privoxy-3.0.26-stable’

解决办法

1、vim /etc/passwd 加入以下代码
privoxy:*:7777:7777:privoxy proxy:/no/home:/no/shell

2、vim /etc/group 加入以下代码
privoxy:*:7777:

openwrt 编译环境检查

Checking ‘working-make’… ok.
Checking ‘case-sensitive-fs’… ok.
Checking ‘gcc’… ok.
Checking ‘working-gcc’… ok.
Checking ‘g++’… ok.
Checking ‘working-g++’… ok.
Checking ‘ncurses’… ok.
Checking ‘zlib’… ok.
Checking ‘libssl’… ok.
Checking ‘perl-thread-queue’… ok.
Checking ‘tar’… ok.
Checking ‘find’… ok.
Checking ‘bash’… ok.
Checking ‘patch’… ok.
Checking ‘diff’… ok.
Checking ‘cp’… ok.
Checking ‘seq’… ok.
Checking ‘awk’… ok.
Checking ‘grep’… ok.
Checking ‘getopt’… ok.
Checking ‘stat’… ok.
Checking ‘md5sum’… ok.
Checking ‘unzip’… ok.
Checking ‘bzip2’… ok.
Checking ‘wget’… ok.
Checking ‘perl’… ok.
Checking ‘python’… ok.
Checking ‘svn’… ok.
Checking ‘git’… ok.
Checking ‘file’… ok.
Checking ‘openssl’… ok.
Checking ‘ldconfig-stub’… ok.

openwrt 开发环境搭建中的问题

1、错误提示:
Checking ‘zlib’… failed.
Build dependency: Please install a static zlib. (Missing libz.a or zlib.h)

解决办法:
yum install zlib-static

2、错误提示:
Checking ‘perl-thread-queue’… failed.
Build dependency: Please install the Perl Thread::Queue module

解决办法:
yum install -y perl-Thread-Queue