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

Burton, Ross ross.burton at intel.com
Thu Sep 28 11:27:55 UTC 2017


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> wrote:

> From: Jackie Huang <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>
> ---
>  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)}"
> +
>  # 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
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20170928/1f05c316/attachment-0002.html>


More information about the Openembedded-core mailing list