├── .github ├── ISSUE_TEMPLATE │ └── bug-report.md └── workflows │ ├── compile-kernel.yml │ ├── delete-older-releases-workflows.yml │ └── packaging-openwrt.yml ├── .gitignore ├── LICENSE ├── README.cn.md ├── README.md ├── action.yml └── openwrt_flippy.sh /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | --- 8 | 9 | **Device Information | 设备信息** 10 | - SOC: [e.g. S095x3] 11 | - Model [e.g. HK1] 12 | 13 | **OpenWrt Version | 系统版本** 14 | - Kernel Version: [e.g. 5.15.100] 15 | - Release: [e.g. official/lede/immortalwrt] 16 | 17 | **Describe the bug | 问题描述** 18 | All issues will only remain open for one week to prioritize resolving them. 19 | After that period, they will be closed but can still continue to be discussed in the thread. 20 | 所有的问题都只保留一周的开启状态供重点关注解决,超时将关闭,但仍然可以长期继续跟帖讨论。 21 | 22 | Please provide a detailed description of the issue and, if necessary, attach a screenshot. 23 | 详细描述问题,并在必要时附上屏幕截图。 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /.github/workflows/compile-kernel.yml: -------------------------------------------------------------------------------- 1 | #========================================================================== 2 | # Description: Compile the kernel using docker 3 | # Copyright (C) 2021 https://github.com/unifreq/openwrt_packit 4 | # Copyright (C) 2021 https://github.com/ophub/amlogic-s9xxx-armbian 5 | #========================================================================== 6 | 7 | name: Compile the kernel using docker 8 | 9 | on: 10 | repository_dispatch: 11 | workflow_dispatch: 12 | inputs: 13 | kernel_source: 14 | description: "Select the kernel source" 15 | required: false 16 | default: "unifreq" 17 | type: choice 18 | options: 19 | - unifreq 20 | - codesnas 21 | kernel_version: 22 | description: "Select kernel version" 23 | required: false 24 | default: "6.12.y" 25 | type: choice 26 | options: 27 | - 5.4.y 28 | - 5.10.y 29 | - 5.15.y 30 | - 6.1.y 31 | - 6.6.y 32 | - 6.12.y 33 | - 5.4.y_5.10.y 34 | - 5.15.y_6.1.y 35 | - 6.6.y_6.12.y 36 | - 5.4.y_5.10.y_5.15.y 37 | - 6.1.y_6.6.y_6.12.y 38 | - all 39 | kernel_auto: 40 | description: "Auto use the latest kernel" 41 | required: false 42 | default: true 43 | type: boolean 44 | silent_log: 45 | description: "Use silent logging" 46 | required: false 47 | default: true 48 | type: boolean 49 | delete_source: 50 | description: "Delete the source after compilation" 51 | required: false 52 | default: true 53 | type: boolean 54 | kernel_package: 55 | description: "Select compile package list" 56 | required: false 57 | default: "all" 58 | type: choice 59 | options: 60 | - all 61 | - dtbs 62 | kernel_toolchain: 63 | description: "Select the compilation toolchain" 64 | required: false 65 | default: "gcc" 66 | type: choice 67 | options: 68 | - clang 69 | - gcc 70 | - gcc-14.2 71 | compress_format: 72 | description: "Set the initrd compression format" 73 | required: false 74 | default: "xz" 75 | type: choice 76 | options: 77 | - xz 78 | - gzip 79 | - zstd 80 | - lzma 81 | docker_image: 82 | description: "Select Armbian docker image" 83 | required: false 84 | default: "bookworm" 85 | type: choice 86 | options: 87 | - jammy 88 | - noble 89 | - bookworm 90 | - bullseye 91 | kernel_sign: 92 | description: "Set the kernel custom signature" 93 | required: false 94 | default: "-ophub" 95 | type: choice 96 | options: 97 | - -ophub 98 | - -yourname 99 | 100 | env: 101 | TZ: America/New_York 102 | 103 | jobs: 104 | build: 105 | runs-on: ubuntu-22.04-arm 106 | if: ${{ github.event.repository.owner.id }} == ${{ github.event.sender.id }} 107 | 108 | steps: 109 | - name: Checkout 110 | uses: actions/checkout@v4 111 | 112 | - name: Initialization environment 113 | id: init 114 | env: 115 | DEBIAN_FRONTEND: noninteractive 116 | run: | 117 | docker rmi $(docker images -q) 2>/dev/null 118 | [[ -n "${AGENT_TOOLSDIRECTORY}" ]] && sudo rm -rf "${AGENT_TOOLSDIRECTORY}" 119 | sudo rm -rf /usr/share/dotnet /usr/local/lib/android 2>/dev/null 120 | sudo swapoff -a 121 | sudo rm -f /swapfile /mnt/swapfile 122 | sudo -E apt-get -y update 123 | sudo -E apt-get -y purge azure-cli ghc* zulu* llvm* firefox google* dotnet* powershell openjdk* mongodb* moby* || true 124 | sudo -E apt-get -y install $(curl -fsSL https://tinyurl.com/ubuntu2204-build-armbian) 125 | sudo -E systemctl daemon-reload 126 | #sudo -E apt-get -y full-upgrade 127 | sudo -E apt-get -y autoremove --purge 128 | sudo -E apt-get clean 129 | sudo sed -i '/NVM_DIR/d;/skel/d' /root/{.bashrc,.profile} 130 | sudo rm -rf ~/{.cargo,.dotnet,.rustup} 131 | sudo timedatectl set-timezone "${TZ}" 132 | echo "status=success" >> ${GITHUB_OUTPUT} 133 | 134 | - name: Create simulated physical disk 135 | id: disk 136 | run: | 137 | mnt_size=$(expr $(df -h /mnt | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 1) 138 | root_size=$(expr $(df -h / | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 4) 139 | sudo truncate -s "${mnt_size}"G /mnt/mnt.img 140 | sudo truncate -s "${root_size}"G /root.img 141 | sudo losetup /dev/loop6 /mnt/mnt.img 142 | sudo losetup /dev/loop7 /root.img 143 | sudo pvcreate /dev/loop6 144 | sudo pvcreate /dev/loop7 145 | sudo vgcreate github /dev/loop6 /dev/loop7 146 | sudo lvcreate -n runner -l 100%FREE github 147 | sudo mkfs.xfs /dev/github/runner 148 | sudo mkdir -p /builder 149 | sudo mount /dev/github/runner /builder 150 | sudo chown -R runner.runner /builder 151 | df -Th 152 | echo "status=success" >> ${GITHUB_OUTPUT} 153 | 154 | - name: Install Docker 155 | id: install 156 | working-directory: /builder 157 | if: ${{ steps.disk.outputs.status }} == 'success' && !cancelled() 158 | run: | 159 | df -hT ${PWD} 160 | curl -fsSL https://get.docker.com | sh 161 | sudo usermod -aG docker $USER 162 | sudo newgrp docker 163 | echo "status=success" >> ${GITHUB_OUTPUT} 164 | 165 | - name: Pull Docker Image [ ${{ inputs.docker_image }} ] 166 | id: pull 167 | working-directory: /builder 168 | if: ${{ steps.install.outputs.status }} == 'success' && !cancelled() 169 | run: | 170 | # Create a docker mapping directory 171 | mkdir -p /builder/compile-kernel/{kernel,output} 172 | ln -sf /builder/compile-kernel/kernel /home/runner/work/_actions/ophub/amlogic-s9xxx-armbian/main/compile-kernel/kernel 173 | ln -sf /builder/compile-kernel/output /home/runner/work/_actions/ophub/amlogic-s9xxx-armbian/main/compile-kernel/output 174 | 175 | # Pull the Armbian Docker image 176 | docker run -d --privileged \ 177 | --name armbian-ophub \ 178 | -v /builder/compile-kernel:/opt/kernel/compile-kernel \ 179 | --restart=always \ 180 | ophub/armbian-${{ inputs.docker_image }}:latest 181 | 182 | echo "status=success" >> ${GITHUB_OUTPUT} 183 | 184 | - name: Compile the kernel [ ${{ inputs.kernel_version }} ] 185 | uses: ophub/amlogic-s9xxx-armbian@main 186 | if: ${{ steps.pull.outputs.status }} == 'success' && !cancelled() 187 | with: 188 | build_target: kernel 189 | kernel_source: ${{ inputs.kernel_source }} 190 | kernel_version: ${{ inputs.kernel_version }} 191 | kernel_auto: ${{ inputs.kernel_auto }} 192 | delete_source: ${{ inputs.delete_source }} 193 | kernel_package: ${{ inputs.kernel_package }} 194 | kernel_sign: ${{ inputs.kernel_sign }} 195 | kernel_toolchain: ${{ inputs.kernel_toolchain }} 196 | compress_format: ${{ inputs.compress_format }} 197 | silent_log: ${{ inputs.silent_log }} 198 | 199 | - name: Upload Kernel to Release 200 | uses: ncipollo/release-action@main 201 | if: ${{ env.PACKAGED_STATUS }} == 'success' && !cancelled() 202 | with: 203 | tag: kernel_stable 204 | artifacts: ${{ env.PACKAGED_OUTPUTPATH }}/* 205 | allowUpdates: true 206 | removeArtifacts: false 207 | replacesArtifacts: true 208 | token: ${{ secrets.GITHUB_TOKEN }} 209 | body: | 210 | The kernel can be used to compile Armbian and OpenWrt. 211 | The kernel source code comes from: ${{ inputs.kernel_source }} 212 | The kernel compilation toolchain: ${{ inputs.kernel_toolchain }} 213 | -------------------------------------------------------------------------------- /.github/workflows/delete-older-releases-workflows.yml: -------------------------------------------------------------------------------- 1 | #========================================================================== 2 | # https://github.com/ophub/flippy-openwrt-actions 3 | # Description: Delete older releases and workflows runs 4 | #========================================================================== 5 | 6 | name: Delete older releases and workflows 7 | 8 | on: 9 | repository_dispatch: 10 | workflow_dispatch: 11 | inputs: 12 | delete_releases: 13 | description: "Delete Releases file?" 14 | required: true 15 | default: true 16 | type: boolean 17 | delete_tags: 18 | description: "Delete related Tags?" 19 | required: false 20 | default: true 21 | type: boolean 22 | prerelease_option: 23 | description: "Whether to differentiate pre-release." 24 | required: false 25 | default: "all" 26 | type: choice 27 | options: 28 | - all 29 | - true 30 | - false 31 | releases_keep_latest: 32 | description: "How many latest releases to keep." 33 | required: false 34 | default: "1" 35 | type: choice 36 | options: 37 | - 30 38 | - 20 39 | - 10 40 | - 9 41 | - 8 42 | - 7 43 | - 6 44 | - 5 45 | - 4 46 | - 3 47 | - 2 48 | - 1 49 | - 0 50 | releases_keep_keyword: 51 | description: "Keyword of the keep releases." 52 | required: false 53 | default: "v0/_save_/kernel_" 54 | delete_workflows: 55 | description: "Delete workflows records?" 56 | required: true 57 | default: true 58 | type: boolean 59 | workflows_keep_day: 60 | description: "Days to keep workflows." 61 | required: false 62 | default: "1" 63 | type: choice 64 | options: 65 | - 30 66 | - 20 67 | - 10 68 | - 9 69 | - 8 70 | - 7 71 | - 6 72 | - 5 73 | - 4 74 | - 3 75 | - 2 76 | - 1 77 | - 0 78 | workflows_keep_keyword: 79 | description: "keywords for keep workflows." 80 | required: false 81 | default: "" 82 | out_log: 83 | description: "Output detailed JSON logs." 84 | required: false 85 | default: true 86 | type: boolean 87 | 88 | env: 89 | TZ: America/New_York 90 | 91 | jobs: 92 | build: 93 | runs-on: ubuntu-22.04 94 | if: ${{ github.event.repository.owner.id }} == ${{ github.event.sender.id }} 95 | 96 | steps: 97 | - name: Checkout 98 | uses: actions/checkout@v4 99 | 100 | - name: Initialization environment 101 | id: init 102 | env: 103 | DEBIAN_FRONTEND: noninteractive 104 | run: | 105 | sudo timedatectl set-timezone "${TZ}" 106 | echo "status=success" >> ${GITHUB_OUTPUT} 107 | 108 | - name: Delete releases and workflows runs 109 | uses: ophub/delete-releases-workflows@main 110 | with: 111 | delete_releases: ${{ inputs.delete_releases }} 112 | delete_tags: ${{ inputs.delete_tags }} 113 | prerelease_option: ${{ inputs.prerelease_option }} 114 | releases_keep_latest: ${{ inputs.releases_keep_latest }} 115 | releases_keep_keyword: ${{ inputs.releases_keep_keyword }} 116 | delete_workflows: ${{ inputs.delete_workflows }} 117 | workflows_keep_day: ${{ inputs.workflows_keep_day }} 118 | workflows_keep_keyword: ${{ inputs.workflows_keep_keyword }} 119 | out_log: ${{ inputs.out_log }} 120 | gh_token: ${{ secrets.GITHUB_TOKEN }} 121 | -------------------------------------------------------------------------------- /.github/workflows/packaging-openwrt.yml: -------------------------------------------------------------------------------- 1 | #========================================================================== 2 | # Description: Packaging OpenWrt 3 | # Copyright (C) 2021 https://github.com/unifreq/openwrt_packit 4 | # Copyright (C) 2021 https://github.com/ophub/flippy-openwrt-actions 5 | #========================================================================== 6 | 7 | name: Packaging OpenWrt 8 | 9 | on: 10 | repository_dispatch: 11 | workflow_dispatch: 12 | inputs: 13 | openwrt_soc: 14 | description: "Select device board." 15 | required: false 16 | default: "all" 17 | type: choice 18 | options: 19 | - all 20 | - s922x_s905x3_s905x2_s912_s905d_s905 21 | - ak88 22 | - beikeyun 23 | - cm3 24 | - e20c 25 | - e24c 26 | - e25 27 | - e52c 28 | - e54c 29 | - ht2 30 | - h28k 31 | - h66k 32 | - h68k 33 | - h69k 34 | - h69k-max 35 | - h88k 36 | - h88k-v3 37 | - jp-tvbox 38 | - l1pro 39 | - photonicat 40 | - qemu 41 | - r66s 42 | - r68s 43 | - rock5b 44 | - rock5c 45 | - rk3399 46 | - s905 47 | - s905d 48 | - s905x2 49 | - s905x3 50 | - s912 51 | - s922x 52 | - s922x-n2 53 | - vplus 54 | - watermelon-pi 55 | - zcube1-max 56 | - diy 57 | customize_rk3399: 58 | description: "Set customize rk3399 devices" 59 | required: false 60 | default: "none" 61 | type: choice 62 | options: 63 | - tvi3315a:rk3399-tvi3315a.dtb/sw799:rk3399-bozz-sw799.dtb 64 | - none 65 | openwrt_kernel: 66 | description: "Select kernel version" 67 | required: false 68 | default: "6.1.y_6.12.y" 69 | type: choice 70 | options: 71 | - 5.4.y 72 | - 5.10.y 73 | - 5.15.y 74 | - 6.1.y 75 | - 6.6.y 76 | - 6.12.y 77 | - 5.4.y_5.10.y 78 | - 5.15.y_6.1.y 79 | - 6.1.y_6.12.y 80 | - 6.1.y_6.6.y 81 | - 6.6.y_6.12.y 82 | kernel_repo: 83 | description: "Set the kernel repository" 84 | required: false 85 | default: "ophub/kernel" 86 | type: choice 87 | options: 88 | - ophub/kernel 89 | - breakingbadboy/OpenWrt 90 | auto_kernel: 91 | description: "Auto use the latest kernel" 92 | required: false 93 | default: true 94 | type: boolean 95 | script_diy_path: 96 | description: "Set custom script loading path" 97 | required: false 98 | default: "" 99 | openwrt_storage: 100 | description: "Select image storage type." 101 | required: false 102 | default: "save" 103 | type: choice 104 | options: 105 | - save 106 | - temp 107 | builder_name: 108 | description: "Set OpenWrt builder signature." 109 | required: false 110 | default: "ophub" 111 | type: choice 112 | options: 113 | - ophub 114 | - angel 115 | - yourname 116 | 117 | env: 118 | TZ: America/New_York 119 | 120 | jobs: 121 | build: 122 | runs-on: ubuntu-22.04 123 | if: ${{ github.event.repository.owner.id }} == ${{ github.event.sender.id }} 124 | 125 | steps: 126 | - name: Checkout 127 | uses: actions/checkout@v4 128 | 129 | - name: Initialization environment 130 | id: init 131 | env: 132 | DEBIAN_FRONTEND: noninteractive 133 | run: | 134 | docker rmi $(docker images -q) 2>/dev/null 135 | [[ -n "${AGENT_TOOLSDIRECTORY}" ]] && sudo rm -rf "${AGENT_TOOLSDIRECTORY}" 136 | sudo rm -rf /usr/share/dotnet /usr/local/lib/android 2>/dev/null 137 | sudo swapoff -a 138 | sudo rm -f /swapfile /mnt/swapfile 139 | sudo -E apt-get -y update 140 | sudo -E apt-get -y purge azure-cli ghc* zulu* llvm* firefox google* dotnet* powershell openjdk* mongodb* moby* || true 141 | sudo -E apt-get -y install $(curl -fsSL https://tinyurl.com/ubuntu2204-make-openwrt) 142 | sudo -E systemctl daemon-reload 143 | #sudo -E apt-get -y full-upgrade 144 | sudo -E apt-get -y autoremove --purge 145 | sudo -E apt-get clean 146 | sudo sed -i '/NVM_DIR/d;/skel/d' /root/{.bashrc,.profile} 147 | sudo rm -rf ~/{.cargo,.dotnet,.rustup} 148 | sudo timedatectl set-timezone "${TZ}" 149 | echo "status=success" >> ${GITHUB_OUTPUT} 150 | 151 | - name: Create simulated physical disk 152 | run: | 153 | mnt_size=$(expr $(df -h /mnt | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 1) 154 | root_size=$(expr $(df -h / | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 4) 155 | sudo truncate -s "${mnt_size}"G /mnt/mnt.img 156 | sudo truncate -s "${root_size}"G /root.img 157 | sudo losetup /dev/loop6 /mnt/mnt.img 158 | sudo losetup /dev/loop7 /root.img 159 | sudo pvcreate /dev/loop6 160 | sudo pvcreate /dev/loop7 161 | sudo vgcreate github /dev/loop6 /dev/loop7 162 | sudo lvcreate -n runner -l 100%FREE github 163 | sudo mkfs.xfs /dev/github/runner 164 | sudo mkdir -p /builder 165 | sudo mount /dev/github/runner /builder 166 | sudo chown -R runner.runner /builder 167 | df -Th 168 | 169 | - name: Download armvirt file 170 | id: download 171 | working-directory: /builder 172 | if: ${{ steps.init.outputs.status }} == 'success' && !cancelled() 173 | run: | 174 | armvirt_tarfile_repo="ophub/amlogic-s9xxx-openwrt" 175 | releases_tag_keywords="OpenWrt_lede" 176 | 177 | armvirt_tarfile_path="openwrt/bin/targets/armvirt/64" 178 | [[ -d "${armvirt_tarfile_path}" ]] || mkdir -p ${armvirt_tarfile_path} 179 | ln -sf /builder/openwrt ${GITHUB_WORKSPACE}/openwrt 180 | 181 | latest_version=$(curl -s \ 182 | -H "Accept: application/vnd.github+json" \ 183 | -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ 184 | https://api.github.com/repos/${armvirt_tarfile_repo}/releases?per_page=100 | \ 185 | jq -r --arg RTK "${releases_tag_keywords}" \ 186 | --arg BOARD "-rootfs.tar.gz" \ 187 | '[.[] | select(.tag_name | contains($RTK))] | 188 | map(.assets[] | select(.browser_download_url | endswith($BOARD))) | 189 | sort_by(.updated_at) | 190 | reverse | 191 | .[0] | 192 | {data: .updated_at, url: .browser_download_url}') 193 | 194 | [[ -z "${latest_version}" || "${latest_version}" == "null" ]] && echo "Invalid OpenWrt rootfs download address." && exit 1 195 | latest_updated_at="$(echo ${latest_version} | jq -r '.data')" 196 | latest_url="$(echo ${latest_version} | jq -r '.url')" 197 | 198 | openwrt_filename="${latest_url##*/}" 199 | curl -fsSL "${latest_url}" -o "${armvirt_tarfile_path}/${openwrt_filename}" 200 | [[ "${?}" -ne "0" ]] && echo "Invalid OpenWrt rootfs download address." && exit 1 201 | 202 | echo "build_tag=${releases_tag_keywords}_${{ inputs.openwrt_storage }}_$(date +"%Y.%m")" >> ${GITHUB_OUTPUT} 203 | echo "status=success" >> ${GITHUB_OUTPUT} 204 | 205 | - name: Clone packit source code 206 | working-directory: /builder 207 | if: ${{ steps.init.outputs.status }} == 'success' && !cancelled() 208 | run: | 209 | SCRIPT_REPO_URL="https://github.com/unifreq/openwrt_packit" 210 | SCRIPT_REPO_BRANCH="master" 211 | SELECT_PACKITPATH="openwrt_packit" 212 | git clone -q --single-branch --depth=1 --branch=${SCRIPT_REPO_BRANCH} ${SCRIPT_REPO_URL} ${SELECT_PACKITPATH} 213 | ln -sf /builder/${SELECT_PACKITPATH} /opt/${SELECT_PACKITPATH} 214 | 215 | - name: Package OpenWrt Firmware 216 | uses: ophub/flippy-openwrt-actions@main 217 | if: ${{ steps.download.outputs.status }} == 'success' && !cancelled() 218 | env: 219 | OPENWRT_ARMSR: openwrt/bin/targets/*/*/*rootfs.tar.gz 220 | SELECT_PACKITPATH: openwrt_packit 221 | PACKAGE_SOC: ${{ inputs.openwrt_soc }} 222 | KERNEL_REPO_URL: ${{ inputs.kernel_repo }} 223 | KERNEL_VERSION_NAME: ${{ inputs.openwrt_kernel }} 224 | KERNEL_AUTO_LATEST: ${{ inputs.auto_kernel }} 225 | CUSTOMIZE_RK3399: ${{ inputs.customize_rk3399 }} 226 | SCRIPT_DIY_PATH: ${{ inputs.script_diy_path }} 227 | WHOAMI: ${{ inputs.builder_name }} 228 | 229 | - name: Upload OpenWrt Firmware to Release 230 | uses: ncipollo/release-action@main 231 | if: ${{ env.PACKAGED_STATUS }} == 'success' && !cancelled() 232 | with: 233 | tag: ${{ steps.download.outputs.build_tag }} 234 | artifacts: ${{ env.PACKAGED_OUTPUTPATH }}/* 235 | allowUpdates: true 236 | removeArtifacts: false 237 | replacesArtifacts: true 238 | token: ${{ secrets.GITHUB_TOKEN }} 239 | body: | 240 | ### OpenWrt Image information 241 | - Default IP: 192.168.1.1 242 | - Default username: root 243 | - Default password: password 244 | - Default WIFI name: OpenWrt 245 | - Default WIFI password: none 246 | ### Install to EMMC 247 | - Login to OpenWrt → System → Amlogic Service → Install OpenWrt 248 | ### OpenWrt source code 249 | - [lede](https://github.com/coolsnowwolf/lede) 250 | ### OpenWrt Image Verification 251 | - sha256sum 252 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | !.gitignore 2 | .DS_Store 3 | npm-debug.log* 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.cn.md: -------------------------------------------------------------------------------- 1 | # 功能说明 2 | 3 | 查看英文说明 | [View English description](README.md) 4 | 5 | [unifreq/openwrt_packit](https://github.com/unifreq/openwrt_packit) 是 `Flippy` 开发的 OpenWrt 打包脚本仓库。支持全志(微加云)、瑞芯微(贝壳云,我家云,电犀牛R66S/R68S,瑞莎5B/E25,西瓜皮等),以及晶晨 S9xxx 系列型号如 S905x3、S905x2、S922x、S905x、S905d,S905,S912 等设备。 6 | 7 | 此 Actions 使用他的打包脚本,未做任何修改,仅进行了智能化 Action 应用开发,让使用 github Actions 打包时变得更加简单化和个性化。 8 | 9 | ## 使用方法 10 | 11 | 在 `.github/workflows/*.yml` 云编译脚本中引入此 Actions 即可使用,例如 [packaging-openwrt.yml](.github/workflows/packaging-openwrt.yml)。代码如下: 12 | 13 | ```yaml 14 | - name: Package OpenWrt Firmware 15 | uses: ophub/flippy-openwrt-actions@main 16 | env: 17 | OPENWRT_ARMSR: openwrt/bin/targets/*/*/*.tar.gz 18 | PACKAGE_SOC: all 19 | KERNEL_VERSION_NAME: 6.1.y_6.6.y 20 | KERNEL_AUTO_LATEST: true 21 | ``` 22 | 23 | ## 可选参数说明 24 | 25 | 根据 `Flippy` 最新发布的内核打包脚本,对 `打包文件`、`make.env`、`选择内核版本`、`选择盒子SoC` 等进行了可选参数配置。 26 | 27 | | 参数 | 默认值 | 说明 | 28 | |------------------------|------------------------|------------------------------------------------| 29 | | OPENWRT_ARMSR | 无 | 必选项. 设置 `openwrt-armsr-armv8-generic-rootfs.tar.gz` 的文件路径,可以使用相对路径如 `openwrt/bin/targets/*/*/*.tar.gz` 或 网络文件下载地址如 `https://github.com/*/releases/*/*.tar.gz` | 30 | | SCRIPT_REPO_URL | unifreq/openwrt_packit | 设置打包脚本源码仓库的 `/` | 31 | | SCRIPT_REPO_BRANCH | master | 设置打包脚本源码仓库的分支 | 32 | | KERNEL_REPO_URL | breakingbadboy/OpenWrt | 设置内核下载仓库的 `/`,默认从 breakingbadboy 维护的[内核 Releases](https://github.com/breakingbadboy/OpenWrt/releases/tag/kernel_stable)里下载。 | 33 | | KERNEL_VERSION_NAME | 6.1.y_6.6.y | 设置[内核版本](https://github.com/breakingbadboy/OpenWrt/releases/tag/kernel_stable),可以查看并选择指定。可指定单个内核如 `6.1.y` ,可选择多个内核用`_`连接如 `6.1.y_6.6.y` | 34 | | KERNEL_AUTO_LATEST | true | 设置是否自动采用同系列最新版本内核。当为 `true` 时,将自动在内核库中查找在 `KERNEL_VERSION_NAME` 中指定的内核如 `6.1.y` 的同系列是否有更新的版本,如有更新版本时,将自动更换为最新版。设置为 `false` 时将编译指定版本内核。 | 35 | | PACKAGE_SOC | all | 设置打包盒子的 `SOC` ,默认 `all` 打包全部盒子,可指定单个盒子如 `s905x3` ,可选择多个盒子用`_`连接如 `s905x3_s905d` 。各盒子的SoC代码为:`vplus`, `cm3`, `jp-tvbox`, `beikeyun`, `l1pro`, `rock5b`, `rock5c`, `e52c`, `e54c`, `r66s`, `r68s`, `e25`, `photonicat`, `watermelon-pi`, `zcube1-max`, `ak88`, `ht2`, `e20c`, `e24c`, `h28k`, `h66k`, `h68k`, `h69k`, `h69k-max`, `h88k`, `h88k-v3`, `rk3399`, `s905`, `s905d`, `s905x2`, `s905x3`, `s912`, `s922x`, `s922x-n2`, `qemu`, `diy`。说明:`s922x-n2` 是 `s922x-odroid-n2`, `diy` 是自定义盒子。 | 36 | | GZIP_IMGS | auto | 设置打包完毕后文件压缩的格式,可选值 `.gz`(默认) / `.xz` / `.zip` / `.zst` / `.7z` | 37 | | SELECT_PACKITPATH | openwrt_packit | 设置 `/opt` 下的打包目录名称 | 38 | | SELECT_OUTPUTPATH | output | 设置 `${SELECT_PACKITPATH}` 目录中固件输出的目录名称 | 39 | | SCRIPT_VPLUS | mk_h6_vplus.sh | 设置打包 `h6 vplus` 的脚本文件名 | 40 | | SCRIPT_CM3 | mk_rk3566_radxa-cm3-rpi-cm4-io.sh | 设置打包 `rk3566 radxa-cm3-rpi-cm4-io` 的脚本文件名 | 41 | | SCRIPT_HT2 | mk_rk3528_ht2.sh | 设置打包 `rk3528 ht2` 的脚本文件名 | 42 | | SCRIPT_E20C | mk_rk3528_e20c.sh | 设置打包 `rk3528 e20c` 的脚本文件名 | 43 | | SCRIPT_E24C | mk_rk3528_e24c.sh | 设置打包 `rk3528 e24c` 的脚本文件名 | 44 | | SCRIPT_H28K | mk_rk3528_h28k.sh | 设置打包 `rk3528 h28k` 的脚本文件名 | 45 | | SCRIPT_H66K | mk_rk3568_h66k.sh | 设置打包 `rk3568 h66k` 的脚本文件名 | 46 | | SCRIPT_H68K | mk_rk3568_h68k.sh | 设置打包 `rk3568 h68k` 的脚本文件名 | 47 | | SCRIPT_H69K | mk_rk3568_h69k.sh | 设置打包 `rk3568 h69k` 的脚本文件名 | 48 | | SCRIPT_H88K | mk_rk3588_h88k.sh | 设置打包 `rk3588 h88k/ak88` 的脚本文件名 | 49 | | SCRIPT_H88KV3 | mk_rk3588_h88k-v3.sh | 设置打包 `rk3588 h88k-v3` 的脚本文件名 | 50 | | SCRIPT_JPTVBOX | mk_rk3566_jp-tvbox.sh | 设置打包 `rk3566 jp-tvbox` 的脚本文件名 | 51 | | SCRIPT_BEIKEYUN | mk_rk3328_beikeyun.sh | 设置打包 `rk3328 beikeyun` 的脚本文件名 | 52 | | SCRIPT_L1PRO | mk_rk3328_l1pro.sh | 设置打包 `rk3328 l1pro` 的脚本文件名 | 53 | | SCRIPT_ZCUBE1MAX | mk_rk3399_zcube1-max.sh | 设置打包 `rk3399 zcube1-max` 的脚本文件名 | 54 | | SCRIPT_ROCK5B | mk_rk3588_rock5b.sh | 设置打包 `rk3588 rock5b` 的脚本文件名 | 55 | | SCRIPT_ROCK5C | mk_rk3588s_rock5c.sh | 设置打包 `rk3588s rock5c` 的脚本文件名 | 56 | | SCRIPT_E52C | mk_rk3588s_e52c.sh | 设置打包 `rk3588s e52c` 的脚本文件名 | 57 | | SCRIPT_E54C | mk_rk3588s_e54c.sh | 设置打包 `rk3588s e54c` 的脚本文件名 | 58 | | SCRIPT_R66S | mk_rk3568_r66s.sh | 设置打包 `rk3568 r66s` 的脚本文件名 | 59 | | SCRIPT_R68S | mk_rk3568_r68s.sh | 设置打包 `rk3568 r68s` 的脚本文件名 | 60 | | SCRIPT_E25 | mk_rk3568_e25.sh | 设置打包 `rk3568 e25` 的脚本文件名 | 61 | | SCRIPT_PHOTONICAT | mk_rk3568_photonicat.sh | 设置打包 `rk3568 photonicat` 的脚本文件名 | 62 | | SCRIPT_WATERMELONPI | mk_rk3568_watermelon-pi.sh | 设置打包 `rk3568 watermelon-pi` 的脚本文件名 | 63 | | SCRIPT_S905 | mk_s905_mxqpro+.sh | 设置打包 `s905 mxqpro+` 的脚本文件名 | 64 | | SCRIPT_S905D | mk_s905d_n1.sh | 设置打包 `s905d n1` 的脚本文件名 | 65 | | SCRIPT_S905X2 | mk_s905x2_x96max.sh | 设置打包 `s905x2 x96max` 的脚本文件名 | 66 | | SCRIPT_S905X3 | mk_s905x3_multi.sh | 设置打包 `s905x3 multi` 的脚本文件名 | 67 | | SCRIPT_S912 | mk_s912_zyxq.sh | 设置打包 `s912 zyxq` 的脚本文件名 | 68 | | SCRIPT_S922X | mk_s922x_gtking.sh | 设置打包 `s922x gtking` 的脚本文件名 | 69 | | SCRIPT_S922X_N2 | mk_s922x_odroid-n2.sh | 设置打包 `s922x odroid-n2` 的脚本文件名 | 70 | | SCRIPT_QEMU | mk_qemu-aarch64_img.sh | 设置打包 `qemu` 的脚本文件名 | 71 | | SCRIPT_DIY | mk_diy.sh | 设置打包 `diy` 自定义脚本文件名 | 72 | | SCRIPT_DIY_PATH | 无 | 设置 `SCRIPT_DIY` 文件的来源路径。可以使用网址如 `https://weburl/mydiyfile` 或你仓库中的相对路径如 `script/mk_s905w.sh` | 73 | | CUSTOMIZE_RK3399 | 无 | 设置自定义 rk3399 设备列表,格式:`board1:dtb1/board2:dtb2`。设置为 `none` 表示忽略该选项。 | 74 | | WHOAMI | flippy | 设置 `make.env` 中 `WHOAMI` 参数的值 | 75 | | OPENWRT_VER | auto | 设置 `make.env` 中 `OPENWRT_VER` 参数的值。默认 `auto` 将自动继承文件中的赋值,设置为其他参数时将替换为自定义参数。 | 76 | | SW_FLOWOFFLOAD | 1 | 设置 `make.env` 中 `SW_FLOWOFFLOAD` 参数的值 | 77 | | HW_FLOWOFFLOAD | 0 | 设置 `make.env` 中 `HW_FLOWOFFLOAD` 参数的值 | 78 | | SFE_FLOW | 1 | 设置 `make.env` 中 `SFE_FLOW` 参数的值 | 79 | | ENABLE_WIFI_K504 | 1 | 设置 `make.env` 中 `ENABLE_WIFI_K504` 参数的值 | 80 | | ENABLE_WIFI_K510 | 1 | 设置 `make.env` 中 `ENABLE_WIFI_K510` 参数的值 | 81 | | DISTRIB_REVISION | R$(date +%m.%d) | 设置 `make.env` 中 `DISTRIB_REVISION` 参数的值 | 82 | | DISTRIB_DESCRIPTION | OpenWrt | 设置 `make.env` 中 `DISTRIB_DESCRIPTION` 参数的值 | 83 | 84 | 💡 一般情况下使用默认参数即可,你也可以根据需要进行配置。例如在 Flippy 把打包脚本重命名后导致无法找到原默认脚本文件、make.env 中的固件版本号未更新等情况下,你可以使用可选参数进行实时指定及个性化配置。 85 | 86 | ## 输出参数说明 87 | 88 | 根据 github.com 的标准输出了 3 个环境变量,方便编译步骤后续使用。由于 github.com 最近修改了 fork 仓库的设置,默认关闭了 Workflow 的读写权限,所以上传到 `Releases` 需要设置 `Workflow 读写权限`,详见[使用说明](https://github.com/ophub/amlogic-s9xxx-openwrt/blob/main/documents/README.cn.md#3-fork-仓库并设置工作流权限)。 89 | 90 | | 参数 | 默认值 | 说明 | 91 | |--------------------------------|----------------------------|----------------------------| 92 | | ${{ env.PACKAGED_OUTPUTPATH }} | /opt/openwrt_packit/output | 打包后的固件所在文件夹的路径 | 93 | | ${{ env.PACKAGED_OUTPUTDATE }} | 07.15.1058 | 打包日期 | 94 | | ${{ env.PACKAGED_STATUS }} | success / failure | 打包状态。成功 / 失败 | 95 | 96 | ## 链接 97 | 98 | - [OpenWrt](https://github.com/openwrt/openwrt) 99 | - [coolsnowwolf/lede](https://github.com/coolsnowwolf/lede) 100 | - [immortalwrt](https://github.com/immortalwrt/immortalwrt) 101 | - [unifreq/openwrt_packit](https://github.com/unifreq/openwrt_packit) 102 | - [breakingbadboy/OpenWrt](https://github.com/breakingbadboy/OpenWrt) 103 | 104 | ## License 105 | 106 | The flippy-openwrt-actions © OPHUB is licensed under [GPL-2.0](https://github.com/ophub/flippy-openwrt-actions/blob/main/LICENSE) 107 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Function description 2 | 3 | View Chinese description | [查看中文说明](README.cn.md) 4 | 5 | [unifreq/openwrt_packit](https://github.com/unifreq/openwrt_packit) is an OpenWrt packaging script repository developed by `Flippy`. It supports Allwinner (VPlus), Rockchip (BeikeYun, Chainedbox-L1-Pro, FastRhino-R66S/R68S, Radxa-5B/E25, Watermelon-pi, etc.), and Amlogic S9xxx series models such as S905x3, S905x2, S922x, S905x, S905d, S905, S912, etc. 6 | 7 | This Actions uses his packaging scripts without any modification, only developed into a smart Action application, making the use of github Actions for packaging simpler and more personalized. 8 | 9 | ## Usage 10 | 11 | This Actions can be used by referencing it in the `.github/workflows/*.yml` cloud compilation script, for example [packaging-openwrt.yml](.github/workflows/packaging-openwrt.yml). The code is as follows: 12 | 13 | ```yaml 14 | - name: Package OpenWrt Firmware 15 | uses: ophub/flippy-openwrt-actions@main 16 | env: 17 | OPENWRT_ARMSR: openwrt/bin/targets/*/*/*.tar.gz 18 | PACKAGE_SOC: all 19 | KERNEL_VERSION_NAME: 6.1.y_6.6.y 20 | KERNEL_AUTO_LATEST: true 21 | ``` 22 | 23 | ## Optional Parameters 24 | 25 | Based on the latest kernel packaging scripts released by `Flippy`, optional parameter configurations have been made for `Packaging Files`, `make.env`, `Select Kernel Version`, `Select Box SoC`, and so on. 26 | 27 | | Parameter | Default | Description | 28 | |------------------------|------------------------|---------------------------------------------------------------| 29 | | OPENWRT_ARMSR | None | Required. Set the file path for `openwrt-armsr-armv8-generic-rootfs.tar.gz`. You can use a relative path such as `openwrt/bin/targets/*/*/*.tar.gz` or a web file download link such as `https://github.com/*/releases/*/*.tar.gz` | 30 | | SCRIPT_REPO_URL | unifreq/openwrt_packit | Set `/` of the packaging script source repository | 31 | | SCRIPT_REPO_BRANCH | master | Set the branch of the packaging script source repository | 32 | | KERNEL_REPO_URL | breakingbadboy/OpenWrt | Set `/` of the kernel download repository, it downloads from the [kernel Releases](https://github.com/breakingbadboy/OpenWrt/releases/tag/kernel_stable) maintained by breakingbadboy by default. | 33 | | KERNEL_VERSION_NAME | 6.1.y_6.6.y | Set the [Kernel version](https://github.com/breakingbadboy/OpenWrt/releases/tag/kernel_stable), you can check and select a specific one. You can specify a single kernel such as `6.1.y`, or select multiple kernels connected with `_` like `6.1.y_6.6.y` | 34 | | KERNEL_AUTO_LATEST | true | Set whether to automatically adopt the latest version kernel of the same series. When set to `true`, it will automatically look for whether there is an updated version of the kernel specified in `KERNEL_VERSION_NAME`, such as `6.1.y`, in the kernel library, and if there is an updated version, it will automatically replace it with the latest version. When set to `false`, it will compile the specified version kernel. | 35 | | PACKAGE_SOC | all | Set the `SOC` of the package box, the default is `all` to package all boxes, you can specify a single box like `s905x3`, or select multiple boxes connected with `_` like `s905x3_s905d`. The SoC codes for each box are: `vplus`, `cm3`, `jp-tvbox`, `beikeyun`, `l1pro`, `rock5b`, `rock5c`, `e52c`, `e54c`, `r66s`, `r68s`, `e25`, `photonicat`, `watermelon-pi`, `zcube1-max`, `ht2`, `e20c`, `e24c`, `h28k`, `h66k`, `h68k`, `h69k`, `h69k-max`, `h88k`, `h88k-v3`, `rk3399`, `s905`, `s905d`, `s905x2`, `s905x3`, `s912`, `s922x`, `s922x-n2`, `qemu`, `diy`. Note: `s922x-n2` is `s922x-odroid-n2`, `diy` is a custom box. | 36 | | GZIP_IMGS | auto | Set the format of the file compression after packaging, optional values are `.gz` (default) / `.xz` / `.zip` / `.zst` / `.7z` | 37 | | SELECT_PACKITPATH | openwrt_packit | Set the name of the packaging directory under `/opt` | 38 | | SELECT_OUTPUTPATH | output | Set the name of the firmware output directory in the `${SELECT_PACKITPATH}` directory | 39 | | SCRIPT_VPLUS | mk_h6_vplus.sh | Set the script filename for packaging `h6 vplus` | 40 | | SCRIPT_CM3 | mk_rk3566_radxa-cm3-rpi-cm4-io.sh | Set the script filename for packaging `rk3566 radxa-cm3-rpi-cm4-io` | 41 | | SCRIPT_HT2 | mk_rk3528_ht2.sh | Set the script filename for packaging `rk3528 ht2` | 42 | | SCRIPT_E20C | mk_rk3528_e20c.sh | Set the script filename for packaging `rk3528 e20c` | 43 | | SCRIPT_E24C | mk_rk3528_e24c.sh | Set the script filename for packaging `rk3528 e24c` | 44 | | SCRIPT_H28K | mk_rk3528_h28k.sh | Set the script filename for packaging `rk3528 h28k` | 45 | | SCRIPT_H66K | mk_rk3568_h66k.sh | Set the script filename for packaging `rk3568 h66k` | 46 | | SCRIPT_H68K | mk_rk3568_h68k.sh | Set the script filename for packaging `rk3568 h68k` | 47 | | SCRIPT_H69K | mk_rk3568_h69k.sh | Set the script filename for packaging `rk3568 h69k` | 48 | | SCRIPT_H88K | mk_rk3588_h88k.sh | Set the script filename for packaging `rk3588 h88k/ak88` | 49 | | SCRIPT_H88KV3 | mk_rk3588_h88k-v3.sh | Set the script filename for packaging `rk3588 h88k-v3` | 50 | | SCRIPT_JPTVBOX | mk_rk3566_jp-tvbox.sh | Set the script filename for packaging `rk3566 jp-tvbox` | 51 | | SCRIPT_BEIKEYUN | mk_rk3328_beikeyun.sh | Set the script filename for packaging `rk3328 beikeyun` | 52 | | SCRIPT_L1PRO | mk_rk3328_l1pro.sh | Set the script filename for packaging `rk3328 l1pro` | 53 | | SCRIPT_ZCUBE1MAX | mk_rk3399_zcube1-max.sh | Set the script filename for packaging `rk3399 zcube1-max` | 54 | | SCRIPT_ROCK5B | mk_rk3588_rock5b.sh | Set the script filename for packaging `rk3588 rock5b` | 55 | | SCRIPT_ROCK5C | mk_rk3588s_rock5c.sh | Set the script filename for packaging `rk3588s rock5c` | 56 | | SCRIPT_E52C | mk_rk3588s_e52c.sh | Set the script filename for packaging `rk3588s e52c` | 57 | | SCRIPT_E54C | mk_rk3588s_e54c.sh | Set the script filename for packaging `rk3588s e54c` | 58 | | SCRIPT_R66S | mk_rk3568_r66s.sh | Set the script filename for packaging `rk3568 r66s` | 59 | | SCRIPT_R68S | mk_rk3568_r68s.sh | Set the script filename for packaging `rk3568 r68s` | 60 | | SCRIPT_E25 | mk_rk3568_e25.sh | Set the script filename for packaging `rk3568 e25` | 61 | | SCRIPT_PHOTONICAT | mk_rk3568_photonicat.sh | Set the script filename for packaging `rk3568 photonicat` | 62 | | SCRIPT_WATERMELONPI | mk_rk3568_watermelon-pi.sh | Set the script filename for packaging `rk3568 watermelon-pi` | 63 | | SCRIPT_S905 | mk_s905_mxqpro+.sh | Set the script filename for packaging `s905 mxqpro+` | 64 | | SCRIPT_S905D | mk_s905d_n1.sh | Set the script filename for packaging `s905d n1` | 65 | | SCRIPT_S905X2 | mk_s905x2_x96max.sh | Set the script filename for packaging `s905x2 x96max` | 66 | | SCRIPT_S905X3 | mk_s905x3_multi.sh | Set the script filename for packaging `s905x3 multi` | 67 | | SCRIPT_S912 | mk_s912_zyxq.sh | Set the script filename for packaging `s912 zyxq` | 68 | | SCRIPT_S922X | mk_s922x_gtking.sh | Set the script filename for packaging `s922x gtking` | 69 | | SCRIPT_S922X_N2 | mk_s922x_odroid-n2.sh | Set the script filename for packaging `s922x odroid-n2` | 70 | | SCRIPT_QEMU | mk_qemu-aarch64_img.sh | Set the script filename for packaging `qemu` | 71 | | SCRIPT_DIY | mk_diy.sh | Set the script filename for packaging `diy` custom | 72 | | SCRIPT_DIY_PATH | None | Set the source path for `SCRIPT_DIY`. It can be a URL like `https://weburl/mydiyfile` or a relative path in your repository like `script/mk_s905w.sh` | 73 | | CUSTOMIZE_RK3399 | None | Set custom rk3399 device list, format: `board1:dtb1/board2:dtb2`. Setting this to `none` means that this option is ignored. | 74 | | WHOAMI | flippy | Set the value for `WHOAMI` in `make.env` | 75 | | OPENWRT_VER | auto | Set the value for `OPENWRT_VER` in `make.env`. By default, `auto` will inherit the value from the file. When set to other parameters, it will replace the original parameter with the custom parameter | 76 | | SW_FLOWOFFLOAD | 1 | Set the value for `SW_FLOWOFFLOAD` in `make.env` | 77 | | HW_FLOWOFFLOAD | 0 | Set the value for `HW_FLOWOFFLOAD` in `make.env` | 78 | | SFE_FLOW | 1 | Set the value for `SFE_FLOW` in `make.env` | 79 | | ENABLE_WIFI_K504 | 1 | Set the value for `ENABLE_WIFI_K504` in `make.env` | 80 | | ENABLE_WIFI_K510 | 1 | Set the value for `ENABLE_WIFI_K510` in `make.env` | 81 | | DISTRIB_REVISION | R$(date +%m.%d) | Set the value for `DISTRIB_REVISION` in `make.env` | 82 | | DISTRIB_DESCRIPTION | OpenWrt | Set the value for `DISTRIB_DESCRIPTION` in `make.env` | 83 | 84 | 💡 In general, using the default parameters is sufficient, but you can configure them according to your needs. For instance, if Flippy renames the packaging script making the original default script file unfindable, or if the firmware version number in make.env is not updated, you can use optional parameters for real-time specification and personalized configuration. 85 | 86 | ## Output Parameters Explanation 87 | 88 | According to the standard of github.com, 3 environment variables have been output for use in subsequent compilation steps. Since github.com recently changed the settings of fork repositories, read-write permissions for Workflow are turned off by default. Therefore, Therefore, to upload to Releases, it is necessary to `set Workflow read and write permissions`. For details, see [User Manual](https://github.com/ophub/amlogic-s9xxx-openwrt/tree/main/documents#3-fork-the-repository-and-set-workflow-permissions). 89 | 90 | | Parameter | Default Value | Description | 91 | |--------------------------------|----------------------------|-----------------------------------------| 92 | | ${{ env.PACKAGED_OUTPUTPATH }} | /opt/openwrt_packit/output | Path of the folder containing the packaged firmware | 93 | | ${{ env.PACKAGED_OUTPUTDATE }} | 07.15.1058 | Packaging date | 94 | | ${{ env.PACKAGED_STATUS }} | success / failure | Packaging status. Success / Failure | 95 | 96 | ## Links 97 | 98 | - [OpenWrt](https://github.com/openwrt/openwrt) 99 | - [coolsnowwolf/lede](https://github.com/coolsnowwolf/lede) 100 | - [immortalwrt](https://github.com/immortalwrt/immortalwrt) 101 | - [unifreq/openwrt_packit](https://github.com/unifreq/openwrt_packit) 102 | - [breakingbadboy/OpenWrt](https://github.com/breakingbadboy/OpenWrt) 103 | 104 | ## License 105 | 106 | The flippy-openwrt-actions © OPHUB is licensed under [GPL-2.0](https://github.com/ophub/flippy-openwrt-actions/blob/main/LICENSE) 107 | 108 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: "Make OpenWrt using flippy's script" 2 | author: "https://github.com/ophub/flippy-openwrt-actions" 3 | description: "Support Amlogic, Rockchip and Allwinner boxes." 4 | inputs: 5 | mode: 6 | description: "Select script." 7 | required: false 8 | default: "flippy" 9 | 10 | runs: 11 | using: "composite" 12 | steps: 13 | - run: ${{ github.action_path }}/openwrt_${{ inputs.mode }}.sh 14 | shell: bash 15 | 16 | branding: 17 | icon: "terminal" 18 | color: "gray-dark" 19 | -------------------------------------------------------------------------------- /openwrt_flippy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #============================================================================================== 3 | # 4 | # Description: Automatically Packaged OpenWrt 5 | # Function: Use Flippy's kernrl files and script to Packaged openwrt 6 | # Copyright (C) 2021 https://github.com/unifreq/openwrt_packit 7 | # Copyright (C) 2021 https://github.com/ophub/flippy-openwrt-actions 8 | # 9 | #======================================= Functions list ======================================= 10 | # 11 | # error_msg : Output error message 12 | # init_var : Initialize all variables 13 | # init_packit_repo : Initialize packit openwrt repo 14 | # query_kernel : Query the latest kernel version 15 | # check_kernel : Check kernel files integrity 16 | # download_kernel : Download the kernel 17 | # make_openwrt : Loop to make OpenWrt files 18 | # out_github_env : Output github.com variables 19 | # 20 | #=============================== Set make environment variables =============================== 21 | # 22 | # Set the default package source download repository 23 | SCRIPT_REPO_URL_VALUE="https://github.com/unifreq/openwrt_packit" 24 | SCRIPT_REPO_BRANCH_VALUE="master" 25 | 26 | # Set the *rootfs.tar.gz package save name 27 | PACKAGE_FILE="openwrt-armsr-armv8-generic-rootfs.tar.gz" 28 | 29 | # Set the list of supported device 30 | PACKAGE_OPENWRT=( 31 | "ak88" "e52c" "e54c" "h88k" "h88k-v3" "rock5b" "rock5c" 32 | "cm3" "e25" "photonicat" "r66s" "r68s" "rk3399" 33 | "e20c" "e24c" "h28k" "h66k" "h68k" "h69k" "h69k-max" "ht2" "jp-tvbox" "watermelon-pi" "zcube1-max" 34 | "s922x" "s922x-n2" "s905x3" "s905x2" "s912" "s905d" "s905" 35 | "beikeyun" "l1pro" 36 | "vplus" 37 | "qemu" 38 | "diy" 39 | ) 40 | # Set the list of devices using the [ rk3588 ] kernel 41 | PACKAGE_OPENWRT_RK3588=("ak88" "e52c" "e54c" "h88k" "h88k-v3" "rock5b" "rock5c") 42 | # Set the list of devices using the [ rk35xx ] kernel 43 | # Devices from the rk3528/rk3566/rk3568 series can utilize the rk35xx and rk3588 kernels. 44 | PACKAGE_OPENWRT_RK35XX=("e20c" "e24c" "h28k" "h66k" "h68k" "h69k" "h69k-max" "ht2" "jp-tvbox" "watermelon-pi" "zcube1-max") 45 | # Set the list of devices using the [ 6.x.y ] kernel 46 | PACKAGE_OPENWRT_6XY=("cm3" "e25" "photonicat" "r66s" "r68s" "rk3399") 47 | # All are packaged by default, and independent settings are supported, such as: [ s905x3_s905d_rock5b ] 48 | PACKAGE_SOC_VALUE="all" 49 | 50 | # Set the default packaged kernel download repository 51 | KERNEL_REPO_URL_VALUE="breakingbadboy/OpenWrt" 52 | # Set kernel tag: kernel_stable, kernel_rk3588, kernel_rk35xx 53 | KERNEL_TAGS=("stable" "rk3588" "rk35xx") 54 | STABLE_KERNEL=("6.1.y" "6.12.y") 55 | RK3588_KERNEL=("5.10.y") 56 | RK35XX_KERNEL=("5.10.y") 57 | KERNEL_AUTO_LATEST_VALUE="true" 58 | 59 | # Set the working directory under /opt 60 | SELECT_PACKITPATH_VALUE="openwrt_packit" 61 | SELECT_OUTPUTPATH_VALUE="output" 62 | GZIP_IMGS_VALUE="auto" 63 | SAVE_OPENWRT_ARMSR_VALUE="true" 64 | 65 | # Set the default packaging script 66 | SCRIPT_BEIKEYUN_FILE="mk_rk3328_beikeyun.sh" 67 | SCRIPT_CM3_FILE="mk_rk3566_radxa-cm3-rpi-cm4-io.sh" 68 | SCRIPT_DIY_FILE="mk_diy.sh" 69 | SCRIPT_E20C_FILE="mk_rk3528_e20c.sh" 70 | SCRIPT_E24C_FILE="mk_rk3528_e24c.sh" 71 | SCRIPT_E25_FILE="mk_rk3568_e25.sh" 72 | SCRIPT_E52C_FILE="mk_rk3588s_e52c.sh" 73 | SCRIPT_E54C_FILE="mk_rk3588s_e54c.sh" 74 | SCRIPT_H28K_FILE="mk_rk3528_h28k.sh" 75 | SCRIPT_H66K_FILE="mk_rk3568_h66k.sh" 76 | SCRIPT_H68K_FILE="mk_rk3568_h68k.sh" 77 | SCRIPT_H69K_FILE="mk_rk3568_h69k.sh" 78 | SCRIPT_H88K_FILE="mk_rk3588_h88k.sh" 79 | SCRIPT_H88KV3_FILE="mk_rk3588_h88k-v3.sh" 80 | SCRIPT_HT2_FILE="mk_rk3528_ht2.sh" 81 | SCRIPT_JPTVBOX_FILE="mk_rk3566_jp-tvbox.sh" 82 | SCRIPT_L1PRO_FILE="mk_rk3328_l1pro.sh" 83 | SCRIPT_PHOTONICAT_FILE="mk_rk3568_photonicat.sh" 84 | SCRIPT_QEMU_FILE="mk_qemu-aarch64_img.sh" 85 | SCRIPT_R66S_FILE="mk_rk3568_r66s.sh" 86 | SCRIPT_R68S_FILE="mk_rk3568_r68s.sh" 87 | SCRIPT_RK3399_FILE="mk_rk3399_generic.sh" 88 | SCRIPT_ROCK5B_FILE="mk_rk3588_rock5b.sh" 89 | SCRIPT_ROCK5C_FILE="mk_rk3588s_rock5c.sh" 90 | SCRIPT_S905_FILE="mk_s905_mxqpro+.sh" 91 | SCRIPT_S905D_FILE="mk_s905d_n1.sh" 92 | SCRIPT_S905X2_FILE="mk_s905x2_x96max.sh" 93 | SCRIPT_S905X3_FILE="mk_s905x3_multi.sh" 94 | SCRIPT_S912_FILE="mk_s912_zyxq.sh" 95 | SCRIPT_S922X_FILE="mk_s922x_gtking.sh" 96 | SCRIPT_S922X_N2_FILE="mk_s922x_odroid-n2.sh" 97 | SCRIPT_VPLUS_FILE="mk_h6_vplus.sh" 98 | SCRIPT_WATERMELONPI_FILE="mk_rk3568_watermelon-pi.sh" 99 | SCRIPT_ZCUBE1MAX_FILE="mk_rk3399_zcube1-max.sh" 100 | 101 | # Set make.env related parameters 102 | WHOAMI_VALUE="flippy" 103 | OPENWRT_VER_VALUE="auto" 104 | SW_FLOWOFFLOAD_VALUE="1" 105 | HW_FLOWOFFLOAD_VALUE="0" 106 | SFE_FLOW_VALUE="1" 107 | ENABLE_WIFI_K504_VALUE="1" 108 | ENABLE_WIFI_K510_VALUE="1" 109 | DISTRIB_REVISION_VALUE="R$(date +%Y.%m.%d)" 110 | DISTRIB_DESCRIPTION_VALUE="OpenWrt" 111 | 112 | # Set font color 113 | STEPS="[\033[95m STEPS \033[0m]" 114 | INFO="[\033[94m INFO \033[0m]" 115 | SUCCESS="[\033[92m SUCCESS \033[0m]" 116 | NOTE="[\033[93m NOTE \033[0m]" 117 | WARNING="[\033[93m WARNING \033[0m]" 118 | ERROR="[\033[91m ERROR \033[0m]" 119 | # 120 | #============================================================================================== 121 | 122 | error_msg() { 123 | echo -e "${ERROR} ${1}" 124 | exit 1 125 | } 126 | 127 | init_var() { 128 | echo -e "${STEPS} Start Initializing Variables..." 129 | 130 | # Install the compressed package 131 | sudo apt-get -qq update 132 | sudo apt-get -qq install -y curl git coreutils p7zip p7zip-full zip unzip gzip xz-utils pigz zstd jq tar 133 | 134 | # Specify the default value 135 | [[ -n "${SCRIPT_REPO_URL}" ]] || SCRIPT_REPO_URL="${SCRIPT_REPO_URL_VALUE}" 136 | [[ "${SCRIPT_REPO_URL,,}" =~ ^http ]] || SCRIPT_REPO_URL="https://github.com/${SCRIPT_REPO_URL}" 137 | [[ -n "${SCRIPT_REPO_BRANCH}" ]] || SCRIPT_REPO_BRANCH="${SCRIPT_REPO_BRANCH_VALUE}" 138 | [[ -n "${KERNEL_REPO_URL}" ]] || KERNEL_REPO_URL="${KERNEL_REPO_URL_VALUE}" 139 | [[ -n "${PACKAGE_SOC}" ]] || PACKAGE_SOC="${PACKAGE_SOC_VALUE}" 140 | [[ -n "${KERNEL_AUTO_LATEST}" ]] || KERNEL_AUTO_LATEST="${KERNEL_AUTO_LATEST_VALUE}" 141 | [[ -n "${GZIP_IMGS}" ]] || GZIP_IMGS="${GZIP_IMGS_VALUE}" 142 | [[ -n "${SELECT_PACKITPATH}" ]] || SELECT_PACKITPATH="${SELECT_PACKITPATH_VALUE}" 143 | [[ -n "${SELECT_OUTPUTPATH}" ]] || SELECT_OUTPUTPATH="${SELECT_OUTPUTPATH_VALUE}" 144 | [[ -n "${SAVE_OPENWRT_ARMSR}" ]] || SAVE_OPENWRT_ARMSR="${SAVE_OPENWRT_ARMSR_VALUE}" 145 | 146 | # Specify the default packaging script 147 | [[ -n "${SCRIPT_BEIKEYUN}" ]] || SCRIPT_BEIKEYUN="${SCRIPT_BEIKEYUN_FILE}" 148 | [[ -n "${SCRIPT_CM3}" ]] || SCRIPT_CM3="${SCRIPT_CM3_FILE}" 149 | [[ -n "${SCRIPT_DIY}" ]] || SCRIPT_DIY="${SCRIPT_DIY_FILE}" 150 | [[ -n "${SCRIPT_E20C}" ]] || SCRIPT_E20C="${SCRIPT_E20C_FILE}" 151 | [[ -n "${SCRIPT_E24C}" ]] || SCRIPT_E24C="${SCRIPT_E24C_FILE}" 152 | [[ -n "${SCRIPT_E25}" ]] || SCRIPT_E25="${SCRIPT_E25_FILE}" 153 | [[ -n "${SCRIPT_E52C}" ]] || SCRIPT_E52C="${SCRIPT_E52C_FILE}" 154 | [[ -n "${SCRIPT_E54C}" ]] || SCRIPT_E54C="${SCRIPT_E54C_FILE}" 155 | [[ -n "${SCRIPT_H28K}" ]] || SCRIPT_H28K="${SCRIPT_H28K_FILE}" 156 | [[ -n "${SCRIPT_H66K}" ]] || SCRIPT_H66K="${SCRIPT_H66K_FILE}" 157 | [[ -n "${SCRIPT_H68K}" ]] || SCRIPT_H68K="${SCRIPT_H68K_FILE}" 158 | [[ -n "${SCRIPT_H69K}" ]] || SCRIPT_H69K="${SCRIPT_H69K_FILE}" 159 | [[ -n "${SCRIPT_H88K}" ]] || SCRIPT_H88K="${SCRIPT_H88K_FILE}" 160 | [[ -n "${SCRIPT_H88KV3}" ]] || SCRIPT_H88KV3="${SCRIPT_H88KV3_FILE}" 161 | [[ -n "${SCRIPT_HT2}" ]] || SCRIPT_HT2="${SCRIPT_HT2_FILE}" 162 | [[ -n "${SCRIPT_JPTVBOX}" ]] || SCRIPT_JPTVBOX="${SCRIPT_JPTVBOX_FILE}" 163 | [[ -n "${SCRIPT_L1PRO}" ]] || SCRIPT_L1PRO="${SCRIPT_L1PRO_FILE}" 164 | [[ -n "${SCRIPT_PHOTONICAT}" ]] || SCRIPT_PHOTONICAT="${SCRIPT_PHOTONICAT_FILE}" 165 | [[ -n "${SCRIPT_QEMU}" ]] || SCRIPT_QEMU="${SCRIPT_QEMU_FILE}" 166 | [[ -n "${SCRIPT_R66S}" ]] || SCRIPT_R66S="${SCRIPT_R66S_FILE}" 167 | [[ -n "${SCRIPT_R68S}" ]] || SCRIPT_R68S="${SCRIPT_R68S_FILE}" 168 | [[ -n "${SCRIPT_RK3399}" ]] || SCRIPT_RK3399="${SCRIPT_RK3399_FILE}" 169 | [[ -n "${SCRIPT_ROCK5B}" ]] || SCRIPT_ROCK5B="${SCRIPT_ROCK5B_FILE}" 170 | [[ -n "${SCRIPT_ROCK5C}" ]] || SCRIPT_ROCK5C="${SCRIPT_ROCK5C_FILE}" 171 | [[ -n "${SCRIPT_S905}" ]] || SCRIPT_S905="${SCRIPT_S905_FILE}" 172 | [[ -n "${SCRIPT_S905D}" ]] || SCRIPT_S905D="${SCRIPT_S905D_FILE}" 173 | [[ -n "${SCRIPT_S905X2}" ]] || SCRIPT_S905X2="${SCRIPT_S905X2_FILE}" 174 | [[ -n "${SCRIPT_S905X3}" ]] || SCRIPT_S905X3="${SCRIPT_S905X3_FILE}" 175 | [[ -n "${SCRIPT_S912}" ]] || SCRIPT_S912="${SCRIPT_S912_FILE}" 176 | [[ -n "${SCRIPT_S922X}" ]] || SCRIPT_S922X="${SCRIPT_S922X_FILE}" 177 | [[ -n "${SCRIPT_S922X_N2}" ]] || SCRIPT_S922X_N2="${SCRIPT_S922X_N2_FILE}" 178 | [[ -n "${SCRIPT_VPLUS}" ]] || SCRIPT_VPLUS="${SCRIPT_VPLUS_FILE}" 179 | [[ -n "${SCRIPT_WATERMELONPI}" ]] || SCRIPT_WATERMELONPI="${SCRIPT_WATERMELONPI_FILE}" 180 | [[ -n "${SCRIPT_ZCUBE1MAX}" ]] || SCRIPT_ZCUBE1MAX="${SCRIPT_ZCUBE1MAX_FILE}" 181 | 182 | # Specify make.env variable 183 | [[ -n "${WHOAMI}" ]] || WHOAMI="${WHOAMI_VALUE}" 184 | [[ -n "${OPENWRT_VER}" ]] || OPENWRT_VER="${OPENWRT_VER_VALUE}" 185 | [[ -n "${SW_FLOWOFFLOAD}" ]] || SW_FLOWOFFLOAD="${SW_FLOWOFFLOAD_VALUE}" 186 | [[ -n "${HW_FLOWOFFLOAD}" ]] || HW_FLOWOFFLOAD="${HW_FLOWOFFLOAD_VALUE}" 187 | [[ -n "${SFE_FLOW}" ]] || SFE_FLOW="${SFE_FLOW_VALUE}" 188 | [[ -n "${ENABLE_WIFI_K504}" ]] || ENABLE_WIFI_K504="${ENABLE_WIFI_K504_VALUE}" 189 | [[ -n "${ENABLE_WIFI_K510}" ]] || ENABLE_WIFI_K510="${ENABLE_WIFI_K510_VALUE}" 190 | [[ -n "${DISTRIB_REVISION}" ]] || DISTRIB_REVISION="${DISTRIB_REVISION_VALUE}" 191 | [[ -n "${DISTRIB_DESCRIPTION}" ]] || DISTRIB_DESCRIPTION="${DISTRIB_DESCRIPTION_VALUE}" 192 | 193 | # Confirm package object 194 | [[ "${PACKAGE_SOC}" != "all" ]] && { 195 | oldIFS="${IFS}" 196 | IFS="_" 197 | PACKAGE_OPENWRT=(${PACKAGE_SOC}) 198 | IFS="${oldIFS}" 199 | } 200 | 201 | # Confirm customize rk3399 devices: ${CUSTOMIZE_RK3399} 202 | # Format: [ board1:dtb1/board2:dtb2/board3:dtb3/... ] 203 | # [ none ] 204 | # Example: [ tvi3315a:rk3399-tvi3315a.dtb/sw799:rk3399-bozz-sw799.dtb ] 205 | # If not specified, it can be set to 'none'. 206 | RK3399_BOARD_LIST=() 207 | RK3399_DTB_LIST=() 208 | [[ -n "${CUSTOMIZE_RK3399}" && "${CUSTOMIZE_RK3399,,}" != "none" ]] && { 209 | # Add rk3399 to the package list 210 | PACKAGE_OPENWRT+=("rk3399") 211 | 212 | # Split the string 213 | oldIFS="${IFS}" 214 | IFS="/" 215 | for rk in ${CUSTOMIZE_RK3399}; do 216 | IFS=":" 217 | tmp_rk_arr=(${rk}) 218 | RK3399_BOARD_LIST+=(${tmp_rk_arr[0]}) 219 | RK3399_DTB_LIST+=(${tmp_rk_arr[1]}) 220 | done 221 | IFS="${oldIFS}" 222 | } 223 | 224 | # Remove duplicate package drivers 225 | PACKAGE_OPENWRT=($(echo "${PACKAGE_OPENWRT[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) 226 | 227 | # Reset required kernel tags 228 | KERNEL_TAGS_TMP=() 229 | for kt in "${PACKAGE_OPENWRT[@]}"; do 230 | if [[ " ${PACKAGE_OPENWRT_RK3588[@]} " =~ " ${kt} " ]]; then 231 | KERNEL_TAGS_TMP+=("rk3588") 232 | elif [[ " ${PACKAGE_OPENWRT_RK35XX[@]} " =~ " ${kt} " ]]; then 233 | KERNEL_TAGS_TMP+=("rk35xx") 234 | else 235 | KERNEL_TAGS_TMP+=("stable") 236 | fi 237 | done 238 | # Remove duplicate kernel tags 239 | KERNEL_TAGS=($(echo "${KERNEL_TAGS_TMP[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) 240 | 241 | echo -e "${INFO} Package directory: [ /opt/${SELECT_PACKITPATH} ]" 242 | echo -e "${INFO} Package SoC: [ $(echo ${PACKAGE_OPENWRT[@]} | xargs) ]" 243 | echo -e "${INFO} Kernel tags: [ $(echo ${KERNEL_TAGS[@]} | xargs) ]" 244 | 245 | # Reset STABLE_KERNEL options 246 | [[ -n "${KERNEL_VERSION_NAME}" && " ${KERNEL_TAGS[@]} " =~ " stable " ]] && { 247 | oldIFS="${IFS}" 248 | IFS="_" 249 | STABLE_KERNEL=(${KERNEL_VERSION_NAME}) 250 | IFS="${oldIFS}" 251 | echo -e "${INFO} Stable kernel: [ $(echo ${STABLE_KERNEL[@]} | xargs) ]" 252 | } 253 | 254 | # Convert kernel library address to api format 255 | echo -e "${INFO} Kernel download repository: [ ${KERNEL_REPO_URL} ]" 256 | [[ "${KERNEL_REPO_URL}" =~ ^https: ]] && KERNEL_REPO_URL="$(echo ${KERNEL_REPO_URL} | awk -F'/' '{print $4"/"$5}')" 257 | kernel_api="https://github.com/${KERNEL_REPO_URL}" 258 | echo -e "${INFO} Kernel Query API: [ ${kernel_api} ]" 259 | } 260 | 261 | init_packit_repo() { 262 | cd /opt 263 | 264 | # Clone the repository into the packaging directory. If it fails, wait 1 minute and try again, try 10 times. 265 | [[ -d "${SELECT_PACKITPATH}" ]] || { 266 | echo -e "${STEPS} Start cloning repository [ ${SCRIPT_REPO_URL} ], branch [ ${SCRIPT_REPO_BRANCH} ] into [ ${SELECT_PACKITPATH} ]" 267 | for i in {1..10}; do 268 | git clone -q --single-branch --depth=1 --branch=${SCRIPT_REPO_BRANCH} ${SCRIPT_REPO_URL} ${SELECT_PACKITPATH} 269 | [[ "${?}" -eq "0" ]] && break || sleep 60 270 | done 271 | [[ -d "${SELECT_PACKITPATH}" ]] || error_msg "Failed to clone the repository." 272 | } 273 | 274 | # Check the *rootfs.tar.gz package 275 | # If the original variable name [ OPENWRT_ARMVIRT ] is detected, it will be inherited and used. 276 | [[ -n "${OPENWRT_ARMVIRT}" && -z "${OPENWRT_ARMSR}" ]] && OPENWRT_ARMSR="${OPENWRT_ARMVIRT}" 277 | [[ -z "${OPENWRT_ARMSR}" ]] && error_msg "The [ OPENWRT_ARMSR ] variable must be specified." 278 | 279 | # Load *-armsr-armv8-generic-rootfs.tar.gz 280 | rm -f ${SELECT_PACKITPATH}/${PACKAGE_FILE} 281 | if [[ "${OPENWRT_ARMSR,,}" =~ ^http ]]; then 282 | echo -e "${STEPS} Download the [ ${OPENWRT_ARMSR} ] file into [ ${SELECT_PACKITPATH} ]" 283 | 284 | # Download the *-armsr-armv8-generic-rootfs.tar.gz file. If the download fails, try again 10 times. 285 | for i in {1..10}; do 286 | curl -fsSL "${OPENWRT_ARMSR}" -o "${SELECT_PACKITPATH}/${PACKAGE_FILE}" 287 | [[ "${?}" -eq "0" ]] && break || sleep 60 288 | done 289 | [[ "${?}" -eq "0" ]] || error_msg "Openwrt rootfs file download failed." 290 | else 291 | echo -e "${STEPS} copy [ ${GITHUB_WORKSPACE}/${OPENWRT_ARMSR} ] file into [ ${SELECT_PACKITPATH} ]" 292 | cp -f ${GITHUB_WORKSPACE}/${OPENWRT_ARMSR} ${SELECT_PACKITPATH}/${PACKAGE_FILE} 293 | [[ "${?}" -eq "0" ]] || error_msg "Openwrt rootfs file copy failed." 294 | fi 295 | 296 | # Normal ${PACKAGE_FILE} file should not be less than 10MB 297 | armvirt_rootfs_size="$(ls -l ${SELECT_PACKITPATH}/${PACKAGE_FILE} 2>/dev/null | awk '{print $5}')" 298 | echo -e "${INFO} armvirt_rootfs_size: [ ${armvirt_rootfs_size} ]" 299 | if [[ "${armvirt_rootfs_size}" -ge "10000000" ]]; then 300 | echo -e "${INFO} [ ${SELECT_PACKITPATH}/${PACKAGE_FILE} ] loaded successfully." 301 | else 302 | error_msg "The [ ${SELECT_PACKITPATH}/${PACKAGE_FILE} ] failed to load." 303 | fi 304 | 305 | # Add custom script 306 | [[ -n "${SCRIPT_DIY_PATH}" ]] && { 307 | rm -f ${SELECT_PACKITPATH}/${SCRIPT_DIY} 308 | if [[ "${SCRIPT_DIY_PATH,,}" =~ ^http ]]; then 309 | echo -e "${INFO} Download the custom script file: [ ${SCRIPT_DIY_PATH} ]" 310 | 311 | # Download the custom script file. If the download fails, try again 10 times. 312 | for i in {1..10}; do 313 | curl -fsSL "${SCRIPT_DIY_PATH}" -o "${SELECT_PACKITPATH}/${SCRIPT_DIY}" 314 | [[ "${?}" -eq "0" ]] && break || sleep 60 315 | done 316 | [[ "${?}" -eq "0" ]] || error_msg "Custom script file download failed." 317 | else 318 | echo -e "${INFO} Copy custom script file: [ ${SCRIPT_DIY_PATH} ]" 319 | cp -f ${GITHUB_WORKSPACE}/${SCRIPT_DIY_PATH} ${SELECT_PACKITPATH}/${SCRIPT_DIY} 320 | [[ "${?}" -eq "0" ]] || error_msg "Custom script file copy failed." 321 | fi 322 | chmod +x ${SELECT_PACKITPATH}/${SCRIPT_DIY} 323 | echo -e "List of [ ${SELECT_PACKITPATH} ] directory files:\n $(ls -lh ${SELECT_PACKITPATH})" 324 | } 325 | } 326 | 327 | query_kernel() { 328 | echo -e "${STEPS} Start querying the latest kernel..." 329 | 330 | # Check the version on the kernel library 331 | x="1" 332 | for vb in "${KERNEL_TAGS[@]}"; do 333 | { 334 | # Select the corresponding kernel directory and list 335 | if [[ "${vb,,}" == "rk3588" ]]; then 336 | down_kernel_list=(${RK3588_KERNEL[@]}) 337 | elif [[ "${vb,,}" == "rk35xx" ]]; then 338 | down_kernel_list=(${RK35XX_KERNEL[@]}) 339 | else 340 | down_kernel_list=(${STABLE_KERNEL[@]}) 341 | fi 342 | 343 | # Query the name of the latest kernel version 344 | TMP_ARR_KERNELS=() 345 | i=1 346 | for kernel_var in "${down_kernel_list[@]}"; do 347 | echo -e "${INFO} (${i}) Auto query the latest kernel version of the same series for [ ${vb} - ${kernel_var} ]" 348 | 349 | # Identify the kernel and , such as [ 6.1 ] 350 | kernel_verpatch="$(echo ${kernel_var} | awk -F '.' '{print $1"."$2}')" 351 | 352 | # Query the latest kernel version 353 | latest_version="$( 354 | curl -fsSL \ 355 | ${kernel_api}/releases/expanded_assets/kernel_${vb} | 356 | grep -oE "${kernel_verpatch}.[0-9]+.*.tar.gz" | sed 's/.tar.gz//' | 357 | sort -urV | head -n 1 358 | )" 359 | 360 | if [[ "$?" -eq "0" && -n "${latest_version}" ]]; then 361 | TMP_ARR_KERNELS[${i}]="${latest_version}" 362 | else 363 | TMP_ARR_KERNELS[${i}]="${kernel_var}" 364 | fi 365 | 366 | echo -e "${INFO} (${i}) [ ${vb} - ${TMP_ARR_KERNELS[$i]} ] is latest kernel." 367 | 368 | let i++ 369 | done 370 | 371 | # Reset the kernel array to the latest kernel version 372 | if [[ "${vb,,}" == "rk3588" ]]; then 373 | RK3588_KERNEL=(${TMP_ARR_KERNELS[@]}) 374 | echo -e "${INFO} The latest version of the rk3588 kernel: [ ${RK3588_KERNEL[@]} ]" 375 | elif [[ "${vb,,}" == "rk35xx" ]]; then 376 | RK35XX_KERNEL=(${TMP_ARR_KERNELS[@]}) 377 | echo -e "${INFO} The latest version of the rk35xx kernel: [ ${RK35XX_KERNEL[@]} ]" 378 | else 379 | STABLE_KERNEL=(${TMP_ARR_KERNELS[@]}) 380 | echo -e "${INFO} The latest version of the stable kernel: [ ${STABLE_KERNEL[@]} ]" 381 | fi 382 | 383 | let x++ 384 | } 385 | done 386 | } 387 | 388 | check_kernel() { 389 | [[ -n "${1}" ]] && check_path="${1}" || error_msg "Invalid kernel path to check." 390 | check_files=($(cat "${check_path}/sha256sums" | awk '{print $2}')) 391 | m="1" 392 | for cf in "${check_files[@]}"; do 393 | { 394 | # Check if file exists 395 | [[ -s "${check_path}/${cf}" ]] || error_msg "The [ ${cf} ] file is missing." 396 | # Check if the file sha256sum is correct 397 | tmp_sha256sum="$(sha256sum "${check_path}/${cf}" | awk '{print $1}')" 398 | tmp_checkcode="$(cat ${check_path}/sha256sums | grep ${cf} | awk '{print $1}')" 399 | [[ "${tmp_sha256sum,,}" == "${tmp_checkcode,,}" ]] || error_msg "[ ${cf} ]: sha256sum verification failed." 400 | let m++ 401 | } 402 | done 403 | echo -e "${INFO} All [ ${#check_files[@]} ] kernel files are sha256sum checked to be complete.\n" 404 | } 405 | 406 | download_kernel() { 407 | echo -e "${STEPS} Start downloading the kernel..." 408 | 409 | cd /opt 410 | 411 | x="1" 412 | for vb in "${KERNEL_TAGS[@]}"; do 413 | { 414 | # Set the kernel download list 415 | if [[ "${vb,,}" == "rk3588" ]]; then 416 | down_kernel_list=(${RK3588_KERNEL[@]}) 417 | elif [[ "${vb,,}" == "rk35xx" ]]; then 418 | down_kernel_list=(${RK35XX_KERNEL[@]}) 419 | else 420 | down_kernel_list=(${STABLE_KERNEL[@]}) 421 | fi 422 | 423 | # Kernel storage directory 424 | kernel_path="kernel/${vb}" 425 | [[ -d "${kernel_path}" ]] || mkdir -p ${kernel_path} 426 | 427 | # Download the kernel to the storage directory 428 | i="1" 429 | for kernel_var in "${down_kernel_list[@]}"; do 430 | if [[ ! -d "${kernel_path}/${kernel_var}" ]]; then 431 | kernel_down_from="https://github.com/${KERNEL_REPO_URL}/releases/download/kernel_${vb}/${kernel_var}.tar.gz" 432 | echo -e "${INFO} (${x}.${i}) [ ${vb} - ${kernel_var} ] Kernel download from [ ${kernel_down_from} ]" 433 | 434 | # Download the kernel file. If the download fails, try again 10 times. 435 | for t in {1..10}; do 436 | curl -fsSL "${kernel_down_from}" -o "${kernel_path}/${kernel_var}.tar.gz" 437 | [[ "${?}" -eq "0" ]] && break || sleep 60 438 | done 439 | [[ "${?}" -eq "0" ]] || error_msg "Failed to download the kernel files from the server." 440 | 441 | # Decompress the kernel file 442 | tar -mxf "${kernel_path}/${kernel_var}.tar.gz" -C "${kernel_path}" 443 | [[ "${?}" -eq "0" ]] || error_msg "[ ${kernel_var} ] kernel decompression failed." 444 | else 445 | echo -e "${INFO} (${x}.${i}) [ ${vb} - ${kernel_var} ] Kernel is in the local directory." 446 | fi 447 | 448 | # If the kernel contains the sha256sums file, check the files integrity 449 | [[ -f "${kernel_path}/${kernel_var}/sha256sums" ]] && check_kernel "${kernel_path}/${kernel_var}" 450 | 451 | let i++ 452 | done 453 | 454 | # Delete downloaded kernel temporary files 455 | rm -f ${kernel_path}/*.tar.gz 456 | sync 457 | 458 | let x++ 459 | } 460 | done 461 | } 462 | 463 | make_openwrt() { 464 | echo -e "${STEPS} Start packaging OpenWrt..." 465 | 466 | i="1" 467 | for PACKAGE_VAR in "${PACKAGE_OPENWRT[@]}"; do 468 | { 469 | # Distinguish between different OpenWrt and use different kernel 470 | if [[ " ${PACKAGE_OPENWRT_RK3588[@]} " =~ " ${PACKAGE_VAR} " ]]; then 471 | build_kernel=(${RK3588_KERNEL[@]}) 472 | vb="rk3588" 473 | elif [[ " ${PACKAGE_OPENWRT_RK35XX[@]} " =~ " ${PACKAGE_VAR} " ]]; then 474 | build_kernel=(${RK35XX_KERNEL[@]}) 475 | vb="rk35xx" 476 | else 477 | build_kernel=(${STABLE_KERNEL[@]}) 478 | vb="stable" 479 | fi 480 | 481 | k="1" 482 | for kernel_var in "${build_kernel[@]}"; do 483 | { 484 | # Rockchip rk3568 series only support 6.x.y and above kernel 485 | [[ -n "$(echo "${PACKAGE_OPENWRT_6XY[@]}" | grep -w "${PACKAGE_VAR}")" && "${kernel_var:0:2}" != "6." ]] && { 486 | echo -e "${STEPS} (${i}.${k}) ${NOTE} Based on , skip the [ ${PACKAGE_VAR} - ${vb}/${kernel_var} ] build." 487 | let k++ 488 | continue 489 | } 490 | 491 | # Check the available size of server space 492 | now_remaining_space="$(df -Tk /opt/${SELECT_PACKITPATH} | tail -n1 | awk '{print $5}' | echo $(($(xargs) / 1024 / 1024)))" 493 | [[ "${now_remaining_space}" -le "3" ]] && { 494 | echo -e "${WARNING} If the remaining space is less than 3G, exit this packaging. \n" 495 | break 496 | } 497 | 498 | cd /opt/kernel 499 | 500 | # Copy the kernel to the packaging directory 501 | rm -f *.tar.gz 502 | cp -f ${vb}/${kernel_var}/* . 503 | # 504 | boot_kernel_file="$(ls boot-${kernel_var}* 2>/dev/null | head -n 1)" 505 | KERNEL_VERSION="${boot_kernel_file:5:-7}" 506 | [[ "${vb,,}" == "rk3588" ]] && RK3588_KERNEL_VERSION="${KERNEL_VERSION}" || RK3588_KERNEL_VERSION="" 507 | [[ "${vb,,}" == "rk35xx" ]] && RK35XX_KERNEL_VERSION="${KERNEL_VERSION}" || RK35XX_KERNEL_VERSION="" 508 | echo -e "${STEPS} (${i}.${k}) Start packaging OpenWrt: [ ${PACKAGE_VAR} ], Kernel directory: [ ${vb} ], Kernel version: [ ${KERNEL_VERSION} ]" 509 | echo -e "${INFO} Remaining space is ${now_remaining_space}G. \n" 510 | 511 | cd /opt/${SELECT_PACKITPATH} 512 | 513 | # If flowoffload is turned on, then sfe is forced to be closed by default 514 | [[ "${SW_FLOWOFFLOAD}" -eq "1" ]] && SFE_FLOW="0" 515 | 516 | if [[ -n "${OPENWRT_VER}" && "${OPENWRT_VER,,}" == "auto" ]]; then 517 | OPENWRT_VER="$(cat make.env | grep "OPENWRT_VER=\"" | cut -d '"' -f2)" 518 | echo -e "${INFO} (${i}.${k}) OPENWRT_VER: [ ${OPENWRT_VER} ]" 519 | fi 520 | 521 | # Generate a custom make.env file 522 | rm -f make.env 2>/dev/null 523 | cat >make.env </dev/null; done 628 | sudo rm -f *.sha.sha 2>/dev/null 629 | 630 | echo "PACKAGED_OUTPUTPATH=${PWD}" >>${GITHUB_ENV} 631 | echo "PACKAGED_OUTPUTDATE=$(date +"%m.%d.%H%M")" >>${GITHUB_ENV} 632 | echo "PACKAGED_STATUS=success" >>${GITHUB_ENV} 633 | echo -e "PACKAGED_OUTPUTPATH: ${PWD}" 634 | echo -e "PACKAGED_OUTPUTDATE: $(date +"%m.%d.%H%M")" 635 | echo -e "PACKAGED_STATUS: success" 636 | echo -e "${INFO} PACKAGED_OUTPUTPATH files list:" 637 | echo -e "$(ls -lh /opt/${SELECT_PACKITPATH}/${SELECT_OUTPUTPATH} 2>/dev/null) \n" 638 | else 639 | echo -e "${ERROR} Packaging failed. \n" 640 | echo "PACKAGED_STATUS=failure" >>${GITHUB_ENV} 641 | fi 642 | } 643 | # Show welcome message 644 | echo -e "${STEPS} Welcome to use the OpenWrt packaging tool! \n" 645 | echo -e "${INFO} Server CPU configuration information: \n$(cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c) \n" 646 | 647 | # Start initializing variables 648 | init_var 649 | init_packit_repo 650 | 651 | # Show server start information 652 | echo -e "${INFO} Server space usage before starting to compile:\n$(df -hT /opt/${SELECT_PACKITPATH}) \n" 653 | 654 | # Packit OpenWrt 655 | [[ "${KERNEL_AUTO_LATEST,,}" == "true" ]] && query_kernel 656 | download_kernel 657 | make_openwrt 658 | out_github_env 659 | 660 | # Show server end information 661 | echo -e "${INFO} Server space usage after compilation:\n$(df -hT /opt/${SELECT_PACKITPATH}) \n" 662 | echo -e "${SUCCESS} The packaging process has been completed. \n" 663 | --------------------------------------------------------------------------------