# LXC_KernelSU_Action **Repository Path**: liqiang9521/LXC_KernelSU_Action ## Basic Information - **Project Name**: LXC_KernelSU_Action - **Description**: 编译内核 源地址:https://github.com/tomxi1997/LXC_KernelSU_Action/ 启用docker:https://github.com/tomxi1997/termux-packages - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-02-05 - **Last Updated**: 2026-07-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README **中文** | [English](README_EN.md) # LXC-KernelSU Action 用于 Non-GKI Kernel 的 Action,具有一定的普遍性,需要了解内核及 Android 的相关知识得以运用。 ## 警告:warning: :warning: :warning: 如果你不是内核作者,使用他人的劳动成果构建 KernelSU,请仅供自己使用,不要分享给别人,这是对原作者的劳动成果的尊重。 ## 支持内核 - `5.4` - `4.19` - `4.14` - `4.9` ## 使用 > 所有 config.env 内的变量均只判断`true` > 编译成功后,会在`Action`上传 AnyKernel3,已经关闭设备检查,请在 Twrp 刷入。 Fork 本仓库到你的储存库然后按照以下内容编辑 config.env,之后点击`Star`或`Action`,在左侧可看见`Build Kernel`选项,点击选项会看见右边的大对话框的上面会有`Run workflows`点击它会启动构建。 ### Kernel Source 修改为你的内核仓库地址 例如: https://github.com/Diva-Room/Miku_kernel_xiaomi_wayne ### Kernel Source Branch 修改为你的内核分支 例如: TDA ### Kernel Config 修改为你的内核配置文件名 例如: vendor/wayne_defconfig ### Arch 例如: arm64 ### Kernel Image Name 修改为需要刷写的 kernel binary,一般与你的 aosp-device tree 里的 BOARD_KERNEL_IMAGE_NAME 是一致的 例如: Image.gz-dtb 常见还有 Image、Image.gz ### Clang #### Use custom clang 可以使用除 google 官方的 clang,如[proton-clang](https://github.com/kdrag0n/proton-clang) #### Custom Clang Source > 如果是 git 仓库,请填写包含`.git`的链接 支持 git 仓库或者 zip 压缩包的直链 #### Custom cmds 都用自定义 clang 了,自己改改这些配置应该都会吧 :) #### Clang Branch 由于 [#23](https://github.com/xiaoleGun/KernelSU_Action/issues/23) 的需要,我们提供可自定义 Google 上游分支的选项,主要的有分支有 | Clang 分支 | | ---------- | | master | | master-kernel-build-2021 | | master-kernel-build-2022 | 或者其它分支,请根据自己的需求在 https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86 中寻找 #### Clang version 填写需要使用的 Clang 版本 | Clang 版本 | 对应 Android 版本 | AOSP-Clang 版本 | | ---------- | ----------------- | --------------- | | 12.0.5 | Android S | r416183b | | 14.0.6 | Android T | r450784d | | 14.0.7 | | r450784e | | 15.0.1 | | r458507 | 一般 Clang12 就能通过大部分 4.14 及以上的内核的编译 我自己的 MI 6X 4.19 使用的是 r450784d ### GCC #### Enable GCC 64 启用 GCC 64 交叉编译 #### Enable GCC 32 启用 GCC 32 交叉编译 ### Extra cmds 有的内核需要加入一些其它编译命令,才能正常编译,一般不需要其它的命令,请自行搜索自己内核的资料 请在命令与命令之间用空格隔开 例如: LLVM=1 LLVM_IAS=1 ### Enable KernelSU 启用 KernelSU,用于排查内核故障或单独编译内核 #### KernelSU Branch or Tag 选择 KernelSU 的分支或 tag: - main 分支(开发版): `KERNELSU_TAG=main` - 最新 TAG(稳定版): `KERNELSU_TAG=` - 指定 TAG(如`v0.5.2`): `KERNELSU_TAG=v0.5.2` #### KernelSU Manager signature size and hash 自定义KernelSU管理器签名的size值和hash值,如果不需要自定义管理器则请留空或填入官方默认值: `KSU_EXPECTED_SIZE=0x033b` `KSU_EXPECTED_HASH=0xb0b91415` 可键入`ksud debug get-sign `获取apk签名的size值和hash值 ### Disable LTO LTO 用于优化内核,但有些时候会导致错误 ### Disable CC_WERROR 用于修复某些不支持或关闭了Kprobes的内核,修复KernelSU未检测到开启Kprobes的变量抛出警告导致错误 ### Add Kprobes Config 自动在 defconfig 注入参数 ### Add overlayfs Config 此参数为 KernelSU 模块和 system 分区读写提供支持 自动在 defconfig 注入参数 ### Enable ccache 启用缓存,让第二次编译内核更快,最少可以减少 2/5 的时间 ### Need DTBO 上传 DTBO 部分设备需要 ### Build Boot IMG > 从之前的 Workflows 合并进来的,可以查看历史提交 编译 boot.img,需要你提供`Source boot image` ### Source Boot Image 故名思义,提供一个源系统可以正常开机的 boot 镜像,需要直链,最好是同一套内核源码以及与你当前系统同一套设备树从 aosp 构建出来的。ramdisk 里面包含分区表以及 init,没有的话构建出来的镜像会无法正常引导。 例如: https://raw.githubusercontent.com/xiaoleGun/KernelSU_action/main/boot/boot-wayne-from-Miku-UI-latest.img ## 感谢 - [AnyKernel3](https://github.com/osm0sis/AnyKernel3) - [AOSP](https://android.googlesource.com) - [KernelSU](https://github.com/tiann/KernelSU) - [xiaoxindada](https://github.com/xiaoxindada) - [xiaoleGun](https://github.com/xiaoleGun/KernelSU_Action) - [qiuqiu](https://blog.qiuqiu233.top/) - [grilix](https://github.com/grilix/kernel-docker-support) - [wu17481748](https://github.com/wu17481748/LXC-DOCKER-KernelSU_Action) - [kdrag0n](https://github.com/kdrag0n/proton-clang) - [JonasCardoso](https://github.com/JonasCardoso/Toolchain) - [Neebe3289](https://gitlab.com/Neebe3289/android_prebuilts_clang_host_linux-x86) - [ZyCromerZ](https://github.com/ZyCromerZ/Clang) - [ARM](https://developer.arm.com/-/media/Files/downloads/gnu) - [LLVM](https://github.com/llvm/llvm-project/) - [mvaisakh](https://github.com/mvaisakh/gcc-build) - [HDTC](https://gitlab.com/HDTC/sdclang) - [Neutron-Toolchains](https://github.com/Neutron-Toolchains) - [kali](https://kali.download/nethunter-images/toolchains/) - [Mandi-Sa](https://github.com/Mandi-Sa/clang/)