Skip to content
env. edited this page Jun 25, 2025 · 1 revision

Kernel MSM-5.15 Wiki

Table of Contents

  1. Overview
  2. Supported Devices
  3. Features
  4. Getting Started
  5. GitHub Actions Build System
  6. Build Configuration Options
  7. KernelSU Integration
  8. Toolchain Options
  9. Telegram Bot Integration
  10. Manual Building
  11. Troubleshooting
  12. Contributing
  13. License Information

Overview

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.

Key Highlights

  • 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

Supported Devices

Device Codename Model
Redmi Note 12 4G NFC topaz M2101K7AG
Redmi Note 12 4G NFC tapas M2101K7BG

Message Format

The bot sends formatted messages including:

  • Build completion status
  • Build date and time
  • KernelSU variant information
  • Download link for the kernel

Manual Building

Prerequisites

# 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

Build Steps

  1. Clone Repository

    git clone https://github.com/topnotchfreaks/kernel_msm-5.15.git
    cd kernel_msm-5.15
    
  2. Setup Toolchain

    # Download and extract your preferred Clang
    wget <clang_url>
    tar -xf clang.tar.gz
    export PATH="$(pwd)/clang/bin:$PATH"
    
  3. Configure Build

    export ARCH=arm64
    export CROSS_COMPILE=aarch64-linux-gnu-
    export CLANG_TRIPLE=aarch64-linux-gnu-
    make O=out gki_defconfig
    
  4. Build Kernel

    make O=out ARCH=arm64 LLVM=1 LTO=thin -j$(nproc)
    
  5. 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/*
    

Troubleshooting

Common Issues

Build Failures

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

GitHub Actions Issues

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

KernelSU Issues

Problem: KernelSU not working

Solution:
1. Verify defconfig includes KSU options
2. Check patch application
3. Ensure proper KPM patching
4. Verify SUSFS configuration

Debug Tips

  1. Enable verbose logging

    export V=1
    make O=out ARCH=arm64 LLVM=1 V=1 -j$(nproc)
    
  2. Check configuration

    make O=out ARCH=arm64 menuconfig
    
  3. Verify toolchain

    clang --version
    aarch64-linux-gnu-gcc --version
    

Contributing

Development Workflow

  1. Fork the repository
  2. Create feature branch
    git checkout -b feature/new-feature
    
  3. Make changes and test
  4. Submit pull request

Contribution Guidelines

  • Follow existing code style
  • Test changes thoroughly
  • Update documentation as needed
  • Include clear commit messages
  • Ensure GitHub Actions pass

Areas for Contribution

  • Device-specific optimizations
  • Security patches
  • Performance improvements
  • Documentation updates
  • Bug fixes
  • New feature implementations

License Information

Dual Licensing Structure

This repository uses a dual-licensing approach:

Kernel Source Code

  • License: GNU General Public License v2.0 (GPLv2)
  • File: LICENSE
  • Scope: All kernel source code and modifications

Build Scripts and Automation

  • License: GNU General Public License v3.0 (GPLv3)
  • File: builder/LICENSE
  • Scope: GitHub Actions workflows, build scripts, automation tools

Compliance Notes

  • 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

Acknowledgments

Core Contributors

  • @PhamtomK12 - Original Kernel Builder Owner
  • @ssocozy - Development contributor
  • @NVG-064 - Development contributor
  • @ShirkNeko - SukiSU integration
  • @thewildjames - Development contributor

Special Thanks

  • Qualcomm for MSM platform support
  • LineageOS community for patches
  • KernelSU developers
  • Android kernel community

Support and Resources

Getting Help

  • Issues: Use GitHub Issues for bug reports
  • Discussions: Use GitHub Discussions for questions
  • Documentation: Refer to this wiki for guidance

External Resources

Disclaimer

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

Table of Contents

  1. [Overview](#overview)
  2. [Supported Devices](#supported-devices)
  3. [Features](#features)
  4. [Getting Started](#getting-started)
  5. [GitHub Actions Build System](#github-actions-build-system)
  6. [Build Configuration Options](#build-configuration-options)
  7. [KernelSU Integration](#kernelsu-integration)
  8. [Toolchain Options](#toolchain-options)
  9. [Telegram Bot Integration](#telegram-bot-integration)
  10. [Manual Building](#manual-building)
  11. [Troubleshooting](#troubleshooting)
  12. [Contributing](#contributing)
  13. [License Information](#license-information)

Overview

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.

Key Highlights

  • 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

Supported Devices

Device Codename Model
Redmi Note 12 4G NFC topaz M2101K7AG
Redmi Note 12 4G NFC tapas M2101K7BG

Architecture

  • Platform: Qualcomm MSM
  • Architecture: ARM64 (aarch64)
  • Kernel Version: Linux 5.15.x

Features

Core Features

  • 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

Advanced Features

  • 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

Getting Started

Prerequisites

  • GitHub account
  • Basic understanding of Android kernels
  • (Optional) Telegram account for automated delivery

Quick Start Guide

  1. Fork the Repository

    Click "Fork" button on the main repository page
    
  2. Enable GitHub Actions

    • Go to your fork's "Actions" tab
    • Click "I understand my workflows, go ahead and enable them"
  3. Configure Secrets (Optional)

    • Go to Settings → Secrets and variables → Actions
    • Add required secrets for Telegram integration
  4. Trigger Your First Build

    • Navigate to Actions tab
    • Select "Build kernels" workflow
    • Click "Run workflow"
    • Configure your build parameters

GitHub Actions Build System

Workflow Overview

The build system consists of two main jobs:

  1. Set-repos: Repository parsing and setup
  2. Build-Kernel: Main kernel compilation process

Build Process Steps

  1. Workspace Setup

    • Environment preparation
    • Package installation
    • Swap configuration (20GB)
  2. Source Code Management

    • Kernel source cloning
    • Branch selection
    • Private repository support
  3. Toolchain Setup

    • Dynamic toolchain fetching
    • Compiler verification
    • Path configuration
  4. Kernel Configuration

    • Defconfig generation
    • Custom configuration application
    • KernelSU integration
  5. Compilation

    • Multi-threaded building
    • LTO optimization
    • LLVM toolchain usage
  6. Post-Processing

    • KPM patching (if applicable)
    • AnyKernel3 packaging
    • Artifact generation

Build Configuration Options

Required Parameters

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

Optional Parameters

Parameter Description Default Options
kernelPrivateSource Private repo access false true/false
kernelBranch Source branch codelinaro Any branch
localVersion Custom version suffix "" -mybuild

Advanced Options

Parameter Description Default Options
kernelSUChoice KernelSU variant SukiSU-Ultra-SuSFS-stable None, SukiSU variants
clangCompiler Compiler selection Greenforce Clang ZyC, Greenforce, TopNotchFreaks

KernelSU Integration

Available Variants

1. SukiSU-Ultra-SuSFS-stable

  • Description: Stable SUSFS implementation
  • Features: Enhanced hiding, stable operation
  • Recommended for: Daily use, production

2. SukiSU-Ultra-SuSFS-dev

  • Description: Development SUSFS version
  • Features: Latest features, experimental
  • Recommended for: Testing, development

3. None

  • Description: Standard kernel without KernelSU
  • Features: Clean kernel build
  • Recommended for: Non-root usage

SUSFS Features

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

Toolchain Options

Available Compilers

1. ZyC Clang

  • Repository: ZyCromerZ/Clang
  • Features: Performance optimized
  • Target: Latest release

2. Greenforce Clang

  • Repository: greenforce-project/greenforce_clang
  • Features: Stability focused
  • Target: Latest release

3. TopNotchFreaks Clang

  • Repository: topnotchfreaks/clang
  • Features: Custom optimizations
  • Target: Latest release

Compiler Configuration

The build system automatically:

  • Fetches the latest compiler release
  • Extracts and configures paths
  • Sets up LLVM environment variables
  • Verifies compiler functionality

Telegram Bot Integration

Setup Process

1. Create Telegram Bot

1. Message @BotFather on Telegram
2. Send "/newbot" command
3. Follow prompts to create bot
4. Save the provided bot token

2. Get Chat ID

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

3. Configure GitHub Secrets

Navigate to your repository: SettingsSecrets and variablesActions

Add the following secrets:

Secret Name Description Example
TELEGRAM_BOT_TOKEN Bot API token 1234567890:ABCdefGHI...
TELEGRAM_USER_ID Your chat ID 123456789

Message Format

The bot sends formatted messages including:

  • Build completion status
  • Build date and time
  • KernelSU variant information
  • Download link for the kernel

Manual Building

Prerequisites

# 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

Build Steps

  1. Clone Repository

    git clone https://github.com/topnotchfreaks/kernel_msm-5.15.git
    cd kernel_msm-5.15
  2. Setup Toolchain

    # Download and extract your preferred Clang
    wget <clang_url>
    tar -xf clang.tar.gz
    export PATH="$(pwd)/clang/bin:$PATH"
  3. Configure Build

    export ARCH=arm64
    export CROSS_COMPILE=aarch64-linux-gnu-
    export CLANG_TRIPLE=aarch64-linux-gnu-
    make O=out gki_defconfig
  4. Build Kernel

    make O=out ARCH=arm64 LLVM=1 LTO=thin -j$(nproc)
  5. 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/*

Troubleshooting

Common Issues

Build Failures

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

GitHub Actions Issues

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

KernelSU Issues

Problem: KernelSU not working

Solution:
1. Verify defconfig includes KSU options
2. Check patch application
3. Ensure proper KPM patching
4. Verify SUSFS configuration

Debug Tips

  1. Enable verbose logging

    export V=1
    make O=out ARCH=arm64 LLVM=1 V=1 -j$(nproc)
  2. Check configuration

    make O=out ARCH=arm64 menuconfig
  3. Verify toolchain

    clang --version
    aarch64-linux-gnu-gcc --version

Contributing

Development Workflow

  1. Fork the repository
  2. Create feature branch
    git checkout -b feature/new-feature
  3. Make changes and test
  4. Submit pull request

Contribution Guidelines

  • Follow existing code style
  • Test changes thoroughly
  • Update documentation as needed
  • Include clear commit messages
  • Ensure GitHub Actions pass

Areas for Contribution

  • Device-specific optimizations
  • Security patches
  • Performance improvements
  • Documentation updates
  • Bug fixes
  • New feature implementations

License Information

Dual Licensing Structure

This repository uses a dual-licensing approach:

Kernel Source Code

  • License: GNU General Public License v2.0 (GPLv2)
  • File: LICENSE
  • Scope: All kernel source code and modifications

Build Scripts and Automation

  • License: GNU General Public License v3.0 (GPLv3)
  • File: builder/LICENSE
  • Scope: GitHub Actions workflows, build scripts, automation tools

Compliance Notes

  • 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

Acknowledgments

Core Contributors

  • @PhamtomK12 - Original Kernel Builder Owner
  • @ssocozy - Development contributor
  • @NVG-064 - Development contributor
  • @ShirkNeko - SukiSU integration
  • @thewildjames - Development contributor

Special Thanks

  • Qualcomm for MSM platform support
  • LineageOS community for patches
  • KernelSU developers
  • Android kernel community

Support and Resources

Getting Help

  • Issues: Use GitHub Issues for bug reports
  • Discussions: Use GitHub Discussions for questions
  • Documentation: Refer to this wiki for guidance

External Resources

Disclaimer

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

Clone this wiki locally