]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
glibc: only install nscd if it's been enabled
authorRoss Burton <ross.burton@arm.com>
Wed, 8 Jul 2026 17:36:49 +0000 (18:36 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 16 Jul 2026 10:17:14 +0000 (11:17 +0100)
Whilst the actual nscd binary won't be installed if the PACKAGECONFIG is
disabled, we were still installing the init scripts and configuration
files.  These should be wrapped with PACKAGECONFIG checks.

${localstatedir}/db and makedbs.sh are part of libnss-db not nscd, so
ensure they're still always installed.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/glibc/glibc-package.inc

index d4941a21a1010bdb8321f7e3c2647f6fd1c7158e..3d721d8f69ff7c598430b7e7f14796f67afbe7e6 100644 (file)
@@ -98,16 +98,20 @@ do_install() {
                rm -f ${D}${infodir}/dir
        fi
 
-       install -d ${D}${sysconfdir}/init.d
-       install -d ${D}${localstatedir}/db/nscd
-       install -m 0755 ${S}/nscd/nscd.init ${D}${sysconfdir}/init.d/nscd
-       install -m 0755 ${S}/nscd/nscd.conf ${D}${sysconfdir}/nscd.conf
+       install -d ${D}${localstatedir}/db
        install -m 0755 ${UNPACKDIR}/makedbs.sh ${D}${localstatedir}/db
-       sed -i "s%daemon%start-stop-daemon --start --exec%g" ${D}${sysconfdir}/init.d/nscd
-       sed -i "s|\(enable-cache\t\+netgroup\t\+\)yes|\1no|" ${D}${sysconfdir}/nscd.conf
 
-       install -d ${D}${systemd_system_unitdir}
-       install -m 0644 ${S}/nscd/nscd.service ${D}${systemd_system_unitdir}/
+       if ${@bb.utils.contains('PACKAGECONFIG', 'nscd', 'true', 'false', d)}; then
+               install -d ${D}${sysconfdir}/init.d
+               install -d ${D}${localstatedir}/db/nscd
+               install -m 0755 ${S}/nscd/nscd.init ${D}${sysconfdir}/init.d/nscd
+               install -m 0755 ${S}/nscd/nscd.conf ${D}${sysconfdir}/nscd.conf
+               sed -i "s%daemon%start-stop-daemon --start --exec%g" ${D}${sysconfdir}/init.d/nscd
+               sed -i "s|\(enable-cache\t\+netgroup\t\+\)yes|\1no|" ${D}${sysconfdir}/nscd.conf
+
+               install -d ${D}${systemd_system_unitdir}
+               install -m 0644 ${S}/nscd/nscd.service ${D}${systemd_system_unitdir}/
+       fi
 
        # The dynamic loader will have been installed into
        # ${base_libdir}. However, if that isn't going to end up being
@@ -132,18 +136,19 @@ def get_libc_fpu_setting(bb, d):
     return ""
 
 do_install:append:class-target() {
-       if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
-               install -d ${D}${nonarch_libdir}/tmpfiles.d
-               echo "d /run/nscd 755 root root -" \
-                       > ${D}${nonarch_libdir}/tmpfiles.d/nscd.conf
-       fi
+       if ${@bb.utils.contains('PACKAGECONFIG', 'nscd', 'true', 'false', d)}; then
+               if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+                       install -d ${D}${nonarch_libdir}/tmpfiles.d
+                       echo "d /run/nscd 755 root root -" \
+                               > ${D}${nonarch_libdir}/tmpfiles.d/nscd.conf
+               fi
 
-       if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
-               install -d ${D}${sysconfdir}/default/volatiles
-               echo "d root root 0755 /var/run/nscd none" \
-                       > ${D}${sysconfdir}/default/volatiles/98_nscd
+               if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+                       install -d ${D}${sysconfdir}/default/volatiles
+                       echo "d root root 0755 /var/run/nscd none" \
+                               > ${D}${sysconfdir}/default/volatiles/98_nscd
+               fi
        fi
-
 }
 do_install:append:aarch64 () {
        do_install_armmultilib