开发环境准备
2025-05-21
主机要求
配置 | 工具 |
---|---|
x86 计算机 | Git 1.8.3.1 或更高版本 |
四核 CPU,例如 3.4 GHz 的 Intel i7-2600(同等或更高) | Tar 1.28 或更高版本 |
300 GB可用磁盘空间(交换分区 > 32 GB) | Python 3.10.2 或更高版本 |
16 GB 内存 | GCC 7.5 或更高版本 |
Ubuntu 22.04 | GNU Make 4.0 或更高版本 |
工具安装
安装以下软件包来为 Yocto 构建准备主机环境
sudo apt update
sudo apt install repo gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint xterm python3-subunit mesa-common-dev zstd liblz4-tool locales tar python-is-python3 file libxml-opml-simplegen-perl vim whiptail g++
设置区域设置(如果尚未设置):
sudo locale-gen en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
更新 git 配置
检查是否在 .gitconfig 中配置了标识
git config --get user.email
git config --get user.name
如果没有在 .gitconfig 中设置帐户标识,请运行以下命令
git config --global user.email <Your email ID>
git config --global user.name <"Your Name">
为控制台的输出添加以下 UI 颜色选项(可选)
git config --global color.ui auto
添加以下 git 配置来获取大型存储库并避免不可靠的连接
git config --global http.postBuffer 1048576000
git config --global http.maxRequestBuffer 1048576000
git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999