How to Compile & Build Android Kernel 👨‍💻🛠️📲

Описание к видео How to Compile & Build Android Kernel 👨‍💻🛠️📲

Steps to Configure, Build & Flash your own Custom Android Kernel:

Requirements:
A PC/Laptop with Linux-based OS & Quad/Dual Core CPU (hyper-threaded processors preferable)
8 / 4 GB of RAM
Android Device with Unlocked Bootloader
Patience


STEPS TO SETUP THE ENVIRONMENT FOR BUILDING THE ANDROID KERNEL:

1. Open Terminal

2. Execute this command:
sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2

3. Download the Source Code of your device from GitHub:
LineageOS: https://github.com/LineageOS?utf8=✓&q...
Motorola: https://github.com/MotorolaMobilityLL...
Samsung: https://opensource.samsung.com/
OnePlus: https://github.com/OnePlusOSS?utf8=✓&...
Xiaomi: https://github.com/MiCode/Xiaomi_Kern...
LG: http://opensource.lge.com/osSch/list?...
HTC: https://www.htcdev.com
Sony: https://github.com/sonyxperiadev/kern...
Others: Google and XDA are your best Friends

4. Download the NDK for Toolchain
https://developer.android.com/ndk/dow...

5. Extract both the Source Code and NDK

6. Make a new folder and rename it to "kernel" for easy reference

7. Move both Extracted "Source Code" and "NDK Folders" to "kernel" folder

8. Rename The Source Code folder to the name of device and other folder to ndk

********************************************************************

STEPS TO CONFIGURE & BUILD THE KERNEL:

9. cd kernel

10. export CROSS_COMPILE=/home/yourusername/ndk/toolchain/arm-linux- androideabi-
4.9/prebuilt/linux-x86/bin/arm-linux-androideabi-
(Here replace the yourusername with the username of your terminal or just copy the path as shown in video)

11. cd motog
(cd to your Source Code Directory)

12. make clean && make mrproper
(Make sure you execute this command in Source Code folder)

13. export ARCH=arm
(The Architechture of my phone's CPU os ARM based & it's 32-bit CPU. If yours is a 64-bit processor then you need to type arm64)

14. Open your kernel source code folder go to "arch/arm/configs"

15. Find that "yourdevicecode_defconfig"
(Replace yourdevicecode_defconfig with the codename of your device. falcon in my case for Moto G)

16. make yourdevice_defconfig

17. make menuconfig
(Make whatever Changes you want and finally save it with somename.config)

18. make –j4
(4 is the number of cores of the CPU of my Laptop. You need to change it according to your Laptop/PC)

********************************************************************

STEPS FOR FLASHING THE KERNEL:

19. Copy the zImage file to platform tools folder (the one having adb and fastboot files)
If you don't have the platform tools, download it from here:
https://dl.google.com/android/reposit...

20. Check whether device is connected by running:
adb devices

21. If you get some permission error, just disconnect your device & go to Developer Options & Click Revoke USB Debugging authorisations & connect again
One message might pop up on your device. Just click Allow

22. Restart the device in Fastboot (Bootloader) mode and connect it to your Laptop/PC:
adb reboot-bootloader

23. Check whether the device is connected by executing:
fastboot devices

24. If you get the serial then it is connected

25. Boot the Kernel without flashing permanently:
fastboot boot zImage

Your device will automatically restart and you can verify whether the kernel is the one you built by looking at the kernel version in About Device where you'll see your Terminal's name

26. If you want to flash Kernel permanently then execute:
fastboot flash zimage zImage


********************************************************************
For more reference head over to these links:
https://forum.xda-developers.com/moto...
https://forum.xda-developers.com/show...
https://www.astronyu.com/how-to-flash...

********************************************************************
My other Videos:

If you don't have / don't know how to install Ubuntu:    • How to Live Boot Ubuntu from USB ? 💻 🐧  

After installing / Live booting Ubuntu try some cool tricks:    • 20 Fun Linux 🐧 Commands You should tr...  

Wanna spend your holidays? Try this beach:    • Chivla Beach - Kolamb to Malvan  


😄 Subscribe (IT'S FREE) 😄 : https://goo.gl/Rh8SQQ


BGM:

Music provided by NoCopyrightSounds & Alan Walker
Song: Elektronomia - Alan Walker - Force [NCS Release]
Video Link:    • Видео  
Song: Elektronomia - Cartoon - On & On (feat. Daniel Levi) [NCS Release]
Video Link:    • Cartoon, Jéja - On & On (feat. Daniel...  
Song: Alan Walker - The Spectre (no copyright - SONG ONLY)
Video Link:    • Видео  

Комментарии

Информация по комментариям в разработке