All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4] rpm: make rpm work in toolchain.
@ 2019-09-24 23:45 Zheng Ruoqin
  2019-09-25  0:02 ` ✗ patchtest: failure for rpm: make rpm work in toolchain. (rev4) Patchwork
  2019-10-02  8:48 ` [PATCH v4] rpm: make rpm work in toolchain Richard Purdie
  0 siblings, 2 replies; 7+ messages in thread
From: Zheng Ruoqin @ 2019-09-24 23:45 UTC (permalink / raw)
  To: openembedded-core

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@cn.fujitsu.com>
---
 meta/recipes-devtools/rpm/files/rpm-setup.py | 27 ++++++++++++++++++++
 meta/recipes-devtools/rpm/rpm_4.14.2.1.bb    | 19 ++++++++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 meta/recipes-devtools/rpm/files/rpm-setup.py

diff --git a/meta/recipes-devtools/rpm/files/rpm-setup.py b/meta/recipes-devtools/rpm/files/rpm-setup.py
new file mode 100644
index 0000000000..b3e8a1198c
--- /dev/null
+++ b/meta/recipes-devtools/rpm/files/rpm-setup.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+import shutil
+
+try:
+    native_sysroot = os.environ['OECORE_NATIVE_SYSROOT']
+    sdktarget_sysroot = os.environ['SDKTARGETSYSROOT']
+except KeyError:
+    print("Not in environment setup, bailing")
+    sys.exit(1)
+
+target_etc_dir = os.path.join(sdktarget_sysroot, 'etc/rpm')
+
+if not os.path.exists(target_etc_dir):
+    os.makedirs(target_etc_dir)
+
+template_file = os.path.join(native_sysroot, 'usr/share/rpm/rpmrc')
+cross_file = os.path.join(sdktarget_sysroot, 'etc/rpmrc')
+shutil.copy(template_file, cross_file)
+
+template_file = os.path.join(native_sysroot, 'usr/share/rpm/platform')
+cross_file = os.path.join(sdktarget_sysroot, 'etc/rpm/platform')
+shutil.copy(template_file, cross_file)
+
+
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 c37330eb4c..e1d1951d74 100644
--- a/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
+++ b/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
@@ -44,6 +44,9 @@ SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.14.x \
            file://0001-mono-find-provides-requires-do-not-use-monodis-from-.patch \
            "
 
+SRC_URI_append_class-nativesdk = "file://rpm-setup.py \
+                                 "
+
 PE = "1"
 SRCREV = "4a9440006398646583f0d9ae1837dad2875013aa"
 
@@ -113,6 +116,20 @@ do_install_append_class-nativesdk() {
         done
 
         rm -rf ${D}/var
+        install -d ${D}${datadir}/rpm
+
+        cat >${D}/${datadir}/rpm/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}${datadir}/rpm/rpmrc
+        cat >${D}/${datadir}/rpm/platform <<EOF
+${MACHINE_ARCH}-pc-linux
+EOF
+
+        install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d
+        install -m 0755 ${WORKDIR}/rpm-setup.py ${D}${SDKPATHNATIVE}/post-relocate-setup.d/
 }
 
 # Rpm's make install creates var/tmp which clashes with base-files packaging
@@ -134,6 +151,8 @@ FILES_${PN} += "${libdir}/rpm-plugins/*.so \
 
 FILES_${PN}-dev += "${libdir}/rpm-plugins/*.la \
                     "
+FILES_${PN}_append_class-nativesdk += "${SDKPATHNATIVE}/post-relocate-setup.d"
+
 
 PACKAGES += "python3-rpm"
 PROVIDES += "python3-rpm"
-- 
2.17.1





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* ✗ patchtest: failure for rpm: make rpm work in toolchain. (rev4)
  2019-09-24 23:45 [PATCH v4] rpm: make rpm work in toolchain Zheng Ruoqin
