* [PATCH] oe-core:package_manager extract target arch from TARGET_SYS and add it into package_archs
@ 2015-12-24 5:51 fupan.li
2016-01-07 14:23 ` Burton, Ross
0 siblings, 1 reply; 3+ messages in thread
From: fupan.li @ 2015-12-24 5:51 UTC (permalink / raw)
To: openembedded-core
From: fli <fupan.li@windriver.com>
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.
Signed-off-by: fli <fupan.li@windriver.com>
---
meta/lib/oe/package_manager.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 04812d2..e4b53a0 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -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
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] oe-core:package_manager extract target arch from TARGET_SYS and add it into package_archs
2015-12-24 5:51 [PATCH] oe-core:package_manager extract target arch from TARGET_SYS and add it into package_archs fupan.li
@ 2016-01-07 14:23 ` Burton, Ross
2016-01-08 1:53 ` fupan
0 siblings, 1 reply; 3+ messages in thread
From: Burton, Ross @ 2016-01-07 14:23 UTC (permalink / raw)
To: fupan.li; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 600 bytes --]
On 24 December 2015 at 05:51, <fupan.li@windriver.com> wrote:
> + #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)
> +
>
Isn't this a long-winded way of getting ${TARGET_ARCH}?
Ross
[-- Attachment #2: Type: text/html, Size: 1274 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] oe-core:package_manager extract target arch from TARGET_SYS and add it into package_archs
2016-01-07 14:23 ` Burton, Ross
@ 2016-01-08 1:53 ` fupan
0 siblings, 0 replies; 3+ messages in thread
From: fupan @ 2016-01-08 1:53 UTC (permalink / raw)
To: Burton, Ross; +Cc: OE-core
[-- Attachment #1: Type: text/html, Size: 2721 bytes --]
[-- Attachment #2: 0001-oe-core-package_manager-add-TARGET_ARCH-into-package.patch --]
[-- Type: text/x-diff, Size: 1692 bytes --]
From 705e8b05d97b23aec40d5b84208531f0d5b8391e Mon Sep 17 00:00:00 2001
From: fli <fupan.li@windriver.com>
Date: Thu, 17 Dec 2015 22:19:27 -0800
Subject: [PATCH] V2 oe-core:package_manager add TARGET_ARCH into package_archs
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-wrs-linux-gnueabi', the target arch will be 'arm'.
And TARGET_SYS's arch substring comes from 'TARGET_ARCH', thus
in order to make the rpm pkgs built out on the target compatilbe
with target, add 'TARGET_ARCH' into package archs which will be
write into the rootfs's /etc/rpm/platform.
Signed-off-by: fli <fupan.li@windriver.com>
---
meta/lib/oe/package_manager.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 30f998a..fbd4563 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -55,6 +55,12 @@ 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 TARGET_ARCH to target package archs.
+ target_arch = self.d.getVar("TARGET_ARCH", True)
+ 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
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-01-08 1:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-24 5:51 [PATCH] oe-core:package_manager extract target arch from TARGET_SYS and add it into package_archs fupan.li
2016-01-07 14:23 ` Burton, Ross
2016-01-08 1:53 ` fupan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox