Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] package_manager.py: set preferred ABI for rpm
@ 2014-07-31  8:15 Robert Yang
  2014-07-31  8:15 ` [PATCH 1/2] " Robert Yang
  2014-07-31  8:15 ` [PATCH 2/2] local.conf.sample.extended: update for preferred ABI Robert Yang
  0 siblings, 2 replies; 6+ messages in thread
From: Robert Yang @ 2014-07-31  8:15 UTC (permalink / raw)
  To: openembedded-core

Test info:
* Set these in local.conf:
MACHINE = "qemux86-64"
require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE_virtclass-multilib-lib32 = "x86"

IMAGE_INSTALL_append = " bash lib32-bash"

1) Set RPM_PREFER_COLOR = "1" in local.conf
$ bitbke core-image-minimal
$ file tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/bin/bash
tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/bin/bash: ELF 32-bit LSB executable, Intel 80386
### 32bit wins

2) Set RPM_PREFER_COLOR = "2" in local.conf
$ bitbke core-image-minimal
$ file tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/bin/bash
tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/bin/bash: ELF 64-bit LSB executable, x86-64
### 64bit wins

// Robert

The following changes since commit 7986adeac16550b33f65fded39a55f668e0e543f:

  populate_sdk_base: Fix grep command usage on old hosts (2014-07-29 09:57:54 +0100)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib robert/rpm
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/rpm

Robert Yang (2):
  package_manager.py: set preferred ABI for rpm
  local.conf.sample.extended: update for preferred ABI

 meta/conf/local.conf.sample.extended |   15 +++++++++++++++
 meta/lib/oe/package_manager.py       |   16 ++++++++++++++++
 meta/lib/oe/rootfs.py                |    3 ++-
 3 files changed, 33 insertions(+), 1 deletion(-)

-- 
1.7.9.5



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] package_manager.py: set preferred ABI for rpm
  2014-07-31  8:15 [PATCH 0/2] package_manager.py: set preferred ABI for rpm Robert Yang
@ 2014-07-31  8:15 ` Robert Yang
  2014-07-31  8:15 ` [PATCH 2/2] local.conf.sample.extended: update for preferred ABI Robert Yang
  1 sibling, 0 replies; 6+ messages in thread
From: Robert Yang @ 2014-07-31  8:15 UTC (permalink / raw)
  To: openembedded-core

When using the RPM packaging backend to generate a rootfs there needs to
be a way to configure the preferred ABI to resolve ELF file conflicts.

Currently RPM resolves ELF file conflicts with the last-installed wins.
Using SMART it's difficult to know what the last installed will be.

There are three specific policies that can be selected:
1: ELF32 wins
2: ELF64 wins
3: ELF64 N32 wins (mips64 or mips64el only)

Another option "0" is uncontrollable, which means that if two are being
installed at once Elf64 is preferred, but if they're being installed in
two different transactions, last in wins, so we don't document it.

Add RPM_PREFER_COLOR to let the user config the preferred ABI.

