<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Dec 7, 2018, 19:36 Rob Landley <<a href="mailto:rob@landley.net">rob@landley.net</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On 12/7/18 8:28 PM, enh wrote:<br>
> On Tue, Dec 4, 2018 at 8:05 PM Rob Landley <<a href="mailto:rob@landley.net" target="_blank" rel="noreferrer">rob@landley.net</a>> wrote:<br>
>><br>
>> On 12/4/18 7:06 PM, enh wrote:<br>
>>> okay, so now toybox builds out of the box (with a custom .config) i<br>
>>> added a bunch more stuff to my .config. the following were all<br>
>>> painless:<br>
>>><br>
>>> ascii base64 basename cal cat catv chgrp chmod chown cksum clear cmp<br>
>>> comm count cpio crc32 cut dirname dos2unix du echo egrep env expand<br>
>>> factor false fgrep file flock fmt ftpget ftpput grep groups head help<br>
>>> hexedit hostname iconv id kill killall5 link ln logname md5sum microcom<br>
>>> mkdir mkfifo mktemp nc netcat nice nl nohup od paste patch printenv<br>
>>> printf pwd pwdx readlink realpath renice rev rm rmdir sed seq setsid<br>
>>> sha1sum sha224sum sha256sum sha384sum sha512sum sleep sort split strings<br>
>>> tac tee timeout true truncate tty uname uniq unix2dos unlink usleep<br>
>>> uudecode uuencode uuidgen w watch wc which who whoami xargs xxd yes<br>
>><br>
>> Could you send me your .config? I can check in a "make macos_defconfig".<br>
> <br>
> with the two extra patches i just sent to the list, you can build a<br>
> whole bunch of stuff:<br>
<br>
Applied.<br>
<br>
> ascii base64 basename cal cat catv chgrp chmod chown cksum clear cmp<br>
> comm count cpio crc32 cut date dirname dos2unix du echo egrep env<br>
> expand factor false fgrep file find flock fmt ftpget ftpput getconf<br>
> grep groups head help hexedit hostname iconv id kill killall5 link<br>
> ln logger logname ls md5sum microcom mkdir mkfifo nc netcat nice nl<br>
> nohup od paste patch printenv printf pwd pwdx readlink realpath renice<br>
> rev rm rmdir sed seq setsid sha1sum sha224sum sha256sum sha384sum<br>
> sha512sum sleep sort split strings tac tee time timeout touch tr true<br>
> truncate tty uname uniq unix2dos unlink usleep uudecode uuencode uuidgen<br>
> w watch wc which who whoami xargs xxd yes<br>
<br>
Which means it's _not_ building.... (rummage rummage)<br>
<br>
acpi blkid blockdev bunzip2 bzcat chattr chroot chrt chvt cp df dmesg eject<br>
fallocate free freeramdisk fsfreeze fstype fsync halt hwclock i2cdetect i2cdump<br>
i2cget i2cset ifconfig inotifyd insmod install ionice iorenice iotop killall<br>
login losetup lsattr lsmod lspci lsusb makedevs mix mknod mkpasswd mkswap mktemp<br>
modinfo mount mountpoint mv nbd-client netstat nproc oneit partprobe passwd<br>
pgrep pidof ping ping6 pivot_root pkill pmap poweroff prlimit ps readahead<br>
reboot reset rfkill rmmod setfattr shred stat su swapoff swapon switch_root sync<br>
sysctl tail taskset test top tunctl ulimit umount uptime vconfig vmstat<br>
<br>
<br>
Hmmm... bunzip2 and bzcat are easy, reset, sync, mktemp, and test might already<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">mktemp was disabled here only because ToT was broken. iirc I've built it before. </div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
work, shred is trivial but silly on journaled filesystems (it was a request),<br>
dunno how much work stat is, tail has two codepaths and one's probably easy...<br>
<br>
The cp/install/mktemp/mv cluser... dunno what's missing? IN theory the openat()<br>
stuff is posix-2008?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">I explained in my mail *and* had a TODO comment in .config explaining it :-P</div><div dir="auto"><br></div><div dir="auto">Basically, BSD has a different API for xattrs. </div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
ps/top/iotop/pkill/pgrep are probably a nightmare because of the /proc stuff and<br>
I have no idea what a macos equivalent would look like.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Yeah, one of the build guys tells me he's actually looked at this recently and found that there doesn't seem to be an official API. Meh... We can worry about these if we ever have real macOS users. </div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Most of the rest probably doesn't apply conceptually. (I mean... maaaaaybe<br>
blkid? Dunno what macos does for mount...)<br>
<br>
> i've basically ignored pending for now, because i was only originally<br>
> hoping to answer the question "is this feasible?" and i think we have<br>
> a pretty strong "yes" that includes most of the things we'd need for a<br>
> mac AOSP build already.<br>
<br>
Cool.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">(You'll see I did build tr, even though it's in pending. That was because the build guy specifically asked. But I don't plan on using anything in pending in the build. I'm concerned enough about stability as it is, without relying on things that are going to get major rewrites.)</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> i might try to get the xattr portability wrapper done before i have to<br>
> give the mac back, but otherwise i'm hanging the "mission<br>
> accomplished" banner for now and will worry about actually, you know,<br>
> _using_ this stuff some other day. probably after i've finished<br>
> getting linux AOSP builds switched over, which is much more<br>
> interesting to me anyway (and especially in the short term).<br>
<br>
I wonder how horrible building this subset under <a href="https://midipix.org" rel="noreferrer noreferrer" target="_blank">https://midipix.org</a> and/or the<br>
Windows linux binary running thingy interface is?<br>
<br>
> i've attached my config. note that i've included TODOs explaining why<br>
> a few of the main failures don't build. tail's inotify is<br>
> interesting/annoying.<br>
<br>
It's all for FLAG_f. I could add a compile-time probe with a config symbol and a<br>
portability.h stub? (Or move the sys/inotify.h #include into portability.h so<br>
#ifdef APPLE could #else it...)<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Yeah, that works for tail. I suggested the ON_BSD/ON_LINUX for general use because it seemed like that would be a better way to have the config stuff work. I was thinking more of things like insmod. But maybe there aren't actually many cases where the whole command is meaningless (as opposed to just some specific option).</div><div dir="auto"><br></div><div dir="auto">Like I say, I'll try to have a look at the last few POSIX toys before I return the loaner Mac. (And I'll borrow another when I've finished switching AOSP over for Linux and I'm ready to think seriously about macOS.)</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
>>> (i haven't even bothered trying anything from pending.)<br>
>><br>
>> If you get the urge for specific commands out of there, lemme know. I just<br>
>> finished redoing test.c and I'm squinting at tftpd.c now (using a dhcp/bootp<br>
>> thing at $DAYJOB)...<br>
> <br>
> of the stuff in pending, AOSP builds would use dd, diff, egrep, grep,<br>
> tar, and tr.<br>
<br>
grep isn't in pending, but I need to add --color support.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Yes, to me that's conceptually still in pending because I think it's going to be a pretty big rewrite 😀</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> all of which were on your "non-trivial" list. (we're<br>
> _building_ toybox's grep family, but we're still using the BSD ones.<br>
> Q/master is currently using toybox dd [P had BSD dd].)<br>
<br>
Lemme see what I can get done on grep --color this weekend...<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">If you're quick I might even risk switching Android over for Q... December is when I stop making drastic changes. My notes only really mention --color:</div><div dir="auto"><br></div><div dir="auto"><span style="font-size:11pt;font-family:roboto;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">grep --- missing --color. compare performance with BSD grep before switching; BSD grep has workarounds for performance in the BSD regex implementation (if we find anything we should see if we can fix bionic instead).</span><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The macos regex() implementation is still a bit different from any of the<br>
linuxes, might still cause a problem there...<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">But probably similar to bionic, I'd imagine...</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Rob<br>
</blockquote></div></div></div>