Hi Alex ->You probably need to use the post-relocate-setup.d/ facility, like the nativesdk-meson recipe does. I am not sure if ->PACKAGE_ARCHS is accessible from it, but it does seem like the right mechanism for tweaking settings that are ->specific to nativesdk packages.
1. About ${PACKAGE_ARCHS} Well, for nativesdk packages ${PACKAGE_ARCHS} is accessible from nativesdk.bbclass, and it equals PACKAGE_ARCHS = "${SDK_PACKAGE_ARCHS}" SDK_PACKAGE_ARCHS = "all any noarch ${SDK_ARCH}-${SDKPKGSUFFIX}" Which will not be changed for different ARCH. While target packages ${PACKAGE_ARCHS} is accessible from base.bbclass, and the value is suitable for different ARCH. 2. About post-relocate-setup.d And usually, tweaking settings are specific to nativesdk packages. But Even if I use the post-relocate-setup.d/ facility, as the value of ${MACHINE_ARCH} is not provided in SDK, so it will not work for target packages. To skip it, I have to write arch info in config file explicitly for different target ARCH as only meta-environment has a similar implementation. 3. Actually, my first plan is to write ${MACHINE_ARCH} in toolchain, but it was rejected +++ b/meta/classes/toolchain-scripts.bbclass @@ -101,6 +101,7 @@ toolchain_shared_env_script () { echo 'export CPPFLAGS="${TARGET_CPPFLAGS}"' >> $script echo 'export KCFLAGS="--sysroot=$SDKTARGETSYSROOT"' >> $script echo 'export OECORE_DISTRO_VERSION="${DISTRO_VERSION}"' >> $script + echo 'export MACHINE_ARCH=${MACHINE_ARCH}' >> $script echo 'export OECORE_SDK_VERSION="${SDK_VERSION}"' >> $script I guess if it can work, maybe post-relocate-setup.d/ facility will be usefull. -------------------------------------------------- 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 From: Alexander Kanavin [mailto:alex.kana...@gmail.com] Sent: Tuesday, September 10, 2019 6:53 PM To: Zheng, Ruoqin/郑 若钦 <zhengrq.f...@cn.fujitsu.com> Cc: OE-core <openembedded-core@lists.openembedded.org> Subject: Re: [OE-core] [PATCH] rpm: make rpm work in toolchain. On Tue, 10 Sep 2019 at 10:07, Zheng, Ruoqin <zhengrq.f...@cn.fujitsu.com<mailto:zhengrq.f...@cn.fujitsu.com>> wrote: In last patch, I put the config file in meta-environment as its do_install task is in the target environment which means the value of ${PACKAGE_ARCHS} is right. And it finally produce a nativesdk package. If I put the config file in nativesdk-rpm, the value of ${PACKAGE_ARCHS} will always be “all any noarch x86_64-nativesdk” which is not suitable for x86, arm and other ARCHS. So I’d like to put config file in the rpm of meta-environment. Did you have any good Suggestions? You probably need to use the post-relocate-setup.d/ facility, like the nativesdk-meson recipe does. I am not sure if PACKAGE_ARCHS is accessible from it, but it does seem like the right mechanism for tweaking settings that are specific to nativesdk packages. Alex
-- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core