diff --git a/.github/workflows/build-kernel-arcvm.yml b/.github/workflows/build-kernel-arcvm.yml index 33579a8ba4bb..fadcbd751adf 100644 --- a/.github/workflows/build-kernel-arcvm.yml +++ b/.github/workflows/build-kernel-arcvm.yml @@ -97,6 +97,10 @@ jobs: run: | set -a && . build.config.gki.x86_64; set +a export DEFCONFIG=x86_64_arcvm_defconfig + if [ ! -z ${{ vars.EXPECTED_SIZE }} ] && [ ! -z ${{ vars.EXPECTED_HASH }} ]; then + export KSU_EXPECTED_SIZE=${{ vars.EXPECTED_SIZE }} + export KSU_EXPECTED_HASH=${{ vars.EXPECTED_HASH }} + fi make LLVM=1 LLVM_IAS=1 DEPMOD=depmod DTC=dtc O=${PWD} mrproper make LLVM=1 LLVM_IAS=1 DEPMOD=depmod DTC=dtc O=${PWD} ${DEFCONFIG} < /dev/null diff --git a/.github/workflows/build-kernel-wsa.yml b/.github/workflows/build-kernel-wsa.yml index e542b9bd587f..707a2f1d863c 100644 --- a/.github/workflows/build-kernel-wsa.yml +++ b/.github/workflows/build-kernel-wsa.yml @@ -115,6 +115,10 @@ jobs: run: | cp configs/wsa/${{ matrix.make_config }} .config make olddefconfig + if [ ! -z ${{ vars.EXPECTED_SIZE }} ] && [ ! -z ${{ vars.EXPECTED_HASH }} ]; then + export KSU_EXPECTED_SIZE=${{ vars.EXPECTED_SIZE }} + export KSU_EXPECTED_HASH=${{ vars.EXPECTED_HASH }} + fi make -j`nproc` LLVM=1 ARCH=${{ matrix.arch }} CROSS_COMPILE=${{ matrix.cross_compile }} ${{ matrix.file_name }} CCACHE="/usr/bin/ccache" declare -A ARCH_MAP=(["x86_64"]="x86" ["arm64"]="arm64") echo "file_path=WSA-Linux-Kernel/arch/${ARCH_MAP[${{ matrix.arch }}]}/boot/${{ matrix.file_name }}" >> $GITHUB_ENV diff --git a/.github/workflows/gki-kernel.yml b/.github/workflows/gki-kernel.yml index 6d5265fe95f5..1dc526196273 100644 --- a/.github/workflows/gki-kernel.yml +++ b/.github/workflows/gki-kernel.yml @@ -144,7 +144,12 @@ jobs: - name: Build boot.img working-directory: android-kernel - run: CCACHE="/usr/bin/ccache" LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh + run: | + if [ ! -z ${{ vars.EXPECTED_SIZE }} ] && [ ! -z ${{ vars.EXPECTED_HASH }} ]; then + export KSU_EXPECTED_SIZE=${{ vars.EXPECTED_SIZE }} + export KSU_EXPECTED_HASH=${{ vars.EXPECTED_HASH }} + fi + CCACHE="/usr/bin/ccache" LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh - name: Prepare artifacts id: prepareArtifacts diff --git a/kernel/Makefile b/kernel/Makefile index 6ff901f05593..5ba201cf259f 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -24,15 +24,18 @@ $(warning "KSU_GIT_VERSION not defined! It is better to make KernelSU a git subm ccflags-y += -DKSU_VERSION=16 endif -ifndef EXPECTED_SIZE -EXPECTED_SIZE := 0x033b +ifndef KSU_EXPECTED_SIZE +KSU_EXPECTED_SIZE := 0x033b endif -ifndef EXPECTED_HASH -EXPECTED_HASH := 0xb0b91415 +ifndef KSU_EXPECTED_HASH +KSU_EXPECTED_HASH := 0xb0b91415 endif -ccflags-y += -DEXPECTED_SIZE=$(EXPECTED_SIZE) -ccflags-y += -DEXPECTED_HASH=$(EXPECTED_HASH) +$(info -- KernelSU Manager signature size: $(KSU_EXPECTED_SIZE)) +$(info -- KernelSU Manager signature hash: $(KSU_EXPECTED_HASH)) + +ccflags-y += -DEXPECTED_SIZE=$(KSU_EXPECTED_SIZE) +ccflags-y += -DEXPECTED_HASH=$(KSU_EXPECTED_HASH) ccflags-y += -Wno-implicit-function-declaration -Wno-strict-prototypes -Wno-int-conversion -Wno-gcc-compat ccflags-y += -Wno-declaration-after-statement