Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/2] system/skeleton: make nsswitch install conditional
Date: Tue, 21 Oct 2014 20:49:18 +0200	[thread overview]
Message-ID: <5446AAAE.80604@mind.be> (raw)
In-Reply-To: <20141020150209.5f8b45a5@free-electrons.com>

On 20/10/14 15:02, Thomas Petazzoni wrote:
> Dear Gustavo Zacarias,
> 
> On Mon, 20 Oct 2014 09:28:05 -0300, Gustavo Zacarias wrote:
>> Don't blindly install the /etc/nsswitch.conf file, it's useless for
>> toolchains that aren't (e)glibc-based and misleading.
>> Make the installation conditional on a (e)glibc toolchain.
>>
>> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
>> ---
>>  {system/skeleton/etc => package/glibc}/nsswitch.conf |  0
>>  toolchain/toolchain.mk                               | 10 ++++++++++
>>  2 files changed, 10 insertions(+)
>>  rename {system/skeleton/etc => package/glibc}/nsswitch.conf (100%)
>>
>> diff --git a/system/skeleton/etc/nsswitch.conf b/package/glibc/nsswitch.conf
>> similarity index 100%
>> rename from system/skeleton/etc/nsswitch.conf
>> rename to package/glibc/nsswitch.conf
>> diff --git a/toolchain/toolchain.mk b/toolchain/toolchain.mk
>> index 8fe06ff..3f3534a 100644
>> --- a/toolchain/toolchain.mk
>> +++ b/toolchain/toolchain.mk
>> @@ -3,6 +3,16 @@
>>  # TARGET_FINALIZE_HOOKS, to be applied just after all packages
>>  # have been built.
>>  
>> +# Install default nsswitch.conf file if the skeleton doesn't provide it
>> +ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
>> +define GLIBC_COPY_NSSWITCH_FILE
>> +	$(Q)if [ ! -f "$(TARGET_DIR)/etc/nsswitch.conf" ]; then \
>> +		cp -a package/glibc/nsswitch.conf $(TARGET_DIR)/etc; \
> 
> 		$(INSTALL) -D -m 0644
> 
> maybe ?
> 
>> +	fi
>> +endef
>> +TARGET_FINALIZE_HOOKS += GLIBC_COPY_NSSWITCH_FILE
>> +endif
> 
> Also, I believe I'd prefer to see this being done in the glibc package
> and in the toolchain-external package. I know it's a bit redundant to
> have it twice, but I'd like to not have too many files that get
> installed through the finalize hooks.

 After reading the whole thread, I'm with gustavoz on this one.

- If you do it in glibc + toolchain-external, you have duplication.

- We expect a skeleton package to appear. When it exists, this and a few other
finalize things can go there instead. In that case, you have no duplication anymore.

- The patch to move this from a finalize hook to the skeleton package will be a
lot simpler than a patch that moves it out of glibc + toolchain-external. In
addition, it's easier to forget it when it's spread out like that.

- We have this patch now, we don't have a patch that puts it in glibc +
toolchain-external.

 Therefore,

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>


 Regards,
 Arnout
-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

  parent reply	other threads:[~2014-10-21 18:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-20 12:28 [Buildroot] [PATCH 1/2] system/skeleton: make nsswitch install conditional Gustavo Zacarias
2014-10-20 12:28 ` [Buildroot] [PATCH 2/2] glibc/nsswitch.conf: also lookup on dns for networks Gustavo Zacarias
2014-10-20 13:02 ` [Buildroot] [PATCH 1/2] system/skeleton: make nsswitch install conditional Thomas Petazzoni
2014-10-20 13:19   ` Gustavo Zacarias
2014-10-20 13:27     ` Thomas Petazzoni
2014-10-20 13:34       ` Gustavo Zacarias
2014-10-20 13:37         ` Thomas Petazzoni
2014-10-20 13:43           ` Gustavo Zacarias
2014-10-20 13:54             ` Thomas Petazzoni
2014-10-20 14:12               ` Gustavo Zacarias
2014-10-20 14:28                 ` Thomas Petazzoni
2014-10-22 14:10                   ` Maxime Hadjinlian
2014-10-22 19:44                     ` Gustavo Zacarias
2014-10-22 19:49                       ` Gustavo Zacarias
2014-10-23 17:47                         ` Maxime Hadjinlian
2014-10-21 18:49   ` Arnout Vandecappelle [this message]
2014-10-25 10:49 ` Thomas Petazzoni

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=5446AAAE.80604@mind.be \
    --to=arnout@mind.be \
    --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