@ 2019-09-25  0:02 ` Patchwork
  2019-09-26  9:31   ` Zheng, Ruoqin
  2019-10-02  8:48 ` [PATCH v4] rpm: make rpm work in toolchain Richard Purdie
  1 sibling, 1 reply; 7+ messages in thread
From: Patchwork @ 2019-09-25  0:02 UTC (permalink / raw)
  To: Zheng Ruoqin; +Cc: openembedded-core

== Series Details ==

Series: rpm: make rpm work in toolchain. (rev4)
Revision: 4
URL   : https://patchwork.openembedded.org/series/19789/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Errors in your Python code were encountered [test_pylint] 
  Suggested fix    Correct the lines introduced by your patch
  Output           Please, fix the listed issues:
                   meta/recipes-devtools/rpm/files/rpm-setup.py does not exist



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ✗ patchtest: failure for rpm: make rpm work in toolchain. (rev4)
  2019-09-25  0:02 ` ✗ patchtest: failure for rpm: make rpm work in toolchain. (rev4) Patchwork
@ 2019-09-26  9:31   ` Zheng, Ruoqin
  2019-10-01 23:44     ` Zheng, Ruoqin
  0 siblings, 1 reply; 7+ messages in thread
From: Zheng, Ruoqin @ 2019-09-26  9:31 UTC (permalink / raw)
  To: openembedded-core

Hi

I found meta/recipes-devtools/rpm/files/rpm-setup.py is in my patch.

But the automated test results have an error message as follows:

  Output           Please, fix the listed issues:
                   meta/recipes-devtools/rpm/files/rpm-setup.py does not exist

Does anyone have any suggestion?

--------------------------------------------------
Zheng Ruoqin
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
ADDR.: No.6 Wenzhu Road, Software Avenue,
       Nanjing, 210012, China
MAIL : zhengrq.fnst@cn.fujistu.com

> -----Original Message-----
> From: Patchwork [mailto:patchwork@patchwork.openembedded.org]
> Sent: Wednesday, September 25, 2019 8:02 AM
> To: Zheng, Ruoqin/郑 若钦 <zhengrq.fnst@cn.fujitsu.com>
> Cc: openembedded-core@lists.openembedded.org
> Subject: ✗ patchtest: failure for rpm: make rpm work in toolchain. (rev4)
> 
> == Series Details ==
> 
> Series: rpm: make rpm work in toolchain. (rev4)
> Revision: 4
> URL   : https://patchwork.openembedded.org/series/19789/
> State : failure
> 
> == Summary ==
> 
> 
> Thank you for submitting this patch series to OpenEmbedded Core. This is an
> automated response. Several tests have been executed on the proposed series
> by patchtest resulting in the following failures:
> 
> 
> 
> * Issue             Errors in your Python code were encountered [test_pylint]
>   Suggested fix    Correct the lines introduced by your patch
>   Output           Please, fix the listed issues:
>                    meta/recipes-devtools/rpm/files/rpm-setup.py does not exist
> 
> 
> 
> If you believe any of these test results are incorrect, please reply to the mailing
> list (openembedded-core@lists.openembedded.org) raising your concerns.
> Otherwise we would appreciate you correcting the issues and submitting a new
> version of the patchset if applicable. Please ensure you add/increment the
> version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
> [PATCH v3] -> ...).
> 
> ---
> Guidelines:
> https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
> Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
> Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
> 
> 




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ✗ patchtest: failure for rpm: make rpm work in toolchain. (rev4)
  2019-09-26  9:31   ` Zheng, Ruoqin
@ 2019-10-01 23:44     ` Zheng, Ruoqin
  0 siblings, 0 replies; 7+ messages in thread
From: Zheng, Ruoqin @ 2019-10-01 23:44 UTC (permalink / raw)
  To: openembedded-core

ping

--------------------------------------------------
Zheng Ruoqin
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
ADDR.: No.6 Wenzhu Road, Software Avenue,
       Nanjing, 210012, China
MAIL : zhengrq.fnst@cn.fujistu.com


> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> Zheng, Ruoqin
> Sent: Thursday, September 26, 2019 5:31 PM
> To: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] ✗ patchtest: failure for rpm: make rpm work in toolchain.
> (rev4)
> 
> Hi
> 
> I found meta/recipes-devtools/rpm/files/rpm-setup.py is in my patch.
> 
> But the automated test results have an error message as follows:
> 
>   Output           Please, fix the listed issues:
>                    meta/recipes-devtools/rpm/files/rpm-setup.py does not exist
> 
> Does anyone have any suggestion?
> 
> --------------------------------------------------
> Zheng Ruoqin
> Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
> ADDR.: No.6 Wenzhu Road, Software Avenue,
>        Nanjing, 210012, China
> MAIL : zhengrq.fnst@cn.fujistu.com
> 
> > -----Original Message-----
> > From: Patchwork [mailto:patchwork@patchwork.openembedded.org]
> > Sent: Wednesday, September 25, 2019 8:02 AM
> > To: Zheng, Ruoqin/郑 若钦 <zhengrq.fnst@cn.fujitsu.com>
> > Cc: openembedded-core@lists.openembedded.org
> > Subject: ✗ patchtest: failure for rpm: make rpm work in toolchain.
> > (rev4)
> >
> > == Series Details ==
> >
> > Series: rpm: make rpm work in toolchain. (rev4)
> > Revision: 4
> > URL   : https://patchwork.openembedded.org/series/19789/
> > State : failure
> >
> > == Summary ==
> >
> >
> > Thank you for submitting this patch series to OpenEmbedded Core. This
> > is an automated response. Several tests have been executed on the
> > proposed series by patchtest resulting in the following failures:
> >
> >
> >
> > * Issue             Errors in your Python code were encountered [test_pylint]
> >   Suggested fix    Correct the lines introduced by your patch
> >   Output           Please, fix the listed issues:
> >                    meta/recipes-devtools/rpm/files/rpm-setup.py does
> > not exist
> >
> >
> >
> > If you believe any of these test results are incorrect, please reply
> > to the mailing list (openembedded-core@lists.openembedded.org) raising your
> concerns.
> > Otherwise we would appreciate you correcting the issues and submitting
> > a new version of the patchset if applicable. Please ensure you
> > add/increment the version number when sending the new version (i.e.
> > [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...).
> >
> > ---
> > Guidelines:
> > https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
> > Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
> > Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
> >
> >
> 
> 
> 
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v4] rpm: make rpm work in toolchain.
  2019-09-24 23:45 [PATCH v4] rpm: make rpm work in toolchain Zheng Ruoqin
  2019-09-25  0:02 ` ✗ patchtest: failure for rpm: make rpm work in toolchain. (rev4) Patchwork
@ 2019-10-02  8:48 ` Richard Purdie
  2019-10-07  0:27   ` Zheng, Ruoqin
  1 sibling, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2019-10-02  8:48 UTC (permalink / raw)
  To: Zheng Ruoqin, openembedded-core

On Wed, 2019-09-25 at 07:45 +0800, Zheng Ruoqin 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.fnst@cn.fujitsu.com>
> ---
>  meta/recipes-devtools/rpm/files/rpm-setup.py | 27
> ++++++++++++++++++++
>  meta/recipes-devtools/rpm/rpm_4.14.2.1.bb    | 19 ++++++++++++++
>  2 files changed, 46 insertions(+)
>  create mode 100644 meta/recipes-devtools/rpm/files/rpm-setup.py
> 
> diff --git a/meta/recipes-devtools/rpm/files/rpm-setup.py
> b/meta/recipes-devtools/rpm/files/rpm-setup.py
> new file mode 100644
> index 0000000000..b3e8a1198c
> --- /dev/null
> +++ b/meta/recipes-devtools/rpm/files/rpm-setup.py
> @@ -0,0 +1,27 @@
> +#!/usr/bin/env python3
> +
> +import os
> +import sys
> +import shutil
> +
> +try:
> +    native_sysroot = os.environ['OECORE_NATIVE_SYSROOT']
> +    sdktarget_sysroot = os.environ['SDKTARGETSYSROOT']
> +except KeyError:
> +    print("Not in environment setup, bailing")
> +    sys.exit(1)
> +
> +target_etc_dir = os.path.join(sdktarget_sysroot, 'etc/rpm')
> +
> +if not os.path.exists(target_etc_dir):
> +    os.makedirs(target_etc_dir)
> +
> +template_file = os.path.join(native_sysroot, 'usr/share/rpm/rpmrc')
> +cross_file = os.path.join(sdktarget_sysroot, 'etc/rpmrc')
> +shutil.copy(template_file, cross_file)
> +
> +template_file = os.path.join(native_sysroot,
> 'usr/share/rpm/platform')
> +cross_file = os.path.join(sdktarget_sysroot, 'etc/rpm/platform')
> +shutil.copy(template_file, cross_file)
> +
> +
> 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 c37330eb4c..e1d1951d74 100644
> --- a/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
> +++ b/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
> @@ -44,6 +44,9 @@ SRC_URI = "git://github.com/rpm-software-
> management/rpm;branch=rpm-4.14.x \
>             file://0001-mono-find-provides-requires-do-not-use-
> monodis-from-.patch \
>             "
>  
> +SRC_URI_append_class-nativesdk = "file://rpm-setup.py \
> +                                 "
> +
>  PE = "1"
>  SRCREV = "4a9440006398646583f0d9ae1837dad2875013aa"
>  
> @@ -113,6 +116,20 @@ do_install_append_class-nativesdk() {
>          done
>  
>          rm -rf ${D}/var
> +        install -d ${D}${datadir}/rpm
> +
> +        cat >${D}/${datadir}/rpm/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}${datadir}/rpm/rpmrc
> +        cat >${D}/${datadir}/rpm/platform <<EOF
> +${MACHINE_ARCH}-pc-linux
> +EOF

This is heading in the right direction but this patch still makes the
nativesdk-rpm recipe machine specific and we can't do that.

Cheers,

Richard





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v4] rpm: make rpm work in toolchain.
  2019-10-02  8:48 ` [PATCH v4] rpm: make rpm work in toolchain Richard Purdie
