notudope / kernel_joyeuse

Kernel for Redmi Note 9 Pro (joyeuse)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to compile kernel for Redmi Note 9 Pro (joyeuse)

Intro

This source code already contains WiFi and Audio drivers that were not included in the original Xiaomi code. Also, added AOSP Device Tree Compiler (DTC) to compile DTB and DTBO trees.

Features

Differences from stock are minimal:

  • Removed incompatible architectures
  • TTL target support
  • Some TCP congestion-avoidance algorithms
  • CPU frequency statistics for the schedutil governor
  • Various minor changes

1. Downloading

Create a working folder, for example kernel:

mkdir kernel
cd kernel

Download kernel source:

git clone --depth=1 https://github.com/tifictive/kernel_joyeuse.git kernel_joyeuse

Download a compatible GCC toolchain. I used AOSP GCC 4.9 for arm64.

git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9 aarch64-linux-android

Download Clang toolchain. I used Proton Clang, you can use another suitable one, for example AOSP Clang.

git clone https://github.com/kdrag0n/proton-clang.git proton-clang

2. Building the kernel

Move to the kernel folder:

cd kernel_joyeuse

Setup default config:

./build.sh custj_defconfig

Note: build.sh - a simple script that sets up environment variables and starts the compilation process.

Optional. You can tweak some kernel parameters:

./build.sh menuconfig

Compiling:

./build.sh

3. Flashing

If the compilation passed without errors, then in the arch/arm64/boot folder you will see the following files:

  • Image.gz - kernel image
  • dtbo.img - board-specific device tree overlay
  • dtb - SoC device tree blob

Preparation

These files must be flashed into the boot section of the phone. To do this, we will use the AnyKernel3 utility.

Download AnyKernel3.zip, unpack and change the following lines in anykernel.sh file as shown below:

kernel.string=Kernel for Joyeuse
do.devicecheck=1
do.modules=0
do.systemless=1
do.cleanup=1
do.cleanuponabort=0
device.name1=joyeuse

# remove others lines like "device.name*"!

block=/dev/block/bootdevice/by-name/boot;

Also remove the lines from # begin ramdisk changes to # end ramdisk changes.

Place the files Image.gz, dtbo.img and dtb where the script is located and repack all the contents of the folder into a zip archive.

Flashing

Reboot into recovery mode, backup the boot and dtbo partitions. Then install our zip archive. Reboot into the system.

About

Kernel for Redmi Note 9 Pro (joyeuse)

License:Other


Languages

Language:C 95.2%Language:Assembly 2.4%Language:C++ 1.3%Language:Objective-C 0.6%Language:Makefile 0.2%Language:Perl 0.1%Language:Shell 0.1%Language:Python 0.1%Language:Yacc 0.0%Language:SmPL 0.0%Language:Roff 0.0%Language:Lex 0.0%Language:Awk 0.0%Language:GDB 0.0%Language:UnrealScript 0.0%Language:Gherkin 0.0%Language:M4 0.0%Language:Clojure 0.0%Language:XS 0.0%Language:Raku 0.0%Language:sed 0.0%Language:Batchfile 0.0%