package_manager.py: set preferred ABI for rpm
cover package_manager.py: set preferred ABI for rpm
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(-)
Signature · 1 line
1.7.9.5
PATCH 1/2 package_manager.py: set preferred ABI for rpm
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]
--- meta/lib/oe/package_manager.py | 16 ++++++++++++++++ meta/lib/oe/rootfs.py | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-)
meta/lib/oe/package_manager.py +16 -0
@@ -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
meta/lib/oe/rootfs.py +2 -1
@@ -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")
Signature · 1 line
1.7.9.5
PATCH 2/2 local.conf.sample.extended: update for preferred ABI
In reply to Robert Yang[YOCTO #4073]
--- meta/conf/local.conf.sample.extended | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
meta/conf/local.conf.sample.extended +15 -0
@@ -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"
Signature · 1 line
1.7.9.5
Re: [PATCH 2/2] local.conf.sample.extended: update for preferred ABI
Quoted 26 lines · Robert Yang
[YOCTO #4073]
Signed-off-by Robert Yang <[email protected]>--- meta/conf/local.conf.sample.extended | 15 +++++++++++++++ 1 file changed, 15 insertions(+)meta/conf/local.conf.sample.extended +7
-0@@ -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
meta/conf/local.conf.sample.extended line 363
Quoted 3 lines
meta/conf/local.conf.sample.extended +0
-0@@ -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.
meta/conf/local.conf.sample.extended line 371
Quoted 9 lines
meta/conf/local.conf.sample.extended +8
-0+ +# 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
Re: [PATCH 2/2] local.conf.sample.extended: update for preferred ABI
Quoted 17 lines · Robert Yang
Quoted 15 lines · Robert Yang
[YOCTO #4073]
Signed-off-by Robert Yang <[email protected]>--- meta/conf/local.conf.sample.extended | 15 +++++++++++++++ 1 file changed, 15 insertions(+)meta/conf/local.conf.sample.extended +0
-0@@ -145,6 +145,13 @@ #MULTILIBS = "multilib:lib32" #DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
Quoted 7 lines
meta/conf/local.conf.sample.extended line 154
Quoted 7 lines
meta/conf/local.conf.sample.extended +7
-0+# 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
Re: [PATCH 2/2] local.conf.sample.extended: update for preferred ABI
Quoted 18 lines · Richard Purdie
Quoted 17 lines · Robert Yang
Quoted 15 lines · Robert Yang
[YOCTO #4073]
Signed-off-by Robert Yang <[email protected]>--- meta/conf/local.conf.sample.extended | 15 +++++++++++++++ 1 file changed, 15 insertions(+)meta/conf/local.conf.sample.extended +0
-0@@ -145,6 +145,13 @@ #MULTILIBS = "multilib:lib32" #DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
Quoted 9 lines
Quoted 7 lines
meta/conf/local.conf.sample.extended line 154
Quoted 7 lines
meta/conf/local.conf.sample.extended +7
-0+# 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
Quoted 4 lines
Cheers,
Richard