add USE_LDCONFIG_CONF_D
cover add USE_LDCONFIG_CONF_D
It'd be nice to support ld.so.conf.d, but it'd also be nice if it were optional. I made the default be zero because I don't want to change behavior on people without warning. Lightly tested, but since I don't actually have a use case for this lying around I can't promise it solves all the things.
The main intended benefit is that packages can install files in ld.so.conf without stepping on each other.
The following changes since commit 91ca6b1b2e009381d8e813906654c0958eee7efc:
lib/oe/rootfs: Improve error message whitespace (2014-07-28 12:20:56 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib seebs/ldsoconfd
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=seebs/ldsoconfd
Peter Seebach (1):
Add support for ld.so.conf.d
meta/recipes-core/eglibc/eglibc-package.inc | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-)
PATCH 1/1 Add support for ld.so.conf.d
The default behavior for USE_LDCONFIG is to use an empty ld.so.conf. In some cases, it might be desireable to have an ld.so.conf.d directory, and inherit files from there. This is a common enough use case to justify support in the recipe, but not common enough to make it the default. So, eglibc gets a new USE_LDCONFIG_CONF_D value, default 0. If it's set to 1, we create the directory and add an "include" line for it to ld.so.conf.
--- meta/recipes-core/eglibc/eglibc-package.inc | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-)
meta/recipes-core/eglibc/eglibc-package.inc +9 -1
@@ -16,6 +16,9 @@ python __anonymous () { # Set this to zero if you don't want ldconfig in the output package USE_LDCONFIG ?= "1" +# Set this to one if you want ld.so.conf to include ld.so.conf.d/* +# by default. +USE_LDCONFIG_CONF_D ?= "0" PACKAGES = "${PN}-dbg catchsegv sln nscd ldd tzcode ${PN}-utils eglibc-thread-db ${PN}-pic libcidn libmemusage libsegfault ${PN}-pcprofile libsotruss ${PN} eglibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc"
@@ -33,7 +36,7 @@ RPROVIDES_${PN}-pcprofile = "glibc-pcprofile" RPROVIDES_${PN}-dbg = "glibc-dbg" libc_baselibs = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so ${base_libdir}/libc.so.* ${base_libdir}/libc-*.so ${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so ${base_libdir}/ld*.so.* ${base_libdir}/ld-*.so ${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so ${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so ${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so ${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so ${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so ${base_libdir}/libnss_files*.so.* ${base_libdir}/libnss_files-*.so ${base_libdir}/libnss_compat*.so.* ${base_libdir}/libnss_compat-*.so ${base_libdir}/libnss_dns*.so.* ${base_libdir}/libnss_dns-*.so ${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so ${base_libdir}/libanl*.so.* ${base_libdir}/libanl-*.so ${base_libdir}/libBrokenLocale*.so.* ${base_libdir}/libBrokenLocale-*.so" -FILES_${PN} = "${libc_baselibs} ${libexecdir}/* ${@base_conditional('USE_LDCONFIG', '1', '${base_sbindir}/ldconfig ${sysconfdir}/ld.so.conf', '', d)}" +FILES_${PN} = "${libc_baselibs} ${libexecdir}/* ${@base_conditional('USE_LDCONFIG', '1', '${base_sbindir}/ldconfig ${sysconfdir}/ld.so.conf ${sysconfdir}/ld.so.conf.d', '', d)}" FILES_ldd = "${bindir}/ldd" FILES_libsegfault = "${base_libdir}/libSegFault*" FILES_libcidn = "${base_libdir}/libcidn-*.so ${base_libdir}/libcidn.so.*"
@@ -99,6 +102,11 @@ do_install_append () { if [ -d ${D}${sysconfdir} ]; then rmdir ${D}${sysconfdir} fi + else + if [ "${USE_LDCONFIG_CONF_D}" = "1" ]; then + mkdir -p ${D}${sysconfdir}/ld.so.conf.d + echo "include ld.so.conf.d/*.conf" >> ${D}${sysconfdir}/ld.so.conf + fi fi }
Signature · 1 line
1.7.1
Re: [PATCH 1/1] Add support for ld.so.conf.d
Quoted 7 lines · Peter Seebach
The default behavior for
USE_LDCONFIGis to use an empty ld.so.conf. In some cases, it might be desireable to have an ld.so.conf.d directory, and inherit files from there. This is a common enough use case to justify support in the recipe, but not common enough to make it the default. So, eglibc gets a newUSE_LDCONFIG_CONF_Dvalue, default 0. If it's set to 1, we create the directory and add an "include" line for it to ld.so.conf.
the patch is good but introducing another variable is not needed you can cover it under US_LDCONFIG itself, ldconfig with empty ld.so.conf will still parse standard lib search paths anyway
Secondly when we use ldconfig it generates ld.so.cache under /etc so I hope we take care of this when we have ro-rootfs
Re: [PATCH 1/1] Add support for ld.so.conf.d
Quoted 10 lines · Khem Raj
Quoted 7 lines · Peter Seebach
The default behavior for
USE_LDCONFIGis to use an empty ld.so.conf. In some cases, it might be desireable to have an ld.so.conf.d directory, and inherit files from there. This is a common enough use case to justify support in the recipe, but not common enough to make it the default. So, eglibc gets a newUSE_LDCONFIG_CONF_Dvalue, default 0. If it's set to 1, we create the directory and add an "include" line for it to ld.so.conf.
Quoted 7 lines
the patch is good but introducing another variable is not needed you can cover it under
US_LDCONFIGitself, ldconfig with empty ld.so.conf will still parse standard lib search paths anywaySecondly when we use ldconfig it generates ld.so.cache under /etc so I hope we take care of this when we have ro-rootfs
In a read-only root case, the ld.so.cache is generated in the cross environment.
I don't know if the cross ldconfig knows about the includes though. Someone
will have to check that.
--Mark
Re: [PATCH 1/1] Add support for ld.so.conf.d
Quoted 3 lines · On Mon, 28 Jul 2014 13:59:20 -0500 Mark Hatle <[email protected]> wrote:
In a read-only root case, the ld.so.cache is generated in the cross environment.
I don't know if the cross ldconfig knows about the includes though. Someone
will have to check that.
It appears to be the same source, so it has the functionality at least in the code.
-s
Signature · 1 line
Listen, get this. Nobody with a good compiler needs to be justified.
Re: [PATCH 1/1] Add support for ld.so.conf.d
In reply to Khem RajQuoted 3 lines · On Mon, 28 Jul 2014 11:47:30 -0700 Khem Raj <[email protected]> wrote:
the patch is good but introducing another variable is not needed you can cover it under
US_LDCONFIGitself, ldconfig with empty ld.so.conf will still parse standard lib search paths anyway
The reason I wanted another variable is to control the creation of a *non-empty* ld.so.conf that would pick up other config files. The idea is that if you wanted to add a non-standard library search path, you could create a file in ld.so.conf.d. I didn't want to make the file have contents unconditionally.
Quoted 2 lines
Secondly when we use ldconfig it generates ld.so.cache under /etc so I hope we take care of this when we have ro-rootfs
I assume that's already working for the existing empty ld.so.conf you get with USE_LDCONFIG=1.
It does occur to me that I don't know whether our cross-ldconfig knows this syntax. I'll double-check that.
-s
Signature · 1 line
Listen, get this. Nobody with a good compiler needs to be justified.