大佬教程收集整理的这篇文章主要介绍了Yocto 抱怨两个配方安装了相同的头文件,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
使用 bitbake
构建映像时,构建会抱怨这两个配方如何安装此特定头文件(在 /usr/include
== 内核头文件下?)。
./tmp/work/aarch64-poky-linux/glibc/2.27-r0/temp/log.do_prepare_recipe_sysroot.21803:807:DEBUG: Removing manifest: /repo/build/tmp/work/aarch64-poky-linux/glibc/2.27-r0/recipe-sysroot/usr/include/scsi/scsi_ioctl.h
ERROR: glibc-2.27-r0 do_prepare_recipe_sysroot: The file /usr/include/scsi/scsi_ioctl.h is installed by both linux-libc-headers and glibc-initial,aborTing
ERROR: glibc-2.27-r0 do_prepare_recipe_sysroot: Function Failed: extend_recipe_sysroot
/tmp/work/aarch64-poky-linux/glibc/2.27-r0/temp/log.do_prepare_recipe_sysroot.16343:976:Exception: fileExistsError: [Errno 17] file exists: '/repo/build/tmp/sysroots-components/aarch64/linux-libc-headers/usr/include/scsi/scsi_ioctl.h' -> 'repo/build/tmp/work/aarch64-poky-linux/glibc/2.27-r0/recipe-sysroot/usr/include/scsi/scsi_ioctl.h'
观察
我首先在 scsi_ioctl.h
目录中查找 source
......但无济于事。
然后,我尝试查看各自的配方文件,这两个文件都需要 .inc
文件,所以我打开了它。
我看到 glibc-initial
依赖于 linux-libc-headers
,这仅仅意味着(根据我的理解)bitbake
在 linux-libc-headers
之前首先构建 glibc-initial
.
linux-libc-headers
删除 scsi.h
。 (不确定它是否与它抱怨的当前标题有关)
我还在 linux-libc-headers.inc
中看到一个长注释,它谈到如何不必向内核添加 libc
自定义扩展。此外,它说如果您需要使用内核驱动程序,请从 STAGING_KERNEL_DIR
中获取它们,它在 bitbake.conf
中设置为 "${TMPDIR}/work-shared/${MACHINE}/kernel-source"
,我已经看到 scsi_ioctl.h
位于那里.
// glibc-initial.inc
DEPENDS = "linux-libc-headers virtual/${TARGET_PREFIX}gcc-initial libgcc-initial"
PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
....
do_install () {
oe_runmake cross-compiling=yes install_root=${D} \
includedir='${includedir}' prefix='${prefix}' \
install-bootstrap-headers=yes install-headers
oe_runmake csu/subdir_lib
mkdir -p ${D}${libdir}/
install -m 644 csu/crt[1in].o ${D}${libdir}
@H_262_8@// linux-libc-headers.inc
do_install() {
oe_runmake headers_install INSTall_HDR_PATH=${D}${exec_prefix}
# Kernel should not be exporTing this header
rm -f ${D}${exec_prefix}/include/scsi/scsi.h
# The ..install.cmd conflicts between varIoUs configure runs
find ${D}${includedir} -name ..install.cmd | xargs rm -f
}
#########################################################################
#### PLEASE READ
#########################################################################
#
# You're probably looking here thinking you need to create some new copy
# of linux-libc-headers since you have your own custom kernel. To put
# this simply,you DO NOT.
#
# Why? these headers are used to build the libc. If you customise the
# headers you are customising the libc and the libc becomes machine
# specific. Most people do not add custom libc extensions to the kernel
# and have a machine specific libc.
#
# But you have some kernel headers you need for some driver? That is fine
# but get them from STAGING_KERNEL_DIR where the kernel installs itself.
# This will make the package using them machine specific but this is much
# better than having a machine specific C library. This does mean your
# recipe needs a
# do_configure[depends] += "virtual/kernel:do_shared_workdir"
# but again,that is fine and makes @R_571_10586@l sense.
#
# There can also be a case where your kernel extremely old and you want
# an older libc ABI for that old kernel. The headers installed by this
# recipe should still be a standard mainline kernel,not your own custom
# one.
问题/疑虑
build/tmp/work/<machine-name>
而不是 build/tmp/work/aarch64-poky-linux
,其中 <machine-name>
是它在 build/conf/local.conf
文件中设置的任何内容,它不是 {{1 }}感谢任何帮助
请说明您使用的是什么版本的 yocto(gatesgarth 等)。
由于 glibc 是一个非常常见的包,我认为您的 yocto if (res.value === truE)
目录出了问题,而不是 yocto 本身的问题。 (在我的 dunfell 构建中,tmp
仅出现在 glibc 配方下。)当前 yocto 为每个包构建了一个不同的 sysroot,但在早期版本中使用了一个通用的 sysroot,它相当脆弱。
你可以试试:
@H_262_8@scsi_ioctl.h
然后重建。如果这不起作用,您可以尝试将 bitbake -c cleanall glibc
bitbake -c cleanall linux-libc-headers
重命名为其他名称并重新运行构建的核心选项。如果您在多个 yocto 版本或多个内核配方中使用相同的 tmp
,我绝对建议您重新开始。
回复:tmp
对 tmp/work/<machine>
; yocto 尝试尽可能广泛地重用构建产品。如果一个包是特定于机器的(例如内核和设备树),它会在 tmp/work/<arch>
下构建。如果它是特定于架构的(例如编译的 C 代码)但不是特定于机器的,则它会在 tmp/work/<machine>
下构建。一些软件包(例如 tmp/work/<arch>
)与平台无关,并构建在 ca-certificates
目录中。
我们为多种不同的 Cortex A8 机器构建;大多数包最终位于 tmp/work/<all>
中,但少数包具有特定于机器的覆盖并最终位于特定于机器的目录中。
以上是大佬教程为你收集整理的Yocto 抱怨两个配方安装了相同的头文件全部内容,希望文章能够帮你解决Yocto 抱怨两个配方安装了相同的头文件所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。