* [PATCH] meta-environment: make rpm and dnf work in toolchain
@ 2019-09-02 1:14 Zheng Ruoqin
2019-09-02 8:12 ` Alexander Kanavin
0 siblings, 1 reply; 4+ messages in thread
From: Zheng Ruoqin @ 2019-09-02 1:14 UTC (permalink / raw)
To: openembedded-core
We need to configure dnf and rpm to use and make it compatible with package architecture from yocto build system.
Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com>
---
meta/recipes-core/meta/meta-environment.bb | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/meta/recipes-core/meta/meta-environment.bb b/meta/recipes-core/meta/meta-environment.bb
index da1230bead..3b25dcc8d0 100644
--- a/meta/recipes-core/meta/meta-environment.bb
+++ b/meta/recipes-core/meta/meta-environment.bb
@@ -62,6 +62,16 @@ create_sdk_files() {
do_install() {
install -d ${D}/${SDKPATH}
install -m 0644 -t ${D}/${SDKPATH} ${SDK_OUTPUT}/${SDKPATH}/*
+
+ mkdir -p ${D}/${SDKTARGETSYSROOT}/etc/rpm
+ echo "arch_compat: ${MACHINE_ARCH}: ${PACKAGE_ARCHS}" > ${D}/${SDKTARGETSYSROOT}/etc/rpmrc
+ sed -i 's/-nativesdk//g' ${D}/${SDKTARGETSYSROOT}/etc/rpmrc
+ sed -i 's/-/_/' ${D}/${SDKTARGETSYSROOT}/etc/rpmrc
+ echo "${MACHINE_ARCH}-pc-linux" > ${D}/${SDKTARGETSYSROOT}/etc/rpm/platform
+
+ mkdir -p ${D}/${SDKTARGETSYSROOT}/etc/dnf/vars
+ echo "${DEFAULTTUNE}:${MACHINE_ARCH}:${TARGET_ARCH}" > ${D}/${SDKTARGETSYSROOT}/etc/dnf/vars/arch
+ sed -i 's/-/_/' ${D}/${SDKTARGETSYSROOT}/etc/dnf/vars/arch
}
PN = "meta-environment-${MACHINE}"
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] meta-environment: make rpm and dnf work in toolchain
2019-09-02 1:14 [PATCH] meta-environment: make rpm and dnf work in toolchain Zheng Ruoqin
@ 2019-09-02 8:12 ` Alexander Kanavin
2019-09-04 1:43 ` Zheng, Ruoqin
0 siblings, 1 reply; 4+ messages in thread
From: Alexander Kanavin @ 2019-09-02 8:12 UTC (permalink / raw)
To: Zheng Ruoqin; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 1333 bytes --]
On Mon, 2 Sep 2019 at 03:16, Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com>
wrote:
> We need to configure dnf and rpm to use and make it compatible with
> package architecture from yocto build system.
> +
> + mkdir -p ${D}/${SDKTARGETSYSROOT}/etc/rpm
> + echo "arch_compat: ${MACHINE_ARCH}: ${PACKAGE_ARCHS}" >
> ${D}/${SDKTARGETSYSROOT}/etc/rpmrc
> + sed -i 's/-nativesdk//g' ${D}/${SDKTARGETSYSROOT}/etc/rpmrc
> + sed -i 's/-/_/' ${D}/${SDKTARGETSYSROOT}/etc/rpmrc
> + echo "${MACHINE_ARCH}-pc-linux" >
> ${D}/${SDKTARGETSYSROOT}/etc/rpm/platform
> +
> + mkdir -p ${D}/${SDKTARGETSYSROOT}/etc/dnf/vars
> + echo "${DEFAULTTUNE}:${MACHINE_ARCH}:${TARGET_ARCH}" >
> ${D}/${SDKTARGETSYSROOT}/etc/dnf/vars/arch
> + sed -i 's/-/_/' ${D}/${SDKTARGETSYSROOT}/etc/dnf/vars/arch
>
This does not seem like the right place to me to adjust the settings. I
think (not sure; never tried it) that the right technique is in the
nativesdk-meson recipe:
install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d
install -m 0755 ${WORKDIR}/meson-setup.py
${D}${SDKPATHNATIVE}/post-relocate-setup.d/
# We need to wrap the real meson with a thin env setup wrapper.
mv ${D}${bindir}/meson ${D}${bindir}/meson.real
install -m 0755 ${WORKDIR}/meson-wrapper ${D}${bindir}/meson
Alex
[-- Attachment #2: Type: text/html, Size: 1896 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] meta-environment: make rpm and dnf work in toolchain
2019-09-02 8:12 ` Alexander Kanavin
@ 2019-09-04 1:43 ` Zheng, Ruoqin
2019-09-04 10:14 ` Alexander Kanavin
0 siblings, 1 reply; 4+ messages in thread
From: Zheng, Ruoqin @ 2019-09-04 1:43 UTC (permalink / raw)
To: Alexander Kanavin; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 2050 bytes --]
Hi Alex
Thank you for your advice and I have a question.
1:-> This does not seem like the right place to me to adjust the settings.
Well, did you mean that I shouldn’t adjust the settings in meta-environment recipe, instead of it, adjust the settings in the nativesdk-meson recipe?
--------------------------------------------------
Zheng Ruoqin
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
From: Alexander Kanavin [mailto:alex.kanavin@gmail.com]
Sent: Monday, September 02, 2019 4:12 PM
To: Zheng, Ruoqin/郑 若钦 <zhengrq.fnst@cn.fujitsu.com>
Cc: OE-core <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [PATCH] meta-environment: make rpm and dnf work in toolchain
On Mon, 2 Sep 2019 at 03:16, Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com<mailto:zhengrq.fnst@cn.fujitsu.com>> wrote:
We need to configure dnf and rpm to use and make it compatible with package architecture from yocto build system.
+
+ mkdir -p ${D}/${SDKTARGETSYSROOT}/etc/rpm
+ echo "arch_compat: ${MACHINE_ARCH}: ${PACKAGE_ARCHS}" > ${D}/${SDKTARGETSYSROOT}/etc/rpmrc
+ sed -i 's/-nativesdk//g' ${D}/${SDKTARGETSYSROOT}/etc/rpmrc
+ sed -i 's/-/_/' ${D}/${SDKTARGETSYSROOT}/etc/rpmrc
+ echo "${MACHINE_ARCH}-pc-linux" > ${D}/${SDKTARGETSYSROOT}/etc/rpm/platform
+
+ mkdir -p ${D}/${SDKTARGETSYSROOT}/etc/dnf/vars
+ echo "${DEFAULTTUNE}:${MACHINE_ARCH}:${TARGET_ARCH}" > ${D}/${SDKTARGETSYSROOT}/etc/dnf/vars/arch
+ sed -i 's/-/_/' ${D}/${SDKTARGETSYSROOT}/etc/dnf/vars/arch
This does not seem like the right place to me to adjust the settings. I think (not sure; never tried it) that the right technique is in the nativesdk-meson recipe:
install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d
install -m 0755 ${WORKDIR}/meson-setup.py ${D}${SDKPATHNATIVE}/post-relocate-setup.d/
# We need to wrap the real meson with a thin env setup wrapper.
mv ${D}${bindir}/meson ${D}${bindir}/meson.real
install -m 0755 ${WORKDIR}/meson-wrapper ${D}${bindir}/meson
Alex
[-- Attachment #2: Type: text/html, Size: 7077 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] meta-environment: make rpm and dnf work in toolchain
2019-09-04 1:43 ` Zheng, Ruoqin
@ 2019-09-04 10:14 ` Alexander Kanavin
0 siblings, 0 replies; 4+ messages in thread
From: Alexander Kanavin @ 2019-09-04 10:14 UTC (permalink / raw)
To: Zheng, Ruoqin; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 707 bytes --]
On Wed, 4 Sep 2019 at 03:44, Zheng, Ruoqin <zhengrq.fnst@cn.fujitsu.com>
wrote:
> Thank you for your advice and I have a question.
>
>
>
> 1:-> This does not seem like the right place to me to adjust the settings.
>
>
>
> Well, did you mean that I shouldn’t adjust the settings in
> meta-environment recipe, instead of it, adjust the settings in the
> nativesdk-meson recipe?
>
What I mean is that you take nativesdk-meson recipe as an example of how to
do special configuration for nativesdk, and do similar adjustments to
dnf/rpm recipes. Specifically, the wrapper can set up environment
variables, and the script in post-relocate-setup.d/ can write
configuration files.
Alex
[-- Attachment #2: Type: text/html, Size: 1643 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-09-04 10:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-02 1:14 [PATCH] meta-environment: make rpm and dnf work in toolchain Zheng Ruoqin
2019-09-02 8:12 ` Alexander Kanavin
2019-09-04 1:43 ` Zheng, Ruoqin
2019-09-04 10:14 ` Alexander Kanavin
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.