Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Baruch Siach <baruch@tkos.co.il>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 2/2] coreutils: optimize the '[' symlink
Date: Thu, 12 Jul 2018 22:02:18 +0300	[thread overview]
Message-ID: <87va9kffb9.fsf@tkos.co.il> (raw)
In-Reply-To: <7ebb787a-3798-5534-9cef-2012943d50ad@mind.be>

Hi Arnout,

Arnout Vandecappelle writes:
> On 11-07-18 21:51, Baruch Siach wrote:
>> Link '[' directly to the coreutils binary instead of going through
>> 'test'.
>
>  One more small question: did you do a runtime test to be sure that this
> actually works? (That said, if this doesn't work, then the previous one also
> can't have worked.)

Tested in chroot now:
# readlink /usr/bin/[
coreutils
# if /usr/bin/[ 0 -eq 0 ]; then echo true; else echo false; fi
true
# if /usr/bin/[ 1 -eq 0 ]; then echo true; else echo false; fi
false

baruch

>> Suggested-by: Arnout Vandecappelle <arnout@mind.be>
>> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
>> ---
>> v2: New patch in this series
>> ---
>>  package/coreutils/coreutils.mk | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/package/coreutils/coreutils.mk b/package/coreutils/coreutils.mk
>> index 2fb4a32c794f..7e7251ff7396 100644
>> --- a/package/coreutils/coreutils.mk
>> +++ b/package/coreutils/coreutils.mk
>> @@ -112,7 +112,7 @@ endif
>>  
>>  define COREUTILS_CLEANUP
>>  	# link for archaic shells
>> -	ln -fs test $(TARGET_DIR)/usr/bin/[
>> +	ln -fs coreutils $(TARGET_DIR)/usr/bin/[
>>  	# gnu thinks chroot is in bin, debian thinks it's in sbin
>>  	rm -f $(TARGET_DIR)/usr/bin/chroot
>>  	ln -sf ../bin/coreutils $(TARGET_DIR)/usr/sbin/chroot

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

  parent reply	other threads:[~2018-07-12 19:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-11 19:51 [Buildroot] [PATCH v2 1/2] coreutils: fix chroot installation Baruch Siach
2018-07-11 19:51 ` [Buildroot] [PATCH v2 2/2] coreutils: optimize the '[' symlink Baruch Siach
2018-07-11 21:48   ` Carlos Santos
2018-07-11 21:49   ` Arnout Vandecappelle
2018-07-11 22:06     ` Carlos Santos
2018-07-12 19:02     ` Baruch Siach [this message]
2018-07-16 14:41 ` [Buildroot] [PATCH v2 1/2] coreutils: fix chroot installation Thomas Petazzoni
2018-07-19 21:38 ` Peter Korsgaard

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=87va9kffb9.fsf@tkos.co.il \
    --to=baruch@tkos.co.il \
    --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