17 Commits
v1.0 ... main

Author SHA1 Message Date
dichgrem
aecef496ca chore:config_corvette 2025-12-15 10:11:36 +08:00
dichgrem
ce58044e89 build:fix4.patch 2025-11-13 15:22:40 +08:00
dichgrem
e98b1f3f6e build:fix3.patch
build:fix1.patch
2025-11-09 22:21:38 +08:00
dichgrem
3967a0ecca chore:a15config 2025-11-02 15:28:17 +08:00
dichgrem
2686d6a135 chore:add_package.sh 2025-10-30 14:24:27 +08:00
dichgrem
49aca10ce6 feat:add_giulia 2025-10-22 16:57:57 +08:00
dichgrem
75ed232bb3 feat:auto_package_name 2025-10-10 11:03:21 +08:00
dichgrem
943277d590 fix:build_step 2025-10-10 08:24:46 +08:00
dichgrem
70a8794285 fix:susfs_steps 2025-10-09 21:53:13 +08:00
dichgrem
3727b78483 style:some_name 2025-10-09 14:04:41 +08:00
dichgrem
8d2e7cab3c feat:kpm_support 2025-10-09 13:43:12 +08:00
dichgrem
51c3213124 feat:lsm_bbg_support 2025-10-09 12:58:41 +08:00
dichgrem
e7b2b4892a feat:sched_support 2025-10-09 12:01:14 +08:00
dichgrem
1b9fec2bb3 feat:zram_support 2025-10-09 09:16:40 +08:00
dichgrem
5bbbe4bde1 style:name 2025-10-07 14:04:04 +08:00
dichgrem
2f31bb26a3 feat:bbr_support 2025-10-06 22:30:37 +08:00
dichgrem
ba5b6e35f8 feat:lto_level 2025-10-06 21:23:46 +08:00
10 changed files with 17780 additions and 29 deletions

View File

@@ -3,18 +3,44 @@ name: Build Ace3Pro Kernel
on: on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
enable_susfs: enable_bbr:
description: "Enable susfs support" description: "Enable BBR support"
required: false required: false
default: "true" default: "false"
type: boolean type: boolean
config_source: enable_kpm:
description: "Choose config source for myconfig" description: "Enable KPM support"
required: true required: false
default: "repo" default: "false"
type: boolean
enable_zram:
description: "Enable ZRAM support"
required: false
default: "false"
type: boolean
enable_sched:
description: "Enable SCHED support"
required: false
default: "false"
type: boolean
enable_susfs:
description: "Enable SUSFS support"
required: false
default: "false"
type: boolean
enable_lsm:
description: "Enable LSM_BBG support"
required: false
default: "false"
type: boolean
lto_solution:
description: "Select the level of lto"
required: false
default: "thin"
type: choice type: choice
options: options:
- repo - thin
- full
root_solution: root_solution:
description: "Choose root solution to integrate" description: "Choose root solution to integrate"
required: false required: false
@@ -25,11 +51,6 @@ on:
- kernelsu - kernelsu
- kernelsu-next - kernelsu-next
- none - none
kernel_name:
description: "Custom kernel name (optional)"
required: false
default: "GKI"
type: string
jobs: jobs:
build-kernel: build-kernel:
@@ -53,7 +74,7 @@ jobs:
pahole dwarves zip gcc g++ pahole dwarves zip gcc g++
gcc --version gcc --version
- name: Setup toolchains & directories - name: Setup clang toolchains
run: | run: |
set -e set -e
echo "WORKDIR=$WORKDIR" echo "WORKDIR=$WORKDIR"
@@ -78,7 +99,7 @@ jobs:
echo "✅ Setup toolchains -> OK" echo "✅ Setup toolchains -> OK"
- name: Setup & Clone Kernel - name: Clone & Setup Kernel
run: | run: |
set -e set -e
mkdir -p "$WORKDIR" mkdir -p "$WORKDIR"
@@ -102,7 +123,7 @@ jobs:
# 设置 KERNEL_DIR 环境变量 # 设置 KERNEL_DIR 环境变量
echo "KERNEL_DIR=android_kernel_oneplus_sm8650" >> $GITHUB_ENV echo "KERNEL_DIR=android_kernel_oneplus_sm8650" >> $GITHUB_ENV
- name: Copy and configure kernel config - name: Copy and configure config
run: | run: |
set -euo pipefail set -euo pipefail
echo "WORKDIR=$WORKDIR" echo "WORKDIR=$WORKDIR"
@@ -134,8 +155,7 @@ jobs:
exit 1 exit 1
fi fi
- name: Install Root solution
- name: Install root solution
run: | run: |
cd "$WORKDIR/$KERNEL_DIR" cd "$WORKDIR/$KERNEL_DIR"
export KCONFIG_CONFIG="$PWD/arch/arm64/configs/config_defconfig" export KCONFIG_CONFIG="$PWD/arch/arm64/configs/config_defconfig"
@@ -154,7 +174,7 @@ jobs:
;; ;;
sukisu) sukisu)
echo "✅ 集成 SukiSU-Ultra" echo "✅ 集成 SukiSU-Ultra"
curl -LSs https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh | bash -s main curl -LSs https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh | bash -s susfs-main
echo "ROOT_SUFFIX=_SukiSU" >> $GITHUB_ENV echo "ROOT_SUFFIX=_SukiSU" >> $GITHUB_ENV
;; ;;
none) none)
@@ -168,10 +188,99 @@ jobs:
;; ;;
esac esac
- name: Apply Susfs patches - name: Enable BBR support
run: |
if [ "${{ inputs.enable_bbr }}" = "true" ]; then
echo "✅ Enabling BBR support"
cd "$WORKDIR/$KERNEL_DIR"
mkdir -p kernel/configs
printf '%s\n' \
'# Fragment config for enabling BBR' \
'CONFIG_TCP_CONG_ADVANCED=y' \
'CONFIG_TCP_CONG_BBR=y' \
'CONFIG_DEFAULT_BBR=y' \
'CONFIG_DEFAULT_TCP_CONG="bbr"' > kernel/configs/bbr.config
export ARCH=arm64
export KCONFIG_CONFIG=arch/arm64/configs/config_defconfig.new
scripts/kconfig/merge_config.sh -m arch/arm64/configs/config_defconfig kernel/configs/bbr.config
mv arch/arm64/configs/config_defconfig.new arch/arm64/configs/config_defconfig
echo "✅ BBR patch step finished"
else
echo "⏩ Skipping BBR support (disabled)"
fi
- name: Enable KPM support
run: |
if [[ "${{ inputs.enable_kpm }}" == "true" && "${{ inputs.root_solution }}" == "sukisu" ]]; then
echo "✅ Enabling KPM support"
cd "$WORKDIR/$KERNEL_DIR"
mkdir -p kernel/configs
printf '%s\n' \
'# Fragment config for enabling KPM' \
'CONFIG_KPM=y' > kernel/configs/kpm.config
export ARCH=arm64
export KCONFIG_CONFIG=arch/arm64/configs/config_defconfig.new
scripts/kconfig/merge_config.sh -m arch/arm64/configs/config_defconfig kernel/configs/kpm.config
mv arch/arm64/configs/config_defconfig.new arch/arm64/configs/config_defconfig
echo "✅ KPM config finished"
else
echo " KPM patches skipped"
fi
- name: Enable ZRAM support
run: |
if [ "${{ inputs.enable_zram }}" = "true" ]; then
echo "✅ Enabling ZRAM support"
cd $GITHUB_WORKSPACE/kernel/
git clone https://github.com/ShirkNeko/SukiSU_patch.git
cd "$WORKDIR/$KERNEL_DIR"
echo "正在拉取ZRAM补丁"
cp -r ../SukiSU_patch/other/zram/lz4k/include/linux/* ./include/linux/
cp -r ../SukiSU_patch/other/zram/lz4k/lib/* ./lib/
cp -r ../SukiSU_patch/other/zram/lz4k/crypto/* ./crypto/
cp -r ../SukiSU_patch/other/zram/lz4k_oplus ./lib/
cp ../SukiSU_patch/other/zram/zram_patch/6.1/lz4kd.patch ./
echo "正在打lz4kd补丁"
patch -p1 -F 3 < lz4kd.patch || true
echo "✅ lz4kd_patch完成"
cp ../SukiSU_patch/other/zram/zram_patch/6.1/lz4k_oplus.patch ./
echo "正在打lz4k_oplus补丁"
patch -p1 -F 3 < lz4k_oplus.patch || true
echo "✅ lz4k_oplus_patch完成"
cd "$WORKDIR/$KERNEL_DIR"
mkdir -p kernel/configs
printf '%s\n' \
'# Fragment config for enabling ZRAM' \
'CONFIG_CRYPTO_LZ4HC=y' \
'CONFIG_CRYPTO_LZ4K=y' \
'CONFIG_CRYPTO_LZ4KD=y' \
'CONFIG_CRYPTO_842=y' \
'CONFIG_CRYPTO_LZ4K_OPLUS=y' \
'CONFIG_ZRAM_WRITEBACK=y' > kernel/configs/zram.config
export ARCH=arm64
export KCONFIG_CONFIG=arch/arm64/configs/config_defconfig.new
scripts/kconfig/merge_config.sh -m arch/arm64/configs/config_defconfig kernel/configs/zram.config
mv arch/arm64/configs/config_defconfig.new arch/arm64/configs/config_defconfig
echo "✅ ZRAM patch step finished"
else
echo " ZRAM patches skipped"
fi
- name: Enable SUSFS support
run: | run: |
if [ "${{ inputs.enable_susfs }}" = "true" ]; then if [ "${{ inputs.enable_susfs }}" = "true" ]; then
cd $GITHUB_WORKSPACE/kernel/android_kernel_oneplus_sm8650 echo "✅ Enabling SUSFS support"
cd "$WORKDIR/$KERNEL_DIR"
echo "🌿 Cloning susfs4ksu repository" echo "🌿 Cloning susfs4ksu repository"
git clone https://gitlab.com/simonpunk/susfs4ksu.git git clone https://gitlab.com/simonpunk/susfs4ksu.git
@@ -190,11 +299,76 @@ jobs:
cd ../ cd ../
patch -p1 --fuzz=3 --ignore-whitespace < 50_add_susfs_in_gki-android14-6.1.patch || true patch -p1 --fuzz=3 --ignore-whitespace < 50_add_susfs_in_gki-android14-6.1.patch || true
echo "✅ Susfs patch step finished" if [ "${{ github.event.inputs.root_solution }}" = "sukisu" ]; then
echo "📦 Applying Fix patches for SukiSU"
patch -p1 < "$GITHUB_WORKSPACE/patches/fix1.patch"
patch -p1 < "$GITHUB_WORKSPACE/patches/fix2.patch"
fi
mkdir -p kernel/configs
printf '%s\n' \
'# Fragment config for enabling SUSFS' \
'CONFIG_KSU_SUSFS=y' \
'CONFIG_KSU_SUSFS_HAS_MAGIC_MOUNT=y' \
'CONFIG_KSU_SUSFS_SUS_PATH=y' \
'CONFIG_KSU_SUSFS_SUS_MOUNT=y' \
'CONFIG_KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT=y' \
'CONFIG_KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT=y' \
'CONFIG_KSU_SUSFS_SUS_KSTAT=y' \
'CONFIG_KSU_SUSFS_SUS_OVERLAYFS=n' \
'CONFIG_KSU_SUSFS_TRY_UMOUNT=y' \
'CONFIG_KSU_SUSFS_AUTO_ADD_TRY_UMOUNT_FOR_BIND_MOUNT=y' \
'CONFIG_KSU_SUSFS_SPOOF_UNAME=y' \
'CONFIG_KSU_SUSFS_ENABLE_LOG=y' \
'CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y' \
'CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y' \
'CONFIG_KSU_SUSFS_OPEN_REDIRECT=y' > kernel/configs/susfs.config
export ARCH=arm64
export KCONFIG_CONFIG=arch/arm64/configs/config_defconfig.new
scripts/kconfig/merge_config.sh -m arch/arm64/configs/config_defconfig kernel/configs/susfs.config
mv arch/arm64/configs/config_defconfig.new arch/arm64/configs/config_defconfig
echo "✅ SUSFS patch step finished"
else else
echo " Susfs patches skipped" echo " SUSFS patches skipped"
fi fi
- name: Enable SCHED support
run: |
if [ "${{ inputs.enable_sched }}" = "true" ]; then
echo "✅ Enabling SCHED support"
cd "$WORKDIR/$KERNEL_DIR"
git clone https://github.com/HanKuCha/sched_ext.git
cp -r ./sched_ext/* ./kernel/sched
rm -rf ./sched_ext/.git
echo "✅ SCHED patch step finished"
cd ./kernel/sched
ls -la
else
echo " SCHED skipped"
fi
- name: Enable LSM_BBG support
run: |
if [ "${{ inputs.enable_lsm }}" = "true" ]; then
cd "$WORKDIR/$KERNEL_DIR"
echo "✅ Enabling LSM_BBG support"
wget -O- https://github.com/vc-teahouse/Baseband-guard/raw/main/setup.sh | bash
sed -i '/^config LSM$/,/^help$/{ /^[[:space:]]*default/ { /baseband_guard/! s/landlock/landlock,baseband_guard/ } }' security/Kconfig
mkdir -p kernel/configs
printf '%s\n' \
'# Fragment config for enabling LSM' \
'CONFIG_BBG=y' > kernel/configs/lsm.config
export ARCH=arm64
export KCONFIG_CONFIG=arch/arm64/configs/config_defconfig.new
scripts/kconfig/merge_config.sh -m arch/arm64/configs/config_defconfig kernel/configs/lsm.config
mv arch/arm64/configs/config_defconfig.new arch/arm64/configs/config_defconfig
echo "✅ LSM_BBG step finished"
else
echo " LSM_BBG skipped"
fi
- name: Build kernel - name: Build kernel
run: | run: |
@@ -211,8 +385,8 @@ jobs:
export KERNEL_DEFCONFIG=config_defconfig export KERNEL_DEFCONFIG=config_defconfig
# 默认 LTO 为 thin # 默认 LTO 为 thin
export LTO="${LTO:-thin}" export LTO="${{ inputs.lto_solution || 'thin' }}"
echo "LTO mode: $LTO" echo "LTO mode: $LTO"
# 工具链路径 # 工具链路径
export CLANG_PATH="$WORKDIR/clang-r547379" export CLANG_PATH="$WORKDIR/clang-r547379"
@@ -282,7 +456,6 @@ jobs:
BUILD_ARGS="-j${TH_COUNT} ${DEF_ARGS}" BUILD_ARGS="-j${TH_COUNT} ${DEF_ARGS}"
echo "=== Start make (logging to ${OUT}/error.log) ===" echo "=== Start make (logging to ${OUT}/error.log) ==="
chmod -R 777 *
rm android/abi_gki_protected_exports_* || true rm android/abi_gki_protected_exports_* || true
make ${BUILD_ARGS} 2>&1 | tee ${OUT}/error.log || true make ${BUILD_ARGS} 2>&1 | tee ${OUT}/error.log || true
@@ -317,6 +490,20 @@ jobs:
exit 1 exit 1
fi fi
- name: Apply KPM patches
run: |
if [[ "${{ inputs.enable_kpm }}" == "true" && "${{ inputs.root_solution }}" == "sukisu" ]]; then
cd $GITHUB_WORKSPACE/kernel/android_kernel_oneplus_sm8650/out/arch/arm64/boot
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU_patch/refs/heads/main/kpm/patch_linux" -o patch
chmod 777 patch
./patch
rm -rf Image
mv oImage Image
echo "✅ KPM patch finished"
else
echo " SCHED skipped"
fi
- name: Replace Image in anykernel3 - name: Replace Image in anykernel3
run: | run: |
set -e set -e
@@ -359,9 +546,22 @@ jobs:
${{ github.workspace }}/kernel/${{ env.KERNEL_DIR }}/out/.config ${{ github.workspace }}/kernel/${{ env.KERNEL_DIR }}/out/.config
${{ github.workspace }}/kernel/output/kernel_info.txt ${{ github.workspace }}/kernel/output/kernel_info.txt
- name: Set package name
run: |
PKG_NAME="anykernel3-${{ github.run_number }}"
[[ "${{ inputs.enable_bbr }}" == "true" ]] && PKG_NAME="${PKG_NAME}_bbr"
[[ "${{ inputs.enable_kpm }}" == "true" ]] && PKG_NAME="${PKG_NAME}_kpm"
[[ "${{ inputs.enable_zram }}" == "true" ]] && PKG_NAME="${PKG_NAME}_zram"
[[ "${{ inputs.enable_sched }}" == "true" ]] && PKG_NAME="${PKG_NAME}_sched"
[[ "${{ inputs.enable_susfs }}" == "true" ]] && PKG_NAME="${PKG_NAME}_susfs"
[[ "${{ inputs.enable_lsm }}" == "true" ]] && PKG_NAME="${PKG_NAME}_lsm"
[[ "${{ inputs.root_solution }}" != "none" ]] && PKG_NAME="${PKG_NAME}_${{ inputs.root_solution }}"
PKG_NAME="${PKG_NAME}_lto-${{ inputs.lto_solution }}"
echo "PKG_NAME=$PKG_NAME" >> $GITHUB_ENV
- name: Upload AnyKernel3 package - name: Upload AnyKernel3 package
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
if: always() if: always()
with: with:
name: anykernel3-${{ github.run_number }}${{ env.ROOT_SUFFIX }} name: ${{ env.PKG_NAME }}
path: ${{ github.workspace }}/anykernel3-${{ github.run_number }}.zip path: ${{ github.workspace }}/anykernel3-${{ github.run_number }}.zip

View File

@@ -16,9 +16,14 @@
## Features ## Features
- Use clang-r547379 - Use clang-r547379
- Enable ThinLTO to build - Enable ThinLTO/FullLTO to build
- Enable Root support : kernelsu/SukiSU/kernelsu-next - Enable Root support : kernelsu/SukiSU/kernelsu-next
- Enable Susfs support : You can build susfs into kernel - Enable BBR support : Enable bbr congestion control algorithm
- Enable KPM support : Enable kpm support in kernel
- Enable ZRAM support : Enable extra zram algorithm(LZ4KD/LZ4K_oplus)
- Enable SUSFS support : You can build susfs into kernel
- Enable SCHED support : Enable Fengchi scx scheduling
- Enable LSM_BBG support block unauthorized writes to critical partitions/device nodes
- Enable Anykernel3 support : Packaged as a zip package of anykernel3 - Enable Anykernel3 support : Packaged as a zip package of anykernel3
To be continued... To be continued...

8726
config/a15_config_11.9_corvette Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

38
package.sh Normal file
View File

@@ -0,0 +1,38 @@
#!/bin/bash
set -euo pipefail
R="$(printf '\033[1;31m')"
G="$(printf '\033[1;32m')"
Y="$(printf '\033[1;33m')"
C="$(printf '\033[1;36m')"
W="$(printf '\033[0m')"
ORIG_ZIP="anykernel3-sukisu-susfs-nokpm-6.1.130.zip"
NEW_ZIP="anykernel3-sukisu-susfs-nokpm-6.1.130-new.zip"
WORK_DIR="ak3_work"
NEW_IMAGE="Image"
echo -e "${C}🧹 清理旧文件...${W}"
rm -rf "$WORK_DIR" "$NEW_ZIP"
mkdir -p "$WORK_DIR"
cd "$WORK_DIR"
echo -e "${C}📦 解压原始刷机包...${W}"
unzip -q "../$ORIG_ZIP" || { echo -e "${R}❌ 解压失败!${W}"; exit 1; }
FILE_COUNT=$(find . -type f | wc -l)
(( FILE_COUNT > 10 )) || { echo -e "${R}❌ 文件数量异常: $FILE_COUNT${W}"; exit 1; }
echo -e "${G}✅ 解压成功,共 $FILE_COUNT 个文件。${W}"
echo -e "${C}🪣 备份原始 Image 文件...${W}"
cp -f Image ../Image.old.backup
echo -e "${C}🔁 替换新的 Image 文件...${W}"
cp -f ../$NEW_IMAGE ./Image
chmod 755 Image
echo -e "${C}📦 重新打包刷机包...${W}"
zip -r -q "../$NEW_ZIP" . -x "*/.*"
cd ..
echo -e "${G}✅ 操作完成!新刷机包: $NEW_ZIP${W}"

