Skip to contentSkip to conversation

rpm: Install and/or tweak rpm macros file to make rpmbuild work

PATCH In review Zoltán Böszörményi 3 participants 16 messages Jul 24, 2023 – Jul 25, 2023 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rpm: Install and/or tweak rpm macros file to make rpmbuild work

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.

---
 meta/recipes-devtools/rpm/rpm_4.18.1.bb | 13 +++++++++++++
 1 file changed, 13 insertions(+)
meta/recipes-devtools/rpm/rpm_4.18.1.bb +13 -0
index 95a9e92f96..21f0127561 100644
@@ -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
+    if [ -d ${D}${prefix}/lib/rpm/platform/${MACHINE_ARCH}-linux ]; then
+        sed -i \
+            -e "s:^%_lib\t.*$:%_lib\t${baselib}:" \
+            -e "s:^%_libdir\t.*$:%_libdir\t${libdir}:" \
+            ${D}${prefix}/lib/rpm/platform/${MACHINE_ARCH}-linux/macros
+    fi
 }
+
 do_install:append:class-nativesdk() {
     rm -rf ${D}${SDKPATHNATIVE}/var
     # Ensure find-debuginfo is located correctly inside SDK
Signature · 1 line
2.41.0
#1 lore raw

meta/recipes-devtools/rpm/rpm_4.18.1.bb do_install:append:class-nativesdk() { · line 144

Quoted 4 lines · Zoltan Boszormenyi
meta/recipes-devtools/rpm/rpm_4.18.1.bb +4 -0
+        sed -i \
+            -e "s:^%_lib\t.*$:%_lib\t${baselib}:" \
+            -e "s:^%_libdir\t.*$:%_libdir\t${libdir}:" \
+            ${D}${prefix}/lib/rpm/platform/${MACHINE_ARCH}-linux/macros

Can this be refactored to avoid sed please? This is both difficult or impossible to understand, and is prone to silent regressions.

Alex

#2 lore raw
Quoted 7 lines · Alexander Kanavin

meta/recipes-devtools/rpm/rpm_4.18.1.bb do_install:append:class-nativesdk() { · line 144

Quoted 4 lines
meta/recipes-devtools/rpm/rpm_4.18.1.bb +4 -0
+        sed -i \
+            -e "s:^%_lib\t.*$:%_lib\t${baselib}:" \
+            -e "s:^%_libdir\t.*$:%_libdir\t${libdir}:" \
+            ${D}${prefix}/lib/rpm/platform/${MACHINE_ARCH}-linux/macros

Can this be refactored to avoid sed please? This is both difficult or impossible to understand, and is prone to silent regressions.

What I mean is, can the file be generated in the first place with the correct values?

Alex

#3 lore raw

2023. 07. 24. 16:03 keltezéssel, Alexander Kanavin írta:

Quoted 9 lines · Alexander Kanavin
Quoted 6 lines

meta/recipes-devtools/rpm/rpm_4.18.1.bb do_install:append:class-nativesdk() { · line 144

Quoted 4 lines
meta/recipes-devtools/rpm/rpm_4.18.1.bb +4 -0
+        sed -i \
+            -e "s:^%_lib\t.*$:%_lib\t${baselib}:" \
+            -e "s:^%_libdir\t.*$:%_libdir\t${libdir}:" \
+            ${D}${prefix}/lib/rpm/platform/${MACHINE_ARCH}-linux/macros

Can this be refactored to avoid sed please? This is both difficult or impossible to understand, and is prone to silent regressions.

What I mean is, can the file be generated in the first place with the correct values?

I'll rework it using a template file.
Still, sed would be used, but in a more readable fashion.

Will this work for you?

#4 lore raw
Quoted 4 lines · Böszörményi Zoltán

I'll rework it using a template file.
Still, sed would be used, but in a more readable fashion.

Will this work for you?

What would be preferred is a patch to the source code, and if we can submit it upstream, that'd be even better.

Alex

#5 lore raw

2023. 07. 24. 17:20 keltezéssel, Alexander Kanavin írta:

Quoted 7 lines · Böszörményi Zoltán
Quoted 4 lines

I'll rework it using a template file.
Still, sed would be used, but in a more readable fashion.

Will this work for you?

What would be preferred is a patch to the source code, and if we can submit it upstream, that'd be even better.

I have a working recipe change based on
https://github.com/rpm-software-management/rpm/pull/2579 (for 4.18.x)
https://github.com/rpm-software-management/rpm/pull/2580 (for 4.19.x)

I will send it soon.

#7 lore raw

2023. 07. 25. 12:30 keltezéssel, Alexander Kanavin írta:

Quoted 8 lines · Böszörményi Zoltán
Quoted 5 lines

I have a working recipe change based on
https://github.com/rpm-software-management/rpm/pull/2579 (for 4.18.x)
https://github.com/rpm-software-management/rpm/pull/2580 (for 4.19.x)

I will send it soon.

I'd want to see what rpm upstream says. Maybe we're doing the whole platform macro thing wrongly.

Hm. Maybe using the BSP name as the platform name is the problem.

FWIW, on Fedora, there is no /etc/rpm/platform and binary packages simply use .x86_64.rpm or .i686.rpm suffixes.

Apparently, rpmbuild can deduce the platform without help. After removing /etc/rpm/platform, rpmbuild will generate an .x86_64.rpm for me.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw

2023. 07. 25. 12:42 keltezéssel, Zoltan Boszormenyi via lists.openembedded.org írta:

Quoted 11 lines

2023. 07. 25. 12:30 keltezéssel, Alexander Kanavin írta:

Quoted 8 lines · Böszörményi Zoltán
Quoted 5 lines

I have a working recipe change based on
https://github.com/rpm-software-management/rpm/pull/2579 (for 4.18.x)
https://github.com/rpm-software-management/rpm/pull/2580 (for 4.19.x)

I will send it soon.

I'd want to see what rpm upstream says. Maybe we're doing the whole platform macro thing wrongly.

Hm. Maybe using the BSP name as the platform name is the problem.

Maybe it's not that much of a problem.
As far as I can see, kernel packages and a few others are built using ${MACHINE_ARCH}.rpm and are put into different subdirectories in a package repository. If everything was built using ${TARGET_ARCH}.rpm, different BSPs that require different kernels but otherwise use identical packages wouldn't be able to use a common repositories.

If the project intends to keep this feature, then something like the patch I posted on github is needed.

Quoted 6 lines

FWIW, on Fedora, there is no /etc/rpm/platform and binary packages simply use .x86_64.rpm or .i686.rpm suffixes.

Apparently, rpmbuild can deduce the platform without help. After removing /etc/rpm/platform, rpmbuild will generate an .x86_64.rpm for me.

And this won't allow building a BSP specific kernel package in the sense that the package would be installable on a different BSP

With the patch I posted on github, any package built on a specific machine will use the BSP specific file name suffix and maybe it won't be installable on a compatible TARGET_ARCH machine.

Catch-22?

#10 lore raw
In reply to Alexander Kanavin

2023. 07. 25. 12:30 keltezéssel, Alexander Kanavin írta:

Quoted 8 lines · Böszörményi Zoltán
Quoted 5 lines

I have a working recipe change based on
https://github.com/rpm-software-management/rpm/pull/2579 (for 4.18.x)
https://github.com/rpm-software-management/rpm/pull/2580 (for 4.19.x)

I will send it soon.

I'd want to see what rpm upstream says. Maybe we're doing the whole platform macro thing wrongly.

I sent the recipe change so you can see the complete picture. FWIW, I was able to build a complete image using this (no problems during do_rootfs or anywhere), and rpmbuild works out of the box on the target system.

#11 lore raw
In reply to Zoltán Böszörményi
Quoted 21 lines · Zoltan Boszormenyi

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.

---
 meta/recipes-devtools/rpm/rpm_4.18.1.bb | 13 +++++++++++++
 1 file changed, 13 insertions(+)
meta/recipes-devtools/rpm/rpm_4.18.1.bb +0 -0
index 95a9e92f96..21f0127561 100644

meta/recipes-devtools/rpm/rpm_4.18.1.bb do_install:append:class-nativesdk() { · line 139

Quoted 9 lines
meta/recipes-devtools/rpm/rpm_4.18.1.bb +6 -0
@@ -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.

Cheers,

Richard

#12 lore raw

2023. 07. 24. 17:59 keltezéssel, Richard Purdie írta:

Quoted 27 lines · Zoltan Boszormenyi
Quoted 26 lines

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.

---
  meta/recipes-devtools/rpm/rpm_4.18.1.bb | 13 +++++++++++++
  1 file changed, 13 insertions(+)
meta/recipes-devtools/rpm/rpm_4.18.1.bb +2 -0
index 95a9e92f96..21f0127561 100644
@@ -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
Quoted 8 lines

meta/recipes-devtools/rpm/rpm_4.18.1.bb do_install:append:class-nativesdk() { · line 139

Quoted 4 lines
meta/recipes-devtools/rpm/rpm_4.18.1.bb +4 -0
+        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.

#13 lore raw
Quoted 37 lines · Böszörményi Zoltán

2023. 07. 24. 17:59 keltezéssel, Richard Purdie írta:

Quoted 27 lines · Zoltan Boszormenyi
Quoted 26 lines

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.

---
  meta/recipes-devtools/rpm/rpm_4.18.1.bb | 13 +++++++++++++
  1 file changed, 13 insertions(+)
meta/recipes-devtools/rpm/rpm_4.18.1.bb +2 -0
index 95a9e92f96..21f0127561 100644
@@ -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
Quoted 8 lines

meta/recipes-devtools/rpm/rpm_4.18.1.bb do_install:append:class-nativesdk() { · line 139

Quoted 4 lines
meta/recipes-devtools/rpm/rpm_4.18.1.bb +4 -0
+        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.

Quoted 8 lines

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.

I'm afraid I don't understand the problem you're running into from your description so I don't know how to answer that. TARGET_ARCH has been around in OE for many years so I'd be surprised it is unavailable in honister though.

I do know that SDK_ARCH is incorrect here though. To prove what I'm saying, try setting SDKMACHINE = "i686" and then check the value of SDK_ARCH compared to when SDKMACHINE = "x86_64" (or "aarch64").

Cheers,

Richard

#14 lore raw

2023. 07. 24. 22:16 keltezéssel, Richard Purdie írta:

Quoted 41 lines · Böszörményi Zoltán
Quoted 40 lines

2023. 07. 24. 17:59 keltezéssel, Richard Purdie írta:

Quoted 26 lines · Zoltan Boszormenyi
Quoted 25 lines

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.

---
   meta/recipes-devtools/rpm/rpm_4.18.1.bb | 13 +++++++++++++
   1 file changed, 13 insertions(+)
meta/recipes-devtools/rpm/rpm_4.18.1.bb +1 -0
index 95a9e92f96..21f0127561 100644
@@ -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
+
Quoted 8 lines

meta/recipes-devtools/rpm/rpm_4.18.1.bb do_install:append:class-nativesdk() { · line 139

Quoted 5 lines
meta/recipes-devtools/rpm/rpm_4.18.1.bb +5 -0
+    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.

Quoted 7 lines
Quoted 3 lines

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.

I'm afraid I don't understand the problem you're running into from your description so I don't know how to answer that. TARGET_ARCH has been around in OE for many years so I'd be surprised it is unavailable in honister though.

I usually verify variable settings via "bitbake -e packagename" and what I can see is that this:

bitbake -e rpm >rpm-vars.txt 2>&1
grep TARGET_ARCH rpm-vars.txt

shows TRANSLATED_TARGET_ARCH on Honister with TARGET_ARCH missing. Can I still use TARGET_ARCH in the rpm recipe on this old Yocto version?

Quoted 1 line

I do know that SDK_ARCH is incorrect here though.

This is why I asked to suggest the correct setting name.

Quoted 7 lines

To prove what I'm
saying, try setting SDKMACHINE = "i686" and then check the value of SDK_ARCH compared to when SDKMACHINE = "x86_64" (or "aarch64").

Cheers,

Richard

#15 lore raw
Quoted 50 lines · Böszörményi Zoltán

2023. 07. 24. 22:16 keltezéssel, Richard Purdie írta:

Quoted 41 lines · Böszörményi Zoltán
Quoted 40 lines

2023. 07. 24. 17:59 keltezéssel, Richard Purdie írta:

Quoted 26 lines · Zoltan Boszormenyi
Quoted 25 lines

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.

---
   meta/recipes-devtools/rpm/rpm_4.18.1.bb | 13 +++++++++++++
   1 file changed, 13 insertions(+)
meta/recipes-devtools/rpm/rpm_4.18.1.bb +1 -0
index 95a9e92f96..21f0127561 100644
@@ -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
+
Quoted 8 lines

meta/recipes-devtools/rpm/rpm_4.18.1.bb do_install:append:class-nativesdk() { · line 139

Quoted 5 lines
meta/recipes-devtools/rpm/rpm_4.18.1.bb +5 -0
+    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.

Quoted 7 lines
Quoted 3 lines

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.

I'm afraid I don't understand the problem you're running into from your description so I don't know how to answer that. TARGET_ARCH has been around in OE for many years so I'd be surprised it is unavailable in honister though.

Quoted 8 lines

I usually verify variable settings via "bitbake -e packagename" and what I can see is that this:

bitbake -e rpm >rpm-vars.txt 2>&1
grep TARGET_ARCH rpm-vars.txt

shows TRANSLATED_TARGET_ARCH on Honister with TARGET_ARCH missing. Can I still use TARGET_ARCH in the rpm recipe on this old Yocto version?

In honister there is this:

$ grep TARGET_ARCH.*export * -R
meta/conf/bitbake.conf:# Make sure TARGET_ARCH isn't exported
meta/conf/bitbake.conf:TARGET_ARCH[unexport] = "1"

which is why it doesn't show up in bitbake -e, the variable does exist though.

Cheers,

Richard

#16 lore raw

2023. 07. 25. 12:29 keltezéssel, Richard Purdie írta:

Quoted 58 lines · Böszörményi Zoltán
Quoted 49 lines

2023. 07. 24. 22:16 keltezéssel, Richard Purdie írta:

Quoted 41 lines · Böszörményi Zoltán
Quoted 40 lines

2023. 07. 24. 17:59 keltezéssel, Richard Purdie írta:

Quoted 26 lines · Zoltan Boszormenyi
Quoted 25 lines

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.

---
    meta/recipes-devtools/rpm/rpm_4.18.1.bb | 13 +++++++++++++
    1 file changed, 13 insertions(+)
meta/recipes-devtools/rpm/rpm_4.18.1.bb +1 -0
index 95a9e92f96..21f0127561 100644
@@ -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
+
Quoted 8 lines

meta/recipes-devtools/rpm/rpm_4.18.1.bb do_install:append:class-nativesdk() { · line 139

Quoted 5 lines
meta/recipes-devtools/rpm/rpm_4.18.1.bb +5 -0
+    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.

Quoted 7 lines
Quoted 3 lines

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.

I'm afraid I don't understand the problem you're running into from your description so I don't know how to answer that. TARGET_ARCH has been around in OE for many years so I'd be surprised it is unavailable in honister though.

Quoted 8 lines

I usually verify variable settings via "bitbake -e packagename" and what I can see is that this:

bitbake -e rpm >rpm-vars.txt 2>&1
grep TARGET_ARCH rpm-vars.txt

shows TRANSLATED_TARGET_ARCH on Honister with TARGET_ARCH missing. Can I still use TARGET_ARCH in the rpm recipe on this old Yocto version?

Quoted 8 lines

In honister there is this:

$ grep TARGET_ARCH.*export * -R
meta/conf/bitbake.conf:# Make sure TARGET_ARCH isn't exported
meta/conf/bitbake.conf:TARGET_ARCH[unexport] = "1"

which is why it doesn't show up in bitbake -e, the variable does exist though.

Thanks!

Quoted 4 lines

Cheers,

Richard