├── diy.sh ├── README.md ├── .config └── .github └── workflows └── build-openwrt-lean.yml /diy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #================================================= 3 | # Description: DIY script 4 | # Lisence: MIT 5 | # Author: P3TERX 6 | # Blog: https://p3terx.com 7 | #================================================= 8 | # Modify default IP 9 | sed -i 's/192.168.1.1/192.168.5.222/g' package/base-files/files/bin/config_generate 10 | 11 | # Modify the version number 12 | # sed -i 's/OpenWrt/Leopard build $(date "+%Y.%m.%d") @ OpenWrt/g' package/default-settings/files/zzz-default-settings 13 | 14 | # 添加新的主题包 15 | # git clone https://github.com/Leo-Jo-My/luci-theme-opentomcat.git package/lean/luci-theme-opentomcat 16 | 17 | # 去除默认主题 18 | sed -i '/set luci.main.mediaurlbase=\/luci-static\/bootstrap/d' feeds/luci/themes/luci-theme-bootstrap/root/etc/uci-defaults/30_luci-theme-bootstrap 19 | 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # OpenWrt firmware for K2-PSG1218-A 3 | 固件采用GitHub Actions不定时自动云编译斐讯K2-PSG1218-A。 4 | Auto build OpenWrt firmware for K2-PSG1218-A via GitHub Actions 5 | 6 | # 致谢大佬&Thanks 7 | 8 | https://github.com/coolsnowwolf/lede 9 | 10 | https://github.com/P3TERX/Actions-OpenWrt/ 11 | 12 | https://github.com/Lienol/openwrt-package 13 | 14 | ..... 15 | 16 | 17 | 18 | # 最新版下载&Download Latest 19 | [![GitHub release (latest by date)](https://img.shields.io/github/v/release/leopardciaw/PSG1218?style=for-the-badge&label=Download)](https://github.com/leopardciaw/PSG1218/releases/latest) 20 | 21 | 22 | [所有已发布 & All Release](https://github.com/leopardciaw/PSG1218/releases) 23 | 24 | # 请注意 25 | 1.集成的插件只是自己需要用到的,请多多包涵。 26 | 2.源码来自https://github.com/coolsnowwolf/lede, 27 | 除了增减插件和主题、修改管理IP外,未做其他修改,有问题请直接到 28 | https://github.com/coolsnowwolf/lede/issues 这里提交issue,提交issues请注意基本的礼仪和格式,翻看之前是否有大佬已提出相关issue。 29 | 3.才疏学浅、时间有限,回答不了任何技术问题哈,只是定时或不定时更新下大雕的源码编译。 30 | -------------------------------------------------------------------------------- /.config: -------------------------------------------------------------------------------- 1 | # 编译psg1218a固件: 2 | CONFIG_TARGET_ramips=y 3 | CONFIG_TARGET_ramips_mt7620=y 4 | CONFIG_TARGET_ramips_mt7620_DEVICE_phicomm_psg1218a=y 5 | 6 | # 固件压缩: 7 | CONFIG_TARGET_IMAGES_GZIP=y 8 | 9 | # IPv6支持: 10 | CONFIG_PACKAGE_dnsmasq_full_dhcpv6=y 11 | CONFIG_PACKAGE_ip6tables=y 12 | CONFIG_PACKAGE_ipv6helper=y 13 | 14 | # 常用LuCI插件选择: 15 | CONFIG_LIBCURL_NO_SMB="!" 16 | # CONFIG_PACKAGE_luci-app-samba is not set 17 | # CONFIG_PACKAGE_autosamba is not set 18 | # CONFIG_PACKAGE_luci-app-accesscontrol is not set 19 | # CONFIG_PACKAGE_luci-app-adguardhome is not set 20 | CONFIG_PACKAGE_luci-app-ddns=y 21 | # CONFIG_PACKAGE_luci-app-adbyby-plus is not set 22 | CONFIG_PACKAGE_luci-app-arpbind=y 23 | # CONFIG_PACKAGE_luci-app-autoreboot is not set 24 | # CONFIG_PACKAGE_luci-app-cifsd is not set 25 | CONFIG_PACKAGE_luci-app-mtwifi=y 26 | CONFIG_PACKAGE_luci-app-guest-wifi=y 27 | CONFIG_PACKAGE_luci-app-upnp=y 28 | # CONFIG_PACKAGE_luci-app-wol is not set 29 | # CONFIG_PACKAGE_luci-app-vlmcsd is not set 30 | # CONFIG_PACKAGE_luci-app-firewall is not set 31 | # CONFIG_PACKAGE_luci-app-hd-idle is not set 32 | CONFIG_PACKAGE_luci-app-ramfree=y 33 | # CONFIG_DEFAULT_luci-app-flowoffload is not set 34 | # CONFIG_PACKAGE_luci-app-cpufreq is not set 35 | # CONFIG_PACKAGE_luci-app-filetransfer is not set 36 | # CONFIG_PACKAGE_luci-app-ttyd is not set 37 | # CONFIG_PACKAGE_luci-app-vsftpd is not set 38 | # CONFIG_PACKAGE_luci-app-syncdial is not set 39 | # CONFIG_PACKAGE_luci-app-zerotier is not set 40 | # CONFIG_DEFAULT_luci-app-sfe is not set 41 | # CONFIG_DEFAULT_luci-app-sqm is not set 42 | # CONFIG_PACKAGE_luci-app-mwan3 is not set 43 | # CONFIG_PACKAGE_luci-app-mwan3helper is not set 44 | # CONFIG_PACKAGE_luci-app-noddos is not set 45 | # CONFIG_PACKAGE_luci-app-qos is not set 46 | # CONFIG_PACKAGE_luci-app-usb-printer is not set 47 | # CONFIG_PACKAGE_luci-app-webadmin is not set 48 | # CONFIG_PACKAGE_luci-app-wireguard is not set 49 | # CONFIG_PACKAGE_luci-app-wrtbwmon is not set 50 | 51 | # LuCI主题: 52 | # CONFIG_PACKAGE_luci-theme-opentomcat is not set 53 | CONFIG_PACKAGE_luci-theme-netgear=y 54 | # CONFIG_PACKAGE_luci-theme-argon is not set 55 | # CONFIG_DEFAULT_luci-theme-bootstrap-mod is not set 56 | # CONFIG_DEFAULT_luci-theme-darkmatter is not set 57 | # CONFIG_PACKAGE_luci-theme-material is not set 58 | -------------------------------------------------------------------------------- /.github/workflows/build-openwrt-lean.yml: -------------------------------------------------------------------------------- 1 | #================================================= 2 | # https://github.com/P3TERX/Actions-OpenWrt 3 | # Description: Build OpenWrt using GitHub Actions 4 | # Lisence: MIT 5 | # env:false @ ture 6 | # Author: P3TERX 7 | # Blog: https://p3terx.com 8 | #================================================= 9 | 10 | name: Build OpenWrt PSG1218A 11 | 12 | on: 13 | repository_dispatch: 14 | # release: 15 | # types: published 16 | # push: 17 | # branches: 18 | # - master 19 | # paths: 20 | # - '.config' 21 | schedule: 22 | - cron: 0 15 */25 * * 23 | # 分 时 日 月 周5 24 | # - cron: 0 8 */3 * * 25 | # watch: 26 | # types: started 27 | 28 | env: 29 | REPO_URL: https://github.com/coolsnowwolf/lede 30 | REPO_BRANCH: master 31 | FEEDS_CONF: feeds.conf.default 32 | CONFIG_FILE: .config 33 | DIY_SH: diy.sh 34 | SSH_ACTIONS: false 35 | UPLOAD_BIN_DIR: false 36 | UPLOAD_FIRMWARE: true 37 | UPLOAD_COWTRANSFER: false 38 | UPLOAD_WETRANSFER: false 39 | UPLOAD_RELEASE: true 40 | TZ: Asia/Shanghai 41 | 42 | jobs: 43 | build: 44 | runs-on: ubuntu-18.04 45 | 46 | 47 | steps: 48 | - name: Checkout 49 | uses: actions/checkout@main 50 | 51 | - name: Initialization environment 52 | env: 53 | DEBIAN_FRONTEND: noninteractive 54 | run: | 55 | sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc 56 | sudo -E apt-get -qq update 57 | sudo -E apt-get -qq install $(curl -fsSL git.io/depends-ubuntu-1804) 58 | sudo -E apt-get -qq autoremove --purge 59 | sudo -E apt-get -qq clean 60 | sudo timedatectl set-timezone "$TZ" 61 | sudo mkdir -p /workdir 62 | sudo chown $USER:$GROUPS /workdir 63 | 64 | - name: 克隆源代码 65 | run: git clone --depth 1 $REPO_URL -b $REPO_BRANCH openwrt 66 | 67 | - name: 更新安装提要 68 | run: cd openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a && ./scripts/feeds install -a 69 | 70 | - name: 加载自定义配置 71 | run: | 72 | [ -e files ] && mv files openwrt/files 73 | [ -e $CONFIG_FILE ] && mv $CONFIG_FILE openwrt/.config 74 | chmod +x $DIY_SH 75 | cd openwrt 76 | ../$DIY_SH 77 | 78 | - name: SSH connection to Actions 79 | # uses: csexton/debugger-action@master 80 | if: env.SSH_ACTIONS == 'true' 81 | uses: mxschmitt/action-tmate@v3 82 | timeout-minutes: 30 83 | 84 | - name: 下载dl文件包 85 | id: package 86 | run: | 87 | cd openwrt 88 | make defconfig 89 | make download -j8 90 | find dl -size -1024c -exec ls -l {} \; 91 | find dl -size -1024c -exec rm -f {} \; 92 | 93 | - name: Compile the firmware 94 | id: compile 95 | run: | 96 | cd openwrt 97 | echo -e "$(nproc) thread compile" 98 | make -j$(nproc) || make -j1 || make -j1 V=s 99 | echo "::set-output name=status::success" 100 | grep '^CONFIG_TARGET.*DEVICE.*=y' .config | sed -r 's/.*DEVICE_(.*)=y/\1/' > DEVICE_NAME 101 | [ -s DEVICE_NAME ] && echo "DEVICE_NAME=_$(cat DEVICE_NAME)" >> $GITHUB_ENV 102 | echo "FILE_DATE=_$(date +"%Y%m%d%H%M")" >> $GITHUB_ENV 103 | 104 | - name: Check space usage 105 | if: (!cancelled()) 106 | run: df -hT 107 | 108 | - name: Upload bin directory 109 | uses: actions/upload-artifact@main 110 | if: steps.compile.outputs.status == 'success' && env.UPLOAD_BIN_DIR == 'true' 111 | with: 112 | name: OpenWrt_bin${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 113 | path: openwrt/bin 114 | 115 | - name: Organize files 116 | id: organize 117 | if: env.UPLOAD_FIRMWARE == 'true' && !cancelled() 118 | run: | 119 | cd openwrt/bin/targets/*/* 120 | rm -rf packages 121 | echo "FIRMWARE=$PWD" >> $GITHUB_ENV 122 | echo "::set-output name=status::success" 123 | 124 | - name: Upload firmware directory 125 | uses: actions/upload-artifact@main 126 | if: steps.organize.outputs.status == 'success' && !cancelled() 127 | with: 128 | name: OpenWrt_firmware${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 129 | path: ${{ env.FIRMWARE }} 130 | 131 | - name: Upload firmware to cowtransfer 132 | id: cowtransfer 133 | if: steps.organize.outputs.status == 'success' && env.UPLOAD_COWTRANSFER == 'true' && !cancelled() 134 | run: | 135 | curl -fsSL git.io/file-transfer | sh 136 | ./transfer cow --block 2621440 -s -p 64 --no-progress ${FIRMWARE} 2>&1 | tee cowtransfer.log 137 | echo "::warning file=cowtransfer.com::$(cat cowtransfer.log | grep https)" 138 | echo "::set-output name=url::$(cat cowtransfer.log | grep https | cut -f3 -d" ")" 139 | 140 | - name: Upload firmware to WeTransfer 141 | id: wetransfer 142 | if: steps.organize.outputs.status == 'success' && env.UPLOAD_WETRANSFER == 'true' && !cancelled() 143 | run: | 144 | curl -fsSL git.io/file-transfer | sh 145 | ./transfer wet -s -p 16 --no-progress ${FIRMWARE} 2>&1 | tee wetransfer.log 146 | echo "::warning file=wetransfer.com::$(cat wetransfer.log | grep https)" 147 | echo "::set-output name=url::$(cat wetransfer.log | grep https | cut -f3 -d" ")" 148 | 149 | - name: Generate release tag 150 | id: tag 151 | if: env.UPLOAD_RELEASE == 'true' && !cancelled() 152 | run: | 153 | echo "::set-output name=release_tag::$(date +"%Y.%m.%d-%H%M")" 154 | touch release.txt 155 | [ $UPLOAD_COWTRANSFER = true ] && echo "🔗 [Cowtransfer](${{ steps.cowtransfer.outputs.url }})" >> release.txt 156 | [ $UPLOAD_WETRANSFER = true ] && echo "🔗 [WeTransfer](${{ steps.wetransfer.outputs.url }})" >> release.txt 157 | echo "::set-output name=status::success" 158 | 159 | - name: Upload firmware to release 160 | uses: softprops/action-gh-release@v1 161 | if: steps.tag.outputs.status == 'success' && !cancelled() 162 | env: 163 | GITHUB_TOKEN: ${{ secrets.LEO_TOKEN }} 164 | with: 165 | tag_name: ${{ steps.tag.outputs.release_tag }} 166 | body_path: release.txt 167 | files: ${{ env.FIRMWARE }}/* 168 | --------------------------------------------------------------------------------