[Toybox] macOS sitrep
Rob Landley
rob at landley.net
Fri Dec 7 19:36:14 PST 2018
On 12/7/18 8:28 PM, enh wrote:
> On Tue, Dec 4, 2018 at 8:05 PM Rob Landley <rob at landley.net> wrote:
>>
>> On 12/4/18 7:06 PM, enh wrote:
>>> okay, so now toybox builds out of the box (with a custom .config) i
>>> added a bunch more stuff to my .config. the following were all
>>> painless:
>>>
>>> ascii base64 basename cal cat catv chgrp chmod chown cksum clear cmp
>>> comm count cpio crc32 cut dirname dos2unix du echo egrep env expand
>>> factor false fgrep file flock fmt ftpget ftpput grep groups head help
>>> hexedit hostname iconv id kill killall5 link ln logname md5sum microcom
>>> mkdir mkfifo mktemp nc netcat nice nl nohup od paste patch printenv
>>> printf pwd pwdx readlink realpath renice rev rm rmdir sed seq setsid
>>> sha1sum sha224sum sha256sum sha384sum sha512sum sleep sort split strings
>>> tac tee timeout true truncate tty uname uniq unix2dos unlink usleep
>>> uudecode uuencode uuidgen w watch wc which who whoami xargs xxd yes
>>
>> Could you send me your .config? I can check in a "make macos_defconfig".
>
> with the two extra patches i just sent to the list, you can build a
> whole bunch of stuff:
Applied.
> ascii base64 basename cal cat catv chgrp chmod chown cksum clear cmp
> comm count cpio crc32 cut date dirname dos2unix du echo egrep env
> expand factor false fgrep file find flock fmt ftpget ftpput getconf
> grep groups head help hexedit hostname iconv id kill killall5 link
> ln logger logname ls md5sum microcom mkdir mkfifo nc netcat nice nl
> nohup od paste patch printenv printf pwd pwdx readlink realpath renice
> rev rm rmdir sed seq setsid sha1sum sha224sum sha256sum sha384sum
> sha512sum sleep sort split strings tac tee time timeout touch tr true
> truncate tty uname uniq unix2dos unlink usleep uudecode uuencode uuidgen
> w watch wc which who whoami xargs xxd yes
Which means it's _not_ building.... (rummage rummage)
acpi blkid blockdev bunzip2 bzcat chattr chroot chrt chvt cp df dmesg eject
fallocate free freeramdisk fsfreeze fstype fsync halt hwclock i2cdetect i2cdump
i2cget i2cset ifconfig inotifyd insmod install ionice iorenice iotop killall
login losetup lsattr lsmod lspci lsusb makedevs mix mknod mkpasswd mkswap mktemp
modinfo mount mountpoint mv nbd-client netstat nproc oneit partprobe passwd
pgrep pidof ping ping6 pivot_root pkill pmap poweroff prlimit ps readahead
reboot reset rfkill rmmod setfattr shred stat su swapoff swapon switch_root sync
sysctl tail taskset test top tunctl ulimit umount uptime vconfig vmstat
Hmmm... bunzip2 and bzcat are easy, reset, sync, mktemp, and test might already
work, shred is trivial but silly on journaled filesystems (it was a request),
dunno how much work stat is, tail has two codepaths and one's probably easy...
The cp/install/mktemp/mv cluser... dunno what's missing? IN theory the openat()
stuff is posix-2008?
ps/top/iotop/pkill/pgrep are probably a nightmare because of the /proc stuff and
I have no idea what a macos equivalent would look like.
Most of the rest probably doesn't apply conceptually. (I mean... maaaaaybe
blkid? Dunno what macos does for mount...)
> i've basically ignored pending for now, because i was only originally
> hoping to answer the question "is this feasible?" and i think we have
> a pretty strong "yes" that includes most of the things we'd need for a
> mac AOSP build already.
Cool.
> i might try to get the xattr portability wrapper done before i have to
> give the mac back, but otherwise i'm hanging the "mission
> accomplished" banner for now and will worry about actually, you know,
> _using_ this stuff some other day. probably after i've finished
> getting linux AOSP builds switched over, which is much more
> interesting to me anyway (and especially in the short term).
I wonder how horrible building this subset under https://midipix.org and/or the
Windows linux binary running thingy interface is?
> i've attached my config. note that i've included TODOs explaining why
> a few of the main failures don't build. tail's inotify is
> interesting/annoying.
It's all for FLAG_f. I could add a compile-time probe with a config symbol and a
portability.h stub? (Or move the sys/inotify.h #include into portability.h so
#ifdef APPLE could #else it...)
>>> (i haven't even bothered trying anything from pending.)
>>
>> If you get the urge for specific commands out of there, lemme know. I just
>> finished redoing test.c and I'm squinting at tftpd.c now (using a dhcp/bootp
>> thing at $DAYJOB)...
>
> of the stuff in pending, AOSP builds would use dd, diff, egrep, grep,
> tar, and tr.
grep isn't in pending, but I need to add --color support.
> all of which were on your "non-trivial" list. (we're
> _building_ toybox's grep family, but we're still using the BSD ones.
> Q/master is currently using toybox dd [P had BSD dd].)
Lemme see what I can get done on grep --color this weekend...
The macos regex() implementation is still a bit different from any of the
linuxes, might still cause a problem there...
Rob
More information about the Toybox
mailing list