2023. 07. 24. 17:59 keltezéssel, Richard Purdie írta:
On Mon, 2023-07-24 at 14:35 +0200, Zoltan Boszormenyi wrote:
Some BSP architecture builds (e.g. genericx86-64 or anything from
meta-intel) don't have their /usr/lib/rpm/platform/<arch>-linux
directories. This causes rpmbuild fail on the target machine.

Use ${SDK_ARCH}-linux as the base arch which likely exists in
/usr/lib/rpm/platform and clone it as ${MACHINE_ARCH}-linux.

Also, fix %_lib and %_libdir in the new cloned platform directory
to use ${baselib} and ${libdir} so the RPM package contents will
be correct for library packages.

Signed-off-by: Zoltán Böszörményi <zbos...@gmail.com>
---
  meta/recipes-devtools/rpm/rpm_4.18.1.bb | 13 +++++++++++++
  1 file changed, 13 insertions(+)

diff --git a/meta/recipes-devtools/rpm/rpm_4.18.1.bb 
b/meta/recipes-devtools/rpm/rpm_4.18.1.bb
index 95a9e92f96..21f0127561 100644
--- a/meta/recipes-devtools/rpm/rpm_4.18.1.bb
+++ b/meta/recipes-devtools/rpm/rpm_4.18.1.bb
@@ -131,7 +131,20 @@ do_install:append:class-nativesdk() {
  # Rpm's make install creates var/tmp which clashes with base-files packaging
  do_install:append:class-target() {
      rm -rf ${D}/var
+
+    if [ -d "${D}${prefix}/lib/rpm/platform/${SDK_ARCH}-linux" ]; then
+        if [ ! -d ${D}${prefix}/lib/rpm/platform/${MACHINE_ARCH}-linux ]; then
+            cp -r ${D}${prefix}/lib/rpm/platform/${SDK_ARCH}-linux 
${D}${prefix}/lib/rpm/platform/${MACHINE_ARCH}-linux
+        fi
+    fi

SDK_ARCH should not be referenced outside of nativesdk recipes. This
reference is almost certainly incorrect as it would make the target
recipe dependent on the value of SDKMACHINE.

Please advise what setting should be used instead.

MACHINE_ARCH is what ends up in /etc/rpm/platform.
TARGET_ARCH is not available in Honister but SDK_ARCH is.

Suggest a common setting that can be used in both older and
newer Yocto versions that has the base arch name and is
usable for target builds.

Thanks.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#184803): 
https://lists.openembedded.org/g/openembedded-core/message/184803
Mute This Topic: https://lists.openembedded.org/mt/100328070/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to