@ 2019-10-07  0:27   ` Zheng, Ruoqin
  2019-10-15  0:03     ` Zheng, Ruoqin
  0 siblings, 1 reply; 7+ messages in thread
From: Zheng, Ruoqin @ 2019-10-07  0:27 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core

Hi Richard
> 
> This is heading in the right direction but this patch still makes the nativesdk-rpm
> recipe machine specific and we can't do that.
>

In this patch, config file is same as v3 patch, and v3 patch has been accepted, but why this  time is " makes the nativesdk-rpm recipe machine specific ".

The config file is processed by script in post-relocate-setup.d/ the same as that in  nativesdk-meson.

--------------------------------------------------
Zheng Ruoqin
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
ADDR.: No.6 Wenzhu Road, Software Avenue,
       Nanjing, 210012, China
MAIL : zhengrq.fnst@cn.fujistu.com


> -----Original Message-----
> From: Richard Purdie [mailto:richard.purdie@linuxfoundation.org]
> Sent: Wednesday, October 02, 2019 4:49 PM
> To: Zheng, Ruoqin/郑 若钦 <zhengrq.fnst@cn.fujitsu.com>; openembedded-
> core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH v4] rpm: make rpm work in toolchain.
> 
> On Wed, 2019-09-25 at 07:45 +0800, Zheng Ruoqin 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.fnst@cn.fujitsu.com>
> > ---
> >  meta/recipes-devtools/rpm/files/rpm-setup.py | 27
> > ++++++++++++++++++++
> >  meta/recipes-devtools/rpm/rpm_4.14.2.1.bb    | 19 ++++++++++++++
> >  2 files changed, 46 insertions(+)
> >  create mode 100644 meta/recipes-devtools/rpm/files/rpm-setup.py
> >
> > diff --git a/meta/recipes-devtools/rpm/files/rpm-setup.py
> > b/meta/recipes-devtools/rpm/files/rpm-setup.py
> > new file mode 100644
> > index 0000000000..b3e8a1198c
> > --- /dev/null
> > +++ b/meta/recipes-devtools/rpm/files/rpm-setup.py
> > @@ -0,0 +1,27 @@
> > +#!/usr/bin/env python3
> > +
> > +import os
> > +import sys
> > +import shutil
> > +
> > +try:
> > +    native_sysroot = os.environ['OECORE_NATIVE_SYSROOT']
> > +    sdktarget_sysroot = os.environ['SDKTARGETSYSROOT'] except
> > +KeyError:
> > +    print("Not in environment setup, bailing")
> > +    sys.exit(1)
> > +
> > +target_etc_dir = os.path.join(sdktarget_sysroot, 'etc/rpm')
> > +
> > +if not os.path.exists(target_etc_dir):
> > +    os.makedirs(target_etc_dir)
> > +
> > +template_file = os.path.join(native_sysroot, 'usr/share/rpm/rpmrc')
> > +cross_file = os.path.join(sdktarget_sysroot, 'etc/rpmrc')
> > +shutil.copy(template_file, cross_file)
> > +
> > +template_file = os.path.join(native_sysroot,
> > 'usr/share/rpm/platform')
> > +cross_file = os.path.join(sdktarget_sysroot, 'etc/rpm/platform')
> > +shutil.copy(template_file, cross_file)
> > +
> > +
> > 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 c37330eb4c..e1d1951d74 100644
> > --- a/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
> > +++ b/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
> > @@ -44,6 +44,9 @@ SRC_URI = "git://github.com/rpm-software-
> > management/rpm;branch=rpm-4.14.x \
> >             file://0001-mono-find-provides-requires-do-not-use-
> > monodis-from-.patch \
> >             "
> >
> > +SRC_URI_append_class-nativesdk = "file://rpm-setup.py \
> > +                                 "
> > +
> >  PE = "1"
> >  SRCREV = "4a9440006398646583f0d9ae1837dad2875013aa"
> >
> > @@ -113,6 +116,20 @@ do_install_append_class-nativesdk() {
> >          done
> >
> >          rm -rf ${D}/var
> > +        install -d ${D}${datadir}/rpm
> > +
> > +        cat >${D}/${datadir}/rpm/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}${datadir}/rpm/rpmrc
> > +        cat >${D}/${datadir}/rpm/platform <<EOF
> > +${MACHINE_ARCH}-pc-linux EOF
> 
> This is heading in the right direction but this patch still makes the nativesdk-rpm
> recipe machine specific and we can't do that.
> 
> Cheers,
> 
> Richard
> 
> 
> 
> 




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v4] rpm: make rpm work in toolchain.
  2019-10-07  0:27   ` Zheng, Ruoqin
@ 2019-10-15  0:03     ` Zheng, Ruoqin
  0 siblings, 0 replies; 7+ messages in thread
