Skip to contentSkip to conversation

oe-core:package_manager extract target arch from TARGET_SYS and add it into package_archs

PATCH In review [email protected] 2 participants 2 messages Dec 23, 2015 – Dec 24, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 oe-core:package_manager extract target arch from TARGET_SYS and add it into package_archs

From: fli <[email protected]>

Since the rpmbuild on the target will use TARGET_SYS as the 'target' to build the source rpm packages, which will extracted the target arch from TARGET_SYS, such as if TARGET_SYS values 'arm-poky-linux-gnueabi', the target arch will be 'arm'.

In order to make the rpm pkgs built out on the target compatilbe with target, extract the arch from TARGET_SYS and add it into package archs which will be write into the rootfs's /etc/rpm/platform.

---
 meta/lib/oe/package_manager.py | 10 ++++++++++
 1 file changed, 10 insertions(+)
meta/lib/oe/package_manager.py +10 -0
index 04812d2..e4b53a0 100644
@@ -55,6 +55,16 @@ class RpmIndexer(Indexer):
             target_os['default'] = self.d.getVar(os_var, True).strip()
         else:
             package_archs['default'] = self.d.getVar("PACKAGE_ARCHS", True).split()
+
+            #add the compatible arch extracted from TARGET_SYS.
+            #TARGET_SYS usually values as "arm-poky-linux-gnueabi",
+            #so the arch is 'arm'
+            target_sys = self.d.getVar("TARGET_SYS", True)
+            if target_sys:
+                target_arch = target_sys.split('-')[0]
+            if target_arch not in package_archs['default']:
+                package_archs['default'].append(target_arch)
+                
             # arch order is reversed.  This ensures the -best- match is
             # listed first!
             package_archs['default'].reverse()
Signature · 1 line
1.9.1
#1 lore raw

re-send this patch to oe-core ml please.

Quoted 45 lines · On Tue, Dec 22, 2015 at 9:59 PM, <[email protected]> wrote:

From: fli <[email protected]>

Since the rpmbuild on the target will use TARGET_SYS as the 'target' to build the source rpm packages, which will extracted the target arch from TARGET_SYS, such as if TARGET_SYS values 'arm-poky-linux-gnueabi', the target arch will be 'arm'.

In order to make the rpm pkgs built out on the target compatilbe with target, extract the arch from TARGET_SYS and add it into package archs which will be write into the rootfs's /etc/rpm/platform.

---
 meta/lib/oe/package_manager.py | 10 ++++++++++
 1 file changed, 10 insertions(+)
meta/lib/oe/package_manager.py +10 -1
index 04812d2..e4b53a0 100644
@@ -55,6 +55,16 @@ class RpmIndexer(Indexer):
             target_os['default'] = self.d.getVar(os_var, True).strip()
         else:
             package_archs['default'] = self.d.getVar("PACKAGE_ARCHS", True).split()
+
+            #add the compatible arch extracted from TARGET_SYS.
+            #TARGET_SYS usually values as "arm-poky-linux-gnueabi",
+            #so the arch is 'arm'
+            target_sys = self.d.getVar("TARGET_SYS", True)
+            if target_sys:
+                target_arch = target_sys.split('-')[0]
+            if target_arch not in package_archs['default']:
+                package_archs['default'].append(target_arch)
+
             # arch order is reversed.  This ensures the -best- match is
             # listed first!
             package_archs['default'].reverse()
--

1.9.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel