Skip to contentSkip to conversation

glibc: move ldconfig to its own package

PATCH In review Andreas Oberritter 2 participants 5 messages Nov 7, 2019 – Nov 8, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 glibc: move ldconfig to its own package

Only recommend its installation, if it's enabled in distro features.

---
 meta/recipes-core/glibc/glibc-package.inc | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
meta/recipes-core/glibc/glibc-package.inc +4 -7
index d7037c5cce..9dd5a0d403 100644
@@ -1,6 +1,6 @@
 INHIBIT_SYSROOT_STRIP = "1"
 
-PACKAGES = "${PN}-dbg catchsegv sln nscd ldd tzcode glibc-thread-db ${PN}-pic libcidn libmemusage libnss-db libsegfault ${PN}-pcprofile libsotruss ${PN} ${PN}-utils glibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc"
+PACKAGES = "${PN}-dbg catchsegv sln nscd ldd tzcode glibc-thread-db ${PN}-pic libcidn libmemusage libnss-db libsegfault ${PN}-pcprofile libsotruss ${PN} ${PN}-utils glibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc ldconfig"
 
 # The ld.so in this glibc supports the GNU_HASH
 RPROVIDES_${PN} = "eglibc rtld(GNU_HASH)"
@@ -23,7 +23,9 @@ ARCH_DYNAMIC_LOADER_aarch64 = "ld-linux-${TARGET_ARCH}.so.1"
 libc_baselibs_append = " ${@oe.utils.conditional('ARCH_DYNAMIC_LOADER', '', '', '${root_prefix}/lib/${ARCH_DYNAMIC_LOADER}', d)}"
 INSANE_SKIP_${PN}_append_aarch64 = " libdir"
 
-FILES_${PN} = "${libc_baselibs} ${libexecdir}/* ${base_sbindir}/ldconfig ${sysconfdir}/ld.so.conf"
+FILES_${PN} = "${libc_baselibs} ${libexecdir}/*"
+RRECOMMENDS_${PN} = "${@bb.utils.filter('DISTRO_FEATURES', 'ldconfig', d)}"
+FILES_ldconfig = "${base_sbindir}/ldconfig ${sysconfdir}/ld.so.conf"
 FILES_ldd = "${bindir}/ldd"
 FILES_libsegfault = "${base_libdir}/libSegFault*"
 FILES_libcidn = "${base_libdir}/libcidn-*.so ${base_libdir}/libcidn.so.*"
