Skip to content

CYG-K2-USB

CYG-K2-USB #8

Workflow file for this run

#修改TNAME: K2P 中的K2P为你需要编译的型号,注意名称要与configs/templates/目录下的名字相同
name: CYG-K2-USB
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: Checkout
uses: actions/checkout@master
- name: Initialization environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
sudo apt-get -y install unzip libtool-bin curl cmake gperf gawk flex bison nano xxd fakeroot \
cpio git python-docutils gettext automake autopoint texinfo build-essential help2man \
pkg-config zlib1g-dev libgmp3-dev libmpc-dev libmpfr-dev libncurses5-dev libltdl-dev wget
- name: Clone source code
env:
KERNEL: 3.4
run: |
git clone --depth=1 https://github.com/chenbaker/Padavan-KVR.git /opt/rt-n56u
cd /opt/rt-n56u/toolchain-mipsel
sh dl_toolchain.sh
mkdir -p /opt/images/
- name: Build Firmware
env:
TNAME: CYG-K2-USB
KERNEL: 3.4
run: |
cd /opt/rt-n56u/trunk
if [ ! -f configs/templates/$TNAME.config ] ; then
echo "configs/templates/$TNAME.config not found "
exit 1
fi
cp -f configs/templates/$TNAME.config .config
################################################################################################
#因不同型号配置功能不一样,所以先把配置项删除,如果你自己要添加其他的,也要写上删除这一条,切记!!!
################################################################################################
##科学上网##
sed -i '/CONFIG_FIRMWARE_INCLUDE_SHADOWSOCKS/d' .config #删除配置项SHADOWSOCKS
#sed -i '/CONFIG_FIRMWARE_INCLUDE_XRA/d' .config
#sed -i '/CONFIG_FIRMWARE_INCLUDE_TROJAN/d' .config
#sed -i '/CONFIG_FIRMWARE_INCLUDE_SSOBFS/d' .config
#sed -i 'CONFIG_FIRMWARE_INCLUDE_V2RAY/d' .config
##内网穿透服务##
sed -i '/CONFIG_FIRMWARE_INCLUDE_ZEROTIER/d' .config #删除配置项zerotier
sed -i '/CONFIG_FIRMWARE_INCLUDE_ALIDDNS/d' .config
sed -i '/CONFIG_FIRMWARE_INCLUDE_DDNSTO/d' .config
sed -i '/CONFIG_FIRMWARE_INCLUDE_NPC/d' .config
######################################################################
#以下选项是定义你需要的功能(y=集成,n=忽略),重新写入到.config文件
######################################################################
##科学上网##
echo "CONFIG_FIRMWARE_INCLUDE_SHADOWSOCKS=y" >> .config #SHADOWSOCK
#echo "CONFIG_FIRMWARE_INCLUDE_XRAY=y" >> .config #集成xray执行文件,可以代替v2ray,大小5M多,如果闪存太小不够还是建议使用v2ray
#echo "CONFIG_FIRMWARE_INCLUDE_TROJAN=y" >> .config #集成trojan执行文件,如果不集成,会从网上下载下来执行,不影响正常使用
#echo "CONFIG_FIRMWARE_INCLUDE_SSOBFS=y" >> .config #simple-obfs混淆插件
#echo "CONFIG_FIRMWARE_INCLUDE_V2RAY=y" >> .config #集成v2ray执行文件,如果不集成,会从网上下载下来执行,不影响正常使用
##内网穿透服务##
echo "CONFIG_FIRMWARE_INCLUDE_ZEROTIER=y" >> .config #zerotier ~1.3M
echo "CONFIG_FIRMWARE_INCLUDE_ALIDDNS=y" >> .config #aliddns
echo "CONFIG_FIRMWARE_INCLUDE_DDNSTO=y" >> .config #ddnsto
echo "CONFIG_FIRMWARE_INCLUDE_NPC=y" >> .config #npc
#########################################################################################
#自定义添加其它功能请参考源码configs/templates/目录下的config文件。按照上面的格式添加即可
#格式如下:
#sed -i '/自定义项/d' .config
#echo "自定义项=y" >> .config
#########################################################################################
sudo ./clear_tree
sudo ./build_firmware_modify $TNAME 0
sudo mv -f images/*.trx /opt/images/
- name : Upload packages
uses: actions/upload-artifact@master
if: always()
with:
name: Padavan-packages
path: /opt/images