Re: [OE-core] [PATCH v4] rpm: make rpm work in toolchain.

2019-10-14 Thread Zheng, Ruoqin
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.f...@cn.fujistu.com


> -Original Message-
> From: openembedded-core-boun...@lists.openembedded.org
> [mailto:openembedded-core-boun...@lists.openembedded.org] On Behalf Of
> Zheng, Ruoqin
> Sent: Monday, October 07, 2019 8:27 AM
> To: Richard Purdie ; openembedded-
> c...@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.f...@cn.fujistu.com
> 
> 
> > -Original Message-
> > From: Richard Purdie [mailto:richard.pur...@linuxfoundation.org]
> > Sent: Wednesday, October 02, 2019 4:49 PM
> > To: Zheng, Ruoqin/郑 若钦 ; openembedded-
> > c...@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 
> > > ---
> > >  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 00..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-d

Re: [OE-core] [PATCH v4] rpm: make rpm work in toolchain.

2019-10-06 Thread Zheng, Ruoqin
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.f...@cn.fujistu.com


> -Original Message-
> From: Richard Purdie [mailto:richard.pur...@linuxfoundation.org]
> Sent: Wednesday, October 02, 2019 4:49 PM
> To: Zheng, Ruoqin/郑 若钦 ; openembedded-
> c...@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 
> > ---
> >  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 00..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 < > +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 < > +${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


Re: [OE-core] [PATCH v4] rpm: make rpm work in toolchain.

2019-10-02 Thread Richard Purdie
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 
> ---
>  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 00..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 < +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 < +${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


[OE-core] [PATCH v4] rpm: make rpm work in toolchain.

2019-09-24 Thread Zheng Ruoqin
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 
---
 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 00..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 <${D}/${datadir}/rpm/platform