armdevvel / mxe-SHARED

MXE (M cross environment) for ARM32 Windows development (shared libraries)
Other
6 stars 3 forks source link

Component/toybox #50

Closed treeswift closed 8 months ago

treeswift commented 9 months ago

This pull request integrates toybox, a collection of *nix tools within a single multi-use binary. It is also a showcase of:

The Windows/MinGW fork of toybox being used provides approximately a third of the tools claimed by mainline Toybox, and roughly a half of the ones currently selected in its configuration. The ones that fail to build (approximately 90) are removed from the build. The ones that make it (also around 90) may not work as intended due to extensive stubbing of POSIX and Linux API, the lack of /sys and /proc, differences between nix and Windows permission models, differences between nix and Windows pipes and, finally, the proverbial lack of fork. However, this is still a significant expansion of our command line utility zoo.

Overall and optimistically, this garage sale buys us the following list of tools (some commands that make no sense on Windows are yet to be removed, but I am too happy right now with having prettified the build as is):

+[ +acpi -arch +ascii +base32 +base64 +basename -bash -blkdiscard
-blkid +bunzip2 +bzcat +cal +cat -chattr -chgrp +chmod -chown +chroot
-chvt +cksum +clear +cmp +comm -count -cp -cpio +crc32 +cut -date
-dd -deallocvt -devmem -df +dirname +dos2unix -du +echo +egrep -eject
+env +expand +factor +false +fgrep +file -find +fmt -free -freeramdisk
-fsfreeze -fstype -fsync +ftpget +ftpput +getopt -gitcheckout -gitclone
-gitfetch -gitinit -gitremote -gpiodetect -gpiofind -gpioget -gpioinfo
-gpioset +grep -groups +gunzip +gzip +head +help -hexedit +httpd -iconv
-id -inotifyd -install -iotop -kill -killall5 +link -linux32 +ln +logger
-logname -ls -lsattr +lsmod +lspci +lsusb -makedevs +mcookie +md5sum
+mkdir -mkfifo -mkpasswd +mountpoint -mv -nbd-client -nbd-server -nice
+nl +nohup -nproc +od -partprobe +paste +patch -pgrep +pidof -pivot_root
-pkill +pmap +printenv +printf -prlimit -ps +pwd +pwdx +pwgen -readahead
+readelf +readlink +realpath +renice +reset +rev +rm +rmdir -rtcwake
+sed +seq -setfattr -sh +sha1sum +sha224sum +sha256sum +sha384sum
+sha3sum +sha512sum +shred -shuf +sleep +sort +split -stat +strings
+sysctl +tac +tail -tar -taskset +tee +test -time -timeout -top -touch
-toysh +tr +true +truncate -tty -uclampset -ulimit -uname +unicode
+uniq +unix2dos +unlink -unshare -uptime +usleep +uudecode +uuencode
+uuidgen -vconfig -vmstat -w -watch -watchdog +wc -wget +which -who
-whoami -xargs +xxd +yes +zcat

cat works, grep works; some missing utilities, such as wget, only have a few holes to plumb. Command files (*.cmd) will be replaced with hardlinks once we have installation hooks in place.

File issues at: https://github.com/treeswift/toybox-mingw/issues

treeswift commented 9 months ago

I reviewed the use of _PATH_* macros; there will be a follow-up soon that removes a BSD'd paths.h stub in the otherwise PD project. But it's a data-only header anyway (a few string literals reflecting a popular convention mostly irrelevant on Windows). TL;DR can merge as is.