From: Zheng, Ruoqin @ 2019-10-15  0:03 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core

Hi Richard
> 
> This is heading in the right direction but this patch still makes the 
> nativesdk-rpm recipe machine specific and we can't do that.
>

If machine specific is not allowed,  when user want to use rpm in nativesdk environment, how should we get the corresponding  arch info?
Do you have any suggestion about it?

--
--------------------------------------------------
Zheng Ruoqin
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
ADDR.: No.6 Wenzhu Road, Software Avenue,
       Nanjing, 210012, China
MAIL : zhengrq.fnst@cn.fujistu.com


> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> Zheng, Ruoqin
> Sent: Monday, October 07, 2019 8:27 AM
> To: Richard Purdie <richard.purdie@linuxfoundation.org>; openembedded-
> core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH v4] rpm: make rpm work in toolchain.
> 
> Hi Richard
> >
> > This is heading in the right direction but this patch still makes the
> > nativesdk-rpm recipe machine specific and we can't do that.
> >
> 
> In this patch, config file is same as v3 patch, and v3 patch has been accepted, but
> why this  time is " makes the nativesdk-rpm recipe machine specific ".
> 
> The config file is processed by script in post-relocate-setup.d/ the same as that in
> nativesdk-meson.
> 
> --------------------------------------------------
> Zheng Ruoqin
> Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
> ADDR.: No.6 Wenzhu Road, Software Avenue,
>        Nanjing, 210012, China
> MAIL : zhengrq.fnst@cn.fujistu.com
> 
> 
> > -----Original Message-----
> > From: Richard Purdie [mailto:richard.purdie@linuxfoundation.org]
> > Sent: Wednesday, October 02, 2019 4:49 PM
> > To: Zheng, Ruoqin/郑 若钦 <zhengrq.fnst@cn.fujitsu.com>; openembedded-
> > core@lists.openembedded.org
> > Subject: Re: [OE-core] [PATCH v4] rpm: make rpm work in toolchain.
> >
> > On Wed, 2019-09-25 at 07:45 +0800, Zheng Ruoqin 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.fnst@cn.fujitsu.com>
> > > ---
> > >  meta/recipes-devtools/rpm/files/rpm-setup.py | 27
> > > ++++++++++++++++++++
> > >  meta/recipes-devtools/rpm/rpm_4.14.2.1.bb    | 19 ++++++++++++++
> > >  2 files changed, 46 insertions(+)
> > >  create mode 100644 meta/recipes-devtools/rpm/files/rpm-setup.py
> > >
> > > diff --git a/meta/recipes-devtools/rpm/files/rpm-setup.py
> > > b/meta/recipes-devtools/rpm/files/rpm-setup.py
> > > new file mode 100644
> > > index 0000000000..b3e8a1198c
> > > --- /dev/null
> > > +++ b/meta/recipes-devtools/rpm/files/rpm-setup.py
> > > @@ -0,0 +1,27 @@
> > > +#!/usr/bin/env python3
> > > +
> > > +import os
> > > +import sys
> > > +import shutil
> > > +
> > > +try:
> > > +    native_sysroot = os.environ['OECORE_NATIVE_SYSROOT']
> > > +    sdktarget_sysroot = os.environ['SDKTARGETSYSROOT'] except
> > > +KeyError:
> > > +    print("Not in environment setup, bailing")
> > > +    sys.exit(1)
> > > +
> > > +target_etc_dir = os.path.join(sdktarget_sysroot, 'etc/rpm')
> > > +
> > > +if not os.path.exists(target_etc_dir):
> > > +    os.makedirs(target_etc_dir)
> > > +
> > > +template_file = os.path.join(native_sysroot, 'usr/share/rpm/rpmrc')
> > > +cross_file = os.path.join(sdktarget_sysroot, 'etc/rpmrc')
> > > +shutil.copy(template_file, cross_file)
> > > +
> > > +template_file = os.path.join(native_sysroot,
> > > 'usr/share/rpm/platform')
> > > +cross_file = os.path.join(sdktarget_sysroot, 'etc/rpm/platform')
> > > +shutil.copy(template_file, cross_file)
> > > +
> > > +
> > > 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 c37330eb4c..e1d1951d74 100644
> > > --- a/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
> > > +++ b/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
> > > @@ -44,6 +44,9 @@ SRC_URI = "git://github.com/rpm-software-
> > > management/rpm;branch=rpm-4.14.x \
> > >             file://0001-mono-find-provides-requires-do-not-use-
> > > monodis-from-.patch \
> > >             "
> > >
> > > +SRC_URI_append_class-nativesdk = "file://rpm-setup.py \
> > > +                                 "
> > > +
> > >  PE = "1"
> > >  SRCREV = "4a9440006398646583f0d9ae1837dad2875013aa"
> > >
> > > @@ -113,6 +116,20 @@ do_install_append_class-nativesdk() {
> > >          done
> > >
> > >          rm -rf ${D}/var
> > > +        install -d ${D}${datadir}/rpm
> > > +
> > > +        cat >${D}/${datadir}/rpm/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}${datadir}/rpm/rpmrc
> > > +        cat >${D}/${datadir}/rpm/platform <<EOF
> > > +${MACHINE_ARCH}-pc-linux EOF
> >
> > This is heading in the right direction but this patch still makes the
> > nativesdk-rpm recipe machine specific and we can't do that.
> >
> > Cheers,
> >
> > Richard
> >
> >
> >
> >
> 
> 
> 
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-10-15  0:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-24 23:45 [PATCH v4] rpm: make rpm work in toolchain Zheng Ruoqin
2019-09-25  0:02 ` ✗ patchtest: failure for rpm: make rpm work in toolchain. (rev4) Patchwork
2019-09-26  9:31   ` Zheng, Ruoqin
2019-10-01 23:44     ` Zheng, Ruoqin
2019-10-02  8:48 ` [PATCH v4] rpm: make rpm work in toolchain Richard Purdie
2019-10-07  0:27   ` Zheng, Ruoqin
2019-10-15  0:03     ` Zheng, Ruoqin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.