How edhic1/kernel_ksu_next_lancelot works
Project Type and Purpose
• Type: Open-source build automation tool (CI/CD pipeline) for compiling and packaging a custom Android kernel (Redmi 9 “lancelot”), integrating KernelSU/SukiSU and multiple patches.
• Purpose: On each push or release, automatically checkout sources, apply patches, configure, compile with custom Clang/GCC, package into AnyKernel3 ZIP and boot image, and upload artifacts to GitHub Releases.
a. GitHub Repository
– Contains:
• .github/workflows/build-kernel.yml (workflow definition)
• config.env (user‐configurable environment settings)
• patches/ (collection of patch files)
• guide/ (documentation and images; optional)
b. GitHub Actions Runner (Hosted VM)
– Stages:
1. Trigger (on push/tag)
2. Checkout kernel source & submodules
3. Load config.env
4. Fetch external toolchains & scripts:
• Custom Clang repo (proton-clang)
• AnyKernel3 repository or zip
• KernelSU source/tag
5. Apply patches (from patches/)
6. Kernel configuration (defconfig + overlayfs, SU options)
7. Compile (clang/gcc toolchain)
8. Package outputs:
• Image.gz-dtb
• AnyKernel3-<build>.zip
9. Upload artifacts & draft GitHub Release
c. External Services
– GitHub Releases API (artifact hosting)
– Telegram community link (support channel)
– External repos:
• Kernel source (configured via KERNEL_SOURCE)
• KernelSU/SukiSU upstream
• AnyKernel3 upstream
Architectural Patterns & Principles
• CI/CD Pipeline: well-defined sequential steps
• Declarative configuration: config.env drives behavior; patches folder is an extension point
• Separation of concerns: build definitions (YAML), code (kernel source), config (env), patches
Technologies/Frameworks
• GitHub Actions (workflow engine)
• Bash/shell scripts inside build-kernel.yml
• Clang/GCC cross-compiler toolchains
• Git (source management)
• AnyKernel3 (packager for recovery flashable ZIP)
Essential Elements
• Labels: e.g., “.github/workflows/build-kernel.yml,” “config.env,” “patches/”
• Annotations for conditional or configurable steps (e.g., “if ENABLE_KERNELSU=true”)