├── .github └── workflows │ └── K3-LEDE.yml ├── LICENSE ├── README.md └── lede ├── .config ├── part1.sh ├── part1.sh.bak ├── part2.sh └── part2.sh.bak /.github/workflows/K3-LEDE.yml: -------------------------------------------------------------------------------- 1 | # 2 | #Copyright 2021-2024 yangxu52 3 | # 4 | #Licensed under the Apache License, Version 2.0 (the "License"); 5 | #you may not use this file except in compliance with the License. 6 | #You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | #Unless required by applicable law or agreed to in writing, software 11 | #distributed under the License is distributed on an "AS IS" BASIS, 12 | #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | #See the License for the specific language governing permissions and 14 | #limitations under the License. 15 | # 16 | 17 | name: K3 firmware compile lede 18 | 19 | on: 20 | workflow_dispatch: 21 | 22 | env: 23 | REPO_URL: https://github.com/coolsnowwolf/lede 24 | REPO_BRANCH: master 25 | FEEDS_CONF_FILE: lede/feeds.conf.default 26 | CONFIG_FILE: lede/.config 27 | MOD_PART1_SH: lede/part1.sh 28 | MOD_PART2_SH: lede/part2.sh 29 | UPLOAD_BIN_DIR: false 30 | UPLOAD_FIRMWARE: true 31 | UPLOAD_RELEASE: true 32 | TIME_ZONE: Asia/Shanghai 33 | COMPILE_DEPENDS: ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential 34 | bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib 35 | git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libfuse-dev libglib2.0-dev libgmp3-dev 36 | libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libpython3-dev libreadline-dev 37 | libssl-dev libtool lrzsz mkisofs msmtp ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 38 | python3-pyelftools python3-setuptools qemu-utils rsync scons squashfs-tools subversion swig texinfo 39 | uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev 40 | jobs: 41 | build: 42 | runs-on: ubuntu-22.04 43 | 44 | steps: 45 | - name: 签出工作区 46 | uses: actions/checkout@main 47 | 48 | - name: 初始化编译环境 49 | env: 50 | DEBIAN_FRONTEND: noninteractive 51 | run: | 52 | sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc 53 | sudo -E apt -qq update 54 | sudo -E apt -qq full-upgrade -y 55 | sudo -E apt -qq install -y $COMPILE_DEPENDS 56 | sudo -E apt -qq autoremove --purge 57 | sudo -E apt -qq clean 58 | sudo timedatectl set-timezone "$TIME_ZONE" 59 | sudo mkdir -p /workdir 60 | sudo chown $USER:$GROUPS /workdir 61 | 62 | - name: 拉取源代码 63 | working-directory: /workdir 64 | run: | 65 | df -hT $PWD 66 | git clone -b $REPO_BRANCH --single-branch $REPO_URL openwrt 67 | ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt 68 | 69 | - name: 尝试获取缓存 70 | uses: stupidloud/cachewrtbuild@main 71 | with: 72 | ccache: 'true' 73 | mixkey: 'bcm53' 74 | prefix: ${{ github.workspace }}/openwrt 75 | 76 | - name: 加载自定义feeds文件 77 | run: | 78 | [ -e $FEEDS_CONF_FILE ] && mv $FEEDS_CONF_FILE openwrt/feeds.conf.default 79 | chmod +x $MOD_PART1_SH 80 | cd openwrt 81 | $GITHUB_WORKSPACE/$MOD_PART1_SH 82 | 83 | - name: 更新feeds中描述内容 84 | run: cd openwrt && ./scripts/feeds update -a 85 | 86 | - name: 安装feeds中描述内容 87 | run: cd openwrt && ./scripts/feeds install -a 88 | 89 | - name: 加载自定义编译配置文件 90 | run: | 91 | [ -e files ] && mv files openwrt/files 92 | [ -e $CONFIG_FILE ] && mv $CONFIG_FILE openwrt/.config 93 | chmod +x $MOD_PART2_SH 94 | cd openwrt 95 | $GITHUB_WORKSPACE/$MOD_PART2_SH 96 | 97 | - name: 下载编译所需依赖文件 98 | id: package 99 | run: | 100 | cd openwrt 101 | make defconfig 102 | make download -j8 103 | find dl -size -1024c -exec ls -l {} \; 104 | find dl -size -1024c -exec rm -f {} \; 105 | 106 | - name: 编译固件 107 | id: compile 108 | run: | 109 | cd openwrt 110 | echo -e "$(nproc) thread compile" 111 | make -j$(nproc) || make -j1 || make -j1 V=s 112 | echo "STATUS=success" >> "$GITHUB_OUTPUT" 113 | grep '^CONFIG_TARGET.*DEVICE.*=y' .config | sed -r 's/.*DEVICE_(.*)=y/\1/' > DEVICE_NAME 114 | [ -s DEVICE_NAME ] && echo "DEVICE_NAME=_$(cat DEVICE_NAME)" >> $GITHUB_ENV 115 | echo "FILE_DATE=_$(date +"%Y%m%d%H%M")" >> $GITHUB_ENV 116 | 117 | - name: 核对空间占用 118 | if: (!cancelled()) 119 | run: df -hT 120 | 121 | - name: 上传bin目录 122 | uses: actions/upload-artifact@main 123 | if: steps.compile.outputs.STATUS == 'success' && env.UPLOAD_BIN_DIR == 'true' 124 | with: 125 | name: OpenWrt_bin${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 126 | path: openwrt/bin 127 | 128 | - name: 整理文件 129 | id: organize 130 | if: env.UPLOAD_FIRMWARE == 'true' && !cancelled() 131 | run: | 132 | cd openwrt/bin/targets/*/* 133 | rm -rf packages 134 | echo "FIRMWARE=$PWD" >> $GITHUB_ENV 135 | echo "STATUS=success" >> "$GITHUB_OUTPUT" 136 | 137 | - name: 上传固件目录 138 | uses: actions/upload-artifact@main 139 | if: steps.organize.outputs.STATUS == 'success' && !cancelled() 140 | with: 141 | name: OpenWrt_firmware${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 142 | path: ${{ env.FIRMWARE }} 143 | 144 | - name: 生成Release标识 145 | id: tag 146 | if: env.UPLOAD_RELEASE == 'true' && !cancelled() 147 | run: | 148 | echo "release_tag=K3-lede-$(date +"%Y.%m.%d-%H%M")" >> "$GITHUB_OUTPUT" 149 | touch release.txt 150 | echo "STATUS=success" >> "$GITHUB_OUTPUT" 151 | 152 | - name: 发布到Release 153 | uses: softprops/action-gh-release@v1 154 | if: steps.tag.outputs.STATUS == 'success' && !cancelled() 155 | env: 156 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 157 | with: 158 | tag_name: ${{ steps.tag.outputs.release_tag }} 159 | body_path: release.txt 160 | files: ${{ env.FIRMWARE }}/* 161 | 162 | - name: 清理工作空间 163 | uses: GitRML/delete-workflow-runs@main 164 | with: 165 | retain_days: 1 166 | keep_minimum_runs: 3 167 | 168 | - name: 移除旧的Realeases 169 | uses: dev-drprasad/delete-older-releases@v0.3.2 170 | if: env.UPLOAD_RELEASE == 'true' && !cancelled() 171 | env: 172 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 173 | with: 174 | keep_latest: 5 175 | delete_tags: true 176 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # **Phicomm-K3-OpenWrt-Firmware** [Please Star⚝ ↗] 2 | Phicomm K3 OpenWrt Firmware, compile by Github Actions 3 | [![LICENSE](https://img.shields.io/badge/license-apache--2.0-green.svg?style=flat-square&label=LICENSE)](https://github.com/yangxu52/Phicomm-K3-OpenWrt-Firmware/blob/main/LICENSE)  4 | ![GitHub Stars](https://img.shields.io/github/stars/yangxu52/Phicomm-K3-OpenWrt-Firmware.svg?style=flat-square&label=Stars&logo=github)  5 | ![GitHub Forks](https://img.shields.io/github/forks/yangxu52/Phicomm-K3-OpenWrt-Firmware.svg?style=flat-square&label=Forks&logo=github) 6 |   7 | ## **1. Instruction | 介绍** 8 | ### **1.1 Source Code | 源码使用** 9 | 10 | - [LEDE @coolsnowwf](https://github.com/coolsnowwolf/lede) 11 | 12 | - [Application passwall @xiaoruoji](https://github.com/xiaorouji/openwrt-passwall ) 13 | 14 | - [Luci theme Argon @jerrykuku](https://github.com/jerrykuku/luci-theme-argon) 15 | 16 | - [K3 Screen Deive and Controller @lwz322](https://github.com/lwz322/k3screenctrl_build) 17 | 18 | - ······ 19 | 20 | ### **1.2 Major Modifications | 主要修改** 21 | 22 | - **Remove all USB support** 23 | USB interface only has charging function. **Important !** 24 | 25 | - **Network Turbo ACC** 26 | Base on Qualcomm Short-FE, significantly improve forwarding ability. 27 | 28 | - **Add IPv6 full support** 29 | 30 | - **Add Phicoomm K3's LCD screen full support** 31 | 32 | - **Add UPNP & DDNS support** 33 | 34 | - **Add KMS Server** 35 | 36 | - **Add Syncdial & mwan3** 37 | Support multi-wan access and load balancing,suport PPPoE and others. 38 | 39 | - **Add ~~Passwall~~** proxy 40 | Only include Xray-core, so only support vmess,vless and trojan protocol. 41 | 42 | - **Add ServerChan** 43 | Send a router status through the WeChat official account (named "方糖") 44 | 45 | - **Add UnblockNeteaseMusic** 46 | Use others repository to unblock music which can't listen in Netease Music. 47 | 48 | - **Add WiFi Schedule** 49 | Schedule open/close wireless feature through un/mount wireless k-mod. 50 | 51 | - **Others** 52 |   53 | 54 | ## **2. Use Guide | 使用指南** 55 | ### **2.1 Language | 语言** 56 | 1. Open [Web Admin](http://192.168.1.1) (default: 192.168.1.1) in your browser and login (default: `root` `password`). 57 | 2. Open Menu `(系统|System)` -> `(系统|System)`, swith tab `(语言和界面|Language and Style)` 58 | 3. Change the `Language` select's option. (auto=English) 59 | 4. Click the `(保存&应用|SAVE&APPLY)` button to save. Finally,refresh browser. 60 |   61 | 62 | ### **2.2 Wireless Power | 无线功率** 63 | 1. Open [Web Admin](http://192.168.1.1) (default: 192.168.1.1) in your browser and login (default: `root` `password`). 64 | 2. Open Menu `(系统|System)` -> `(启动项|Startup)`, slide to the bottom. 65 | 3. Add some shell command in `(本地启动脚本|Local Startup Script)`, before `exit 0` 66 | ```shell 67 | iwconfig wlan0 txpower 23 68 | iwconfig wlan1 txpower 23 69 | ``` 70 | The `wlan0` represent 2.4G,`wlan1` represent 5G. `23` reresent submit power (max:`31`). 71 | Recommend: Between `23` and `27`.Power is proportional to signal and inversely proportional to wireless throughput. 72 | 4. Click the `(保存&应用|SAVE&APPLY)` button to save. Finally,refresh browser. 73 |   74 | 75 | ### **2.3 Network Turbo ACC | 网络加速** 76 | 1. Open [Web Admin](http://192.168.1.1) (default: 192.168.1.1) in your browser and login (default: `root` `password`). 77 | 2. Open Menu (网络|Network) -> (Turbo ACC Center|Turbo ACC 网络加速). 78 | 3. Selected the `Shortcut-FE flow offloading | Shortcut-FE 流量分载` and `BBR CCA | BBR 拥塞控制算法`.Change `FullCone NAT | 全锥型 NAT`'s Option to `High Performing Mode | 高性能模式` 79 | 4. Click the `(保存&应用|SAVE&APPLY)` button to save. 80 |   81 | 82 | ## **3. Tanks | 致谢** 83 | - [coolsnowwolf](https://github.com/coolsnowwolf) 84 | - [Lienol](https://github.com/Lienol) 85 | - [jerrykuku](https://github.com/jerrykuku) 86 | - [lwz322](https://github.com/lwz322) 87 | - [P3TERX](https://github.com/P3TERX) 88 | - Others 89 | -------------------------------------------------------------------------------- /lede/part1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | #Copyright 2021-2023 yangxu52 5 | # 6 | #Licensed under the Apache License, Version 2.0 (the "License"); 7 | #you may not use this file except in compliance with the License. 8 | #You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | #Unless required by applicable law or agreed to in writing, software 13 | #distributed under the License is distributed on an "AS IS" BASIS, 14 | #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | #See the License for the specific language governing permissions and 16 | #limitations under the License. 17 | # 18 | echo '添加Passwall依赖feeds' 19 | sed -i '$a src-git passwall https://github.com/xiaorouji/openwrt-passwall-packages' feeds.conf.default 20 | echo '=========Add passwall feeds source OK!=========' 21 | 22 | echo '添加Passwall软件源' 23 | rm -rf package/lean/luci-app-passwall 24 | git clone -b main --single-branch https://github.com/xiaorouji/openwrt-passwall package/lean/luci-app-passwall 25 | echo '=========Add passwall source OK!=========' 26 | 27 | echo '添加jerrykuku的argon-mod主题' 28 | rm -rf package/lean/luci-theme-argon 29 | git clone -b 18.06 --single-branch https://github.com/jerrykuku/luci-theme-argon package/lean/luci-theme-argon 30 | echo '=========Add argon-mod OK!=========' 31 | 32 | echo '添加lwz322的K3屏幕插件' 33 | rm -rf package/lean/luci-app-k3screenctrl 34 | git clone https://github.com/yangxu52/luci-app-k3screenctrl.git package/lean/luci-app-k3screenctrl 35 | echo '=========Add k3screen plug OK!=========' 36 | 37 | echo '替换lwz322的K3屏幕驱动插件' 38 | rm -rf package/lean/k3screenctrl 39 | git clone https://github.com/yangxu52/k3screenctrl_build.git package/lean/k3screenctrl/ 40 | echo '=========Replace k3screen drive plug OK!=========' 41 | 42 | # echo '移除bcm53xx中的其他机型' 43 | # sed -i '421,453d' target/linux/bcm53xx/image/Makefile 44 | # sed -i '140,412d' target/linux/bcm53xx/image/Makefile 45 | # sed -i 's/$(USB3_PACKAGES) k3screenctrl/luci-app-k3screenctrl/g' target/linux/bcm53xx/image/Makefile 46 | # sed -n '140,146p' target/linux/bcm53xx/image/Makefile 47 | # echo '=========Remove other devices of bcm53xx OK!=========' 48 | 49 | #1.'asus_dhd24' 2.'ac88u_20' 3.'69027' 50 | FIRMWARE='69027' 51 | echo '替换无线驱动' 52 | wget -nv https://github.com/yangxu52/Phicomm-k3-Wireless-Firmware/raw/master/brcmfmac4366c-pcie.bin.${FIRMWARE} -O package/lean/k3-brcmfmac4366c-firmware/files/lib/firmware/brcm/brcmfmac4366c-pcie.bin 53 | echo '=========Replace k3 wireless firmware OK!=========' 54 | -------------------------------------------------------------------------------- /lede/part1.sh.bak: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | #Copyright 2021-2023 yangxu52 5 | # 6 | #Licensed under the Apache License, Version 2.0 (the "License"); 7 | #you may not use this file except in compliance with the License. 8 | #You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | #Unless required by applicable law or agreed to in writing, software 13 | #distributed under the License is distributed on an "AS IS" BASIS, 14 | #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | #See the License for the specific language governing permissions and 16 | #limitations under the License. 17 | # 18 | 19 | # echo '添加SSRPLUS软件源' 20 | # sed -i '$a src-git helloworld https://github.com/fw876/helloworld' feeds.conf.default 21 | # cat feeds.conf.default |grep helloworld 22 | # echo '=========Add feed source OK!=========' 23 | 24 | # echo '添加bypass软件源' 25 | # sed -i '$a src-git bypass https://github.com/kiddin9/openwrt-bypass' feeds.conf.default 26 | # cat feeds.conf.default |grep bypass 27 | # echo '=========Add bypass source OK!=========' 28 | 29 | # echo '添加dnsfilter' 30 | # rm -rf package/lean/luci-app-dnsfilter 31 | # git clone https://github.com/kiddin9/luci-app-dnsfilter package/lean/luci-app-dnsfilter 32 | # echo '=========Add dnsfilter source OK!=========' 33 | 34 | # echo '添加OpenClash' 35 | # rm -rf package/lean/luci-app-openclash 36 | # svn checkout https://github.com/vernesong/OpenClash/trunk/luci-app-openclash package/lean/luci-app-openclash 37 | # echo '=========Add OpenClash source OK!=========' 38 | 39 | echo '添加Passwall软件源' 40 | sed -i '$a src-git passwall https://github.com/xiaorouji/openwrt-passwall' feeds.conf.default 41 | rm -rf package/lean/luci-app-passwall 42 | git clone -b luci https://github.com/xiaorouji/openwrt-passwall package/lean/luci-app-passwall 43 | echo '=========Add feed source OK!=========' 44 | 45 | echo '添加jerrykuku的argon-mod主题' 46 | rm -rf package/lean/luci-theme-argon 47 | git clone -b 18.06 https://github.com/jerrykuku/luci-theme-argon package/lean/luci-theme-argon 48 | echo '=========Add argon-mod OK!=========' 49 | 50 | echo '添加lwz322的K3屏幕插件' 51 | rm -rf package/lean/luci-app-k3screenctrl 52 | git clone https://github.com/yangxu52/luci-app-k3screenctrl.git package/lean/luci-app-k3screenctrl 53 | echo '=========Add k3screen plug OK!=========' 54 | 55 | echo '替换lwz322的K3屏幕驱动插件' 56 | rm -rf package/lean/k3screenctrl 57 | git clone https://github.com/yangxu52/k3screenctrl_build.git package/lean/k3screenctrl/ 58 | echo '=========Replace k3screen drive plug OK!=========' 59 | 60 | 61 | echo '移除bcm53xx中的其他机型' 62 | sed -i '421,453d' target/linux/bcm53xx/image/Makefile 63 | sed -i '140,412d' target/linux/bcm53xx/image/Makefile 64 | sed -i 's/$(USB3_PACKAGES) k3screenctrl/luci-app-k3screenctrl/g' target/linux/bcm53xx/image/Makefile 65 | # sed -n '140,146p' target/linux/bcm53xx/image/Makefile 66 | echo '=========Remove other devices of bcm53xx OK!=========' 67 | 68 | #1.'asus_dhd24' 2.'ac88u_20' 3.'69027' 69 | firmware='ac88u_20' 70 | echo '替换K3的无线驱动为asus-dhd24' 71 | wget -nv https://github.com/yangxu52/Phicomm-k3-Wireless-Firmware/raw/master/brcmfmac4366c-pcie.bin.${firmware} -O package/lean/k3-brcmfmac4366c-firmware/files/lib/firmware/brcm/brcmfmac4366c-pcie.bin 72 | echo '=========Replace k3 wireless firmware OK!=========' 73 | -------------------------------------------------------------------------------- /lede/part2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | #Copyright 2021-2023 yangxu52 5 | # 6 | #Licensed under the Apache License, Version 2.0 (the "License"); 7 | #you may not use this file except in compliance with the License. 8 | #You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | #Unless required by applicable law or agreed to in writing, software 13 | #distributed under the License is distributed on an "AS IS" BASIS, 14 | #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | #See the License for the specific language governing permissions and 16 | #limitations under the License. 17 | # 18 | 19 | # Alter default kernel version 20 | # sed -i 's/KERNEL_PATCHVER:=5.4/KERNEL_PATCHVER:=5.10/g' target/linux/bcm53xx/Makefile 21 | # cat target/linux/bcm53xx/Makefile |grep KERNEL_PATCHVER 22 | # echo '=========Alert Kernel OK!=========' 23 | 24 | # Alter default router IP 25 | #sed -i 's/192.168.1.1/192.168.50.5/g' package/base-files/files/bin/config_generate 26 | 27 | #修改NTP设置 28 | #sed -i "s/'0.openwrt.pool.ntp.org'/'ntp1.aliyun.com'/g" package/base-files/files/bin/config_generate 29 | #sed -i "s/'1.openwrt.pool.ntp.org'/'ntp2.aliyun.com'/g" package/base-files/files/bin/config_generate 30 | #sed -i "s/'2.openwrt.pool.ntp.org'/'ntp3.aliyun.com'/g" package/base-files/files/bin/config_generate 31 | #sed -i "s/'3.openwrt.pool.ntp.org'/'ntp4.aliyun.com'/g" package/base-files/files/bin/config_generate 32 | #cat package/base-files/files/bin/config_generate |grep system.ntp.server= 33 | #echo 'Alert NTP Settings OK!=====================' 34 | 35 | echo '修改主机名' 36 | sed -i "s/hostname='OpenWrt'/hostname='Phicomm-K3'/g" package/base-files/files/bin/config_generate 37 | cat package/base-files/files/bin/config_generate |grep hostname= 38 | echo '=========Alert hostname OK!=========' 39 | 40 | echo '移除主页跑分信息显示' 41 | sed -i 's/ <%=luci.sys.exec("cat \/etc\/bench.log") or ""%>//g' package/lean/autocore/files/arm/index.htm 42 | echo '=========Remove benchmark display in index OK!=========' 43 | 44 | echo '移除主页日志打印' 45 | sed -i '/console.log(mainNodeName);/d' package/lean/luci-theme-argon/htdocs/luci-static/argon/js/script.js 46 | echo '=========Remove log print in index OK!=========' 47 | 48 | echo '修改upnp绑定文件位置' 49 | sed -i 's/\/var\/upnp.leases/\/tmp\/upnp.leases/g' feeds/packages/net/miniupnpd/files/upnpd.config 50 | cat feeds/packages/net/miniupnpd/files/upnpd.config |grep upnp_lease_file 51 | echo '=========Alert upnp binding file directory!=========' 52 | 53 | #添加主页的CPU温度显示 54 | #sed -i "/<%:Load Average%>/a \ \t\t<%:CPU Temperature%><%=luci.sys.exec(\"sed 's/../&./g' /sys/class/thermal/thermal_zone0/temp|cut -c1-4\")%>" feeds/luci/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm 55 | #cat feeds/luci/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm |grep Temperature 56 | #echo "Add CPU Temperature in Admin Index OK=====================" 57 | -------------------------------------------------------------------------------- /lede/part2.sh.bak: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | #Copyright 2021-2023 yangxu52 5 | # 6 | #Licensed under the Apache License, Version 2.0 (the "License"); 7 | #you may not use this file except in compliance with the License. 8 | #You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | #Unless required by applicable law or agreed to in writing, software 13 | #distributed under the License is distributed on an "AS IS" BASIS, 14 | #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | #See the License for the specific language governing permissions and 16 | #limitations under the License. 17 | # 18 | 19 | # Alter default router IP 20 | #sed -i 's/192.168.1.1/192.168.50.5/g' package/base-files/files/bin/config_generate 21 | 22 | #修改NTP设置 23 | #sed -i "s/'0.openwrt.pool.ntp.org'/'ntp1.aliyun.com'/g" package/base-files/files/bin/config_generate 24 | #sed -i "s/'1.openwrt.pool.ntp.org'/'ntp2.aliyun.com'/g" package/base-files/files/bin/config_generate 25 | #sed -i "s/'2.openwrt.pool.ntp.org'/'ntp3.aliyun.com'/g" package/base-files/files/bin/config_generate 26 | #sed -i "s/'3.openwrt.pool.ntp.org'/'ntp4.aliyun.com'/g" package/base-files/files/bin/config_generate 27 | #cat package/base-files/files/bin/config_generate |grep system.ntp.server= 28 | #echo 'Alert NTP Settings OK!=====================' 29 | 30 | # latest='179' 31 | # latest_hash='2c9bdec0922a95aff34e8d53d2e0ecf7e842033cd908d2959a43d34afb5d897d' 32 | # echo '修改5.4分支为5.4.latest' 33 | # sed -i "/^LINUX_VERSION-5.4/c LINUX_VERSION-5.4 = .${latest}" include/kernel-5.4 34 | # sed -i "/^LINUX_KERNEL_HASH-5.4/c LINUX_KERNEL_HASH-5.4.${latest} = ${latest_hash}" include/kernel-5.4 35 | # echo '=========Alert kernel to 5.4.latest OK!=========' 36 | 37 | 38 | echo '修改主机名' 39 | sed -i "s/hostname='OpenWrt'/hostname='Phicomm-K3'/g" package/base-files/files/bin/config_generate 40 | cat package/base-files/files/bin/config_generate |grep hostname= 41 | echo '=========Alert hostname OK!=========' 42 | 43 | echo '移除主页跑分信息显示' 44 | sed -i 's/ <%=luci.sys.exec("cat \/etc\/bench.log") or ""%>//g' package/lean/autocore/files/arm/index.htm 45 | echo '=========Remove benchmark display in index OK!=========' 46 | 47 | echo '移除主页日志打印' 48 | sed -i '/console.log(mainNodeName);/d' package/lean/luci-theme-argon/htdocs/luci-static/argon/js/script.js 49 | echo '=========Remove log print in index OK!=========' 50 | 51 | echo '修改upnp绑定文件位置' 52 | sed -i 's/\/var\/upnp.leases/\/tmp\/upnp.leases/g' feeds/packages/net/miniupnpd/files/upnpd.config 53 | cat feeds/packages/net/miniupnpd/files/upnpd.config |grep upnp_lease_file 54 | echo '=========Alert upnp binding file directory!=========' 55 | 56 | #添加主页的CPU温度显示 57 | #sed -i "/<%:Load Average%>/a \ \t\t<%:CPU Temperature%><%=luci.sys.exec(\"sed 's/../&./g' /sys/class/thermal/thermal_zone0/temp|cut -c1-4\")%>" feeds/luci/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm 58 | #cat feeds/luci/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm |grep Temperature 59 | #echo "Add CPU Temperature in Admin Index OK=====================" 60 | --------------------------------------------------------------------------------