Skip to content

Commit

Permalink
CI: Supports setting up a customized manager (xiaoleGun#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
natsumerinchan authored Jul 23, 2023
1 parent 90ede83 commit 7b996f2
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build-kernel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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 }}
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_path>`获取apk签名的size值和hash值

### Disable LTO

LTO 用于优化内核,但有些时候会导致错误
Expand Down
10 changes: 10 additions & 0 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <apk_path>` to get the size and hash of the apk signature.

### Add Kprobes Config

Inject parameters into the defconfig automatically.
Expand Down
2 changes: 2 additions & 0 deletions config.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7b996f2

Please sign in to comment.