Thanks, I think this looks more or less correct now. Alex
On Thu, 12 Sep 2019 at 09:53, Zheng Ruoqin <zhengrq.f...@cn.fujitsu.com> wrote: > 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.f...@cn.fujitsu.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 063f4269a5..5634f6702f 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}-${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 \ > @@ -112,6 +115,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 > @@ -133,6 +147,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 > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core >
-- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core