25
patches/fix1.patch Normal file
View File

@@ -0,0 +1,25 @@
From fa44e51fc7886e40c0748e2f1a389a6c740cc5c5 Mon Sep 17 00:00:00 2001
From: dichgrem <brcefy@gmail.com>
Date: Sun, 9 Nov 2025 21:15:25 +0800
Subject: [PATCH] fix:ksud.c
---
kernel/ksud.c | 144 ++++++++++++++++++++++++++++++--------------------
1 file changed, 87 insertions(+), 57 deletions(-)
diff --git a/kernel/ksud.c b/kernel/ksud.c
index d7078460..d213add5 100644
--- a/kernel/ksud.c
+++ b/kernel/ksud.c
@@ -68,6 +68,9 @@ bool ksu_execveat_hook __read_mostly = true;
bool susfs_is_sus_su_ready = false;
#endif // #ifdef CONFIG_KSU_SUSFS_SUS_SU
+#ifdef CONFIG_KSU_SUSFS_SUS_SU
+#endif // #ifdef CONFIG_KSU_SUSFS_SUS_SU
+
u32 ksu_devpts_sid;
// Detect whether it is on or not
--
2.43.0

8
patches/fix2.patch Normal file
View File

@@ -0,0 +1,8 @@
--- a/drivers/kernelsu/kernel_compat.c
+++ b/drivers/kernelsu/kernel_compat.c
@@ -83,6 +83,7 @@
+ #undef ksu_access_ok
int ksu_access_ok(const void *addr, unsigned long size) {
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)
/* For kernels before 5.0.0, pass the type argument to access_ok. */

