新增设备支持: 小娱C5(xiaoyu_xy-c5)

This commit is contained in:
Hyy2001X 2021-05-06 11:08:50 +08:00
parent 6444ebda97
commit 7b5075af1f
3 changed files with 265 additions and 0 deletions

156
.github/workflows/xiaoyu_xy-c5.yml vendored Normal file
View File

@ -0,0 +1,156 @@
#=======================================================
# Description: Build OpenWrt using GitHub Actions
# https://github.com/Hyy2001X/AutoBuild-Actions
# Lisence: MIT
# Author: P3TERX
# Modify: Hyy2001X
#=======================================================
name: AutoBuild-xiaoyu_xy-c5
on:
repository_dispatch:
workflow_dispatch:
inputs:
ssh:
description: 'SSH connection to Actions'
required: true
default: 'false'
# schedule:
# - cron: 0 11 * * *
# watch:
# types: [started]
env:
REPO_URL: https://github.com/coolsnowwolf/lede
REPO_BRANCH: master
CONFIG_FILE: xiaoyu_xy-c5
DIY_SCRIPT: Scripts/AutoBuild_DiyScript.sh
FUNCTION_SCRIPT: Scripts/AutoBuild_Function.sh
UPLOAD_RELEASE: true
UPLOAD_FIRMWARE: false
UPLOAD_BIN_DIR: false
REMOVE_USELESS_FILES: true
REMOVE_OLD_RELEASE: false
REMOVE_WORKFLOW_RUNS: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Initialization Environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo -E apt-get update
sudo -E apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf wget curl swig rsync
sudo timedatectl set-timezone "Asia/Shanghai"
sudo mkdir -p /workdir
sudo chown $USER:$GROUPS /workdir
echo "Compile_Date=$(date +%Y%m%d%H%M)" > $GITHUB_WORKSPACE/Openwrt.info
echo "Display_Date=$(date +%Y/%m/%d)" >> $GITHUB_WORKSPACE/Openwrt.info
echo "Artifacts_Date=$(date +%Y%m%d%H%M)" >> $GITHUB_ENV
touch update_log.txt
- name: Remove useless files
if: env.REMOVE_USELESS_FILES == 'true' && !cancelled()
run: |
echo "Deleting useless files, please wait ..."
docker rmi `docker images -q`
sudo rm -rf \
/usr/share/dotnet \
/etc/mysql \
/etc/php
sudo -E apt-get -y autoremove --purge
sudo -E apt-get clean
- name: Clone source code
run: |
git clone -b $REPO_BRANCH $REPO_URL openwrt
ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt
[ -f Configs/$CONFIG_FILE ] && cp Configs/$CONFIG_FILE openwrt/.config || {
echo "未检测到该设备的 $CONFIG_FILE 配置文件!"
exit 1
}
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
make defconfig
- name: Run Custom Firmware-Diy Scripts
run: |
chmod +x $DIY_SCRIPT
chmod +x $FUNCTION_SCRIPT
cd openwrt
source $GITHUB_WORKSPACE/$DIY_SCRIPT
source $GITHUB_WORKSPACE/$FUNCTION_SCRIPT && Firmware-Diy_Base
Firmware-Diy
- name: SSH connection to Actions
uses: P3TERX/ssh2actions@v1.0.0
if: (github.event.inputs.ssh == 'true' && github.event.inputs.ssh != 'false') || contains(github.event.action, 'ssh')
env:
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
- name: Preload and Compile the Openwrt
run: |
cp Configs/$CONFIG_FILE openwrt/.config
cd openwrt
./scripts/feeds install -a
make defconfig
make download -j$(nproc)
echo "Start to compile OpenWrt ..."
make -j$(nproc) || make -j1 V=s
- name: Process the AutoBuild Firmware
run: |
cd openwrt
source $GITHUB_WORKSPACE/$DIY_SCRIPT
source $GITHUB_WORKSPACE/$FUNCTION_SCRIPT && PS_Firmware
- name: Upload Firmware to Artifacts
uses: actions/upload-artifact@main
if: env.UPLOAD_FIRMWARE == 'true' && !cancelled()
with:
name: OpenWrt_Firmware_${{ env.Artifacts_DATE }}
path: openwrt/bin/Firmware
- name: Upload bin directory to Artifacts
uses: actions/upload-artifact@main
if: env.UPLOAD_BIN_DIR == 'true' && !cancelled()
with:
name: OpenWrt_bin_${{ env.Artifacts_DATE }}
path: openwrt/bin
- name: Upload Firmware to Release
uses: softprops/action-gh-release@v1
if: env.UPLOAD_RELEASE == 'true' && !cancelled()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: AutoUpdate
body_path: update_log.txt
files: openwrt/bin/Firmware/*
- name: Remove old Release
uses: dev-drprasad/delete-older-releases@v0.1.0
if: env.REMOVE_OLD_RELEASE == 'true' && !cancelled()
with:
keep_latest: 3
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Remove workflow runs
uses: GitRML/delete-workflow-runs@main
if: env.REMOVE_WORKFLOW_RUNS == 'true' && !cancelled()
with:
retain_days: 1
keep_minimum_runs: 3

106
Configs/xiaoyu_xy-c5 Normal file
View File

@ -0,0 +1,106 @@
CONFIG_TARGET_ramips=y
CONFIG_TARGET_ramips_mt7621=y
CONFIG_TARGET_ramips_mt7621_DEVICE_xiaoyu_xy-c5=y
CONFIG_BUILD_PATENTED=y
# IPv6 相关
CONFIG_IPV6=y
CONFIG_KERNEL_IPV6=y
CONFIG_PACKAGE_ipv6helper=y
CONFIG_PACKAGE_dnsmasq_full_dhcpv6=y
CONFIG_PACKAGE_6rd=y
CONFIG_PACKAGE_6to4=y
# 加密
CONFIG_PACKAGE_luci-ssl-openssl=y
CONFIG_PACKAGE_kmod-crypto-gcm=y
CONFIG_PACKAGE_kmod-crypto-md5=y
CONFIG_PACKAGE_kmod-crypto-sha256=y
# USB 相关
CONFIG_PACKAGE_automount=y
CONFIG_PACKAGE_e2fsprogs=y
CONFIG_PACKAGE_luci-app-hd-idle=y
CONFIG_PACKAGE_luci-app-usb-printer=y
## USB 网络共享
CONFIG_PACKAGE_kmod-usb-net=y
CONFIG_PACKAGE_kmod-usb-net-asix=y
CONFIG_PACKAGE_kmod-usb-net-cdc-ether=y
CONFIG_PACKAGE_kmod-usb-net-cdc-ncm=y
CONFIG_PACKAGE_kmod-usb-net-hso=y
CONFIG_PACKAGE_kmod-usb-net-huawei-cdc-ncm=y
CONFIG_PACKAGE_kmod-usb-net-ipheth=y
CONFIG_PACKAGE_kmod-usb-net-rndis=y
CONFIG_PACKAGE_libudev-fbsd=y
CONFIG_PACKAGE_usbutils=y
## USB 网络存储
CONFIG_PACKAGE_autosamba=y
CONFIG_PACKAGE_luci-app-samba=y
CONFIG_PACKAGE_luci-app-vsftpd=y
# 主题包以及相关设置
CONFIG_PACKAGE_luci-theme-argon=y
CONFIG_PACKAGE_luci-app-argon-config=y
# DDNS 相关
CONFIG_PACKAGE_luci-app-ddns=y
CONFIG_PACKAGE_ddns-scripts_aliyun=y
CONFIG_PACKAGE_ddns-scripts_dnspod=y
CONFIG_PACKAGE_ddns-scripts_cloudflare.com-v4=y
CONFIG_PACKAGE_ddns-scripts_freedns_42_pl=y
CONFIG_PACKAGE_ddns-scripts_no-ip_com=y
## 下载管理工具
CONFIG_PACKAGE_luci-app-aria2=y
CONFIG_PACKAGE_curl=y
CONFIG_PACKAGE_wget=y
# CONFIG_PACKAGE_luci-app-rclone_INCLUDE_fuse-utils is not set
# CONFIG_PACKAGE_luci-app-rclone_INCLUDE_rclone-ng is not set
# CONFIG_PACKAGE_luci-app-rclone_INCLUDE_rclone-webui is not set
# LUCI Appliciations
CONFIG_PACKAGE_luci-app-accesscontrol=y
CONFIG_PACKAGE_luci-app-adbyby-plus=y
CONFIG_PACKAGE_luci-app-adguardhome=y
CONFIG_PACKAGE_luci-app-autoupdate=y
CONFIG_PACKAGE_luci-app-bearDropper=y
CONFIG_PACKAGE_luci-app-eqos=y
CONFIG_PACKAGE_luci-app-filetransfer=y
CONFIG_PACKAGE_luci-app-mwan3=y
CONFIG_PACKAGE_luci-app-mwan3helper=y
CONFIG_PACKAGE_luci-app-nlbwmon=y
CONFIG_PACKAGE_luci-app-openclash=y
CONFIG_PACKAGE_luci-app-onliner=y
CONFIG_PACKAGE_luci-app-sqm=y
CONFIG_PACKAGE_luci-app-smartdns=y
CONFIG_PACKAGE_luci-app-ssr-plus=y
CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Shadowsocks=y
CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_ShadowsocksR_Server=y
CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Xray=y
CONFIG_PACKAGE_xray-geodata=y
CONFIG_PACKAGE_luci-app-serverchan=y
CONFIG_PACKAGE_luci-app-socat=y
CONFIG_SOCAT_SSL=y
CONFIG_PACKAGE_luci-app-syncdial=y
CONFIG_PACKAGE_luci-app-ttyd=y
CONFIG_PACKAGE_luci-app-uhttpd=y
CONFIG_PACKAGE_luci-app-upnp=y
CONFIG_PACKAGE_luci-app-unblockmusic=y
CONFIG_UnblockNeteaseMusic_Go=y
CONFIG_PACKAGE_luci-app-webadmin=y
CONFIG_PACKAGE_luci-app-wol=y
CONFIG_PACKAGE_luci-app-wireguard=y
CONFIG_PACKAGE_luci-app-zerotier=y
# Other Appliciations
CONFIG_PACKAGE_ppp-mod-pppol2tp=y
CONFIG_PACKAGE_ppp-mod-pptp=y
CONFIG_PACKAGE_wpad=y
CONFIG_PACKAGE_xz=y
CONFIG_PACKAGE_xz-utils=y
## 网络性能
CONFIG_PACKAGE_iperf3=y

View File

@ -0,0 +1,3 @@
git other OpenClash https://github.com/vernesong master
svn other luci-app-eqos https://github.com/kenzok8/openwrt-packages/trunk
git other luci-app-bearDropper https://github.com/NateLol