[YOCTO #4073]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/lib/oe/package_manager.py |   16 ++++++++++++++++
 meta/lib/oe/rootfs.py          |    3 ++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 5444422..a0984c4 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -821,6 +821,22 @@ class RpmPM(PackageManager):
         self._invoke_smart('config --set rpm-extra-macros._var=%s' %
                            self.d.getVar('localstatedir', True))
         cmd = 'config --set rpm-extra-macros._tmppath=/install/tmp'
+
+        prefer_color = self.d.getVar('RPM_PREFER_COLOR', True)
+        if prefer_color:
+            if prefer_color not in ['0', '1', '2', '3']:
+                bb.fatal("Invalid RPM_PREFER_COLOR: %s, it should be one of:\n"
+                        "\t1: ELF32 wins\n"
+                        "\t2: ELF64 wins\n"
+                        "\t3: ELF64 N32 wins (mips64 or mips64el only)" %
+                        prefer_color)
+            if prefer_color == "3" and self.d.getVar("TUNE_ARCH", True) not in \
+                                    ['mips64', 'mips64el']:
+                bb.fatal("RPM_PREFER_COLOR = \"3\" is for mips64 or mips64el "
+                         "only.")
+            self._invoke_smart('config --set rpm-extra-macros._prefer_color=%s'
+                        % prefer_color)
+
         self._invoke_smart(cmd)
 
         # Write common configuration for host and target usage
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 90a98b4..0424a01 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -329,7 +329,8 @@ class RpmRootfs(Rootfs):
 
     @staticmethod
     def _depends_list():
-        return ['DEPLOY_DIR_RPM', 'INC_RPM_IMAGE_GEN', 'RPM_PREPROCESS_COMMANDS', 'RPM_POSTPROCESS_COMMANDS']
+        return ['DEPLOY_DIR_RPM', 'INC_RPM_IMAGE_GEN', 'RPM_PREPROCESS_COMMANDS',
+                'RPM_POSTPROCESS_COMMANDS', 'RPM_PREFER_COLOR']
 
     def _get_delayed_postinsts(self):
         postinst_dir = self.d.expand("${IMAGE_ROOTFS}${sysconfdir}/rpm-postinsts")
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] local.conf.sample.extended: update for preferred ABI
  2014-07-31  8:15 [PATCH 0/2] package_manager.py: set preferred ABI for rpm Robert Yang
  2014-07-31  8:15 ` [PATCH 1/2] " Robert Yang
@ 2014-07-31  8:15 ` Robert Yang
  2014-07-31  8:18   ` Robert Yang
  1 sibling, 1 reply; 6+ messages in thread
From: Robert Yang @ 2014-07-31  8:15 UTC (permalink / raw)
  To: openembedded-core

[YOCTO #4073]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/conf/local.conf.sample.extended |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/meta/conf/local.conf.sample.extended b/meta/conf/local.conf.sample.extended
index 89b80a6..8ad7b6f 100644
--- a/meta/conf/local.conf.sample.extended
+++ b/meta/conf/local.conf.sample.extended
@@ -145,6 +145,13 @@
 #MULTILIBS = "multilib:lib32"
 #DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
 
+# Set RPM_PREFER_COLOR to configure preferred ABI when using rpm packaging
+# backend to generate a rootfs, choices are:
+# 1: ELF32 wins
+# 2: ELF64 wins
+# 3: ELF64 N32 wins (for mips64 or mips64el only)
+#RPM_PREFER_COLOR ?= "2"
+
 # The network based PR service host and port
 # Uncomment the following lines to enable PRservice.
 # Set PRSERV_HOST to 'localhost:0' to automatically
@@ -354,3 +361,11 @@
 # feed layout is used where package files are placed in <outdir>/<arch>/.
 #
 #IPK_HIERARCHICAL_FEED = "1"
+
+# Checks the kernel image size against KERNEL_IMAGE_MAXSIZE (The unit is
+# Kbytes)
+#KERNEL_IMAGE_MAXSIZE = "8192"
+#
+# Check the rootfs size against IMAGE_ROOTFS_MAXSIZE (The unit is
+# Kbytes)
+#IMAGE_ROOTFS_MAXSIZE = "65536"
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] local.conf.sample.extended: update for preferred ABI
  2014-07-31  8:15 ` [PATCH 2/2] local.conf.sample.extended: update for preferred ABI Robert Yang
@ 2014-07-31  8:18   ` Robert Yang
  2014-07-31 13:45     ` Richard Purdie
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Yang @ 2014-07-31  8:18 UTC (permalink / raw)
  To: openembedded-core



