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

相关文章

java变量内存中存储的使用方式

《java变量内存中存储的使用方式》:本文主要介绍java变量内存中存储的使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1、介绍2、变量的定义3、 变量的类型4、 变量的作用域5、 内存中的存储方式总结1、介绍在 Java 中,变量是用于存储程序中数据

Java中 instanceof 的用法详细介绍

《Java中instanceof的用法详细介绍》在Java中,instanceof是一个二元运算符(类型比较操作符),用于检查一个对象是否是某个特定类、接口的实例,或者是否是其子类的实例,这篇文章... 目录引言基本语法基本作用1. 检查对象是否是指定类的实例2. 检查对象是否是子类的实例3. 检查对象是否

什么是ReFS 文件系统? ntfs和refs的优缺点区别介绍

《什么是ReFS文件系统?ntfs和refs的优缺点区别介绍》最近有用户在Win11Insider的安装界面中发现,可以使用ReFS来格式化硬盘,这是不是意味着,ReFS有望在未来成为W... 数十年以来,Windows 系统一直将 NTFS 作为「内置硬盘」的默认文件系统。不过近些年来,微软还在研发一款名

C#使用StackExchange.Redis实现分布式锁的两种方式介绍

《C#使用StackExchange.Redis实现分布式锁的两种方式介绍》分布式锁在集群的架构中发挥着重要的作用,:本文主要介绍C#使用StackExchange.Redis实现分布式锁的... 目录自定义分布式锁获取锁释放锁自动续期StackExchange.Redis分布式锁获取锁释放锁自动续期分布式

redis过期key的删除策略介绍

《redis过期key的删除策略介绍》:本文主要介绍redis过期key的删除策略,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录第一种策略:被动删除第二种策略:定期删除第三种策略:强制删除关于big key的清理UNLINK命令FLUSHALL/FLUSHDB命

Pytest多环境切换的常见方法介绍

《Pytest多环境切换的常见方法介绍》Pytest作为自动化测试的主力框架,如何实现本地、测试、预发、生产环境的灵活切换,本文总结了通过pytest框架实现自由环境切换的几种方法,大家可以根据需要进... 目录1.pytest-base-url2.hooks函数3.yml和fixture结论你是否也遇到过

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