[OE-core] [PATCH 3/4] systemd: add myhostname to nsswitch.conf

Dan McGregor danismostlikely at gmail.com
Wed Nov 18 03:49:01 UTC 2015


On 12 Nov 2015 5:41 p.m., "Christopher Larson" <kergoth at gmail.com> wrote:
>
> From: Christopher Larson <chris_larson at mentor.com>
>
> We don't need nss-myhostname on systemd systems, because systemd already
> provides myhostname, but we weren't configuring nsswitch to use it. Being
able
> to resolve the hostname is useful for a number of different applications,
so
> enable it using the same postinst/prerm bits which are in nss-myhostname.

I have this and a similar change for resolved in an append at work. Would
others be interested in that too?

>
> Signed-off-by: Christopher Larson <chris_larson at mentor.com>
> ---
>  meta/recipes-core/systemd/systemd_225.bb | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/meta/recipes-core/systemd/systemd_225.bb
b/meta/recipes-core/systemd/systemd_225.bb
> index 18c2448..20515f5 100644
> --- a/meta/recipes-core/systemd/systemd_225.bb
> +++ b/meta/recipes-core/systemd/systemd_225.bb
> @@ -397,6 +397,18 @@ ALTERNATIVE_TARGET[runlevel] =
"${base_bindir}/systemctl"
>  ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
>  ALTERNATIVE_PRIORITY[runlevel] ?= "300"
>
> +pkg_postinst_${PN} () {
> +       sed -e '/^hosts:/s/\s*\<myhostname\>//' \
> +               -e
's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname
\3\4\5/' \
> +               -i $D${sysconfdir}/nsswitch.conf
> +}
> +
> +pkg_prerm_${PN} () {
> +       sed -e '/^hosts:/s/\s*\<myhostname\>//' \
> +               -e '/^hosts:/s/\s*myhostname//' \
> +               -i $D${sysconfdir}/nsswitch.conf
> +}
> +
>  pkg_postinst_udev-hwdb () {
>         if test -n "$D"; then
>                 ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')}
hwdb --update \
> --
> 2.2.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20151117/de05727b/attachment-0002.html>


More information about the Openembedded-core mailing list