-
Notifications
You must be signed in to change notification settings - Fork 15
Home
- Overview
- Supported Devices
- Features
- Getting Started
- GitHub Actions Build System
- Build Configuration Options
- KernelSU Integration
- Toolchain Options
- Telegram Bot Integration
- Manual Building
- Troubleshooting
- Contributing
- License Information
The kernel_msm-5.15 repository is a comprehensive kernel source and build system specifically designed for Redmi Note 12 4G NFC devices. Built on the Linux kernel 5.15 (msm-5.15 branch), this project provides automated building capabilities through GitHub Actions, extensive KernelSU support, and advanced customization options.
- Automated Cloud Building: No local setup required
- Multiple KernelSU Variants: Including SukiSU-Ultra with SUSFS support
- Flexible Toolchain Options: Support for multiple Clang compilers
- Telegram Integration: Automatic delivery of built kernels
- Advanced Security Features: SUSFS implementation for enhanced stealth
Device | Codename | Model |
---|---|---|
Redmi Note 12 4G NFC | topaz | M2101K7AG |
Redmi Note 12 4G NFC | tapas | M2101K7BG |
The bot sends formatted messages including:
- Build completion status
- Build date and time
- KernelSU variant information
- Download link for the kernel
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install -y build-essential bc curl flex cpio rsync git zip \
dwarves libelf-dev gcc-aarch64-linux-gnu libssl-dev \
python3 clang lld llvm llvm-dev
Arch Linux
sudo pacman -S base-devel bc curl flex cpio rsync git zip
libelf gcc python clang lld llvm
-
Clone Repository
git clone https://github.com/topnotchfreaks/kernel_msm-5.15.git cd kernel_msm-5.15
-
Setup Toolchain
# Download and extract your preferred Clang wget <clang_url> tar -xf clang.tar.gz export PATH="$(pwd)/clang/bin:$PATH"
-
Configure Build
export ARCH=arm64 export CROSS_COMPILE=aarch64-linux-gnu- export CLANG_TRIPLE=aarch64-linux-gnu- make O=out gki_defconfig
-
Build Kernel
make O=out ARCH=arm64 LLVM=1 LTO=thin -j$(nproc)
-
Package with AnyKernel3
git clone https://github.com/topnotchfreaks/AnyKernel3.git cp out/arch/arm64/boot/Image AnyKernel3/ cd AnyKernel3 zip -r9 ../kernel.zip * -x .git/*
Problem: Compilation errors
Solution:
1. Check toolchain installation
2. Verify source code integrity
3. Review build logs for specific errors
4. Try different compiler options
Problem: Out of memory errors
Solution:
1. Increase swap space (GitHub Actions uses 20GB)
2. Reduce parallel jobs (-j parameter)
3. Use LTO=thin instead of LTO=full
Problem: Workflow not triggering
Solution:
1. Ensure Actions are enabled in your fork
2. Check workflow syntax
3. Verify permissions
Problem: Private repository access
Solution:
1. Set kernelPrivateSource to true
2. Add PRIVATE_REPO_TOKEN secret
3. Verify token permissions
Problem: KernelSU not working
Solution:
1. Verify defconfig includes KSU options
2. Check patch application
3. Ensure proper KPM patching
4. Verify SUSFS configuration
-
Enable verbose logging
export V=1 make O=out ARCH=arm64 LLVM=1 V=1 -j$(nproc)
-
Check configuration
make O=out ARCH=arm64 menuconfig
-
Verify toolchain
clang --version aarch64-linux-gnu-gcc --version
- Fork the repository
-
Create feature branch
git checkout -b feature/new-feature
- Make changes and test
- Submit pull request
- Follow existing code style
- Test changes thoroughly
- Update documentation as needed
- Include clear commit messages
- Ensure GitHub Actions pass
- Device-specific optimizations
- Security patches
- Performance improvements
- Documentation updates
- Bug fixes
- New feature implementations
This repository uses a dual-licensing approach:
- License: GNU General Public License v2.0 (GPLv2)
-
File:
LICENSE
- Scope: All kernel source code and modifications
- License: GNU General Public License v3.0 (GPLv3)
-
File:
builder/LICENSE
- Scope: GitHub Actions workflows, build scripts, automation tools
- Any modifications to kernel source must be released under GPLv2
- Build script modifications must be released under GPLv3
- Attribution to original authors must be maintained
- Source code availability requirements apply
- @PhamtomK12 - Original Kernel Builder Owner
- @ssocozy - Development contributor
- @NVG-064 - Development contributor
- @ShirkNeko - SukiSU integration
- @thewildjames - Development contributor
- Qualcomm for MSM platform support
- LineageOS community for patches
- KernelSU developers
- Android kernel community
- Issues: Use GitHub Issues for bug reports
- Discussions: Use GitHub Discussions for questions
- Documentation: Refer to this wiki for guidance
This project is intended for advanced users and developers. Flashing custom kernels may void device warranties or cause unintended behavior. Always backup your data and proceed with caution.
Last Updated: June 2025
# Kernel MSM-5.15 Wiki- [Overview](#overview)
- [Supported Devices](#supported-devices)
- [Features](#features)
- [Getting Started](#getting-started)
- [GitHub Actions Build System](#github-actions-build-system)
- [Build Configuration Options](#build-configuration-options)
- [KernelSU Integration](#kernelsu-integration)
- [Toolchain Options](#toolchain-options)
- [Telegram Bot Integration](#telegram-bot-integration)
- [Manual Building](#manual-building)
- [Troubleshooting](#troubleshooting)
- [Contributing](#contributing)
- [License Information](#license-information)
The kernel_msm-5.15 repository is a comprehensive kernel source and build system specifically designed for Redmi Note 12 4G NFC devices. Built on the Linux kernel 5.15 (msm-5.15 branch), this project provides automated building capabilities through GitHub Actions, extensive KernelSU support, and advanced customization options.
- Automated Cloud Building: No local setup required
- Multiple KernelSU Variants: Including SukiSU-Ultra with SUSFS support
- Flexible Toolchain Options: Support for multiple Clang compilers
- Telegram Integration: Automatic delivery of built kernels
- Advanced Security Features: SUSFS implementation for enhanced stealth
Device | Codename | Model |
---|---|---|
Redmi Note 12 4G NFC | topaz | M2101K7AG |
Redmi Note 12 4G NFC | tapas | M2101K7BG |
- Platform: Qualcomm MSM
- Architecture: ARM64 (aarch64)
- Kernel Version: Linux 5.15.x
- Linux Kernel 5.15: Latest stable kernel base
- GKI Compliance: Generic Kernel Image support
- Device-Specific Optimizations: Tailored for topaz/tapas hardware
- Security Patches: Regular security updates and fixes
- Performance Optimizations: Enhanced performance tuning
- KernelSU Support: Multiple variants available
- SUSFS Integration: Advanced hiding capabilities
- Custom Patches: LineageOS disguise and other enhancements
- Flexible Building: Multiple compiler options
- Automated Testing: CI/CD integration
- GitHub account
- Basic understanding of Android kernels
- (Optional) Telegram account for automated delivery
-
Fork the Repository
Click "Fork" button on the main repository page
-
Enable GitHub Actions
- Go to your fork's "Actions" tab
- Click "I understand my workflows, go ahead and enable them"
-
Configure Secrets (Optional)
- Go to Settings → Secrets and variables → Actions
- Add required secrets for Telegram integration
-
Trigger Your First Build
- Navigate to Actions tab
- Select "Build kernels" workflow
- Click "Run workflow"
- Configure your build parameters
The build system consists of two main jobs:
- Set-repos: Repository parsing and setup
- Build-Kernel: Main kernel compilation process
-
Workspace Setup
- Environment preparation
- Package installation
- Swap configuration (20GB)
-
Source Code Management
- Kernel source cloning
- Branch selection
- Private repository support
-
Toolchain Setup
- Dynamic toolchain fetching
- Compiler verification
- Path configuration
-
Kernel Configuration
- Defconfig generation
- Custom configuration application
- KernelSU integration
-
Compilation
- Multi-threaded building
- LTO optimization
- LLVM toolchain usage
-
Post-Processing
- KPM patching (if applicable)
- AnyKernel3 packaging
- Artifact generation
Parameter | Description | Default | Example |
---|---|---|---|
kernelSourceURL |
Source repository URL | topnotchfreaks/kernel_msm-5.15 | Custom repo URL |
kernelDevice |
Target device | gki | topaz, tapas |
kernelSourceName |
Source name identifier | kernel_msm-5.15 | Custom name |
Parameter | Description | Default | Options |
---|---|---|---|
kernelPrivateSource |
Private repo access | false | true/false |
kernelBranch |
Source branch | codelinaro | Any branch |
localVersion |
Custom version suffix | "" | -mybuild |
Parameter | Description | Default | Options |
---|---|---|---|
kernelSUChoice |
KernelSU variant | SukiSU-Ultra-SuSFS-stable | None, SukiSU variants |
clangCompiler |
Compiler selection | Greenforce Clang | ZyC, Greenforce, TopNotchFreaks |
- Description: Stable SUSFS implementation
- Features: Enhanced hiding, stable operation
- Recommended for: Daily use, production
- Description: Development SUSFS version
- Features: Latest features, experimental
- Recommended for: Testing, development
- Description: Standard kernel without KernelSU
- Features: Clean kernel build
- Recommended for: Non-root usage
When KernelSU is enabled, the following SUSFS features are automatically configured:
-
Magic Mount Hiding:
CONFIG_KSU_SUSFS_HAS_MAGIC_MOUNT=y
-
Path Suspicion:
CONFIG_KSU_SUSFS_SUS_PATH=y
-
Mount Suspicion:
CONFIG_KSU_SUSFS_SUS_MOUNT=y
-
Kstat Suspicion:
CONFIG_KSU_SUSFS_SUS_KSTAT=y
-
Umount Attempts:
CONFIG_KSU_SUSFS_TRY_UMOUNT=y
-
Uname Spoofing:
CONFIG_KSU_SUSFS_SPOOF_UNAME=y
-
Cmdline Spoofing:
CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y
-
Open Redirection:
CONFIG_KSU_SUSFS_OPEN_REDIRECT=y
- Repository: ZyCromerZ/Clang
- Features: Performance optimized
- Target: Latest release
- Repository: greenforce-project/greenforce_clang
- Features: Stability focused
- Target: Latest release
- Repository: topnotchfreaks/clang
- Features: Custom optimizations
- Target: Latest release
The build system automatically:
- Fetches the latest compiler release
- Extracts and configures paths
- Sets up LLVM environment variables
- Verifies compiler functionality
1. Message @BotFather on Telegram
2. Send "/newbot" command
3. Follow prompts to create bot
4. Save the provided bot token
1. Start chat with your bot
2. Send any message
3. Visit: https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates
4. Find your chat ID in the response
Navigate to your repository: Settings → Secrets and variables → Actions
Add the following secrets:
Secret Name | Description | Example |
---|---|---|
TELEGRAM_BOT_TOKEN |
Bot API token | 1234567890:ABCdefGHI... |
TELEGRAM_USER_ID |
Your chat ID | 123456789 |
The bot sends formatted messages including:
- Build completion status
- Build date and time
- KernelSU variant information
- Download link for the kernel
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install -y build-essential bc curl flex cpio rsync git zip \
dwarves libelf-dev gcc-aarch64-linux-gnu libssl-dev \
python3 clang lld llvm llvm-dev
# Arch Linux
sudo pacman -S base-devel bc curl flex cpio rsync git zip \
libelf gcc python clang lld llvm
-
Clone Repository
git clone https://github.com/topnotchfreaks/kernel_msm-5.15.git cd kernel_msm-5.15
-
Setup Toolchain
# Download and extract your preferred Clang wget <clang_url> tar -xf clang.tar.gz export PATH="$(pwd)/clang/bin:$PATH"
-
Configure Build
export ARCH=arm64 export CROSS_COMPILE=aarch64-linux-gnu- export CLANG_TRIPLE=aarch64-linux-gnu- make O=out gki_defconfig
-
Build Kernel
make O=out ARCH=arm64 LLVM=1 LTO=thin -j$(nproc)
-
Package with AnyKernel3
git clone https://github.com/topnotchfreaks/AnyKernel3.git cp out/arch/arm64/boot/Image AnyKernel3/ cd AnyKernel3 zip -r9 ../kernel.zip * -x .git/*
Problem: Compilation errors
Solution:
1. Check toolchain installation
2. Verify source code integrity
3. Review build logs for specific errors
4. Try different compiler options
Problem: Out of memory errors
Solution:
1. Increase swap space (GitHub Actions uses 20GB)
2. Reduce parallel jobs (-j parameter)
3. Use LTO=thin instead of LTO=full
Problem: Workflow not triggering
Solution:
1. Ensure Actions are enabled in your fork
2. Check workflow syntax
3. Verify permissions
Problem: Private repository access
Solution:
1. Set kernelPrivateSource to true
2. Add PRIVATE_REPO_TOKEN secret
3. Verify token permissions
Problem: KernelSU not working
Solution:
1. Verify defconfig includes KSU options
2. Check patch application
3. Ensure proper KPM patching
4. Verify SUSFS configuration
-
Enable verbose logging
export V=1 make O=out ARCH=arm64 LLVM=1 V=1 -j$(nproc)
-
Check configuration
make O=out ARCH=arm64 menuconfig
-
Verify toolchain
clang --version aarch64-linux-gnu-gcc --version
- Fork the repository
-
Create feature branch
git checkout -b feature/new-feature
- Make changes and test
- Submit pull request
- Follow existing code style
- Test changes thoroughly
- Update documentation as needed
- Include clear commit messages
- Ensure GitHub Actions pass
- Device-specific optimizations
- Security patches
- Performance improvements
- Documentation updates
- Bug fixes
- New feature implementations
This repository uses a dual-licensing approach:
- License: GNU General Public License v2.0 (GPLv2)
-
File:
LICENSE
- Scope: All kernel source code and modifications
- License: GNU General Public License v3.0 (GPLv3)
-
File:
builder/LICENSE
- Scope: GitHub Actions workflows, build scripts, automation tools
- Any modifications to kernel source must be released under GPLv2
- Build script modifications must be released under GPLv3
- Attribution to original authors must be maintained
- Source code availability requirements apply
- @PhamtomK12 - Original Kernel Builder Owner
- @ssocozy - Development contributor
- @NVG-064 - Development contributor
- @ShirkNeko - SukiSU integration
- @thewildjames - Development contributor
- Qualcomm for MSM platform support
- LineageOS community for patches
- KernelSU developers
- Android kernel community
- Issues: Use GitHub Issues for bug reports
- Discussions: Use GitHub Discussions for questions
- Documentation: Refer to this wiki for guidance
- [Android Kernel Development](https://source.android.com/devices/architecture/kernel)
- [KernelSU Documentation](https://kernelsu.org/)
- [Clang Documentation](https://clang.llvm.org/docs/)
- [Git Documentation](https://git-scm.com/doc)
This project is intended for advanced users and developers. Flashing custom kernels may void device warranties or cause unintended behavior. Always backup your data and proceed with caution.
Last Updated: June 2025