搭建基础环境 - JackA1ltman/NonGKI_Kernel_Build_2nd GitHub Wiki
基础编译 · 第一步
我们基于干净的设备环境进行教学,以 Ubuntu 24.04 为例。
推荐使用清华大学镜像源下载(大陆地区):
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 -ygit clone -b <分支名> https://github.com/<用户>/<仓库>.git --depth 1| 参数 | 说明 |
|---|---|
clone |
克隆目标源码 |
-b <分支名> |
指定克隆分支,不加则克隆所有分支 |
--depth 1 |
只保留最新提交,压缩大小,适合不需要历史记录的场景 |