en Setting Up the Environment - JackA1ltman/NonGKI_Kernel_Build_2nd GitHub Wiki

Setting Up the Environment

Local Build · Step 1

This guide assumes a clean machine and uses Ubuntu 24.04 as the reference system.

Get a Linux Distribution

Download Ubuntu 24.04 from the official website:

https://ubuntu.com/download/desktop

For users in mainland China, use the Tsinghua University mirror:

https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/noble/ubuntu-24.04.3-desktop-amd64.iso

Campus mirror hub: https://mirrors.cernet.edu.cn/

Create a Bootable USB Drive

Write the ISO to a USB drive using one of the following tools:

Install the System

  1. Reboot into BIOS and select the USB drive as the boot device
  2. In the Ubuntu LiveISO GRUB menu, press Enter to enter Live mode
  3. Choose Erase disk and install Ubuntu (automatic partitioning), then wait about 20 minutes and reboot

Dual-boot users: Manual partitioning is required. Use a tool like DiskGenius to carve out at least 300 GB for Linux. During installation, create an EFI partition of ≥ 512 MB and assign the rest to /. Use a swap file rather than a dedicated swap partition.

Install Required Dependencies

sudo apt update && sudo apt upgrade -y

sudo apt install nano vim wget curl git ccache \
  automake flex lzop bison gperf build-essential zip \
  curl zlib1g-dev g++-multilib libxml2-utils bzip2 \
  libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools \
  pngcrush schedtool dpkg-dev liblz4-tool make optipng \
  maven libssl-dev pwgen libswitch-perl policycoreutils \
  minicom libxml-sax-base-perl libxml-simple-perl bc \
  libc6-dev-i386 lib32ncurses5-dev libx11-dev lib32z-dev \
  libgl1-mesa-dev xsltproc unzip device-tree-compiler \
  wget curl cpio p7zip p7zip-full libtinfo5 -y

sudo apt install python3 python-is-python3 -y

Basic git Usage

git clone -b <branch> https://github.com/<user>/<repo>.git --depth 1
Flag Description
clone Clone the target repository
-b <branch> Clone a specific branch; omit to clone all branches
--depth 1 Keep only the latest commit, reduces size — ideal when you do not need history
⚠️ **GitHub.com Fallback** ⚠️