[OE-core] [PATCH] rootfs-postcommands.bbclass: add support for /etc/ld.so.conf.d/*.conf

Huang, Jie (Jackie) Jackie.Huang at windriver.com
Fri Sep 29 02:58:20 UTC 2017


That’s what we did in the original patch, but rejected long time ago
then we have been keeping it in our local branch:

commit 1e43ff11f841247453f1d4106b22d33aa3a150f9
Author: Ming Liu <ming.liu at windriver.com>
Date:   Wed Aug 21 16:06:29 2013 +0800

    eglibc: add support for /etc/ld.so.conf.d/*.conf

    There are advantages in changing the contents of ld.so.conf to
    "include /etc/ld.so.conf.d/*.conf" instead of directly listing directories
    in it, just like most distributions are doing the same.

    Signed-off-by: Ming Liu <ming.liu at windriver.com>
    Signed-off-by: Robert Yang <liezhi.yang at windriver.com>

    (LOCAL REV: NOT UPSTREAM) -- Sent to oe-core on 20131127

    Rejected by oe-core since:
     - This will cause the existing contents of ld.so.conf to be obliterated
       if the file wasn't empty to begin with.  (I know that it is empty in
       oe-core, but a distro layer might be overlaying this file with its
       own.)

     - Also, it seems as though the choice of whether to use an "ld.so.conf.d"
       arrangement or not is one that the distro should be making. Is there
       a strong reason why this needs to be done in oe-core?

     - I would like to different components to add their own conf files to
       ${D}${sysconfdir}/ld.so.conf.d and let ldconfig executed in do_rootfs
       to find them, but they won't be there when eglibc.do_install is executed.

Signed-off-by: Hongxu Jia <hongxu.jia at windriver.com>


Then we re-implement it as a rootfs postinstall command to avoid the concern
and it could be controlled in distro settings.

Thanks,
Jackie

From: Burton, Ross [mailto:ross.burton at intel.com]
Sent: Thursday, September 28, 2017 19:28
To: Huang, Jie (Jackie)
Cc: OE-core
Subject: Re: [OE-core] [PATCH] rootfs-postcommands.bbclass: add support for /etc/ld.so.conf.d/*.conf

Why implement this as a rootfs postinstall command?  glibc writes this file, so we can alter it when that recipe is written.

Ross

On 31 August 2017 at 06:54, <jackie.huang at windriver.com<mailto:jackie.huang at windriver.com>> wrote:
From: Jackie Huang <jackie.huang at windriver.com<mailto:jackie.huang at windriver.com>>

There are advantages in changing the contents of ld.so.conf to
"include /etc/ld.so.conf.d/*.conf" instead of directly listing
directories in it, just like most distributions are doing the same.

Signed-off-by: Jackie Huang <jackie.huang at windriver.com<mailto:jackie.huang at windriver.com>>
---
 meta/classes/rootfs-postcommands.bbclass | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index dc5a76baba..af01eb550a 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -20,6 +20,9 @@ ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("IMAGE_FEATURES", "read-only
 # Generates test data file with data store variables expanded in json format
 ROOTFS_POSTPROCESS_COMMAND += "write_image_test_data ; "

+# Add support for /etc/ld.so.conf.d/*.conf if ldconfig is enabled
+ROOTFS_POSTINSTALL_COMMAND += "${@bb.utils.contains('DISTRO_FEATURES', 'ldconfig', 'add_ld_so_conf_d ;', '', d)}<mailto:$%7b at bb.utils.contains('DISTRO_FEATURES',%20'ldconfig',%20'add_ld_so_conf_d%20;',%20'',%20d)%7d>"
+
 # Write manifest
 IMAGE_MANIFEST = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.manifest"
 ROOTFS_POSTUNINSTALL_COMMAND =+ "write_image_manifest ; "
@@ -244,6 +247,16 @@ make_zimage_symlink_relative () {
        fi
 }

+# Add support for /etc/ld.so.conf.d/*.conf
+add_ld_so_conf_d() {
+    if [ -f ${IMAGE_ROOTFS}${sysconfdir}/ld.so.conf ]; then
+        if ! `grep -q 'include ld.so.conf.d\/\*.conf' /etc/ld.so.conf`; then
+            echo 'include ld.so.conf.d/*.conf' >> ${IMAGE_ROOTFS}${sysconfdir}/ld.so.conf
+        fi
+        mkdir -p ${IMAGE_ROOTFS}${sysconfdir}/ld.so.conf.d
+    fi
+}
+
 python write_image_manifest () {
     from oe.rootfs import image_list_installed_packages
     from oe.utils import format_pkg_list
--
2.11.0

--
_______________________________________________
Openembedded-core mailing list
Openembedded-core at lists.openembedded.org<mailto:Openembedded-core at lists.openembedded.org>
http://lists.openembedded.org/mailman/listinfo/openembedded-core

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20170929/9bfabd25/attachment-0002.html>


More information about the Openembedded-core mailing list