From patchwork Mon Oct 13 12:45:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 72148 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 468E6CCD18C for ; Mon, 13 Oct 2025 12:45:39 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.42441.1760359529163438561 for ; Mon, 13 Oct 2025 05:45:29 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B480E113E for ; Mon, 13 Oct 2025 05:45:20 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 48FE13F738 for ; Mon, 13 Oct 2025 05:45:28 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 1/2] glibc: inherit update-rc.d Date: Mon, 13 Oct 2025 13:45:14 +0100 Message-ID: <20251013124515.2362058-1-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 13 Oct 2025 12:45:39 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224780 The nscd package has an init script, so we should be inheriting the update-rc.d class like we inherit the the systemd class. Signed-off-by: Ross Burton --- meta/recipes-core/glibc/glibc-package.inc | 3 +++ meta/recipes-core/glibc/glibc.inc | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/meta/recipes-core/glibc/glibc-package.inc b/meta/recipes-core/glibc/glibc-package.inc index 21f2200d19b..d4941a21a10 100644 --- a/meta/recipes-core/glibc/glibc-package.inc +++ b/meta/recipes-core/glibc/glibc-package.inc @@ -297,3 +297,6 @@ CONFFILES:nscd = "${sysconfdir}/nscd.conf" SYSTEMD_PACKAGES = "nscd" SYSTEMD_SERVICE:nscd = "nscd.service" + +INITSCRIPT_PACKAGES = "nscd" +INITSCRIPT_NAME = "nscd" diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc index d8f20c87dd6..0aa36318193 100644 --- a/meta/recipes-core/glibc/glibc.inc +++ b/meta/recipes-core/glibc/glibc.inc @@ -5,7 +5,7 @@ DEPENDS = "virtual/cross-cc virtual/cross-binutils libgcc-initial linux-libc-hea PROVIDES = "virtual/libc" PROVIDES += "virtual/libintl virtual/libiconv" -inherit autotools texinfo systemd +inherit autotools texinfo systemd update-rc.d LEAD_SONAME = "libc.so" From patchwork Mon Oct 13 12:45:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 72149 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44EEDCCD183 for ; Mon, 13 Oct 2025 12:45:39 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.42442.1760359529849754547 for ; Mon, 13 Oct 2025 05:45:29 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6185312FC for ; Mon, 13 Oct 2025 05:45:21 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id F314F3F738 for ; Mon, 13 Oct 2025 05:45:28 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 2/2] glibc: only install nscd if it's been enabled Date: Mon, 13 Oct 2025 13:45:15 +0100 Message-ID: <20251013124515.2362058-2-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251013124515.2362058-1-ross.burton@arm.com> References: <20251013124515.2362058-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 13 Oct 2025 12:45:39 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224781 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 --- meta/recipes-core/glibc/glibc-package.inc | 41 +++++++++++++---------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/meta/recipes-core/glibc/glibc-package.inc b/meta/recipes-core/glibc/glibc-package.inc index d4941a21a10..3d721d8f69f 100644 --- a/meta/recipes-core/glibc/glibc-package.inc +++ b/meta/recipes-core/glibc/glibc-package.inc @@ -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