rootfs-postcommands.bbclass: add support for /etc/ld.so.conf.d/*.conf
PATCH 1/1 rootfs-postcommands.bbclass: add support for /etc/ld.so.conf.d/*.conf
From: Jackie Huang <[email protected]>
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.
--- meta/classes/rootfs-postcommands.bbclass | 13 +++++++++++++ 1 file changed, 13 insertions(+)
meta/classes/rootfs-postcommands.bbclass +13 -0
@@ -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
Signature · 1 line
2.11.0
Why implement this as a rootfs postinstall command? glibc writes this file, so we can alter it when that recipe is written.
Ross
Quoted 57 lines · On 31 August 2017 at 06:54, <[email protected]> wrote:
From: Jackie Huang <[email protected]>
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 <[email protected]>--- meta/classes/rootfs-postcommands.bbclass | 13 +++++++++++++ 1 file changed, 13 insertions(+)meta/classes/rootfs-postcommands.bbclass +0
-0@@ -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; "meta/classes/rootfs-postcommands.bbclass +2
-0+# 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)}"meta/classes/rootfs-postcommands.bbclass +5
-0+ # 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.confmeta/classes/rootfs-postcommands.bbclass +5
-1+ 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
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Quoted 2 lines · Ross
Why implement this as a rootfs postinstall command? glibc writes this file, so we can alter it when that recipe is written.
Also this is a problem for reproducible builds.
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
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 <[email protected]> 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.
(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.
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:[email protected]]
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, <[email protected]<mailto:[email protected]>> wrote:
From: Jackie Huang <[email protected]<mailto:[email protected]>>
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.
--- meta/classes/rootfs-postcommands.bbclass | 13 +++++++++++++ 1 file changed, 13 insertions(+)
meta/classes/rootfs-postcommands.bbclass +13 -0
@@ -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:$%[email protected]('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 [email protected]<mailto:[email protected]>
http://lists.openembedded.org/mailman/listinfo/openembedded-core
I found the original patch:
https://patchwork.openembedded.org/patch/62453/
Thanks,
Jackie
From: [email protected] [mailto:[email protected]] On Behalf Of Huang, Jie (Jackie)
Sent: Friday, September 29, 2017 10:58
To: BURTON, ROSS
Cc: OE-core
Subject: Re: [OE-core] [PATCH] rootfs-postcommands.bbclass: add support for /etc/ld.so.conf.d/*.conf
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 <[email protected]<mailto:[email protected]>> 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.
(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.
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:[email protected]]
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, <[email protected]<mailto:[email protected]>> wrote:
From: Jackie Huang <[email protected]<mailto:[email protected]>>
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.
--- meta/classes/rootfs-postcommands.bbclass | 13 +++++++++++++ 1 file changed, 13 insertions(+)
meta/classes/rootfs-postcommands.bbclass +13 -0
@@ -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:$%[email protected]('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 [email protected]<mailto:[email protected]>
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Quoted 11 lines · Jackie (Wind River)
- This will cause the existing contents of ld.so.conf to be
obliteratedif 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.)
Quoted 7 lines
- 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?
This is easily handled in many ways. Check the include doesn't already exist and concatenate the file instead of overwriting it, for example. Or add the include to the default oe-core ld.so.conf, and distros that want to change ld.so.conf can by changing that file.
Ross
Ok, I will do this in the glibc recipe instead if it’s preferred.
Thanks,
Jackie
From: Burton, Ross [mailto:[email protected]]
Sent: Friday, September 29, 2017 21:38
To: Huang, Jie (Jackie)
Cc: OE-core
Subject: Re: [OE-core] [PATCH] rootfs-postcommands.bbclass: add support for /etc/ld.so.conf.d/*.conf
On 29 September 2017 at 03:58, Huang, Jackie (Wind River) <[email protected]<mailto:[email protected]>> wrote:
- 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?
This is easily handled in many ways. Check the include doesn't already exist and concatenate the file instead of overwriting it, for example. Or add the include to the default oe-core ld.so.conf, and distros that want to change ld.so.conf can by changing that file.
Ross