From 7b996f2315486f57866222264fdbe8402359b57c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=BB=E3=83=AA=E3=82=AB=E3=83=BB=E3=82=B7=E3=83=AB?= =?UTF-8?q?=E3=83=95=E3=82=A3=E3=83=AB?= <64072399+natsumerinchan@users.noreply.github.com> Date: Sun, 23 Jul 2023 22:34:32 +0800 Subject: [PATCH] CI: Supports setting up a customized manager (#70) --- .github/workflows/build-kernel.yml | 6 ++++++ README.md | 10 ++++++++++ README_EN.md | 10 ++++++++++ config.env | 2 ++ 4 files changed, 28 insertions(+) diff --git a/.github/workflows/build-kernel.yml b/.github/workflows/build-kernel.yml index cfb69f841d..2ce21588b2 100644 --- a/.github/workflows/build-kernel.yml +++ b/.github/workflows/build-kernel.yml @@ -42,6 +42,8 @@ jobs: echo "NEED_DTBO=$(cat config.env | grep -w "NEED_DTBO" | head -n 1 | cut -d "=" -f 2)" >> $GITHUB_ENV echo "BUILD_BOOT_IMG=$(cat config.env | grep -w "BUILD_BOOT_IMG" | head -n 1 | cut -d "=" -f 2)" >> $GITHUB_ENV echo "SOURCE_BOOT_IMAGE=$(cat config.env | grep -w "SOURCE_BOOT_IMAGE" | head -n 1 | cut -d "=" -f 2)" >> $GITHUB_ENV + echo "KSU_EXPECTED_SIZE=$(cat config.env | grep -w "KSU_EXPECTED_SIZE" | head -n 1 | cut -d "=" -f 2)" >> $GITHUB_ENV + echo "KSU_EXPECTED_HASH=$(cat config.env | grep -w "KSU_EXPECTED_HASH" | head -n 1 | cut -d "=" -f 2)" >> $GITHUB_ENV - name: Setup build kernel environment run: | @@ -157,6 +159,10 @@ jobs: export PATH=$GITHUB_WORKSPACE/kernel_workspace/clang-aosp/bin:$PATH export KBUILD_BUILD_HOST=Github-Action export KBUILD_BUILD_USER=$(echo ${{ github.actor }} | tr A-Z a-z) + if [ ! -z ${{ env.KSU_EXPECTED_SIZE }} ] && [ ! -z ${{ env.KSU_EXPECTED_HASH }} ]; then + export KSU_EXPECTED_SIZE=${{ env.KSU_EXPECTED_SIZE }} + export KSU_EXPECTED_HASH=${{ env.KSU_EXPECTED_HASH }} + fi make -j$(nproc --all) CC=clang O=out ARCH=${{ env.ARCH }} ${{ env.CUSTOM_CMDS }} ${{ env.EXTRA_CMDS }} ${{ env.GCC_64 }} ${{ env.GCC_32 }} ${{ env.KERNEL_CONFIG }} if [ ${{ env.ENABLE_CCACHE }} = true ]; then make -j$(nproc --all) CC="ccache clang" O=out ARCH=${{ env.ARCH }} ${{ env.CUSTOM_CMDS }} ${{ env.EXTRA_CMDS }} ${{ env.GCC_64 }} ${{ env.GCC_32 }} diff --git a/README.md b/README.md index 0ca9c40030..848e3554e5 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,16 @@ Fork 本仓库到你的储存库然后按照以下内容编辑 config.env,之 - 最新 TAG(稳定版): `KERNELSU_TAG=` - 指定 TAG(如`v0.5.2`): `KERNELSU_TAG=v0.5.2` +#### KernelSU Manager signature size and hash + +自定义KernelSU管理器签名的size值和hash值,如果不需要自定义管理器则请留空或填入官方默认值: + +`KSU_EXPECTED_SIZE=0x033b` + +`KSU_EXPECTED_HASH=0xb0b91415` + +可键入`ksud debug get-sign `获取apk签名的size值和hash值 + ### Disable LTO LTO 用于优化内核,但有些时候会导致错误 diff --git a/README_EN.md b/README_EN.md index f408cbbe9d..319d53b716 100644 --- a/README_EN.md +++ b/README_EN.md @@ -123,6 +123,16 @@ Select the branch or tag of KernelSU: - Latest TAG (stable version): `KERNELSU_TAG=` - Specify the TAG (such as `v0.5.2`): `KERNELSU_TAG=v0.5.2` +#### KernelSU Manager signature size and hash + +Customize the size and hash values of the KernelSU manager signature, if you don't need to customize the manager then please leave them empty or fill in the official default values: + +`KSU_EXPECTED_SIZE=0x033b` + +`KSU_EXPECTED_HASH=0xb0b91415` + +You can type `ksud debug get-sign ` to get the size and hash of the apk signature. + ### Add Kprobes Config Inject parameters into the defconfig automatically. diff --git a/config.env b/config.env index 5fa8f7b3b6..ccb5371fa1 100644 --- a/config.env +++ b/config.env @@ -25,6 +25,8 @@ ENABLE_GCC_ARM32=true # KernelSU flags ENABLE_KERNELSU=false KERNELSU_TAG=main +KSU_EXPECTED_SIZE= +KSU_EXPECTED_HASH= # Configuration DISABLE-LTO=false