Skip to content
androidk26 edited this page Apr 19, 2026 · 5 revisions

Detailed guide for building and installation of custom kernel for Redmi Note 10 (sunny/mojito)

🛠️ Buiding the kernel

Pre-requisites

  • A proper and fast internet connection
  • A PC/Cloud Computer running Linux OS (Ubuntu/ArchLinux/*) (for WSL2 please refer to wiki/guide on setting up kernel building environment).
  • A better processor (better the processor, lower the compile times).
  • Around 15 GB free space
  • Brain and patience. Keep in mind, Google is your friend, but AI is your professor, and community is your guide. You should have some experience with Linux environment and aware of how to run commands. There's no harm in trying.

Preparing the Build Environment

If you have not built a kernel on your system before, there are some packages needed for building kernel environment. You can get these installed with:

for Ubuntu/Linux Mint

curl https://raw.githubusercontent.com/akhilnarang/scripts/master/setup/android_build_env.sh | bash

for ArchLinux

curl https://raw.githubusercontent.com/akhilnarang/scripts/master/setup/arch-manjaro.sh | bash

for Fedora

curl https://raw.githubusercontent.com/akhilnarang/scripts/master/setup/fedora.sh | bash

Obtaining kernel source tree

This subsections aims at downloading and building the kernel from source. Not applicable if you are trying to develop/work on the source since you have no authority to push changes. You will have no commit history hereby and it is not advisable to work on a source with no commit history.

Run the following command to clone the source locally.

git clone -b kernelsu-next-susfs --depth 1 --recurse-submodules --shallow-submodules https://github.com/androidk26/Redmi-Note-10-Kernel.git sunny-mod

Workflow and modifications (optional)

Note

You may skip this part if you don't have any modification or changes to do.

  • Your work and modifications happens here.
  • You are free to modify and or apply changes to this kernel tree as long as you are recognizing and giving credits to the maintainer.

Building the kernel

This is the easiest part, since you are going to use cyberknight777's script to accomplish the task smoothly.

Change directory to sunny-mod folder. This is the root folder of kernel tree.

Note

You need to change the command below to point the root depending on which directory or folder you have clone the kernel tree.

cd path/to/cloned/kernel/tree/sunny-mod

Execute the command:

sed -i 's/TGI=1/TGI=0/' kramel.sh

Execute the build script:

CI=0 OTA=0 RELEASE=0 bash kramel.sh img mod mkzip

and it will start building the kernel. Sit back and relax because this will download toolchains, flasher, and some scripts. Everything at this point depends on your internet speed and processors.

If the build is successful, obtain the flashable kernel zip from anykernel3-sunny folder inside root directory.

NetErnels-sunny-*.zip

🚀 Installation

There are two methods to install this modified kernel build:

  • Method A: By patching boot.img and flash it through fastboot.
  • Method B (rooted): By directly flashing anykernel3 zip file through kernel flasher.

Pre-requisites

  • A compatible Redmi Note 10 (sunny/mojito) Unlocked bootloader
  • A Linux environment (for Method A: patching boot.img)

Method A: Patching boot.img

Requirements:

  • Linux environment

you can use one of these: Linux Distro (PC), WSL2 (PC), or Termux (Android)

  • Update your linux environment packages for better performance and latest features:

for Linux distro and WSL2

sudo apt update && upgrade -y

for Termux (android)

pkg update && upgrade -y

In this guide, we are using Magiskboot from Magisk-v*.apk. Download here

Magiskboot setup

  1. Change the file extension .apk of Magisk-v*.apk file to .zip and extract libmagiskboot.so

Note

Note that you should use a compatible libmagiskboot.so inside magisk depending on your system ARM:

for Linux distro and WSL2

/lib/x86_64/libmagiskboot.so`

for Termux (android)

(Sunny) newer device: /lib/arm64-v8a/libmagiskboot.so
legacy / old device: /lib/armeabu-v7a/libmagiskboot.so
  1. Rename and remove file extension of libmagiskboot.so to magiskboot
  2. Make it executable:
chmod +x ~/magiskboot

Replacing the kernel

  1. Extract NetErnels-sunny-*.zip from your kernel building output directory: sunny-mod/anykernel3-sunny/NetErnels-sunny-*.zip or from your downloads if you have downloaded a release from this repository.

  2. Change directory where your magiskboot is located.

cd path/to/your/magiskboot
  1. Unpack your target boot.img
./magiskboot unpack path/to/your/boot.img

You will now see some files unpacked from boot.img

boot.img
kernel
ramdisk.cpio
...
...
  1. Replace the file named kernel with file named Image from your extracted NetErnels-sunny-*.zip

  2. Rename the newly placed file Image to kernel

  3. Repack the boot.img

./magiskboot repack boot.img

You will now see newly modified boot named: new-boot.img

boot.img
kernel
ramdisk.cpio
new-boot.img
...
  1. Flash the newly modified boot.img to device bootloader

Note

If you were ever renamed the new-boot.img, flash it according to its new name.

fastboot flash boot boot.img

Method B: Direct flash through kernel flasher

Important

Your device should be already rooted for this procedure to work.

  • Copy your newly build kernel or the downloaded flashable kernel zip from this repository to your device.

  • Download the latest Kernel Flasher

  • Check your active boot partition slot Slot Suffix using Kernel Flasher

  • Tap View on your active slot

  • Tap Flash, then tap Flash AK3 Zip

  • Locate and select your copied NetErnels-sunny-*.zip

  • Reboot