Yocto - 变量介绍:BASE_WORKDIR、WORKDIR和D

2024-06-09 17:28
文章标签 介绍 变量 base yocto workdir

本文主要是介绍Yocto - 变量介绍:BASE_WORKDIR、WORKDIR和D,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

BASE_WORKDIR

指向所有配方的工作目录根目录。默认值为"${TMPDIR}/work"。

Points to the base of the work directory for all recipes. The default value is “${TMPDIR}/work”.

$ bitbake -e <recipe-name>| grep ^BASE_WORKDIR

BASE_WORKDIR="/home/myname/imx93-yocto-bsp/build/tmp/work"

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 

TMPDIR

该变量是 OpenEmbedded 联编系统用于所有联编输出和中间文件(共享状态缓存除外)的基本目录。默认情况下,TMPDIR 变量指向构建目录中的 tmp。

如果要在默认位置之外的其他位置建立此目录,可以取消注释并编辑源代码目录中 conf/local.conf 文件中的以下语句:

This variable is the base directory the OpenEmbedded build system uses for all build output and intermediate files (other than the shared state cache). By default, the TMPDIR variable points to tmp within the Build Directory.

If you want to establish this directory in a location other than the default, you can uncomment and edit the following statement in the conf/local.conf file in the Source Directory:

#TMPDIR = "${TOPDIR}/tmp"

这种情况下的一个使用示例是将 TMPDIR 设置为不使用 NFS 的本地磁盘,同时让构建目录使用 NFS。

TMPDIR 使用的文件系统必须具有标准的文件系统语义(即混合大小写文件是唯一的、POSIX 文件锁定和持久性 inodes)。由于 NFS 的各种问题和某些实现中的错误,NFS 无法满足这一最低要求。因此,TMPDIR 不能在 NFS 上运行。

An example use for this scenario is to set TMPDIR to a local disk, which does not use NFS, while having the Build Directory use NFS.

The filesystem used by TMPDIR must have standard filesystem semantics (i.e. mixed-case files are unique, POSIX file locking, and persistent inodes). Due to various issues with NFS and bugs in some implementations, NFS does not meet this minimum requirement. Consequently, TMPDIR cannot be on NFS.

On my machine:

$ bitbake -e kbw-mod | grep ^TMPDIR=

TMPDIR="/home/myname/imx93-yocto-bsp/build/tmp/"

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 

WORKDIR

在 Yocto 中,${WORKDIR} 是一个环境变量,表示特定配方在联编过程中的工作目录。它本质上是一个临时目录,Yocto 在此解压和准备源文件、应用补丁,并执行与构建软件包或组件相关的各种任务。

${WORKDIR}: 此变量指向配方的工作目录。通常位于 Yocto 构建环境的 tmp 目录中。

In Yocto, ${WORKDIR} is an environment variable that represents the working directory of a particular recipe during the build process. It's essentially a temporary directory where Yocto unpacks and prepares source files, applies patches, and performs various tasks related to building a package or component.

${WORKDIR}: This variable points to the working directory for the recipe. It's typically located within the tmp directory of your Yocto build environment.

${WORKDIR} 的默认值定义在 bitbake 变量中。但你可以在配方中修改它。它指向 bitbake 解压软件包的目录

你可以从 bitbake 环境中获取 ${WORKDIR} 的值:

The default value of ${WORKDIR} is defined in bitbake variables. But you can change it in the recipe. It points toward the directory where bitbake unpacks the package.

You can get the value of ${WORKDIR} from the bitbake environment:

bitbake -e <recipe-name> | grep ^WORKDIR=

官方文档:

OpenEmbedded 构建系统构建配方的工作目录路径名。该目录位于 TMPDIR 目录结构中,与正在构建的配方和构建配方的系统相关。

The pathname of the work directory in which the OpenEmbedded build system builds a recipe. This directory is located within the TMPDIR directory structure and is specific to the recipe being built and the system for which it is being built.

The WORKDIR directory is defined as follows:

${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}

The actual directory depends on several things:

* TMPDIR: The top-level build output directory

* MULTIMACH_TARGET_SYS: The target system identifier

* PN: The recipe name

* EXTENDPE: The epoch — if PE is not specified, which is usually the case for most recipes, then EXTENDPE is blank.

* PV: The recipe version

* PR: The recipe revision

例如,假设源代码目录的顶级文件夹名为 poky,默认编译目录为 poky/build,目标系统为 qemux86-poky-linux。此外,假设你的配方名为 foo_1.3.0-r0.bb。在这种情况下,编译系统用来编译软件包的工作目录如下:

As an example, assume a Source Directory top-level folder name poky, a default Build Directory at poky/build, and a qemux86-poky-linux machine target system. Furthermore, suppose your recipe is named foo_1.3.0-r0.bb. In this case, the work directory the build system uses to build the package would be as follows:

poky/build/tmp/work/qemux86-poky-linux/foo/1.3.0-r0

On my machine:

$ bitbake -e recipe-name | grep ^WORKDIR=

WORKDIR="/home/myname/imx93-yocto-bsp/build/tmp/work/target-sys-name/recipe-name/0.1-r0"

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 

