Skip to content
Panchajanya Sarkar edited this page Jan 1, 2022 · 5 revisions

Welcome to the Azure Kernel wiki!

The Linux Kernel is the foundation of the Unix-like operating systems. The kernel is responsible for communication between hardware and software and the allocation of available resources. Each and every OS comes with a predefined kernel. The basic need to install a custom kernel is to enjoy a better, optimized overall user experience.

We are going to cover up the following things -

     - Installation
     - Building from source
     - Contributing

Installation ( Only for R - S AOSP )


This section describes how to flash the kernel zip.

  1. Download the latest Kernel zip
  2. Place the zip in your storage which is easily accessible.
  3. Reboot to Recovery. TWRP/OFOX/SHRP is preferred
  4. Flash the zip.
  5. wipe caches (optional)
  6. Reboot

You are good to go. Full Charge once right after flashing. Enjoy my works. ;)


Building from Source


This section describes how to build the kernel.

Many guys have shown interest in building kernel, especially if you have a keen interest in taking the blue pill and diving deeper, how things works and how much pain we go through while working on an OSS project.

Pre-requisites

  1. Proper and fast internet connection
  2. A PC/Cloud Computer running Linux OS (Ubuntu/ArchLinux/*) ( IDC/IDK anything about WSL2 )
  3. A better processor ( better the processor, lower the compile times )
  4. Around 15 GB free space
  5. Brains and patience. Always remember, Google is your best friend. You should have some experience with Linux environment and you are aware of how to run a command and can differentiate commands.

Preparing the Build Environment

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

Ubuntu/Linux Mint

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

ArchLinux

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

Fedora

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

You have successfully finished setting up your build environment.

Obtaining sources

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 --depth 1 https://github.com/Panchajanya1999/msm-4.14.git

After cloning successfully, you will have the sources in msm-4.14 folder. The inside of the folder looks like this -

Imgur

Building

The building part is the easiest part here, since you are going to use my script to accomplish the task smoothly.

  1. Change directory to msm-4.14 folder. This is what you call root folder.

  2. Grab my latest kernel building script from GitHub curl https://raw.githubusercontent.com/Panchajanya1999/myscripts/master/kernel.sh > kernel.sh

  3. Edit few parameters in the build script. Open the script kernel.sh using a text editor of your choice and

    3.a. > Check Line 55 and put your name there. Looks cool and you can flex easily ;)

    3.b. > Check Line 85 and change PTTG=1 to PTTG=0. This will not push zip anywhere unless you have a different setup.

    3.c. > Check Line 110 and set SIGN=1 to SIGN=0.

  4. Run the script. bash kernel.sh will start building the kernel. Sit back and enjoy because this will download toolchains, flasher and few scripts. Everything in this point depends on your internet speed.

  5. If the build is successful, obtain the kernel zip from AnyKernel3 folder inside root directory. At this point, I guess you know how the kernel zip looks like.

  6. Flash the zip and enjoy your newly built kernel.


Contributing


Will be written later.