centos 6 64位系统下交叉编译openwrt ipk
以编译openwrt-ssr for openwrt 18.06.1为例
1、安装依赖库
yum install -y subversion binutils bzip2 gcc gcc-c++ gawk gettext flex xz time
yum install -y ncurses-devel zlib-devel make patch unzip perl-ExtUtils-MakeMaker
yum install -y glibc glibc-devel glibc-static quilt ncurses-lib sed sdcc intltool sharutils bison wget
2、下载SDK,以K2P MTK的SDK为例
wget http://downloads.openwrt.org/releases/18.06.1/targets/ramips/mt7621/openwrt-sdk-18.06.1-ramips-mt7621_gcc-7.3.0_musl.Linux-x86_64.tar.xz
xz -d openwrt-sdk-18.06.1-ramips-mt7621_gcc-7.3.0_musl.Linux-x86_64.tar.xz
tar xf openwrt-sdk-18.06.1-ramips-mt7621_gcc-7.3.0_musl.Linux-x86_64.tar
3、下载ipk源码
cd openwrt-sdk-18.06.1-ramips-mt7621_gcc-7.3.0_musl.Linux-x86_64
./scripts/feeds update packages
./scripts/feeds install libpcre
./scripts/feeds update
./scripts/feeds install zlib
./scripts/feeds install libopenssl
git clone https://github.com/ywb94/openwrt-ssr.git package/openwrt-ssr
4、编译
make menuconfig
# 选择要编译的包
#luci ->3. Applications-> luci-app-shadowsocksR 原始版本
#luci ->3. Applications-> luci-app-shadowsocksR-GFW GFWList版本
选择为“M”后保存退出
# 开始编译
make package/openwrt-ssr/compile V=99
编译完成:
ipk目录如上图所示
ipk安装时如果提示dnsmasq错误,需先卸载dnsmasq,重新安装
opkg remove dnsmasq
安装后需重启一次路由器,否则无法启动
评论:3