]> code.ossystems Code Review - openembedded-core.git/commitdiff
package_manager.py: set preferred ABI for rpm
authorRobert Yang <liezhi.yang@windriver.com>
Thu, 31 Jul 2014 05:35:59 +0000 (22:35 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 2 Aug 2014 08:25:34 +0000 (09:25 +0100)
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>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/lib/oe/package_manager.py
meta/lib/oe/rootfs.py

index 54444223058d3743b49db5d46b7991f6c04dd097..a0984c404bfe381fb4ae0c23b7ce0d0461df85d8 100644 (file)
@@ -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
index 90a98b456c07657f340d5a5ec4a8b11502c2d822..0424a01aa5a5a899e5d341936ae46985bee983a1 100644 (file)
@@ -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")