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

相关文章

MySQL中慢SQL优化的不同方式介绍

《MySQL中慢SQL优化的不同方式介绍》慢SQL的优化,主要从两个方面考虑,SQL语句本身的优化,以及数据库设计的优化,下面小编就来给大家介绍一下有哪些方式可以优化慢SQL吧... 目录避免不必要的列分页优化索引优化JOIN 的优化排序优化UNION 优化慢 SQL 的优化,主要从两个方面考虑,SQL 语

C++中函数模板与类模板的简单使用及区别介绍

《C++中函数模板与类模板的简单使用及区别介绍》这篇文章介绍了C++中的模板机制,包括函数模板和类模板的概念、语法和实际应用,函数模板通过类型参数实现泛型操作,而类模板允许创建可处理多种数据类型的类,... 目录一、函数模板定义语法真实示例二、类模板三、关键区别四、注意事项 ‌在C++中,模板是实现泛型编程

Python实现html转png的完美方案介绍

《Python实现html转png的完美方案介绍》这篇文章主要为大家详细介绍了如何使用Python实现html转png功能,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 1.增强稳定性与错误处理建议使用三层异常捕获结构:try: with sync_playwright(

Java使用多线程处理未知任务数的方案介绍

《Java使用多线程处理未知任务数的方案介绍》这篇文章主要为大家详细介绍了Java如何使用多线程实现处理未知任务数,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 知道任务个数,你可以定义好线程数规则,生成线程数去跑代码说明:1.虚拟线程池:使用 Executors.newVir

JAVA SE包装类和泛型详细介绍及说明方法

《JAVASE包装类和泛型详细介绍及说明方法》:本文主要介绍JAVASE包装类和泛型的相关资料,包括基本数据类型与包装类的对应关系,以及装箱和拆箱的概念,并重点讲解了自动装箱和自动拆箱的机制,文... 目录1. 包装类1.1 基本数据类型和对应的包装类1.2 装箱和拆箱1.3 自动装箱和自动拆箱2. 泛型2

浅析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