我需要用根据我的自定义配方构建的库覆盖根据给定配方构建的共享库(我们称之为packageX(。基本上,我需要从packageX在/usr/lib
中构建和生成libA.so
和libB.so
。之后,我的配方应该生成自定义的libA.so
和libB.so
,以及将要添加的其他库。
我试图创建一个自定义配方来生成所需的库,但它们不能覆盖原始库。
ERROR: my_recipe-1.0.0-r0 do_populate_sysroot: The recipe my_recipe is trying to install files into a shared area when those files already exist.
Those files and their manifest location are:
.../usr/lib/libA.so.1.0.0
Matched in b'manifest-packageX.populate_sysroot'
.../usr/lib/libB.so.1.0.0
Matched in b'manifest-packageX.populate_sysroot'
Please verify which recipe should provide the above files.
ERROR: my_recipe-1.0.0-r0 do_populate_sysroot: If the above message is too much, the simpler version is you're advised to wipe out tmp and rebuild (reusing sstate is fine). That will likely fix things in most (but not all) cases.
之后,我尝试更改packageX
配方:
PACKAGES =+ "libC libD libE"
FILES_libC = "${libdir}/libC${SOLIBS}"
FILES_libD = "${libdir}/libD${SOLIBS}"
FILES_libE = "${libdir}/libE${SOLIBS}"
# compile function will build the libraries
do_install_append_class-target () {
install -Dm 0755 ${S}/my_recipe/bin/libA.so ${D}${libdir}/libA.so.1.0.0
install -Dm 0755 ${S}/my_recipe/bin/libB.so ${D}${libdir}/libB.so.1.0.0
install -Dm 0755 ${S}/my_recipe/bin/libC.so ${D}${libdir}/libC.so.1.0.0
install -Dm 0755 ${S}/my_recipe/bin/libD.so ${D}${libdir}/libD.so.1.0.0
install -Dm 0755 ${S}/my_recipe/bin/libE.so ${D}${libdir}/libE.so.1.0.0
oe_libinstall -so libA ${D}${libdir}
oe_libinstall -so libB ${D}${libdir}
oe_libinstall -so libC ${D}${libdir}
oe_libinstall -so libD ${D}${libdir}
oe_libinstall -so libE ${D}${libdir}
}
输出为:
ERROR: packageX-1.0.2j-r0 do_package_qa: QA Issue: non -dev/-dbg/nativesdk- package contains symlink .so: packageX path '.../packageX/1.0.2j-r0/packages-split/packageX/usr/lib/libA.so'
non -dev/-dbg/nativesdk- package contains symlink .so: packageX path '.../packageX/1.0.2j-r0/packages-split/packageX/usr/lib/libB.so' [dev-so]
ERROR: packageX-1.0.2j-r0 do_package_qa: QA Issue: No GNU_HASH in the elf binary: '.../packageX/1.0.2j-r0/packages-split/libC/usr/lib/libC.so.1.0.0' [ldflags]
ERROR: packageX-1.0.2j-r0 do_package_qa: QA Issue: No GNU_HASH in the elf binary: '.../packageX/1.0.2j-r0/packages-split/libE/usr/lib/libE.so.1.0.0' [ldflags]
WARNING: packageX-1.0.2j-r0 do_package_qa: QA Issue: /usr/lib/libE.so.1.0.0 contained in package libE requires libD.so, but no providers found in RDEPENDS_libE? [file-rdeps]
ERROR: packageX-1.0.2j-r0 do_package_qa: QA Issue: No GNU_HASH in the elf binary: '.../packageX/1.0.2j-r0/packages-split/libD/usr/lib/libD.so.1.0.0' [ldflags]
WARNING: packageX-1.0.2j-r0 do_package_qa: QA Issue: /usr/lib/libD.so.1.0.0 contained in package libD requires libC.so, but no providers found in RDEPENDS_libD? [file-rdeps]
结论:我的目标是从Yocto食谱中覆盖这些库。保持packageX
配方不变将是完美的。那么,我如何从Yocto食谱中实现这一点呢?
您可以使用变量SSTATE_ALLOW_OVERLAP_FILES
来实现这一点。然而,在大多数情况下,实现.bappend文件是更好的策略。