đŸ”§

Building Kernel in Android using Termux

Jul 12, 2024

Lecture on Building Kernel in Android using Termux

Introduction

  • Discussion on building Kernel for Android using Termux.
  • Prerequisite: Installation of Payrot and OS Ubuntu.
  • Mention of using Kali NetHunter for those who have it installed.

Setting Up Termux

  1. Open Termux: Install required tools (Payrot).
  2. Download OS Ubuntu: Required for setting up the environment.
  3. Alternative: Use Kali NetHunter if already installed—No need for Ubuntu.

Extracting and Setting Up Ubuntu

  • Process: Extract the downloaded OS into the Termux directory.
  • Note: No need for --subsystem parameter with NetHunter.
  • Command: Basic commands for extraction are the same for Ubuntu and NetHunter.

Running Ubuntu

  1. Navigate to the Folder: Move into the Ubuntu directory.
  2. Enter Command: Execute ./start-ubuntu.sh to enter the Ubuntu OS.

Downloading Kernel Source

  • Device Example: Nexus 6 is used as an example.
  • Recommendation: Download zipped kernel source to save data.
  • Transfer: Move the source to the OS.

Extracting Kernel Source

  • Command: Use Termux to extract the kernel source.
  • Note: Use termux for extraction to root directly.

Compiling Kernel

  • Navigate to Source Folder: Move into the kernel source folder.
  • Export and Set Up Environment:
    • Follow the instructional video or provided materials.
    • Identify the codename of the device (e.g., Nexus 6P codename: Angler).
    • Use command to set up: `export ARCH=arm64; export SUBARCH=arm64; export CROSS_COMPILE=aarch64-linux-gnu-
  • Create Output Directory: mkdir -p out
  • Configuration:
    • Use make angler_defconfig to configure.
    • If display issue occurs, use pinch-to-zoom on screen.
    • Follow the link provided in the tutorial for standard configurations.`

Building Kernel

  • Compile Command: make -j4
  • Others: Contact via Telegram or comments for support.

Conclusion

  • Reminder: Processes can be lengthy depending on device specs.
  • Summary: Recap important commands and steps.
  • End Note: Encourage like, subscribe, and share on the platform.