NotePublic/Software/Applications/Yocto/Yocto_基本使用和常见问题.md

76 lines
1.1 KiB
Markdown
Raw Blame History

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.

# Yocto 基本使用和常见问题
## 交叉编译配置
在 yocto 根目录下:
```bash
source <sdk root>/oe-init-build-env
```
## 编译目标
使用如下命令查看所有编译目标:
```bash
bitbake -s
```
## 在 build 目录下进行编译
```bash
bitbake <target> -C compile
```
参数:
-C 强制编译,配置、编译目标并打包;
-c 不强制。
生成的文件在:
```bash
<yocto root>/build/tmp/deploy/images/<product>
```
目录下。
## Clean
注意Clena 动作会清除 build/tmp 文件夹下的源码。
```bash
bitbake <target> -c cleansstate
```
## Linux Kernel
Kernel 源码在:
```bash
<yocto root>/build/tmp/work-shared/<product>/kernel-source
```
目录下。
Kernel 配置方法为:
```bash
bitbake linux-renesas -c do_menuconfig
```
## 常见问题
### Please use a locale setting which supports utf-8
Yocto 需要 locales 支持且设置为 UTF8。
```bash
# Ubuntu
sudo apt-get install locales
sudo dpkg-reconfigure locales
sudo locale-gen "en_US.UTF-8"
sudo update-locale LC_ALL="en_US.UTF-8" LANG="en_US.UTF-8"
export LANG="en_US.UTF-8"
```