This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: [ITP] busybox 1.23.2-1
- From: Christian Franke <Christian dot Franke at t-online dot de>
- To: cygwin-apps at cygwin dot com
- Date: Fri, 26 Jun 2015 22:41:22 +0200
- Subject: Re: [ITP] busybox 1.23.2-1
- Authentication-results: sourceware.org; auth=none
- References: <20150626084405 dot GQ31223 at calimero dot vinschen dot de> <1249775739558d38eb7bd2e6 dot 92454804 at email dot t-online dot de> <87si9eqqlo dot fsf at Rainer dot invalid>
Achim Gratz wrote:
Christian Franke writes:
Hmm... it possibly would make sense to use alternatives(8) for the
/usr/bin/busybox symlink
(and move man page and doc files to a separate busybox-doc package).
Yes, please.
Agree. I will provide 3 packages:
- busybox: Normal shell mode, all commands below
/usr/share/libexec/busybox
- busybox-standalone: Standalone shell mode, same commands below
/usr/share/libexec/busybox-standalone.
- busybox-doc: man page and doc files.
postinstall scripts of both binary packages use update-alternatives to
install
/usr/bin/busybox ->
/usr/share/libexec/busybox{,-standalone}/bin/busybox.exe
preremove scripts remove an alternative only if still in auto mode.
Note that both versions could be used to create a tiny 'portable' Cygwin
by copying libexec/busybox{,-standalone} to /some/where.
Which variant is best depends on the use case.
How big would that package be in total? While certainly bigger than
setup.exe, it might perhaps provide an opportunity to bootstrap a full
Cygwin installation while staying in the POSIX world.
64-bit version:
$ cp -a /usr/libexec/busybox /tmp/tiny-cygwin
$ cp -a /bin/cygwin1.dll /tmp/tiny-cygwin/bin
$ du /tmp/tiny-cygwin
4055 /tmp/tiny-cygwin/bin
0 /tmp/tiny-cygwin/etc
0 /tmp/tiny-cygwin/lib
28 /tmp/tiny-cygwin/sbin
0 /tmp/tiny-cygwin/tmp
0 /tmp/tiny-cygwin/usr
4083 /tmp/tiny-cygwin
(On NTFS. A copy to a USB flash drive with a FAT will grow the
non-standalone version to ~10MB due to the many small symlink files).
Most space is used by cygwin1.dll itself.
busybox.exe with all working features enabled is ~600MB (bash: ~700MB).
Removing the daemons, other rarely used commands and some features could
reduce it to 300-350MB. I did't test LTO build which could further
reduce size.
On a small Cygwin installation, install busybox and set
PATH=/usr/local/bin:/usr/bin:/usr/libexec/busybox/bin
This will add tiny versions of various commands if the full package is
not installed.
Some busybox commands not included in Cygwin "Base" install:
bzip2, cpio, dos2unix, free, ftpget/put, hexdump, nc, pipe_progress, pscan,
pstree, unix2dos, telnet, top, watch, wget, which, unlzma, unzip, unxz.
IMO not too bad for a single exe which is smaller than bash.exe :-)
How compatible is it with (d)ash? Or rather is it at least the same
level of POSIX compliant? If it is, it should be in Base I'd say.
I did a few tests (e.g. running autoconf ./configure scripts) which
worked as expected. I didn't run any test suite.
According to the sourcecode, the busybox ash has the same origin as
dash: the Almquist SHell.
Today I retried on another machine and it works. Looks like there is
some interesting problem in the Cygwin 64 installation on my build
machine :-)
How up-to-date is you binutils installation? Also, IIRC JonY has been
swapping a few packages without bumping the release numbers, so maybe
try to re-install the toolchains.
Meantime I found the issue:
The 64-bit version was built from a directory reached via a symlink
[$(pwd) != $(/bin/pwd)].
Unfortunately (in this case), bash passes the symlink version of the
path down to cygport via PWD and this somehow breaks the debug source
detection.
Using (cd $(/bin/pwd) && cygport ...) fixes the problem.
Christian