> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tsukineos.top/llms.txt
> Use this file to discover all available pages before exploring further.

# Build Environment

> 构建主机依赖与交叉编译说明

# 构建环境

## 主机要求

* 任意现代 Linux 发行版（推荐 x86\_64）
* 约 20 GB 可用磁盘空间
* 联网（拉取内核/BusyBox 源码）

## 依赖（Debian/Ubuntu）

```bash theme={null}
sudo apt install build-essential bc flex bison libssl-dev libelf-dev \
  wget cpio gzip xz-utils
```

## 依赖（Arch）

```bash theme={null}
sudo pacman -S base-devel openssl elfutils wget cpio gzip xz
```

## 静态编译 BusyBox

```bash theme={null}
make menuconfig   # 在 Settings 中开启 "Build static binary"
make -j$(nproc)
```

## 交叉编译（x86\_64 主机构建 ARM64）

```bash theme={null}
sudo apt install gcc-aarch64-linux-gnu
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
# 内核、BusyBox、自研工具均在此环境下编译
```

## 提示

* 推荐在 TsukineOS 或干净的容器/虚拟机中构建，避免宿主库污染。
* 各组件的具体编译参数以仓库 `TsukineOS` 当前源码为准。

```

---
```
