All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [git commit] nss-mdns: unbreak after e1eba3d97 (system/skeleton: make nsswitch install conditional)
@ 2014-10-31 10:31 Peter Korsgaard
  2014-10-31 11:20 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Korsgaard @ 2014-10-31 10:31 UTC (permalink / raw)
  To: buildroot

commit: http://git.buildroot.net/buildroot/commit/?id=c7c0ca288dc8bf758c4324e23fc5853192d23d7a
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Fixes http://autobuild.buildroot.net/results/481/4819cacd4b7015ef2bfaaf1b3fc9ba33f9194315/

After commit e1eba3d97, the skeleton no longer has a /etc/nsswitch.conf by
the time nss-mdns gets built, so the sed invocation fails.

Work around it by installing the glibc one early if not already available
in the skeleton.

If we want to do further modification of nsswitch.conf in the future (for
E.G.  samba), then we should probably introduce some hooks to
GLIBC_COPY_NSSWITCH_FILE instead.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 package/nss-mdns/nss-mdns.mk |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/package/nss-mdns/nss-mdns.mk b/package/nss-mdns/nss-mdns.mk
index 8d23f89..22c2bc2 100644
--- a/package/nss-mdns/nss-mdns.mk
+++ b/package/nss-mdns/nss-mdns.mk
@@ -10,6 +10,9 @@ NSS_MDNS_LICENSE = LGPLv2.1+
 NSS_MDNS_LICENSE_FILES = LICENSE
 
 define NSS_MDNS_INSTALL_CONFIG
+	if [ ! -f "$(TARGET_DIR)/etc/nsswitch.conf" ]; then \
+		$(INSTALL) -D -m 0644 package/glibc/nsswitch.conf $(TARGET_DIR)/etc/nsswitch.conf ; \
+	fi
 	sed -r -i -e 's/^(hosts:[[:space:]]+).*/\1files mdns4_minimal [NOTFOUND=return] dns mdns4/' \
 	    $(TARGET_DIR)/etc/nsswitch.conf
 endef

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [git commit] nss-mdns: unbreak after e1eba3d97 (system/skeleton: make nsswitch install conditional)
  2014-10-31 10:31 [Buildroot] [git commit] nss-mdns: unbreak after e1eba3d97 (system/skeleton: make nsswitch install conditional) Peter Korsgaard
@ 2014-10-31 11:20 ` Thomas Petazzoni
  2014-10-31 11:54   ` Peter Korsgaard
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2014-10-31 11:20 UTC (permalink / raw)
  To: buildroot

Dear Peter Korsgaard,

On Fri, 31 Oct 2014 11:31:05 +0100, Peter Korsgaard wrote:

> diff --git a/package/nss-mdns/nss-mdns.mk b/package/nss-mdns/nss-mdns.mk
> index 8d23f89..22c2bc2 100644
> --- a/package/nss-mdns/nss-mdns.mk
> +++ b/package/nss-mdns/nss-mdns.mk
> @@ -10,6 +10,9 @@ NSS_MDNS_LICENSE = LGPLv2.1+
>  NSS_MDNS_LICENSE_FILES = LICENSE
>  
>  define NSS_MDNS_INSTALL_CONFIG
> +	if [ ! -f "$(TARGET_DIR)/etc/nsswitch.conf" ]; then \
> +		$(INSTALL) -D -m 0644 package/glibc/nsswitch.conf $(TARGET_DIR)/etc/nsswitch.conf ; \
> +	fi
>  	sed -r -i -e 's/^(hosts:[[:space:]]+).*/\1files mdns4_minimal [NOTFOUND=return] dns mdns4/' \
>  	    $(TARGET_DIR)/etc/nsswitch.conf
>  endef

As I already pointed out when I reviewed Gustavo's patch about
nsswitch.conf, it's not the correct approach. This file should be
installed by the glibc and toolchain-external packages. This way, it is
guaranteed to be there when nss-mdns or samba want to modify.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [git commit] nss-mdns: unbreak after e1eba3d97 (system/skeleton: make nsswitch install conditional)
  2014-10-31 11:20 ` Thomas Petazzoni
@ 2014-10-31 11:54   ` Peter Korsgaard
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2014-10-31 11:54 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

Hi,

 >> define NSS_MDNS_INSTALL_CONFIG
 >> +	if [ ! -f "$(TARGET_DIR)/etc/nsswitch.conf" ]; then \
 >> +		$(INSTALL) -D -m 0644 package/glibc/nsswitch.conf $(TARGET_DIR)/etc/nsswitch.conf ; \
 >> +	fi
 >> sed -r -i -e 's/^(hosts:[[:space:]]+).*/\1files mdns4_minimal [NOTFOUND=return] dns mdns4/' \
 >> $(TARGET_DIR)/etc/nsswitch.conf
 >> endef

 > As I already pointed out when I reviewed Gustavo's patch about
 > nsswitch.conf, it's not the correct approach. This file should be
 > installed by the glibc and toolchain-external packages. This way, it is
 > guaranteed to be there when nss-mdns or samba want to modify.

True. Care to send a patch to implement this?

-- 
Bye, Peter Korsgaard 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-31 11:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-31 10:31 [Buildroot] [git commit] nss-mdns: unbreak after e1eba3d97 (system/skeleton: make nsswitch install conditional) Peter Korsgaard
2014-10-31 11:20 ` Thomas Petazzoni
2014-10-31 11:54   ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.