[PATCH] Busybox 1.23.2 for Cygwin

Christian Franke Christian.Franke at t-online.de
Mon Jul 6 16:40:07 UTC 2015


Hi,

thanks for providing BusyBox.

Just for info:
A Cygwin port is now available in the Cygwin net distribution:

https://cygwin.com/cgi-bin2/package-grep.cgi?grep=busybox
https://cygwin.com/ml/cygwin/2015-07/msg00072.html

diffstat:
configs/cygwin_defconfig     |  332 
++++++++++++++++++++++++-------------------
coreutils/date.c             |    7
coreutils/du.c               |    4
coreutils/ls.c               |    3
coreutils/stat.c             |    2
include/applets.src.h        |    2
include/libbb.h              |   30 +++
include/platform.h           |   24 ++-
libbb/missing_syscalls.c     |    3
libbb/read_key.c             |    6
libbb/udp_io.c               |    5
miscutils/man.c              |    6
networking/hostname.c        |    6
networking/ip_icmp_missing.h |  162 ++++++++++++++++++++
networking/nslookup.c        |   17 +-
networking/ping.c            |   26 +--
networking/traceroute.c      |   32 +++-
procps/ps.c                  |    6
procps/top.c                 |    2
shell/ash.c                  |   17 ++
20 files changed, 516 insertions(+), 176 deletions(-)


The patch is available here:

http://chrfranke.no-ip.org/cygwin/busybox-1.23.2-1.src.patch


Not Cygwin specific changes:

- libbb.h: Add ugly hack to hide incompatible itoa()/utoa() defined in 
stdlib.h.

(Suggestion: Rename libbb's itoa() and utoa() in all source files to 
improve portability. Such incompatible versions exist in stdlib.h of 
various non-GNU C-Libraries)

- libbb.h: Define DEV_BSIZE if missing in param.h.

(Possibly not required for most platforms)

- platform.h: Various (un)defines related to other changes.

- date.c: Use clock_gettime() if syscall.h is not available.

- du.c, ls.c, stat.c: Use DEV_BSIZE instead of 512 as size of 
stat.st_blocks. Cygwin uses DEV_BSIZE=1024.

(Should possibly better use S_BLKSIZE or add a warning if DEV_BSIZE != 
S_BLKSIZE ?)

- hostname.c: Support platforms without sethostname(). It is not part of 
POSIX.

(Suggestion: Add FEATURE_HOSTNAME_CAN_SET_HOSTNAME)

- man.c: Allow to customize the formatting command. Cygwin installs GNU 
tbl as "tbl" not "gtbl".

(Suggestion: Add FEATURE_MAN_FORMATTING_COMMAND)

- missing_syscalls.c: Include syscall.h only if required.

- nslookup.c: Disable IPv6 server support if _res._u._ext.nsaddrs is 
missing.

- ps.c: Support platforms with Kernel_HZ == sysinfo(_SC_CLK_TCK).

- read_key.c: Allow to customize poll() timeout after ESC. Required for 
Windows console, not required for mintty.

(Suggestion: Add FEATURE_ESC_KEY_POLL_TIMEOUT)

- udp_io.c: Disable PKTINFO if in_pktinfo.ipi_spec_dst is missing.

- top.c: Accept /proc/stat cpu lines with only 4 values.


Cygwin specific changes:

- cygwin_defconfig: Enable everything which compiles and could do 
something useful.

- libbb.h: Add missing include sys/sysinfo.h.
Add missing sigisemptyset().

- platform.h: ptsname_r() is available in Cygwin. Various (un)defines 
related to other changes.

- applets.src.h: Don't install mkpasswd as alias for cryptpw. Cygwin's 
mkpasswd reads info from Windows SAM or AD database.

(Suggestion: Add FEATURE_MKPASSWD_ALIAS)

- ip_icmp_missing.h: New file with missing declarations from netinet/*.h.

- ash.c: Allow 'cd' to Windows path.

- nslookup.c: Handle empty DNS server list properly.
Print warning because getaddrinfo() uses Winsock and therefore ignores 
server configured in resolver library.

(Suggestion: If SERVER parameter is provided, use direct resolver lib 
calls instead of getaddrinfo())

- ping.c: Include ip_icmp_missing.h.
Disable IP_MULTICAST_IF and IPV6_CHECKSUM.

- traceroute.c: Include ip_icmp_missing.h.
Use one raw ICMP socket for send and receive due to a limitation of 
Windows sockets.
Disable UDP and IP_MULTICAST_IF.
Disable uid 0 check. Windows has no unique privileged user, Cygwin has 
no uid 0.


A Linux build of 1.23.2 + patch works. Due to limited time, I didn't try 
a merge to git master yet.

Thanks,
Christian



More information about the busybox mailing list