From 6f30e3586eb1b8e853cf23dd039f258d0dc0bc6b Mon Sep 17 00:00:00 2001 From: Eero Aaltonen Date: Thu, 19 Oct 2023 14:11:51 +0300 Subject: base-files, systemd: add nss-resolve plugin Add nss-resolve plugin to the glibc Name Service Switch (NSS) with systemd-resolved DISTRO_FEATURE so that systemd-resolved is used in DNS name resolution. This enables the resolution of Multicast DNS and Link-Local Multicast Name Resolution names, depending on the selected options. (From OE-Core rev: 81da1d6eecee9fd036121298abba6fdcffc3969d) Signed-off-by: Eero Aaltonen Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- .../0001-add-nss-resolve-to-nsswitch.patch | 31 ++++++++++++++++++++++ meta/recipes-core/base-files/base-files_3.0.14.bb | 2 ++ meta/recipes-core/systemd/systemd_254.4.bb | 3 +++ 3 files changed, 36 insertions(+) create mode 100644 meta/recipes-core/base-files/base-files/0001-add-nss-resolve-to-nsswitch.patch diff --git a/meta/recipes-core/base-files/base-files/0001-add-nss-resolve-to-nsswitch.patch b/meta/recipes-core/base-files/base-files/0001-add-nss-resolve-to-nsswitch.patch new file mode 100644 index 0000000000..a6e39e0956 --- /dev/null +++ b/meta/recipes-core/base-files/base-files/0001-add-nss-resolve-to-nsswitch.patch @@ -0,0 +1,31 @@ +From 830abe652428d9d31780c3ace121635ad7b64274 Mon Sep 17 00:00:00 2001 +From: Eero Aaltonen +Date: Wed Sep 27 15:50:48 2023 +0300 +Subject: [PATCH] Add nss-resolve to the Name Service Switch (NSS) + +Add `nss-resolve` so that `systemd-resolved` is used for name +resolution with glibc `gethostbyname` calls. + +Upstream-Status: Inappropriate [no upstream, configuration]. + +Signed-off-by: Eero Aaltonen +--- + nsswitch.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/nsswitch.conf b/nsswitch.conf +index 06f03d2..34b165c 100644 +--- a/nsswitch.conf ++++ b/nsswitch.conf +@@ -8,7 +8,7 @@ passwd: compat + group: compat + shadow: compat + +-hosts: files dns ++hosts: resolve [!UNAVAIL=return] files dns + networks: files + + protocols: db files +-- +2.25.1 + diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb index 4d246126a2..9fab53ce63 100644 --- a/meta/recipes-core/base-files/base-files_3.0.14.bb +++ b/meta/recipes-core/base-files/base-files_3.0.14.bb @@ -23,6 +23,8 @@ SRC_URI = "file://rotation \ file://share/dot.profile \ file://licenses/GPL-2 \ " +SRC_URI:append:libc-glibc = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd systemd-resolved', ' file://0001-add-nss-resolve-to-nsswitch.patch', '', d)}" + S = "${WORKDIR}" INHIBIT_DEFAULT_DEPS = "1" diff --git a/meta/recipes-core/systemd/systemd_254.4.bb b/meta/recipes-core/systemd/systemd_254.4.bb index d888efdece..76cc07e86f 100644 --- a/meta/recipes-core/systemd/systemd_254.4.bb +++ b/meta/recipes-core/systemd/systemd_254.4.bb @@ -793,6 +793,9 @@ python __anonymous() { if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") + if bb.utils.contains('DISTRO_FEATURES', 'systemd-resolved', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'nss-resolve resolved', True, False, d): + bb.error("DISTRO_FEATURES[systemd-resolved] requires PACKAGECONFIG[nss-resolve, resolved]") + if bb.utils.contains('PACKAGECONFIG', 'repart', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'openssl', True, False, d): bb.error("PACKAGECONFIG[repart] requires PACKAGECONFIG[openssl]") -- cgit v1.2.3-54-g00ecf