diff --git a/.github/workflows/build-kernel.yml b/.github/workflows/build-kernel.yml index 33f8baf9..f7ee42d7 100644 --- a/.github/workflows/build-kernel.yml +++ b/.github/workflows/build-kernel.yml @@ -34,13 +34,25 @@ jobs: name: Build aarch64-${{ matrix.version }} runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 + with: + path: KernelSU - name: Download kernel source run: | + cd $GITHUB_WORKSPACE git clone https://gerrit.googlesource.com/git-repo mkdir android-kernel && cd android-kernel ../git-repo/repo init -u https://android.googlesource.com/kernel/manifest -b common-${{ matrix.tag }} ../git-repo/repo sync - curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - + echo "[+] KernelSU setup" + GKI_ROOT=$(pwd) + echo "[+] GKI_ROOT: $GKI_ROOT" + echo "[+] Copy kernel su driver to $GKI_ROOT/common/drivers" + ln -sf $GITHUB_WORKSPACE/KernelSU/kernel $GKI_ROOT/common/drivers/kernelsu + echo "[+] Add kernel su driver to Makefile" + DRIVER_MAKEFILE=$GKI_ROOT/common/drivers/Makefile + grep -q "kernelsu" $DRIVER_MAKEFILE || echo "obj-y += kernelsu/" >> $DRIVER_MAKEFILE + echo "[+] KernelSU setup Done." curl -Lo gki-kernel.zip https://dl.google.com/android/gki/gki-certified-boot-${{ matrix.tag }}_r1.zip unzip gki-kernel.zip tools/mkbootimg/unpack_bootimg.py --boot_img=$(find . -maxdepth 1 -name "*.img")