diff options
| author | Hiago De Franco <hiago.franco@toradex.com> | 2025-05-22 17:14:17 -0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-05-27 09:01:17 +0100 |
| commit | c26f016b74ec14275a6f1568bb32c4a4f35d7dcf (patch) | |
| tree | d0bf1bd1f3892fb3ceb7d3d7467e8b60c70268f3 /meta | |
| parent | 5a9c2f7cd9d6391ee0ef0f5043681f6c6a96b9f2 (diff) | |
| download | poky-c26f016b74ec14275a6f1568bb32c4a4f35d7dcf.tar.gz | |
base-files: add nsswitch-resolved.conf and remove nsswitch patch
Due to changes to nsswitch.conf file on commit 0cb122f17cf2
("base-files: add gshadow entry in nsswitch.conf"), the current patch
does not apply anymore due to patch fuzz.
This fuzz wasn't detected before because this is a conditional patch,
and will be hard to detect if nsswitch.conf changes again.
Instead, add a new version of nsswitch.conf, called
nsswitch-resolved.conf, which will later be renamed accordingly based on
the DISTRO_FEATURES variable. This file contains the necessary changes
which were applied by the patch before.
(From OE-Core rev: f3f68874f0edd16c4a85df76e34cc905c41d47f0)
Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
Suggested-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
3 files changed, 22 insertions, 33 deletions
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 deleted file mode 100644 index a6e39e0956..0000000000 --- a/meta/recipes-core/base-files/base-files/0001-add-nss-resolve-to-nsswitch.patch +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | From 830abe652428d9d31780c3ace121635ad7b64274 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Eero Aaltonen <eero.aaltonen@vaisala.com> | ||
| 3 | Date: Wed Sep 27 15:50:48 2023 +0300 | ||
| 4 | Subject: [PATCH] Add nss-resolve to the Name Service Switch (NSS) | ||
| 5 | |||
| 6 | Add `nss-resolve` so that `systemd-resolved` is used for name | ||
| 7 | resolution with glibc `gethostbyname` calls. | ||
| 8 | |||
| 9 | Upstream-Status: Inappropriate [no upstream, configuration]. | ||
| 10 | |||
| 11 | Signed-off-by: Eero Aaltonen <eero.aaltonen@vaisala.com> | ||
| 12 | --- | ||
| 13 | nsswitch.conf | 2 +- | ||
| 14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 15 | |||
| 16 | diff --git a/nsswitch.conf b/nsswitch.conf | ||
| 17 | index 06f03d2..34b165c 100644 | ||
| 18 | --- a/nsswitch.conf | ||
| 19 | +++ b/nsswitch.conf | ||
| 20 | @@ -8,7 +8,7 @@ passwd: compat | ||
| 21 | group: compat | ||
| 22 | shadow: compat | ||
| 23 | |||
| 24 | -hosts: files dns | ||
| 25 | +hosts: resolve [!UNAVAIL=return] files dns | ||
| 26 | networks: files | ||
| 27 | |||
| 28 | protocols: db files | ||
| 29 | -- | ||
| 30 | 2.25.1 | ||
| 31 | |||
diff --git a/meta/recipes-core/base-files/base-files/nsswitch-resolved.conf b/meta/recipes-core/base-files/base-files/nsswitch-resolved.conf new file mode 100644 index 0000000000..ec6ce156b5 --- /dev/null +++ b/meta/recipes-core/base-files/base-files/nsswitch-resolved.conf | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | # /etc/nsswitch.conf | ||
| 2 | # | ||
| 3 | # Example configuration of GNU Name Service Switch functionality. | ||
| 4 | # If you have the `glibc-doc' and `info' packages installed, try: | ||
| 5 | # `info libc "Name Service Switch"' for information about this file. | ||
| 6 | |||
| 7 | passwd: compat | ||
| 8 | group: compat | ||
| 9 | shadow: compat | ||
| 10 | gshadow: files | ||
| 11 | |||
| 12 | hosts: resolve [!UNAVAIL=return] files dns | ||
| 13 | networks: files | ||
| 14 | |||
| 15 | protocols: db files | ||
| 16 | services: db files | ||
| 17 | ethers: db files | ||
| 18 | rpc: db files | ||
| 19 | |||
| 20 | netgroup: nis | ||
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 60253fcd42..59b084d141 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 | |||
| @@ -11,6 +11,7 @@ LIC_FILES_CHKSUM = "file://licenses/GPL-2;md5=94d55d512a9ba36caa9b7df079bae19f" | |||
| 11 | 11 | ||
| 12 | SRC_URI = "file://rotation \ | 12 | SRC_URI = "file://rotation \ |
| 13 | file://nsswitch.conf \ | 13 | file://nsswitch.conf \ |
| 14 | file://nsswitch-resolved.conf \ | ||
| 14 | file://motd \ | 15 | file://motd \ |
| 15 | file://hosts \ | 16 | file://hosts \ |
| 16 | file://host.conf \ | 17 | file://host.conf \ |
| @@ -23,7 +24,6 @@ SRC_URI = "file://rotation \ | |||
| 23 | file://share/dot.profile \ | 24 | file://share/dot.profile \ |
| 24 | file://licenses/GPL-2 \ | 25 | file://licenses/GPL-2 \ |
| 25 | " | 26 | " |
| 26 | SRC_URI:append:libc-glibc = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd systemd-resolved', ' file://0001-add-nss-resolve-to-nsswitch.patch', '', d)}" | ||
| 27 | 27 | ||
| 28 | S = "${WORKDIR}/sources" | 28 | S = "${WORKDIR}/sources" |
| 29 | UNPACKDIR = "${S}" | 29 | UNPACKDIR = "${S}" |
| @@ -124,7 +124,7 @@ do_install () { | |||
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | do_install:append:libc-glibc () { | 126 | do_install:append:libc-glibc () { |
| 127 | install -m 0644 ${S}/nsswitch.conf ${D}${sysconfdir}/nsswitch.conf | 127 | install -m 0644 ${S}/${@bb.utils.contains('DISTRO_FEATURES', 'systemd systemd-resolved', 'nsswitch-resolved.conf', 'nsswitch.conf', d)} ${D}${sysconfdir}/nsswitch.conf |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | DISTRO_VERSION[vardepsexclude] += "DATE" | 130 | DISTRO_VERSION[vardepsexclude] += "DATE" |
