diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f50dcb6..f1fb8bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,8 +18,12 @@ on: jobs: build: name: GKI Kernel Module Build - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest needs: upload-artifact + env: + CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion" + CCACHE_NOHASHDIR: "true" + CCACHE_HARDLINK: "true" strategy: fail-fast: false matrix: @@ -53,12 +57,13 @@ jobs: with: arch: ${{ matrix.arch }} tag: ${{ matrix.tag }} + lto: false module-name: ovo module-path: ovo upload-artifact: name: Upload LKM Source Code - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v4 diff --git a/action.yml b/action.yml index 25a9cc4..0c6192e 100644 --- a/action.yml +++ b/action.yml @@ -20,6 +20,10 @@ inputs: module-name: description: 'Specify the name of the kernel module.' required: true + lto: + description: 'Enable LTO build.' + type: boolean + required: true runs: using: "composite" @@ -143,7 +147,8 @@ runs: cd common/ && git add -A && git commit -a -m "Add Kernel Module" repo status - - name: Build Kernel + - name: Build Kernel(LTO) + if: ${{ inputs.lto == true }} shell: bash working-directory: android-kernel run: | @@ -169,6 +174,33 @@ runs: fi fi + - name: Build Kernel(NoLTO) + if: ${{ inputs.lto == false }} + shell: bash + working-directory: android-kernel + run: | + if [[ "${{ inputs.tag }}" == "android16-6.12" ]]; then + if [ "${{ inputs.arch }}" = "aarch64" ]; then + tools/bazel run --disk_cache=/home/runner/.cache/bazel --config=fast --lto=none //common:kernel_aarch64_dist + elif [ "${{ inputs.arch }}" = "x86_64" ]; then + tools/bazel run --disk_cache=/home/runner/.cache/bazel --config=fast --lto=none //common:kernel_x86_64_dist + fi + else + if [ "${{ inputs.arch }}" = "aarch64" ]; then + if [ -e build/build.sh ]; then + LTO=None BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh CC="/usr/bin/ccache clang" + else + tools/bazel run --disk_cache=/home/runner/.cache/bazel --config=fast --lto=none //common:kernel_aarch64_dist -- --dist_dir=dist + fi + elif [ "${{ inputs.arch }}" = "x86_64" ]; then + if [ -e build/build.sh ]; then + LTO=None BUILD_CONFIG=common/build.config.gki.x86_64 build/build.sh CC="/usr/bin/ccache clang" + else + tools/bazel run --disk_cache=/home/runner/.cache/bazel --config=fast --lto=none //common:kernel_x86_64_dist -- --dist_dir=dist + fi + fi + fi + - name: Prepare Artifacts shell: bash run: | diff --git a/ovo/Makefile b/ovo/Makefile index e701236..49fbcf6 100644 --- a/ovo/Makefile +++ b/ovo/Makefile @@ -7,7 +7,7 @@ $(MODULE)-objs += kkit.o $(MODULE)-objs += peekaboo.o $(MODULE)-objs += memory.o -EXTRA_CFLAGS = -fno-pic +EXTRA_CFLAGS += -fno-pic EXTRA_CFLAGS += -DHIDE_SELF_MODULE=0 # 是否在模块表中移除自己 EXTRA_CFLAGS += -DBUILD_REMAP=0 # 是否编译内存重映射API(不稳定) EXTRA_CFLAGS += -DINJECT_SYSCALLS=0 # 是否注入SYSCALL实现反检测 diff --git a/ovo/peekaboo.c b/ovo/peekaboo.c index a31812a..65b12f3 100644 --- a/ovo/peekaboo.c +++ b/ovo/peekaboo.c @@ -40,6 +40,6 @@ void cuteBabyPleaseDontCry(void) { #endif #if INJECT_SYSCALLS == 1 - + #endif }