D

目标目录。do_install 任务安装组件的构建目录位置。该位置默认为:

The destination directory. The location in the Build Directory where components are installed by the do_install task. This location defaults to:

${WORKDIR}/image

Example:

$ bitbake -e <recipe-name> | grep ^D=

D="/home/myname/imx93-yocto-bsp/build/tmp/work/target-sys-name/recipe-name/0.1-r0/image"

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 

TOPDIR

指向构建目录。BitBake 会自动设置此变量。

Points to the build directory. BitBake automatically sets this variable.

当前最新的bitbake版本是2.8。

6 Variables Glossary — Bitbake dev documentation

参考:

12 Variables Glossary — The Yocto Project ® 5.0.1 documentation

12 Variables Glossary

这篇关于Yocto - 变量介绍:BASE_WORKDIR、WORKDIR和D的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1045820

相关文章

浅析Rust多线程中如何安全的使用变量

《浅析Rust多线程中如何安全的使用变量》这篇文章主要为大家详细介绍了Rust如何在线程的闭包中安全的使用变量,包括共享变量和修改变量,文中的示例代码讲解详细,有需要的小伙伴可以参考下... 目录1. 向线程传递变量2. 多线程共享变量引用3. 多线程中修改变量4. 总结在Rust语言中,一个既引人入胜又可

四种Flutter子页面向父组件传递数据的方法介绍

《四种Flutter子页面向父组件传递数据的方法介绍》在Flutter中,如果父组件需要调用子组件的方法,可以通过常用的四种方式实现,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录方法 1:使用 GlobalKey 和 State 调用子组件方法方法 2:通过回调函数(Callb

Python进阶之Excel基本操作介绍

《Python进阶之Excel基本操作介绍》在现实中,很多工作都需要与数据打交道,Excel作为常用的数据处理工具,一直备受人们的青睐,本文主要为大家介绍了一些Python中Excel的基本操作,希望... 目录概述写入使用 xlwt使用 XlsxWriter读取修改概述在现实中,很多工作都需要与数据打交

java脚本使用不同版本jdk的说明介绍

《java脚本使用不同版本jdk的说明介绍》本文介绍了在Java中执行JavaScript脚本的几种方式,包括使用ScriptEngine、Nashorn和GraalVM,ScriptEngine适用... 目录Java脚本使用不同版本jdk的说明1.使用ScriptEngine执行javascript2.

Python实现NLP的完整流程介绍

《Python实现NLP的完整流程介绍》这篇文章主要为大家详细介绍了Python实现NLP的完整流程,文中的示例代码讲解详细,具有一定的借鉴价值,感兴趣的小伙伴可以跟随小编一起学习一下... 目录1. 编程安装和导入必要的库2. 文本数据准备3. 文本预处理3.1 小写化3.2 分词(Tokenizatio

java如何调用kettle设置变量和参数

《java如何调用kettle设置变量和参数》文章简要介绍了如何在Java中调用Kettle,并重点讨论了变量和参数的区别,以及在Java代码中如何正确设置和使用这些变量,避免覆盖Kettle中已设置... 目录Java调用kettle设置变量和参数java代码中变量会覆盖kettle里面设置的变量总结ja

Perl 特殊变量详解

《Perl特殊变量详解》Perl语言中包含了许多特殊变量,这些变量在Perl程序的执行过程中扮演着重要的角色,:本文主要介绍Perl特殊变量,需要的朋友可以参考下... perl 特殊变量Perl 语言中包含了许多特殊变量,这些变量在 Perl 程序的执行过程中扮演着重要的角色。特殊变量通常用于存储程序的

性能测试介绍

性能测试是一种测试方法,旨在评估系统、应用程序或组件在现实场景中的性能表现和可靠性。它通常用于衡量系统在不同负载条件下的响应时间、吞吐量、资源利用率、稳定性和可扩展性等关键指标。 为什么要进行性能测试 通过性能测试,可以确定系统是否能够满足预期的性能要求,找出性能瓶颈和潜在的问题,并进行优化和调整。 发现性能瓶颈:性能测试可以帮助发现系统的性能瓶颈,即系统在高负载或高并发情况下可能出现的问题

水位雨量在线监测系统概述及应用介绍

在当今社会,随着科技的飞速发展,各种智能监测系统已成为保障公共安全、促进资源管理和环境保护的重要工具。其中,水位雨量在线监测系统作为自然灾害预警、水资源管理及水利工程运行的关键技术,其重要性不言而喻。 一、水位雨量在线监测系统的基本原理 水位雨量在线监测系统主要由数据采集单元、数据传输网络、数据处理中心及用户终端四大部分构成,形成了一个完整的闭环系统。 数据采集单元:这是系统的“眼睛”,

Hadoop数据压缩使用介绍

一、压缩原则 (1)运算密集型的Job,少用压缩 (2)IO密集型的Job,多用压缩 二、压缩算法比较 三、压缩位置选择 四、压缩参数配置 1)为了支持多种压缩/解压缩算法,Hadoop引入了编码/解码器 2)要在Hadoop中启用压缩,可以配置如下参数