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

  • 6
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

夜流冰

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

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

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

打赏作者

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

抵扣说明:

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

余额充值