From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v3] package/systemd: register NSS plugins in nsswitch.conf
Date: Sat, 4 Jul 2020 10:00:25 +0200 [thread overview]
Message-ID: <20200704080025.GC2273@scaer> (raw)
In-Reply-To: <20200703234923.174320-1-nolange79@gmail.com>
Norbert, All,
On 2020-07-04 01:49 +0200, Norbert Lange spake thusly:
> This supports 4 plugins, each will be added at the right
> spot if enabled, based on the template coming with systemd.
[--SNIP--]
> Signed-off-by: Norbert Lange <nolange79@gmail.com>
> ---
> v3:
> * basically a rewrite
> * tested together with nss_mdns4 replacements
> ---
> package/systemd/systemd.mk | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
> index 8e01a0db5b..2e6c81bd75 100644
> --- a/package/systemd/systemd.mk
> +++ b/package/systemd/systemd.mk
> @@ -473,7 +473,27 @@ define SYSTEMD_INSTALL_MACHINEID_HOOK
> touch $(TARGET_DIR)/etc/machine-id
> endef
>
> +# anchor nss_resolve after files, if mymachines is also used, remove that first
> +# and add it back. this is necessary as other packages (mdns) move around
> +# the dns entry.
> +
> +define SYSTEMD_ADD_NSSCONFIG_HOOK
> + $(SED) '/^passwd:/ {/systemd/! s/$$/ systemd/}' \
> + -e '/^group:/ {/systemd/! s/$$/ systemd/}' \
> + $(if $(BR2_PACKAGE_SYSTEMD_RESOLVED), \
> + -e '/^hosts:/ s/[[:space:]]*mymachines//' \
> + -e '/^hosts:/ {/resolve/! s/files/files resolve [!UNAVAIL=return]/}' ) \
> + $(if $(BR2_PACKAGE_SYSTEMD_MYHOSTNAME), \
> + -e '/^hosts:/ {/myhostname/! s/$$/ myhostname/}' ) \
> + $(if $(BR2_PACKAGE_SYSTEMD_MACHINED), \
> + -e '/^passwd:/ {/mymachines/! s/files/files mymachines/}' \
> + -e '/^group:/ {/mymachines/! s/files/files [SUCCESS=merge] mymachines [SUCCESS=merge]/}' \
> + -e '/^hosts:/ {/mymachines/! s/files/files mymachines/}' ) \
> + $(TARGET_DIR)/etc/nsswitch.conf
> +endef
> +
> SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
> + SYSTEMD_ADD_NSSCONFIG_HOOK \
As I already said: ths must be a target-finalize hook, not a
post-install hook.
Regards,
Yann E. MORIN.
> SYSTEMD_INSTALL_INIT_HOOK \
> SYSTEMD_INSTALL_MACHINEID_HOOK \
> SYSTEMD_INSTALL_RESOLVCONF_HOOK
> --
> 2.27.0
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
next prev parent reply other threads:[~2020-07-04 8:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-03 23:49 [Buildroot] [PATCH v3] package/systemd: register NSS plugins in nsswitch.conf Norbert Lange
2020-07-04 8:00 ` Yann E. MORIN [this message]
2020-07-04 17:15 ` Norbert Lange
2020-07-04 19:27 ` Yann E. MORIN
2020-07-04 20:49 ` Norbert Lange
2020-07-04 21:38 ` Yann E. MORIN
2020-07-04 22:17 ` Norbert Lange
2020-07-05 6:55 ` Yann E. MORIN
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200704080025.GC2273@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox