简体   繁体   English

使用bbappend中的共享库符号链接,bitbake do_rootfs安装失败

[英]bitbake do_rootfs install fails with shared library symlink in bbappend

I am trying to add a shared library package to a Yocto Krogoth image from a custom recipe that is dependent on libudev.so.0 but the openembedded-core layer's eudev recipe only provides libudev.so.1.6.3 and a libudev.so.1 symlink: libudev.so.1 -> libudev.so.1.6.3 我试图将共享库包从依赖libudev.so.0的自定义配方添加到Yocto Krogoth图像,但是openembedded-core层的eudev 配方仅提供libudev.so.1.6.3libudev.so.1符号链接: libudev.so.1 -> libudev.so.1.6.3

I have added a eudev_%.bbappend recipes_core recipe that creates the symlink 我添加了一个创建符号链接的eudev_%.bbappend recipes_core配方

do_install_append() {
        ln -srf ${D}${base_libdir}/libudev.so.1 ${D}${base_libdir}/libudev.so.0
}

and I can confirm the libudev.so.0 file is added to the libudev package in 并且我可以确认libudev.so.0文件已添加到libudev包中

tmp/work/HOST/eudev/3.1.5-r0/image/lib/libudev.so.0 
tmp/work/HOST/eudev/3.1.5-r0/package/lib/libudev.so.0 
tmp/work/HOST/eudev/3.1.5-r0/packages-split/lib/libudev.so.0 
tmp/work/HOST/eudev/3.1.5-r0/sysroot-destdir/lib/libudev.so.0

and installed to the image's tmp/sysroots/MACHINE/lib/libudev.so.0 directory when building the image and is present in the resultant tmp/deploy/images/MACHINE/IMAGENAME.tar.bz2 rootfs archive. 并在构建映像时安装到映像的tmp/sysroots/MACHINE/lib/libudev.so.0目录中,并存在于生成的tmp/deploy/images/MACHINE/IMAGENAME.tar.bz2 rootfs归档文件中。 The issue is that with the above in place I cannot add my shared library package to the image as it results in the following error: 问题在于,使用上述方法后,我无法将共享库包添加到映像,因为它会导致以下错误:

do_rootfs: ...
Computing transaction...error: Can't install MYRECIPE@HOST: no package provides libudev.so.0

The custom recipe does have RDEPENDS_${PN} = libudev set. 自定义配方确实设置了RDEPENDS_${PN} = libudev

Why is the do_rootfs error generated as the installed libudev package clearly does provide the libudev.so.0 library? 为什么由于已安装的libudev软件包明显提供了libudev.so.0库而产生了do_rootfs错误? Bitbaking the custom recipe independently has no issue, but that obviously does not attempt to install the resultant package into an image. 独立地对定制配方进行位烘烤没有问题,但是显然不会尝试将生成的程序包安装到映像中。

Why is the do_rootfs error generated as the installed libudev package clearly does provide the libudev.so.0 library? 为什么由于已安装的libudev软件包明显提供了libudev.so.0库而产生了do_rootfs错误?

I'm pretty sure the the relevant code isn't looking at file names but actual symbols needed by your library -- there's packaging magic that looks at all the libraries and executables and figures out their runtime dependencies based on the symbols they need (this is how the correct dependency libraries end up on the rootfs). 我很确定相关代码不是在查看文件名而是库所需的实际符号-打包魔术可以查看所有库和可执行文件并根据所需的符号找出它们的运行时依赖关系(这是正确的依赖库最终在rootfs上的输出)。 I believe the error message is trying to say that no available library exports the symbols that your library needs. 我相信错误消息试图说没有可用的库导出您的库所需的符号。

You can check the soname your udev exports with 您可以使用以下命令检查udev导出的soname:

readelf -a libudev.so.1 | grep SONAME
0x000000000000000e (SONAME)             Library soname: [libudev.so.1]

I've not confirmed that this is what the rootfs code checks for but it's quite likely. 我尚未确认这是rootfs代码检查的内容,但很有可能。

Are you expecting a library linked with libudev.so.0 to just work with libudev.so.1 without even a recompile? 您是否希望与libudev.so.0链接的库仅与libudev.so.1一起使用,而无需重新编译? I'm not familiar with udev but in general libraries are unlikely to work like that. 我不熟悉udev,但总的来说图书馆不太可能那样工作。

The custom recipe does have RDEPENDS_${PN} = libudev set. 自定义配方确实设置了RDEPENDS _ $ {PN} = libudev。

This is not normally needed -- if your software dynamically links to a library, the runtime dependency is found automatically. 通常不需要这样做-如果您的软件动态链接到库,则会自动找到运行时依赖项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM