├── .github └── workflows │ └── compile-openwrt.yml ├── README.md ├── build ├── Lede_source │ ├── .config │ ├── diy-part.sh │ ├── diy │ │ ├── README │ │ └── package │ │ │ └── base-files │ │ │ └── files │ │ │ └── etc │ │ │ └── banner │ ├── files │ │ ├── README │ │ ├── etc │ │ │ ├── config │ │ │ │ ├── dropbear │ │ │ │ ├── network │ │ │ │ └── openclash │ │ │ └── openclash │ │ │ │ └── core │ │ │ │ └── clash_meta │ │ └── usr │ │ │ └── sbin │ │ │ └── app │ ├── patches │ │ └── README │ └── settings.ini ├── Lienol_source │ ├── diy-part.sh │ ├── diy │ │ ├── README │ │ └── package │ │ │ └── base-files │ │ │ └── files │ │ │ └── etc │ │ │ └── banner │ ├── files │ │ └── README │ ├── patches │ │ └── README │ └── settings.ini ├── Mortal_source │ ├── diy-part.sh │ ├── diy │ │ ├── README │ │ └── package │ │ │ └── base-files │ │ │ └── files │ │ │ └── etc │ │ │ └── banner │ ├── files │ │ └── README │ ├── patches │ │ └── README │ └── settings.ini ├── common │ ├── 1022gg │ ├── AutoUpdate.sh │ ├── Custom │ │ ├── DRM-I915 │ │ ├── compile.sh │ │ └── seedconfig.sh │ ├── LEDE │ │ ├── diy │ │ │ ├── README │ │ │ └── package │ │ │ │ └── base-files │ │ │ │ └── files │ │ │ │ └── lib │ │ │ │ └── upgrade │ │ │ │ └── keep.d │ │ │ │ └── base-files-essential │ │ ├── files │ │ │ └── README │ │ └── patches │ │ │ └── README │ ├── LICENSE │ ├── LIENOL │ │ ├── diy │ │ │ ├── README │ │ │ └── package │ │ │ │ └── base-files │ │ │ │ └── files │ │ │ │ ├── etc │ │ │ │ ├── profile │ │ │ │ └── webweb.sh │ │ │ │ └── lib │ │ │ │ └── upgrade │ │ │ │ └── keep.d │ │ │ │ └── base-files-essential │ │ ├── files │ │ │ └── README │ │ └── patches │ │ │ └── README │ ├── MORTAL │ │ ├── diy │ │ │ ├── README │ │ │ └── package │ │ │ │ └── base-files │ │ │ │ └── files │ │ │ │ ├── etc │ │ │ │ ├── profile │ │ │ │ └── webweb.sh │ │ │ │ └── lib │ │ │ │ └── upgrade │ │ │ │ └── keep.d │ │ │ │ └── base-files-essential │ │ ├── files │ │ │ └── README │ │ └── patches │ │ │ └── README │ ├── README.md │ ├── common.sh │ ├── replace.sh │ └── upgrade.sh └── openwrt_amlogic │ ├── aarch64_cortex-a53.config │ ├── diy-part.sh │ ├── diy │ ├── README │ └── package │ │ └── base-files │ │ └── files │ │ └── etc │ │ └── banner │ ├── files │ ├── README │ ├── etc │ │ ├── FileBrowser │ │ │ └── filebrowser │ │ ├── config │ │ │ ├── argon │ │ │ ├── dhcp │ │ │ ├── filebrowser │ │ │ ├── network │ │ │ ├── openclash │ │ │ ├── samba4 │ │ │ └── turboacc │ │ ├── init.d │ │ │ └── ttyd │ │ ├── openclash │ │ │ └── core │ │ │ │ └── clash │ │ └── opkg │ │ │ └── distfeeds.conf │ └── www │ │ └── luci-static │ │ └── argon │ │ └── background │ │ └── bj.jpg │ ├── patches │ └── README │ └── settings.ini └── img └── opimg.png /.github/workflows/compile-openwrt.yml: -------------------------------------------------------------------------------- 1 | name: 编译 OpenWrt 固件 2 | on: 3 | workflow_dispatch: 4 | push: 5 | branches: 6 | - main 7 | paths: 8 | - 'build/Tianling_source/start-up/start' 9 | 10 | schedule: 11 | - cron: 0 17 * * 5 12 | 13 | env: 14 | Github: https://github.com/${{github.repository}} 15 | Author: ${{github.actor}} 16 | Apidz: ${{github.repository}} 17 | Run_number: ${{github.run_number}} 18 | Run_workflow: ${{github.workflow}} 19 | REPO_TOKEN: ${{ secrets.REPO_TOKEN }} 20 | TZ: Asia/Shanghai 21 | 22 | jobs: 23 | build: 24 | runs-on: ubuntu-22.04 25 | if: github.event.repository.owner.id == github.event.sender.id 26 | 27 | name: 编译 "${{matrix.target}}" 28 | strategy: 29 | fail-fast: false 30 | matrix: 31 | target: [Lede_source] 32 | 33 | # [Lede_source,Lienol_source,Mortal_source,Tianling_source,openwrt_amlogic] 34 | 35 | steps: 36 | - name: 准备结束 37 | uses: actions/checkout@v4 38 | 39 | - name: 读取设置 40 | run: | 41 | source "${GITHUB_WORKSPACE}/build/${{matrix.target}}/settings.ini" 42 | echo "REPO_URL=${REPO_URL}" >> $GITHUB_ENV 43 | echo "REPO_BRANCH=${REPO_BRANCH}" >> $GITHUB_ENV 44 | echo "CONFIG_FILE=${CONFIG_FILE}" >> $GITHUB_ENV 45 | echo "DIY_PART_SH=${DIY_PART_SH}" >> $GITHUB_ENV 46 | echo "SSH_ACTIONS=${SSH_ACTIONS}" >> $GITHUB_ENV 47 | echo "UPLOAD_BIN_DIR=${UPLOAD_BIN_DIR}" >> $GITHUB_ENV 48 | echo "UPLOAD_CONFIG=${UPLOAD_CONFIG}" >> $GITHUB_ENV 49 | echo "UPLOAD_FIRMWARE=${UPLOAD_FIRMWARE}" >> $GITHUB_ENV 50 | echo "UPLOAD_RELEASE=${UPLOAD_RELEASE}" >> $GITHUB_ENV 51 | echo "SERVERCHAN_SCKEY=${SERVERCHAN_SCKEY}" >> $GITHUB_ENV 52 | echo "REGULAR_UPDATE=${REGULAR_UPDATE}" >> $GITHUB_ENV 53 | echo "USE_CACHEWRTBUILD=${USE_CACHEWRTBUILD}" >> $GITHUB_ENV 54 | echo "BY_INFORMATION=${BY_INFORMATION}" >> $GITHUB_ENV 55 | echo "AUTOMATIC_AMLOGIC=${AUTOMATIC_AMLOGIC}" >> $GITHUB_ENV 56 | echo "CangKu=${Apidz##*/}" >> $GITHUB_ENV 57 | echo "Modelfile=${{matrix.target}}" >> $GITHUB_ENV 58 | - name: 初始化 59 | run: | 60 | chmod -R +x "${GITHUB_WORKSPACE}/build/common" 61 | if [[ "${REPO_BRANCH}" == "master" ]]; then 62 | echo "ZZZ=package/lean/default-settings/files/zzz-default-settings" >> $GITHUB_ENV 63 | echo "CODE=Lede" >> $GITHUB_ENV 64 | echo "OpenWrt_name=18.06" >> $GITHUB_ENV 65 | elif [[ "${REPO_BRANCH}" == "19.07" ]]; then 66 | echo "ZZZ=package/default-settings/files/zzz-default-settings" >> $GITHUB_ENV 67 | echo "CODE=Lienol" >> $GITHUB_ENV 68 | echo "OpenWrt_name=19.07" >> $GITHUB_ENV 69 | elif [[ "${REPO_BRANCH}" == "openwrt-18.06" ]]; then 70 | echo "ZZZ=package/emortal/default-settings/files/zzz-default-settings" >> $GITHUB_ENV 71 | echo "CODE=Mortal" >> $GITHUB_ENV 72 | echo "OpenWrt_name=18.06" >> $GITHUB_ENV 73 | fi 74 | echo "NETIP=package/base-files/files/etc/networkip" >> $GITHUB_ENV 75 | echo "DELETE=package/base-files/files/etc/deletefile" >> $GITHUB_ENV 76 | 77 | - name: 释放空间 78 | run: | 79 | sudo rm -rf /etc/apt/sources.list.d 80 | sudo bash -c "curl -s https://us.cooluc.com/ubuntu-apt/sources-22.04.list > /etc/apt/sources.list" 81 | sudo swapoff -a 82 | sudo rm -f /swapfile /mnt/swapfile 83 | sudo docker image prune -a -f 84 | sudo systemctl stop docker 85 | sudo snap set system refresh.retain=2 86 | sudo apt-get -y purge firefox clang* ghc* google* llvm* mono* mongo* mysql* php* 87 | sudo apt-get -y autoremove --purge 88 | sudo apt-get clean 89 | sudo rm -rf /etc/mysql /etc/php /usr/lib/jvm /usr/libexec/docker /usr/local /usr/src/* /var/lib/docker /var/lib/gems /var/lib/mysql /var/lib/snapd /etc/skel /opt/{microsoft,az,hostedtoolcache,cni,mssql-tools,pipx} /usr/share/{az*,dotnet,swift,miniconda,gradle*,java,kotlinc,ri,sbt} /root/{.sbt,.local,.npm} 90 | sudo sed -i '/NVM_DIR/d;/skel/d' /root/{.bashrc,.profile} 91 | rm -rf ~/{.cargo,.dotnet,.rustup} 92 | df -Th 93 | 94 | - name: 部署环境 95 | env: 96 | DEBIAN_FRONTEND: noninteractive 97 | run: | 98 | sudo sh -c 'echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-17 main" >> /etc/apt/sources.list' 99 | sudo sh -c 'echo "deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-17 main" >> /etc/apt/sources.list' 100 | wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - 101 | sudo apt-get update 102 | sudo apt-get install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential bzip2 ccache cmake cpio curl device-tree-compiler ecj fakeroot fastjar flex gawk gettext genisoimage git gnutls-dev gperf haveged help2man intltool irqbalance jq libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses-dev libreadline-dev libssl-dev libtool libyaml-dev libz-dev lrzsz msmtp nano ninja-build p7zip p7zip-full patch pkgconf libpython3-dev python3 python3-pip python3-cryptography python3-docutils python3-ply python3-pyelftools python3-requests qemu-utils quilt re2c rsync rename scons sharutils squashfs-tools subversion swig texinfo uglifyjs unzip vim wget xmlto zlib1g-dev zstd xxd 103 | sudo apt-get clean 104 | echo "=================================================" 105 | echo "文件系统 类型 容量 已用 可用 使用% 挂载点" 106 | df -hT $PWD 107 | sudo timedatectl set-timezone "$TZ" 108 | sudo mkdir -p /${{matrix.target}} 109 | sudo chown $USER:$GROUPS /${{matrix.target}} 110 | 111 | - name: 下载源码 112 | working-directory: /${{matrix.target}} 113 | run: | 114 | git clone -b "$REPO_BRANCH" --single-branch "$REPO_URL" openwrt 115 | cd openwrt 116 | ./scripts/feeds update -a > /dev/null 2>&1 117 | ln -sf /${{matrix.target}}/openwrt $GITHUB_WORKSPACE/openwrt 118 | echo "Home=${GITHUB_WORKSPACE}/openwrt" >> $GITHUB_ENV 119 | echo "PATH1=${GITHUB_WORKSPACE}/openwrt/build/${{matrix.target}}" >> $GITHUB_ENV 120 | 121 | - name: 加载设置 122 | run: | 123 | echo "Compile_Date=$(date +%Y%m%d%H%M)" >> $GITHUB_ENV 124 | cp -Rf `find ./ -maxdepth 1 -type d ! -path './openwrt' ! -path './'` openwrt 125 | mv -f "${Home}"/build/common/*.sh "${PATH1}" 126 | source "${PATH1}/common.sh" && Diy_settings 127 | [[ "${{ github.event.inputs.ssh }}" == 'ssh' ]] && echo "SSHYC=true" >> $GITHUB_ENV 128 | cd openwrt 129 | if [[ "${REPO_BRANCH}" == "master" ]]; then 130 | source "${PATH1}/common.sh" && Diy_lede 131 | elif [[ "${REPO_BRANCH}" == "19.07" ]]; then 132 | source "${PATH1}/common.sh" && Diy_lienol 133 | elif [[ "${REPO_BRANCH}" == "openwrt-18.06" ]]; then 134 | source "${PATH1}/common.sh" && Diy_Tianling 135 | elif [[ "${REPO_BRANCH}" == "openwrt-21.02" ]]; then 136 | source "${PATH1}/common.sh" && Diy_mortal 137 | fi 138 | source "${PATH1}/common.sh" && Diy_all 139 | /bin/bash "${PATH1}/$DIY_PART_SH" 140 | ./scripts/feeds update -a 141 | ./scripts/feeds install -a > /dev/null 2>&1 142 | ./scripts/feeds install -a 143 | mv "$PATH1/$CONFIG_FILE" .config 144 | if [[ "${REGULAR_UPDATE}" == "true" ]]; then 145 | source "${PATH1}/upgrade.sh" && Diy_Part1 146 | fi 147 | 148 | - name: 生成配置 149 | run: | 150 | cd openwrt 151 | source "${PATH1}/common.sh" && Diy_chajian > /dev/null 2>&1 152 | make defconfig > /dev/null 2>&1 153 | ./scripts/diffconfig.sh > ${GITHUB_WORKSPACE}/config.txt 154 | echo "TARGET_BOARD=$(awk -F '[="]+' '/TARGET_BOARD/{print $2}' .config)" >> $GITHUB_ENV 155 | echo "TARGET_SUBTARGET=$(awk -F '[="]+' '/TARGET_SUBTARGET/{print $2}' .config)" >> $GITHUB_ENV 156 | if [ `grep -c "CONFIG_TARGET_x86_64=y" .config` -eq '1' ]; then 157 | echo "TARGET_PROFILE=x86-64" >> $GITHUB_ENV 158 | elif [ `grep -c "CONFIG_TARGET_x86_generic=y" .config` -eq '1' ]; then 159 | echo "TARGET_PROFILE=x86-32" >> $GITHUB_ENV 160 | elif [ `grep -c "CONFIG_TARGET.*DEVICE.*=y" .config` -eq '1' ]; then 161 | grep '^CONFIG_TARGET.*DEVICE.*=y' .config | sed -r 's/.*DEVICE_(.*)=y/\1/' > DEVICE_NAME 162 | [ -s DEVICE_NAME ] && echo "TARGET_PROFILE=$(cat DEVICE_NAME)" >> $GITHUB_ENV 163 | else 164 | echo "TARGET_PROFILE=armvirt" >> $GITHUB_ENV 165 | fi 166 | - name: 编译信息 167 | run: | 168 | cd openwrt 169 | source "${PATH1}/common.sh" && Diy_chuli > /dev/null 2>&1 170 | if [ "${REGULAR_UPDATE}" == "true" ]; then 171 | source "${PATH1}/upgrade.sh" && Diy_Part2 > /dev/null 2>&1 172 | fi 173 | if [ "${BY_INFORMATION}" == "true" ]; then 174 | source "${PATH1}/upgrade.sh" && GET_TARGET_INFO 175 | source "${PATH1}/common.sh" && Diy_xinxi 176 | chmod -R 755 . 177 | fi 178 | - name: 电报通知 179 | if: env.SERVERCHAN_SCKEY == 'true' 180 | run: | 181 | cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c > CPU 182 | cat /proc/cpuinfo | grep "cpu cores" | uniq >> CPU 183 | sed -i 's|[[:space:]]||g; s|^.||' CPU && sed -i 's|CPU||g; s|pucores:||' CPU 184 | CPUNAME="$(awk 'NR==1' CPU)" && CPUCORES="$(awk 'NR==2' CPU)" 185 | curl -k --data chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" --data "text=🔔 您正在使用【${CPUNAME} CPU】【${CPUCORES}核心】【${CODE}】源码 编译固件中,请耐心等待...... ⏳" "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" 186 | 187 | - name: 加载缓存 188 | uses: actions/cache@v4 189 | with: 190 | path: | 191 | ${{ github.workspace }}/openwrt 192 | key: ${{ runner.os }}-openwrt-${{ hashFiles('**/openwrt/Makefile') }} 193 | restore-keys: | 194 | ${{ runner.os }}-openwrt- 195 | 196 | - name: 下载dl库 197 | id: package 198 | run: | 199 | cd openwrt 200 | make download -j8 201 | find dl -size -1024c -exec rm -f {} \; 202 | - name: 编译固件 203 | id: compile 204 | run: | 205 | cd openwrt 206 | echo -e "$(nproc) thread compile" 207 | make -j$(nproc) || make -j1 V=s 208 | echo "status=success" >> $GITHUB_ENV 209 | echo "date=$(date "+%Y%m%d%H%M%S")" >> $GITHUB_ENV 210 | echo "date1=$(date +'%m-%d')" >> $GITHUB_ENV 211 | 212 | - name: 上传配置 213 | if: env.UPLOAD_CONFIG == 'true' 214 | uses: actions/upload-artifact@v4 215 | with: 216 | name: .config_${{ env.CODE }}_${{ env.TARGET_PROFILE }}_${{ env.Compile_Date }} 217 | path: config.txt 218 | 219 | - name: 上传文件 220 | if: env.status == 'success' && env.UPLOAD_BIN_DIR == 'true' 221 | uses: actions/upload-artifact@v4 222 | with: 223 | name: filename+ipk_${{ env.CODE }}_${{ env.TARGET_PROFILE }}_${{ env.Compile_Date }} 224 | path: openwrt/bin 225 | 226 | - name: 整理文件 227 | id: organizer 228 | run: | 229 | if [ "${AUTOMATIC_AMLOGIC}" == "true" ]; then 230 | source "${PATH1}/common.sh" && Diy_amlogic 231 | fi 232 | cd openwrt 233 | echo "文件系统 类型 容量 已用 可用 使用% 挂载点" 234 | df -hT $PWD 235 | cp -Rf bin/targets/*/* "${Home}"/upgrade 236 | cd bin/targets/*/* 237 | find . \( -name "*buildinfo*" -o -name "*sha256sums*" -o -name "*manifest*" -o -name "*vmlinuz*" -o -name "*Image*" -o -name "*rootfs.img.gz*" -o -name "*kernel.bin*" \) -exec rm -rf {} + 238 | rm -rf packages 239 | rename -v "s/^openwrt/${{ env.date1 }}-${{ env.CODE }}/" * 240 | echo "FIRMWARE=$PWD" >> $GITHUB_ENV 241 | echo "BOT=TRUE" >> $GITHUB_ENV 242 | echo "status=success" >> $GITHUB_ENV 243 | 244 | - name: 上传固件 245 | if: env.status == 'success' && env.UPLOAD_FIRMWARE == 'true' 246 | uses: actions/upload-artifact@v4 247 | with: 248 | name: ${{ env.OpenWrt_name }}-${{ env.CODE }}-${{ env.TARGET_PROFILE }}-firmware-${{ env.Compile_Date }} 249 | path: ${{ env.FIRMWARE }} 250 | 251 | - name: 发布信息 252 | if: env.status == 'success' && env.UPLOAD_RELEASE == 'true' 253 | run: | 254 | echo "### $(date +"%Y年%m月%d号-%H点%M分")" > update_log.txt 255 | curl -fsSL git.io/file-transfer | sh 256 | ./transfer cow --block 2621440 -s -p 64 --no-progress ${FIRMWARE} 2>&1 | tee cowtransfer.log 257 | echo "##### 奶牛快传:$(cat cowtransfer.log | grep https | cut -f3 -d" ")" >> update_log.txt 258 | ./transfer wet -s -p 16 --no-progress ${FIRMWARE} 2>&1 | tee wetransfer.log 259 | echo "##### WETRANSFER:$(cat wetransfer.log | grep https | cut -f3 -d" ")" >> update_log.txt 260 | 261 | - name: 发布固件 262 | if: env.status == 'success' && env.UPLOAD_RELEASE == 'true' && env.REPO_TOKEN 263 | uses: ncipollo/release-action@v1 264 | with: 265 | name: ${{ env.CODE }}-${{ env.TARGET_PROFILE }} 266 | tag: ${{ env.date }} 267 | token: ${{ secrets.REPO_TOKEN }} 268 | bodyFile: "update_log.txt" 269 | artifacts: "${{ env.FIRMWARE }}/*" 270 | 271 | - name: 云端更新1 272 | if: env.status == 'success' && env.REGULAR_UPDATE == 'true' 273 | run: | 274 | cd openwrt 275 | source "${PATH1}/upgrade.sh" && Diy_Part3 276 | 277 | - name: 云端更新2 278 | if: env.status == 'success' && env.REGULAR_UPDATE == 'true' && env.REPO_TOKEN 279 | uses: svenstaro/upload-release-action@v2 280 | with: 281 | repo_token: ${{ secrets.REPO_TOKEN }} 282 | file: openwrt/bin/Firmware/* 283 | tag: AutoUpdate 284 | overwrite: true 285 | file_glob: true 286 | 287 | - name: 云端更新3 288 | if: env.status == 'success' && env.REGULAR_UPDATE == 'true' 289 | run: | 290 | mkdir -p Github_Tags 291 | cd Github_Tags 292 | wget -q --no-cookie --no-check-certificate https://api.github.com/repos/${{github.repository}}/releases/tags/AutoUpdate -O Github_Tags 293 | 294 | - name: 云端更新4 295 | if: env.status == 'success' && env.REGULAR_UPDATE == 'true' && env.REPO_TOKEN 296 | uses: svenstaro/upload-release-action@v2 297 | with: 298 | repo_token: ${{ secrets.REPO_TOKEN }} 299 | file: Github_Tags/* 300 | tag: AutoUpdate 301 | overwrite: true 302 | file_glob: true 303 | 304 | - name: 电报通知 305 | if: env.status == 'success' && env.SERVERCHAN_SCKEY == 'true' 306 | run: | 307 | curl -k --data chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" --data "text=我亲爱的✨主人✨:您使用【${{matrix.target}}】文件夹编译的[${{ env.CODE }}-${{ env.TARGET_PROFILE }}]固件(${{env.CangKu}}仓库的#${{env.Run_number}}号)顺利编译完成了!💐" "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" 308 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **x86 固件更新 方式:** 2 | **x86 firmware update Method:** 3 | 1. 在**OP后台 系统--更新固件 点击 手动更新** 稍等几分钟 路由重启即可 4 | In the OP background system - update firmware, click on Manual update. Wait a few minutes for the router to restart 5 | 2. **命令行** 或 **SSH 链接** OP **执行以下命令** 完成固件更新 6 | Command line or SSH link OP execute the following command to complete the firmware update 7 | - 执行 **`bash /bin/AutoUpdate.sh`** 保留配置更新 8 | - Execute bash /bin/AutoUpdate.sh Keep configuration updates 9 | - 执行 **`bash /bin/AutoUpdate.sh -n`** 不保留配置更新 10 | - Execute bash /bin/AutoUpdate.sh -n Do not keep configuration updates 11 | 12 | **注意:升级不会保留原有自己安装的 app ,还需升级后自行按需安装** 13 | Note: The upgrade will not retain the original self-installed apps, and you will need to install them yourself after the upgrade as needed 14 | Default login IP address, default account, default password 15 | 192.168.123.254 root password 16 | | 默认登陆IP | 默认账号 | 默认密码 | 17 | | ---- | ---- | ---- | 18 | | 192.168.123.254 | root | password | 19 | 20 | 固件页面 21 | Firmware page 22 | ![image](https://raw.githubusercontent.com/gd0772/AutoBuild-OpenWrt/main/img/opimg.png) 23 | 24 | # 感谢 25 | thank 26 | - [大雕 源码仓库](https://github.com/coolsnowwolf/lede.git) 27 | - [Lienol 源码仓库](https://github.com/Lienol/openwrt.git) 28 | - [天灵 源码仓库](https://github.com/project-openwrt/openwrt.git) 29 | - [P3TERX 自动编译脚本](https://github.com/P3TERX/Actions-OpenWrt) 30 | - [Hyy2001X 定时更新脚本](https://github.com/Hyy2001X/AutoBuild-Actions) 31 | - [danshui-git 云编译的说明及DIY](https://github.com/danshui-git/build-actions) 32 | -------------------------------------------------------------------------------- /build/Lede_source/.config: -------------------------------------------------------------------------------- 1 | CONFIG_TARGET_x86=y 2 | CONFIG_TARGET_x86_64=y 3 | CONFIG_TARGET_x86_64_DEVICE_generic=y 4 | CONFIG_GRUB_TITLE="Powered by gd772" 5 | CONFIG_OPENSSH_LIBFIDO2=y 6 | CONFIG_PACKAGE_6in4=y 7 | # CONFIG_PACKAGE_TURBOACC_INCLUDE_FLOW_OFFLOADING is not set 8 | CONFIG_PACKAGE_TURBOACC_INCLUDE_SHORTCUT_FE_CM=y 9 | CONFIG_PACKAGE_alist=y 10 | CONFIG_PACKAGE_bash=y 11 | CONFIG_PACKAGE_blkid=y 12 | CONFIG_PACKAGE_boost=y 13 | CONFIG_PACKAGE_boost-program_options=y 14 | CONFIG_PACKAGE_boost-system=y 15 | CONFIG_PACKAGE_btrfs-progs=y 16 | CONFIG_PACKAGE_chinadns-ng=y 17 | CONFIG_PACKAGE_coreutils-nohup=y 18 | CONFIG_PACKAGE_coreutils-timeout=y 19 | CONFIG_PACKAGE_fdisk=y 20 | CONFIG_PACKAGE_filebrowser=y 21 | CONFIG_PACKAGE_fuse-utils=y 22 | CONFIG_PACKAGE_git=y 23 | CONFIG_PACKAGE_git-http=y 24 | CONFIG_PACKAGE_glib2=y 25 | CONFIG_PACKAGE_gzip=y 26 | CONFIG_PACKAGE_haproxy=y 27 | CONFIG_PACKAGE_hysteria=y 28 | CONFIG_PACKAGE_ip6tables=y 29 | CONFIG_PACKAGE_ipt2socks=y 30 | CONFIG_PACKAGE_iptables-mod-iprange=y 31 | CONFIG_PACKAGE_iptables-mod-socket=y 32 | CONFIG_PACKAGE_ipv6helper=y 33 | CONFIG_PACKAGE_kmod-crypto-acompress=y 34 | CONFIG_PACKAGE_kmod-ebtables=y 35 | CONFIG_PACKAGE_kmod-ebtables-ipv6=y 36 | CONFIG_PACKAGE_kmod-fs-btrfs=y 37 | CONFIG_PACKAGE_kmod-fuse=y 38 | CONFIG_PACKAGE_kmod-gre=y 39 | CONFIG_PACKAGE_kmod-inet-diag=y 40 | CONFIG_PACKAGE_kmod-ip6tables=y 41 | CONFIG_PACKAGE_kmod-ipt-iprange=y 42 | CONFIG_PACKAGE_kmod-ipt-nat6=y 43 | # CONFIG_PACKAGE_kmod-ipt-offload is not set 44 | CONFIG_PACKAGE_kmod-ipt-socket=y 45 | CONFIG_PACKAGE_kmod-iptunnel=y 46 | CONFIG_PACKAGE_kmod-iptunnel4=y 47 | CONFIG_PACKAGE_kmod-ipvlan=y 48 | CONFIG_PACKAGE_kmod-l2tp=y 49 | CONFIG_PACKAGE_kmod-lib-lzo=y 50 | CONFIG_PACKAGE_kmod-lib-raid6=y 51 | CONFIG_PACKAGE_kmod-lib-xor=y 52 | CONFIG_PACKAGE_kmod-lib-zlib-deflate=y 53 | CONFIG_PACKAGE_kmod-lib-zstd=y 54 | CONFIG_PACKAGE_kmod-netlink-diag=y 55 | # CONFIG_PACKAGE_kmod-nf-flow is not set 56 | CONFIG_PACKAGE_kmod-nf-ipt6=y 57 | CONFIG_PACKAGE_kmod-nf-log6=y 58 | CONFIG_PACKAGE_kmod-nf-nat6=y 59 | CONFIG_PACKAGE_kmod-nf-reject6=y 60 | CONFIG_PACKAGE_kmod-nf-socket=y 61 | CONFIG_PACKAGE_kmod-pppol2tp=y 62 | CONFIG_PACKAGE_kmod-shortcut-fe=y 63 | CONFIG_PACKAGE_kmod-shortcut-fe-cm=y 64 | CONFIG_PACKAGE_kmod-sit=y 65 | CONFIG_PACKAGE_kmod-udptunnel4=y 66 | CONFIG_PACKAGE_kmod-udptunnel6=y 67 | CONFIG_PACKAGE_kmod-usb-ehci=y 68 | CONFIG_PACKAGE_kmod-usb-xhci-hcd=y 69 | CONFIG_PACKAGE_kmod-usb2=y 70 | CONFIG_PACKAGE_kmod-usb2-pci=y 71 | CONFIG_PACKAGE_kmod-usb3=y 72 | CONFIG_PACKAGE_libcap-bin=y 73 | CONFIG_PACKAGE_libcap-bin-capsh-shell="/bin/sh" 74 | CONFIG_PACKAGE_libcbor=y 75 | CONFIG_PACKAGE_libdnet=y 76 | CONFIG_PACKAGE_libeudev=y 77 | CONFIG_PACKAGE_libffi=y 78 | CONFIG_PACKAGE_libfido2=y 79 | CONFIG_PACKAGE_libfuse=y 80 | CONFIG_PACKAGE_libinih=y 81 | CONFIG_PACKAGE_libltdl=y 82 | CONFIG_PACKAGE_liblua5.3=y 83 | CONFIG_PACKAGE_liblzo=y 84 | CONFIG_PACKAGE_libminiupnpc=y 85 | CONFIG_PACKAGE_libmspack=y 86 | CONFIG_PACKAGE_libnatpmp=y 87 | CONFIG_PACKAGE_libpam=y 88 | CONFIG_PACKAGE_libparted=y 89 | CONFIG_PACKAGE_libruby=y 90 | CONFIG_PACKAGE_libstdcpp=y 91 | CONFIG_PACKAGE_liburcu=y 92 | CONFIG_PACKAGE_libuv=y 93 | CONFIG_PACKAGE_libwebsockets-full=y 94 | CONFIG_PACKAGE_libyaml=y 95 | CONFIG_PACKAGE_lsblk=y 96 | # CONFIG_PACKAGE_luci-app-accesscontrol is not set 97 | CONFIG_PACKAGE_luci-app-alist=y 98 | CONFIG_PACKAGE_luci-app-diskman=y 99 | CONFIG_PACKAGE_luci-app-diskman_INCLUDE_btrfs_progs=y 100 | CONFIG_PACKAGE_luci-app-diskman_INCLUDE_lsblk=y 101 | CONFIG_PACKAGE_luci-app-filebrowser=y 102 | CONFIG_PACKAGE_luci-app-openclash=y 103 | CONFIG_PACKAGE_luci-app-partexp=y 104 | CONFIG_PACKAGE_luci-app-passwall=y 105 | CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Haproxy=y 106 | CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Hysteria=y 107 | CONFIG_PACKAGE_luci-app-passwall_INCLUDE_ShadowsocksR_Libev_Client=y 108 | CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Libev_Client=y 109 | CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Libev_Server=y 110 | CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Simple_Obfs=y 111 | CONFIG_PACKAGE_luci-app-passwall_INCLUDE_SingBox=y 112 | CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Trojan_Plus=y 113 | CONFIG_PACKAGE_luci-app-passwall_INCLUDE_V2ray_Plugin=y 114 | CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Xray=y 115 | CONFIG_PACKAGE_luci-app-passwall_Iptables_Transparent_Proxy=y 116 | CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_ChinaDNS_NG=y 117 | CONFIG_PACKAGE_luci-app-ttyd=y 118 | CONFIG_PACKAGE_luci-app-zerotier=y 119 | CONFIG_PACKAGE_luci-i18n-alist-zh-cn=y 120 | CONFIG_PACKAGE_luci-i18n-diskman-zh-cn=y 121 | CONFIG_PACKAGE_luci-i18n-filebrowser-zh-cn=y 122 | CONFIG_PACKAGE_luci-i18n-partexp-zh-cn=y 123 | CONFIG_PACKAGE_luci-i18n-passwall-zh-cn=y 124 | CONFIG_PACKAGE_luci-i18n-ttyd-zh-cn=y 125 | CONFIG_PACKAGE_luci-i18n-zerotier-zh-cn=y 126 | CONFIG_PACKAGE_luci-theme-argon=y 127 | CONFIG_PACKAGE_nano=y 128 | CONFIG_PACKAGE_netdata=y 129 | CONFIG_PACKAGE_open-vm-tools=y 130 | CONFIG_PACKAGE_openssh-keygen=y 131 | CONFIG_PACKAGE_openssh-server=y 132 | CONFIG_PACKAGE_openssh-sftp-server=y 133 | CONFIG_PACKAGE_parted=y 134 | CONFIG_PACKAGE_ppp-mod-pppol2tp=y 135 | CONFIG_PACKAGE_pptpd=y 136 | CONFIG_PACKAGE_ruby=y 137 | CONFIG_PACKAGE_ruby-bigdecimal=y 138 | CONFIG_PACKAGE_ruby-date=y 139 | CONFIG_PACKAGE_ruby-digest=y 140 | CONFIG_PACKAGE_ruby-enc=y 141 | CONFIG_PACKAGE_ruby-forwardable=y 142 | CONFIG_PACKAGE_ruby-pstore=y 143 | CONFIG_PACKAGE_ruby-psych=y 144 | CONFIG_PACKAGE_ruby-stringio=y 145 | CONFIG_PACKAGE_ruby-strscan=y 146 | CONFIG_PACKAGE_ruby-yaml=y 147 | CONFIG_PACKAGE_shadowsocks-libev-ss-local=y 148 | CONFIG_PACKAGE_shadowsocks-libev-ss-redir=y 149 | CONFIG_PACKAGE_sing-box=y 150 | CONFIG_PACKAGE_smartmontools=y 151 | CONFIG_PACKAGE_trojan-plus=y 152 | CONFIG_PACKAGE_ttyd=y 153 | CONFIG_PACKAGE_unrar=y 154 | CONFIG_PACKAGE_unzip=y 155 | CONFIG_PACKAGE_v2ray-plugin=y 156 | CONFIG_PACKAGE_vim=y 157 | CONFIG_PACKAGE_xfs-admin=y 158 | CONFIG_PACKAGE_xfs-fsck=y 159 | CONFIG_PACKAGE_xfs-growfs=y 160 | CONFIG_PACKAGE_xfs-mkfs=y 161 | CONFIG_PACKAGE_xl2tpd=y 162 | CONFIG_PACKAGE_xz-utils=y 163 | CONFIG_PACKAGE_zerotier=y 164 | CONFIG_PARTED_READLINE=y 165 | CONFIG_SING_BOX_WITH_CLASH_API=y 166 | CONFIG_SING_BOX_WITH_DHCP=y 167 | CONFIG_SING_BOX_WITH_ECH=y 168 | CONFIG_SING_BOX_WITH_GVISOR=y 169 | CONFIG_SING_BOX_WITH_QUIC=y 170 | CONFIG_SING_BOX_WITH_UTLS=y 171 | CONFIG_SING_BOX_WITH_WIREGUARD=y 172 | CONFIG_TARGET_ROOTFS_PARTSIZE=684 173 | CONFIG_boost-compile-visibility-hidden=y 174 | CONFIG_boost-runtime-shared=y 175 | CONFIG_boost-static-and-shared-libs=y 176 | CONFIG_boost-variant-release=y 177 | -------------------------------------------------------------------------------- /build/Lede_source/diy-part.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2019-2020 P3TERX 3 | # DIY扩展 在此脚本 增加插件 4 | 5 | bash <(curl -Lso- https://raw.githubusercontent.com/gd0772/patch/main/x86.sh) 6 | -------------------------------------------------------------------------------- /build/Lede_source/diy/README: -------------------------------------------------------------------------------- 1 | 替换文件用的文件夹,按照源码路径替换 2 | 替换文件有两个方法 3 | 1、在这里按 Add file 然后选 Create new file 然后要替换文件的路径跟名字,下面大方框粘贴内容,然后最下面绿色按钮保存 4 | 比如替换banner,在源码的路径是‘package/base-files/files/etc/banner’,按 Add file 然后选 Create new file,粘贴这个路径,下面大方框粘贴内容,然后最下面绿色按钮保存完成 5 | 6 | 2、在这里按 Create new file 然后选择 Upload files 然后把在你电脑上按文件夹路径跟名字制作好的文件拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 7 | 比如替换banner,在电脑创建package文件夹,package文件夹里面创建base-files文件夹,base-files文件夹里面创建files文件夹,files文件夹里面创建etc文件夹, 8 | 在etc文件夹创建banner.txt的文本文档,设置好内容,然后把.txt后缀去掉就是banner了,然后把你创建package文件夹拖进来,等文件传输完毕,然后按最下绿色按钮保存就可以了 9 | -------------------------------------------------------------------------------- /build/Lede_source/diy/package/base-files/files/etc/banner: -------------------------------------------------------------------------------- 1 | _____ ______ ______ ___ _ ___ ___ ______ _____ 2 | / _ \ | _ \ | ____| | \ | | | | / / | _ \ |_ _| 3 | | | | | | |_| | | |__ | \| | | | __ / / | |_| | | | 4 | | | | | | ___/ | __| | |\ | | | / | / / | _ / | | 5 | | |_| | | | | |___ | | \ | | |/ |/ / | | \ \ | | 6 | \_____/ |_| |_____| |_| \_| |___/|___/ |_| \_\ |_| 7 | W I R E L E S S F R E E D O M 8 | Firmware Compiled by: gd772 9 | --------------------------------------------------------------- 10 | -------------------------------------------------------------------------------- /build/Lede_source/files/README: -------------------------------------------------------------------------------- 1 | 替换openwrt设置文件的文件夹,设置好openwrt后 2 | 记住这个不是源码文件,是源码编译好固件后的openwrt,安装好后,设置好后,openwrt里面etc 3 | 用WinSCP(文件协议F选择SCP)连接openwrt,找到etc文件夹,里面就是openwrt的所有设置文件 4 | 5 | 6 | 1、在这里按 Add file 然后选 Create new file 然后要替换文件的路径跟名字,下面大方框粘贴补丁内容,然后最下面绿色按钮保存 7 | 比如替换smartdns,在openwrt的路径是‘etc/config/smartdns’,按 Add file 然后选 Create new file,粘贴这个路径,下面大方框粘贴补丁内容,然后最下面绿色按钮保存完成 8 | 这个上替换单个文件方便,如果文件很多就比较麻烦,用下面的方法更好,就比如smartdns就有4个设置文件,不过一般都只用etc/config/smartdns的就是 9 | 10 | 2、在这里按 Create new file 然后选择 Upload files 然后把openwrt的对应路径制作好的etc文件夹,拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 11 | 比如替换smartdns,在电脑创建etc文件夹,etc文件夹里面创建config文件夹,然后在WinSCP里面etc/config里面的smartdns拖进来,上面说到smartdns有4个设置文件, 12 | 就在etc文件夹里面还有一个smartdns文件夹的,里面有三个设置文件,你把WinSCP里etc里面的smartdns文件夹直接拖到在你电脑创建的etc文件夹里面就好了 13 | 这样你在电脑创建的etc文件夹里面就有两个文件夹,一个config文件夹放着一个smartdns文件,一个smartdns文件夹里面放着address.conf、blacklist-ip.conf、custom.con三个设置文件 14 | 然后在这里按 Create new file 然后选择 Upload files 然后把在你电脑上etc文件夹拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 -------------------------------------------------------------------------------- /build/Lede_source/files/etc/config/dropbear: -------------------------------------------------------------------------------- 1 | 2 | config dropbear 3 | option PasswordAuth 'on' 4 | option Interface 'lan' 5 | option Port '12306' 6 | -------------------------------------------------------------------------------- /build/Lede_source/files/etc/config/network: -------------------------------------------------------------------------------- 1 | 2 | config interface 'loopback' 3 | option proto 'static' 4 | option ipaddr '127.0.0.1' 5 | option netmask '255.0.0.0' 6 | option device 'lo' 7 | 8 | config globals 'globals' 9 | option packet_steering '1' 10 | 11 | config interface 'lan' 12 | option proto 'static' 13 | option ipaddr '192.168.123.254' 14 | option netmask '255.255.255.0' 15 | option ip6assign '64' 16 | option device 'br-lan' 17 | 18 | config interface 'wan' 19 | option _orig_ifname 'eth1' 20 | option _orig_bridge 'false' 21 | option proto 'pppoe' 22 | option ipv6 'auto' 23 | option keepalive '0' 24 | option device 'eth1' 25 | 26 | config interface 'wan6' 27 | option proto 'dhcpv6' 28 | option reqaddress 'try' 29 | option reqprefix 'auto' 30 | option device 'eth1' 31 | 32 | config device 33 | option name 'br-lan' 34 | option type 'bridge' 35 | list ports 'eth0' 36 | -------------------------------------------------------------------------------- /build/Lede_source/files/etc/config/openclash: -------------------------------------------------------------------------------- 1 | 2 | config openclash 'config' 3 | option update '0' 4 | option auto_update '0' 5 | option auto_update_time '0' 6 | option dashboard_forward_ssl '0' 7 | option rule_source '0' 8 | option enable_custom_clash_rules '0' 9 | option other_rule_auto_update '0' 10 | option en_mode 'redir-host' 11 | option enable_redirect_dns '1' 12 | option servers_if_update '0' 13 | option disable_masq_cache '1' 14 | option servers_update '0' 15 | option log_level '0' 16 | option proxy_mode 'rule' 17 | option intranet_allowed '1' 18 | option enable_udp_proxy '1' 19 | option disable_udp_quic '1' 20 | option lan_ac_mode '0' 21 | option operation_mode 'redir-host' 22 | option enable_rule_proxy '0' 23 | option redirect_dns '0' 24 | option cachesize_dns '0' 25 | option filter_aaaa_dns '0' 26 | option small_flash_memory '0' 27 | option interface_name '0' 28 | option common_ports '0' 29 | option log_size '1024' 30 | option tolerance '0' 31 | option store_fakeip '0' 32 | option custom_fakeip_filter '0' 33 | option custom_host '0' 34 | option custom_name_policy '0' 35 | option stream_domains_prefetch '0' 36 | option stream_auto_select '0' 37 | option bypass_gateway_compatible '0' 38 | option github_address_mod '0' 39 | option urltest_address_mod '0' 40 | option urltest_interval_mod '0' 41 | option delay_start '0' 42 | option router_self_proxy '1' 43 | option release_branch 'master' 44 | option dashboard_type 'Official' 45 | option yacd_type 'Official' 46 | option append_default_dns '0' 47 | option geo_custom_url 'https://testingcf.jsdelivr.net/gh/alecthw/mmdb_china_ip_list@release/lite/Country.mmdb' 48 | option chnr_custom_url 'https://ispip.clang.cn/all_cn.txt' 49 | option chnr6_custom_url 'https://ispip.clang.cn/all_cn_ipv6.txt' 50 | option cndomain_custom_url 'https://testingcf.jsdelivr.net/gh/felixonmars/dnsmasq-china-list@master/accelerated-domains.china.conf' 51 | option core_version 'linux-amd64' 52 | option default_resolvfile '/tmp/resolv.conf.d/resolv.conf.auto' 53 | option config_reload '0' 54 | option enable_meta_core '1' 55 | option enable_custom_domain_dns_server '0' 56 | option geo_auto_update '0' 57 | option geo_update_week_time '1' 58 | option geo_update_day_time '0' 59 | option geoip_auto_update '0' 60 | option geosite_auto_update '0' 61 | option chnr_auto_update '0' 62 | option chnr_update_week_time '1' 63 | option chnr_update_day_time '0' 64 | option auto_restart '0' 65 | option auto_restart_week_time '1' 66 | option auto_restart_day_time '0' 67 | option china_ip_route '1' 68 | option cn_port '10086' 69 | option ipv6_enable '1' 70 | option ipv6_mode '0' 71 | option enable_v6_udp_proxy '1' 72 | option ipv6_dns '1' 73 | option china_ip6_route '1' 74 | option dns_port '10096' 75 | option proxy_port '10076' 76 | option tproxy_port '10066' 77 | option http_port '10056' 78 | option socks_port '10046' 79 | option mixed_port '10036' 80 | option proxy_dns_group 'Disable' 81 | option keep_alive_interval '0' 82 | option find_process_mode '0' 83 | option global_client_fingerprint '0' 84 | option geodata_loader '0' 85 | option enable_geoip_dat '0' 86 | option enable_custom_dns '1' 87 | option enable_tcp_concurrent '1' 88 | option enable_unified_delay '1' 89 | option enable_meta_sniffer '1' 90 | option enable_meta_sniffer_pure_ip '0' 91 | option enable_meta_sniffer_custom '0' 92 | option append_wan_dns '0' 93 | option custom_fallback_filter '0' 94 | option dashboard_password 'gqc000xt' 95 | option enable '0' 96 | option enable_respect_rules '0' 97 | 98 | config dns_servers 99 | option type 'udp' 100 | option ip '119.29.29.29' 101 | option enabled '1' 102 | option group 'default' 103 | 104 | config dns_servers 105 | option group 'nameserver' 106 | option type 'udp' 107 | option ip '114.114.114.114' 108 | option enabled '0' 109 | 110 | config dns_servers 111 | option type 'udp' 112 | option ip '223.5.5.5' 113 | option enabled '1' 114 | option group 'default' 115 | 116 | config dns_servers 117 | option group 'nameserver' 118 | option type 'udp' 119 | option ip '119.29.29.29' 120 | option enabled '1' 121 | 122 | config dns_servers 123 | option group 'nameserver' 124 | option type 'udp' 125 | option ip '119.28.28.28' 126 | option enabled '0' 127 | 128 | config dns_servers 129 | option group 'nameserver' 130 | option type 'udp' 131 | option ip '223.5.5.5' 132 | option enabled '1' 133 | 134 | config dns_servers 135 | option type 'https' 136 | option ip 'doh.pub/dns-query' 137 | option group 'nameserver' 138 | option enabled '1' 139 | 140 | config dns_servers 141 | option type 'https' 142 | option ip 'dns.alidns.com/dns-query' 143 | option group 'nameserver' 144 | option enabled '1' 145 | 146 | config dns_servers 147 | option type 'https' 148 | option group 'fallback' 149 | option ip 'dns.cloudflare.com/dns-query' 150 | option enabled '0' 151 | 152 | config dns_servers 153 | option group 'fallback' 154 | option ip 'dns.google' 155 | option port '853' 156 | option type 'tls' 157 | option enabled '1' 158 | 159 | config dns_servers 160 | option group 'fallback' 161 | option type 'https' 162 | option ip '1.1.1.1/dns-query' 163 | option enabled '0' 164 | 165 | config dns_servers 166 | option group 'fallback' 167 | option ip '1.1.1.1' 168 | option port '853' 169 | option type 'tls' 170 | option enabled '1' 171 | 172 | config dns_servers 173 | option enabled '0' 174 | option group 'fallback' 175 | option ip '8.8.8.8' 176 | option port '853' 177 | option type 'tls' 178 | 179 | config dns_servers 180 | option type 'udp' 181 | option group 'fallback' 182 | option ip '2001:4860:4860::8888' 183 | option port '53' 184 | option enabled '1' 185 | 186 | config dns_servers 187 | option type 'udp' 188 | option group 'fallback' 189 | option ip '2001:4860:4860::8844' 190 | option port '53' 191 | option enabled '1' 192 | 193 | config dns_servers 194 | option type 'udp' 195 | option group 'fallback' 196 | option ip '2001:da8::666' 197 | option port '53' 198 | option enabled '0' 199 | 200 | config dns_servers 201 | option group 'fallback' 202 | option type 'https' 203 | option ip 'public.dns.iij.jp/dns-query' 204 | option enabled '0' 205 | 206 | config dns_servers 207 | option group 'fallback' 208 | option type 'https' 209 | option ip 'jp.tiar.app/dns-query' 210 | option enabled '0' 211 | 212 | config dns_servers 213 | option group 'fallback' 214 | option type 'https' 215 | option ip 'jp.tiarap.org/dns-query' 216 | option enabled '0' 217 | 218 | config dns_servers 219 | option group 'fallback' 220 | option ip 'jp.tiar.app' 221 | option type 'tls' 222 | option enabled '0' 223 | 224 | config dns_servers 225 | option group 'fallback' 226 | option ip 'dot.tiar.app' 227 | option type 'tls' 228 | option enabled '0' 229 | 230 | config dns_servers 231 | option enabled '0' 232 | option group 'fallback' 233 | option type 'https' 234 | option ip 'doh.dnslify.com/dns-query' 235 | 236 | config dns_servers 237 | option enabled '0' 238 | option group 'fallback' 239 | option ip 'dns.twnic.tw/dns-query' 240 | option type 'https' 241 | 242 | config dns_servers 243 | option enabled '0' 244 | option group 'fallback' 245 | option ip 'dns.oszx.co/dns-query' 246 | option type 'https' 247 | 248 | config dns_servers 249 | option enabled '0' 250 | option group 'fallback' 251 | option ip 'doh.applied-privacy.net/query' 252 | option type 'https' 253 | 254 | config dns_servers 255 | option enabled '0' 256 | option group 'fallback' 257 | option ip 'dnsforge.de/dns-query' 258 | option type 'https' 259 | 260 | config dns_servers 261 | option enabled '0' 262 | option group 'fallback' 263 | option ip 'doh.ffmuc.net/dns-query' 264 | option type 'https' 265 | 266 | config dns_servers 267 | option enabled '0' 268 | option group 'fallback' 269 | option type 'https' 270 | option ip 'doh.mullvad.net/dns-query' 271 | -------------------------------------------------------------------------------- /build/Lede_source/files/etc/openclash/core/clash_meta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gd0772/AutoBuild-OpenWrt/87e0032ffea12db01d124a01a8fea64d16561194/build/Lede_source/files/etc/openclash/core/clash_meta -------------------------------------------------------------------------------- /build/Lede_source/files/usr/sbin/app: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ! -d "/dev/fd" ]; then 4 | ln -sf /proc/self/fd /dev/fd 5 | fi 6 | bash <(curl -Lso- https://drive.gd772.net/d/update/x86_app.sh) 7 | -------------------------------------------------------------------------------- /build/Lede_source/patches/README: -------------------------------------------------------------------------------- 1 | 存放制作好的补丁文件 2 | 存放补丁有两种方法 3 | 1、在这里按 Add file 然后选 Create new file 然后补丁名字,下面大方框粘贴补丁内容,然后最下面绿色按钮保存 4 | 2、在这里按 Create new file 然后选择 Upload files 然后把在你电脑上的补丁文件拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 5 | -------------------------------------------------------------------------------- /build/Lede_source/settings.ini: -------------------------------------------------------------------------------- 1 | REPO_URL="https://github.com/coolsnowwolf/lede" # 编译固件源码链接(请勿修改) 2 | REPO_BRANCH="master" # 源码链接的分支(请勿修改) 3 | CONFIG_FILE=".config" # 配置文件(可SSH远程定制固件插件,也可在本地提取配置粘贴到此文件) 4 | DIY_PART_SH="diy-part.sh" # 自定义文件(增加插件或者修改IP之类的自定义设置) 5 | UPLOAD_BIN_DIR="true" # 上传【bin文件夹】到github空间(true=开启)(false=关闭) 6 | UPLOAD_CONFIG="true" # 上传【.config】配置文件到github空间(true=开启)(false=关闭) 7 | UPLOAD_FIRMWARE="true" # 上传固件到github空间(true=开启)(false=关闭) 8 | UPLOAD_RELEASE="false" # 发布固件(true=开启)(false=关闭) 9 | SERVERCHAN_SCKEY="true" # 微信、电报或push推送,默认电报,需要其他的请看微信通知说明替换代码(true=开启)(false=关闭) 10 | REGULAR_UPDATE="true" # 把自动在线更新的插件编译进固件,且发布固件到云端,需要密匙配合(请看说明)(true=开启)(false=关闭) 11 | BY_INFORMATION="true" # 是否显示编译信息,如出现信息显示错误导致编译进行不了,请关闭(true=开启)(false=关闭) 12 | USE_CACHEWRTBUILD="true" # 是否开启缓存加速,如出现带有缓存编译时莫名错误导致失败的,请关闭(true=开启)(false=关闭) 13 | -------------------------------------------------------------------------------- /build/Lienol_source/diy-part.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2019-2020 P3TERX 3 | # DIY扩展 在此脚本 增加插件 4 | 5 | 6 | # sed -i 's/luci-theme-bootstrap/luci-theme-argon/g' feeds/luci/collections/luci/Makefile # 选择argon为默认主题 7 | 8 | sed -i '/CYXluq4wUazHjmCDBCqXF/d' $ZZZ # 设置密码为空 9 | 10 | sed -i "s/'OpenWrt'/'N1'/g" package/base-files/files/bin/config_generate # 设置主机名 11 | 12 | # 在线更新时,删除不想保留固件的某个文件,在EOF跟EOF直接加入删除代码,记住这里对应的是固件的文件路径,比如: rm /etc/config/luci 13 | cat >$DELETE <<-EOF 14 | EOF 15 | 16 | # 修改插件名字 17 | # sed -i 's/"aMule设置"/"电驴下载"/g' `grep "aMule设置" -rl ./` 18 | # sed -i 's/"网络存储"/"NAS"/g' `grep "网络存储" -rl ./` 19 | # sed -i 's/"Turbo ACC 网络加速"/"网络加速"/g' `grep "Turbo ACC 网络加速" -rl ./` 20 | # sed -i 's/"实时流量监测"/"流量"/g' `grep "实时流量监测" -rl ./` 21 | # sed -i 's/"KMS 服务器"/"KMS激活"/g' `grep "KMS 服务器" -rl ./` 22 | # sed -i 's/"TTYD 终端"/"命令窗"/g' `grep "TTYD 终端" -rl ./` 23 | # sed -i 's/"USB 打印服务器"/"打印服务"/g' `grep "USB 打印服务器" -rl ./` 24 | # sed -i 's/"Web 管理"/"Web"/g' `grep "Web 管理" -rl ./` 25 | # sed -i 's/"管理权"/"改密码"/g' `grep "管理权" -rl ./` 26 | # sed -i 's/"带宽监控"/"监控"/g' `grep "带宽监控" -rl ./` 27 | # sed -i 's/"Argon 主题设置"/"Argon设置"/g' `grep "Argon 主题设置" -rl ./` 28 | -------------------------------------------------------------------------------- /build/Lienol_source/diy/README: -------------------------------------------------------------------------------- 1 | 替换文件用的文件夹,按照源码路径替换 2 | 替换文件有两个方法 3 | 1、在这里按 Add file 然后选 Create new file 然后要替换文件的路径跟名字,下面大方框粘贴内容,然后最下面绿色按钮保存 4 | 比如替换banner,在源码的路径是‘package/base-files/files/etc/banner’,按 Add file 然后选 Create new file,粘贴这个路径,下面大方框粘贴内容,然后最下面绿色按钮保存完成 5 | 6 | 2、在这里按 Create new file 然后选择 Upload files 然后把在你电脑上按文件夹路径跟名字制作好的文件拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 7 | 比如替换banner,在电脑创建package文件夹,package文件夹里面创建base-files文件夹,base-files文件夹里面创建files文件夹,files文件夹里面创建etc文件夹, 8 | 在etc文件夹创建banner.txt的文本文档,设置好内容,然后把.txt后缀去掉就是banner了,然后把你创建package文件夹拖进来,等文件传输完毕,然后按最下绿色按钮保存就可以了 9 | -------------------------------------------------------------------------------- /build/Lienol_source/diy/package/base-files/files/etc/banner: -------------------------------------------------------------------------------- 1 | _____ ______ ______ ___ _ ___ ___ ______ _____ 2 | / _ \ | _ \ | ____| | \ | | | | / / | _ \ |_ _| 3 | | | | | | |_| | | |__ | \| | | | __ / / | |_| | | | 4 | | | | | | ___/ | __| | |\ | | | / | / / | _ / | | 5 | | |_| | | | | |___ | | \ | | |/ |/ / | | \ \ | | 6 | \_____/ |_| |_____| |_| \_| |___/|___/ |_| \_\ |_| 7 | W I R E L E S S F R E E D 8 | -------------------------------------------------------------- 9 | by lean & immortalwrt Compilde by gd772 10 | -------------------------------------------------------------- 11 | -------------------------------------------------------------------------------- /build/Lienol_source/files/README: -------------------------------------------------------------------------------- 1 | 替换openwrt设置文件的文件夹,设置好openwrt后 2 | 记住这个不是源码文件,是源码编译好固件后的openwrt,安装好后,设置好后,openwrt里面etc 3 | 用WinSCP(文件协议F选择SCP)连接openwrt,找到etc文件夹,里面就是openwrt的所有设置文件 4 | 5 | 6 | 1、在这里按 Add file 然后选 Create new file 然后要替换文件的路径跟名字,下面大方框粘贴补丁内容,然后最下面绿色按钮保存 7 | 比如替换smartdns,在openwrt的路径是‘etc/config/smartdns’,按 Add file 然后选 Create new file,粘贴这个路径,下面大方框粘贴补丁内容,然后最下面绿色按钮保存完成 8 | 这个上替换单个文件方便,如果文件很多就比较麻烦,用下面的方法更好,就比如smartdns就有4个设置文件,不过一般都只用etc/config/smartdns的就是 9 | 10 | 2、在这里按 Create new file 然后选择 Upload files 然后把openwrt的对应路径制作好的etc文件夹,拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 11 | 比如替换smartdns,在电脑创建etc文件夹,etc文件夹里面创建config文件夹,然后在WinSCP里面etc/config里面的smartdns拖进来,上面说到smartdns有4个设置文件, 12 | 就在etc文件夹里面还有一个smartdns文件夹的,里面有三个设置文件,你把WinSCP里etc里面的smartdns文件夹直接拖到在你电脑创建的etc文件夹里面就好了 13 | 这样你在电脑创建的etc文件夹里面就有两个文件夹,一个config文件夹放着一个smartdns文件,一个smartdns文件夹里面放着address.conf、blacklist-ip.conf、custom.con三个设置文件 14 | 然后在这里按 Create new file 然后选择 Upload files 然后把在你电脑上etc文件夹拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 -------------------------------------------------------------------------------- /build/Lienol_source/patches/README: -------------------------------------------------------------------------------- 1 | 存放制作好的补丁文件 2 | 存放补丁有两种方法 3 | 1、在这里按 Add file 然后选 Create new file 然后补丁名字,下面大方框粘贴补丁内容,然后最下面绿色按钮保存 4 | 2、在这里按 Create new file 然后选择 Upload files 然后把在你电脑上的补丁文件拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 5 | -------------------------------------------------------------------------------- /build/Lienol_source/settings.ini: -------------------------------------------------------------------------------- 1 | REPO_URL="https://github.com/Lienol/openwrt" # 编译固件源码链接(请勿修改) 2 | REPO_BRANCH="19.07" # 源码链接的分支(请勿修改) 3 | CONFIG_FILE=".config" # 配置文件(可SSH远程定制固件插件,也可在本地提取配置粘贴到此文件) 4 | DIY_PART_SH="diy-part.sh" # 自定义文件(增加插件或者修改IP之类的自定义设置) 5 | UPLOAD_BIN_DIR="false" # 上传【bin文件夹】到github空间(true=开启)(false=关闭) 6 | UPLOAD_CONFIG="true" # 上传【.config】配置文件到github空间(true=开启)(false=关闭) 7 | UPLOAD_FIRMWARE="true" # 上传固件到github空间(true=开启)(false=关闭) 8 | UPLOAD_COWTRANSFER="false" # 上传固件到到【奶牛快传】和【WETRANSFER】(true=开启)(false=关闭) 9 | UPLOAD_RELEASE="false" # 发布固件(true=开启)(false=关闭) 10 | SERVERCHAN_SCKEY="false" # 微信、电报或push推送,默认电报,需要其他的请看微信通知说明替换代码(true=开启)(false=关闭) 11 | REGULAR_UPDATE="false" # 把自动在线更新的插件编译进固件,且发布固件到云端,需要密匙配合(请看说明)(true=开启)(false=关闭) 12 | BY_INFORMATION="true" # 是否显示编译信息,如出现信息显示错误导致编译进行不了,请关闭(true=开启)(false=关闭) 13 | USE_CACHEWRTBUILD="true" # 是否开启缓存加速,如出现带有缓存编译时莫名错误导致失败的,请关闭(true=开启)(false=关闭) 14 | -------------------------------------------------------------------------------- /build/Mortal_source/diy-part.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2019-2020 P3TERX 3 | # DIY扩展 在此脚本 增加插件 4 | 5 | 6 | # sed -i 's/luci-theme-bootstrap/luci-theme-argon/g' feeds/luci/collections/luci/Makefile # 选择argon为默认主题 7 | 8 | sed -i '/CYXluq4wUazHjmCDBCqXF/d' $ZZZ # 设置密码为空 9 | 10 | sed -i "s/'OpenWrt'/'N1'/g" package/base-files/files/bin/config_generate # 设置主机名 11 | 12 | # 在线更新时,删除不想保留固件的某个文件,在EOF跟EOF直接加入删除代码,记住这里对应的是固件的文件路径,比如: rm /etc/config/luci 13 | cat >$DELETE <<-EOF 14 | EOF 15 | 16 | # 修改插件名字 17 | # sed -i 's/"aMule设置"/"电驴下载"/g' `grep "aMule设置" -rl ./` 18 | # sed -i 's/"网络存储"/"NAS"/g' `grep "网络存储" -rl ./` 19 | # sed -i 's/"Turbo ACC 网络加速"/"网络加速"/g' `grep "Turbo ACC 网络加速" -rl ./` 20 | # sed -i 's/"实时流量监测"/"流量"/g' `grep "实时流量监测" -rl ./` 21 | # sed -i 's/"KMS 服务器"/"KMS激活"/g' `grep "KMS 服务器" -rl ./` 22 | # sed -i 's/"TTYD 终端"/"命令窗"/g' `grep "TTYD 终端" -rl ./` 23 | # sed -i 's/"USB 打印服务器"/"打印服务"/g' `grep "USB 打印服务器" -rl ./` 24 | # sed -i 's/"Web 管理"/"Web"/g' `grep "Web 管理" -rl ./` 25 | # sed -i 's/"管理权"/"改密码"/g' `grep "管理权" -rl ./` 26 | # sed -i 's/"带宽监控"/"监控"/g' `grep "带宽监控" -rl ./` 27 | # sed -i 's/"Argon 主题设置"/"Argon设置"/g' `grep "Argon 主题设置" -rl ./` 28 | -------------------------------------------------------------------------------- /build/Mortal_source/diy/README: -------------------------------------------------------------------------------- 1 | 替换文件用的文件夹,按照源码路径替换 2 | 替换文件有两个方法 3 | 1、在这里按 Add file 然后选 Create new file 然后要替换文件的路径跟名字,下面大方框粘贴内容,然后最下面绿色按钮保存 4 | 比如替换banner,在源码的路径是‘package/base-files/files/etc/banner’,按 Add file 然后选 Create new file,粘贴这个路径,下面大方框粘贴内容,然后最下面绿色按钮保存完成 5 | 6 | 2、在这里按 Create new file 然后选择 Upload files 然后把在你电脑上按文件夹路径跟名字制作好的文件拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 7 | 比如替换banner,在电脑创建package文件夹,package文件夹里面创建base-files文件夹,base-files文件夹里面创建files文件夹,files文件夹里面创建etc文件夹, 8 | 在etc文件夹创建banner.txt的文本文档,设置好内容,然后把.txt后缀去掉就是banner了,然后把你创建package文件夹拖进来,等文件传输完毕,然后按最下绿色按钮保存就可以了 9 | -------------------------------------------------------------------------------- /build/Mortal_source/diy/package/base-files/files/etc/banner: -------------------------------------------------------------------------------- 1 | _____ ______ ______ ___ _ ___ ___ ______ _____ 2 | / _ \ | _ \ | ____| | \ | | | | / / | _ \ |_ _| 3 | | | | | | |_| | | |__ | \| | | | __ / / | |_| | | | 4 | | | | | | ___/ | __| | |\ | | | / | / / | _ / | | 5 | | |_| | | | | |___ | | \ | | |/ |/ / | | \ \ | | 6 | \_____/ |_| |_____| |_| \_| |___/|___/ |_| \_\ |_| 7 | W I R E L E S S F R E E D 8 | -------------------------------------------------------------- 9 | by lean & immortalwrt Compilde by gd772 10 | -------------------------------------------------------------- 11 | -------------------------------------------------------------------------------- /build/Mortal_source/files/README: -------------------------------------------------------------------------------- 1 | 替换openwrt设置文件的文件夹,设置好openwrt后 2 | 记住这个不是源码文件,是源码编译好固件后的openwrt,安装好后,设置好后,openwrt里面etc 3 | 用WinSCP(文件协议F选择SCP)连接openwrt,找到etc文件夹,里面就是openwrt的所有设置文件 4 | 5 | 6 | 1、在这里按 Add file 然后选 Create new file 然后要替换文件的路径跟名字,下面大方框粘贴补丁内容,然后最下面绿色按钮保存 7 | 比如替换smartdns,在openwrt的路径是‘etc/config/smartdns’,按 Add file 然后选 Create new file,粘贴这个路径,下面大方框粘贴补丁内容,然后最下面绿色按钮保存完成 8 | 这个上替换单个文件方便,如果文件很多就比较麻烦,用下面的方法更好,就比如smartdns就有4个设置文件,不过一般都只用etc/config/smartdns的就是 9 | 10 | 2、在这里按 Create new file 然后选择 Upload files 然后把openwrt的对应路径制作好的etc文件夹,拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 11 | 比如替换smartdns,在电脑创建etc文件夹,etc文件夹里面创建config文件夹,然后在WinSCP里面etc/config里面的smartdns拖进来,上面说到smartdns有4个设置文件, 12 | 就在etc文件夹里面还有一个smartdns文件夹的,里面有三个设置文件,你把WinSCP里etc里面的smartdns文件夹直接拖到在你电脑创建的etc文件夹里面就好了 13 | 这样你在电脑创建的etc文件夹里面就有两个文件夹,一个config文件夹放着一个smartdns文件,一个smartdns文件夹里面放着address.conf、blacklist-ip.conf、custom.con三个设置文件 14 | 然后在这里按 Create new file 然后选择 Upload files 然后把在你电脑上etc文件夹拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 -------------------------------------------------------------------------------- /build/Mortal_source/patches/README: -------------------------------------------------------------------------------- 1 | 存放制作好的补丁文件 2 | 存放补丁有两种方法 3 | 1、在这里按 Add file 然后选 Create new file 然后补丁名字,下面大方框粘贴补丁内容,然后最下面绿色按钮保存 4 | 2、在这里按 Create new file 然后选择 Upload files 然后把在你电脑上的补丁文件拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 5 | -------------------------------------------------------------------------------- /build/Mortal_source/settings.ini: -------------------------------------------------------------------------------- 1 | REPO_URL="https://github.com/immortalwrt/immortalwrt" # 编译固件源码链接(请勿修改) 2 | REPO_BRANCH="openwrt-18.06" # 源码链接的分支(请勿修改) 3 | CONFIG_FILE=".config" # 配置文件(可SSH远程定制固件插件,也可在本地提取配置粘贴到此文件) 4 | DIY_PART_SH="diy-part.sh" # 自定义文件(增加插件或者修改IP之类的自定义设置) 5 | UPLOAD_BIN_DIR="false" # 上传【bin文件夹】到github空间(true=开启)(false=关闭) 6 | UPLOAD_CONFIG="true" # 上传【.config】配置文件到github空间(true=开启)(false=关闭) 7 | UPLOAD_FIRMWARE="true" # 上传固件到github空间(true=开启)(false=关闭) 8 | UPLOAD_COWTRANSFER="false" # 上传固件到到【奶牛快传】和【WETRANSFER】(true=开启)(false=关闭) 9 | UPLOAD_RELEASE="false" # 发布固件(true=开启)(false=关闭) 10 | SERVERCHAN_SCKEY="false" # 微信、电报或push推送,默认电报,需要其他的请看微信通知说明替换代码(true=开启)(false=关闭) 11 | REGULAR_UPDATE="false" # 把自动在线更新的插件编译进固件,且发布固件到云端,需要密匙配合(请看说明)(true=开启)(false=关闭) 12 | BY_INFORMATION="true" # 是否显示编译信息,如出现信息显示错误导致编译进行不了,请关闭(true=开启)(false=关闭) 13 | USE_CACHEWRTBUILD="true" # 是否开启缓存加速,如出现带有缓存编译时莫名错误导致失败的,请关闭(true=开启)(false=关闭) 14 | -------------------------------------------------------------------------------- /build/common/1022gg: -------------------------------------------------------------------------------- 1 | 10月22号的对应公告 2 | -------------------------------------------------------------------------------- /build/common/AutoUpdate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # https://github.com/Hyy2001X/AutoBuild-Actions 3 | # AutoBuild Module by Hyy2001 4 | # AutoUpdate for Openwrt 5 | 6 | Version=V6.5 7 | 8 | Shell_Helper() { 9 | echo 10 | echo 11 | 12 | echo -e "${Yellow}命令用途: 13 | 14 | bash /bin/AutoUpdate.sh [保留配置更新] 15 | bash /bin/AutoUpdate.sh -n [不保留配置更新] 16 | bash /bin/AutoUpdate.sh -g [把固件更改成其他作者固件,前提是你编译了有附带定时更新插件的其他作者的固件] 17 | bash /bin/AutoUpdate.sh -c [更换Github地址] 18 | bash /bin/AutoUpdate.sh -t [执行测试模式(只运行,不安装,查看更新固件操作流程)] 19 | bash /bin/AutoUpdate.sh -h [列出帮助信息] 20 | ${White}" 21 | 22 | echo -e "${Purple} 23 | =============================================================================================== 24 | ${White}" 25 | echo 26 | [[ -f /etc/CLOUD_Name ]] && { 27 | export CLOUD_Name="$(egrep -o "${LUCI_Name}-${CURRENT_Version}${BOOT_Type}-[a-zA-Z0-9]+${Firmware_SFX}" /etc/CLOUD_Name | awk 'END {print}')" > /dev/null 2>&1 28 | } || { 29 | wget -q -P ${Download_Path} https://ghproxy.com/${Github_Tagstwo} -O ${Download_Path}/Github_Tags > /dev/null 2>&1 30 | export CLOUD_Name="$(egrep -o "${LUCI_Name}-${CURRENT_Version}${BOOT_Type}-[a-zA-Z0-9]+${Firmware_SFX}" ${Download_Tags} | awk 'END {print}')" > /dev/null 2>&1 31 | [[ ! -f /etc/CLOUD_Name ]] && [[ ${CLOUD_Name} ]] && echo "${CLOUD_Name}" > /etc/CLOUD_Name 32 | } 33 | echo -e "${Green}详细参数: 34 | 35 | /overlay 可用: ${Overlay_Available} 36 | /tmp 可用: ${TMP_Available}M 37 | 固件下载位置: ${Download_Path} 38 | 当前设备名称: ${CURRENT_Device} 39 | 固件上的名称: ${DEFAULT_Device} 40 | 当前固件版本: ${CURRENT_Version} 41 | Github 地址: ${Github} 42 | 解析 API 地址: ${Github_Tags} 43 | 固件下载地址: ${Github_Release} 44 | 更新运行日志: ${AutoUpdate_Log_Path}/AutoUpdate.log 45 | 固件作者: ${Author} 46 | 作者仓库: ${CangKu} 47 | 固件名称: ${CLOUD_Name} 48 | 固件格式: ${EFI_Mode}${Firmware_SFX} 49 | ${White}" 50 | exit 0 51 | } 52 | White="\033[0;37m" 53 | Yellow="\033[0;33m" 54 | Red="\033[1;91m" 55 | Blue="\033[0;94m" 56 | BLUEB="\033[1;94m" 57 | BCyan="\033[1;36m" 58 | Grey="\033[1;34m" 59 | Green="\033[0;92m" 60 | Purple="\033[1;95m" 61 | [ -f /bin/openwrt_info ] && { 62 | chmod +x /bin/openwrt_info 63 | source /bin/openwrt_info 64 | } || { 65 | echo -e "\n${Red}未检测到更新插件所需文件,无法运行更新程序!${White}" 66 | echo 67 | exit 1 68 | } 69 | export Input_Option=$1 70 | export Input_Other=$2 71 | export Apidz="${Github##*com/}" 72 | export Author="${Apidz%/*}" 73 | export CangKu="${Apidz##*/}" 74 | export Github_Tags="https://api.github.com/repos/${Apidz}/releases/tags/AutoUpdate" 75 | export Github_Tagstwo="${Github}/releases/download/AutoUpdate/Github_Tags" 76 | export Kernel="$(egrep -o "[0-9]+\.[0-9]+\.[0-9]+" /usr/lib/opkg/info/kernel.control)" 77 | export Overlay_Available="$(df -h | grep ":/overlay" | awk '{print $4}' | awk 'NR==1')" 78 | rm -rf "${Download_Path}" && export TMP_Available="$(df -m | grep "/tmp" | awk '{print $4}' | awk 'NR==1' | awk -F. '{print $1}')" 79 | [ ! -d "${Download_Path}" ] && mkdir -p ${Download_Path} 80 | opkg list | awk '{print $1}' > ${Download_Path}/Installed_PKG_List 81 | export PKG_List="${Download_Path}/Installed_PKG_List" 82 | export AutoUpdate_Log_Path="/tmp" 83 | GET_PID() { 84 | local Result 85 | while [[ $1 ]];do 86 | Result=$(busybox ps | grep "$1" | grep -v "grep" | awk '{print $1}' | awk 'NR==1') 87 | [[ -n ${Result} ]] && echo ${Result} 88 | shift 89 | done 90 | } 91 | TIME() { 92 | local Color 93 | [[ -z $1 ]] && { 94 | echo -ne "\n${Grey}[$(date "+%H:%M:%S")]${White} " 95 | } || { 96 | case $1 in 97 | r) Color="${Red}";; 98 | g) Color="${Green}";; 99 | b) Color="${Blue}";; 100 | B) Color="${BLUEB}";; 101 | y) Color="${Yellow}";; 102 | h) Color="${BCyan}";; 103 | z) Color="${Purple}";; 104 | x) Color="${Grey}";; 105 | esac 106 | [[ $# -lt 2 ]] && { 107 | echo -e "\n${Grey}[$(date "+%H:%M:%S")]${White} $1" 108 | LOGGER $1 109 | } || { 110 | echo -e "\n${Grey}[$(date "+%H:%M:%S")]${White} ${Color}$2${White}" 111 | LOGGER $2 112 | } 113 | } 114 | } 115 | 116 | LOGGER() { 117 | [[ ! -d ${AutoUpdate_Log_Path} ]] && mkdir -p ${AutoUpdate_Log_Path} 118 | [[ ! -f ${AutoUpdate_Log_Path}/AutoUpdate.log ]] && touch ${AutoUpdate_Log_Path}/AutoUpdate.log 119 | echo "[$(date "+%Y-%m-%d-%H:%M:%S")] [$(GET_PID AutoUpdate.sh)] $*" >> ${AutoUpdate_Log_Path}/AutoUpdate.log 120 | } 121 | case ${DEFAULT_Device} in 122 | x86-64) 123 | [ -d /sys/firmware/efi ] && { 124 | export BOOT_Type="-UEFI" 125 | export EFI_Mode="UEFI" 126 | } || { 127 | export BOOT_Type="-Legacy" 128 | export EFI_Mode="Legacy" 129 | } 130 | export CURRENT_Device="$(jsonfilter -e '@.model.id' < /etc/board.json | tr ',' '_')" 131 | export Firmware_SFX=".${Firmware_Type}" 132 | [[ -z "${Firmware_Type}" ]] && export Firmware_SFX=".img.gz" 133 | ;; 134 | *) 135 | export CURRENT_Device="$(jsonfilter -e '@.model.id' < /etc/board.json | tr ',' '_')" 136 | export Firmware_SFX=".${Firmware_Type}" 137 | export BOOT_Type="-Sysupg" 138 | export EFI_Mode="" 139 | [[ -z "${Firmware_Type}" ]] && export Firmware_SFX=".bin" 140 | esac 141 | export CURRENT_Ver="${CURRENT_Version}${BOOT_Type}" 142 | echo "CURRENT_Version=${CURRENT_Version}" > /etc/openwrt_ver 143 | echo -e "\nCURRENT_Model=${EFI_Mode}${Firmware_SFX}" >> /etc/openwrt_ver 144 | echo -e "\nNEI_Luci=${Kernel} - ${Luci_Edition}" >> /etc/openwrt_ver 145 | cd /etc 146 | clear && echo "Openwrt-AutoUpdate Script ${Version}" 147 | echo 148 | if [[ -z "${Input_Option}" ]];then 149 | export Upgrade_Options="sysupgrade -q" 150 | export Update_Mode=1 151 | TIME h "执行: 保留配置更新固件[静默模式]" 152 | else 153 | case ${Input_Option} in 154 | -t | -n | -f | -u | -N | -s | -w) 155 | case ${Input_Option} in 156 | -t) 157 | export Input_Other="-t" 158 | TIME h "执行: 测试模式" 159 | TIME z "测试模式(只运行,不安装,查看更新固件操作流程是否正确)" 160 | ;; 161 | -w) 162 | export Input_Other="-w" 163 | ;; 164 | -n | -N) 165 | export Upgrade_Options="sysupgrade -n" 166 | TIME h "执行: 更新固件(不保留配置)" 167 | ;; 168 | -s) 169 | export Upgrade_Options="sysupgrade -F -n" 170 | TIME h "执行: 强制更新固件(不保留配置)" 171 | ;; 172 | -u) 173 | export AutoUpdate_Mode=1 174 | export Upgrade_Options="sysupgrade -q" 175 | ;; 176 | esac 177 | ;; 178 | -c) 179 | source /bin/openwrt_info 180 | TIME h "执行:更换[Github地址]操作" 181 | TIME y "地址格式:https://github.com/帐号/仓库" 182 | TIME z "正确地址示例:https://github.com/281677160/AutoBuild-OpenWrt" 183 | TIME h "现在所用地址为:${Github}" 184 | echo 185 | read -p "请输入新的Github地址:" Input_Other 186 | Input_Other="${Input_Other:-"$Github"}" 187 | Github_uci=$(uci get autoupdate.@login[0].github 2>/dev/null) 188 | [[ -n "${Github_uci}" ]] && [[ "${Github_uci}" != "${Input_Other}" ]] && { 189 | uci set autoupdate.@login[0].github=${Input_Other} 190 | uci commit autoupdate 191 | TIME y "Github 地址已更换为: ${Input_Other}" 192 | TIME y "UCI 设置已更新!" 193 | echo 194 | } 195 | Input_Other="${Input_Other:-"$Github"}" 196 | [[ "${Github}" != "${Input_Other}" ]] && { 197 | sed -i "s?${Github}?${Input_Other}?g" /bin/openwrt_info 198 | unset Input_Other 199 | exit 0 200 | } || { 201 | TIME g "INPUT: ${Input_Other}" 202 | TIME r "输入的 Github 地址相同,无需修改!" 203 | echo 204 | exit 1 205 | } 206 | ;; 207 | -h | -H | -l | -L) 208 | Shell_Helper 209 | ;; 210 | -g | -G) 211 | bash /bin/replace.sh 212 | sleep 1 213 | exit 0 214 | ;; 215 | *) 216 | echo -e "\nERROR INPUT: [$*]" 217 | Shell_Helper 218 | ;; 219 | esac 220 | fi 221 | [[ -z ${CURRENT_Version} ]] && TIME r "本地固件版本获取失败,请检查/bin/openwrt_info文件的值!" && exit 1 222 | [[ -z ${Github} ]] && TIME r "Github地址获取失败,请检查/bin/openwrt_info文件的值!" && exit 1 223 | TIME g "正在获取云端固件版本信息..." 224 | [ ! -d ${Download_Path} ] && mkdir -p ${Download_Path} 225 | wget -q ${Github_Tags} -O ${Download_Tags} > /dev/null 2>&1 226 | if [[ $? -ne 0 ]];then 227 | wget -q -P ${Download_Path} https://pd.zwc365.com/${Github_Tagstwo} -O ${Download_Path}/Github_Tags > /dev/null 2>&1 228 | if [[ $? -ne 0 ]];then 229 | wget -q -P ${Download_Path} https://ghproxy.com/${Github_Tagstwo} -O ${Download_Path}/Github_Tags > /dev/null 2>&1 230 | fi 231 | if [[ $? -ne 0 ]];then 232 | TIME r "获取固件版本信息失败,请检测网络,或者您更改的Github地址为无效地址,或者您的仓库是私库,或者发布已被删除!" 233 | echo 234 | exit 1 235 | fi 236 | fi 237 | export CLOUD_Name="$(egrep -o "${LUCI_Name}-${CURRENT_Version}${BOOT_Type}-[a-zA-Z0-9]+${Firmware_SFX}" ${Download_Tags} | awk 'END {print}')" 238 | [[ ! -f /etc/CLOUD_Name ]] && echo "${CLOUD_Name}" > /etc/CLOUD_Name 239 | TIME g "正在比对云端固件和本地安装固件版本..." 240 | export CLOUD_Firmware="$(egrep -o "${Egrep_Firmware}-[0-9]+${BOOT_Type}-[a-zA-Z0-9]+${Firmware_SFX}" ${Download_Tags} | awk 'END {print}')" 241 | export CLOUD_sion="$(echo ${CLOUD_Firmware} | egrep -o "${REPO_Name}-${DEFAULT_Device}-[0-9]+")" 242 | export CLOUD_Version="$(echo ${CLOUD_Firmware} | egrep -o "${REPO_Name}-${DEFAULT_Device}-[0-9]+${BOOT_Type}")" 243 | [[ -z "${CLOUD_Version}" ]] && { 244 | TIME r "比对固件版本失败!" 245 | exit 1 246 | } 247 | [[ "${Input_Other}" == "-w" ]] && { 248 | echo -e "\nCLOUD_Version=${CLOUD_sion}" > /tmp/Version_Tags 249 | echo -e "\nCURRENT_Version=${CURRENT_Version}" >> /tmp/Version_Tags 250 | exit 0 251 | } 252 | export Firmware_Name="$(echo ${CLOUD_Firmware} | egrep -o "${Egrep_Firmware}-[0-9]+${BOOT_Type}-[a-zA-Z0-9]+")" 253 | export Firmware="${CLOUD_Firmware}" 254 | export CLOUD_Name="$(egrep -o "${LUCI_Name}-${CURRENT_Version}${BOOT_Type}-[a-zA-Z0-9]+${Firmware_SFX}" ${Download_Tags} | awk 'END {print}')" 255 | let X=$(grep -n "${Firmware}" ${Download_Tags} | tail -1 | cut -d : -f 1)-4 256 | let CLOUD_Firmware_Size=$(sed -n "${X}p" ${Download_Tags} | egrep -o "[0-9]+" | awk '{print ($1)/1048576}' | awk -F. '{print $1}')+1 257 | echo -e "\n本地版本:${CURRENT_Ver}" 258 | echo "云端版本:${CLOUD_Version}" 259 | [[ "${TMP_Available}" -lt "${CLOUD_Firmware_Size}" ]] && { 260 | TIME g "tmp 剩余空间: ${TMP_Available}M" 261 | TIME r "tmp空间不足[${CLOUD_Firmware_Size}M],不够下载固件所需,请清理tmp空间或者增加运行内存!" 262 | echo 263 | exit 1 264 | } 265 | if [[ ! "${Force_Update}" == 1 ]];then 266 | if [[ "${CURRENT_Version}" -gt "${CLOUD_Version}" ]];then 267 | TIME r "检测到有可更新的固件版本,立即更新固件!" 268 | fi 269 | if [[ "${CURRENT_Version}" -eq "${CLOUD_Version}" ]];then 270 | [[ "${AutoUpdate_Mode}" == 1 ]] && exit 0 271 | TIME && read -p "当前版本和云端最新版本一致,是否还要重新安装固件?[Y/n]:" Choose 272 | [[ "${Choose}" == Y ]] || [[ "${Choose}" == y ]] && { 273 | TIME z "正在开始重新安装固件..." 274 | } || { 275 | TIME r "已取消重新安装固件,即将退出程序..." 276 | sleep 2 277 | exit 0 278 | } 279 | fi 280 | if [[ "${CURRENT_Version}" -lt "${CLOUD_Version}" ]];then 281 | [[ "${AutoUpdate_Mode}" == 1 ]] && exit 0 282 | TIME && read -p "云端最高版本,低于您现在的版本,是否强制覆盖现有固件?[Y/n]:" Choose 283 | [[ "${Choose}" == Y ]] || [[ "${Choose}" == y ]] && { 284 | TIME z "正在开始使用云端版本覆盖现有固件..." 285 | } || { 286 | TIME r "已取消覆盖固件,退出程序..." 287 | sleep 2 288 | exit 0 289 | } 290 | fi 291 | fi 292 | TIME g "列出详细信息..." 293 | sleep 1 294 | echo -e "\n固件作者:${Author}" 295 | echo "设备名称:${CURRENT_Device}" 296 | echo "固件格式:${Firmware_SFX}" 297 | [[ "${DEFAULT_Device}" == x86-64 ]] && { 298 | echo "引导模式:${EFI_Mode}" 299 | } 300 | echo "固件名称:${Firmware}" 301 | echo "下载保存:${Download_Path}" 302 | echo "固件体积:${CLOUD_Firmware_Size}M" 303 | cd ${Download_Path} 304 | [[ "$(cat ${Download_Path}/Installed_PKG_List)" =~ curl ]] && { 305 | export Google_Check=$(curl -I -s --connect-timeout 8 google.com -w %{http_code} | tail -n1) 306 | if [ ! "$Google_Check" == 301 ];then 307 | TIME g "正在下载云端固件,请耐心等待..." 308 | wget -q "https://ghproxy.com/${Github_Release}/${Firmware}" -O ${Firmware} 309 | if [[ $? -ne 0 ]];then 310 | wget -q "https://pd.zwc365.com/${Github_Release}/${Firmware}" -O ${Firmware} 311 | if [[ $? -ne 0 ]];then 312 | TIME r "下载云端固件失败,请尝试手动安装!" 313 | echo 314 | exit 1 315 | else 316 | TIME y "下载云端固件成功!" 317 | fi 318 | else 319 | TIME y "下载云端固件成功!" 320 | fi 321 | else 322 | TIME g "正在下载云端固件,请耐心等待..." 323 | wget -q "${Github_Release}/${Firmware}" -O ${Firmware} 324 | if [[ $? -ne 0 ]];then 325 | wget -q "https://ghproxy.com/${Github_Release}/${Firmware}" -O ${Firmware} 326 | if [[ $? -ne 0 ]];then 327 | TIME r "下载云端固件失败,请尝试手动安装!" 328 | echo 329 | exit 1 330 | else 331 | TIME y "下载云端固件成功!" 332 | fi 333 | else 334 | TIME y "下载云端固件成功!" 335 | fi 336 | fi 337 | } 338 | export CLOUD_MD5=$(md5sum ${Firmware} | cut -c1-3) 339 | export CLOUD_256=$(sha256sum ${Firmware} | cut -c1-3) 340 | export MD5_256=$(echo ${Firmware} | egrep -o "[a-zA-Z0-9]+${Firmware_SFX}" | sed -r "s/(.*)${Firmware_SFX}/\1/") 341 | export CURRENT_MD5="$(echo "${MD5_256}" | cut -c1-3)" 342 | export CURRENT_256="$(echo "${MD5_256}" | cut -c 4-)" 343 | [[ ${CURRENT_MD5} != ${CLOUD_MD5} ]] && { 344 | TIME r "MD5对比失败,固件可能在下载时损坏,请检查网络后重试!" 345 | exit 1 346 | } 347 | [[ ${CURRENT_256} != ${CLOUD_256} ]] && { 348 | TIME r "SHA256对比失败,固件可能在下载时损坏,请检查网络后重试!" 349 | exit 1 350 | } 351 | chmod 777 ${Firmware} 352 | TIME g "准备更新固件,更新期间请不要断开电源或重启设备 ..." 353 | [[ "${Input_Other}" == "-t" ]] && { 354 | TIME z "测试模式运行完毕!" 355 | rm -rf "${Download_Path}" 356 | echo 357 | exit 0 358 | } 359 | sleep 2 360 | TIME g "正在更新固件,请耐心等待 ..." 361 | [[ "$(cat ${PKG_List})" =~ gzip ]] && opkg remove gzip > /dev/null 2>&1 362 | if [[ "${AutoUpdate_Mode}" == 1 ]] || [[ "${Update_Mode}" == 1 ]]; then 363 | source /etc/deletefile 364 | cp -Rf /etc/config/network /mnt/network 365 | mv -f /etc/config/luci /etc/config/luci- 366 | sysupgrade -b /mnt/back.tar.gz 367 | [[ $? == 0 ]] && { 368 | mv -f /etc/config/luci- /etc/config/luci 369 | export Upgrade_Options="sysupgrade -f /mnt/back.tar.gz" 370 | } || { 371 | mv -f /etc/config/luci- /etc/config/luci 372 | export Upgrade_Options="sysupgrade -q" 373 | } 374 | fi 375 | 376 | ${Upgrade_Options} ${Firmware} 377 | 378 | exit 0 379 | 380 | -------------------------------------------------------------------------------- /build/common/Custom/DRM-I915: -------------------------------------------------------------------------------- 1 | CONFIG_64BIT=y 2 | CONFIG_DRM=y 3 | CONFIG_DRM_I915=y 4 | CONFIG_DRM_I915_GVT=y 5 | CONFIG_DUMMY_CONSOLE=y 6 | -------------------------------------------------------------------------------- /build/common/Custom/compile.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | TIME() { 4 | [[ -z "$1" ]] && { 5 | echo -ne " " 6 | } || { 7 | case $1 in 8 | r) export Color="\e[31;1m";; 9 | g) export Color="\e[32;1m";; 10 | b) export Color="\e[34;1m";; 11 | y) export Color="\e[33;1m";; 12 | z) export Color="\e[35;1m";; 13 | l) export Color="\e[36;1m";; 14 | esac 15 | [[ $# -lt 2 ]] && echo -e "\e[36m\e[0m ${1}" || { 16 | echo -e "\e[36m\e[0m ${Color}${2}\e[0m" 17 | } 18 | } 19 | } 20 | UbuntuName=`cat /etc/issue` 21 | XTName="Ubuntu" 22 | XTbit=`getconf LONG_BIT` 23 | [[ ( $UbuntuName != *$XTName* ) || ( $XTbit != 64 ) ]] && { 24 | clear 25 | echo 26 | TIME y "请使用Ubuntu 64bit,推荐 Ubuntu 18 LTS 或 Ubuntu 20 LTS" 27 | echo 28 | exit 1 29 | } 30 | [[ "$USER" == "root" ]] && { 31 | clear 32 | echo 33 | TIME g "警告:请勿使用root用户编译,换一个普通用户吧~~" 34 | echo 35 | exit 1 36 | } 37 | [[ ! -e .compile ]] && { 38 | clear 39 | echo 40 | echo 41 | echo 42 | TIME z "|*******************************************|" 43 | TIME g "| |" 44 | TIME y "| 首次编译,请输入Ubuntu密码继续下一步 |" 45 | TIME g "| |" 46 | TIME z "| 编译环境部署 |" 47 | TIME g "| |" 48 | TIME r "|*******************************************|" 49 | echo 50 | echo 51 | sudo apt-get update -y 52 | sudo apt-get full-upgrade -y 53 | sudo apt-get install -y build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 lib32stdc++6 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 rename libpcap0.8-dev swig rsync 54 | [[ ! $? == 0 ]] && { 55 | clear 56 | echo 57 | TIME r "环境部署失败,请检测网络或更换节点再尝试!" 58 | exit 1 59 | } || { 60 | sudo timedatectl set-timezone Asia/Shanghai 61 | echo "compile" > .compile 62 | } 63 | } 64 | rm -rf ${firmware} 65 | if [[ -n "$(ls -A "openwrt/config_bf" 2>/dev/null)" ]]; then 66 | if [[ -n "$(ls -A "openwrt/.Lede_core" 2>/dev/null)" ]]; then 67 | firmware="Lede_source" 68 | CODE="lede" 69 | CJB_DL="Lede_dl.zip" 70 | Modelfile="Lede_source" 71 | Core=".Lede_core" 72 | source openwrt/.Lede_core 73 | elif [[ -n "$(ls -A "openwrt/.Lienol_core" 2>/dev/null)" ]]; then 74 | firmware="Lienol_source" 75 | CODE="lienol" 76 | CJB_DL="Lienol_dl.zip" 77 | Modelfile="Lienol_source" 78 | Core=".Lienol_core" 79 | source openwrt/.Lienol_core 80 | elif [[ -n "$(ls -A "openwrt/.Mortal_core" 2>/dev/null)" ]]; then 81 | firmware="Mortal_source" 82 | CODE="mortal" 83 | CJB_DL="Mortal_dl.zip" 84 | Modelfile="Mortal_source" 85 | Core=".Mortal_core" 86 | source openwrt/.Mortal_core 87 | elif [[ -n "$(ls -A "openwrt/.amlogic_core" 2>/dev/null)" ]]; then 88 | firmware="openwrt_amlogic" 89 | CODE="lede" 90 | CJB_DL="Lede_dl.zip" 91 | Modelfile="openwrt_amlogic" 92 | Core=".amlogic_core" 93 | source openwrt/.amlogic_core 94 | else 95 | clear 96 | echo 97 | echo 98 | echo 99 | TIME r "没检测到openwrt文件夹有执行文件,自动转换成首次编译命令编译固件,请稍后..." 100 | rm -rf {openwrt,.compile} 101 | rm -rf ${firmware} 102 | bash <(curl -fsSL git.io/JcGDV) 103 | fi 104 | if [[ ! -e openwrt/${Core} ]]; then 105 | if [[ -e ${firmware}/${Core} ]]; then 106 | source ${firmware}/${Core} 107 | fi 108 | fi 109 | echo 110 | if [[ `grep -c "CONFIG_TARGET_x86_64=y" openwrt/config_bf` -eq '1' ]]; then 111 | TARGET_PROFILE="x86-64" 112 | elif [[ `grep -c "CONFIG_TARGET.*DEVICE.*=y" openwrt/config_bf` -eq '1' ]]; then 113 | TARGET_PROFILE="$(egrep -o "CONFIG_TARGET.*DEVICE.*=y" openwrt/config_bf | sed -r 's/.*DEVICE_(.*)=y/\1/')" 114 | else 115 | TARGET_PROFILE="armvirt" 116 | fi 117 | [[ ${firmware} == "openwrt_amlogic" ]] && { 118 | clear 119 | echo 120 | echo 121 | echo 122 | TIME g "正在使用[ ${firmware} ]源码编译[ N1和晶晨系列盒子专用固件 ],是否更换源码?" 123 | } || { 124 | clear 125 | echo 126 | echo 127 | echo 128 | TIME g "正在使用[ ${firmware} ]源码编译[ ${TARGET_PROFILE}固件 ],是否更换源码编译?" 129 | } 130 | read -p " [输入[ Y/y ]回车确认,直接回车跳过选择]: " GHYM 131 | case $GHYM in 132 | [Yy]) 133 | clear 134 | echo 135 | echo 136 | TIME r "您选择更改源码,正在清理旧文件中,请稍后..." 137 | rm -rf openwrt 138 | rm -rf ${firmware} 139 | ;; 140 | *) 141 | YUAN_MA="false" 142 | TIME y "您已关闭更换源码,保存配置中,请稍后..." 143 | mkdir -p ${firmware} 144 | cp -Rf openwrt/{config_bf,${Core},compile.sh} ${firmware} > /dev/null 2>&1 145 | ;; 146 | esac 147 | fi 148 | Ubunkj="$(df -h | grep "/dev/*/" | awk '{print $4}' | awk 'NR==1')" 149 | FINAL=`echo ${Ubunkj: -1}` 150 | if [[ "${FINAL}" =~ (M|K) ]]; then 151 | echo 152 | TIME r "敬告:可用空间小于[ 1G ]退出编译,建议可用空间大于20G,是否继续?" 153 | sleep 2 154 | exit 1 155 | echo 156 | fi 157 | Ubuntu_mz="$(cat /etc/group | grep adm | cut -f2 -d,)" 158 | Ubuntu_kj="$(df -h | grep "/dev/*/" | awk '{print $4}' | awk 'NR==1' | sed 's/.$//g')" 159 | if [[ "${Ubuntu_kj}" -lt "20" ]];then 160 | echo 161 | TIME z "您当前系统可用空间为${Ubuntu_kj}G" 162 | echo "" 163 | TIME r "敬告:可用空间小于[ 20G ]编译容易出错,建议可用空间大于20G,是否继续?" 164 | echo 165 | read -p " [回车退出,Y/y确认继续]: " YN 166 | case ${YN} in 167 | [Yy]) 168 | TIME g "可用空间太小严重影响编译,请满天神佛保佑您成功吧!" 169 | echo 170 | ;; 171 | *) 172 | TIME y "您已取消编译,请清理Ubuntu空间或增加硬盘容量..." 173 | echo "" 174 | sleep 2s 175 | exit 0 176 | esac 177 | fi 178 | [[ ! ${YUAN_MA} == "false" ]] && { 179 | clear 180 | echo 181 | echo 182 | echo 183 | TIME l " 1. Lede_5.4内核,LUCI 18.06版本(Lede_source)" 184 | echo 185 | TIME l " 2. Lienol_4.14内核,LUCI 19.07版本(Lienol_source)" 186 | echo 187 | TIME l " 3. Immortalwrt_5.4内核,LUCI 21.02版本(Mortal_source)" 188 | echo 189 | TIME l " 4. N1和晶晨系列CPU盒子专用(openwrt_amlogic)" 190 | echo 191 | TIME l " 5. 退出编译程序" 192 | echo 193 | echo 194 | echo 195 | while :; do 196 | TIME g "请选择编译源码,输入[ 1、2、3、4、5 ]然后回车确认您的选择!" 197 | read -p " 输入您的选择: " CHOOSE 198 | case $CHOOSE in 199 | 1) 200 | firmware="Lede_source" 201 | CODE="lede" 202 | Core=".Lede_core" 203 | CJB_DL="Lede_dl.zip" 204 | Modelfile="Lede_source" 205 | source Lede_source/.Lede_core > /dev/null 2>&1 206 | TIME y "您选择了:Lede_5.4内核,LUCI 18.06版本" 207 | break 208 | ;; 209 | 2) 210 | firmware="Lienol_source" 211 | CODE="lienol" 212 | Core=".Lienol_core" 213 | CJB_DL="Lienol_dl.zip" 214 | Modelfile="Lienol_source" 215 | source Lienol_source/.Lienol_core > /dev/null 2>&1 216 | TIME y "您选择了:Lienol_4.14内核,LUCI 19.07版本" 217 | break 218 | ;; 219 | 3) 220 | firmware="Mortal_source" 221 | CODE="mortal" 222 | Core=".Mortal_core" 223 | CJB_DL="Mortal_dl.zip" 224 | Modelfile="Mortal_source" 225 | source Mortal_source/.Mortal_core > /dev/null 2>&1 226 | TIME y "您选择了:Immortalwrt_5.4内核,LUCI 21.02版本" 227 | break 228 | ;; 229 | 4) 230 | firmware="openwrt_amlogic" 231 | CODE="lede" 232 | Core=".amlogic_core" 233 | CJB_DL="Lede_dl.zip" 234 | Modelfile="openwrt_amlogic" 235 | source openwrt_amlogic/.amlogic_core > /dev/null 2>&1 236 | TIME y "您选择了:N1和晶晨系列CPU盒子专用" 237 | break 238 | ;; 239 | 5) 240 | rm -rf compile.sh 241 | TIME r "您选择了退出编译程序" 242 | exit 0 243 | break 244 | ;; 245 | *) 246 | TIME r "警告:输入错误,请输入正确的编号!" 247 | ;; 248 | esac 249 | done 250 | } 251 | echo 252 | echo 253 | [[ -z ${ipdz} ]] && ipdz="192.168.1.1" 254 | TIME g "设置openwrt的后台IP地址[ 回车默认 $ipdz ]" 255 | read -p " 请输入后台IP地址:" ip 256 | ip=${ip:-"$ipdz"} 257 | TIME y "您的后台地址为:$ip" 258 | echo 259 | echo 260 | TIME g "是否需要选择机型和增删插件?" 261 | read -p " [输入[ Y/y ]回车确认,直接回车跳过选择]: " MENU 262 | case $MENU in 263 | [Yy]) 264 | Menuconfig="YES" 265 | TIME y "您执行机型和增删插件命令,请耐心等待程序运行至窗口弹出进行机型和插件配置!" 266 | ;; 267 | *) 268 | TIME r "您已关闭选择机型和增删插件设置!" 269 | ;; 270 | esac 271 | echo 272 | echo 273 | TIME g "是否把固件上传到<奶牛快传>?" 274 | read -p " [输入[ Y/y ]回车确认,直接回车跳过选择]: " NNKC 275 | case $NNKC in 276 | [Yy]) 277 | UPCOWTRANSFER="true" 278 | TIME y "您执行了上传固件到<奶牛快传>!" 279 | ;; 280 | *) 281 | TIME r "您已关闭上传固件到<奶牛快传>!" 282 | ;; 283 | esac 284 | echo 285 | echo 286 | [[ ! $firmware == "openwrt_amlogic" ]] && { 287 | TIME g "是否把定时更新插件编译进固件?" 288 | read -p " [输入[ Y/y ]回车确认,直接回车跳过选择]: " RELE 289 | case $RELE in 290 | [Yy]) 291 | REG_UPDATE="true" 292 | ;; 293 | *) 294 | TIME r "您已关闭把‘定时更新插件’编译进固件!" 295 | Github="https://github.com/mdtycl/Compile-OpenWrt" 296 | ;; 297 | esac 298 | } 299 | [[ "${REG_UPDATE}" == "true" ]] && { 300 | [[ -z ${Git} ]] && Git="https://github.com/mdtycl/Compile-OpenWrt" 301 | TIME g "设置Github地址,定时更新固件需要把固件传至对应地址的Releases" 302 | TIME z "回车默认为:$Git" 303 | read -p " 请输入Github地址:" Github 304 | Github=${Github:-"$Git"} 305 | TIME y "您的Github地址为:$Github" 306 | Apidz="${Github##*com/}" 307 | Author="${Apidz%/*}" 308 | CangKu="${Apidz##*/}" 309 | } 310 | echo 311 | mkdir -p ${firmware} 312 | cat >${firmware}/${Core} <<-EOF 313 | ipdz=$ip 314 | Git=$Github 315 | EOF 316 | Begin="$(date "+%Y/%m/%d-%H.%M")" 317 | date1="$(date +'%m.%d')" 318 | echo 319 | TIME g "正在下载源码中,请耐心等候~~~" 320 | echo 321 | if [[ $firmware == "Lede_source" ]]; then 322 | rm -rf openwrt && git clone https://github.com/coolsnowwolf/lede openwrt 323 | [[ $? -ne 0 ]] && { 324 | TIME r "源码下载失败,请检测网络或更换节点再尝试!" 325 | echo 326 | exit 1 327 | } 328 | ZZZ="package/lean/default-settings/files/zzz-default-settings" 329 | OpenWrt_name="18.06" 330 | echo -e "\nipdz=$ip" > openwrt/.Lede_core 331 | echo -e "\nGit=$Github" >> openwrt/.Lede_core 332 | elif [[ $firmware == "Lienol_source" ]]; then 333 | rm -rf openwrt && git clone -b 19.07 --single-branch https://github.com/Lienol/openwrt openwrt 334 | [[ $? -ne 0 ]] && { 335 | TIME r "源码下载失败,请检测网络或更换节点再尝试!" 336 | echo 337 | exit 1 338 | } 339 | ZZZ="package/default-settings/files/zzz-default-settings" 340 | OpenWrt_name="19.07" 341 | echo -e "\nipdz=$ip" > openwrt/.Lienol_core 342 | echo -e "\nGit=$Github" >> openwrt/.Lienol_core 343 | elif [[ $firmware == "Mortal_source" ]]; then 344 | rm -rf openwrt && git clone -b openwrt-21.02 --single-branch https://github.com/immortalwrt/immortalwrt openwrt 345 | [[ $? -ne 0 ]] && { 346 | TIME r "源码下载失败,请检测网络或更换节点再尝试!" 347 | echo 348 | exit 1 349 | } 350 | ZZZ="package/emortal/default-settings/files/zzz-default-settings" 351 | OpenWrt_name="21.02" 352 | echo -e "\nipdz=$ip" > openwrt/.Mortal_core 353 | echo -e "\nGit=$Github" >> openwrt/.Mortal_core 354 | elif [[ $firmware == "openwrt_amlogic" ]]; then 355 | rm -rf openwrt && git clone https://github.com/coolsnowwolf/lede openwrt 356 | [[ $? -ne 0 ]] && { 357 | TIME r "源码下载失败,请检测网络或更换节点再尝试!" 358 | echo 359 | exit 1 360 | } 361 | echo 362 | TIME g "正在下载打包所需的内核,请耐心等候~~~" 363 | echo 364 | rm -rf amlogic-s9xxx && svn co https://github.com/ophub/amlogic-s9xxx-openwrt/trunk/amlogic-s9xxx amlogic-s9xxx 365 | [[ $? -ne 0 ]] && { 366 | rm -rf amlogic-s9xxx 367 | TIME r "内核下载失败,请检测网络或更换节点再尝试!" 368 | echo 369 | exit 1 370 | } || { 371 | mv amlogic-s9xxx openwrt/amlogic-s9xxx 372 | curl -fsSL https://raw.githubusercontent.com/ophub/amlogic-s9xxx-openwrt/main/make > openwrt/make 373 | mkdir -p openwrt/openwrt-armvirt 374 | chmod 777 openwrt/make 375 | } 376 | ZZZ="package/lean/default-settings/files/zzz-default-settings" 377 | OpenWrt_name="18.06" 378 | echo -e "\nipdz=$ip" > openwrt/.amlogic_core 379 | echo -e "\nGit=$Github" >> openwrt/.amlogic_core 380 | fi 381 | if [[ "${UPCOWTRANSFER}" == "true" ]]; then 382 | curl -fsSL git.io/file-transfer | sh 383 | fi 384 | GITHUB_WORKSPACE="$PWD" 385 | Home="$PWD/openwrt" 386 | PATH1="$PWD/openwrt/build/${firmware}" 387 | NETIP="package/base-files/files/etc/networkip" 388 | [[ -e "${firmware}" ]] && cp -Rf "${firmware}"/${Core} "${Home}"/${Core} 389 | echo "Compile_Date=$(date +%Y%m%d%H%M)" > $Home/Openwrt.info 390 | [ -f $Home/Openwrt.info ] && . $Home/Openwrt.info 391 | svn co https://github.com/mdtycl/Compile-OpenWrt/trunk/build $Home/build > /dev/null 2>&1 392 | [[ $? -ne 0 ]] && { 393 | TIME r "编译脚本下载失败,请检测网络或更换节点再尝试!" 394 | exit 1 395 | } 396 | svn co https://github.com/mdtycl/Compile-OpenWrt/trunk/common $Home/build/common 397 | [[ $? -ne 0 ]] && { 398 | TIME r "脚本扩展下载失败,请检测网络或更换节点再尝试!" 399 | exit 1 400 | } 401 | chmod -R +x $Home/build/common 402 | chmod -R +x $Home/build/${firmware} 403 | source $Home/build/${firmware}/settings.ini 404 | REGULAR_UPDATE="${REG_UPDATE}" 405 | cp -Rf $Home/build/common/Custom/compile.sh openwrt/compile.sh 406 | cp -Rf $Home/build/common/*.sh openwrt/build/${firmware} 407 | echo 408 | TIME g "正在加载自定义文件和下载插件,请耐心等候~~~" 409 | echo 410 | cd $Home 411 | ./scripts/feeds update -a > /dev/null 2>&1 412 | if [[ "${REPO_BRANCH}" == "master" ]]; then 413 | source "${PATH1}/common.sh" && Diy_lede 414 | elif [[ "${REPO_BRANCH}" == "19.07" ]]; then 415 | source "${PATH1}/common.sh" && Diy_lienol 416 | elif [[ "${REPO_BRANCH}" == "openwrt-21.02" ]]; then 417 | source "${PATH1}/common.sh" && Diy_mortal 418 | fi 419 | source build/${firmware}/common.sh && Diy_all 420 | [[ $? -ne 0 ]] && { 421 | TIME r "插件包下载失败,请检测网络或更换节点再尝试!" 422 | echo 423 | exit 1 424 | } 425 | echo 426 | TIME g "正在加载源和安装源,请耐心等候~~~" 427 | echo 428 | cat >$NETIP <<-EOF 429 | uci set network.lan.ipaddr='$ip' 430 | uci commit network 431 | EOF 432 | sed -i "s/OpenWrt /${Ubuntu_mz} compiled in $(TZ=UTC-8 date "+%Y.%m.%d") @ OpenWrt /g" $ZZZ 433 | sed -i '/CYXluq4wUazHjmCDBCqXF/d' $ZZZ 434 | echo 435 | sed -i 's/"网络存储"/"NAS"/g' `grep "网络存储" -rl ./feeds/luci/applications` 436 | sed -i 's/"网络存储"/"NAS"/g' `grep "网络存储" -rl ./package` 437 | sed -i 's/"带宽监控"/"监控"/g' `grep "带宽监控" -rl ./feeds/luci/applications` 438 | sed -i 's/"Argon 主题设置"/"Argon设置"/g' `grep "Argon 主题设置" -rl ./feeds/luci/applications` 439 | ./scripts/feeds update -a 440 | ./scripts/feeds install -a > /dev/null 2>&1 441 | ./scripts/feeds install -a 442 | [[ -e ${Home}/config_bf ]] && { 443 | cp -rf ${Home}/config_bf ${Home}/.config 444 | } || { 445 | cp -rf ${Home}/build/${firmware}/.config ${Home}/.config 446 | } 447 | if [[ "${REGULAR_UPDATE}" == "true" ]]; then 448 | source build/$firmware/upgrade.sh && Diy_Part1 449 | fi 450 | if [[ `grep -c "CONFIG_PACKAGE_luci-theme-argon=y" ${Home}/.config` -eq '0' ]]; then 451 | echo -e "\nCONFIG_PACKAGE_luci-theme-argon=y" >> ${Home}/.config 452 | fi 453 | find . -name 'README' -o -name 'README.md' | xargs -i rm -rf {} 454 | find . -name 'CONTRIBUTED.md' -o -name 'README_EN.md' -o -name 'DEVICE_NAME' | xargs -i rm -rf {} 455 | [ "${Menuconfig}" == "YES" ] && { 456 | make menuconfig 457 | } 458 | echo 459 | TIME g "正在生成配置文件,请稍后..." 460 | echo 461 | source build/${firmware}/common.sh && Diy_chajian 462 | make defconfig 463 | ./scripts/diffconfig.sh > ${Home}/config_bf 464 | if [ -n "$(ls -A "${Home}/Chajianlibiao" 2>/dev/null)" ]; then 465 | clear 466 | echo 467 | echo 468 | echo 469 | chmod -R +x ${Home}/CHONGTU 470 | source ${Home}/CHONGTU 471 | rm -rf {CHONGTU,Chajianlibiao} 472 | echo 473 | TIME g "如需重新编译请按 Ctrl+c 结束此次编译,否则30秒后继续编译!" 474 | make defconfig > /dev/null 2>&1 475 | sleep 30s 476 | fi 477 | TARGET_BOARD="$(awk -F '[="]+' '/TARGET_BOARD/{print $2}' .config)" 478 | TARGET_SUBTARGET="$(awk -F '[="]+' '/TARGET_SUBTARGET/{print $2}' .config)" 479 | if [[ `grep -c "CONFIG_TARGET_x86_64=y" .config` -eq '1' ]]; then 480 | TARGET_PROFILE="x86-64" 481 | elif [[ `grep -c "CONFIG_TARGET.*DEVICE.*=y" .config` -eq '1' ]]; then 482 | TARGET_PROFILE="$(egrep -o "CONFIG_TARGET.*DEVICE.*=y" .config | sed -r 's/.*DEVICE_(.*)=y/\1/')" 483 | else 484 | TARGET_PROFILE="armvirt" 485 | fi 486 | if [ "${REGULAR_UPDATE}" == "true" ]; then 487 | source build/$firmware/upgrade.sh && Diy_Part2 488 | fi 489 | echo 490 | rm -rf ../{Lede_source,Lienol_source,Mortal_source,openwrt_amlogic} 491 | # 为编译做最后处理 492 | BY_INFORMATION="false" 493 | source build/${firmware}/common.sh && Diy_chuli 494 | COMFIRMWARE="openwrt/bin/targets/${TARGET_BOARD}/${TARGET_SUBTARGET}" 495 | TIME g "正在下载DL文件,请耐心等待..." 496 | make defconfig 497 | make -j8 download 2>&1 |tee build.log 498 | find dl -size -1024c -exec ls -l {} \; 499 | find dl -size -1024c -exec rm -f {} \; 500 | if [[ `grep -c "make with -j1 V=s or V=sc" build.log` -ge '1' ]]; then 501 | clear 502 | echo 503 | echo 504 | TIME g "下载DL失败,更换节点后再尝试下载?" 505 | read -p " [输入[ Y/y ]回车,退出下载,更换节点后按回车继续尝试下载DL]: " XZDL 506 | case $XZDL in 507 | [Yy]) 508 | exit 1 509 | echo 510 | ;; 511 | *) 512 | rm -rf build.log 513 | make -j8 download 2>&1 |tee build.log 514 | find dl -size -1024c -exec ls -l {} \; 515 | find dl -size -1024c -exec rm -f {} \; 516 | ;; 517 | esac 518 | fi 519 | if [[ `grep -c "make with -j1 V=s or V=sc" build.log` -ge '1' ]]; then 520 | clear 521 | echo 522 | echo 523 | TIME g "下载DL失败,继续更换节点后再尝试下载?" 524 | read -p " [输入[ Y/y ]回车,退出下载,更换节点后按回车继续尝试下载DL]: " XZDLE 525 | case $XZDLE in 526 | [Yy]) 527 | exit 1 528 | echo 529 | ;; 530 | *) 531 | rm -rf build.log 532 | make -j8 download 2>&1 |tee build.log 533 | find dl -size -1024c -exec ls -l {} \; 534 | find dl -size -1024c -exec rm -f {} \; 535 | ;; 536 | esac 537 | fi 538 | if [[ `grep -c "make with -j1 V=s or V=sc" build.log` -ge '1' ]]; then 539 | echo 540 | rm -rf build.log 541 | TIME r "下载DL失败,请检查网络或者更换节点后再尝试编译!" 542 | exit 1 543 | echo 544 | fi 545 | rm -rf build.log 546 | cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c > CPU 547 | cat /proc/cpuinfo | grep "cpu cores" | uniq >> CPU 548 | sed -i 's|[[:space:]]||g; s|^.||' CPU && sed -i 's|CPU||g; s|pucores:||' CPU 549 | CPUNAME="$(awk 'NR==1' CPU)" && CPUCORES="$(awk 'NR==2' CPU)" 550 | rm -rf CPU 551 | clear 552 | echo 553 | echo 554 | echo 555 | TIME g "您的CPU型号为[ ${CPUNAME} ]" 556 | echo 557 | echo 558 | TIME g "在Ubuntu使用核心数为[ ${CPUCORES} ],线程数为[ $(nproc) ]" 559 | echo 560 | echo 561 | if [[ "$(nproc)" == "1" ]]; then 562 | TIME y "正在使用[$(nproc)线程]编译固件,预计要[3.5]小时左右,请耐心等待..." 563 | elif [[ "$(nproc)" =~ (2|3) ]]; then 564 | TIME y "正在使用[$(nproc)线程]编译固件,预计要[3]小时左右,请耐心等待..." 565 | elif [[ "$(nproc)" =~ (4|5) ]]; then 566 | TIME y "正在使用[$(nproc)线程]编译固件,预计要[2.5]小时左右,请耐心等待..." 567 | elif [[ "$(nproc)" =~ (6|7) ]]; then 568 | TIME y "正在使用[$(nproc)线程]编译固件,预计要[2]小时左右,请耐心等待..." 569 | elif [[ "$(nproc)" =~ (8|9) ]]; then 570 | TIME y "正在使用[$(nproc)线程]编译固件,预计要[1.5]小时左右,请耐心等待..." 571 | else 572 | TIME y "正在使用[$(nproc)线程]编译固件,预计要[1]小时左右,请耐心等待..." 573 | fi 574 | sleep 15s 575 | make -j$(nproc) V=s 2>&1 |tee build.log 576 | 577 | if [ "$?" == "0" ]; then 578 | if [[ `ls ${COMFIRMWARE} | grep -c "openwrt"` -ge '1' ]] || [[ `ls ${COMFIRMWARE} | grep -c "immortalwrt"` -ge '1' ]]; then 579 | echo 580 | echo 581 | TIME r "编译失败,没发现固件存在~~!" 582 | echo 583 | TIME y "请不要使用桌面版ubuntu编译,或者您的翻墙网络有问题,油管或者是飞快,但是不能用于编译" 584 | sleep 5 585 | exit 1 586 | fi 587 | byend="1" 588 | End="$(date "+%Y/%m/%d-%H.%M")" 589 | rm -rf $Home/build.log 590 | clear 591 | echo 592 | echo 593 | echo 594 | [[ ${firmware} == "openwrt_amlogic" ]] && { 595 | TIME y "使用[ ${firmware} ]文件夹,编译[ N1和晶晨系列盒子专用固件 ]顺利编译完成~~~" 596 | } || { 597 | TIME y "使用[ ${firmware} ]文件夹,编译[ ${TARGET_PROFILE} ]顺利编译完成~~~" 598 | } 599 | echo 600 | TIME y "后台地址: $ip" 601 | echo 602 | TIME y "用户名: root" 603 | echo 604 | TIME y "密 码: 无" 605 | echo 606 | TIME g "开始时间:${Begin}" 607 | echo 608 | TIME g "结束时间:${End}" 609 | echo 610 | TIME y "固件已经存入${COMFIRMWARE}文件夹中" 611 | echo 612 | if [[ "${REGULAR_UPDATE}" == "true" ]]; then 613 | [ -f $Home/Openwrt.info ] && . $Home/Openwrt.info 614 | cp -Rf ${Home}/bin/targets/*/* ${Home}/upgrade 615 | source build/${firmware}/upgrade.sh && Diy_Part3 616 | TIME g "加入‘定时升级固件插件’的固件已经放入[bin/Firmware]文件夹中" 617 | echo 618 | fi 619 | if [[ $firmware == "openwrt_amlogic" ]]; then 620 | cp -Rf ${Home}/bin/targets/*/*/*.tar.gz ${Home}/openwrt-armvirt/ && sync 621 | TIME l "请输入一键打包命令进行打包固件,打包成功后,固件存放在[openwrt/out]文件夹中" 622 | fi 623 | echo 624 | cd ${Home}/bin/targets/${TARGET_BOARD}/${TARGET_SUBTARGET} 625 | rename -v "s/^openwrt/${date1}-${CODE}/" * > /dev/null 2>&1 626 | cd ${GITHUB_WORKSPACE} 627 | if [[ "${UPCOWTRANSFER}" == "true" ]]; then 628 | TIME g "正在上传固件至奶牛快传中,请稍后..." 629 | echo 630 | WETCOMFIRMWARE="${Home}/bin/targets/${TARGET_BOARD}/${TARGET_SUBTARGET}" 631 | mv ${WETCOMFIRMWARE}/packages ${Home}/bin/targets/${TARGET_BOARD}/packages 632 | ./transfer cow --block 2621440 -s -p 64 --no-progress ${WETCOMFIRMWARE} 2>&1 | tee cowtransfer.log > /dev/null 2>&1 633 | cow="$(cat cowtransfer.log | grep https | cut -f3 -d" ")" 634 | echo 635 | TIME y "奶牛快传:${cow}" 636 | echo "${cow}" > openwrt/bin/奶牛快传链接 637 | echo 638 | fi 639 | rm -rf $Home/Openwrt.info 640 | rm -rf ${Home}/upgrade 641 | rm -rf {transfer,cowtransfer.log,wetransfer.log} 642 | sleep 5 643 | exit 0 644 | else 645 | echo 646 | echo 647 | TIME r "编译失败~~!" 648 | echo 649 | TIME y "请用WinSCP工具连接ubuntu然后把openwrt文件夹里面的[build.log]文件拖至电脑上" 650 | echo 651 | TIME y "在电脑上查看build.log文件日志详情!" 652 | echo 653 | byend="1" 654 | sleep 5 655 | exit 1 656 | fi 657 | if [[ "${byend}" == "1" ]]; then 658 | sleep 5 659 | exit 0 660 | fi 661 | -------------------------------------------------------------------------------- /build/common/Custom/seedconfig.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | TIME() { 4 | [[ -z "$1" ]] && { 5 | echo -ne " " 6 | } || { 7 | case $1 in 8 | r) export Color="\e[31;1m";; 9 | g) export Color="\e[32;1m";; 10 | y) export Color="\e[33;1m";; 11 | z) export Color="\e[35;1m";; 12 | l) export Color="\e[36;1m";; 13 | esac 14 | [[ $# -lt 2 ]] && echo -e "\e[36m\e[0m ${1}" || { 15 | echo -e "\e[36m\e[0m ${Color}${2}\e[0m" 16 | } 17 | } 18 | } 19 | UbuntuName=`cat /etc/issue` 20 | XTName="Ubuntu" 21 | [[ $UbuntuName != *$XTName* ]] && { 22 | clear 23 | echo 24 | TIME y "请使用 Ubuntu 系统,推荐 Ubuntu 18 LTS 或 Ubuntu 20 LTS" 25 | echo 26 | exit 1 27 | } 28 | [[ ! -e .compile ]] && { 29 | clear 30 | echo 31 | echo 32 | echo 33 | TIME l "|*******************************************|" 34 | TIME z "| 欢迎使用一键提取.config配置程序 |" 35 | TIME g "| |" 36 | TIME y "| 请输入Ubuntu密码继续下一步, 环境部署 |" 37 | TIME r "|*******************************************|" 38 | sleep 2s 39 | sudo apt-get update -y 40 | sudo apt-get full-upgrade -y 41 | sudo apt-get install -y build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 lib32stdc++6 subversion flex uglifyjs 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 42 | [[ $? -ne 0 ]] && { 43 | clear 44 | echo 45 | TIME r "环境部署失败,请检测网络或更换节点再尝试!" 46 | exit 1 47 | } || { 48 | sudo apt-get clean 49 | sudo timedatectl set-timezone Asia/Shanghai 50 | echo "compile" > .compile 51 | } 52 | } 53 | clear 54 | echo 55 | echo 56 | echo 57 | TIME l " 1. Lede_5.4内核,LUCI 18.06版本" 58 | echo 59 | TIME l " 2. Lienol_4.14内核,LUCI 19.07版本" 60 | echo 61 | TIME l " 3. Immortalwrt_5.4内核,LUCI 21.02版本" 62 | echo 63 | TIME l " 4. N1和晶晨系列CPU盒子专用" 64 | echo 65 | TIME l " 5. 退出编译程序" 66 | echo 67 | echo 68 | echo 69 | while :; do 70 | TIME z "友情提示:本脚本提取的.config为我仓库云编译脚本专用,请正确选择对应源码!" 71 | echo 72 | echo 73 | TIME g "请选择编译源码,提取对应的配置文件,输入[ 1、2、3、4、5 ]然后回车确认您的选择!" 74 | echo 75 | read -p " 输入您的选择: " CHOOSE 76 | case $CHOOSE in 77 | 1) 78 | REPO_URL="https://github.com/coolsnowwolf/lede" 79 | REPO_BRANCH="master" 80 | CONFIG="Lede_5.4内核,LUCI 18.06版本" 81 | echo 82 | TIME y "您选择了:${CONFIG}" 83 | echo 84 | TIME y "请耐心等待程序运行至窗口弹出进行机型和插件配置" 85 | break 86 | ;; 87 | 2) 88 | REPO_URL="https://github.com/Lienol/openwrt" 89 | REPO_BRANCH="19.07" 90 | CONFIG="Lienol_4.14内核,LUCI 19.07版本" 91 | echo 92 | TIME y "您选择了:${CONFIG}" 93 | echo 94 | TIME y "请耐心等待程序运行至窗口弹出进行机型和插件配置" 95 | break 96 | ;; 97 | 3) 98 | REPO_URL="https://github.com/immortalwrt/immortalwrt" 99 | REPO_BRANCH="openwrt-21.02" 100 | CONFIG="Immortalwrt_5.4内核,LUCI 21.02版本" 101 | echo 102 | TIME y "您选择了:${CONFIG}" 103 | echo 104 | TIME y "请耐心等待程序运行至窗口弹出进行机型和插件配置" 105 | break 106 | ;; 107 | 4) 108 | REPO_URL="https://github.com/coolsnowwolf/lede" 109 | REPO_BRANCH="master" 110 | firmware="openwrt_amlogic" 111 | CONFIG="N1和晶晨系列CPU盒子专用源码" 112 | echo 113 | TIME y "您选择了:${CONFIG}" 114 | echo 115 | TIME y "请耐心等待程序运行至窗口弹出进行机型和插件配置" 116 | break 117 | ;; 118 | 5) 119 | rm -rf seedconfig.sh 120 | TIME r "您选择了退出编译程序" 121 | exit 0 122 | break 123 | ;; 124 | *) 125 | TIME r "警告:输入错误,请输入正确的编号" 126 | ;; 127 | esac 128 | done 129 | echo 130 | echo 131 | TIME g "正在下载源码和同步Github脚本的插件,请耐心等候~~~" 132 | echo 133 | rm -rf seedconfig && git clone -b "$REPO_BRANCH" --single-branch "$REPO_URL" seedconfig 134 | [[ $? -ne 0 ]] && { 135 | echo 136 | TIME r "源码下载失败,请检测网络或更换节点!" 137 | echo 138 | exit 1 139 | } 140 | Home="$PWD/seedconfig" 141 | cd $Home 142 | ./scripts/feeds update -a > /dev/null 2>&1 143 | git clone -b "$REPO_BRANCH" --single-branch https://github.com/281677160/openwrt-package 144 | [[ $? -ne 0 ]] && { 145 | echo 146 | rm -rf ../seedconfig.sh 147 | rm -rf ../seedconfig 148 | TIME r "插件下载失败,请检测网络或更换节点再尝试!" 149 | echo 150 | exit 1 151 | } || { 152 | cp -Rf openwrt-package/* "${Home}" && rm -rf ${Home}/openwrt-package 153 | } 154 | svn co https://github.com/fw876/helloworld/trunk/luci-app-ssr-plus package/luci-app-ssr-plus > /dev/null 2>&1 155 | [[ $? -ne 0 ]] && { 156 | echo 157 | rm -rf ../seedconfig.sh 158 | rm -rf ../seedconfig 159 | TIME r "luci-app-ssr-plus下载失败,请检测网络或更换节点再尝试!" 160 | echo 161 | exit 1 162 | } 163 | svn co https://github.com/xiaorouji/openwrt-passwall/trunk/luci-app-passwall package/luci-app-passwall > /dev/null 2>&1 164 | [[ $? -ne 0 ]] && { 165 | echo 166 | rm -rf ../seedconfig.sh 167 | rm -rf ../seedconfig 168 | TIME r "luci-app-passwall下载失败,请检测网络或更换节点再尝试!" 169 | echo 170 | exit 1 171 | } 172 | ./scripts/feeds update -a 173 | ./scripts/feeds install -a 174 | [[ $firmware == "openwrt_amlogic" ]] && { 175 | cat >.config <<-EOF 176 | CONFIG_TARGET_armvirt=y 177 | CONFIG_TARGET_armvirt_64=y 178 | CONFIG_TARGET_armvirt_64_Default=y 179 | CONFIG_PACKAGE_luci-app-amlogic=y 180 | EOF 181 | } 182 | make menuconfig 183 | make defconfig 184 | ./scripts/diffconfig.sh > ../config.txt 185 | clear 186 | echo 187 | echo 188 | echo 189 | TIME y "[ ${CONFIG} ]的.config配置文件提取工作完成!" 190 | echo 191 | TIME g "请用WinSCP工具连接你的ubuntu,在ubuntu根目录有一份config.txt文件。" 192 | echo 193 | TIME g "把config.txt文件内容全选复制,然后覆盖对应机型.config里面原来的内容就可以了!" 194 | echo 195 | TIME g "或者可以使用 cat config.txt 命令来查看!" 196 | echo 197 | echo 198 | echo 199 | rm -rf ../seedconfig.sh 200 | rm -rf ../seedconfig 201 | 202 | exit 0 203 | -------------------------------------------------------------------------------- /build/common/LEDE/diy/README: -------------------------------------------------------------------------------- 1 | 替换文件用的文件夹,按照源码路径替换 2 | 替换文件有两个方法 3 | 1、在这里按 Add file 然后选 Create new file 然后要替换文件的路径跟名字,下面大方框粘贴内容,然后最下面绿色按钮保存 4 | 比如替换banner,在源码的路径是‘package/base-files/files/etc/banner’,按 Add file 然后选 Create new file,粘贴这个路径,下面大方框粘贴内容,然后最下面绿色按钮保存完成 5 | 6 | 2、在这里按 Create new file 然后选择 Upload files 然后把在你电脑上按文件夹路径跟名字制作好的文件拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 7 | 比如替换banner,在电脑创建package文件夹,package文件夹里面创建base-files文件夹,base-files文件夹里面创建files文件夹,files文件夹里面创建etc文件夹, 8 | 在etc文件夹创建banner.txt的文本文档,设置好内容,然后把.txt后缀去掉就是banner了,然后把你创建package文件夹拖进来,等文件传输完毕,然后按最下绿色按钮保存就可以了 9 | -------------------------------------------------------------------------------- /build/common/LEDE/diy/package/base-files/files/lib/upgrade/keep.d/base-files-essential: -------------------------------------------------------------------------------- 1 | # Essential files that will be always kept 2 | /etc/hosts 3 | /etc/inittab 4 | /etc/group 5 | /etc/passwd 6 | /etc/profile 7 | /etc/shadow 8 | /etc/shells 9 | /etc/shinit 10 | /etc/sysctl.conf 11 | /etc/rc.local 12 | /mnt/network 13 | /etc/docker/daemon.json 14 | /etc/docker/key.json 15 | /etc/config/AdGuardHome.yaml 16 | -------------------------------------------------------------------------------- /build/common/LEDE/files/README: -------------------------------------------------------------------------------- 1 | 替换openwrt设置文件的文件夹,设置好openwrt后 2 | 记住这个不是源码文件,是源码编译好固件后的openwrt,安装好后,设置好后,openwrt里面etc 3 | 用WinSCP(文件协议F选择SCP)连接openwrt,找到etc文件夹,里面就是openwrt的所有设置文件 4 | 5 | 6 | 1、在这里按 Add file 然后选 Create new file 然后要替换文件的路径跟名字,下面大方框粘贴补丁内容,然后最下面绿色按钮保存 7 | 比如替换smartdns,在openwrt的路径是‘etc/config/smartdns’,按 Add file 然后选 Create new file,粘贴这个路径,下面大方框粘贴补丁内容,然后最下面绿色按钮保存完成 8 | 这个上替换单个文件方便,如果文件很多就比较麻烦,用下面的方法更好,就比如smartdns就有4个设置文件,不过一般都只用etc/config/smartdns的就是 9 | 10 | 2、在这里按 Create new file 然后选择 Upload files 然后把openwrt的对应路径制作好的etc文件夹,拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 11 | 比如替换smartdns,在电脑创建etc文件夹,etc文件夹里面创建config文件夹,然后在WinSCP里面etc/config里面的smartdns拖进来,上面说到smartdns有4个设置文件, 12 | 就在etc文件夹里面还有一个smartdns文件夹的,里面有三个设置文件,你把WinSCP里etc里面的smartdns文件夹直接拖到在你电脑创建的etc文件夹里面就好了 13 | 这样你在电脑创建的etc文件夹里面就有两个文件夹,一个config文件夹放着一个smartdns文件,一个smartdns文件夹里面放着address.conf、blacklist-ip.conf、custom.con三个设置文件 14 | 然后在这里按 Create new file 然后选择 Upload files 然后把在你电脑上etc文件夹拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 -------------------------------------------------------------------------------- /build/common/LEDE/patches/README: -------------------------------------------------------------------------------- 1 | 存放制作好的补丁文件 2 | 存放补丁有两种方法 3 | 1、在这里按 Add file 然后选 Create new file 然后补丁名字,下面大方框粘贴补丁内容,然后最下面绿色按钮保存 4 | 2、在这里按 Create new file 然后选择 Upload files 然后把在你电脑上的补丁文件拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 5 | -------------------------------------------------------------------------------- /build/common/LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /build/common/LIENOL/diy/README: -------------------------------------------------------------------------------- 1 | 替换文件用的文件夹,按照源码路径替换 2 | 替换文件有两个方法 3 | 1、在这里按 Add file 然后选 Create new file 然后要替换文件的路径跟名字,下面大方框粘贴内容,然后最下面绿色按钮保存 4 | 比如替换banner,在源码的路径是‘package/base-files/files/etc/banner’,按 Add file 然后选 Create new file,粘贴这个路径,下面大方框粘贴内容,然后最下面绿色按钮保存完成 5 | 6 | 2、在这里按 Create new file 然后选择 Upload files 然后把在你电脑上按文件夹路径跟名字制作好的文件拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 7 | 比如替换banner,在电脑创建package文件夹,package文件夹里面创建base-files文件夹,base-files文件夹里面创建files文件夹,files文件夹里面创建etc文件夹, 8 | 在etc文件夹创建banner.txt的文本文档,设置好内容,然后把.txt后缀去掉就是banner了,然后把你创建package文件夹拖进来,等文件传输完毕,然后按最下绿色按钮保存就可以了 9 | -------------------------------------------------------------------------------- /build/common/LIENOL/diy/package/base-files/files/etc/profile: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export White="\e[0m" 4 | export Yellow="\e[33;1m" 5 | export Red="\e[31m;1m" 6 | export Blue="\033[1;34m" 7 | export Skyb="\e[36;1m" 8 | 9 | clear 10 | [ -e /tmp/.failsafe ] && export FAILSAFE=1 11 | [ -f /etc/banner ] && { 12 | echo -e "$Blue" 13 | cat /etc/banner 14 | echo -e "$White" 15 | } 16 | [ -n "$FAILSAFE" ] && { 17 | echo -e "$Yellow" 18 | cat /etc/banner.failsafe 19 | echo -e "$White" 20 | } 21 | 22 | fgrep -sq '/ overlay ro,' /proc/mounts && { 23 | echo 'Your JFFS2-partition seems full and overlayfs is mounted read-only.' 24 | echo 'Please try to remove files from /overlay/upper/... and reboot!' 25 | } 26 | 27 | export PATH="/usr/sbin:/usr/bin:/sbin:/bin" 28 | export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6) 29 | export HOME=${HOME:-/root} 30 | export PS1='\u@\h:\w\$ ' 31 | 32 | case "$TERM" in 33 | xterm*|rxvt*) 34 | export PS1='\[\e]0;\u@\h: \w\a\]'$PS1 35 | ;; 36 | esac 37 | 38 | [ -x /bin/more ] || alias more=less 39 | [ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi 40 | 41 | alias ll='ls -alF --color=auto' 42 | 43 | [ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc 44 | 45 | [ -x /usr/bin/arp -o -x /sbin/arp ] || arp() { cat /proc/net/arp; } 46 | [ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; } 47 | 48 | [ -n "$FAILSAFE" ] || { 49 | for FILE in /etc/profile.d/*.sh; do 50 | [ -e "$FILE" ] && . "$FILE" 51 | done 52 | unset FILE 53 | } 54 | 55 | if ( grep -qs '^root::' /etc/shadow && \ 56 | [ -z "$FAILSAFE" ] ) 57 | then 58 | cat << EOF 59 | EOF 60 | fi 61 | 62 | service() { 63 | [ -f "/etc/init.d/$1" ] || { 64 | echo "service "'"'"$1"'"'" not found, the following services are available:" 65 | ls "/etc/init.d" 66 | return 1 67 | } 68 | /etc/init.d/$@ 69 | } 70 | -------------------------------------------------------------------------------- /build/common/LIENOL/diy/package/base-files/files/etc/webweb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sed -i '/DISTRIB_REVISION/d' /etc/openwrt_release 4 | echo "DISTRIB_REVISION='Lienol-19.07'" >> /etc/openwrt_release 5 | 6 | sed -i 's/<%=pcdata(ver.distversion)%>/<%=pcdata(ver.distversion)%>/g' /usr/lib/lua/luci/view/admin_status/index.htm 8 | 9 | sed -i 's/)<\/a> \//luciversion %>)<\/a> \/-->/g' /usr/lib/lua/luci/view/themes/*/footer.htm 11 | 12 | [[ ! -f /mnt/network ]] && chmod +x /etc/networkip && source /etc/networkip 13 | 14 | cp -Rf /etc/config/network /mnt/network 15 | 16 | echo "0 1 * * 1 rm /tmp/luci-indexcache > /dev/null 2>&1" >> /etc/crontabs/root 17 | 18 | if [[ `grep -c "x86_64" /etc/openwrt_release` -eq '0' ]]; then 19 | source /etc/openwrt_release 20 | sed -i "s/x86_64/${DISTRIB_TARGET}/g" /etc/banner 21 | fi 22 | 23 | if [[ -e /usr/share/AdGuardHome ]] && [[ -e /etc/init.d/AdGuardHome ]]; then 24 | chmod -R +x /usr/share/AdGuardHome /etc/init.d/AdGuardHome 25 | fi 26 | 27 | chmod -R +x /etc/init.d /usr/share 28 | 29 | /etc/init.d/uhttpd restart 30 | 31 | rm -rf /etc/networkip 32 | rm -rf /etc/webweb.sh 33 | exit 0 34 | -------------------------------------------------------------------------------- /build/common/LIENOL/diy/package/base-files/files/lib/upgrade/keep.d/base-files-essential: -------------------------------------------------------------------------------- 1 | # Essential files that will be always kept 2 | /etc/hosts 3 | /etc/inittab 4 | /etc/group 5 | /etc/passwd 6 | /etc/profile 7 | /etc/shadow 8 | /etc/shells 9 | /etc/shinit 10 | /etc/sysctl.conf 11 | /etc/rc.local 12 | /mnt/network 13 | /etc/docker/daemon.json 14 | /etc/docker/key.json 15 | /etc/config/AdGuardHome.yaml 16 | -------------------------------------------------------------------------------- /build/common/LIENOL/files/README: -------------------------------------------------------------------------------- 1 | 替换openwrt设置文件的文件夹,设置好openwrt后 2 | 记住这个不是源码文件,是源码编译好固件后的openwrt,安装好后,设置好后,openwrt里面etc 3 | 用WinSCP(文件协议F选择SCP)连接openwrt,找到etc文件夹,里面就是openwrt的所有设置文件 4 | 5 | 6 | 1、在这里按 Add file 然后选 Create new file 然后要替换文件的路径跟名字,下面大方框粘贴补丁内容,然后最下面绿色按钮保存 7 | 比如替换smartdns,在openwrt的路径是‘etc/config/smartdns’,按 Add file 然后选 Create new file,粘贴这个路径,下面大方框粘贴补丁内容,然后最下面绿色按钮保存完成 8 | 这个上替换单个文件方便,如果文件很多就比较麻烦,用下面的方法更好,就比如smartdns就有4个设置文件,不过一般都只用etc/config/smartdns的就是 9 | 10 | 2、在这里按 Create new file 然后选择 Upload files 然后把openwrt的对应路径制作好的etc文件夹,拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 11 | 比如替换smartdns,在电脑创建etc文件夹,etc文件夹里面创建config文件夹,然后在WinSCP里面etc/config里面的smartdns拖进来,上面说到smartdns有4个设置文件, 12 | 就在etc文件夹里面还有一个smartdns文件夹的,里面有三个设置文件,你把WinSCP里etc里面的smartdns文件夹直接拖到在你电脑创建的etc文件夹里面就好了 13 | 这样你在电脑创建的etc文件夹里面就有两个文件夹,一个config文件夹放着一个smartdns文件,一个smartdns文件夹里面放着address.conf、blacklist-ip.conf、custom.con三个设置文件 14 | 然后在这里按 Create new file 然后选择 Upload files 然后把在你电脑上etc文件夹拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 -------------------------------------------------------------------------------- /build/common/LIENOL/patches/README: -------------------------------------------------------------------------------- 1 | 存放制作好的补丁文件 2 | 存放补丁有两种方法 3 | 1、在这里按 Add file 然后选 Create new file 然后补丁名字,下面大方框粘贴补丁内容,然后最下面绿色按钮保存 4 | 2、在这里按 Create new file 然后选择 Upload files 然后把在你电脑上的补丁文件拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 5 | -------------------------------------------------------------------------------- /build/common/MORTAL/diy/README: -------------------------------------------------------------------------------- 1 | 替换文件用的文件夹,按照源码路径替换 2 | 替换文件有两个方法 3 | 1、在这里按 Add file 然后选 Create new file 然后要替换文件的路径跟名字,下面大方框粘贴内容,然后最下面绿色按钮保存 4 | 比如替换banner,在源码的路径是‘package/base-files/files/etc/banner’,按 Add file 然后选 Create new file,粘贴这个路径,下面大方框粘贴内容,然后最下面绿色按钮保存完成 5 | 6 | 2、在这里按 Create new file 然后选择 Upload files 然后把在你电脑上按文件夹路径跟名字制作好的文件拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 7 | 比如替换banner,在电脑创建package文件夹,package文件夹里面创建base-files文件夹,base-files文件夹里面创建files文件夹,files文件夹里面创建etc文件夹, 8 | 在etc文件夹创建banner.txt的文本文档,设置好内容,然后把.txt后缀去掉就是banner了,然后把你创建package文件夹拖进来,等文件传输完毕,然后按最下绿色按钮保存就可以了 9 | -------------------------------------------------------------------------------- /build/common/MORTAL/diy/package/base-files/files/etc/profile: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export White="\e[0m" 4 | export Yellow="\e[33;1m" 5 | export Red="\e[31m;1m" 6 | export Blue="\033[1;34m" 7 | export Skyb="\e[36;1m" 8 | 9 | clear 10 | [ -e /tmp/.failsafe ] && export FAILSAFE=1 11 | [ -f /etc/banner ] && { 12 | echo -e "$Blue" 13 | cat /etc/banner 14 | echo -e "$White" 15 | } 16 | [ -n "$FAILSAFE" ] && { 17 | echo -e "$Yellow" 18 | cat /etc/banner.failsafe 19 | echo -e "$White" 20 | } 21 | 22 | fgrep -sq '/ overlay ro,' /proc/mounts && { 23 | echo 'Your JFFS2-partition seems full and overlayfs is mounted read-only.' 24 | echo 'Please try to remove files from /overlay/upper/... and reboot!' 25 | } 26 | 27 | export PATH="/usr/sbin:/usr/bin:/sbin:/bin" 28 | export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6) 29 | export HOME=${HOME:-/root} 30 | export PS1='\u@\h:\w\$ ' 31 | 32 | case "$TERM" in 33 | xterm*|rxvt*) 34 | export PS1='\[\e]0;\u@\h: \w\a\]'$PS1 35 | ;; 36 | esac 37 | 38 | [ -x /bin/more ] || alias more=less 39 | [ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi 40 | 41 | alias ll='ls -alF --color=auto' 42 | 43 | [ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc 44 | 45 | [ -x /usr/bin/arp -o -x /sbin/arp ] || arp() { cat /proc/net/arp; } 46 | [ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; } 47 | 48 | [ -n "$FAILSAFE" ] || { 49 | for FILE in /etc/profile.d/*.sh; do 50 | [ -e "$FILE" ] && . "$FILE" 51 | done 52 | unset FILE 53 | } 54 | 55 | if ( grep -qs '^root::' /etc/shadow && \ 56 | [ -z "$FAILSAFE" ] ) 57 | then 58 | cat << EOF 59 | EOF 60 | fi 61 | 62 | service() { 63 | [ -f "/etc/init.d/$1" ] || { 64 | echo "service "'"'"$1"'"'" not found, the following services are available:" 65 | ls "/etc/init.d" 66 | return 1 67 | } 68 | /etc/init.d/$@ 69 | } 70 | -------------------------------------------------------------------------------- /build/common/MORTAL/diy/package/base-files/files/etc/webweb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sed -i 's/)<\/a> \//luciversion %>)<\/a> \/-->/g' /usr/lib/lua/luci/view/themes/*/footer.htm 5 | 6 | [[ ! -f /mnt/network ]] && chmod +x /etc/networkip && source /etc/networkip 7 | 8 | cp -Rf /etc/config/network /mnt/network 9 | 10 | if [[ `grep -c "x86_64" /etc/openwrt_release` -eq '0' ]]; then 11 | source /etc/openwrt_release 12 | sed -i "s/x86_64/${DISTRIB_TARGET}/g" /etc/banner 13 | fi 14 | 15 | echo "0 1 * * 1 rm /tmp/luci-indexcache > /dev/null 2>&1" >> /etc/crontabs/root 16 | 17 | if [[ -e /usr/share/AdGuardHome ]] && [[ -e /etc/init.d/AdGuardHome ]]; then 18 | chmod -R +x /usr/share/AdGuardHome /etc/init.d/AdGuardHome 19 | fi 20 | 21 | chmod -R +x /etc/init.d /usr/share 22 | 23 | rm -rf /etc/networkip 24 | rm -rf /etc/webweb.sh 25 | exit 0 26 | -------------------------------------------------------------------------------- /build/common/MORTAL/diy/package/base-files/files/lib/upgrade/keep.d/base-files-essential: -------------------------------------------------------------------------------- 1 | # Essential files that will be always kept 2 | /etc/hosts 3 | /etc/inittab 4 | /etc/group 5 | /etc/passwd 6 | /etc/profile 7 | /etc/shadow 8 | /etc/shells 9 | /etc/shinit 10 | /etc/sysctl.conf 11 | /etc/rc.local 12 | /mnt/network 13 | /etc/docker/daemon.json 14 | /etc/docker/key.json 15 | /etc/AdGuardHome.yaml 16 | -------------------------------------------------------------------------------- /build/common/MORTAL/files/README: -------------------------------------------------------------------------------- 1 | 替换openwrt设置文件的文件夹,设置好openwrt后 2 | 记住这个不是源码文件,是源码编译好固件后的openwrt,安装好后,设置好后,openwrt里面etc 3 | 用WinSCP(文件协议F选择SCP)连接openwrt,找到etc文件夹,里面就是openwrt的所有设置文件 4 | 5 | 6 | 1、在这里按 Add file 然后选 Create new file 然后要替换文件的路径跟名字,下面大方框粘贴补丁内容,然后最下面绿色按钮保存 7 | 比如替换smartdns,在openwrt的路径是‘etc/config/smartdns’,按 Add file 然后选 Create new file,粘贴这个路径,下面大方框粘贴补丁内容,然后最下面绿色按钮保存完成 8 | 这个上替换单个文件方便,如果文件很多就比较麻烦,用下面的方法更好,就比如smartdns就有4个设置文件,不过一般都只用etc/config/smartdns的就是 9 | 10 | 2、在这里按 Create new file 然后选择 Upload files 然后把openwrt的对应路径制作好的etc文件夹,拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 11 | 比如替换smartdns,在电脑创建etc文件夹,etc文件夹里面创建config文件夹,然后在WinSCP里面etc/config里面的smartdns拖进来,上面说到smartdns有4个设置文件, 12 | 就在etc文件夹里面还有一个smartdns文件夹的,里面有三个设置文件,你把WinSCP里etc里面的smartdns文件夹直接拖到在你电脑创建的etc文件夹里面就好了 13 | 这样你在电脑创建的etc文件夹里面就有两个文件夹,一个config文件夹放着一个smartdns文件,一个smartdns文件夹里面放着address.conf、blacklist-ip.conf、custom.con三个设置文件 14 | 然后在这里按 Create new file 然后选择 Upload files 然后把在你电脑上etc文件夹拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 -------------------------------------------------------------------------------- /build/common/MORTAL/patches/README: -------------------------------------------------------------------------------- 1 | 存放制作好的补丁文件 2 | 存放补丁有两种方法 3 | 1、在这里按 Add file 然后选 Create new file 然后补丁名字,下面大方框粘贴补丁内容,然后最下面绿色按钮保存 4 | 2、在这里按 Create new file 然后选择 Upload files 然后把在你电脑上的补丁文件拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 5 | -------------------------------------------------------------------------------- /build/common/README.md: -------------------------------------------------------------------------------- 1 | # common 2 | -------------------------------------------------------------------------------- /build/common/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # https://github.com/gd0772/AutoBuild-OpenWrt 3 | # common Module by gd772 4 | # matrix.target=${Modelfile} 5 | 6 | TIME() { 7 | Compte=$(date +%Y年%m月%d号%H时%M分) 8 | [[ -z "$1" ]] && { 9 | echo -ne " " 10 | } || { 11 | case $1 in 12 | r) export Color="\e[31m";; 13 | g) export Color="\e[32m";; 14 | b) export Color="\e[34m";; 15 | y) export Color="\e[33m";; 16 | z) export Color="\e[35m";; 17 | l) export Color="\e[36m";; 18 | esac 19 | [[ $# -lt 2 ]] && echo -e "\e[36m\e[0m ${1}" || { 20 | echo -e "\e[36m\e[0m ${Color}${2}\e[0m" 21 | } 22 | } 23 | } 24 | 25 | ################################################################################################################ 26 | # LEDE源码通用diy.sh文件 27 | ################################################################################################################ 28 | Diy_lede() { 29 | 30 | if [[ ! "${Modelfile}" == "openwrt_amlogic" ]]; then 31 | sed -i '/IMAGES_GZIP/d' "${PATH1}/${CONFIG_FILE}" > /dev/null 2>&1 32 | echo -e "\nCONFIG_TARGET_IMAGES_GZIP=y" >> "${PATH1}/${CONFIG_FILE}" 33 | fi 34 | if [[ "${Modelfile}" == "openwrt_amlogic" ]]; then 35 | 36 | # luci-app-cpufreq修改一些代码适配amlogic 37 | sed -i 's/LUCI_DEPENDS.*/LUCI_DEPENDS:=\@\(arm\|\|aarch64\)/g' feeds/luci/applications/luci-app-cpufreq/Makefile 38 | 39 | fi 40 | } 41 | 42 | 43 | ################################################################################################################ 44 | # LIENOL源码通用diy.sh文件 45 | ################################################################################################################ 46 | Diy_lienol() { 47 | 48 | find . -name 'luci-app-netdata' -o -name 'netdata' -o -name 'luci-theme-argon' | xargs -i rm -rf {} 49 | find . -name 'ddns-scripts_aliyun' -o -name 'ddns-scripts_dnspod' -o -name 'luci-app-wol' | xargs -i rm -rf {} 50 | find . -name 'luci-app-wrtbwmon' -o -name 'wrtbwmon' -o -name 'pdnsd-alt' | xargs -i rm -rf {} 51 | rm -rf feeds/packages/libs/libcap 52 | } 53 | 54 | 55 | ################################################################################################################ 56 | # 天灵源码18.06 diy.sh文件 57 | ################################################################################################################ 58 | Diy_mortal() { 59 | 60 | find . -name 'luci-app-argon-config' -o -name 'luci-theme-argon' -o -name 'luci-light' | xargs -i rm -rf {} 61 | find . -name 'luci-app-netdata' -o -name 'netdata' -o -name 'luci-theme-openwrt' -o -name 'luci-app-cifs' | xargs -i rm -rf {} 62 | find . -name 'luci-app-wrtbwmon' -o -name 'wrtbwmon' | xargs -i rm -rf {} 63 | } 64 | 65 | 66 | ################################################################################################################ 67 | # 全部作者源码公共diy.sh文件 68 | ################################################################################################################ 69 | Diy_all() { 70 | 71 | if [[ ${REGULAR_UPDATE} == "true" ]]; then 72 | git clone https://github.com/gd0772/luci-app-autoupdate feeds/luci/applications/luci-app-autoupdate 73 | cp -Rf "${PATH1}"/{AutoUpdate.sh,replace.sh} package/base-files/files/bin 74 | sed -i 's/"定时更新"/"更新固件"/g' feeds/luci/applications/luci-app-autoupdate/po/zh-cn/autoupdate.po 75 | sed -i 's/定时更新 LUCI/固件更新 LUCI/g' feeds/luci/applications/luci-app-autoupdate/po/zh-cn/autoupdate.po 76 | fi 77 | if [[ "${REPO_BRANCH}" == "master" ]]; then 78 | cp -Rf "${Home}"/build/common/LEDE/files "${Home}" 79 | cp -Rf "${Home}"/build/common/LEDE/diy/* "${Home}" 80 | cp -Rf "${Home}"/build/common/LEDE/patches/* "${PATH1}/patches" 81 | elif [[ "${REPO_BRANCH}" == "19.07" ]]; then 82 | cp -Rf "${Home}"/build/common/LIENOL/files "${Home}" 83 | cp -Rf "${Home}"/build/common/LIENOL/diy/* "${Home}" 84 | cp -Rf "${Home}"/build/common/LIENOL/patches/* "${PATH1}/patches" 85 | elif [[ "${REPO_BRANCH}" == "openwrt-18.06" ]]; then 86 | cp -Rf "${Home}"/build/common/MORTAL/files "${Home}" 87 | cp -Rf "${Home}"/build/common/MORTAL/diy/* "${Home}" 88 | cp -Rf "${Home}"/build/common/MORTAL/patches/* "${PATH1}/patches" 89 | 90 | fi 91 | if [ -n "$(ls -A "${PATH1}/diy" 2>/dev/null)" ]; then 92 | cp -Rf "${PATH1}"/diy/* "${Home}" 93 | fi 94 | if [ -n "$(ls -A "${PATH1}/files" 2>/dev/null)" ]; then 95 | cp -Rf "${PATH1}/files" "${Home}" && chmod -R +x ${Home}/files 96 | fi 97 | if [ -n "$(ls -A "${PATH1}/patches" 2>/dev/null)" ]; then 98 | find "${PATH1}/patches" -type f -name '*.patch' -print0 | sort -z | xargs -I % -t -0 -n 1 sh -c "cat '%' | patch -d './' -p1 --forward --no-backup-if-mismatch" 99 | fi 100 | } 101 | 102 | ################################################################################################################ 103 | # s905x3_s905x2_s905x_s905d_s922x_s912 一键打包脚本 104 | ################################################################################################################ 105 | Diy_amlogic() { 106 | if [[ -n "$(ls -A "$GITHUB_WORKSPACE/amlogic_openwrt" 2>/dev/null)" ]]; then 107 | git clone https://github.com/mdtycl/amlogic-s905d 108 | # git clone https://github.com/ophub/amlogic-s9xxx-openwrt 109 | mv amlogic-s905d/{amlogic-s9xxx,make} $GITHUB_WORKSPACE 110 | rm -rf amlogic-s905d 111 | source $GITHUB_WORKSPACE/amlogic_openwrt 112 | if [[ ${amlogic_kernel} == "5.4.155" ]]; then 113 | curl -fsSL https://raw.githubusercontent.com/ophub/amlogic-s9xxx-openwrt/main/.github/workflows/build-openwrt-lede.yml > open.yml 114 | Make_kernel="$(cat open.yml | grep ./make | cut -d "k" -f3 | sed s/[[:space:]]//g)" 115 | amlogic_kernel="${Make_kernel}" 116 | else 117 | amlogic_kernel="${amlogic_kernel}" 118 | fi 119 | if [[ -z "${Make_kernel}" ]];then 120 | amlogic_kernel="5.4.155" 121 | fi 122 | mkdir -p $GITHUB_WORKSPACE/openwrt-armvirt 123 | cp -Rf ${Home}/bin/targets/*/*/*.tar.gz $GITHUB_WORKSPACE/openwrt-armvirt/ && sync 124 | sudo chmod +x make 125 | sudo ./make -d -b "${amlogic_model}" -k "${amlogic_kernel}" 126 | cp -Rf $GITHUB_WORKSPACE/out/* ${Home}/bin/targets/*/* 127 | else 128 | TIME r "缺少打包所需的组合文件,您或者把diy-part.sh组合代码删除了" 129 | fi 130 | } 131 | 132 | ################################################################################################################ 133 | # 判断脚本是否缺少主要文件(如果缺少settings.ini设置文件在检测脚本设置就运行错误了) 134 | ################################################################################################################ 135 | Diy_settings() { 136 | rm -rf ${Home}/build/QUEWENJIANerros 137 | if [ -z "$(ls -A "$PATH1/${CONFIG_FILE}" 2>/dev/null)" ]; then 138 | echo 139 | TIME r "错误提示:编译脚本缺少[${CONFIG_FILE}]名称的配置文件,请在[build/${Modelfile}]文件夹内补齐" 140 | echo "errors" > ${Home}/build/QUEWENJIANerros 141 | echo 142 | fi 143 | if [ -z "$(ls -A "$PATH1/${DIY_PART_SH}" 2>/dev/null)" ]; then 144 | echo 145 | TIME r "错误提示:编译脚本缺少[${DIY_PART_SH}]名称的自定义设置文件,请在[build/${Modelfile}]文件夹内补齐" 146 | echo "errors" > ${Home}/build/QUEWENJIANerros 147 | echo 148 | fi 149 | if [ -n "$(ls -A "${Home}/build/QUEWENJIANerros" 2>/dev/null)" ]; then 150 | rm -rf ${Home}/build/QUEWENJIANerros 151 | exit 1 152 | fi 153 | rm -rf {build,README.md} 154 | } 155 | 156 | 157 | ################################################################################################################ 158 | # 判断插件冲突 159 | ################################################################################################################ 160 | Diy_chajian() { 161 | echo 162 | make defconfig > /dev/null 2>&1 163 | echo "TIME b \" 插件冲突信息\"" > ${Home}/CHONGTU 164 | 165 | if [ -n "$(ls -A "${Home}/Chajianlibiao" 2>/dev/null)" ]; then 166 | echo "TIME y \" 插件冲突会导致编译失败,以上操作如非您所需,请关闭此次编译,重新开始编译,避开冲突重新选择插件\"" >>CHONGTU 167 | echo "TIME z \"\"" >>CHONGTU 168 | else 169 | rm -rf CHONGTU 170 | fi 171 | } 172 | 173 | 174 | ################################################################################################################ 175 | # 为编译做最后处理 176 | ################################################################################################################ 177 | Diy_chuli() { 178 | 179 | sed -i '$ s/exit 0$//' ${Home}/package/base-files/files/etc/rc.local 180 | echo ' 181 | /etc/init.d/network restart 182 | /etc/init.d/uhttpd restart 183 | exit 0 184 | ' >> ${Home}/package/base-files/files/etc/rc.local 185 | 186 | if [[ "${REPO_BRANCH}" == "19.07" ]]; then 187 | sed -i 's/PATCHVER:=4.9/PATCHVER:=4.14/g' target/linux/*/Makefile 188 | sed -i 's/PATCHVER:=4.19/PATCHVER:=4.14/g' target/linux/*/Makefile 189 | fi 190 | 191 | if [[ "${TARGET_BOARD}" == "x86" ]]; then 192 | cp -Rf "${Home}"/build/common/Custom/DRM-I915 target/linux/x86/DRM-I915 193 | for X in $(ls -1 target/linux/x86 | grep "config-"); do echo -e "\n$(cat target/linux/x86/DRM-I915)" >> target/linux/x86/${X}; done 194 | fi 195 | 196 | if [[ "${BY_INFORMATION}" == "true" ]]; then 197 | grep -i CONFIG_PACKAGE_luci-app .config | grep -v \# > Plug-in 198 | grep -i CONFIG_PACKAGE_luci-theme .config | grep -v \# >> Plug-in 199 | if [[ `grep -c "CONFIG_PACKAGE_luci-i18n-qbittorrent-zh-cn=y" ${Home}/.config` -eq '0' ]]; then 200 | if [[ `grep -c "luci-app-qbittorrent_static" ${Home}/Plug-in` -eq '1' ]]; then 201 | sed -i '/qbittorrent/d' Plug-in 202 | fi 203 | fi 204 | sed -i '/INCLUDE/d' Plug-in > /dev/null 2>&1 205 | sed -i '/=m/d' Plug-in > /dev/null 2>&1 206 | sed -i 's/CONFIG_PACKAGE_/、/g' Plug-in 207 | sed -i 's/=y/\"/g' Plug-in 208 | awk '$0=NR$0' Plug-in > Plug-2 209 | awk '{print " " $0}' Plug-2 > Plug-in 210 | sed -i "s/^/TIME g \"/g" Plug-in 211 | cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c > CPU 212 | cat /proc/cpuinfo | grep "cpu cores" | uniq >> CPU 213 | sed -i 's|[[:space:]]||g; s|^.||' CPU && sed -i 's|CPU||g; s|pucores:||' CPU 214 | CPUNAME="$(awk 'NR==1' CPU)" && CPUCORES="$(awk 'NR==2' CPU)" 215 | rm -rf CPU 216 | 217 | if [[ "${REPO_BRANCH}" == "openwrt-18.06" ]] || [[ "${REPO_BRANCH}" == "openwrt-21.02" ]]; then 218 | export KERNEL_PATC="" 219 | export KERNEL_PATC="$(egrep KERNEL_PATCHVER:=[0-9]+\.[0-9]+ ${Home}/target/linux/${TARGET_BOARD}/Makefile |cut -d "=" -f2)" 220 | [[ -z ${KERNEL_PATC} ]] && export KERNEL_PATC="$(egrep KERNEL_PATCHVER=[0-9]+\.[0-9]+ ${Home}/target/linux/${TARGET_BOARD}/Makefile |cut -d "=" -f2)" 221 | [[ -n ${KERNEL_PATC} ]] && export LINUX_KERNEL="$(egrep -o LINUX_KERNEL_HASH-${KERNEL_PATC}\.[0-9]+ ${Home}/include/kernel-version.mk |cut -d "-" -f2)" 222 | [[ -z ${LINUX_KERNEL} ]] && export LINUX_KERNEL="nono" 223 | else 224 | export KERNEL_PATC="" 225 | export KERNEL_PATC="$(egrep KERNEL_PATCHVER:=[0-9]+\.[0-9]+ ${Home}/target/linux/${TARGET_BOARD}/Makefile |cut -d "=" -f2)" 226 | [[ -z ${KERNEL_PATC} ]] && export KERNEL_PATC="$(egrep KERNEL_PATCHVER=[0-9]+\.[0-9]+ ${Home}/target/linux/${TARGET_BOARD}/Makefile |cut -d "=" -f2)" 227 | [[ -n ${KERNEL_PATC} ]] && export LINUX_KERNEL="$(egrep -o LINUX_KERNEL_HASH-${KERNEL_PATC}\.[0-9]+ ${Home}/include/kernel-${KERNEL_PATC} |cut -d "-" -f2)" 228 | [[ -z ${LINUX_KERNEL} ]] && export LINUX_KERNEL="nono" 229 | 230 | PATCHVER="unknown" 231 | fi 232 | if [[ ! "${PATCHVER}" == "unknown" ]]; then 233 | PATCHVER=$(egrep -o "${PATCHVER}.[0-9]+" ${Home}/include/kernel-version.mk) 234 | fi 235 | 236 | if [[ "${Modelfile}" == "openwrt_amlogic" ]]; then 237 | [[ -e $GITHUB_WORKSPACE/amlogic_openwrt ]] && source $GITHUB_WORKSPACE/amlogic_openwrt 238 | [[ "${amlogic_kernel}" == "5.4.155" ]] && { 239 | curl -fsSL https://raw.githubusercontent.com/mdtycl/amlogic-s905d/master/.github/workflows/build-openwrt-lede.yml > open.yml 240 | Make_ker="$(cat open.yml | grep ./make | cut -d "k" -f3 | sed s/[[:space:]]//g)" 241 | TARGET_kernel="${Make_ker}" 242 | TARGET_model="${amlogic_model}" 243 | } || { 244 | TARGET_kernel="${amlogic_kernel}" 245 | TARGET_model="${amlogic_model}" 246 | } 247 | fi 248 | fi 249 | rm -rf ${Home}/files/{README,README.md} 250 | } 251 | 252 | 253 | ################################################################################################################ 254 | # 编译信息 255 | ################################################################################################################ 256 | Diy_xinxi() { 257 | if [[ "${TARGET_PROFILE}" =~ (friendlyarm_nanopi-r2s|friendlyarm_nanopi-r4s|armvirt) ]]; then 258 | REGULAR_UPDATE="false" 259 | fi 260 | echo 261 | TIME b "编译源码: ${CODE}" 262 | TIME b "源码链接: ${REPO_URL}" 263 | TIME b "源码分支: ${REPO_BRANCH}" 264 | TIME b "源码作者: ${ZUOZHE}" 265 | TIME b "固件内核: ${LINUX_KERNEL}" 266 | TIME b "Luci版本: ${OpenWrt_name}" 267 | [[ "${Modelfile}" == "openwrt_amlogic" ]] && { 268 | TIME b "编译机型: ${TARGET_model}" 269 | TIME b "打包内核: ${TARGET_kernel}" 270 | } || { 271 | TIME b "编译机型: ${TARGET_PROFILE}" 272 | } 273 | TIME b "固件作者: ${Author}" 274 | TIME b "仓库地址: ${Github}" 275 | TIME b "启动编号: #${Run_number}(${CangKu}仓库第${Run_number}次启动[${Run_workflow}]工作流程)" 276 | TIME b "编译时间: ${Compte}" 277 | [[ "${Modelfile}" == "openwrt_amlogic" ]] && { 278 | TIME g "您当前使用【${Modelfile}】文件夹编译【${TARGET_model}】固件" 279 | } || { 280 | TIME g "您当前使用【${Modelfile}】文件夹编译【${TARGET_PROFILE}】固件" 281 | } 282 | echo 283 | 284 | if [[ ${UPLOAD_FIRMWARE} == "true" ]]; then 285 | TIME y "上传固件到github actions: 开启" 286 | else 287 | TIME r "上传固件到github actions: 关闭" 288 | fi 289 | if [[ ${UPLOAD_CONFIG} == "true" ]]; then 290 | TIME y "上传[.config]配置文件: 开启" 291 | else 292 | TIME r "上传[.config]配置文件: 关闭" 293 | fi 294 | if [[ ${UPLOAD_BIN_DIR} == "true" ]]; then 295 | TIME y "上传BIN文件夹: 开启" 296 | else 297 | TIME r "上传BIN文件夹: 关闭" 298 | fi 299 | if [[ ${UPLOAD_RELEASE} == "true" ]]; then 300 | TIME y "发布固件: 开启" 301 | else 302 | TIME r "发布固件: 关闭" 303 | fi 304 | if [[ ${SERVERCHAN_SCKEY} == "true" ]]; then 305 | TIME y "电报通知: 开启" 306 | else 307 | TIME r "电报通知: 关闭" 308 | fi 309 | if [[ ${SSH_ACTIONS} == "true" ]]; then 310 | TIME y "SSH远程连接: 开启" 311 | else 312 | TIME r "SSH远程连接: 关闭" 313 | fi 314 | if [[ ${BY_INFORMATION} == "true" ]]; then 315 | TIME y "编译信息显示: 开启" 316 | fi 317 | if [[ ${SSHYC} == "true" ]]; then 318 | TIME y "SSH远程连接临时开关: 开启" 319 | fi 320 | if [[ ${REGULAR_UPDATE} == "true" ]]; then 321 | TIME y "固件在线更新: 开启" 322 | else 323 | TIME r "固件在线更新: 关闭" 324 | fi 325 | if [[ ${REGULAR_UPDATE} == "true" ]]; then 326 | echo 327 | TIME l "固件在线更新信息" 328 | TIME z "插件版本: ${AutoUpdate_Version}" 329 | if [[ ${TARGET_PROFILE} == "x86-64" ]]; then 330 | TIME b "传统固件: ${Legacy_Firmware}" 331 | TIME b "UEFI固件: ${UEFI_Firmware}" 332 | TIME b "固件后缀: ${Firmware_sfx}" 333 | else 334 | TIME b "固件名称: ${Up_Firmware}" 335 | TIME b "固件后缀: ${Firmware_sfx}" 336 | fi 337 | TIME b "固件版本: ${Openwrt_Version}" 338 | TIME b "云端路径: ${Github_UP_RELEASE}" 339 | 340 | else 341 | echo 342 | fi 343 | echo 344 | TIME z " 文件系统 类型 容量 已用 可用 使用% 挂载点" 345 | cd ../ && df -hT $PWD && cd openwrt 346 | echo 347 | TIME z " 本编译 服务器的 CPU型号为 [ ${CPUNAME} ]" 348 | echo 349 | TIME z " 使用 核心数 为 [ ${CPUCORES} ], 线程数为 [ $(nproc) ]" 350 | echo 351 | TIME z " 随机分配到的 CPU性能, AMDEPYC776364(最快) > 8370C(快) > 8272CL(超时边缘) > 8171M(超时) > E5系列(建议放弃)" 352 | echo 353 | TIME z " 下面将使用 [ $(nproc) 线程 ] 编译固件" 354 | echo 355 | 356 | if [ -n "$(ls -A "${Home}/Chajianlibiao" 2>/dev/null)" ]; then 357 | echo 358 | echo 359 | chmod -R +x ${Home}/CHONGTU 360 | source ${Home}/CHONGTU 361 | rm -rf {CHONGTU,Chajianlibiao} 362 | echo 363 | echo 364 | fi 365 | if [ -n "$(ls -A "${Home}/Plug-in" 2>/dev/null)" ]; then 366 | TIME r " 已选插件列表" 367 | chmod -R +x ${Home}/Plug-in 368 | source ${Home}/Plug-in 369 | rm -rf {Plug-in,Plug-2} 370 | echo 371 | fi 372 | } 373 | -------------------------------------------------------------------------------- /build/common/replace.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | TIME() { 5 | [[ -z "$1" ]] && { 6 | echo -ne " " 7 | } || { 8 | case $1 in 9 | r) export Color="\033[1;91m";; 10 | g) export Color="\033[0;92m";; 11 | B) export Color="\033[1;36m";; 12 | y) export Color="\033[0;33m";; 13 | z) export Color="\033[1;95m";; 14 | h) export Color="\033[1;34m";; 15 | esac 16 | [[ $# -lt 2 ]] && echo -e "\e[36m\e[0m ${1}" || { 17 | echo -e "\e[36m\e[0m ${Color}${2}\e[0m" 18 | } 19 | } 20 | } 21 | source /bin/openwrt_info 22 | [ ! -d ${Download_Path} ] && mkdir -p ${Download_Path} 23 | wget -q --no-cookie --no-check-certificate -T 15 -t 4 ${Github_Tags} -O ${Download_Tags} 24 | [[ ! $? == 0 ]] && { 25 | TIME r "获取固件版本信息失败,请检测网络或您的网络需要翻墙,或者您更改的Github地址为无效地址!" 26 | exit 1 27 | } 28 | Kernel="$(egrep -o "[0-9]+\.[0-9]+\.[0-9]+" /usr/lib/opkg/info/kernel.control)" 29 | clear && echo "Openwrt-AutoUpdate Script ${Version}" 30 | echo 31 | echo 32 | TIME h "执行:转换成其他源码固件" 33 | echo 34 | echo 35 | TIME y "当前源码:${REPO_Name} / ${Luci_Edition} / ${Kernel}" 36 | TIME y "固件格式:${EFI_Mode}${Firmware_SFX}" 37 | TIME y "设备型号:${DEFAULT_Device}" 38 | echo 39 | if [[ "${REPO_Name}" == "lede" ]]; then 40 | if [[ `cat ${Download_Tags} | grep -c "19.07-lienol-${DEFAULT_Device}-.*${BOOT_Type}-.*${Firmware_SFX}"` -ge '1' ]]; then 41 | ZHUANG1="1" 42 | fi 43 | if [[ `cat ${Download_Tags} | grep -c "21.02-mortal-${DEFAULT_Device}-.*${BOOT_Type}-.*${Firmware_SFX}"` -ge '1' ]]; then 44 | ZHUANG2="2" 45 | fi 46 | if [[ -z "${ZHUANG1}" ]] && [[ -z "${ZHUANG2}" ]]; then 47 | TIME r "没有检测到有其他作者相同机型的固件版本,或者固件格式不相同!" 48 | echo 49 | exit 1 50 | fi 51 | if [[ -n "${ZHUANG1}" ]] && [[ -n "${ZHUANG2}" ]]; then 52 | ZHUANG1="3" 53 | ZHUANG2="3" 54 | ZHUANG3="3" 55 | fi 56 | fi 57 | if [[ "${REPO_Name}" == "lienol" ]]; then 58 | if [[ `cat ${Download_Tags} | grep -c "18.06-lede-${DEFAULT_Device}-.*${BOOT_Type}-.*${Firmware_SFX}"` -ge '1' ]]; then 59 | ZHUANG1="1" 60 | fi 61 | if [[ `cat ${Download_Tags} | grep -c "21.02-mortal-${DEFAULT_Device}-.*${BOOT_Type}-.*${Firmware_SFX}"` -ge '1' ]]; then 62 | ZHUANG2="2" 63 | fi 64 | if [[ -z "${ZHUANG1}" ]] && [[ -z "${ZHUANG2}" ]]; then 65 | TIME r "没有检测到有其他作者相同机型的固件版本,或者固件格式不相同!" 66 | echo 67 | exit 1 68 | fi 69 | if [[ -n "${ZHUANG1}" ]] && [[ -n "${ZHUANG2}" ]]; then 70 | ZHUANG1="3" 71 | ZHUANG2="3" 72 | ZHUANG3="3" 73 | fi 74 | fi 75 | if [[ "${REPO_Name}" == "mortal" ]]; then 76 | if [[ `cat ${Download_Tags} | grep -c "18.06-lede-${DEFAULT_Device}-.*${BOOT_Type}-.*${Firmware_SFX}"` -ge '1' ]]; then 77 | ZHUANG1="1" 78 | fi 79 | if [[ `cat ${Download_Tags} | grep -c "19.07-lienol-${DEFAULT_Device}-.*${BOOT_Type}-.*${Firmware_SFX}"` -ge '1' ]]; then 80 | ZHUANG2="2" 81 | fi 82 | if [[ -z "${ZHUANG1}" ]] && [[ -z "${ZHUANG2}" ]]; then 83 | TIME r "没有检测到有其他作者相同机型的固件版本,或者固件格式不相同!" 84 | echo 85 | exit 1 86 | fi 87 | if [[ -n "${ZHUANG1}" ]] && [[ -n "${ZHUANG2}" ]]; then 88 | ZHUANG1="3" 89 | ZHUANG2="3" 90 | ZHUANG3="3" 91 | fi 92 | fi 93 | echo 94 | TIME z "请注意:选择更换其他源码固件后,立即执行不保留配置安装新固件!" 95 | echo 96 | echo 97 | echo 98 | if [[ "${REPO_Name}" == "lede" ]]; then 99 | if [[ "${ZHUANG1}" == "1" ]]; then 100 | TIME B "1. 转换成 Lienol 19.07 其他内核版本?" 101 | echo 102 | TIME B "2. 退出固件转换程序?" 103 | echo 104 | echo 105 | echo 106 | while :; do 107 | TIME g "请选序列号[ 1、2 ]输入,然后回车确认您的选择!" 108 | echo 109 | read -p " 请输入您的选择: " CHOOSE 110 | case $CHOOSE in 111 | 1) 112 | cat >/bin/openwrt_info <<-EOF 113 | Github=${Github} 114 | Luci_Edition=19.07 115 | CURRENT_Version=lienol-${DEFAULT_Device}-202107010100 116 | DEFAULT_Device=${DEFAULT_Device} 117 | Firmware_Type=${Firmware_Type} 118 | LUCI_Name=19.07 119 | REPO_Name=lienol 120 | Github_Release=${Github_Release} 121 | Egrep_Firmware=19.07-lienol-${DEFAULT_Device} 122 | Download_Path=${Download_Path} 123 | Version=${Version} 124 | Download_Tags=${Download_Tags} 125 | EOF 126 | echo 127 | TIME y "转换固件成功,开始安装新源码的固件,请稍后...!" 128 | sleep 2 129 | bash /bin/AutoUpdate.sh -s 130 | exit 0 131 | break 132 | ;; 133 | 2) 134 | TIME r "您退出了固件转换程序" 135 | echo 136 | sleep 2 137 | exit 0 138 | break 139 | ;; 140 | *) 141 | TIME r "警告:输入错误,请输入正确的编号!" 142 | ;; 143 | esac 144 | done 145 | elif [[ "${ZHUANG2}" == "2" ]]; then 146 | TIME B "1. 转换成 mortal 21.02 其他内核版本?" 147 | echo 148 | TIME B "2. 退出固件转换程序?" 149 | echo 150 | echo 151 | echo 152 | while :; do 153 | TIME g "请选序列号[ 1、2 ]输入,然后回车确认您的选择!" 154 | echo 155 | read -p " 请输入您的选择: " CHOOSE 156 | case $CHOOSE in 157 | 1) 158 | cat >/bin/openwrt_info <<-EOF 159 | Github=${Github} 160 | Luci_Edition=21.02 161 | CURRENT_Version=mortal-${DEFAULT_Device}-202107010100 162 | DEFAULT_Device=${DEFAULT_Device} 163 | Firmware_Type=${Firmware_Type} 164 | LUCI_Name=21.02 165 | REPO_Name=mortal 166 | Github_Release=${Github_Release} 167 | Egrep_Firmware=21.02-mortal-${DEFAULT_Device} 168 | Download_Path=${Download_Path} 169 | Version=${Version} 170 | Download_Tags=${Download_Tags} 171 | EOF 172 | echo 173 | TIME y "转换固件成功,开始安装新源码的固件,请稍后...!" 174 | sleep 2 175 | bash /bin/AutoUpdate.sh -s 176 | exit 0 177 | break 178 | ;; 179 | 2) 180 | echo 181 | TIME r "您退出了固件转换程序" 182 | echo 183 | sleep 1 184 | exit 0 185 | break 186 | ;; 187 | *) 188 | TIME r "警告:输入错误,请输入正确的编号!" 189 | ;; 190 | esac 191 | done 192 | elif [[ "${ZHUANG3}" == "3" ]]; then 193 | TIME B "1. 转换成 Lienol 19.07 其他内核版本?" 194 | echo 195 | TIME B "2. 转换成 mortal 21.02 其他内核版本?" 196 | echo 197 | TIME B "3. 退出固件转换程序?" 198 | echo 199 | echo 200 | echo 201 | while :; do 202 | TIME g "请选序列号[ 1、2、3 ]输入,然后回车确认您的选择!" 203 | echo 204 | read -p " 请输入您的选择: " CHOOSE 205 | case $CHOOSE in 206 | 1) 207 | cat >/bin/openwrt_info <<-EOF 208 | Github=${Github} 209 | Luci_Edition=19.07 210 | CURRENT_Version=lienol-${DEFAULT_Device}-202107010100 211 | DEFAULT_Device=${DEFAULT_Device} 212 | Firmware_Type=${Firmware_Type} 213 | LUCI_Name=19.07 214 | REPO_Name=lienol 215 | Github_Release=${Github_Release} 216 | Egrep_Firmware=19.07-lienol-${DEFAULT_Device} 217 | Download_Path=${Download_Path} 218 | Version=${Version} 219 | Download_Tags=${Download_Tags} 220 | EOF 221 | echo 222 | TIME y "转换固件成功,开始安装新源码的固件,请稍后...!" 223 | sleep 2 224 | bash /bin/AutoUpdate.sh -s 225 | exit 0 226 | break 227 | ;; 228 | 2) 229 | cat >/bin/openwrt_info <<-EOF 230 | Github=${Github} 231 | Luci_Edition=21.02 232 | CURRENT_Version=mortal-${DEFAULT_Device}-202107010100 233 | DEFAULT_Device=${DEFAULT_Device} 234 | Firmware_Type=${Firmware_Type} 235 | LUCI_Name=21.02 236 | REPO_Name=mortal 237 | Github_Release=${Github_Release} 238 | Egrep_Firmware=21.02-mortal-${DEFAULT_Device} 239 | Download_Path=${Download_Path} 240 | Version=${Version} 241 | Download_Tags=${Download_Tags} 242 | EOF 243 | echo 244 | TIME y "转换固件成功,开始安装新源码的固件,请稍后...!" 245 | sleep 2 246 | bash /bin/AutoUpdate.sh -s 247 | exit 0 248 | break 249 | ;; 250 | 3) 251 | echo 252 | TIME r "您退出了固件转换程序" 253 | echo 254 | sleep 1 255 | exit 0 256 | break 257 | ;; 258 | *) 259 | TIME r "警告:输入错误,请输入正确的编号!" 260 | ;; 261 | esac 262 | done 263 | fi 264 | 265 | fi 266 | if [[ "${REPO_Name}" == "lienol" ]]; then 267 | if [[ "${ZHUANG1}" == "1" ]]; then 268 | TIME B "1. 转换成 Lede 18.06 其他内核版本?" 269 | echo 270 | TIME B "2. 退出固件转换程序?" 271 | echo 272 | echo 273 | echo 274 | while :; do 275 | TIME g "请选序列号[ 1、2 ]输入,然后回车确认您的选择!" 276 | echo 277 | read -p " 请输入您的选择: " CHOOSE 278 | case $CHOOSE in 279 | 1) 280 | cat >/bin/openwrt_info <<-EOF 281 | Github=${Github} 282 | Luci_Edition=18.06 283 | CURRENT_Version=lede-${DEFAULT_Device}-202107010100 284 | DEFAULT_Device=${DEFAULT_Device} 285 | Firmware_Type=${Firmware_Type} 286 | LUCI_Name=18.06 287 | REPO_Name=lede 288 | Github_Release=${Github_Release} 289 | Egrep_Firmware=18.06-lede-${DEFAULT_Device} 290 | Download_Path=${Download_Path} 291 | Version=${Version} 292 | Download_Tags=${Download_Tags} 293 | EOF 294 | echo 295 | TIME y "转换固件成功,开始安装新源码的固件,请稍后...!" 296 | sleep 2 297 | bash /bin/AutoUpdate.sh -s 298 | exit 0 299 | break 300 | ;; 301 | 2) 302 | echo 303 | TIME r "您退出了固件转换程序" 304 | echo 305 | sleep 1 306 | exit 0 307 | break 308 | ;; 309 | *) 310 | TIME r "警告:输入错误,请输入正确的编号!" 311 | ;; 312 | esac 313 | done 314 | elif [[ "${ZHUANG2}" == "2" ]]; then 315 | TIME B "1. 转换成 mortal 21.02 其他内核版本?" 316 | echo 317 | TIME B "2. 退出固件转换程序?" 318 | echo 319 | echo 320 | echo 321 | while :; do 322 | TIME g "请选序列号[ 1、2 ]输入,然后回车确认您的选择!" 323 | echo 324 | read -p " 请输入您的选择: " CHOOSE 325 | case $CHOOSE in 326 | 1) 327 | cat >/bin/openwrt_info <<-EOF 328 | Github=${Github} 329 | Luci_Edition=21.02 330 | CURRENT_Version=mortal-${DEFAULT_Device}-202107010100 331 | DEFAULT_Device=${DEFAULT_Device} 332 | Firmware_Type=${Firmware_Type} 333 | LUCI_Name=21.02 334 | REPO_Name=mortal 335 | Github_Release=${Github_Release} 336 | Egrep_Firmware=21.02-mortal-${DEFAULT_Device} 337 | Download_Path=${Download_Path} 338 | Version=${Version} 339 | Download_Tags=${Download_Tags} 340 | EOF 341 | echo 342 | TIME y "转换固件成功,开始安装新源码的固件,请稍后...!" 343 | sleep 2 344 | bash /bin/AutoUpdate.sh -s 345 | exit 0 346 | break 347 | ;; 348 | 2) 349 | echo 350 | TIME r "您退出了固件转换程序" 351 | echo 352 | sleep 1 353 | exit 0 354 | break 355 | ;; 356 | *) 357 | TIME r "警告:输入错误,请输入正确的编号!" 358 | ;; 359 | esac 360 | done 361 | elif [[ "${ZHUANG3}" == "3" ]]; then 362 | TIME B "1. 转换成 Lede 18.06 其他内核版本?" 363 | echo 364 | TIME B "2. 转换成 mortal 21.02 其他内核版本?" 365 | echo 366 | TIME B "3. 退出固件转换程序?" 367 | echo 368 | echo 369 | echo 370 | while :; do 371 | TIME g "请选序列号[ 1、2、3 ]输入,然后回车确认您的选择!" 372 | echo 373 | read -p " 请输入您的选择: " CHOOSE 374 | case $CHOOSE in 375 | 1) 376 | cat >/bin/openwrt_info <<-EOF 377 | Github=${Github} 378 | Luci_Edition=18.06 379 | CURRENT_Version=lede-${DEFAULT_Device}-202107010100 380 | DEFAULT_Device=${DEFAULT_Device} 381 | Firmware_Type=${Firmware_Type} 382 | LUCI_Name=18.06 383 | REPO_Name=lede 384 | Github_Release=${Github_Release} 385 | Egrep_Firmware=18.06-lede-${DEFAULT_Device} 386 | Download_Path=${Download_Path} 387 | Version=${Version} 388 | Download_Tags=${Download_Tags} 389 | EOF 390 | echo 391 | TIME y "转换固件成功,开始安装新源码的固件,请稍后...!" 392 | sleep 2 393 | bash /bin/AutoUpdate.sh -s 394 | exit 0 395 | break 396 | ;; 397 | 2) 398 | cat >/bin/openwrt_info <<-EOF 399 | Github=${Github} 400 | Luci_Edition=21.02 401 | CURRENT_Version=mortal-${DEFAULT_Device}-202107010100 402 | DEFAULT_Device=${DEFAULT_Device} 403 | Firmware_Type=${Firmware_Type} 404 | LUCI_Name=21.02 405 | REPO_Name=mortal 406 | Github_Release=${Github_Release} 407 | Egrep_Firmware=21.02-mortal-${DEFAULT_Device} 408 | Download_Path=${Download_Path} 409 | Version=${Version} 410 | Download_Tags=${Download_Tags} 411 | EOF 412 | echo 413 | TIME y "转换固件成功,开始安装新源码的固件,请稍后...!" 414 | sleep 2 415 | bash /bin/AutoUpdate.sh -s 416 | exit 0 417 | break 418 | ;; 419 | 3) 420 | echo 421 | TIME r "您退出了固件转换程序" 422 | echo 423 | sleep 1 424 | exit 0 425 | break 426 | ;; 427 | *) 428 | TIME r "警告:输入错误,请输入正确的编号!" 429 | ;; 430 | esac 431 | done 432 | fi 433 | 434 | fi 435 | if [[ "${REPO_Name}" == "mortal" ]]; then 436 | if [[ "${ZHUANG1}" == "1" ]]; then 437 | TIME B "1. 转换成 Lede 18.06 其他内核版本?" 438 | echo 439 | TIME B "2. 退出固件转换程序?" 440 | echo 441 | echo 442 | echo 443 | while :; do 444 | TIME g "请选序列号[ 1、2 ]输入,然后回车确认您的选择!" 445 | echo 446 | read -p " 请输入您的选择: " CHOOSE 447 | case $CHOOSE in 448 | 1) 449 | cat >/bin/openwrt_info <<-EOF 450 | Github=${Github} 451 | Luci_Edition=18.06 452 | CURRENT_Version=lede-${DEFAULT_Device}-202107010100 453 | DEFAULT_Device=${DEFAULT_Device} 454 | Firmware_Type=${Firmware_Type} 455 | LUCI_Name=18.06 456 | REPO_Name=lede 457 | Github_Release=${Github_Release} 458 | Egrep_Firmware=18.06-lede-${DEFAULT_Device} 459 | Download_Path=${Download_Path} 460 | Version=${Version} 461 | Download_Tags=${Download_Tags} 462 | EOF 463 | echo 464 | TIME y "转换固件成功,开始安装新源码的固件,请稍后...!" 465 | sleep 2 466 | bash /bin/AutoUpdate.sh -s 467 | exit 0 468 | break 469 | ;; 470 | 2) 471 | echo 472 | TIME r "您退出了固件转换程序" 473 | echo 474 | sleep 1 475 | exit 0 476 | break 477 | ;; 478 | *) 479 | TIME r "警告:输入错误,请输入正确的编号!" 480 | ;; 481 | esac 482 | done 483 | elif [[ "${ZHUANG2}" == "2" ]]; then 484 | TIME B "1. 转换成 lienol 19.07 其他内核版本?" 485 | echo 486 | TIME B "2. 退出固件转换程序?" 487 | echo 488 | echo 489 | echo 490 | while :; do 491 | TIME g "请选序列号[ 1、2 ]输入,然后回车确认您的选择!" 492 | echo 493 | read -p " 请输入您的选择: " CHOOSE 494 | case $CHOOSE in 495 | 1) 496 | cat >/bin/openwrt_info <<-EOF 497 | Github=${Github} 498 | Luci_Edition=19.07 499 | CURRENT_Version=lienol-${DEFAULT_Device}-202107010100 500 | DEFAULT_Device=${DEFAULT_Device} 501 | Firmware_Type=${Firmware_Type} 502 | LUCI_Name=19.07 503 | REPO_Name=lienol 504 | Github_Release=${Github_Release} 505 | Egrep_Firmware=19.07-lienol-${DEFAULT_Device} 506 | Download_Path=${Download_Path} 507 | Version=${Version} 508 | Download_Tags=${Download_Tags} 509 | EOF 510 | echo 511 | TIME y "转换固件成功,开始安装新源码的固件,请稍后...!" 512 | sleep 2 513 | bash /bin/AutoUpdate.sh -s 514 | exit 0 515 | break 516 | ;; 517 | 2) 518 | echo 519 | TIME r "您退出了固件转换程序" 520 | echo 521 | sleep 1 522 | exit 0 523 | break 524 | ;; 525 | *) 526 | TIME r "警告:输入错误,请输入正确的编号!" 527 | ;; 528 | esac 529 | done 530 | elif [[ "${ZHUANG3}" == "3" ]]; then 531 | TIME B "1. 转换成 Lede 18.06 其他内核版本?" 532 | echo 533 | TIME B "2. 转换成 lienol 19.07 其他内核版本?" 534 | echo 535 | TIME B "3. 退出固件转换程序?" 536 | echo 537 | echo 538 | echo 539 | while :; do 540 | TIME g "请选序列号[ 1、2、3 ]输入,然后回车确认您的选择!" 541 | echo 542 | read -p " 请输入您的选择: " CHOOSE 543 | case $CHOOSE in 544 | 1) 545 | cat >/bin/openwrt_info <<-EOF 546 | Github=${Github} 547 | Luci_Edition=18.06 548 | CURRENT_Version=lede-${DEFAULT_Device}-202107010100 549 | DEFAULT_Device=${DEFAULT_Device} 550 | Firmware_Type=${Firmware_Type} 551 | LUCI_Name=18.06 552 | REPO_Name=lede 553 | Github_Release=${Github_Release} 554 | Egrep_Firmware=18.06-lede-${DEFAULT_Device} 555 | Download_Path=${Download_Path} 556 | Version=${Version} 557 | Download_Tags=${Download_Tags} 558 | EOF 559 | echo 560 | TIME y "转换固件成功,开始安装新源码的固件,请稍后...!" 561 | sleep 2 562 | bash /bin/AutoUpdate.sh -s 563 | exit 0 564 | break 565 | ;; 566 | 2) 567 | cat >/bin/openwrt_info <<-EOF 568 | Github=${Github} 569 | Luci_Edition=19.07 570 | CURRENT_Version=lienol-${DEFAULT_Device}-202107010100 571 | DEFAULT_Device=${DEFAULT_Device} 572 | Firmware_Type=${Firmware_Type} 573 | LUCI_Name=19.07 574 | REPO_Name=lienol 575 | Github_Release=${Github_Release} 576 | Egrep_Firmware=19.07-lienol-${DEFAULT_Device} 577 | Download_Path=${Download_Path} 578 | Version=${Version} 579 | Download_Tags=${Download_Tags} 580 | EOF 581 | echo 582 | TIME y "转换固件成功,开始安装新源码的固件,请稍后...!" 583 | sleep 2 584 | bash /bin/AutoUpdate.sh -s 585 | exit 0 586 | break 587 | ;; 588 | 3) 589 | echo 590 | TIME r "您退出了固件转换程序" 591 | echo 592 | sleep 1 593 | exit 0 594 | break 595 | ;; 596 | *) 597 | TIME r "警告:输入错误,请输入正确的编号!" 598 | ;; 599 | esac 600 | done 601 | fi 602 | 603 | fi 604 | exit 0 605 | -------------------------------------------------------------------------------- /build/common/upgrade.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # https://github.com/Hyy2001X/AutoBuild-Actions 3 | # AutoBuild Module by Hyy2001 4 | # AutoBuild Functions 5 | 6 | GET_TARGET_INFO() { 7 | [[ ${TARGET_PROFILE} == x86-64 ]] && { 8 | [[ `grep -c "CONFIG_TARGET_IMAGES_GZIP=y" ${Home}/.config` -ge '1' ]] && Firmware_sfxo=img.gz || Firmware_sfxo=img 9 | } 10 | case "${REPO_BRANCH}" in 11 | "master") 12 | LUCI_Name="18.06" 13 | REPO_Name="lede" 14 | ZUOZHE="coolsnowwolf" 15 | if [[ "${TARGET_PROFILE}" == "x86-64" ]]; then 16 | Legacy_Firmware="openwrt-x86-64-generic-squashfs-combined.${Firmware_sfxo}" 17 | UEFI_Firmware="openwrt-x86-64-generic-squashfs-combined-efi.${Firmware_sfxo}" 18 | Firmware_sfx="${Firmware_sfxo}" 19 | elif [[ "${TARGET_PROFILE}" == "phicomm_k3" ]]; then 20 | Up_Firmware="openwrt-bcm53xx-generic-phicomm_k3-squashfs.trx" 21 | Firmware_sfx="trx" 22 | elif [[ "${TARGET_PROFILE}" == "xiaomi_mi-router-3g" ]]; then 23 | TARGET_PROFILE="xiaomi_mir3g" 24 | Up_Firmware="openwrt-${TARGET_BOARD}-${TARGET_SUBTARGET}-${TARGET_PROFILE}-squashfs-sysupgrade.bin" 25 | Firmware_sfx="bin" 26 | elif [[ "${TARGET_PROFILE}" == "xiaomi_mi-router-3g-v2" ]]; then 27 | TARGET_PROFILE="xiaomi_mir3gv2" 28 | Up_Firmware="openwrt-${TARGET_BOARD}-${TARGET_SUBTARGET}-${TARGET_PROFILE}-squashfs-sysupgrade.bin" 29 | Firmware_sfx="bin" 30 | else 31 | Up_Firmware="openwrt-${TARGET_BOARD}-${TARGET_SUBTARGET}-${TARGET_PROFILE}-squashfs-sysupgrade.bin" 32 | Firmware_sfx="bin" 33 | fi 34 | ;; 35 | "19.07") 36 | LUCI_Name="19.07" 37 | REPO_Name="lienol" 38 | ZUOZHE="Lienol" 39 | if [[ "${TARGET_PROFILE}" == "x86-64" ]]; then 40 | Legacy_Firmware="openwrt-x86-64-combined-squashfs.${Firmware_sfxo}" 41 | UEFI_Firmware="openwrt-x86-64-combined-squashfs-efi.${Firmware_sfxo}" 42 | Firmware_sfx="${Firmware_sfxo}" 43 | elif [[ "${TARGET_PROFILE}" == "phicomm-k3" ]]; then 44 | Up_Firmware="openwrt-bcm53xx-phicomm-k3-squashfs.trx" 45 | Firmware_sfx="trx" 46 | else 47 | Up_Firmware="openwrt-${TARGET_BOARD}-${TARGET_SUBTARGET}-${TARGET_PROFILE}-squashfs-sysupgrade.bin" 48 | Firmware_sfx="bin" 49 | fi 50 | ;; 51 | "openwrt-21.02") 52 | LUCI_Name="21.02" 53 | REPO_Name="mortal" 54 | ZUOZHE="immortalwrt" 55 | if [[ "${TARGET_PROFILE}" == "x86-64" ]]; then 56 | Legacy_Firmware="immortalwrt-x86-64-generic-squashfs-combined.${Firmware_sfxo}" 57 | UEFI_Firmware="immortalwrt-x86-64-generic-squashfs-combined-efi.${Firmware_sfxo}" 58 | Firmware_sfx="${Firmware_sfxo}" 59 | elif [[ "${TARGET_PROFILE}" == "phicomm_k3" ]]; then 60 | Up_Firmware="immortalwrt-bcm53xx-generic-phicomm_k3-squashfs.trx" 61 | Firmware_sfx="trx" 62 | elif [[ "${TARGET_PROFILE}" == "xiaomi_mi-router-3g" ]]; then 63 | TARGET_PROFILE="xiaomi_mir3g" 64 | Up_Firmware="openwrt-ramips-mt7621-xiaomi_mir3g-squashfs-sysupgrade.bin" 65 | Firmware_sfx="bin" 66 | elif [[ "${TARGET_PROFILE}" == "xiaomi_mi-router-3g-v2" ]]; then 67 | TARGET_PROFILE="xiaomi_mir3gv2" 68 | Up_Firmware="openwrt-ramips-mt7621-xiaomi_mir3gv2-squashfs-sysupgrade.bin" 69 | Firmware_sfx="bin" 70 | else 71 | Up_Firmware="immortalwrt-${TARGET_BOARD}-${TARGET_SUBTARGET}-${TARGET_PROFILE}-squashfs-sysupgrade.bin" 72 | Firmware_sfx="bin" 73 | fi 74 | ;; 75 | esac 76 | [ ${REGULAR_UPDATE} == "true" ] && { 77 | AutoUpdate_Version=$(egrep -o "V[0-9].+" ${Home}/package/base-files/files/bin/AutoUpdate.sh | awk 'END{print}') 78 | } || AutoUpdate_Version=OFF 79 | In_Firmware_Info="${Home}/package/base-files/files/bin/openwrt_info" 80 | Github_Release="${Github}/releases/download/AutoUpdate" 81 | Github_UP_RELEASE="${Github}/releases/AutoUpdate" 82 | Openwrt_Version="${REPO_Name}-${TARGET_PROFILE}-${Compile_Date}" 83 | Egrep_Firmware="${LUCI_Name}-${REPO_Name}-${TARGET_PROFILE}" 84 | } 85 | 86 | Diy_Part1() { 87 | sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += luci-app-autoupdate luci-app-ttyd/g' target/linux/*/Makefile 88 | } 89 | 90 | Diy_Part2() { 91 | GET_TARGET_INFO 92 | cat >${In_Firmware_Info} <<-EOF 93 | Github=${Github} 94 | Luci_Edition=${OpenWrt_name} 95 | CURRENT_Version=${Openwrt_Version} 96 | DEFAULT_Device=${TARGET_PROFILE} 97 | Firmware_Type=${Firmware_sfx} 98 | LUCI_Name=${LUCI_Name} 99 | REPO_Name=${REPO_Name} 100 | Github_Release=${Github_Release} 101 | Egrep_Firmware=${Egrep_Firmware} 102 | Download_Path=/tmp/Downloads 103 | Version=${AutoUpdate_Version} 104 | Download_Tags=/tmp/Downloads/Github_Tags 105 | EOF 106 | } 107 | 108 | Diy_Part3() { 109 | GET_TARGET_INFO 110 | AutoBuild_Firmware="${LUCI_Name}-${Openwrt_Version}" 111 | Firmware_Path="${Home}/upgrade" 112 | Mkdir ${Home}/bin/Firmware 113 | if [[ `ls ${Firmware_Path} | grep -c "sysupgrade.bin"` -ge '1' ]]; then 114 | Up_BinFirmware="openwrt-${TARGET_BOARD}-${TARGET_SUBTARGET}-${TARGET_PROFILE}-squashfs-sysupgrade.bin" 115 | mv ${Firmware_Path}/*sysupgrade.bin ${Home}/bin/Firmware/${Up_BinFirmware} 116 | mv ${Home}/bin/Firmware/${Up_BinFirmware} ${Firmware_Path}/${Up_BinFirmware} 117 | fi 118 | cd ${Firmware_Path} 119 | if [[ `ls | grep -c "xiaomi_mi-router-3g"` -ge '1' ]]; then 120 | rename -v "s/xiaomi_mi-router-3g/xiaomi_mir3g/" * > /dev/null 2>&1 121 | fi 122 | if [[ `ls | grep -c "xiaomi_mi-router-3g-v2"` -ge '1' ]]; then 123 | rename -v "s/xiaomi_mi-router-3g-v2/xiaomi_mir3gv2/" * > /dev/null 2>&1 124 | fi 125 | case "${TARGET_PROFILE}" in 126 | x86-64) 127 | [[ -e ${Legacy_Firmware} ]] && { 128 | MD5=$(md5sum ${Legacy_Firmware} | cut -c1-3) 129 | SHA256=$(sha256sum ${Legacy_Firmware} | cut -c1-3) 130 | SHA5BIT="${MD5}${SHA256}" 131 | cp ${Legacy_Firmware} ${Home}/bin/Firmware/${AutoBuild_Firmware}-Legacy-${SHA5BIT}.${Firmware_sfx} 132 | } 133 | [[ -e ${UEFI_Firmware} ]] && { 134 | MD5=$(md5sum ${UEFI_Firmware} | cut -c1-3) 135 | SHA256=$(sha256sum ${UEFI_Firmware} | cut -c1-3) 136 | SHA5BIT="${MD5}${SHA256}" 137 | cp ${UEFI_Firmware} ${Home}/bin/Firmware/${AutoBuild_Firmware}-UEFI-${SHA5BIT}.${Firmware_sfx} 138 | } 139 | ;; 140 | friendlyarm_nanopi-r2s | friendlyarm_nanopi-r4s | armvirt) 141 | echo "R2S/R4S/N1/晶晨系列,暂不支持定时更新固件!" > Update_Logs.json 142 | cp Update_Logs.json ${Home}/bin/Firmware/Update_Logs.json 143 | ;; 144 | *) 145 | [[ -e ${Up_Firmware} ]] && { 146 | MD5=$(md5sum ${Up_Firmware} | cut -c1-3) 147 | SHA256=$(sha256sum ${Up_Firmware} | cut -c1-3) 148 | SHA5BIT="${MD5}${SHA256}" 149 | cp ${Up_Firmware} ${Home}/bin/Firmware/${AutoBuild_Firmware}-Sysupg-${SHA5BIT}.${Firmware_sfx} 150 | } || { 151 | echo "Firmware is not detected !" 152 | } 153 | ;; 154 | esac 155 | cd ${Home} 156 | } 157 | 158 | Mkdir() { 159 | _DIR=${1} 160 | if [ ! -d "${_DIR}" ];then 161 | mkdir -p ${_DIR} 162 | fi 163 | unset _DIR 164 | } 165 | -------------------------------------------------------------------------------- /build/openwrt_amlogic/diy-part.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2019-2020 P3TERX 3 | # DIY扩展二合一了,在此处可以增加插件 4 | 5 | git clone https://github.com/gd0772/package package/gd772 6 | wget https://raw.githubusercontent.com/gd0772/patch/main/n1.sh 7 | bash n1.sh 8 | 9 | # 设置打包固件的机型,内核组合(可用内核是时时变化的,过老的内核就删除的,所以要选择什么内核请看说明) 10 | cat >$GITHUB_WORKSPACE/amlogic_openwrt <<-EOF 11 | rootfs_size=944 12 | amlogic_model=s905d 13 | amlogic_kernel=5.4.155 14 | EOF 15 | -------------------------------------------------------------------------------- /build/openwrt_amlogic/diy/README: -------------------------------------------------------------------------------- 1 | 替换文件用的文件夹,按照源码路径替换 2 | 替换文件有两个方法 3 | 1、在这里按 Add file 然后选 Create new file 然后要替换文件的路径跟名字,下面大方框粘贴内容,然后最下面绿色按钮保存 4 | 比如替换banner,在源码的路径是‘package/base-files/files/etc/banner’,按 Add file 然后选 Create new file,粘贴这个路径,下面大方框粘贴内容,然后最下面绿色按钮保存完成 5 | 6 | 2、在这里按 Create new file 然后选择 Upload files 然后把在你电脑上按文件夹路径跟名字制作好的文件拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 7 | 比如替换banner,在电脑创建package文件夹,package文件夹里面创建base-files文件夹,base-files文件夹里面创建files文件夹,files文件夹里面创建etc文件夹, 8 | 在etc文件夹创建banner.txt的文本文档,设置好内容,然后把.txt后缀去掉就是banner了,然后把你创建package文件夹拖进来,等文件传输完毕,然后按最下绿色按钮保存就可以了 9 | -------------------------------------------------------------------------------- /build/openwrt_amlogic/diy/package/base-files/files/etc/banner: -------------------------------------------------------------------------------- 1 | _____ ______ ______ ___ _ ___ ___ ______ _____ 2 | / _ \ | _ \ | ____| | \ | | | | / / | _ \ |_ _| 3 | | | | | | |_| | | |__ | \| | | | __ / / | |_| | | | 4 | | | | | | ___/ | __| | |\ | | | / | / / | _ / | | 5 | | |_| | | | | |___ | | \ | | |/ |/ / | | \ \ | | 6 | \_____/ |_| |_____| |_| \_| |___/|___/ |_| \_\ |_| 7 | W I R E L E S S F R E E D 8 | -------------------------------------------------------------- 9 | by lean & immortalwrt Compilde by gd772 10 | -------------------------------------------------------------- 11 | -------------------------------------------------------------------------------- /build/openwrt_amlogic/files/README: -------------------------------------------------------------------------------- 1 | 替换openwrt设置文件的文件夹,设置好openwrt后 2 | 记住这个不是源码文件,是源码编译好固件后的openwrt,安装好后,设置好后,openwrt里面etc 3 | 用WinSCP(文件协议F选择SCP)连接openwrt,找到etc文件夹,里面就是openwrt的所有设置文件 4 | 5 | 6 | 1、在这里按 Add file 然后选 Create new file 然后要替换文件的路径跟名字,下面大方框粘贴补丁内容,然后最下面绿色按钮保存 7 | 比如替换smartdns,在openwrt的路径是‘etc/config/smartdns’,按 Add file 然后选 Create new file,粘贴这个路径,下面大方框粘贴补丁内容,然后最下面绿色按钮保存完成 8 | 这个上替换单个文件方便,如果文件很多就比较麻烦,用下面的方法更好,就比如smartdns就有4个设置文件,不过一般都只用etc/config/smartdns的就是 9 | 10 | 2、在这里按 Create new file 然后选择 Upload files 然后把openwrt的对应路径制作好的etc文件夹,拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 11 | 比如替换smartdns,在电脑创建etc文件夹,etc文件夹里面创建config文件夹,然后在WinSCP里面etc/config里面的smartdns拖进来,上面说到smartdns有4个设置文件, 12 | 就在etc文件夹里面还有一个smartdns文件夹的,里面有三个设置文件,你把WinSCP里etc里面的smartdns文件夹直接拖到在你电脑创建的etc文件夹里面就好了 13 | 这样你在电脑创建的etc文件夹里面就有两个文件夹,一个config文件夹放着一个smartdns文件,一个smartdns文件夹里面放着address.conf、blacklist-ip.conf、custom.con三个设置文件 14 | 然后在这里按 Create new file 然后选择 Upload files 然后把在你电脑上etc文件夹拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 -------------------------------------------------------------------------------- /build/openwrt_amlogic/files/etc/FileBrowser/filebrowser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gd0772/AutoBuild-OpenWrt/87e0032ffea12db01d124a01a8fea64d16561194/build/openwrt_amlogic/files/etc/FileBrowser/filebrowser -------------------------------------------------------------------------------- /build/openwrt_amlogic/files/etc/config/argon: -------------------------------------------------------------------------------- 1 | 2 | config global 3 | option dark_primary '#483d8b' 4 | option blur_dark '10' 5 | option transparency_dark '0.5' 6 | option mode 'normal' 7 | option save '保存更改' 8 | option transparency '0' 9 | option blur '1' 10 | option primary '#708090' 11 | 12 | -------------------------------------------------------------------------------- /build/openwrt_amlogic/files/etc/config/dhcp: -------------------------------------------------------------------------------- 1 | 2 | config dnsmasq 3 | option domainneeded '1' 4 | option localise_queries '1' 5 | option rebind_protection '1' 6 | option rebind_localhost '1' 7 | option local '/lan/' 8 | option domain 'lan' 9 | option expandhosts '1' 10 | option authoritative '1' 11 | option readethers '1' 12 | option leasefile '/tmp/dhcp.leases' 13 | option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto' 14 | option nonwildcard '1' 15 | option localservice '1' 16 | option ednspacket_max '1232' 17 | option localuse '1' 18 | option sequential_ip '1' 19 | option port '53' 20 | option cachesize '0' 21 | 22 | config dhcp 'lan' 23 | option interface 'lan' 24 | option dhcpv4 'server' 25 | option ra_slaac '1' 26 | list ra_flags 'managed-config' 27 | list ra_flags 'other-config' 28 | option start '100' 29 | option limit '150' 30 | option leasetime '24h' 31 | 32 | config dhcp 'wan' 33 | option interface 'wan' 34 | option ignore '1' 35 | 36 | config odhcpd 'odhcpd' 37 | option maindhcp '0' 38 | option leasefile '/tmp/hosts/odhcpd' 39 | option leasetrigger '/usr/sbin/odhcpd-update' 40 | option loglevel '4' 41 | 42 | config srvhost 43 | option srv '_vlmcs._tcp' 44 | option target 'N1' 45 | option port '1688' 46 | option class '0' 47 | option weight '100' 48 | 49 | -------------------------------------------------------------------------------- /build/openwrt_amlogic/files/etc/config/filebrowser: -------------------------------------------------------------------------------- 1 | 2 | config global 3 | option port '8088' 4 | option root_path '/' 5 | option project_directory '/etc/FileBrowser' 6 | option enable '0' 7 | 8 | -------------------------------------------------------------------------------- /build/openwrt_amlogic/files/etc/config/network: -------------------------------------------------------------------------------- 1 | 2 | config interface 'loopback' 3 | option ifname 'lo' 4 | option proto 'static' 5 | option ipaddr '127.0.0.1' 6 | option netmask '255.0.0.0' 7 | 8 | config globals 'globals' 9 | option ula_prefix 'fd6d:cd6e:a677::/48' 10 | 11 | config interface 'lan' 12 | option ifname 'eth0' 13 | option proto 'static' 14 | option ipaddr '192.168.123.2' 15 | option netmask '255.255.255.0' 16 | option gateway '192.168.123.1' 17 | option dns '8.8.4.4' 18 | option delegate '0' 19 | -------------------------------------------------------------------------------- /build/openwrt_amlogic/files/etc/config/openclash: -------------------------------------------------------------------------------- 1 | 2 | config openclash 'config' 3 | option proxy_port '7892' 4 | option tproxy_port '7895' 5 | option mixed_port '7893' 6 | option socks_port '7891' 7 | option http_port '7890' 8 | option dns_port '7874' 9 | option update '0' 10 | option auto_update '0' 11 | option auto_update_time '0' 12 | option cn_port '9090' 13 | option dashboard_password '123456' 14 | option dashboard_forward_ssl '0' 15 | option rule_source '0' 16 | option enable_custom_dns '0' 17 | option ipv6_enable '0' 18 | option ipv6_dns '0' 19 | option enable_custom_clash_rules '0' 20 | option other_rule_auto_update '0' 21 | option enable_redirect_dns '1' 22 | option dns_advanced_setting '0' 23 | option servers_if_update '0' 24 | option disable_masq_cache '1' 25 | option servers_update '0' 26 | option log_level 'silent' 27 | option proxy_mode 'rule' 28 | option intranet_allowed '1' 29 | option enable_udp_proxy '1' 30 | option disable_udp_quic '1' 31 | option filter_aaaa_dns '0' 32 | option small_flash_memory '0' 33 | option interface_name '0' 34 | option log_size '1024' 35 | option tolerance '0' 36 | option store_fakeip '1' 37 | option custom_fallback_filter '0' 38 | option append_wan_dns '1' 39 | option stream_domains_prefetch '0' 40 | option stream_auto_select '0' 41 | option bypass_gateway_compatible '0' 42 | option github_address_mod 'https://testingcf.jsdelivr.net/' 43 | option urltest_address_mod '0' 44 | option delay_start '0' 45 | option router_self_proxy '1' 46 | option release_branch 'master' 47 | option enable_meta_core '0' 48 | option dashboard_type 'Official' 49 | option yacd_type 'Official' 50 | option append_default_dns '1' 51 | option geo_custom_url 'https://testingcf.jsdelivr.net/gh/alecthw/mmdb_china_ip_list@release/lite/Country.mmdb' 52 | option chnr_custom_url 'https://ispip.clang.cn/all_cn.txt' 53 | option chnr6_custom_url 'https://ispip.clang.cn/all_cn_ipv6.txt' 54 | option cndomain_custom_url 'https://testingcf.jsdelivr.net/gh/felixonmars/dnsmasq-china-list@master/accelerated-domains.china.conf' 55 | option core_version 'linux-arm64' 56 | option default_resolvfile '/tmp/resolv.conf.d/resolv.conf.auto' 57 | option config_path '/etc/openclash/config/config.yaml' 58 | option restricted_mode '0' 59 | option dnsmasq_noresolv '0' 60 | option dnsmasq_resolvfile '/tmp/resolv.conf.d/resolv.conf.auto' 61 | option operation_mode 'fake-ip' 62 | option en_mode 'fake-ip' 63 | option enable_rule_proxy '1' 64 | option china_ip_route '0' 65 | option fakeip_range '198.18.0.1/16' 66 | option other_rule_update_week_time '1' 67 | option other_rule_update_day_time '0' 68 | option geo_auto_update '0' 69 | option geo_update_week_time '1' 70 | option geo_update_day_time '0' 71 | option chnr_auto_update '0' 72 | option chnr_update_week_time '1' 73 | option chnr_update_day_time '0' 74 | option auto_restart '0' 75 | option auto_restart_week_time '1' 76 | option auto_restart_day_time '0' 77 | option config_reload '1' 78 | option enable '0' 79 | option cachesize_dns '0' 80 | option redirect_dns '0' 81 | 82 | config dns_servers 83 | option group 'nameserver' 84 | option type 'udp' 85 | option ip '114.114.114.114' 86 | option enabled '1' 87 | 88 | config dns_servers 89 | option group 'nameserver' 90 | option type 'udp' 91 | option ip '119.29.29.29' 92 | option enabled '1' 93 | 94 | config dns_servers 95 | option group 'nameserver' 96 | option type 'udp' 97 | option ip '119.28.28.28' 98 | option enabled '0' 99 | 100 | config dns_servers 101 | option group 'nameserver' 102 | option type 'udp' 103 | option ip '223.5.5.5' 104 | option enabled '0' 105 | 106 | config dns_servers 107 | option type 'https' 108 | option ip 'doh.pub/dns-query' 109 | option group 'nameserver' 110 | option enabled '1' 111 | 112 | config dns_servers 113 | option type 'https' 114 | option ip 'dns.alidns.com/dns-query' 115 | option group 'nameserver' 116 | option enabled '1' 117 | 118 | config dns_servers 119 | option type 'https' 120 | option group 'fallback' 121 | option ip 'dns.cloudflare.com/dns-query' 122 | option enabled '1' 123 | 124 | config dns_servers 125 | option group 'fallback' 126 | option ip 'dns.google' 127 | option port '853' 128 | option type 'tls' 129 | option enabled '0' 130 | 131 | config dns_servers 132 | option group 'fallback' 133 | option type 'https' 134 | option ip '1.1.1.1/dns-query' 135 | option enabled '0' 136 | 137 | config dns_servers 138 | option group 'fallback' 139 | option ip '1.1.1.1' 140 | option port '853' 141 | option type 'tls' 142 | option enabled '0' 143 | 144 | config dns_servers 145 | option enabled '0' 146 | option group 'fallback' 147 | option ip '8.8.8.8' 148 | option port '853' 149 | option type 'tls' 150 | 151 | config dns_servers 152 | option type 'udp' 153 | option group 'fallback' 154 | option ip '2001:4860:4860::8888' 155 | option port '53' 156 | option enabled '0' 157 | 158 | config dns_servers 159 | option type 'udp' 160 | option group 'fallback' 161 | option ip '2001:4860:4860::8844' 162 | option port '53' 163 | option enabled '0' 164 | 165 | config dns_servers 166 | option type 'udp' 167 | option group 'fallback' 168 | option ip '2001:da8::666' 169 | option port '53' 170 | option enabled '0' 171 | 172 | config dns_servers 173 | option group 'fallback' 174 | option type 'https' 175 | option ip 'public.dns.iij.jp/dns-query' 176 | option enabled '1' 177 | 178 | config dns_servers 179 | option group 'fallback' 180 | option type 'https' 181 | option ip 'jp.tiar.app/dns-query' 182 | option enabled '1' 183 | 184 | config dns_servers 185 | option group 'fallback' 186 | option type 'https' 187 | option ip 'jp.tiarap.org/dns-query' 188 | option enabled '1' 189 | 190 | config dns_servers 191 | option group 'fallback' 192 | option ip 'jp.tiar.app' 193 | option type 'tls' 194 | option enabled '0' 195 | 196 | config dns_servers 197 | option group 'fallback' 198 | option ip 'dot.tiar.app' 199 | option type 'tls' 200 | option enabled '1' 201 | 202 | config authentication 203 | option enabled '1' 204 | option username 'gd772' 205 | option password 'Clash' 206 | -------------------------------------------------------------------------------- /build/openwrt_amlogic/files/etc/config/samba4: -------------------------------------------------------------------------------- 1 | 2 | config samba 3 | option workgroup 'WORKGROUP' 4 | option charset 'UTF-8' 5 | option description 'Samba on OpenWRT' 6 | option homes '0' 7 | option macos '0' 8 | option name 'N1' 9 | 10 | config sambashare 11 | option read_only 'no' 12 | option guest_ok 'yes' 13 | option inherit_owner 'yes' 14 | option create_mask '0777' 15 | option path '/mnt/mmcblk2p4' 16 | option name 'mmcblk2p4' 17 | option force_root '0' 18 | 19 | -------------------------------------------------------------------------------- /build/openwrt_amlogic/files/etc/config/turboacc: -------------------------------------------------------------------------------- 1 | 2 | config turboacc 'config' 3 | option hw_flow '0' 4 | option bbr_cca '0' 5 | option dns_caching '0' 6 | option sfe_flow '0' 7 | option sw_flow '0' 8 | option fullcone_nat '1' 9 | 10 | -------------------------------------------------------------------------------- /build/openwrt_amlogic/files/etc/init.d/ttyd: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | START=99 4 | STOP=50 5 | USE_PROCD=1 6 | 7 | NAME=ttyd 8 | PROG=/usr/bin/$NAME 9 | 10 | validate_section_ttyd() 11 | { 12 | uci_load_validate ttyd ttyd "$1" "$2" \ 13 | 'enable:bool:1' \ 14 | 'port:port' \ 15 | 'interface:string' \ 16 | 'credential:string' \ 17 | 'uid:uinteger' \ 18 | 'gid:uinteger' \ 19 | 'signal:uinteger' \ 20 | 'url_arg:bool' \ 21 | 'readonly:bool' \ 22 | 'client_option:list(string)' \ 23 | 'terminal_type:string' \ 24 | 'check_origin:bool' \ 25 | 'max_clients:uinteger' \ 26 | 'once:bool' \ 27 | 'index:string' \ 28 | 'ipv6:bool' \ 29 | 'ssl:bool' \ 30 | 'ssl_cert:file' \ 31 | 'ssl_key:file' \ 32 | 'ssl_ca:file' \ 33 | 'debug:uinteger' \ 34 | 'command:string' 35 | } 36 | 37 | ttyd_instance() 38 | { 39 | [ "$2" = 0 ] || { 40 | echo "validation failed" 41 | return 1 42 | } 43 | 44 | [ "$enable" = 0 ] && return 1 45 | [ -z "$command" ] && return 1 46 | 47 | [ "${interface::1}" = @ ] && { 48 | interface=$( 49 | . /lib/functions/network.sh 50 | network_get_device device "${interface:1}" 51 | echo -n "$device" 52 | ) 53 | } 54 | 55 | [ "$url_arg" = 0 ] && url_arg="" 56 | [ "$readonly" = 0 ] && readonly="" 57 | [ "$check_origin" = 0 ] && check_origin="" 58 | [ "$once" = 0 ] && once="" 59 | [ "$ipv6" = 0 ] && ipv6="" 60 | [ "$ssl" = 0 ] && ssl="" 61 | 62 | procd_open_instance 63 | procd_set_param command "$PROG" \ 64 | ${port:+-p $port} \ 65 | #${interface:+-i $interface} \ 66 | ${credential:+-c $credential} \ 67 | ${uid:+-u $uid} \ 68 | ${gid:+-g $gid} \ 69 | ${signal:+-s $signal} \ 70 | ${url_arg:+-a} \ 71 | ${readonly:+-R} \ 72 | ${terminal_type:+-T $terminal_type} \ 73 | ${check_origin:+-O} \ 74 | ${max_clients:+-m $max_clients} \ 75 | ${once:+-o} \ 76 | ${index:+-I $index} \ 77 | ${ipv6:+-6} \ 78 | ${ssl:+-S} \ 79 | ${ssl_cert:+-C $ssl_cert} \ 80 | ${ssl_key:+-K $ssl_key} \ 81 | ${ssl_ca:+-A $ssl_ca} \ 82 | ${debug:+-d $debug} 83 | config_list_foreach "$1" client_option "procd_append_param command -t" 84 | procd_append_param command $command 85 | procd_set_param stdout 1 86 | procd_set_param stderr 1 87 | procd_close_instance 88 | } 89 | 90 | start_service() { 91 | config_load "$NAME" 92 | config_foreach validate_section_ttyd ttyd ttyd_instance 93 | } 94 | 95 | shutdown() { 96 | # close all open connections 97 | killall "$NAME" 98 | } 99 | 100 | service_triggers() { 101 | procd_add_reload_trigger "$NAME" 102 | } 103 | -------------------------------------------------------------------------------- /build/openwrt_amlogic/files/etc/openclash/core/clash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gd0772/AutoBuild-OpenWrt/87e0032ffea12db01d124a01a8fea64d16561194/build/openwrt_amlogic/files/etc/openclash/core/clash -------------------------------------------------------------------------------- /build/openwrt_amlogic/files/etc/opkg/distfeeds.conf: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /build/openwrt_amlogic/files/www/luci-static/argon/background/bj.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gd0772/AutoBuild-OpenWrt/87e0032ffea12db01d124a01a8fea64d16561194/build/openwrt_amlogic/files/www/luci-static/argon/background/bj.jpg -------------------------------------------------------------------------------- /build/openwrt_amlogic/patches/README: -------------------------------------------------------------------------------- 1 | 存放制作好的补丁文件 2 | 存放补丁有两种方法 3 | 1、在这里按 Add file 然后选 Create new file 然后补丁名字,下面大方框粘贴补丁内容,然后最下面绿色按钮保存 4 | 2、在这里按 Create new file 然后选择 Upload files 然后把在你电脑上的补丁文件拖进来,等文件传输完毕,然后最下绿色按钮保存就可以了 5 | -------------------------------------------------------------------------------- /build/openwrt_amlogic/settings.ini: -------------------------------------------------------------------------------- 1 | REPO_URL="https://github.com/coolsnowwolf/lede" # 编译固件源码链接(请勿修改) 2 | REPO_BRANCH="master" # 源码链接的分支(请勿修改) 3 | CONFIG_FILE="aarch64_cortex-a53.config" # 配置文件(可SSH远程定制固件插件,也可在本地提取配置粘贴到此文件) 4 | DIY_PART_SH="diy-part.sh" # 自定义文件(增加插件或者修改IP之类的自定义设置) 5 | UPLOAD_BIN_DIR="true" # 上传【bin文件夹】到github空间(true=开启)(false=关闭) 6 | UPLOAD_CONFIG="true" # 上传【.config】配置文件到github空间(true=开启)(false=关闭) 7 | UPLOAD_FIRMWARE="true" # 上传固件到github空间(true=开启)(false=关闭) 8 | UPLOAD_COWTRANSFER="false" # 上传固件到到【奶牛快传】和【WETRANSFER】(true=开启)(false=关闭) 9 | UPLOAD_RELEASE="false" # 发布固件(true=开启)(false=关闭) 10 | SERVERCHAN_SCKEY="true" # 微信、电报或push推送,默认电报,需要其他的请看微信通知说明替换代码(true=开启)(false=关闭) 11 | BY_INFORMATION="true" # 是否显示编译信息,如出现信息显示错误导致编译进行不了,请关闭(true=开启)(false=关闭) 12 | USE_CACHEWRTBUILD="false" # 是否开启缓存加速,如出现带有缓存编译时莫名错误导致失败的,请关闭(true=开启)(false=关闭) 13 | AUTOMATIC_AMLOGIC="false" # N1和晶晨系列固件自动打包成 .img 固件(true=开启)(false=关闭) 14 | -------------------------------------------------------------------------------- /img/opimg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gd0772/AutoBuild-OpenWrt/87e0032ffea12db01d124a01a8fea64d16561194/img/opimg.png --------------------------------------------------------------------------------