On 07/31/2014 04:15 PM, Robert Yang wrote:
> [YOCTO #4073]
>
> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> ---
>   meta/conf/local.conf.sample.extended |   15 +++++++++++++++
>   1 file changed, 15 insertions(+)
>
> diff --git a/meta/conf/local.conf.sample.extended b/meta/conf/local.conf.sample.extended
> index 89b80a6..8ad7b6f 100644
> --- a/meta/conf/local.conf.sample.extended
> +++ b/meta/conf/local.conf.sample.extended
> @@ -145,6 +145,13 @@
>   #MULTILIBS = "multilib:lib32"
>   #DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
>
> +# Set RPM_PREFER_COLOR to configure preferred ABI when using rpm packaging
> +# backend to generate a rootfs, choices are:
> +# 1: ELF32 wins
> +# 2: ELF64 wins
> +# 3: ELF64 N32 wins (for mips64 or mips64el only)
> +#RPM_PREFER_COLOR ?= "2"
> +
>   # The network based PR service host and port
>   # Uncomment the following lines to enable PRservice.
>   # Set PRSERV_HOST to 'localhost:0' to automatically
> @@ -354,3 +361,11 @@
>   # feed layout is used where package files are placed in <outdir>/<arch>/.
>   #
>   #IPK_HIERARCHICAL_FEED = "1"


I removed the lines below in the git repo, they should be in another patch.

> +
> +# Checks the kernel image size against KERNEL_IMAGE_MAXSIZE (The unit is
> +# Kbytes)
> +#KERNEL_IMAGE_MAXSIZE = "8192"
> +#
> +# Check the rootfs size against IMAGE_ROOTFS_MAXSIZE (The unit is
> +# Kbytes)
> +#IMAGE_ROOTFS_MAXSIZE = "65536"
>

// Robert


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] local.conf.sample.extended: update for preferred ABI
  2014-07-31  8:18   ` Robert Yang
@ 2014-07-31 13:45     ` Richard Purdie
  2014-07-31 13:55       ` Mark Hatle
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Purdie @ 2014-07-31 13:45 UTC (permalink / raw)
  To: Robert Yang; +Cc: openembedded-core

On Thu, 2014-07-31 at 16:18 +0800, Robert Yang wrote:
> 
> On 07/31/2014 04:15 PM, Robert Yang wrote:
> > [YOCTO #4073]
> >
> > Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> > ---
> >   meta/conf/local.conf.sample.extended |   15 +++++++++++++++
> >   1 file changed, 15 insertions(+)
> >
> > diff --git a/meta/conf/local.conf.sample.extended b/meta/conf/local.conf.sample.extended
> > index 89b80a6..8ad7b6f 100644
> > --- a/meta/conf/local.conf.sample.extended
> > +++ b/meta/conf/local.conf.sample.extended
> > @@ -145,6 +145,13 @@
> >   #MULTILIBS = "multilib:lib32"
> >   #DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
> >
> > +# Set RPM_PREFER_COLOR to configure preferred ABI when using rpm packaging
> > +# backend to generate a rootfs, choices are:
> > +# 1: ELF32 wins
> > +# 2: ELF64 wins
> > +# 3: ELF64 N32 wins (for mips64 or mips64el only)
> > +#RPM_PREFER_COLOR ?= "2"
> > +

Is x86 x32 also color 3?

Cheers,

Richard



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] local.conf.sample.extended: update for preferred ABI
  2014-07-31 13:45     ` Richard Purdie
@ 2014-07-31 13:55       ` Mark Hatle
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Hatle @ 2014-07-31 13:55 UTC (permalink / raw)
  To: openembedded-core

On 7/31/14, 8:45 AM, Richard Purdie wrote:
> On Thu, 2014-07-31 at 16:18 +0800, Robert Yang wrote:
>>
>> On 07/31/2014 04:15 PM, Robert Yang wrote:
>>> [YOCTO #4073]
>>>
>>> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
>>> ---
>>>    meta/conf/local.conf.sample.extended |   15 +++++++++++++++
>>>    1 file changed, 15 insertions(+)
>>>
>>> diff --git a/meta/conf/local.conf.sample.extended b/meta/conf/local.conf.sample.extended
>>> index 89b80a6..8ad7b6f 100644
>>> --- a/meta/conf/local.conf.sample.extended
>>> +++ b/meta/conf/local.conf.sample.extended
>>> @@ -145,6 +145,13 @@
>>>    #MULTILIBS = "multilib:lib32"
>>>    #DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
>>>
>>> +# Set RPM_PREFER_COLOR to configure preferred ABI when using rpm packaging
>>> +# backend to generate a rootfs, choices are:
>>> +# 1: ELF32 wins
>>> +# 2: ELF64 wins
>>> +# 3: ELF64 N32 wins (for mips64 or mips64el only)
>>> +#RPM_PREFER_COLOR ?= "2"
>>> +
>
> Is x86 x32 also color 3?

x32 support was never implemented.  RPM has no unique identification for x32 
binaries at this time.  They're treated as ELF64 if I remember correctly.

If implemented, I would expect it to piggy back on '3' as well.

--Mark

> Cheers,
>
> Richard
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-07-31 13:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-31  8:15 [PATCH 0/2] package_manager.py: set preferred ABI for rpm Robert Yang
2014-07-31  8:15 ` [PATCH 1/2] " Robert Yang
2014-07-31  8:15 ` [PATCH 2/2] local.conf.sample.extended: update for preferred ABI Robert Yang
2014-07-31  8:18   ` Robert Yang
2014-07-31 13:45     ` Richard Purdie
2014-07-31 13:55       ` Mark Hatle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox