zram: do not waste zram_table_entry flags bits #100
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 编译内核 | |
| on: | |
| push: | |
| branches: | |
| - dev/* | |
| - stable/* | |
| workflow_dispatch: | |
| env: | |
| AOSP_TOOLCHAIN_BRANCH: android16 | |
| AOSP_CLANG_VERSION: r547379 | |
| jobs: | |
| build: | |
| name: 编译内核 | |
| permissions: { contents: write } | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| device: | |
| - beryllium | |
| - dipper | |
| - equuleus | |
| - perseus | |
| - polaris | |
| - ursa | |
| steps: | |
| - name: 安装软件包 | |
| env: | |
| PACKAGES: | |
| ccache | |
| binutils-aarch64-linux-gnu | |
| binutils-arm-linux-gnueabi | |
| run: | | |
| sudo apt-get update -y -q | |
| sudo apt-get upgrade -y -q | |
| sudo apt-get install -y -q ${{ env.PACKAGES }} | |
| - name: 安装make4.4.1-2 | |
| run: | | |
| curl -LSs http://ftp.debian.org/debian/pool/main/m/make-dfsg/make_4.4.1-2_amd64.deb -o make.deb | |
| sudo apt-get install -y ./make.deb | |
| rm ./make.deb | |
| - name: 同步仓库 | |
| uses: actions/checkout@main | |
| with: | |
| path: kernel | |
| - name: 缓存Clang | |
| id: cache-clang | |
| uses: actions/cache@main | |
| with: | |
| path: clang | |
| key: clang-${{ env.AOSP_TOOLCHAIN_BRANCH }}-${{ env.AOSP_CLANG_VERSION }} | |
| - name: 下载Clang | |
| if: steps.cache-clang.outputs.cache-hit != 'true' | |
| run: | |
| mkdir -p clang && | |
| curl -LSs "https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/+archive/refs/heads/${{ env.AOSP_TOOLCHAIN_BRANCH }}-release/clang-${{ env.AOSP_CLANG_VERSION }}.tar.gz" | | |
| tar xz -C clang | |
| - name: 缓存ccache | |
| uses: hendrikmuhs/ccache-action@main | |
| with: | |
| key: kernel-${{ matrix.device }} | |
| restore-keys: kernel-${{ matrix.device }} | |
| max-size: 5G | |
| - name: 编译 | |
| working-directory: kernel | |
| env: | |
| MAKE_ARGS: | |
| -j$(nproc --all) | |
| CC="ccache clang" | |
| LD=ld.lld | |
| ARCH=arm64 | |
| LLVM=1 | |
| LLVM_IAS=1 | |
| O=out | |
| CROSS_COMPILE=aarch64-linux-gnu- | |
| CROSS_COMPILE_ARM32=arm-linux-gnueabi- | |
| CONFIG_FILES: | |
| vendor/xiaomi/mi845_defconfig | |
| vendor/xiaomi/${{ matrix.device }}.config | |
| run: | | |
| export PATH=$GITHUB_WORKSPACE/clang/bin:$PATH | |
| export KBUILD_BUILD_USER=${{ github.repository_owner }} | |
| export KBUILD_BUILD_HOST=github-runner | |
| export KBUILD_BUILD_TIMESTAMP=`date -u -d "@$(git log -1 --format=%at)" +"%a %b %d %H:%M:%S %Z %Y"` | |
| make ${{ env.MAKE_ARGS }} ${{ env.CONFIG_FILES }} all | |
| - name: 打包(AnyKernel3) | |
| run: | | |
| git clone https://github.com/osm0sis/AnyKernel3 --depth=1 ak3 | |
| cp kernel/out/arch/arm64/boot/Image.gz-dtb ak3/ | |
| cd ak3 | |
| cat >anykernel.sh <<EOF | |
| properties() { ' | |
| kernel.string=Kernel for ${{ matrix.device }} | |
| device.name1=${{ matrix.device }} | |
| do.devicecheck=1 | |
| '; } | |
| ramdisk_compression=auto | |
| patch_vbmeta_flag=auto | |
| is_slot_device=auto | |
| block=auto | |
| . tools/ak3-core.sh | |
| split_boot | |
| flash_boot | |
| EOF | |
| zip -qr9 Anykernel3-${{ matrix.device }}.zip * -x .git .github README.md *placeholder | |
| - name: 打包(boot) | |
| run: | | |
| git clone https://android.googlesource.com/platform/system/tools/mkbootimg --depth=1 mkbootimg | |
| cp kernel/out/arch/arm64/boot/Image.gz-dtb mkbootimg/ | |
| cd mkbootimg | |
| boot_url=$(curl -LSs https://download.lineageos.org/api/v2/devices/${{ matrix.device }}/builds | jq -r '.[0].files[1].url') | |
| curl -LSs $boot_url -o boot.img | |
| mkbootimg_args=$(./unpack_bootimg.py --out out --boot_img boot.img --format mkbootimg) | |
| mv Image.gz-dtb out/kernel | |
| eval "./mkbootimg.py $mkbootimg_args -o boot-lineage-${{ matrix.device }}.img" | |
| - name: 上传文件 | |
| uses: actions/upload-artifact@main | |
| with: | |
| name: kernel-${{ matrix.device }}-ak3 | |
| path: ak3/Anykernel3-${{ matrix.device }}.zip | |
| - name: 上传文件 | |
| uses: actions/upload-artifact@main | |
| with: | |
| name: kernel-${{ matrix.device }}-boot | |
| path: mkbootimg/boot-lineage-${{ matrix.device }}.img | |
| release: | |
| name: 发布 | |
| permissions: { contents: write } | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: 获取构建产物 | |
| uses: actions/download-artifact@main | |
| with: | |
| path: kernel | |
| pattern: kernel-* | |
| merge-multiple: true | |
| - name: 获取当前时间 | |
| id: time | |
| run: | | |
| echo "time=$(TZ='Asia/Shanghai' date -u +'%Y%m%d%H%M')" >> $GITHUB_OUTPUT | |
| echo "timestamp=$(date +%s)" >> $GITHUB_OUTPUT | |
| - name: 下载ci管理器 | |
| continue-on-error: true | |
| uses: dawidd6/action-download-artifact@master | |
| with: | |
| repo: rsuntk/KernelSU | |
| workflow_conclusion: success | |
| name: manager | |
| workflow: build-manager.yml | |
| path: manager | |
| check_artifacts: true | |
| search_artifacts: true | |
| - name: 发布 | |
| uses: softprops/action-gh-release@master | |
| with: | |
| tag_name: rel-${{ steps.time.outputs.timestamp }} | |
| name: Kernel build ${{ steps.time.outputs.time }} | |
| prerelease: ${{ startsWith(github.ref_name, 'dev/') }} | |
| files: | | |
| kernel/* | |
| manager/* | |
| - name: 发送Telegram通知 | |
| continue-on-error: true | |
| env: | |
| COMMIT_MESSAGE: ${{ github.event.head_commit.message }} | |
| COMMIT_URL: ${{ github.event.head_commit.url }} | |
| RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| RELEASE_URL: ${{ github.server_url }}/${{ github.repository }}/releases/tag/rel-${{ steps.time.outputs.timestamp }} | |
| run: | | |
| msg="*CI ${{ steps.time.outputs.time }}* | |
| > Branch/分支: \`${{ github.ref_name }}\` | |
| \`\`\` | |
| $COMMIT_MESSAGE | |
| \`\`\` | |
| [Download/下载]($RELEASE_URL) | |
| [Commit/提交]($COMMIT_URL) | |
| [Run/工作流]($RUN_URL) | |
| " | |
| curl -LSs https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage \ | |
| -F 'chat_id="${{ secrets.TELEGRAM_CHAT_ID }}"' \ | |
| -F 'message_thread_id=${{ secrets.TELEGRAM_MESSAGE_THREAD_ID }}' \ | |
| -F 'parse_mode="markdownv2"' \ | |
| -F "text=\"$msg\"" | tee Markdown.txt | |
| ! ${{ startsWith(github.ref_name, 'stable/') }} || \ | |
| curl https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/pinChatMessage \ | |
| -F 'chat_id="${{ secrets.TELEGRAM_CHAT_ID }}"' \ | |
| -F message_id=$(jq '.result.message_id' Markdown.txt) |