编译Shadowsocks for Gargoyle

因为shadowsocks-libev提供的nightly版是基于openwrt trunk编译的,而gargoyle 1.5.11基于openwrt attitude adjustment,所以在gargoyle上安装会出错:

root@Gargoyle:/# opkg install /tmp/ss.ipk
 ERROR: No package named shadowsocks-libev-polarssl found, try updating your package lists

当然,最简单快捷的方法是把ipk解压,再把文件放进对应目录就可以了。我主要是想趁着这次机会学习编译一下openwrt,接着开始记录本次编译过程。

更详细说明请参阅openwrt wiki

 

本次编译环境在Arch Linux下进行、路由器为水星mw4530r(tp-link wdr4310的马甲);在编译shadowsocks之前先把环境准备妥当:

pacman -Sy
pacman -S base-devel subversion git

接下来获取openwrt源码:

mkdir ~/openwrt
cd ~/openwrt
svn co svn://svn.openwrt.org/openwrt/branches/attitude_adjustment

检查是否缺少编译所需的套件:

cd ~/openwrt/attitude_adjustment
make defconfig
make prereq

下载shadowsocks-libev源码到package目录:

cd ~/openwrt/attitude_adjustment/package
git clone https://github.com/madeye/shadowsocks-libev.git

执行make menuconfig进行openwrt编译配置:

cd ~/openwrt/attitude_adjustment
make menuconfig

Target System (Atheros AR7xxx/AR9xxx)
Subtarget (Generic)
Target Profile (TP-LINK TL-WDR3600/4300/4310)

Network里面选上shadowsocks-libev(按空格出现M即可,代表编译为ipk包),其它的不用管,因为这次目的是编译shadowsocks,保存退出menuconfig。

At last,开始编译:

make V=s

然后就是漫长的等待了,编译过程中会下载必要的工具包,请保持网络畅通。大约一小时后,原无意外shadowsocks会出现在:

ls ~/openwrt/attitude_adjustmentbin/bin/ar71xx/packages/ |grep shadow
shadowsocks-libev_1.4.2-343940e6ffd2062b11dccab0894b73f7f32722f7_ar71xx.ipk

把它放到路由器上opkg install ./shadow[TAB],大家懂的。

One thought on “编译Shadowsocks for Gargoyle

Leave a Reply

Your email address will not be published. Required fields are marked *