mirror of
https://github.com/JackA1ltman/NonGKI_Kernel_Build_2nd.git
synced 2026-08-19 15:03:40 +08:00
Page:
搭建基础环境
Pages
Fork 项目
Home
en Automated Release
en Choosing a Toolchain
en Compiling on a Mobile Device
en Compiling the Kernel
en Compiling the Stock Vendor Kernel
en Configuring the YML File
en Embedding KernelSU and Patching SuSFS
en Fork the Repository
en Hiding Root Common Methods
en Introduction
en Kernel Build FAQ
en Packaging and Flashing
en Requirements
en Running and Downloading Artifacts
en Setting Up the Environment
en Variable Reference
内核编译答疑
利用移动设备编译内核
变量参考
基础需求
嵌入KernelSU和SuSFS修补
序章
打包与刷入
搭建基础环境
编译内核
编译器选择
编译设备厂商原始内核
自动发布
运行与产物
配置 YML 文件
隐藏Root常规方式
No results
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
搭建基础环境
基础编译 · 第一步
我们基于干净的设备环境进行教学,以 Ubuntu 24.04 为例。
获取 Linux 发行版
推荐使用清华大学镜像源下载(大陆地区):
https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/noble/ubuntu-24.04.3-desktop-amd64.iso
校园镜像联合站:https://mirrors.cernet.edu.cn/
或直接从官网下载:https://ubuntu.com/download/desktop
制作启动盘
将 ISO 写入 U 盘,推荐工具:
- Rufus:https://rufus.ie/
- Ventoy:https://www.ventoy.net/
- Etchdroid(将手机作为 U 盘,极端情况):https://etchdroid.app/
安装系统
- 重启进入 BIOS,在启动项中选择 U 盘
- 进入 Ubuntu LiveISO 的 GRUB,回车进入 Live 模式
- 选择清空磁盘自动分区方式安装,等待约 20 分钟后重启进入系统
双系统用户注意:需手动分区,建议用 DiskGenius 拆分至少 300 GB 给 Linux。安装时创建 ≥ 512 MB 的 EFI 分区,其余分给
/分区。Swap 建议使用文件方式而非独立分区。
安装必要依赖
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
git 基础用法
git clone -b <分支名> https://github.com/<用户>/<仓库>.git --depth 1
| 参数 | 说明 |
|---|---|
clone |
克隆目标源码 |
-b <分支名> |
指定克隆分支,不加则克隆所有分支 |
--depth 1 |
只保留最新提交,压缩大小,适合不需要历史记录的场景 |
🌐 Language / 语言
📖 English
Local Build
- Setting Up the Environment
- Choosing a Toolchain
- Compiling the Kernel
- Compiling on a Mobile Device
- Compiling the Stock Vendor Kernel
- Embedding KernelSU & Patching SuSFS
- Packaging and Flashing
- Kernel Build FAQ
Build with Actions
- Fork the Repository
- Configuring the YML File
- Variable Reference
- Running and Downloading Artifacts
- Automated Release
Hide Root Trace
📖 中文
基础编译
利用 Action 构建内核
隐藏Root痕迹