-
Notifications
You must be signed in to change notification settings - Fork 33
Home
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
This section describes how to flash the kernel zip.
- Download the latest Kernel zip
- Place the zip in your storage which is easily accessible.
- Reboot to Recovery. TWRP/OFOX/SHRP is preferred
- Flash the zip.
- wipe caches (optional)
- Reboot
You are good to go. Full Charge once right after flashing. Enjoy my works. ;)
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.
- Proper and fast internet connection
- A PC/Cloud Computer running Linux OS (Ubuntu/ArchLinux/*) ( IDC/IDK anything about WSL2 )
- A better processor ( better the processor, lower the compile times )
- Around 15 GB free space
- 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.
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.
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 -
The building part is the easiest part here, since you are going to use my script to accomplish the task smoothly.
-
Change directory to
msm-4.14
folder. This is what you callroot
folder. -
Grab my latest kernel building script from GitHub
curl https://raw.githubusercontent.com/Panchajanya1999/myscripts/master/kernel.sh > kernel.sh
-
Edit few parameters in the build script. Open the script
kernel.sh
using a text editor of your choice and3.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
toPTTG=0
. This will not push zip anywhere unless you have a different setup.3.c. > Check Line 110 and set
SIGN=1
toSIGN=0
. -
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. -
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. -
Flash the zip and enjoy your newly built kernel.
Will be written later.