[oe-commits] [openembedded-core] 28/58: rpm: make rpm work in toolchain.

git at git.openembedded.org git at git.openembedded.org
Sun Sep 15 16:59:22 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 6cdd509a8085533961c1a91e0111b37e4273a900
Author: Zheng Ruoqin <zhengrq.fnst at cn.fujitsu.com>
AuthorDate: Thu Sep 12 15:52:11 2019 +0800

    rpm: make rpm work in toolchain.
    
    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 previous 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 <zhengrq.fnst at cn.fujitsu.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/recipes-devtools/rpm/rpm_4.14.2.1.bb | 16 ++++++++++++++++
 1 file changed, 16 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 c37330e..e1db1e3 100644
--- a/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
+++ b/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
@@ -103,6 +103,9 @@ do_install_append_class-native() {
         done
 }
 
+REAL_MULTIMACH_TARGET_SYS = "${TUNE_PKGARCH}-${DISTRO}-${TARGET_OS}"
+SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${REAL_MULTIMACH_TARGET_SYS}"
+
 do_install_append_class-nativesdk() {
         for tool in ${WRAPPER_TOOLS}; do
                 create_wrapper ${D}$tool \
@@ -113,6 +116,17 @@ 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}: all any noarch ${PACKAGE_EXTRA_ARCHS}
+EOF
+
+# Arch Info should be fixed as '-' is instead of '_'.
+        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
@@ -134,6 +148,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"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list