Yocto - 使用Yocto开发嵌入式Linux系统_12 开发定制层

Exploring External Layers
Poky 最迷人的功能之一是灵活使用外部层。在本章中,我们将探讨为什么这是一项重要功能,以及如何利用它。我们还将了解不同类型的图层及其目录树布局。最后,在本章结尾,我们将学习在项目中加入一个新图层。
One of the most charming features of Poky is the flexibility of using external layers. In this chapter, we will examine why this is a vital capability and how we can take advantage of it. We will also look at the different types of layers and their directory trees layout. Finally, at the end of this chapter, we will learn to include a new layer in our project.
1, Powering flexibility with layers
Poky 包含的元数据分布在机器和发行版文件、类和配方等配置定义文件中,涵盖了从简单应用到完整图形堆栈和框架的所有内容。BitBake 可以从多个地方加载元数据集合,这些地方被称为元数据层。
Poky contains metadata spread over configuration definition files such as machine and distro files, classes, and recipes, covering everything from simple applications to full graphical stacks and frameworks. There are multiple places that BitBake can load metadata collection from, which are known as metadata layers.
使用图层的最大优势是可以将元数据分割成逻辑单元,这样用户就可以只选择项目所需的元数据集合。
The biggest strength of using layers is the ability to split metadata into logical units, which enables users to pick only the metadata collection needed for a project.
使用元数据层可以让我们做到以下几点:
* 提高代码重用率
* 在不同团队、社区和供应商之间共享和扩展工作
* 提高 Yocto 项目社区的代码质量,因为多个开发人员和用户会共同关注他们感兴趣的特定元数据层
Using metadata layers enables us to do the following:
* Improve code reuse
* Share and scale work across different teams, communities, and vendors
* Increase the Yocto Project community’s code quality, as multiple developers and users focus together on a particular metadata layer that is of interest to them
我们可以出于不同的原因配置系统,例如需要启用/禁用某个功能,或更改构建标志以启用特定架构的优化。这些都是可以使用层进行定制的例子。
We can configure the system for different reasons, such as the need to enable/disable a feature or change build flags to enable architecture-specific optimizations. These are examples of customizations that can be done using layers.
In addition, we should organize metadata in different layers instead of creating our custom project environment, changing recipes, and modifying files in the Poky layer. The more separated an organization is, the easier it is to reuse the layers in future projects, as the Poky source code is split into different layers as well. It contains three layers by default, as we can see in the output of the following command line:
此外,我们应该在不同的层中组织元数据,而不是在 Poky 层中创建自定义项目环境、更改配方和修改文件。由于 Poky 源代码也被分割成不同的层,因此组织得越分离,就越容易在未来的项目中重复使用这些层。默认情况下,它包含三个层,我们可以从以下命令行的输出中看到:
[ Figure 11.1 – The result of bitbake-layers show-layers ]
命令行输出会显示任何图层的以下三个基本属性:
* 名称: 通常以元字符串开头。
* 路径: 当我们想在项目中添加一个层,同时附加到 BBPATH 变量时,这一点非常重要。
* 优先级: 这是 BitBake 用来决定使用哪种配方以及 .bb
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜流冰

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值