CI: Support set manager signature size and hash (#757)

close #739, close #745, close #752
This commit is contained in:
セリカ・シルフィル
2023-07-18 12:38:44 +08:00
committed by GitHub
parent 56d145666c
commit be413fd147
4 changed files with 23 additions and 7 deletions

View File

@@ -97,6 +97,10 @@ jobs:
run: | run: |
set -a && . build.config.gki.x86_64; set +a set -a && . build.config.gki.x86_64; set +a
export DEFCONFIG=x86_64_arcvm_defconfig 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} mrproper
make LLVM=1 LLVM_IAS=1 DEPMOD=depmod DTC=dtc O=${PWD} ${DEFCONFIG} < /dev/null make LLVM=1 LLVM_IAS=1 DEPMOD=depmod DTC=dtc O=${PWD} ${DEFCONFIG} < /dev/null

View File

@@ -115,6 +115,10 @@ jobs:
run: | run: |
cp configs/wsa/${{ matrix.make_config }} .config cp configs/wsa/${{ matrix.make_config }} .config
make olddefconfig 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" 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") 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 echo "file_path=WSA-Linux-Kernel/arch/${ARCH_MAP[${{ matrix.arch }}]}/boot/${{ matrix.file_name }}" >> $GITHUB_ENV

View File

@@ -144,7 +144,12 @@ jobs:
- name: Build boot.img - name: Build boot.img
working-directory: android-kernel 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 - name: Prepare artifacts
id: prepareArtifacts id: prepareArtifacts

View File

@@ -24,15 +24,18 @@ $(warning "KSU_GIT_VERSION not defined! It is better to make KernelSU a git subm
ccflags-y += -DKSU_VERSION=16 ccflags-y += -DKSU_VERSION=16
endif endif
ifndef EXPECTED_SIZE ifndef KSU_EXPECTED_SIZE
EXPECTED_SIZE := 0x033b KSU_EXPECTED_SIZE := 0x033b
endif endif
ifndef EXPECTED_HASH ifndef KSU_EXPECTED_HASH
EXPECTED_HASH := 0xb0b91415 KSU_EXPECTED_HASH := 0xb0b91415
endif endif
ccflags-y += -DEXPECTED_SIZE=$(EXPECTED_SIZE) $(info -- KernelSU Manager signature size: $(KSU_EXPECTED_SIZE))
ccflags-y += -DEXPECTED_HASH=$(EXPECTED_HASH) $(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-implicit-function-declaration -Wno-strict-prototypes -Wno-int-conversion -Wno-gcc-compat
ccflags-y += -Wno-declaration-after-statement ccflags-y += -Wno-declaration-after-statement