Patchwork [1/1] libpam: fix 64-bit pam plugins not installed when add to 32-bit image

login
register
mail settings
Submitter Hongxu Jia
Date April 9, 2014, 8:56 a.m.
Message ID <68fec84f980edb28dba039fe788e2fd65fb2a2bb.1397025331.git.hongxu.jia@windriver.com>
Download mbox | patch
Permalink /patch/70355/
State Accepted
Commit b0bf00125192a72cb1630494a4a53a71b492287f
Headers show

Comments

Hongxu Jia - April 9, 2014, 8:56 a.m.
While the BSP is configured as a 64-bit kernel and 32-bit userspace,
add a 64-bit version of libpam to the filesystem, there was a failure:
...
| Computing transaction...error: Can't install
pam-plugin-unix-1.1.6-r2@lib64_x86_64: no package provides libpam-lib64
|
| Saving cache...
...

While using 'lib64' as the multilib suffix of libpam RPROVIDES , the
RPROVIDES was overridden by map_depends_variable in classextend.py.
...
 $RPROVIDES_lib64-libpam [2 operations]
   set data_smart.py:429 [finalize]
     " libpam-${baselib}"
   set classextend.py:71 [map_depends_variable]4532
     "lib64-libpam"
 computed:
   "lib64-libpam"
RPROVIDES_lib64-libpam="lib64-libpam"
...

Rename the suffix could fix this issue.
[YOCTO #4532]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-extended/pam/libpam_1.1.6.bb | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

Patch

diff --git a/meta/recipes-extended/pam/libpam_1.1.6.bb b/meta/recipes-extended/pam/libpam_1.1.6.bb
index 61aa0a1..7c0111f 100644
--- a/meta/recipes-extended/pam/libpam_1.1.6.bb
+++ b/meta/recipes-extended/pam/libpam_1.1.6.bb
@@ -62,12 +62,18 @@  FILES_${PN}-xtests = "${datadir}/Linux-PAM/xtests"
 
 PACKAGES_DYNAMIC += "^pam-plugin-.*"
 
-RPROVIDES_${PN} += "libpam-${baselib}"
-RPROVIDES_${PN}-runtime += "libpam-runtime-${baselib}"
+def get_multilib_bit(d):
+    baselib = d.getVar('baselib', True) or ''
+    return baselib.replace('lib', '')
 
-RDEPENDS_${PN}-runtime = "libpam-${baselib} pam-plugin-deny-${baselib} pam-plugin-permit-${baselib} pam-plugin-warn-${baselib} pam-plugin-unix-${baselib}"
-RDEPENDS_${PN}-xtests = "libpam-${baselib} pam-plugin-access-${baselib} pam-plugin-debug-${baselib} pam-plugin-cracklib-${baselib} pam-plugin-pwhistory-${baselib} pam-plugin-succeed-if-${baselib} pam-plugin-time-${baselib} coreutils"
-RRECOMMENDS_${PN} = "libpam-runtime-${baselib}"
+libpam_suffix = "suffix${@get_multilib_bit(d)}"
+
+RPROVIDES_${PN} += "libpam-${libpam_suffix}"
+RPROVIDES_${PN}-runtime += "libpam-runtime-${libpam_suffix}"
+
+RDEPENDS_${PN}-runtime = "libpam-${libpam_suffix} pam-plugin-deny-${libpam_suffix} pam-plugin-permit-${libpam_suffix} pam-plugin-warn-${libpam_suffix} pam-plugin-unix-${libpam_suffix}"
+RDEPENDS_${PN}-xtests = "libpam-${libpam_suffix} pam-plugin-access-${libpam_suffix} pam-plugin-debug-${libpam_suffix} pam-plugin-cracklib-${libpam_suffix} pam-plugin-pwhistory-${libpam_suffix} pam-plugin-succeed-if-${libpam_suffix} pam-plugin-time-${libpam_suffix} coreutils"
+RRECOMMENDS_${PN} = "libpam-runtime-${libpam_suffix}"
 
 python populate_packages_prepend () {
     def pam_plugin_append_file(pn, dir, file):
@@ -78,21 +84,21 @@  python populate_packages_prepend () {
         d.setVar('FILES_' + pn, nf)
 
     def pam_plugin_hook(file, pkg, pattern, format, basename):
-        baselib = d.getVar('baselib', True)
+        libpam_suffix = d.getVar('libpam_suffix', True)
         mlprefix = d.getVar('MLPREFIX', True) or ''
 
         rdeps = d.getVar('RDEPENDS_' + pkg, True)
         if rdeps:
-            rdeps = rdeps + " " + mlprefix + "libpam-" + baselib
+            rdeps = rdeps + " " + mlprefix + "libpam-" + libpam_suffix
         else:
-            rdeps = mlprefix + "libpam-" + baselib
+            rdeps = mlprefix + "libpam-" + libpam_suffix
         d.setVar('RDEPENDS_' + pkg, rdeps)
 
         provides = d.getVar('RPROVIDES_' + pkg, True)
         if provides:
-            provides = provides + " " + pkg + "-" + baselib
+            provides = provides + " " + pkg + "-" + libpam_suffix
         else:
-            provides = pkg + "-" + baselib
+            provides = pkg + "-" + libpam_suffix
         d.setVar('RPROVIDES_' + pkg, provides)
 
     dvar = bb.data.expand('${WORKDIR}/package', d, True)