@@ -107,11 +109,6 @@ do_install_append () {
 }
 
 do_install_append_class-target() {
-	if ! ${@bb.utils.contains('DISTRO_FEATURES', 'ldconfig', 'true', 'false', d)}; then
-		# The distro doesn't want these files so let's not install them
-		rm -f ${D}${sysconfdir}/ld.so.conf
-		rm -f ${D}${base_sbindir}/ldconfig
-	fi
 	if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
 		install -d ${D}${sysconfdir}/tmpfiles.d
 		echo "d /run/nscd 755 root root -" \
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/3 package.bbclass: Always include ldconfig fragment

Now that ldconfig may get installed from a feed, use it when it's available on the target.

---
 meta/classes/package.bbclass | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
meta/classes/package.bbclass +1 -3
index f955df1111..e0d6ff6701 100644
@@ -1731,8 +1731,6 @@ python package_do_shlibs() {
     else:
         snap_symlinks = False
 
-    use_ldconfig = bb.utils.contains('DISTRO_FEATURES', 'ldconfig', True, False, d)
-
     needed = {}
 
     shlib_provider = oe.package.read_shlib_providers(d)
@@ -1791,7 +1789,7 @@ python package_do_shlibs() {
                     if s[0] not in shlib_provider:
                         shlib_provider[s[0]] = {}
                     shlib_provider[s[0]][s[1]] = (pkg, pkgver)
-        if needs_ldconfig and use_ldconfig:
+        if needs_ldconfig:
             bb.debug(1, 'adding ldconfig call to postinst for %s' % pkg)
             postinst = d.getVar('pkg_postinst_%s' % pkg)
             if not postinst:
Signature · 1 line
2.17.1
#2 lore raw

PATCH 3/3 systemd: Add runtime dependency on new ldconfig package

In reply to Andreas Oberritter
---
 meta/recipes-core/systemd/systemd_243.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/systemd/systemd_243.bb +1 -1
index 6e7f95693b..54fcc6a5d1 100644
@@ -139,7 +139,7 @@ PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false"
 PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables"
 PACKAGECONFIG[journal-upload] = "-Dlibcurl=true,-Dlibcurl=false,curl"
 PACKAGECONFIG[kmod] = "-Dkmod=true,-Dkmod=false,kmod"
-PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false"
+PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false,,ldconfig"
 PACKAGECONFIG[libidn] = "-Dlibidn=true,-Dlibidn=false,libidn"
 PACKAGECONFIG[localed] = "-Dlocaled=true,-Dlocaled=false"
 PACKAGECONFIG[logind] = "-Dlogind=true,-Dlogind=false"
Signature · 1 line
2.17.1
#3 lore raw

Re: [PATCH 3/3] systemd: Add runtime dependency on new ldconfig package

Quoted 11 lines · Andreas Oberritter
---
 meta/recipes-core/systemd/systemd_243.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/systemd/systemd_243.bb +0 -0
index 6e7f95693b..54fcc6a5d1 100644

meta/recipes-core/systemd/systemd_243.bb PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false" · line 142

Quoted 5 lines
meta/recipes-core/systemd/systemd_243.bb +1 -1
@@ -139,7 +139,7 @@ PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false"
 PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables"
 PACKAGECONFIG[journal-upload] = "-Dlibcurl=true,-Dlibcurl=false,curl"
 PACKAGECONFIG[kmod] = "-Dkmod=true,-Dkmod=false,kmod"
-PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false"
+PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false,,ldconfig"

Is this necessary? The implication of adding it is that you want to support situations where ldconfig is disabled in DISTRO_FEATURES (ie the new ldconfig package is not pulled in via a runtime dependency from glibc) but then manually added to systemd PACKAGECONFIG (ie ignoring DISTRO_FEATURES). That just seems like a misconfiguration and not something we should try to support.

Quoted 11 lines
meta/recipes-core/systemd/systemd_243.bb +0 -1
 PACKAGECONFIG[libidn] = "-Dlibidn=true,-Dlibidn=false,libidn"
 PACKAGECONFIG[localed] = "-Dlocaled=true,-Dlocaled=false"
 PACKAGECONFIG[logind] = "-Dlogind=true,-Dlogind=false"
--

2.17.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#4 lore raw

Re: [PATCH 3/3] systemd: Add runtime dependency on new ldconfig package

Quoted 16 lines · On Thu, 7 Nov 2019 16:58:57 -0800 Andre McCurdy <[email protected]> wrote:
Quoted 15 lines · Andreas Oberritter
---
 meta/recipes-core/systemd/systemd_243.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/systemd/systemd_243.bb +0 -1
index 6e7f95693b..54fcc6a5d1 100644
@@ -139,7 +139,7 @@ PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false"
 PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables"
 PACKAGECONFIG[journal-upload] = "-Dlibcurl=true,-Dlibcurl=false,curl"
 PACKAGECONFIG[kmod] = "-Dkmod=true,-Dkmod=false,kmod"
-PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false"
Quoted 8 lines

meta/recipes-core/systemd/systemd_243.bb PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false" · line 142

Quoted 1 line
meta/recipes-core/systemd/systemd_243.bb +1 -0
+PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false,,ldconfig"

Is this necessary? The implication of adding it is that you want to support situations where ldconfig is disabled in DISTRO_FEATURES (ie the new ldconfig package is not pulled in via a runtime dependency from glibc) but then manually added to systemd PACKAGECONFIG (ie ignoring DISTRO_FEATURES). That just seems like a misconfiguration and not something we should try to support.

If you enable ldconfig in systemd, then you clearly always want to install ldconfig with systemd. That's what this patch makes sure. You can still build other images without systemd (i.e. with sysvinit) and without ldconfig. That's what I do.

Regards,
Andreas