We need to configure rpm to use package architecture from yocto build system.
Install rpmrc and rpm/platform to ${SDKTARGETSYSROOT} because config file in
host-sysroot as /opt/poky/2.7+snapshot/sysroots/x86_64-pokysdk-linux will be
covered by another ARCH which result in prvious config settings inefficacy.
To resolve it, put config file in target-sysroot like
/opt/poky/2.7+snapshot/sysroots/core2-64-poky-linux. As each ARCH has its own
target-sysroot, config file will not be covered.
Signed-off-by: Zheng Ruoqin <[email protected]>
---
meta/recipes-devtools/rpm/rpm_4.14.2.1.bb | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
b/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
index 063f4269a5..af8e144f96 100644
--- a/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
+++ b/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
@@ -102,6 +102,9 @@ do_install_append_class-native() {
done
}
+REAL_MULTIMACH_TARGET_SYS = "${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}"
+SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${REAL_MULTIMACH_TARGET_SYS}"
+
do_install_append_class-nativesdk() {
for tool in ${WRAPPER_TOOLS}; do
create_wrapper ${D}$tool \
@@ -112,6 +115,16 @@ do_install_append_class-nativesdk() {
done
rm -rf ${D}/var
+ install -d ${D}/${SDKTARGETSYSROOT}/etc/rpm
+
+ cat >${D}/${SDKTARGETSYSROOT}/etc/rpmrc <<EOF
+arch_compat: ${MACHINE_ARCH}: ${PACKAGE_ARCHS}
+EOF
+ sed -i 's/-nativesdk//g' ${D}/${SDKTARGETSYSROOT}/etc/rpmrc
+ sed -i 's/-/_/' ${D}/${SDKTARGETSYSROOT}/etc/rpmrc
+ cat >${D}/${SDKTARGETSYSROOT}/etc/rpm/platform <<EOF
+${MACHINE_ARCH}-pc-linux
+EOF
}
# Rpm's make install creates var/tmp which clashes with base-files packaging
@@ -133,6 +146,8 @@ FILES_${PN} += "${libdir}/rpm-plugins/*.so \
FILES_${PN}-dev += "${libdir}/rpm-plugins/*.la \
"
+FILES_${PN}_append_class-nativesdk += "${SDKTARGETSYSROOT}"
+
PACKAGES += "python3-rpm"
PROVIDES += "python3-rpm"
--
2.17.1
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core