25
patches/fix3.patch Normal file
View File

@@ -0,0 +1,25 @@
From 6059499ca6be9a424b09f8d5eeb626d0fbd8d126 Mon Sep 17 00:00:00 2001
From: dichgrem <brcefy@gmail.com>
Date: Sun, 9 Nov 2025 20:39:11 +0800
Subject: [PATCH] fix:base
---
fs/proc/base.c | 1106 +++++++++++++++++++++++++-----------------------
1 file changed, 576 insertions(+), 530 deletions(-)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index b0ec673a2..12f3b9a13 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -99,6 +99,9 @@
#include <linux/resctrl.h>
#include <linux/cn_proc.h>
#include <linux/cpufreq_times.h>
+#ifdef CONFIG_KSU_SUSFS_SUS_MAP
+#include <linux/susfs_def.h>
+#endif
#include <linux/dma-buf.h>
#include <trace/events/oom.h>
#include <trace/hooks/sched.h>
--
2.43.0

23
patches/fix4.patch Normal file
View File

@@ -0,0 +1,23 @@
--- a/drivers/kernelsu/core_hook.c
+++ b/drivers/kernelsu/core_hook.c
@@ -526,7 +526,6 @@
return 0;
}
-#endif // #ifdef CONFIG_KSU_SUSFS
#endif // KERNEL_VERSION(5, 11, 0)
--- a/KernelSU/kernel/sucompat.c
+++ b/KernelSU/kernel/sucompat.c
@@ -408,3 +408,11 @@
return 0;
}
+
+/* --- SUSFS compatibility wrapper --- */
+int ksu_handle_devpts(struct inode *inode)
+{
+ return __ksu_handle_devpts(inode);
+}
+EXPORT_SYMBOL(ksu_handle_devpts);