1*cf5a6c84SAndroid Build Coastguard Worker<html><head><title>toybox roadmap</title> 2*cf5a6c84SAndroid Build Coastguard Worker<!--#include file="header.html" --> 3*cf5a6c84SAndroid Build Coastguard Worker<title>Toybox Roadmap</title> 4*cf5a6c84SAndroid Build Coastguard Worker 5*cf5a6c84SAndroid Build Coastguard Worker<h2>Roadmap sections</h2> 6*cf5a6c84SAndroid Build Coastguard Worker 7*cf5a6c84SAndroid Build Coastguard Worker<ul> 8*cf5a6c84SAndroid Build Coastguard Worker<li><a href=#goals>Introduction</a></li> 9*cf5a6c84SAndroid Build Coastguard Worker<li><a href=#susv4>POSIX-2008/SUSv4</a></li> 10*cf5a6c84SAndroid Build Coastguard Worker<li><a href=#sigh>Linux "Standard" Base</a></li> 11*cf5a6c84SAndroid Build Coastguard Worker<li><a href=#rfc>IETF RFCs and Man Pages</a></li> 12*cf5a6c84SAndroid Build Coastguard Worker<li><a href=#dev_env>Development Environment</a></li> 13*cf5a6c84SAndroid Build Coastguard Worker<li><a href=#android>Android Toolbox</a></li> 14*cf5a6c84SAndroid Build Coastguard Worker<li><a href=#aosp>Building AOSP</a></li> 15*cf5a6c84SAndroid Build Coastguard Worker<li><a href=#tizen>Tizen Core</a></li> 16*cf5a6c84SAndroid Build Coastguard Worker<li><a href=#yocto>Yocto</a></li> 17*cf5a6c84SAndroid Build Coastguard Worker<li><a href=#fhs>Filesystem Hierachy Standard</a></li> 18*cf5a6c84SAndroid Build Coastguard Worker<li><a href=#buildroot>buildroot</a></li> 19*cf5a6c84SAndroid Build Coastguard Worker<li>Miscelaneous: <a href=#klibc>klibc</a>, <a href=#glibc>glibc</a>, 20*cf5a6c84SAndroid Build Coastguard Worker<a href=#sash>sash</a>, <a href=#sbase>sbase</a>, 21*cf5a6c84SAndroid Build Coastguard Worker<a href=#uclinux>uclinux</a>...</li> 22*cf5a6c84SAndroid Build Coastguard Worker<li><a href=#packages>Other Packages</a></li> 23*cf5a6c84SAndroid Build Coastguard Worker<li><a href=#todo>TODO list</a></li> 24*cf5a6c84SAndroid Build Coastguard Worker</ul> 25*cf5a6c84SAndroid Build Coastguard Worker 26*cf5a6c84SAndroid Build Coastguard Worker<a name="goals" /> 27*cf5a6c84SAndroid Build Coastguard Worker<h2>Introduction (Goals and use cases)</h2> 28*cf5a6c84SAndroid Build Coastguard Worker 29*cf5a6c84SAndroid Build Coastguard Worker<p>We have several potential use cases for a new set of command line 30*cf5a6c84SAndroid Build Coastguard Workerutilities, and are using those to determine which commands to implement 31*cf5a6c84SAndroid Build Coastguard Workerfor Toybox's 1.0 release. Most of these have their own section in the 32*cf5a6c84SAndroid Build Coastguard Worker<a href=status.html>status page</a>, showing current progress towards 33*cf5a6c84SAndroid Build Coastguard Workercommplation.</p> 34*cf5a6c84SAndroid Build Coastguard Worker 35*cf5a6c84SAndroid Build Coastguard Worker<p>The most interesting publicly available standards are A) POSIX-2008 (also 36*cf5a6c84SAndroid Build Coastguard Workerknown as SUSv4), B) the Linux Standard Base version 4.1, and C) the official 37*cf5a6c84SAndroid Build Coastguard Worker<a href=https://www.kernel.org/doc/man-pages/>Linux man pages</a>. 38*cf5a6c84SAndroid Build Coastguard WorkerBut each of those include commands we've decided not implement, exclude 39*cf5a6c84SAndroid Build Coastguard Workercommands or features we have, and don't always entirely match reality.</p> 40*cf5a6c84SAndroid Build Coastguard Worker 41*cf5a6c84SAndroid Build Coastguard Worker<p>The most thorough real world test (other than a large interactive 42*cf5a6c84SAndroid Build Coastguard Workeruserbase) is using toybox as the command line in a build system such as 43*cf5a6c84SAndroid Build Coastguard Worker<a href=https://landley.net/aboriginal/about.html>Aboriginal 44*cf5a6c84SAndroid Build Coastguard WorkerLinux</a>, having it rebuild itself from source code, and using the result 45*cf5a6c84SAndroid Build Coastguard Workerto <a href=https://github.com/landley/control-images>build Linux From Scratch</a>. 46*cf5a6c84SAndroid Build Coastguard WorkerThe current "minimal native development system" goal is to use 47*cf5a6c84SAndroid Build Coastguard Worker<a href=faq.html#mkroot>mkroot</a> 48*cf5a6c84SAndroid Build Coastguard Workerplus <a href=faq.html#cross>musl-cross-make</a> to hermetically build 49*cf5a6c84SAndroid Build Coastguard Worker<a href=https://source.android.com>AOSP</a>.</p> 50*cf5a6c84SAndroid Build Coastguard Worker 51*cf5a6c84SAndroid Build Coastguard Worker<p>We've also checked what commands were provided by similar projects 52*cf5a6c84SAndroid Build Coastguard Worker(klibc, sash, sbase, embutils, nash, beastiebox...), looked at various 53*cf5a6c84SAndroid Build Coastguard Workervendor configurations of busybox, and collected end user requests.</p> 54*cf5a6c84SAndroid Build Coastguard Worker 55*cf5a6c84SAndroid Build Coastguard Worker<p>Finally, we'd like to provide a good replacement for the Bash shell, 56*cf5a6c84SAndroid Build Coastguard Workerwhich was the first program Linux ever ran (leading up to the 0.0.1 release 57*cf5a6c84SAndroid Build Coastguard Workerin 1991) and remains the standard shell of Linux (no matter what Ubuntu says). 58*cf5a6c84SAndroid Build Coastguard WorkerThis doesn't necessarily mean including every last Bash 5.x feature, but 59*cf5a6c84SAndroid Build Coastguard Workerdoes involve {various,features} <(beyond) posix.</p> 60*cf5a6c84SAndroid Build Coastguard Worker 61*cf5a6c84SAndroid Build Coastguard Worker<p>See the <a href=status.html>status page</a> for the categorized command list 62*cf5a6c84SAndroid Build Coastguard Workerand progress towards implementing it.</p> 63*cf5a6c84SAndroid Build Coastguard Worker 64*cf5a6c84SAndroid Build Coastguard Worker<hr /> 65*cf5a6c84SAndroid Build Coastguard Worker<a name="standards"> 66*cf5a6c84SAndroid Build Coastguard Worker<h2>Use case: standards compliance.</h2> 67*cf5a6c84SAndroid Build Coastguard Worker 68*cf5a6c84SAndroid Build Coastguard Worker<h3><a name=susv4 /><a href="#susv4">POSIX-2008/SUSv4</a></h3> 69*cf5a6c84SAndroid Build Coastguard Worker<p>The best standards describe reality rather than attempting to impose a 70*cf5a6c84SAndroid Build Coastguard Workernew one. I.E. "A good standard should document, not legislate." 71*cf5a6c84SAndroid Build Coastguard WorkerStandards which document existing reality tend to be approved by 72*cf5a6c84SAndroid Build Coastguard Workermore than one standards body, such as ANSI and ISO both approving <a href=https://landley.net/c99-draft.html>C99</a>. That's why IEEE 1003.1-2008, 73*cf5a6c84SAndroid Build Coastguard Workerthe Single Unix Specification version 4, and the Open Group Base Specification 74*cf5a6c84SAndroid Build Coastguard Workeredition 7 are all the same standard from three sources, which most people just 75*cf5a6c84SAndroid Build Coastguard Workercall "posix" (short for "portable operating system that works like unix"). 76*cf5a6c84SAndroid Build Coastguard WorkerIt's available <a href=https://pubs.opengroup.org/onlinepubs/9699919799>online in full</a>, and may be downloaded as a tarball. 77*cf5a6c84SAndroid Build Coastguard WorkerPrevious versions (<a href=https://pubs.opengroup.org/onlinepubs/009695399/>SUSv3</a> and 78*cf5a6c84SAndroid Build Coastguard Worker<a href=https://pubs.opengroup.org/onlinepubs/7990989775/>SUSv2</a>) 79*cf5a6c84SAndroid Build Coastguard Workerare also available.</p> 80*cf5a6c84SAndroid Build Coastguard Worker 81*cf5a6c84SAndroid Build Coastguard Worker<p>The original Posix was a collection of different standards (POSIX.1 82*cf5a6c84SAndroid Build Coastguard Workerfrom 1988, POSIX.1b from 1993, and POSIX.1c from 1995). The unified 83*cf5a6c84SAndroid Build Coastguard WorkerSUSv2 came out in 1997 and SUSv3 came out in 2001. 84*cf5a6c84SAndroid Build Coastguard Worker<a href=https://pubs.opengroup.org/onlinepubs/9699919799.2008edition/>Posix 85*cf5a6c84SAndroid Build Coastguard Worker2008</a> was then reissued in 2013 and 2018, the first was minor wordsmithing 86*cf5a6c84SAndroid Build Coastguard Workerwith no behavioral changes, the second was to renew a ten year timeout 87*cf5a6c84SAndroid Build Coastguard Workerto still be considered a "current standard" by some government regulations, 88*cf5a6c84SAndroid Build Coastguard Workerbut isn't officially a new standard. It's still posix-2008/SUSv4/Issue 7. 89*cf5a6c84SAndroid Build Coastguard WorkerThe endless committee process to produce 90*cf5a6c84SAndroid Build Coastguard Worker"Issue 8" has been ongoing for over 15 years now, with conference 91*cf5a6c84SAndroid Build Coastguard Workercalls on mondays and thursdays, mostly to discuss recent bug tracker 92*cf5a6c84SAndroid Build Coastguard Workerentries then publish the minutes of the meeting on the mailing list. 93*cf5a6c84SAndroid Build Coastguard WorkerProminent committee members have died during this time.</p> 94*cf5a6c84SAndroid Build Coastguard Worker 95*cf5a6c84SAndroid Build Coastguard Worker<h3>Why not just use posix for everything?</h3> 96*cf5a6c84SAndroid Build Coastguard Worker 97*cf5a6c84SAndroid Build Coastguard Worker<p>Unfortunately, Posix describes an incomplete subset of reality, because 98*cf5a6c84SAndroid Build Coastguard Workerit was designed to. It started with proprietary unix vendors collaborating to 99*cf5a6c84SAndroid Build Coastguard Workerdescribe the functionality their fragmented APIs could agree on, which was then 100*cf5a6c84SAndroid Build Coastguard Workerincorporated into <a href=https://nvlpubs.nist.gov/nistpubs/Legacy/FIPS/fipspub151-2-1993.pdf>US federal procurement standards</a> 101*cf5a6c84SAndroid Build Coastguard Workeras a <a href=https://www.youtube.com/watch?v=nwrTTXOg-KI>compliance requirement</a> 102*cf5a6c84SAndroid Build Coastguard Workerfor things like navy contracts, giving large corporations 103*cf5a6c84SAndroid Build Coastguard Workerlike IBM and Microsoft millions of dollars of incentive 104*cf5a6c84SAndroid Build Coastguard Workerto punch holes in the standard big enough to drive 105*cf5a6c84SAndroid Build Coastguard Worker<a href=https://en.wikipedia.org/wiki/Microsoft_POSIX_subsystem>Windows NT</a> and 106*cf5a6c84SAndroid Build Coastguard Worker<a href=http://www.naspa.net/magazine/1996/May/T9605006.PDF>OS/360</a> through. 107*cf5a6c84SAndroid Build Coastguard WorkerWhen open source projects like Linux started developing on the internet 108*cf5a6c84SAndroid Build Coastguard Worker(enabled by the 1993 relaxation of the National Science Foundation's 109*cf5a6c84SAndroid Build Coastguard Worker"Acceptable Use Policy" allowing everyone to connect to the internet, 110*cf5a6c84SAndroid Build Coastguard Workerpreviously restricted to approved government/military/university organizations), 111*cf5a6c84SAndroid Build Coastguard WorkerPosix <a href=http://www.opengroup.org/testing/fips/policy_info.html>ignored 112*cf5a6c84SAndroid Build Coastguard Workerthe upstarts</a> and Linux eventually 113*cf5a6c84SAndroid Build Coastguard Worker<a href=https://www.linuxjournal.com/article/3417>returned the favor</a>, 114*cf5a6c84SAndroid Build Coastguard Workerleaving Posix behind.</p> 115*cf5a6c84SAndroid Build Coastguard Worker 116*cf5a6c84SAndroid Build Coastguard Worker<p>The result is a "standard" that lacks any mention of commands like 117*cf5a6c84SAndroid Build Coastguard Worker"init" or "mount" required to actually boot a system. 118*cf5a6c84SAndroid Build Coastguard WorkerIt describes logname but not login. It provides ipcrm 119*cf5a6c84SAndroid Build Coastguard Workerand ipcs, but not ipcmk, so you can use System V IPC resources but not create 120*cf5a6c84SAndroid Build Coastguard Workerthem. And widely used real-world commands such as tar and cpio (the basis 121*cf5a6c84SAndroid Build Coastguard Workerof initramfs and RPM) which were present in earlier 122*cf5a6c84SAndroid Build Coastguard Workerversions of the standard have been removed, while obsolete commands like 123*cf5a6c84SAndroid Build Coastguard Workercksum, compress, sccs and uucp remain with no mention of modern counterparts 124*cf5a6c84SAndroid Build Coastguard Workerlike crc32/sha1sum, gzip/xz, svn/git or scp/rsync. Meanwhile posix' description 125*cf5a6c84SAndroid Build Coastguard Workerof the commands 126*cf5a6c84SAndroid Build Coastguard Workerthemselves are missing dozens of features, and specify silly things like ebcdic 127*cf5a6c84SAndroid Build Coastguard Workersupport in dd or that wc should use %d (not %lld) for byte counts. So 128*cf5a6c84SAndroid Build Coastguard Workerwe have to extensively filter posix to get a useful set of recommendations.</p> 129*cf5a6c84SAndroid Build Coastguard Worker 130*cf5a6c84SAndroid Build Coastguard Worker<h3>Analysis</h3> 131*cf5a6c84SAndroid Build Coastguard Worker 132*cf5a6c84SAndroid Build Coastguard Worker<p>Starting with the 133*cf5a6c84SAndroid Build Coastguard Worker<a href="http://pubs.opengroup.org/onlinepubs/9699919799.2008edition/idx/utilities.html">full "utilities" list</a>, 134*cf5a6c84SAndroid Build Coastguard Workerwe first remove generally obsolete 135*cf5a6c84SAndroid Build Coastguard Workercommands (compress ed ex pr uncompress uccp uustat uux), commands for the 136*cf5a6c84SAndroid Build Coastguard Workerpre-CVS "SCCS" source control system (admin delta get prs rmdel sact sccs unget 137*cf5a6c84SAndroid Build Coastguard Workerval what), fortran support (asa fort77), and batch processing support (batch 138*cf5a6c84SAndroid Build Coastguard Workerqalter qdel qhold qmove qmsg qrerun qrls qselect qsig qstat qsub).</p> 139*cf5a6c84SAndroid Build Coastguard Worker 140*cf5a6c84SAndroid Build Coastguard Worker<p>Some commands are for a compiler toolchain (ar c99 cflow ctags cxref gencat 141*cf5a6c84SAndroid Build Coastguard Workericonv lex m4 make nm strings strip yacc) which is out of scope for 142*cf5a6c84SAndroid Build Coastguard Workertoybox and should be supplied externally. (Some of these might be 143*cf5a6c84SAndroid Build Coastguard Workerrevisited later, but not for toybox 1.0.)</p> 144*cf5a6c84SAndroid Build Coastguard Worker 145*cf5a6c84SAndroid Build Coastguard Worker<p>Some commands are part of a command shell, and can't be implemented as 146*cf5a6c84SAndroid Build Coastguard Workerseparate executables (alias bg cd command fc fg getopts hash jobs kill read 147*cf5a6c84SAndroid Build Coastguard Workertype ulimit umask unalias wait). These may be implemented as part of the 148*cf5a6c84SAndroid Build Coastguard Workerbuilt-in toybox shell, but are not exported into $PATH via symlinks and 149*cf5a6c84SAndroid Build Coastguard Workerthus are not part of toybox's main command list. (If you fork a 150*cf5a6c84SAndroid Build Coastguard Workerchild process and have it "cd" then exit, you've accomplished nothing.) 151*cf5a6c84SAndroid Build Coastguard WorkerAgain, what posix lists as "commands" is incomplete: a shell also needs exit, if, while, 152*cf5a6c84SAndroid Build Coastguard Workerfor, case, export, set, unset, trap, exec... (And for bash compatibility 153*cf5a6c84SAndroid Build Coastguard Workerfunction, source, declare...)</p> 154*cf5a6c84SAndroid Build Coastguard Worker 155*cf5a6c84SAndroid Build Coastguard Worker<p>A few other commands are judgement calls, providing command-line 156*cf5a6c84SAndroid Build Coastguard Workerinternationalization support (iconv locale localedef), System V inter-process 157*cf5a6c84SAndroid Build Coastguard Workercommunication (ipcrm ipcs), and cross-tty communication from the minicomputer 158*cf5a6c84SAndroid Build Coastguard Workerdays (talk mesg write). The "pax" utility <a href=https://slashdot.org/story/06/09/04/1335226/debian-kicks-jrg-schilling>failed</a> to replace tar, 159*cf5a6c84SAndroid Build Coastguard Worker"mailx" is 160*cf5a6c84SAndroid Build Coastguard Workera command line email client, and "lp" submits files for printing to... what 161*cf5a6c84SAndroid Build Coastguard Workerexactly? (cups?) The standard defines crontab but not crond. What is 162*cf5a6c84SAndroid Build Coastguard Workerpathchk supposed to be portable _to_? (Linux accepts 255 byte path components 163*cf5a6c84SAndroid Build Coastguard Workerwith any char except NUL or / and no max length on the total path, and 164*cf5a6c84SAndroid Build Coastguard Worker<a href=https://yarchive.net/comp/linux/utf8.html>EXPLICITLY</a> 165*cf5a6c84SAndroid Build Coastguard Workerdoesn't care if it's an invalid utf8 sequence.)</p> 166*cf5a6c84SAndroid Build Coastguard Worker 167*cf5a6c84SAndroid Build Coastguard Worker<p>Removing all of that leaves the following commands, which toybox should 168*cf5a6c84SAndroid Build Coastguard Workerimplement:</p> 169*cf5a6c84SAndroid Build Coastguard Worker 170*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 171*cf5a6c84SAndroid Build Coastguard Worker<span id=posix> 172*cf5a6c84SAndroid Build Coastguard Workerat awk basename bc cal cat chgrp chmod chown cksum cmp comm cp 173*cf5a6c84SAndroid Build Coastguard Workercsplit cut date dd df diff dirname du echo env expand expr false file find 174*cf5a6c84SAndroid Build Coastguard Workerfold fuser getconf grep head id join kill link ln logger logname ls man 175*cf5a6c84SAndroid Build Coastguard Workermkdir mkfifo more mv newgrp nice nl nohup od paste patch printf ps 176*cf5a6c84SAndroid Build Coastguard Workerpwd renice rm rmdir sed sh sleep sort split stty tabs tail tee test time 177*cf5a6c84SAndroid Build Coastguard Workertouch tput tr true tsort tty uname unexpand uniq unlink uudecode uuencode vi wc 178*cf5a6c84SAndroid Build Coastguard Workerwho xargs zcat 179*cf5a6c84SAndroid Build Coastguard Worker</span> 180*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 181*cf5a6c84SAndroid Build Coastguard Worker 182*cf5a6c84SAndroid Build Coastguard Worker<h3><a name=sigh /><a href="#sigh">Linux Standard Base</a></h3> 183*cf5a6c84SAndroid Build Coastguard Worker 184*cf5a6c84SAndroid Build Coastguard Worker<p>One attempt to supplement POSIX towards an actual usable system was the 185*cf5a6c84SAndroid Build Coastguard WorkerLinux Standard Base. Unfortunately, the quality of this "standard" is 186*cf5a6c84SAndroid Build Coastguard Workerfairly low, largely due to the Free Standards Group that maintained it 187*cf5a6c84SAndroid Build Coastguard Workerbeing consumed by <a href=https://landley.net/notes-2010.html#18-07-2010>the Linux Foundation</a> in 2007.</p> 188*cf5a6c84SAndroid Build Coastguard Worker 189*cf5a6c84SAndroid Build Coastguard Worker<p>Where POSIX allowed its standards process to be compromised 190*cf5a6c84SAndroid Build Coastguard Workerby leaving things out (but what 191*cf5a6c84SAndroid Build Coastguard Workerthey DID standardize tends to be respected, if sometimes obsolete), 192*cf5a6c84SAndroid Build Coastguard Workerthe Linux Standard Base's failure mode was different. They responded to 193*cf5a6c84SAndroid Build Coastguard Workerpressure by including anything their members paid them enough to promote, 194*cf5a6c84SAndroid Build Coastguard Workersuch as allowing Red Hat to push 195*cf5a6c84SAndroid Build Coastguard WorkerRPM into the standard even though all sorts of distros (Debian, Slackware, Arch, 196*cf5a6c84SAndroid Build Coastguard WorkerGentoo, Android, Alpine...) don't use it and never will. This means anything in the LSB is 197*cf5a6c84SAndroid Build Coastguard Workerat best a suggestion: arbitrary portions of this standard are widely 198*cf5a6c84SAndroid Build Coastguard Workerignored.</p> 199*cf5a6c84SAndroid Build Coastguard Worker 200*cf5a6c84SAndroid Build Coastguard Worker<p>The <a href=https://mjg59.dreamwidth.org/39546.html>community perception</a> 201*cf5a6c84SAndroid Build Coastguard Workerseems to be that the Linux Standard Base is 202*cf5a6c84SAndroid Build Coastguard Workerthe best standard money can buy: the Linux Foundation is supported by 203*cf5a6c84SAndroid Build Coastguard Workerfinancial donations from large companies and the LSB 204*cf5a6c84SAndroid Build Coastguard Worker<a href=https://www.softwarefreedom.org/blog/2016/apr/11/lf/>represents the interests 205*cf5a6c84SAndroid Build Coastguard Workerof those donors</a> regardless of technical merit. (The Linux Foundation, which 206*cf5a6c84SAndroid Build Coastguard Workermaintains the LSB, is NOT a 501c3. It's a 501c6, the 207*cf5a6c84SAndroid Build Coastguard Workersame kind of legal entity as the Tobacco Institute and 208*cf5a6c84SAndroid Build Coastguard Worker<a href=https://lwn.net/Articles/706585/>Microsoft's</a> 209*cf5a6c84SAndroid Build Coastguard Workerold "<a href=https://en.wikipedia.org/wiki/Don%27t_Copy_That_Floppy>Don't Copy That Floppy</a>" campaign.) Debian officially 210*cf5a6c84SAndroid Build Coastguard Worker<a href=http://lwn.net/Articles/658809>washed its hands of LSB</a> by 211*cf5a6c84SAndroid Build Coastguard Workerrefusing to adopt release 5.0 in 2015, and no longer even pretends to support 212*cf5a6c84SAndroid Build Coastguard Workerit (which affects Debian derivatives like Ubuntu and Knoppix). Toybox has 213*cf5a6c84SAndroid Build Coastguard Workerstayed on 4.1 for similar reasons.</p> 214*cf5a6c84SAndroid Build Coastguard Worker 215*cf5a6c84SAndroid Build Coastguard Worker<p>That said, Posix by itself isn't enough, and this is the next most 216*cf5a6c84SAndroid Build Coastguard Workercomprehensive standards effort for Linux so far, so we salvage what we can. 217*cf5a6c84SAndroid Build Coastguard WorkerA lot of historical effort went into producing the standard before the 218*cf5a6c84SAndroid Build Coastguard WorkerLinux Foundation took over.</p> 219*cf5a6c84SAndroid Build Coastguard Worker 220*cf5a6c84SAndroid Build Coastguard Worker<h3>Analysis</h3> 221*cf5a6c84SAndroid Build Coastguard Worker 222*cf5a6c84SAndroid Build Coastguard Worker<p>LSB 4.1 specifies a <a href=http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/cmdbehav.html>list of command line 223*cf5a6c84SAndroid Build Coastguard Workerutilities</a>:</p> 224*cf5a6c84SAndroid Build Coastguard Worker 225*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 226*cf5a6c84SAndroid Build Coastguard Workerar at awk batch bc chfn chsh col cpio crontab df dmesg du echo egrep 227*cf5a6c84SAndroid Build Coastguard Workerfgrep file fuser gettext grep groupadd groupdel groupmod groups 228*cf5a6c84SAndroid Build Coastguard Workergunzip gzip hostname install install_initd ipcrm ipcs killall lpr ls 229*cf5a6c84SAndroid Build Coastguard Workerlsb_release m4 md5sum mknod mktemp more mount msgfmt newgrp od passwd 230*cf5a6c84SAndroid Build Coastguard Workerpatch pidof remove_initd renice sed sendmail seq sh shutdown su sync 231*cf5a6c84SAndroid Build Coastguard Workertar umount useradd userdel usermod xargs zcat 232*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 233*cf5a6c84SAndroid Build Coastguard Worker 234*cf5a6c84SAndroid Build Coastguard Worker<p>Where posix specifies one of those commands, LSB's deltas tended to be 235*cf5a6c84SAndroid Build Coastguard Workeraccomodations for broken tool versions which ween't up to date with the 236*cf5a6c84SAndroid Build Coastguard Workerstandard yet. (See <a href=http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/more.html>more</a> and <a href=http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/xargs.html>xargs</a> 237*cf5a6c84SAndroid Build Coastguard Workerfor examples.)</p> 238*cf5a6c84SAndroid Build Coastguard Worker 239*cf5a6c84SAndroid Build Coastguard Worker<p>Since we've already committed to using our own judgement to skip bits of 240*cf5a6c84SAndroid Build Coastguard WorkerPOSIX, and LSB's "judgement" in this regard is purely bug workarounds to declare 241*cf5a6c84SAndroid Build Coastguard Workervarious legacy tool implementations "compliant", this means we're mostly 242*cf5a6c84SAndroid Build Coastguard Workerinterested in the set of LSB tools that aren't mentioned in posix.</p> 243*cf5a6c84SAndroid Build Coastguard Worker 244*cf5a6c84SAndroid Build Coastguard Worker<p>Of these, gettext and msgfmt are internationalization, install_initd and 245*cf5a6c84SAndroid Build Coastguard Workerremove_initd weren't present even in Ubuntu 10.04, lpr is out of scope, 246*cf5a6c84SAndroid Build Coastguard Workerlsb_release just reports information in /etc/os-release, and sendmail's 247*cf5a6c84SAndroid Build Coastguard Workerturned into a pile of cryptographic verification and DNS shenanigans due 248*cf5a6c84SAndroid Build Coastguard Workerto spammers.</p> 249*cf5a6c84SAndroid Build Coastguard Worker 250*cf5a6c84SAndroid Build Coastguard Worker<p>This leaves:</p> 251*cf5a6c84SAndroid Build Coastguard Worker 252*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 253*cf5a6c84SAndroid Build Coastguard Worker<span id=lsb> 254*cf5a6c84SAndroid Build Coastguard Workerchfn chsh dmesg egrep fgrep groupadd groupdel groupmod groups 255*cf5a6c84SAndroid Build Coastguard Workergunzip gzip hostname install killall md5sum 256*cf5a6c84SAndroid Build Coastguard Workermknod mktemp mount passwd pidof seq shutdown 257*cf5a6c84SAndroid Build Coastguard Workersu sync tar umount useradd userdel usermod zcat 258*cf5a6c84SAndroid Build Coastguard Worker</span> 259*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 260*cf5a6c84SAndroid Build Coastguard Worker 261*cf5a6c84SAndroid Build Coastguard Worker<h3><a name=rfc /><a href="#rfc">IETF RFCs and Man Pages</a></h3> 262*cf5a6c84SAndroid Build Coastguard Worker 263*cf5a6c84SAndroid Build Coastguard Worker<p>They're very nice, but there's thousands of them. The signal to noise 264*cf5a6c84SAndroid Build Coastguard Workerratio here is terrible.</p> 265*cf5a6c84SAndroid Build Coastguard Worker 266*cf5a6c84SAndroid Build Coastguard Worker<p>Discussion of standards wouldn't be complete without the Internet 267*cf5a6c84SAndroid Build Coastguard WorkerEngineering Task Force's "<a href=https://www.rfc-editor.org/in-notes/rfc-index.txt>Request For Comments</a>" collection and Michael Kerrisk's 268*cf5a6c84SAndroid Build Coastguard Worker<a href=https://www.kernel.org/doc/man-pages/>Linux man-pages project</a>... 269*cf5a6c84SAndroid Build Coastguard Workerexcept these aren't standards, they're collections of documentation with 270*cf5a6c84SAndroid Build Coastguard Workerlow barriers to inclusion. They're not saying "you should support 271*cf5a6c84SAndroid Build Coastguard WorkerX", they're saying "if you do, here's how". 272*cf5a6c84SAndroid Build Coastguard WorkerThus neither really helps us select which commands to include.</p> 273*cf5a6c84SAndroid Build Coastguard Worker 274*cf5a6c84SAndroid Build Coastguard Worker<p>The man pages website includes the commands in git, yum, perf, postgres, 275*cf5a6c84SAndroid Build Coastguard Workerflatpack... Great for examining the features of a command you've 276*cf5a6c84SAndroid Build Coastguard Workeralready decided to include, useless for deciding _what_ to include.</p> 277*cf5a6c84SAndroid Build Coastguard Worker 278*cf5a6c84SAndroid Build Coastguard Worker<p>The RFCs are more about protocols than commands. The noise level is 279*cf5a6c84SAndroid Build Coastguard Workerextremely high: there's thousands of RFCs, many describing a proposed idea 280*cf5a6c84SAndroid Build Coastguard Workerthat never took off, and less than 1% of the resulting documents are 281*cf5a6c84SAndroid Build Coastguard Workercurrently relevant to toybox. The documents are numbered based on the 282*cf5a6c84SAndroid Build Coastguard Workerorder they were received, with no real attempt at coherently indexing 283*cf5a6c84SAndroid Build Coastguard Workerthe result. As with man pages they can be <a href=https://www.ietf.org/rfc/rfc0610.txt>long and complicated</a> or 284*cf5a6c84SAndroid Build Coastguard Worker<a href=https://www.ietf.org/rfc/rfc1951.txt>terse and impenetrable</a>, 285*cf5a6c84SAndroid Build Coastguard Workerhave developed a certain amount of <a href=https://www.ietf.org/rfc/rfc8179.txt>bureaucracy</a> over the years, and often the easiest way to understand what 286*cf5a6c84SAndroid Build Coastguard Workerthey <a href=https://www.ietf.org/rfc/rfc4330.txt>document</a> is to find an <a href=https://www.ietf.org/rfc/rfc1769.txt>earlier version</a> to read first. 287*cf5a6c84SAndroid Build Coastguard Worker(This is an example of the greybeard community problem, where all current 288*cf5a6c84SAndroid Build Coastguard Workerdocumentation was written by people who don't remember NOT already knowing 289*cf5a6c84SAndroid Build Coastguard Workerthis stuff and the resources they originally learned from are long gone.)</p> 290*cf5a6c84SAndroid Build Coastguard Worker 291*cf5a6c84SAndroid Build Coastguard Worker<p>That said, RFC documents can be useful (especially for networking protocols) 292*cf5a6c84SAndroid Build Coastguard Workerand the four URL templates the recommended starting files 293*cf5a6c84SAndroid Build Coastguard Workerfor new commands (hello.c and skeleton.c in the toys/example directory) 294*cf5a6c84SAndroid Build Coastguard Workerprovide point to example posix, lsb, man, and rfc pages online.</p> 295*cf5a6c84SAndroid Build Coastguard Worker 296*cf5a6c84SAndroid Build Coastguard Worker<hr /> 297*cf5a6c84SAndroid Build Coastguard Worker<a name="dev_env"> 298*cf5a6c84SAndroid Build Coastguard Worker<h2><a href="#dev_env">Use case: provide a self-hosting development environment</a></h2> 299*cf5a6c84SAndroid Build Coastguard Worker 300*cf5a6c84SAndroid Build Coastguard Worker<p>Once upon a time, the following commands were enough to build the <a href=http://landley.net/aboriginal/about.html>Aboriginal Linux</a> development 301*cf5a6c84SAndroid Build Coastguard Workerenvironment, boot it to a shell prompt, and build <a href=http://www.linuxfromscratch.org/lfs/view/6.8/>Linux From Scratch 6.8</a> under it.</p> 302*cf5a6c84SAndroid Build Coastguard Worker 303*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 304*cf5a6c84SAndroid Build Coastguard Worker<span id=development> 305*cf5a6c84SAndroid Build Coastguard Workerbzcat cat cp dirname echo env patch rmdir sha1sum sleep sort sync 306*cf5a6c84SAndroid Build Coastguard Workertrue uname wc which yes zcat 307*cf5a6c84SAndroid Build Coastguard Workerawk basename chmod chown cmp cut date dd diff 308*cf5a6c84SAndroid Build Coastguard Workeregrep expr fdisk find grep gzip head hostname id install ln ls 309*cf5a6c84SAndroid Build Coastguard Workermkdir mktemp mv od readlink rm sed sh tail tar touch tr uniq 310*cf5a6c84SAndroid Build Coastguard Workerwget whoami xargs chgrp comm gunzip less logname split 311*cf5a6c84SAndroid Build Coastguard Workertee test time bunzip2 chgrp chroot comm cpio dmesg 312*cf5a6c84SAndroid Build Coastguard Workerdnsdomainname ftpget ftpput gunzip ifconfig init 313*cf5a6c84SAndroid Build Coastguard Workerlogname losetup mdev mount mountpoint nc pgrep pkill 314*cf5a6c84SAndroid Build Coastguard Workerpwd route split stat switch_root tac umount vi 315*cf5a6c84SAndroid Build Coastguard Workerresize2fs tune2fs fsck.ext2 genext2fs mke2fs xzcat 316*cf5a6c84SAndroid Build Coastguard Worker</span> 317*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 318*cf5a6c84SAndroid Build Coastguard Worker 319*cf5a6c84SAndroid Build Coastguard Worker<p>This use case includes running init scripts and other shell scripts, running 320*cf5a6c84SAndroid Build Coastguard Workerconfigure, make, and install in each package, and providing basic command line 321*cf5a6c84SAndroid Build Coastguard Workerfacilities such as a text editor. (It does not include a compiler toolchain or 322*cf5a6c84SAndroid Build Coastguard WorkerC library, those are outside the scope of the toybox project, although mkroot 323*cf5a6c84SAndroid Build Coastguard Workerhas a <a href=https://landley.net/code/qcc>potential follow-up project</a>. 324*cf5a6c84SAndroid Build Coastguard WorkerFor now we use distro toolchains, 325*cf5a6c84SAndroid Build Coastguard Worker<a href=https://github.com/richfelker/musl-cross-make>musl-cross-make</a>, 326*cf5a6c84SAndroid Build Coastguard Workerand the Android NDK for build testing.) 327*cf5a6c84SAndroid Build Coastguard WorkerThat build system also installed bash 2.05b as #!/bin/sh and its scripts 328*cf5a6c84SAndroid Build Coastguard Workerrequired bash extensions not present in shells such as busybox ash. 329*cf5a6c84SAndroid Build Coastguard WorkerTo replace that, toysh needs to supply several bash extensions _and_ work 330*cf5a6c84SAndroid Build Coastguard Workerwhen called under the name "bash".</p> 331*cf5a6c84SAndroid Build Coastguard Worker 332*cf5a6c84SAndroid Build Coastguard Worker<p>The above command list was collected using a command line recording wrapper 333*cf5a6c84SAndroid Build Coastguard Worker(mkroot/record-commands and toys/example/logpath.c) which mkroot/mkroot.sh 334*cf5a6c84SAndroid Build Coastguard Workeralso uses to populate root/build/log/*-commands.txt. Try 335*cf5a6c84SAndroid Build Coastguard Worker<b>awk '{print $1}' root/build/log/*-commands.txt | sort -u | grep -v musl | xargs</b> 336*cf5a6c84SAndroid Build Coastguard Workerafter building a mkroot target to see the list of commands called out 337*cf5a6c84SAndroid Build Coastguard Workerof the $PATH during that build.</p> 338*cf5a6c84SAndroid Build Coastguard Worker 339*cf5a6c84SAndroid Build Coastguard Worker<h3>Stages and moving targets</h3> 340*cf5a6c84SAndroid Build Coastguard Worker 341*cf5a6c84SAndroid Build Coastguard Worker<p>The development environment use case has two stages, achieving: 342*cf5a6c84SAndroid Build Coastguard Worker1) a bootable system that can rebuild itself from source, and 2) 343*cf5a6c84SAndroid Build Coastguard Workera build environment capable 344*cf5a6c84SAndroid Build Coastguard Workerof bootstrapping up to arbitrary complexity (by building 345*cf5a6c84SAndroid Build Coastguard WorkerLinux From Scratch and Beyond Linux From Scratch under the resulting 346*cf5a6c84SAndroid Build Coastguard Workersystem, or the Android Open Source Project). To accomplish just the first 347*cf5a6c84SAndroid Build Coastguard Workergoal (a minimal system that can rebuild _itself_ from source), the old 348*cf5a6c84SAndroid Build Coastguard Workerbuild still needs the following busybox commands for which toybox does 349*cf5a6c84SAndroid Build Coastguard Workernot yet supply adequate replacements:</p> 350*cf5a6c84SAndroid Build Coastguard Worker 351*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 352*cf5a6c84SAndroid Build Coastguard Workerawk diff expr fdisk gzip less route sh tr unxz vi xzcat 353*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 354*cf5a6c84SAndroid Build Coastguard Worker 355*cf5a6c84SAndroid Build Coastguard Worker<p>All of those except awk and less have partial implementations 356*cf5a6c84SAndroid Build Coastguard Workerin "pending".</p> 357*cf5a6c84SAndroid Build Coastguard Worker 358*cf5a6c84SAndroid Build Coastguard Worker<p>In 2017 Aboriginal Linux development ended, replaced by a much simpler 359*cf5a6c84SAndroid Build Coastguard Workerproject ("mkroot") designed to use an existing cross+native toolchain (such as 360*cf5a6c84SAndroid Build Coastguard Worker<a href=https://github.com/richfelker/musl-cross-make>musl-cross-make</a> 361*cf5a6c84SAndroid Build Coastguard Workeror the Android NDK) instead of building its own cross and native compilers 362*cf5a6c84SAndroid Build Coastguard Workerfrom source. In 2019 the still-incomplete 363*cf5a6c84SAndroid Build Coastguard Workermkroot was merged into toybox as the "make root" target (which runs 364*cf5a6c84SAndroid Build Coastguard Workermkroot/mkroot.sh). This is intended 365*cf5a6c84SAndroid Build Coastguard Workeras a simpler way of providing essentially the same build environment, and doesn't 366*cf5a6c84SAndroid Build Coastguard Workersignificantly affect the rest of this analysis (although the "rebuild itself 367*cf5a6c84SAndroid Build Coastguard Workerfrom source" test should now include building musl-cross-make under either 368*cf5a6c84SAndroid Build Coastguard Workermkroot or toybox's "make airlock" host environment).</p> 369*cf5a6c84SAndroid Build Coastguard Worker 370*cf5a6c84SAndroid Build Coastguard Worker<p>Building Linux From Scratch is not the same as building the 371*cf5a6c84SAndroid Build Coastguard Worker<a href=https://source.android.com>Android Open Source Project</a>, 372*cf5a6c84SAndroid Build Coastguard Workerbut after toybox 1.0 we plan to try 373*cf5a6c84SAndroid Build Coastguard Worker<a href=http://landley.net/aboriginal/about.html#hairball>modifying the AOSP build</a> 374*cf5a6c84SAndroid Build Coastguard Workerto reduce dependencies. (It's fairly likely we'll have to add at least 375*cf5a6c84SAndroid Build Coastguard Workera read-only git utility so repo can download the build's source code, 376*cf5a6c84SAndroid Build Coastguard Workerbut that's actually <a href=https://www.youtube.com/watch?v=I-lGyn3PHP4>not 377*cf5a6c84SAndroid Build Coastguard Workerthat hard</a>. We'll probably also need our own "make" at some point after 378*cf5a6c84SAndroid Build Coastguard Worker1.0, which is its own moving target thanks to cmake and ninja and so on.) 379*cf5a6c84SAndroid Build Coastguard WorkerThe ongoing Android <a href=http://lists.landley.net/pipermail/toybox-landley.net/2018-January/009330.html>hermetic build</a> work is already advancing 380*cf5a6c84SAndroid Build Coastguard Workerthis goal.</p> 381*cf5a6c84SAndroid Build Coastguard Worker 382*cf5a6c84SAndroid Build Coastguard Worker<hr /> 383*cf5a6c84SAndroid Build Coastguard Worker<h2><a name=android /><a href="#android">Use case: Replacing Android Toolbox</a></h2> 384*cf5a6c84SAndroid Build Coastguard Worker 385*cf5a6c84SAndroid Build Coastguard Worker<p>Android has a policy against GPL in userspace, so even though BusyBox 386*cf5a6c84SAndroid Build Coastguard Workerpredates Android by many years, they couldn't use it. Instead they grabbed 387*cf5a6c84SAndroid Build Coastguard Workeran old version of ash (later replaced by 388*cf5a6c84SAndroid Build Coastguard Worker<a href="https://www.mirbsd.org/mksh.htm">mksh</a>) 389*cf5a6c84SAndroid Build Coastguard Workerand implemented their own command line utility set 390*cf5a6c84SAndroid Build Coastguard Workercalled "toolbox" (which toybox has already mostly replaced).</p> 391*cf5a6c84SAndroid Build Coastguard Worker 392*cf5a6c84SAndroid Build Coastguard Worker<p>Toolbox doesn't have its own repository, instead it's part of Android's 393*cf5a6c84SAndroid Build Coastguard Worker<a href=https://android.googlesource.com/platform/system/core>system/core 394*cf5a6c84SAndroid Build Coastguard Workergit repository</a>. Android's Native Development Kit (their standalone 395*cf5a6c84SAndroid Build Coastguard Workerdownloadable toolchain) has its own 396*cf5a6c84SAndroid Build Coastguard Worker<a href=https://android.googlesource.com/platform/ndk/+/master/docs/Roadmap.md>roadmap</a>, and each version has 397*cf5a6c84SAndroid Build Coastguard Worker<a href=https://developer.android.com/ndk/downloads/revision_history>release 398*cf5a6c84SAndroid Build Coastguard Workernotes</a>.</p> 399*cf5a6c84SAndroid Build Coastguard Worker 400*cf5a6c84SAndroid Build Coastguard Worker<h3>Toolbox commands:</h3> 401*cf5a6c84SAndroid Build Coastguard Worker 402*cf5a6c84SAndroid Build Coastguard Worker<p>According to <a href=https://android.googlesource.com/platform/system/core/+/master/toolbox/Android.bp> 403*cf5a6c84SAndroid Build Coastguard Workersystem/core/toolbox/Android.bp</a> the toolbox directory builds the 404*cf5a6c84SAndroid Build Coastguard Workerfollowing commands:</p> 405*cf5a6c84SAndroid Build Coastguard Worker 406*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 407*cf5a6c84SAndroid Build Coastguard Workergetevent getprop modprobe setprop start 408*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 409*cf5a6c84SAndroid Build Coastguard Worker 410*cf5a6c84SAndroid Build Coastguard Worker<p>getprop/setprop/start were in toybox and moved back because they're so 411*cf5a6c84SAndroid Build Coastguard Workertied to non-public system interfaces. modprobe shares the implementation 412*cf5a6c84SAndroid Build Coastguard Workerused in init. getevent is a board bringup tool built with a python script 413*cf5a6c84SAndroid Build Coastguard Workerthat pulls all the constants from the latest kernel headers.</p> 414*cf5a6c84SAndroid Build Coastguard Worker 415*cf5a6c84SAndroid Build Coastguard Worker<h3>Other Android /system/bin commands</h3> 416*cf5a6c84SAndroid Build Coastguard Worker 417*cf5a6c84SAndroid Build Coastguard Worker<p>Other than the toolbox links, the currently interesting 418*cf5a6c84SAndroid Build Coastguard Workerbinaries in /system/bin are:</p> 419*cf5a6c84SAndroid Build Coastguard Worker 420*cf5a6c84SAndroid Build Coastguard Worker<ul> 421*cf5a6c84SAndroid Build Coastguard Worker<li><b>arping</b> - ARP REQUEST tool (iputils)</li> 422*cf5a6c84SAndroid Build Coastguard Worker<li><b>blkid</b> - identify block devices (e2fsprogs)</li> 423*cf5a6c84SAndroid Build Coastguard Worker<li><b>e2fsck</b> - fsck for ext2/ext3/ext4 (e2fsprogs)</li> 424*cf5a6c84SAndroid Build Coastguard Worker<li><b>fsck.f2fs</b> - fsck for f2fs (f2fs-tools)</li> 425*cf5a6c84SAndroid Build Coastguard Worker<li><b>fsck_msdos</b> - fsck for FAT (BSD)</li> 426*cf5a6c84SAndroid Build Coastguard Worker<li><b>gzip</b> - compression/decompression tool (zlib)</li> 427*cf5a6c84SAndroid Build Coastguard Worker<li><b>ip</b> - network routing tool (iproute2)</li> 428*cf5a6c84SAndroid Build Coastguard Worker<li><b>iptables/ip6tables</b> - IPv4/IPv6 NAT admin (iptables)</li> 429*cf5a6c84SAndroid Build Coastguard Worker<li><b>iw</b> - wireless device config tool (iw)</li> 430*cf5a6c84SAndroid Build Coastguard Worker<li><b>logwrapper</b> - redirect stdio to android log (Android)</li> 431*cf5a6c84SAndroid Build Coastguard Worker<li><b>make_ext4fs</b> - make ext4 fs (Android)</li> 432*cf5a6c84SAndroid Build Coastguard Worker<li><b>make_f2fs</b> - make f2fs fs (f2fs-tools)</li> 433*cf5a6c84SAndroid Build Coastguard Worker<li><b>ping/ping6</b> - ICMP ECHO_REQUEST tool (iputils)</li> 434*cf5a6c84SAndroid Build Coastguard Worker<li><b>reboot</b> - reboot (Android)</li> 435*cf5a6c84SAndroid Build Coastguard Worker<li><b>resize2fs</b> - resize ext2/ext3/ext4 fs (e2fsprogs)</li> 436*cf5a6c84SAndroid Build Coastguard Worker<li><b>sh</b> - mksh (BSD)</li> 437*cf5a6c84SAndroid Build Coastguard Worker<li><b>ss</b> - socket statistics (iproute2)</li> 438*cf5a6c84SAndroid Build Coastguard Worker<li><b>tc</b> - traffic control (iproute2)</li> 439*cf5a6c84SAndroid Build Coastguard Worker<li><b>tracepath/tracepath6</b> - trace network path (iputils)</li> 440*cf5a6c84SAndroid Build Coastguard Worker<li><b>traceroute/traceroute6</b> - trace network route (iputils)</li> 441*cf5a6c84SAndroid Build Coastguard Worker</ul> 442*cf5a6c84SAndroid Build Coastguard Worker 443*cf5a6c84SAndroid Build Coastguard Worker<p>The names in parentheses are the upstream source of the command.</p> 444*cf5a6c84SAndroid Build Coastguard Worker 445*cf5a6c84SAndroid Build Coastguard Worker<h3>Analysis</h3> 446*cf5a6c84SAndroid Build Coastguard Worker 447*cf5a6c84SAndroid Build Coastguard Worker<p>For reference, combining everything listed above that's still "fair game" 448*cf5a6c84SAndroid Build Coastguard Workerfor toybox, we get:</p> 449*cf5a6c84SAndroid Build Coastguard Worker 450*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 451*cf5a6c84SAndroid Build Coastguard Workerarping blkid e2fsck dd fsck.f2fs fsck_msdos gzip ip iptables 452*cf5a6c84SAndroid Build Coastguard Workerip6tables iw logwrapper make_ext4fs make_f2fs modpobe newfs_msdos ping ping6 453*cf5a6c84SAndroid Build Coastguard Workerreboot resize2fs sh ss tc tracepath tracepath6 traceroute traceroute6 454*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 455*cf5a6c84SAndroid Build Coastguard Worker 456*cf5a6c84SAndroid Build Coastguard Worker<p>We may eventually implement all of that, but for toybox 1.0 we need to 457*cf5a6c84SAndroid Build Coastguard Workerfocus a bit. If Android has an acceptable external package, and the command 458*cf5a6c84SAndroid Build Coastguard Workerisn't needed for system bootstrapping, replacing the external package is 459*cf5a6c84SAndroid Build Coastguard Workernot a priority.</p> 460*cf5a6c84SAndroid Build Coastguard Worker 461*cf5a6c84SAndroid Build Coastguard Worker<p>However, several commands toybox plans to implement anyway could potentially 462*cf5a6c84SAndroid Build Coastguard Workerreplace existing Android versions, so we should take into account Android's use 463*cf5a6c84SAndroid Build Coastguard Workercases when doing so. This includes:</p> 464*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 465*cf5a6c84SAndroid Build Coastguard Worker<span id=toolbox> 466*cf5a6c84SAndroid Build Coastguard Workergetevent gzip modprobe newfs_msdos sh 467*cf5a6c84SAndroid Build Coastguard Worker</span> 468*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 469*cf5a6c84SAndroid Build Coastguard Worker 470*cf5a6c84SAndroid Build Coastguard Worker<p>Update: <a href=https://android.googlesource.com/platform/system/core/+/master/system/core/Android.bp> 471*cf5a6c84SAndroid Build Coastguard Workerexternal/toybox/Android.bp</a> has symlinks for the following toys out 472*cf5a6c84SAndroid Build Coastguard Workerof "pending". (The toybox modprobe is also built for the device, but 473*cf5a6c84SAndroid Build Coastguard Workerit isn't actually used and is only there for sanity checking against 474*cf5a6c84SAndroid Build Coastguard Workerthe libmodprobe-based implementation.) These should be a priority for 475*cf5a6c84SAndroid Build Coastguard Workercleanup:</p> 476*cf5a6c84SAndroid Build Coastguard Worker 477*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 478*cf5a6c84SAndroid Build Coastguard Workerdiff expr getopt tr brctl getfattr lsof modprobe more stty traceroute vi 479*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 480*cf5a6c84SAndroid Build Coastguard Worker 481*cf5a6c84SAndroid Build Coastguard Worker<p>Android wishlist:</p> 482*cf5a6c84SAndroid Build Coastguard Worker 483*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 484*cf5a6c84SAndroid Build Coastguard Workermtools genvfatfs mke2fs gene2fs 485*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 486*cf5a6c84SAndroid Build Coastguard Worker 487*cf5a6c84SAndroid Build Coastguard Worker<hr /> 488*cf5a6c84SAndroid Build Coastguard Worker<h2><a name=aosp /><a href="#aosp">Use case: Building AOSP</a></h2> 489*cf5a6c84SAndroid Build Coastguard Worker 490*cf5a6c84SAndroid Build Coastguard Worker<p>The list of external tools used to build AOSP was 491*cf5a6c84SAndroid Build Coastguard Worker<a href="https://android.googlesource.com/platform/build/soong/+/master/ui/build/paths/config.go">here</a>, 492*cf5a6c84SAndroid Build Coastguard Workerbut as they're switched over to toybox they disappear and reappear 493*cf5a6c84SAndroid Build Coastguard Worker<a href="https://android.googlesource.com/platform/prebuilts/build-tools/+/refs/heads/master/path/linux-x86/">here</a>.</p> 494*cf5a6c84SAndroid Build Coastguard Worker 495*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 496*cf5a6c84SAndroid Build Coastguard Workerawk basename bash bc bzip2 cat chmod cmp comm cp cut date dd diff dirname dlv du 497*cf5a6c84SAndroid Build Coastguard Workerecho egrep env expr find fuser getconf getopt git grep gzip head hexdump 498*cf5a6c84SAndroid Build Coastguard Workerhostname id jar java javap ln ls lsof m4 make md5sum mkdir mktemp mv od openssl 499*cf5a6c84SAndroid Build Coastguard Workerpaste patch pgrep pkill ps pstree pwd python python2.7 python3 readlink 500*cf5a6c84SAndroid Build Coastguard Workerrealpath rm rmdir rsync sed setsid sh sha1sum sha256sum sha512sum 501*cf5a6c84SAndroid Build Coastguard Workersleep sort stat tar tail tee touch tr true uname uniq unix2dos unzip 502*cf5a6c84SAndroid Build Coastguard Workerwc which whoami xargs xxd xz zip zipinfo 503*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 504*cf5a6c84SAndroid Build Coastguard Worker 505*cf5a6c84SAndroid Build Coastguard Worker<p>The following are already in the tree and will be used directly:</p> 506*cf5a6c84SAndroid Build Coastguard Worker 507*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 508*cf5a6c84SAndroid Build Coastguard Workerawk bc bzip2 jar java javap m4 make python python2.7 python3 xz 509*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 510*cf5a6c84SAndroid Build Coastguard Worker 511*cf5a6c84SAndroid Build Coastguard Worker<p>Subtracting what's already in toybox (including the following toybox toys 512*cf5a6c84SAndroid Build Coastguard Workerthat are still in pending: <code>diff expr gzip lsof tr</code>), 513*cf5a6c84SAndroid Build Coastguard Workerthat leaves:</p> 514*cf5a6c84SAndroid Build Coastguard Worker 515*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 516*cf5a6c84SAndroid Build Coastguard Workerbash fuser git hexdump openssl pstree rsync sh unzip zip zipinfo 517*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 518*cf5a6c84SAndroid Build Coastguard Worker 519*cf5a6c84SAndroid Build Coastguard Worker<p>For AOSP, zip/zipinfo/unzip are likely to be libziparchive based. 520*cf5a6c84SAndroid Build Coastguard Workergit/openssl seem like they should just be brought in to the tree. rsync is 521*cf5a6c84SAndroid Build Coastguard Workerused to work around a Mac <code>cp -Rf</code> bug with broken symbolic links. 522*cf5a6c84SAndroid Build Coastguard WorkerThat leaves:</p> 523*cf5a6c84SAndroid Build Coastguard Worker 524*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 525*cf5a6c84SAndroid Build Coastguard Workerbash fuser hexdump pstree 526*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 527*cf5a6c84SAndroid Build Coastguard Worker 528*cf5a6c84SAndroid Build Coastguard Worker<p>(Why are fuser and pstree used during the AOSP build? They're used for 529*cf5a6c84SAndroid Build Coastguard Workerdiagnostics if something goes wrong. So it's really just bash and hexdump 530*cf5a6c84SAndroid Build Coastguard Workerthat are actually used to build.)</p> 531*cf5a6c84SAndroid Build Coastguard Worker 532*cf5a6c84SAndroid Build Coastguard Worker<hr /> 533*cf5a6c84SAndroid Build Coastguard Worker<h2><a name=tizen /><a href="#tizen">Use case: Tizen Core</a></h2> 534*cf5a6c84SAndroid Build Coastguard Worker 535*cf5a6c84SAndroid Build Coastguard Worker<p>A side effect of the Linux Foundation following the money to the 536*cf5a6c84SAndroid Build Coastguard Workerexclusion of all else is they "support" their donors' myriad often 537*cf5a6c84SAndroid Build Coastguard Workercontradictory pet projects with elaborate announcements and press releases. 538*cf5a6c84SAndroid Build Coastguard WorkerLong ago when Nokia's Maemo merged 539*cf5a6c84SAndroid Build Coastguard Workerwith Intel's Moblin to form <a href=https://www.linuxfoundation.org/press-release/linux-foundation-to-host-meego-project/>MeeGo</a>, there were believable <a href=https://www.linuxfoundation.org/press-release/public-support-for-the-meego-project/>statements</a> 540*cf5a6c84SAndroid Build Coastguard Workerabout unifying fragmented vendor efforts. Then MeeGo merged with 541*cf5a6c84SAndroid Build Coastguard Worker<a href=http://en.wikipedia.org/wiki/LiMo_Foundation>LiMo</a> to 542*cf5a6c84SAndroid Build Coastguard Worker<a href=notes-2012.html#16-05-2012>form Tizen</a>, 543*cf5a6c84SAndroid Build Coastguard Workerwhich became a Samsung-only project (that <a href=https://www.androidheadlines.com/2021/05/samsung-tvs-continue-use-tizen-os.html>still ships</a> 544*cf5a6c84SAndroid Build Coastguard Workerinside <a href=https://twitter.com/cstross/status/1453747613686288385>televisions</a>, 545*cf5a6c84SAndroid Build Coastguard Workerbut was otherwise subsumed into <a href=https://www.theverge.com/2021/5/18/22440483/samsung-smartwatch-google-wearos-tizen-watch>Android GO</a>).</p> 546*cf5a6c84SAndroid Build Coastguard Worker 547*cf5a6c84SAndroid Build Coastguard Worker<p>Along the way, the Tizen project expressed a desire to eliminate GPLv3 software 548*cf5a6c84SAndroid Build Coastguard Workerfrom its core system, and in installing toybox as 549*cf5a6c84SAndroid Build Coastguard Worker<a href=https://wiki.tizen.org/wiki/Toybox>part of this process</a>.</p> 550*cf5a6c84SAndroid Build Coastguard Worker 551*cf5a6c84SAndroid Build Coastguard Worker<p>They had a fairly long list of new commands they wanted to see in toybox:</p> 552*cf5a6c84SAndroid Build Coastguard Worker 553*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 554*cf5a6c84SAndroid Build Coastguard Worker<span id=tizen_cmd> 555*cf5a6c84SAndroid Build Coastguard Workerarch base64 users unexpand shred join csplit 556*cf5a6c84SAndroid Build Coastguard Workerhostid nproc runcon sha224sum sha256sum sha384sum sha512sum sha3sum mkfs.vfat fsck.vfat 557*cf5a6c84SAndroid Build Coastguard Workerdosfslabel uname pinky diff3 sdiff zcmp zdiff zegrep zfgrep zless zmore 558*cf5a6c84SAndroid Build Coastguard Worker</span> 559*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 560*cf5a6c84SAndroid Build Coastguard Worker 561*cf5a6c84SAndroid Build Coastguard Worker<p>In addition, they wanted to use several commands then in pending:</p> 562*cf5a6c84SAndroid Build Coastguard Worker 563*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 564*cf5a6c84SAndroid Build Coastguard Worker<span id=tizen> 565*cf5a6c84SAndroid Build Coastguard Workertar diff printf wget rsync fdisk vi less tr test stty fold expr dd 566*cf5a6c84SAndroid Build Coastguard Worker</span> 567*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 568*cf5a6c84SAndroid Build Coastguard Worker 569*cf5a6c84SAndroid Build Coastguard Worker<p>Also, tizen uses a different Linux Security Module called SMACK, so 570*cf5a6c84SAndroid Build Coastguard Workermany of the SELinux options ala ls -Z needed smack alternatives in an 571*cf5a6c84SAndroid Build Coastguard Workerif/else setup. We added lib/lsm.h to abstract this, but haven't heard 572*cf5a6c84SAndroid Build Coastguard Workerfrom Tizen in years and have started implementing SELinux support without 573*cf5a6c84SAndroid Build Coastguard WorkerSmack support in places like tar.c. At some point, lib/lsm.h may go away 574*cf5a6c84SAndroid Build Coastguard Workerdue to lack of expressed interest.</p> 575*cf5a6c84SAndroid Build Coastguard Worker 576*cf5a6c84SAndroid Build Coastguard Worker<hr /> 577*cf5a6c84SAndroid Build Coastguard Worker<h2><a name=yocto /><a href="#yocto">Use case: Yocto</a></h2> 578*cf5a6c84SAndroid Build Coastguard Worker 579*cf5a6c84SAndroid Build Coastguard Worker<p>Another project the Linux Foundation is paid to appreciate is Yocto, 580*cf5a6c84SAndroid Build Coastguard Workerwhich was designed to fix the ongoing proprietary fragmentation problem 581*cf5a6c84SAndroid Build Coastguard Worker(now in Linux build systems instead of vendor unix forks) by being the 582*cf5a6c84SAndroid Build Coastguard Workerbuild system equivalent of a glue trap. While proclaiming that having the 583*cf5a6c84SAndroid Build Coastguard Worker"minimum level of standardization" contributes to a "strong ecosystem", 584*cf5a6c84SAndroid Build Coastguard WorkerYocto uses a "<a href=https://www.yoctoproject.org/software-overview/layers/>layered</a>" 585*cf5a6c84SAndroid Build Coastguard Workerdesign where everybody who touches it is encouraged to add more and more layers 586*cf5a6c84SAndroid Build Coastguard Workerof metadata on top of what came before, until they wind up <a href=https://github.com/varigit/variscite-bsp-platform>using repo</a> just to manage 587*cf5a6c84SAndroid Build Coastguard Workerthe layers (let alone their contents). But -- and this is the 588*cf5a6c84SAndroid Build Coastguard Workerimportant bit -- all these dispirate forks are called "yocto" and built on 589*cf5a6c84SAndroid Build Coastguard Workertop of giant piles of code the Linux Foundation can take credit for 590*cf5a6c84SAndroid Build Coastguard Workersince they filed the serial numbers off OpenEmbedded. (And THEN users 591*cf5a6c84SAndroid Build Coastguard Workerare encouraged to check the result into their own repository as one 592*cf5a6c84SAndroid Build Coastguard Workerbig initial commit, discarding all layers and history.)</p> 593*cf5a6c84SAndroid Build Coastguard Worker 594*cf5a6c84SAndroid Build Coastguard Worker<p>Yocto's "core-image-minimal" target (only 3,106 build steps in the 3.3 595*cf5a6c84SAndroid Build Coastguard Workerrelease, which includes building host versions of gnome packages and 596*cf5a6c84SAndroid Build Coastguard Worker<a href=https://landley.net/notes-2019.html#06-02-2019>something called</a> 597*cf5a6c84SAndroid Build Coastguard Workerthe "uninative binary shim") builds a busybox-based system with the following commands:</p> 598*cf5a6c84SAndroid Build Coastguard Worker 599*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 600*cf5a6c84SAndroid Build Coastguard Worker<span id=yocto_cmd> 601*cf5a6c84SAndroid Build Coastguard Workeraddgroup adduser ascii sh awk base32 basename blkid bunzip2 bzcat bzip2 cat 602*cf5a6c84SAndroid Build Coastguard Workerchattr chgrp chmod chown chroot chvt clear cmp cp cpio crc32 cut date dc dd 603*cf5a6c84SAndroid Build Coastguard Workerdeallocvt delgroup deluser depmod df diff dirname dmesg dnsdomainname du 604*cf5a6c84SAndroid Build Coastguard Workerdumpkmap dumpleases echo egrep env expr false fbset fdisk fgrep find flock 605*cf5a6c84SAndroid Build Coastguard Workerfree fsck fstrim fuser getopt getty grep groups gunzip gzip head hexdump 606*cf5a6c84SAndroid Build Coastguard Workerhostname hwclock id ifconfig ifdown ifup insmod ip kill killall klogd less 607*cf5a6c84SAndroid Build Coastguard Workerln loadfont loadkmap logger logname logread losetup ls lsmod lzcat md5sum 608*cf5a6c84SAndroid Build Coastguard Workermesg microcom mkdir mkfifo mknod mkswap mktemp modprobe more mount mountpoint 609*cf5a6c84SAndroid Build Coastguard Workermv nc netstat nohup nproc nslookup od openvt patch pgrep pidof pivot_root 610*cf5a6c84SAndroid Build Coastguard Workerprintf ps pwd rdate readlink realpath reboot renice reset resize rev rfkill 611*cf5a6c84SAndroid Build Coastguard Workerrm rmdir rmmod route run-parts sed seq setconsole setsid sh sha1sum sha256sum 612*cf5a6c84SAndroid Build Coastguard Workershuf sleep sort start-stop-daemon stat strings stty sulogin swapoff swapon 613*cf5a6c84SAndroid Build Coastguard Workerswitch_root sync sysctl syslogd tail tar tee telnet test tftp time top touch 614*cf5a6c84SAndroid Build Coastguard Workertr true ts tty udhcpc udhcpd umount uname uniq unlink unzip uptime users 615*cf5a6c84SAndroid Build Coastguard Workerusleep vi watch wc wget which who whoami xargs xzcat yes zcat 616*cf5a6c84SAndroid Build Coastguard Worker</span> 617*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 618*cf5a6c84SAndroid Build Coastguard Worker 619*cf5a6c84SAndroid Build Coastguard Worker<p>Nobody seems entirely sure why.</p> 620*cf5a6c84SAndroid Build Coastguard Worker 621*cf5a6c84SAndroid Build Coastguard Worker<a name="fhs" /> 622*cf5a6c84SAndroid Build Coastguard Worker<hr /><a href=fhs>Filesystem Hierachy Standard</a> 623*cf5a6c84SAndroid Build Coastguard Worker<h2>Filesystem Hierarchy Standard:</h2> 624*cf5a6c84SAndroid Build Coastguard Worker 625*cf5a6c84SAndroid Build Coastguard Worker<p>Another standard taken over by the Linux Foundation. (At least the 626*cf5a6c84SAndroid Build Coastguard Workerlinks to this one didn't <a href=http://lanana.org/>go 404</a> the 627*cf5a6c84SAndroid Build Coastguard Workerinstant they took it over). Of historical interest due to what it 628*cf5a6c84SAndroid Build Coastguard Workermanaged to achieve before they chased away the hobbyists maintaining it. 629*cf5a6c84SAndroid Build Coastguard WorkerOnly one version (3.0 in 2015) has been released since the Linux Foundation 630*cf5a6c84SAndroid Build Coastguard Workerabsorbed the FHS. The previous release, Version 2.3, was released in 2004. 631*cf5a6c84SAndroid Build Coastguard WorkerThe Linux Foundation did not retain earlier versions. The contents of 632*cf5a6c84SAndroid Build Coastguard Workerthe relevant sections appear identical between the two versions, in the 633*cf5a6c84SAndroid Build Coastguard Worker11 years between releases the Linux Foundation just added section numbers.</p> 634*cf5a6c84SAndroid Build Coastguard Worker 635*cf5a6c84SAndroid Build Coastguard Worker<p><a href=https://refspects.linuxfoundation.org/FHS_3.0/fhs-3.0.html>FHS 3.0</a> 636*cf5a6c84SAndroid Build Coastguard Workersection 3.4.2 requires commands to be in the /bin directory, and then 3.4.3 637*cf5a6c84SAndroid Build Coastguard Workerhas an optional list, 638*cf5a6c84SAndroid Build Coastguard Workerand then 3.16.2 and 3.16.3 similarly cover /sbin. There are linux 639*cf5a6c84SAndroid Build Coastguard Workerspecific sections in 6.1.2 and 6.1.6 but everything in them is obsolete.</p> 640*cf5a6c84SAndroid Build Coastguard Worker 641*cf5a6c84SAndroid Build Coastguard Worker<p>The /bin options include csh but not bash, and ed but not vi. 642*cf5a6c84SAndroid Build Coastguard WorkerThe /sbin options have "update" which seems obsolete (filesystem 643*cf5a6c84SAndroid Build Coastguard Workerbuffers haven't needed a userspace process to flush them for DECADES), 644*cf5a6c84SAndroid Build Coastguard Worker"fastboot" and "fasthalt" (reboot and halt have -nf), and 645*cf5a6c84SAndroid Build Coastguard Workerfsck.* and mkfs.* that don't actually specify any specific filesystems. 646*cf5a6c84SAndroid Build Coastguard WorkerRemoving that gives us:</p> 647*cf5a6c84SAndroid Build Coastguard Worker 648*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 649*cf5a6c84SAndroid Build Coastguard Worker<span id=fhs_cmd> 650*cf5a6c84SAndroid Build Coastguard Workercat chgrp chmod chown cp date dd df dmesg echo false hostname kill ln 651*cf5a6c84SAndroid Build Coastguard Workerlogin ls mkdir mknod more mount mv ps pwd rm rmdir sed sh stty su sync true 652*cf5a6c84SAndroid Build Coastguard Workerumount uname tar cpio gzip gunzip zcat netstat ping 653*cf5a6c84SAndroid Build Coastguard Workershutdown fdisk getty halt ifconfig init mkswap reboot route swapon swapoff 654*cf5a6c84SAndroid Build Coastguard Worker</span> 655*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 656*cf5a6c84SAndroid Build Coastguard Worker 657*cf5a6c84SAndroid Build Coastguard Worker<hr /><a name=buildroot /> 658*cf5a6c84SAndroid Build Coastguard Worker<h2>buildroot:</h2> 659*cf5a6c84SAndroid Build Coastguard Worker 660*cf5a6c84SAndroid Build Coastguard Worker<p>If a toybox-based development environment is to support running 661*cf5a6c84SAndroid Build Coastguard Workerbuildroot under it, the <a href=https://buildroot.org/downloads/manual/manual.html#requirement-mandatory>mandatory packages</a> 662*cf5a6c84SAndroid Build Coastguard Workersection of the buildroot manual lists:</p> 663*cf5a6c84SAndroid Build Coastguard Worker 664*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p><b> 665*cf5a6c84SAndroid Build Coastguard Workerwhich sed make bash patch gzip bzip2 tar cpio unzip rsync file bc wget 666*cf5a6c84SAndroid Build Coastguard Worker</b></p></blockquote> 667*cf5a6c84SAndroid Build Coastguard Worker 668*cf5a6c84SAndroid Build Coastguard Worker<p>(It also lists binutils gcc g++ perl python, and for debian it wants 669*cf5a6c84SAndroid Build Coastguard Workerthe build-essential meta-package. And it wants file to be in /usr/bin because 670*cf5a6c84SAndroid Build Coastguard Worker<a href=https://git.busybox.net/buildroot/tree/support/dependencies/dependencies.sh?h=2018.02.x#n84>libtool 671*cf5a6c84SAndroid Build Coastguard Workerbreaks otherwise</a>.)</p> 672*cf5a6c84SAndroid Build Coastguard Worker 673*cf5a6c84SAndroid Build Coastguard Worker<p>Oddly, buildroot can't NOT cross compile. Buildroot does not support a cross toolchain that lives in "/usr/bin" 674*cf5a6c84SAndroid Build Coastguard Workerwith a prefix of "". If you try, and chop out the test for a blank prefix, 675*cf5a6c84SAndroid Build Coastguard Workerit dies trying to run "/usr/bin/-gcc". In theory you can modify any open source 676*cf5a6c84SAndroid Build Coastguard Workerproject to do anything if you rewrite enough of it, but buildroot's developers 677*cf5a6c84SAndroid Build Coastguard Workerexplicitly do not support this usage model.</p> 678*cf5a6c84SAndroid Build Coastguard Worker 679*cf5a6c84SAndroid Build Coastguard Worker<hr /><a name=klibc /> 680*cf5a6c84SAndroid Build Coastguard Worker<h2>klibc:</h2> 681*cf5a6c84SAndroid Build Coastguard Worker 682*cf5a6c84SAndroid Build Coastguard Worker<p>Long ago some kernel developers came up with a project called 683*cf5a6c84SAndroid Build Coastguard Worker<a href=http://en.wikipedia.org/wiki/Klibc>klibc</a>. 684*cf5a6c84SAndroid Build Coastguard WorkerAfter a decade of development it still has no web page or HOWTO, 685*cf5a6c84SAndroid Build Coastguard Workerand nobody's quite sure if the license is BSD or GPL. It inexplicably 686*cf5a6c84SAndroid Build Coastguard Worker<a href=http://www.infoworld.com/d/data-center/perl-isnt-going-anywhere-better-or-worse-211580>requires perl to build</a>, and seems like an ideal candidate for 687*cf5a6c84SAndroid Build Coastguard Workerreplacement.</p> 688*cf5a6c84SAndroid Build Coastguard Worker 689*cf5a6c84SAndroid Build Coastguard Worker<p>In addition to a C library less general-purpose than old versions of bionic 690*cf5a6c84SAndroid Build Coastguard Worker(let alone musl), klibc builds a random assortment of executables to run init scripts 691*cf5a6c84SAndroid Build Coastguard Workerwith. There's no multiplexer command, these are individual executables:</p> 692*cf5a6c84SAndroid Build Coastguard Worker 693*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p><b> 694*cf5a6c84SAndroid Build Coastguard Workercat chroot cpio dd dmesg false fixdep fstype gunzip gzip halt ipconfig kill 695*cf5a6c84SAndroid Build Coastguard Workerkinit ln losetup ls minips mkdir mkfifo mknodes 696*cf5a6c84SAndroid Build Coastguard Workermksyntax mount mv nfsmount nuke pivot_root poweroff readlink reboot resume 697*cf5a6c84SAndroid Build Coastguard Workerrun-init sh sha1hash sleep sync true umount uname zcat 698*cf5a6c84SAndroid Build Coastguard Worker</b></p></blockquote> 699*cf5a6c84SAndroid Build Coastguard Worker 700*cf5a6c84SAndroid Build Coastguard Worker<p>To get that list, build klibc according to the instructions (I 701*cf5a6c84SAndroid Build Coastguard Worker<a href=http://landley.net/notes-2013.html#23-01-2013>looked at</a> version 702*cf5a6c84SAndroid Build Coastguard Worker2.0.2 and did cd klibc-*; ln -s /output/of/kernel/make/headers_install 703*cf5a6c84SAndroid Build Coastguard Workerlinux; make) then <b>echo $(for i in $(find . -type f); do file $i | grep -q 704*cf5a6c84SAndroid Build Coastguard Workerexecutable && basename $i; done | grep -v '[.]g$' | sort -u)</b> to find 705*cf5a6c84SAndroid Build Coastguard Workerexecutables, then eliminate the *.so files and *.shared duplicates.</p> 706*cf5a6c84SAndroid Build Coastguard Worker 707*cf5a6c84SAndroid Build Coastguard Worker<p>Some of those binaries are build-time tools that don't get installed, 708*cf5a6c84SAndroid Build Coastguard Workerwhich removes mknodes, mksyntax, sha1hash, and fixdep from the list. 709*cf5a6c84SAndroid Build Coastguard Worker(And sha1hash is just an unpolished sha1sum anyway.)</p> 710*cf5a6c84SAndroid Build Coastguard Worker 711*cf5a6c84SAndroid Build Coastguard Worker<p>The run-init command is more commonly called switch_root, nuke is just 712*cf5a6c84SAndroid Build Coastguard Worker"rm -rf -- $@", and minips is more commonly called "ps": I'm not doing aliases 713*cf5a6c84SAndroid Build Coastguard Workerfor these oddball names. 714*cf5a6c84SAndroid Build Coastguard WorkerThe "kinit" command is another gratuitous rename, it's init running as PID 1. 715*cf5a6c84SAndroid Build Coastguard WorkerThe halt, poweroff, and reboot commands work with it. 716*cf5a6c84SAndroid Build Coastguard WorkerYet more stale forks of dash and gzip got sucked in here (see "dubious 717*cf5a6c84SAndroid Build Coastguard Workerlicense terms" above).</p> 718*cf5a6c84SAndroid Build Coastguard Worker 719*cf5a6c84SAndroid Build Coastguard Worker<p>In theory "blkid" or "file" handle fstype (and df for mounted filesystems), 720*cf5a6c84SAndroid Build Coastguard Workerbut we could do fstype. We should also implement nfsmount, and probably smbmount 721*cf5a6c84SAndroid Build Coastguard Workerand p9mount even though this hasn't got one. (The reason these aren't 722*cf5a6c84SAndroid Build Coastguard Workerin the base "mount" command is they interactively query login credentials.) 723*cf5a6c84SAndroid Build Coastguard WorkerThe ipconfig command here has a built in dhcp client, so it's ifconfig 724*cf5a6c84SAndroid Build Coastguard Workerand dhcpcd and maybe some other stuff.</p> 725*cf5a6c84SAndroid Build Coastguard Worker 726*cf5a6c84SAndroid Build Coastguard Worker<p>The resume command is... weird. It finds a swap partition and reads data 727*cf5a6c84SAndroid Build Coastguard Workerfrom it into a /proc file, something the kernel is capable of doing itself. 728*cf5a6c84SAndroid Build Coastguard Worker(Even though the klibc author 729*cf5a6c84SAndroid Build Coastguard Worker<a href=http://www.zytor.com/pipermail/klibc/2006-June/001748.html>attempted 730*cf5a6c84SAndroid Build Coastguard Workerto remove</a> that capability from the kernel, current kernel/power/hibernate.c 731*cf5a6c84SAndroid Build Coastguard Workerstill parses "resume=" on the command line). And yet various distros seem to 732*cf5a6c84SAndroid Build Coastguard Workermake use of klibc for this. 733*cf5a6c84SAndroid Build Coastguard WorkerGiven the history of swsusp/hibernate (and 734*cf5a6c84SAndroid Build Coastguard Worker<a href=http://lwn.net/Articles/333007>TuxOnIce</a> 735*cf5a6c84SAndroid Build Coastguard Workerand <a href=http://lwn.net/Articles/242107>kexec jump</a>...) I've lost track 736*cf5a6c84SAndroid Build Coastguard Workerof the current state of the art here. Ah, Documentation/power/userland-swsusp.txt 737*cf5a6c84SAndroid Build Coastguard Workerhas the API docs, and <a href=http://suspend.sf.net>here's a better 738*cf5a6c84SAndroid Build Coastguard Workertool</a>...</p> 739*cf5a6c84SAndroid Build Coastguard Worker 740*cf5a6c84SAndroid Build Coastguard Worker<p>This gives us a klibc command list:</p> 741*cf5a6c84SAndroid Build Coastguard Worker 742*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 743*cf5a6c84SAndroid Build Coastguard Worker<span id=klibc_cmd> 744*cf5a6c84SAndroid Build Coastguard Workercat chroot dmesg false kill ln losetup ls mkdir mkfifo readlink rm switch_root 745*cf5a6c84SAndroid Build Coastguard Workersleep sync true uname 746*cf5a6c84SAndroid Build Coastguard Worker 747*cf5a6c84SAndroid Build Coastguard Workercpio dd ps mv pivot_root 748*cf5a6c84SAndroid Build Coastguard Workermount nfsmount fstype umount 749*cf5a6c84SAndroid Build Coastguard Workersh gunzip gzip zcat 750*cf5a6c84SAndroid Build Coastguard Workerkinit halt poweroff reboot 751*cf5a6c84SAndroid Build Coastguard Workeripconfig 752*cf5a6c84SAndroid Build Coastguard Workerresume 753*cf5a6c84SAndroid Build Coastguard Worker</span> 754*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 755*cf5a6c84SAndroid Build Coastguard Worker 756*cf5a6c84SAndroid Build Coastguard Worker<hr /> 757*cf5a6c84SAndroid Build Coastguard Worker<a name=glibc /> 758*cf5a6c84SAndroid Build Coastguard Worker<h2>glibc</h2> 759*cf5a6c84SAndroid Build Coastguard Worker 760*cf5a6c84SAndroid Build Coastguard Worker<p>Rather a lot of command line utilities come bundled with glibc:</p> 761*cf5a6c84SAndroid Build Coastguard Worker 762*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 763*cf5a6c84SAndroid Build Coastguard Workercatchsegv getconf getent iconv iconvconfig ldconfig ldd locale localedef 764*cf5a6c84SAndroid Build Coastguard Workermtrace nscd rpcent rpcinfo tzselect zdump zic 765*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 766*cf5a6c84SAndroid Build Coastguard Worker 767*cf5a6c84SAndroid Build Coastguard Worker<p>Of those, musl libc only implements ldd. Of the rest:</p> 768*cf5a6c84SAndroid Build Coastguard Worker 769*cf5a6c84SAndroid Build Coastguard Worker<ul> 770*cf5a6c84SAndroid Build Coastguard Worker<li><b>catchsegv</b> is a rudimentary debugger, probably out of scope for toybox.</li> 771*cf5a6c84SAndroid Build Coastguard Worker<li><b>iconv</b> has been <a href="#susv4">previously discussed</a>.</li> 772*cf5a6c84SAndroid Build Coastguard Worker<li><b>iconvconfig</b> is only relevant if iconv is user-configurable; musl uses a 773*cf5a6c84SAndroid Build Coastguard Workernon-configurable iconv now that utf8+unicode exist.</li> 774*cf5a6c84SAndroid Build Coastguard Worker<li><b>getconf</b> is a posix utility which displays several variables from 775*cf5a6c84SAndroid Build Coastguard Workerunistd.h; it probably belongs in the development toolchain.</li> 776*cf5a6c84SAndroid Build Coastguard Worker<li><b>getent</b> handles retrieving entries from passwd-style databases 777*cf5a6c84SAndroid Build Coastguard Worker(in a rather lame way) and is trivially replacable by grep.</li> 778*cf5a6c84SAndroid Build Coastguard Worker<li><b>locale</b> was discussed under <a href=#susv4>posix</a>.</li> 779*cf5a6c84SAndroid Build Coastguard Worker<li><b>localedef</b> compiles locale definitions, which musl currently does not use.</li> 780*cf5a6c84SAndroid Build Coastguard Worker<li><b>mtrace</b> is a perl script to use the malloc debugging that glibc has built-in; 781*cf5a6c84SAndroid Build Coastguard Workerthis is not relevant for musl, and would necessarily vary with libc.</li> 782*cf5a6c84SAndroid Build Coastguard Worker<li><b>nscd</b> is a name service caching daemon, which is not yet relevant for musl.</li> 783*cf5a6c84SAndroid Build Coastguard Worker<li><b>rpcinfo</b> and <b>rpcent</b> are related to the Remote Procedure Calls 784*cf5a6c84SAndroid Build Coastguard Workerlayer (an old sun technology used by some userspace NFS implementations), 785*cf5a6c84SAndroid Build Coastguard Workerwhich musl does not include and debian does not install by default.</li> 786*cf5a6c84SAndroid Build Coastguard Worker</ul> 787*cf5a6c84SAndroid Build Coastguard Worker 788*cf5a6c84SAndroid Build Coastguard Worker<p>The remaining commands involve glibc's bundled timezone database, 789*cf5a6c84SAndroid Build Coastguard Workerwhich seems to be derived from the <a href=http://www.iana.org/time-zones>IANA 790*cf5a6c84SAndroid Build Coastguard Workertimezone database</a>. Unless we want to maintain our own fork of the 791*cf5a6c84SAndroid Build Coastguard Workerstandards body's database like glibc does, these are of no interest, 792*cf5a6c84SAndroid Build Coastguard Workerbut for completeness:</p> 793*cf5a6c84SAndroid Build Coastguard Worker 794*cf5a6c84SAndroid Build Coastguard Worker<ul> 795*cf5a6c84SAndroid Build Coastguard Worker<li><b>tzselect</b> outputs a TZ variable correponding to user input. 796*cf5a6c84SAndroid Build Coastguard WorkerThe documentation does not indicate how to use it in a script, but it seems 797*cf5a6c84SAndroid Build Coastguard Workerthat Debian may have done so.</li> 798*cf5a6c84SAndroid Build Coastguard Worker<li><b>zdump</b> prints current time in each of several timezones, optionally 799*cf5a6c84SAndroid Build Coastguard Workeroutputting a great deal of extra information about each timezone.</li> 800*cf5a6c84SAndroid Build Coastguard Worker<li><b>zic</b> converts a description of a timezone to a file in tz format.</li> 801*cf5a6c84SAndroid Build Coastguard Worker</ul> 802*cf5a6c84SAndroid Build Coastguard Worker 803*cf5a6c84SAndroid Build Coastguard Worker<p>We implemented getconf and iconv, and I could see maybe arguing for ncsd. 804*cf5a6c84SAndroid Build Coastguard WorkerThe rest are not relevant to toybox.</p> 805*cf5a6c84SAndroid Build Coastguard Worker 806*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 807*cf5a6c84SAndroid Build Coastguard Worker 808*cf5a6c84SAndroid Build Coastguard Worker<hr /> 809*cf5a6c84SAndroid Build Coastguard Worker<a name=sash /> 810*cf5a6c84SAndroid Build Coastguard Worker<h2>Stand-Alone Shell</h2> 811*cf5a6c84SAndroid Build Coastguard Worker 812*cf5a6c84SAndroid Build Coastguard Worker<p>Wikipedia has <a href=http://en.wikipedia.org/wiki/Stand-alone_shell>a good 813*cf5a6c84SAndroid Build Coastguard Workersummary of sash</a>, with links. The original Stand-Alone Shell project reached 814*cf5a6c84SAndroid Build Coastguard Workera stopping point, and then <a href=http://www.baiti.net/sash>"sash plus 815*cf5a6c84SAndroid Build Coastguard Workerpatches"</a> extended it a bit further. The result is a megabyte executable 816*cf5a6c84SAndroid Build Coastguard Workerthat provides 40 commands.</p> 817*cf5a6c84SAndroid Build Coastguard Worker 818*cf5a6c84SAndroid Build Coastguard Worker<p>Sash is a shell with built-in commands. It doesn't have a multiplexer 819*cf5a6c84SAndroid Build Coastguard Workercommand, meaning "sash ls -l" doesn't work (you have to go "sash -c 'ls -l'"). 820*cf5a6c84SAndroid Build Coastguard Worker</p> 821*cf5a6c84SAndroid Build Coastguard Worker 822*cf5a6c84SAndroid Build Coastguard Worker<p>The list of commands can be obtained via building it and doing 823*cf5a6c84SAndroid Build Coastguard Worker"echo help | ./sash | awk '{print $1}' | sed 's/^-//' | xargs echo", which 824*cf5a6c84SAndroid Build Coastguard Workergives us:</p> 825*cf5a6c84SAndroid Build Coastguard Worker 826*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 827*cf5a6c84SAndroid Build Coastguard Workeralias aliasall ar cd chattr chgrp chmod chown cmp cp chroot dd echo ed exec 828*cf5a6c84SAndroid Build Coastguard Workerexit file find grep gunzip gzip help kill losetup losetup ln ls lsattr mkdir 829*cf5a6c84SAndroid Build Coastguard Workermknod more mount mv pivot_root printenv prompt pwd quit rm rmdir setenv source 830*cf5a6c84SAndroid Build Coastguard Workersum sync tar touch umask umount unalias where 831*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 832*cf5a6c84SAndroid Build Coastguard Worker 833*cf5a6c84SAndroid Build Coastguard Worker<p>Plus sh because it's a shell. A dozen or so commands can only sanely be 834*cf5a6c84SAndroid Build Coastguard Workerimplemented as shell builtins (alias aliasall cd exec exit prompt quit setenv 835*cf5a6c84SAndroid Build Coastguard Workersource umask unalias), and where is an alias for which.</p> 836*cf5a6c84SAndroid Build Coastguard Worker 837*cf5a6c84SAndroid Build Coastguard Worker<p>This leaves:</p> 838*cf5a6c84SAndroid Build Coastguard Worker 839*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 840*cf5a6c84SAndroid Build Coastguard Worker<span id=sash_cmd> 841*cf5a6c84SAndroid Build Coastguard Workerchgrp chmod chown cmp cp chroot echo find grep help kill losetup 842*cf5a6c84SAndroid Build Coastguard Workerln ls mkdir mknod mount mv pivot_root printenv pwd rm rmdir sync tar touch umount 843*cf5a6c84SAndroid Build Coastguard Workerar chattr dd ed file gunzip gzip lsattr more sh 844*cf5a6c84SAndroid Build Coastguard Worker</span> 845*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 846*cf5a6c84SAndroid Build Coastguard Worker 847*cf5a6c84SAndroid Build Coastguard Worker<p>(For once, this project doesn't include a fork of gzip, instead 848*cf5a6c84SAndroid Build Coastguard Workerit sucks in -lz from the host.)</p> 849*cf5a6c84SAndroid Build Coastguard Worker 850*cf5a6c84SAndroid Build Coastguard Worker<hr /> 851*cf5a6c84SAndroid Build Coastguard Worker<a name=sbase /> 852*cf5a6c84SAndroid Build Coastguard Worker<h2>sbase:</h2> 853*cf5a6c84SAndroid Build Coastguard Worker 854*cf5a6c84SAndroid Build Coastguard Worker<p>It's <a href=http://git.suckless.org/sbase>on suckless</a> in 855*cf5a6c84SAndroid Build Coastguard Worker<a href=http://git.suckless.org/ubase>two parts</a>. As of November 2015 it's 856*cf5a6c84SAndroid Build Coastguard Workerimplemented the following (renaming "cron" to "crond" for 857*cf5a6c84SAndroid Build Coastguard Workerconsistency, and yanking "sponge", "mesg", "pagesize", "respawn", and 858*cf5a6c84SAndroid Build Coastguard Worker"vtallow"):</p> 859*cf5a6c84SAndroid Build Coastguard Worker 860*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p> 861*cf5a6c84SAndroid Build Coastguard Worker<span id=sbase_cmd> 862*cf5a6c84SAndroid Build Coastguard Workerbasename cal cat chgrp chmod chown chroot cksum cmp comm cp crond cut date 863*cf5a6c84SAndroid Build Coastguard Workerdirname du echo env expand expr false find flock fold getconf grep head 864*cf5a6c84SAndroid Build Coastguard Workerhostname join kill link ln logger logname ls md5sum mkdir mkfifo mktemp mv 865*cf5a6c84SAndroid Build Coastguard Workernice nl nohup od paste printenv printf pwd readlink renice rm rmdir sed seq 866*cf5a6c84SAndroid Build Coastguard Workersetsid sha1sum sha256sum sha512sum sleep sort split strings sync tail 867*cf5a6c84SAndroid Build Coastguard Workertar tee test tftp time touch tr true tty uname unexpand uniq unlink uudecode 868*cf5a6c84SAndroid Build Coastguard Workeruuencode wc which xargs yes 869*cf5a6c84SAndroid Build Coastguard Worker</span> 870*cf5a6c84SAndroid Build Coastguard Worker</p></blockquote> 871*cf5a6c84SAndroid Build Coastguard Worker 872*cf5a6c84SAndroid Build Coastguard Worker<p>and<p> 873*cf5a6c84SAndroid Build Coastguard Worker 874*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p> 875*cf5a6c84SAndroid Build Coastguard Worker<span id=sbase_cmd> 876*cf5a6c84SAndroid Build Coastguard Workerchvt clear dd df dmesg eject fallocate free id login mknod mountpoint 877*cf5a6c84SAndroid Build Coastguard Workerpasswd pidof ps stat su truncate unshare uptime watch 878*cf5a6c84SAndroid Build Coastguard Workerwho 879*cf5a6c84SAndroid Build Coastguard Worker</span> 880*cf5a6c84SAndroid Build Coastguard Worker</p></blockquote> 881*cf5a6c84SAndroid Build Coastguard Worker 882*cf5a6c84SAndroid Build Coastguard Worker<hr /> 883*cf5a6c84SAndroid Build Coastguard Worker<a name=nash /> 884*cf5a6c84SAndroid Build Coastguard Worker<h2>nash:</h2> 885*cf5a6c84SAndroid Build Coastguard Worker 886*cf5a6c84SAndroid Build Coastguard Worker<p>Red Hat's nash was part of its "mkinitrd" package, replacement for a shell 887*cf5a6c84SAndroid Build Coastguard Workerand utilities on the boot floppy back in the 1990's (the same general idea 888*cf5a6c84SAndroid Build Coastguard Workeras BusyBox, developed independently). Red Hat discontinued nash development 889*cf5a6c84SAndroid Build Coastguard Workerin 2010, replacing it with dracut (which collects together existing packages, 890*cf5a6c84SAndroid Build Coastguard Workerincluding busybox).</p> 891*cf5a6c84SAndroid Build Coastguard Worker 892*cf5a6c84SAndroid Build Coastguard Worker<p>I couldn't figure out how to beat source code out of 893*cf5a6c84SAndroid Build Coastguard Worker<a href=http://pkgs.fedoraproject.org/git/mkinitrd>Fedora's current git</a> 894*cf5a6c84SAndroid Build Coastguard Workerrepository. The last release version that used it was Fedora Core 12 895*cf5a6c84SAndroid Build Coastguard Workerwhich has <a href=http://archive.fedoraproject.org/pub/archive/fedora/linux/releases/12/Fedora/source/SRPMS/mkinitrd-6.0.93-1.fc12.src.rpm>a source rpm</a> 896*cf5a6c84SAndroid Build Coastguard Workerthat can be unwound with "rpm2cpio mkinitrd.src.rpm | cpio -i -d -H newc 897*cf5a6c84SAndroid Build Coastguard Worker--no-absolute-filenames" and in there is a mkinitrd-6.0.93.tar.bz2 which 898*cf5a6c84SAndroid Build Coastguard Workerhas the source.</p> 899*cf5a6c84SAndroid Build Coastguard Worker 900*cf5a6c84SAndroid Build Coastguard Worker<p>In addition to being a bit like a command shell, the nash man page lists the 901*cf5a6c84SAndroid Build Coastguard Workerfollowing commands:</p> 902*cf5a6c84SAndroid Build Coastguard Worker 903*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p> 904*cf5a6c84SAndroid Build Coastguard Workeraccess echo find losetup mkdevices mkdir mknod mkdmnod mkrootdev mount 905*cf5a6c84SAndroid Build Coastguard Workerpivot_root readlink raidautorun setquiet showlabels sleep switchroot umount 906*cf5a6c84SAndroid Build Coastguard Worker</p></blockquote> 907*cf5a6c84SAndroid Build Coastguard Worker 908*cf5a6c84SAndroid Build Coastguard Worker<p>Oddly, the only occurrence of the string pivot_root in the nash source code 909*cf5a6c84SAndroid Build Coastguard Workeris in the man page, the command isn't there. (It seems to have been removed 910*cf5a6c84SAndroid Build Coastguard Workerwhen the underscoreless switchroot went in.)</p> 911*cf5a6c84SAndroid Build Coastguard Worker 912*cf5a6c84SAndroid Build Coastguard Worker<p>A more complete list seems to be the handlers[] array in nash.c:</p> 913*cf5a6c84SAndroid Build Coastguard Worker 914*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p> 915*cf5a6c84SAndroid Build Coastguard Workeraccess buildEnv cat cond cp daemonize dm echo exec exit find kernelopt 916*cf5a6c84SAndroid Build Coastguard WorkerloadDrivers loadpolicy mkchardevs mkblktab mkblkdevs mkdir mkdmnod mknod 917*cf5a6c84SAndroid Build Coastguard Workermkrootdev mount netname network null plymouth hotplug killplug losetup 918*cf5a6c84SAndroid Build Coastguard Workerln ls raidautorun readlink resume resolveDevice rmparts setDeviceEnv 919*cf5a6c84SAndroid Build Coastguard Workersetquiet setuproot showelfinterp showlabels sleep stabilized status switchroot 920*cf5a6c84SAndroid Build Coastguard Workerumount waitdev 921*cf5a6c84SAndroid Build Coastguard Worker</p></blockquote> 922*cf5a6c84SAndroid Build Coastguard Worker 923*cf5a6c84SAndroid Build Coastguard Worker<p>This list is nuts: "plymouth" is an alias for "null" which is basically 924*cf5a6c84SAndroid Build Coastguard Worker"true" (which the above list doesn't have). Things like buildEnv and 925*cf5a6c84SAndroid Build Coastguard WorkerloadDrivers are bespoke Red Hat behavior that might as well be hardwired in 926*cf5a6c84SAndroid Build Coastguard Workerto nash's main() without being called.</p> 927*cf5a6c84SAndroid Build Coastguard Worker 928*cf5a6c84SAndroid Build Coastguard Worker<p>Instead of eliminating items 929*cf5a6c84SAndroid Build Coastguard Workerfrom the list with an explanation for each, I'm just going to cherry pick 930*cf5a6c84SAndroid Build Coastguard Workera few: the device mapper (dm, raidautorun) is probably interesting, 931*cf5a6c84SAndroid Build Coastguard Workerhotplug (may be obsolete due to kernel changes that now load firmware 932*cf5a6c84SAndroid Build Coastguard Workerdirectly), and another "resume" ala klibc.</p> 933*cf5a6c84SAndroid Build Coastguard Worker 934*cf5a6c84SAndroid Build Coastguard Worker<p>But mostly: I don't care about this one. And neither does Red Hat anymore.</p> 935*cf5a6c84SAndroid Build Coastguard Worker 936*cf5a6c84SAndroid Build Coastguard Worker<p>Verdict: ignore</p> 937*cf5a6c84SAndroid Build Coastguard Worker 938*cf5a6c84SAndroid Build Coastguard Worker<hr /> 939*cf5a6c84SAndroid Build Coastguard Worker<a name=beastiebox /> 940*cf5a6c84SAndroid Build Coastguard Worker<h2>Beastiebox</h2> 941*cf5a6c84SAndroid Build Coastguard Worker 942*cf5a6c84SAndroid Build Coastguard Worker<p>Back in 2008, the BSD guys vented some busybox-envy 943*cf5a6c84SAndroid Build Coastguard Worker<a href=http://beastiebox.sourceforge.net>on sourceforge</a>. Then stopped. 944*cf5a6c84SAndroid Build Coastguard WorkerTheir repository is still in CVS, hasn't been touched in years, it's a giant 945*cf5a6c84SAndroid Build Coastguard Workerhairball of existing code sucked together. (The web page says the author 946*cf5a6c84SAndroid Build Coastguard Workeris aware of crunchgen, but decided to do this by hand anyway. This is not 947*cf5a6c84SAndroid Build Coastguard Workera collection of new code, it's a katamari of existing code rolled up in a 948*cf5a6c84SAndroid Build Coastguard Workerball.)</p> 949*cf5a6c84SAndroid Build Coastguard Worker 950*cf5a6c84SAndroid Build Coastguard Worker<p>Combining the set of commands listed on the web page with the set of 951*cf5a6c84SAndroid Build Coastguard Workerman pages in the source gives us:</P> 952*cf5a6c84SAndroid Build Coastguard Worker 953*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p> 954*cf5a6c84SAndroid Build Coastguard Worker[ cat chmod cp csh date df disklabel dmesg echo ex fdisk fsck fsck_ffs getty 955*cf5a6c84SAndroid Build Coastguard Workerhalt hostname ifconfig init kill less lesskey ln login ls lv mksh more mount 956*cf5a6c84SAndroid Build Coastguard Workermount_ffs mv pfctl ping poweroff ps reboot rm route sed sh stty sysctl tar test 957*cf5a6c84SAndroid Build Coastguard Workertraceroute umount vi wiconfig 958*cf5a6c84SAndroid Build Coastguard Worker</p></blockquote> 959*cf5a6c84SAndroid Build Coastguard Worker 960*cf5a6c84SAndroid Build Coastguard Worker<p>Apparently lv is the missing link between ed and vi, copyright 1982-1997 (do 961*cf5a6c84SAndroid Build Coastguard Workernot want), ex is another obsolete vi mode, lesskey is "used to 962*cf5a6c84SAndroid Build Coastguard Workerspecify a set of key bindings to be used with less", and csh is a shell they 963*cf5a6c84SAndroid Build Coastguard Workersucked in (even though they have mksh?), [ is an alias for test. Several more bsd-isms that don't have Linux 964*cf5a6c84SAndroid Build Coastguard Workerequivalents (even in the ubuntu "install this package" search) are 965*cf5a6c84SAndroid Build Coastguard Workerdisklabel, fsck_ffs, mount_ffs, and pfctl. And wiconfig is a 966*cf5a6c84SAndroid Build Coastguard Workerwavelan interface network card driver utility. Subtracting all that and the 967*cf5a6c84SAndroid Build Coastguard Workercommands toybox already implements at triage time, we get:</p> 968*cf5a6c84SAndroid Build Coastguard Worker 969*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p> 970*cf5a6c84SAndroid Build Coastguard Worker<span id=beastiebox_cmd> 971*cf5a6c84SAndroid Build Coastguard Workerfdisk fsck getty halt ifconfig init kill less more mount mv ping poweroff 972*cf5a6c84SAndroid Build Coastguard Workerps reboot route sed sh stty sysctl tar test traceroute umount vi 973*cf5a6c84SAndroid Build Coastguard Worker</span> 974*cf5a6c84SAndroid Build Coastguard Worker</p></blockquote> 975*cf5a6c84SAndroid Build Coastguard Worker 976*cf5a6c84SAndroid Build Coastguard Worker<p>Not a hugely interesting list, but eh.</p> 977*cf5a6c84SAndroid Build Coastguard Worker 978*cf5a6c84SAndroid Build Coastguard Worker<p>Verdict: ignore</p> 979*cf5a6c84SAndroid Build Coastguard Worker 980*cf5a6c84SAndroid Build Coastguard Worker<hr /> 981*cf5a6c84SAndroid Build Coastguard Worker<a name=BsdBox /> 982*cf5a6c84SAndroid Build Coastguard Worker<h2>BsdBox</h2> 983*cf5a6c84SAndroid Build Coastguard Worker 984*cf5a6c84SAndroid Build Coastguard Worker<p>Somebody decided to do a <a href=https://wiki.freebsd.org/AdrianChadd/BsdBox>multicall binary for freebsd</a>.</p> 985*cf5a6c84SAndroid Build Coastguard Worker 986*cf5a6c84SAndroid Build Coastguard Worker<p>They based it on crunchgen, a tool that glues existing programs together 987*cf5a6c84SAndroid Build Coastguard Workerinto an archive and uses the name to execute the right one. It has no 988*cf5a6c84SAndroid Build Coastguard Workersimplification or code sharing benefits whatsoever, it's basically an 989*cf5a6c84SAndroid Build Coastguard Workerarchiver that produces executables.</p> 990*cf5a6c84SAndroid Build Coastguard Worker 991*cf5a6c84SAndroid Build Coastguard Worker<p>That's about where I stopped reading.</p> 992*cf5a6c84SAndroid Build Coastguard Worker 993*cf5a6c84SAndroid Build Coastguard Worker<p>Verdict: ignore.</p> 994*cf5a6c84SAndroid Build Coastguard Worker 995*cf5a6c84SAndroid Build Coastguard Worker<hr /> 996*cf5a6c84SAndroid Build Coastguard Worker<a name=slowaris /> 997*cf5a6c84SAndroid Build Coastguard Worker<h2>OpenSolaris Busybox</h2> 998*cf5a6c84SAndroid Build Coastguard Worker 999*cf5a6c84SAndroid Build Coastguard Worker<p>Somebody <a href=http://hub.opensolaris.org/bin/view/Project+busybox/>wrote 1000*cf5a6c84SAndroid Build Coastguard Workera wiki page</a> saying that Busybox for OpenSolaris would be a good idea.</p> 1001*cf5a6c84SAndroid Build Coastguard Worker 1002*cf5a6c84SAndroid Build Coastguard Worker<p>The corresponding "files" tab is an auto-generated stub. The project never 1003*cf5a6c84SAndroid Build Coastguard Workereven got as far as suggesting commands to include before Oracle discontinued 1004*cf5a6c84SAndroid Build Coastguard WorkerOpenSolaris.</p> 1005*cf5a6c84SAndroid Build Coastguard Worker 1006*cf5a6c84SAndroid Build Coastguard Worker<p>Verdict: ignore.</p> 1007*cf5a6c84SAndroid Build Coastguard Worker 1008*cf5a6c84SAndroid Build Coastguard Worker<hr /> 1009*cf5a6c84SAndroid Build Coastguard Worker<a name=uclinux /> 1010*cf5a6c84SAndroid Build Coastguard Worker<h2>uClinux</h2> 1011*cf5a6c84SAndroid Build Coastguard Worker 1012*cf5a6c84SAndroid Build Coastguard Worker<p>Long ago a hardware developer named Jeff Dionne put together a 1013*cf5a6c84SAndroid Build Coastguard Workernommu Linux distribution, which involved rewriting a lot of command line 1014*cf5a6c84SAndroid Build Coastguard Workerutilities that relied on <a href=http://nommu.org/memory-faq.txt>features 1015*cf5a6c84SAndroid Build Coastguard Workerunavailable on nommu</a> hardware.</p> 1016*cf5a6c84SAndroid Build Coastguard Worker 1017*cf5a6c84SAndroid Build Coastguard Worker<p>In 2003 Jeff moved to Japan and handed 1018*cf5a6c84SAndroid Build Coastguard Workerthe project off to people who allowed it to roll to a stop. The website 1019*cf5a6c84SAndroid Build Coastguard Workerturned into a mess of 404 links, the navigation indexes stopped being 1020*cf5a6c84SAndroid Build Coastguard Workerupdated over a decade ago, and the project's CVS repository suffered a 1021*cf5a6c84SAndroid Build Coastguard Workerhard drive failure for which there were no backups. The project continued 1022*cf5a6c84SAndroid Build Coastguard Workerto put out "releases" through 2014 (you have to scroll down in the "news" 1023*cf5a6c84SAndroid Build Coastguard Workersection to find them, the "HTTP download" section in the nav bar on the 1024*cf5a6c84SAndroid Build Coastguard Workerleft hasn't been updated in over a decade), which were hand-updated tarball 1025*cf5a6c84SAndroid Build Coastguard Workersnapshots mostly consisting of software from the 1990's. For example the 1026*cf5a6c84SAndroid Build Coastguard Worker2014 release still contained ipfwadm, the package which predated ipchains, 1027*cf5a6c84SAndroid Build Coastguard Workerwhich predated iptables, which is in the process of being replaced by 1028*cf5a6c84SAndroid Build Coastguard Workernftables.</p> 1029*cf5a6c84SAndroid Build Coastguard Worker 1030*cf5a6c84SAndroid Build Coastguard Worker<p>Nevertheless, people still try to use this because the project was viewed 1031*cf5a6c84SAndroid Build Coastguard Workeras the place to discuss, develop, and learn about nommu Linux. 1032*cf5a6c84SAndroid Build Coastguard WorkerThe role of uclinux.org as an educational resource kept people coming 1033*cf5a6c84SAndroid Build Coastguard Workerto it long after it had collapsed as a Linux distro.</p> 1034*cf5a6c84SAndroid Build Coastguard Worker 1035*cf5a6c84SAndroid Build Coastguard Worker<p>Starting around 0.6.0 toybox began to address nommu support with the goal 1036*cf5a6c84SAndroid Build Coastguard Workerof putting uClinux out of its misery.</p> 1037*cf5a6c84SAndroid Build Coastguard Worker 1038*cf5a6c84SAndroid Build Coastguard Worker<p>An analysis of <a href=http://www.uclinux.org/pub/uClinux/dist/uClinux-dist-20140504.tar.bz2>uClinux-dist-20140504</a> found 312 package 1039*cf5a6c84SAndroid Build Coastguard Workersubdirectories under "user".</p> 1040*cf5a6c84SAndroid Build Coastguard Worker 1041*cf5a6c84SAndroid Build Coastguard Worker<h3>Taking out the trash</h3> 1042*cf5a6c84SAndroid Build Coastguard Worker 1043*cf5a6c84SAndroid Build Coastguard Worker<p>A bunch of packages (<b>inotify-tools, input-event-demon, ipsec-tools, netifd, 1044*cf5a6c84SAndroid Build Coastguard Workerkeepalived, mobile-broadband-provider-info, nuttp, readline, snort, 1045*cf5a6c84SAndroid Build Coastguard Workersnort-barnyard, socat, sqlite, sysklogd, sysstat, tcl, ubus, uci, udev, 1046*cf5a6c84SAndroid Build Coastguard Workerunionfs, uqmi, usb_modeswitch, usbutils, util-linux</b>) 1047*cf5a6c84SAndroid Build Coastguard Workerare hard to evaluate because 1048*cf5a6c84SAndroid Build Coastguard Workeruclinux has directories for them, but their source isn't actually in the 1049*cf5a6c84SAndroid Build Coastguard Workeruclinux tree. In some of these the makefiles download a git repo during 1050*cf5a6c84SAndroid Build Coastguard Workerthe build, so I'm assuming you can build the external package if you really 1051*cf5a6c84SAndroid Build Coastguard Workercare. (Even when I know what these packages do, I'm skipping them 1052*cf5a6c84SAndroid Build Coastguard Workerbecause uclinux doesn't actually contain them, and any given snapshot 1053*cf5a6c84SAndroid Build Coastguard Workerof the build system will bitrot as external web links change over time.)</p> 1054*cf5a6c84SAndroid Build Coastguard Worker 1055*cf5a6c84SAndroid Build Coastguard Worker<p>Other packages are orphaned, meaning they're not mentioned from any Kconfig 1056*cf5a6c84SAndroid Build Coastguard Workeror Makefiles outside of their directory, so uclinux can't actually build 1057*cf5a6c84SAndroid Build Coastguard Workerthem: <b>mbus</b> is an orphaned i2c test program expecting to run in some sort 1058*cf5a6c84SAndroid Build Coastguard Workerof hardwired hardware context, <b>mkeccbin</b> is an orphaned "ECC annotated 1059*cf5a6c84SAndroid Build Coastguard Workerbinary file" generator (meaning it's half of a flash writer), 1060*cf5a6c84SAndroid Build Coastguard Worker<b>wsc_upnp</b> is a "Ralink WPS" driver (some sort of stale wifi chip)...</p> 1061*cf5a6c84SAndroid Build Coastguard Worker 1062*cf5a6c84SAndroid Build Coastguard Worker<p>The majority of the remaining packages are probably not of interest to 1063*cf5a6c84SAndroid Build Coastguard Workertoybox due to being so obsolete or special purpose they may not actually be 1064*cf5a6c84SAndroid Build Coastguard Workerof interest to anybody anymore. (This list also includes a lot of 1065*cf5a6c84SAndroid Build Coastguard Workerspecial-purpose network back-end stuff that's hard for anybody but 1066*cf5a6c84SAndroid Build Coastguard Workerdatacenter admins to evaluate the current relevance of.)</p> 1067*cf5a6c84SAndroid Build Coastguard Worker 1068*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b><p> 1069*cf5a6c84SAndroid Build Coastguard Workerarj asterisk boottools bpalogin br2684ctl camserv can4linux cgi_generic 1070*cf5a6c84SAndroid Build Coastguard Workercgihtml clamav clamsmtp conntrack-tools cramfs crypto-tools cxxtest 1071*cf5a6c84SAndroid Build Coastguard Workerddns3-client de2ts-cal debug demo diald discard dnsmasq dnsmasq2 1072*cf5a6c84SAndroid Build Coastguard Workerethattach expat-examples ez-ipupdate fakeidentd 1073*cf5a6c84SAndroid Build Coastguard Workerfconfig ferret flatfs flthdr freeradius freeswan frob-led frox fswcert 1074*cf5a6c84SAndroid Build Coastguard Workergame gettyd gnugk haserl horch 1075*cf5a6c84SAndroid Build Coastguard Workerhostap hping httptunnel ifattach ipchains 1076*cf5a6c84SAndroid Build Coastguard Workeripfwadm ipmasqadm ipportfw ipredir ipset iso_client 1077*cf5a6c84SAndroid Build Coastguard Workerjamvm jffs-tools jpegview jquery-ui kendin-config kismet klaxon kmod 1078*cf5a6c84SAndroid Build Coastguard Workerl2tpd lcd ledcmd ledcon lha lilo lirc lissa load loattach 1079*cf5a6c84SAndroid Build Coastguard Workerlpr lrpstat lrzsz mail mbus mgetty microwin ModemManager msntp musicbox 1080*cf5a6c84SAndroid Build Coastguard Workernooom null openswan openvpn palmbot pam_* pcmcia-cs playrt plugdaemon pop3proxy 1081*cf5a6c84SAndroid Build Coastguard Workerpotrace qspitest quagga radauth 1082*cf5a6c84SAndroid Build Coastguard Workerramimage readprofile rdate readprofile routed rrdtool rtc-ds1302 1083*cf5a6c84SAndroid Build Coastguard Workersendip ser sethdlc setmac setserial sgutool sigs siproxd slattach 1084*cf5a6c84SAndroid Build Coastguard Workersmtpclient snmpd net-snmp snortrules speedtouch squashfs scep sslwrap stp 1085*cf5a6c84SAndroid Build Coastguard Workerstunnel tcpblast tcpdump tcpwrappers threaddemos tinylogin tinyproxy 1086*cf5a6c84SAndroid Build Coastguard Workertpt tripwire unrar unzoo version vpnled w3cam xl2tpd zebra 1087*cf5a6c84SAndroid Build Coastguard Worker</p></b></blockquote> 1088*cf5a6c84SAndroid Build Coastguard Worker 1089*cf5a6c84SAndroid Build Coastguard Worker<p>This stuff is all over the place: arj, lha, rar, and zoo are DOS archivers, 1090*cf5a6c84SAndroid Build Coastguard Workerethattach describes itself as just "a network tool", 1091*cf5a6c84SAndroid Build Coastguard Workermail is a textmode smtp mailer literally described as "Some kind of mail 1092*cf5a6c84SAndroid Build Coastguard Workerproggy" in uclinux's kconfig (as opposed to clamsmtp and smtpclient and 1093*cf5a6c84SAndroid Build Coastguard Workerso on), this gettyd isn't a generic version but specifically a 1094*cf5a6c84SAndroid Build Coastguard Workerhardwired ppp dialin utility, mgetty isn't a generic version but is combined 1095*cf5a6c84SAndroid Build Coastguard Workerwith "sendfax", hostap is an intersil prism driver, wlan-ng is also an 1096*cf5a6c84SAndroid Build Coastguard Workerintersil prism dirver, null is a program to intentionally dereference a 1097*cf5a6c84SAndroid Build Coastguard Workernull pointer (in case you needed one), iso_client is a 1098*cf5a6c84SAndroid Build Coastguard Worker"Demo Application for the USB Device Driver", kendin-config is 1099*cf5a6c84SAndroid Build Coastguard Worker"for configuring the Micrel Kendin KS8995M over QSPI", speedtouch configures 1100*cf5a6c84SAndroid Build Coastguard Workera specific brand of asdl modem, portmap is part of Anfs, 1101*cf5a6c84SAndroid Build Coastguard Workerferret, linux-igd, and miniupnp are all upnp packages, 1102*cf5a6c84SAndroid Build Coastguard Workerlanbypass "can be used to control the LAN 1103*cf5a6c84SAndroid Build Coastguard Workerbypass switches on the Advantech x86 based hardware platforms", lcd is 1104*cf5a6c84SAndroid Build Coastguard Worker"test of lcddma device driver" (an out-of-tree Coldfire driver apparently 1105*cf5a6c84SAndroid Build Coastguard Workerlost to history, the uclinux linux-2.4.x directory has a config symbol for 1106*cf5a6c84SAndroid Build Coastguard Workerit, but nothing in the code actually _uses_ it...), qspitest is another 1107*cf5a6c84SAndroid Build Coastguard Workercoldfire thing, mii-tool-fec is 1108*cf5a6c84SAndroid Build Coastguard Worker"strictly for the FEC Ethernet driver as implemented (and modified) for 1109*cf5a6c84SAndroid Build Coastguard Workerthe uCdimm5272", rtc-ds1302 and rtc-m41t11 are usermode drivers for specific 1110*cf5a6c84SAndroid Build Coastguard Workerclock chips, stunnel is basically "openssl s_client -quiet -connect", 1111*cf5a6c84SAndroid Build Coastguard Workerpotrace is a bitmap to vector graphic converter, radauth performs command line 1112*cf5a6c84SAndroid Build Coastguard Workerauthentication against a radius server, 1113*cf5a6c84SAndroid Build Coastguard Workerclamav, klaxon, ferret, l7-protocols, and nessus are very old network security 1114*cf5a6c84SAndroid Build Coastguard Workersoftware (it's got a stale snapshot of nmap too), xl2tpd is a PPP over UDP 1115*cf5a6c84SAndroid Build Coastguard Workertunnel (rfc 2661), zebra is the package quagga replaced, 1116*cf5a6c84SAndroid Build Coastguard Workerlilo is the x86-only bootloader that predated grub (and recently discontinued 1117*cf5a6c84SAndroid Build Coastguard Workerdevelopment), lissa is a "framebuffer graphics demo" from 1118*cf5a6c84SAndroid Build Coastguard Worker1998, the squashfs package here is the out of tree patches for 2.4 kernels 1119*cf5a6c84SAndroid Build Coastguard Workerand such before the filesystem was merged upstream (as opposed to the 1120*cf5a6c84SAndroid Build Coastguard Workersquashfs-new package which is a snapshot of the userspace tool from 2011), 1121*cf5a6c84SAndroid Build Coastguard Workerload is basically "dd file /dev/spi", version is basically "cat /proc/version", 1122*cf5a6c84SAndroid Build Coastguard Workermicrowin is a port of the WinCE graphics API to Linux, scep is a 2003 1123*cf5a6c84SAndroid Build Coastguard Workerimplementation of an IETF draft abandoned in 2010, tpt depends on 1124*cf5a6c84SAndroid Build Coastguard WorkerAndrew Morton's 15 year old unmerged "timepegs" kernel patch using the pentium 1125*cf5a6c84SAndroid Build Coastguard Workercycle counter, vpnled controls a light that reboots systems (what?), 1126*cf5a6c84SAndroid Build Coastguard Workerw3cam is a video4linux 1.0 client (v4l2 showed up during 2.5 and support for 1127*cf5a6c84SAndroid Build Coastguard Workerthe old v4l1 was removed in 2.6.38 back in 2011), busybox ate tinylogin 1128*cf5a6c84SAndroid Build Coastguard Workerover a decade ago, lrpstat is a java network monitor 1129*cf5a6c84SAndroid Build Coastguard Workerfrom 2001, lrzsz is zmodem/ymodem/zmodem, msntp and stp implement rfc2030 1130*cf5a6c84SAndroid Build Coastguard Workermeaning it overflows in 2036 (the package was last updated in 2000), rdate 1131*cf5a6c84SAndroid Build Coastguard Workeris rfc 868 meaning it also overflows in 2036 (which is why ntp was invented 1132*cf5a6c84SAndroid Build Coastguard Workera few decades back), reiserfsprogs development stopped abruptly after 1133*cf5a6c84SAndroid Build Coastguard WorkerHans Reiser was convicted of murdering his wife Nina (denying it on the 1134*cf5a6c84SAndroid Build Coastguard Workerstand and then leading them to the body as part of his plea bargain during 1135*cf5a6c84SAndroid Build Coastguard Workersentencing)... 1136*cf5a6c84SAndroid Build Coastguard Worker</p> 1137*cf5a6c84SAndroid Build Coastguard Worker 1138*cf5a6c84SAndroid Build Coastguard Worker<p>Seriously, there's a lot of crap in there. It's hard to analyze most 1139*cf5a6c84SAndroid Build Coastguard Workerof it far enough to prove it _doesn't_ do anything.</p> 1140*cf5a6c84SAndroid Build Coastguard Worker 1141*cf5a6c84SAndroid Build Coastguard Worker<h3>Non-toybox programs</h3> 1142*cf5a6c84SAndroid Build Coastguard Worker 1143*cf5a6c84SAndroid Build Coastguard Worker<p>The following software may actually still do something intelligible 1144*cf5a6c84SAndroid Build Coastguard Worker(although the package versions tend to be years out of date), but 1145*cf5a6c84SAndroid Build Coastguard Workerit's not a direction toybox has chosen to go in.</p> 1146*cf5a6c84SAndroid Build Coastguard Worker 1147*cf5a6c84SAndroid Build Coastguard Worker<p>There are several programming languages (<b>bash, lua, jamvm, tinytcl, 1148*cf5a6c84SAndroid Build Coastguard Workerperl, python</b>) in there. Maybe someone somewhere wants a 2008 release of a 1149*cf5a6c84SAndroid Build Coastguard Workerjava virtual machine tested to work on nommu systems (jamvm), but it's out 1150*cf5a6c84SAndroid Build Coastguard Workerof scope for toybox.</p> 1151*cf5a6c84SAndroid Build Coastguard Worker 1152*cf5a6c84SAndroid Build Coastguard Worker<p>A bunch of benchmark programs: <b>cpu, dhrystone, mathtest, nbench, netperf, 1153*cf5a6c84SAndroid Build Coastguard Workernetpipe, and whetstone</b>.</p> 1154*cf5a6c84SAndroid Build Coastguard Worker 1155*cf5a6c84SAndroid Build Coastguard Worker<p>A bunch of web servers: <b>appWeb, boa, fnord (via tcpserver), goahead, httpd, 1156*cf5a6c84SAndroid Build Coastguard Workermini_httpd, and thttpd</b>.</p> 1157*cf5a6c84SAndroid Build Coastguard Worker 1158*cf5a6c84SAndroid Build Coastguard Worker<p>A bunch of shells: <b>msh</b> is a clever (I.E. obfuscated) little shell, 1159*cf5a6c84SAndroid Build Coastguard Worker<b>nwsh</b> is "new shell" (that's what it called itself in 1999 anyway), 1160*cf5a6c84SAndroid Build Coastguard Worker<b>sash</b> is another shell with a bunch of builtins (ls, ps, df, cp, date, reboot, 1161*cf5a6c84SAndroid Build Coastguard Workerand shutdown, this roadmap analyzes it <a href="#sash">elsewhere</a>), 1162*cf5a6c84SAndroid Build Coastguard Worker<b>sh</b> is a very old minix shell fork, and <b>tcsh</b> is also a shell.</p> 1163*cf5a6c84SAndroid Build Coastguard Worker 1164*cf5a6c84SAndroid Build Coastguard Worker<p>Also in this category, we have:</p> 1165*cf5a6c84SAndroid Build Coastguard Worker 1166*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b><p> 1167*cf5a6c84SAndroid Build Coastguard Workerdropbear jffs-tools jpegview kexec-tools bind ctorrent 1168*cf5a6c84SAndroid Build Coastguard Workeriperf iproute2 ip-sentinel iptables kexec 1169*cf5a6c84SAndroid Build Coastguard Workernmap oggplay openssl oprofile p7zip pppd pptp play vplay 1170*cf5a6c84SAndroid Build Coastguard Workerhdparm mp3play at clock 1171*cf5a6c84SAndroid Build Coastguard Workermtd-utils mysql logrotate brcfg bridge-utils flashw 1172*cf5a6c84SAndroid Build Coastguard Workerebtables etherwake ethtool expect gdb gdbserver hostapd 1173*cf5a6c84SAndroid Build Coastguard Workerlm_sensors load netflash netstat-nat 1174*cf5a6c84SAndroid Build Coastguard Workerradvd recover rootloader resolveip rp-pppoe 1175*cf5a6c84SAndroid Build Coastguard Workerrsyslog rsyslogd samba smbmount squashfs-new squid ssh strace tip 1176*cf5a6c84SAndroid Build Coastguard Workeruboot-envtools ulogd usbhubctrl vconfig vixie-cron watchdogd 1177*cf5a6c84SAndroid Build Coastguard Workerwireless_tools wpa_supplicant 1178*cf5a6c84SAndroid Build Coastguard Worker</p></b></blockquote> 1179*cf5a6c84SAndroid Build Coastguard Worker 1180*cf5a6c84SAndroid Build Coastguard Worker<p>An awful lot of those are borderline: play and vplay are wav file 1181*cf5a6c84SAndroid Build Coastguard Workeraudio players, there's oprofile _and_ readprofile (which just reads kernel 1182*cf5a6c84SAndroid Build Coastguard Workerprofiling data from /proc/profile), 1183*cf5a6c84SAndroid Build Coastguard Workerradvd is a "routr advertisement daemon" (ipv6 stateless autoconf), 1184*cf5a6c84SAndroid Build Coastguard Workerctorrent is a bittorent client, 1185*cf5a6c84SAndroid Build Coastguard Workerlm_sensors is hardware (heat?) monitoring, 1186*cf5a6c84SAndroid Build Coastguard Workerresolveip is dig only less so, 1187*cf5a6c84SAndroid Build Coastguard Workerrp-pppoe is ppp over ethernet, 1188*cf5a6c84SAndroid Build Coastguard Workerebtables is an ethernet version of iptables (for bridging), 1189*cf5a6c84SAndroid Build Coastguard Workertheir dropbear is from 2012, and that ssh version is from 2011 1190*cf5a6c84SAndroid Build Coastguard Worker(which means it's about nine months too _old_ to have the heartbleed bug). 1191*cf5a6c84SAndroid Build Coastguard WorkerThere's both ulogd and ulogd2 (no idea why), and pppd is version 2.4 but 1192*cf5a6c84SAndroid Build Coastguard Workerthere's a ppd-2.3 directory also. We used to be interested in ftpd/proftpd 1193*cf5a6c84SAndroid Build Coastguard Workeras a way of uploading files out of a vm, but support for that has waned 1194*cf5a6c84SAndroid Build Coastguard Workerover the years and there are lots of alternatives.</p> 1195*cf5a6c84SAndroid Build Coastguard Worker 1196*cf5a6c84SAndroid Build Coastguard Worker<p>Lots of flash stuff: 1197*cf5a6c84SAndroid Build Coastguard Workerflashw is a flash writer, load is an spi flash loader, netflash writes 1198*cf5a6c84SAndroid Build Coastguard Workerto flash via tftp, 1199*cf5a6c84SAndroid Build Coastguard Workerrecover is also a reflash daemon intended to come up when the system can't boot, 1200*cf5a6c84SAndroid Build Coastguard Workerrootloader seems to be another reflash daemon but without dhcp.</p> 1201*cf5a6c84SAndroid Build Coastguard Worker 1202*cf5a6c84SAndroid Build Coastguard Worker<h3>Already in roadmap</h3> 1203*cf5a6c84SAndroid Build Coastguard Worker 1204*cf5a6c84SAndroid Build Coastguard Worker<p>The following packages contain commands already in the toybox roadmap:</p> 1205*cf5a6c84SAndroid Build Coastguard Worker 1206*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b><p> 1207*cf5a6c84SAndroid Build Coastguard Workeragetty cal cksum cron dhcpcd dhcpcd-new dhcpd dhcp-isc dosfstools e2fsprogs 1208*cf5a6c84SAndroid Build Coastguard Workerelvis-tiny levee fdisk fileutils ftp grep hd hwclock inetd init ntp 1209*cf5a6c84SAndroid Build Coastguard Workeriputils login module-init-tools netcat shutils ntpdate lspci ping procps 1210*cf5a6c84SAndroid Build Coastguard Workerrsync shadow shutils stty sysutils telnet telnetd tftp tftpd traceroute 1211*cf5a6c84SAndroid Build Coastguard Workerunzip wget mawk net-tools 1212*cf5a6c84SAndroid Build Coastguard Worker</p></b></blockquote> 1213*cf5a6c84SAndroid Build Coastguard Worker 1214*cf5a6c84SAndroid Build Coastguard Worker<p>There are some duplicates in there, levee is a tiny vi implementation 1215*cf5a6c84SAndroid Build Coastguard Workerlike elvis-tiny, ntp and ntpdate overlap, etc.</p> 1216*cf5a6c84SAndroid Build Coastguard Worker 1217*cf5a6c84SAndroid Build Coastguard Worker<p>Verdict: We don't really need to do a whole lot special for nommu 1218*cf5a6c84SAndroid Build Coastguard Workersystems, just get the existing toybox roadmap working on nommu and 1219*cf5a6c84SAndroid Build Coastguard Workerwe're good. The uClinux project can rest in peace.</p> 1220*cf5a6c84SAndroid Build Coastguard Worker 1221*cf5a6c84SAndroid Build Coastguard Worker<hr /> 1222*cf5a6c84SAndroid Build Coastguard Worker<h2>Requests:</h2> 1223*cf5a6c84SAndroid Build Coastguard Worker 1224*cf5a6c84SAndroid Build Coastguard Worker<p>The following additional commands have been requested (and often submitted) 1225*cf5a6c84SAndroid Build Coastguard Workerby various users. I _really_ need to clean up this section.</p> 1226*cf5a6c84SAndroid Build Coastguard Worker 1227*cf5a6c84SAndroid Build Coastguard Worker<p>Also:</p> 1228*cf5a6c84SAndroid Build Coastguard Worker<blockquote><b> 1229*cf5a6c84SAndroid Build Coastguard Worker<span id=request> 1230*cf5a6c84SAndroid Build Coastguard Workerdig freeramdisk getty halt hexdump hwclock klogd modprobe ping ping6 pivot_root 1231*cf5a6c84SAndroid Build Coastguard Workerpoweroff readahead rev sfdisk sudo syslogd taskset telnet telnetd tracepath 1232*cf5a6c84SAndroid Build Coastguard Workertraceroute unzip usleep vconfig zip free login modinfo unshare netcat help w 1233*cf5a6c84SAndroid Build Coastguard Workeriwconfig iwlist rdate 1234*cf5a6c84SAndroid Build Coastguard Workerdos2unix unix2dos clear 1235*cf5a6c84SAndroid Build Coastguard Workerpmap realpath setsid timeout truncate 1236*cf5a6c84SAndroid Build Coastguard Workermkswap swapon swapoff 1237*cf5a6c84SAndroid Build Coastguard Workercount oneit fstype 1238*cf5a6c84SAndroid Build Coastguard Workeracpi blkid eject pwdx 1239*cf5a6c84SAndroid Build Coastguard Workersulogin rfkill bootchartd 1240*cf5a6c84SAndroid Build Coastguard Workerarp makedevs sysctl killall5 crond crontab deluser last mkpasswd watch 1241*cf5a6c84SAndroid Build Coastguard Workerblockdev rpm2cpio arping brctl dumpleases fsck 1242*cf5a6c84SAndroid Build Coastguard Workertcpsvd tftpd 1243*cf5a6c84SAndroid Build Coastguard Workerfactor fallocate fsfreeze inotifyd lspci nbd-client partprobe strings 1244*cf5a6c84SAndroid Build Coastguard Workerbase32 base64 mix 1245*cf5a6c84SAndroid Build Coastguard Workerreset hexedit nsenter shred 1246*cf5a6c84SAndroid Build Coastguard Workerfsync insmod ionice lsmod lsusb rmmod vmstat xxd top iotop 1247*cf5a6c84SAndroid Build Coastguard Workerlsof ionice compress dhcp dhcpd addgroup delgroup host iconv ip 1248*cf5a6c84SAndroid Build Coastguard Workeripcrm ipcs netstat openvt 1249*cf5a6c84SAndroid Build Coastguard Workerdeallocvt iorenice 1250*cf5a6c84SAndroid Build Coastguard Workerudpsvd adduser 1251*cf5a6c84SAndroid Build Coastguard Workermicrocom tunctl chrt getfattr setfattr 1252*cf5a6c84SAndroid Build Coastguard Workerkexec 1253*cf5a6c84SAndroid Build Coastguard Workerascii crc32 devmem fmt i2cdetect i2cdump i2cget i2cset i2ctransfer mcookie prlimit sntp ulimit uuidgen dhcp6 ipaddr iplink iproute iprule iptunnel cd exit toysh bash traceroute6 1254*cf5a6c84SAndroid Build Coastguard Workerblkdiscard rtcwake 1255*cf5a6c84SAndroid Build Coastguard Workerwatchdog 1256*cf5a6c84SAndroid Build Coastguard Workerpwgen readelf unicode 1257*cf5a6c84SAndroid Build Coastguard Workerrsync 1258*cf5a6c84SAndroid Build Coastguard Workerlinux32 hd strace 1259*cf5a6c84SAndroid Build Coastguard Workergpiodetect gpiofind gpioget gpioinfo gpioset httpd uclampset 1260*cf5a6c84SAndroid Build Coastguard Workernbd-server 1261*cf5a6c84SAndroid Build Coastguard Worker</span> 1262*cf5a6c84SAndroid Build Coastguard Worker</b></blockquote> 1263*cf5a6c84SAndroid Build Coastguard Worker 1264*cf5a6c84SAndroid Build Coastguard Worker<hr /> 1265*cf5a6c84SAndroid Build Coastguard Worker<a name=packages /> 1266*cf5a6c84SAndroid Build Coastguard Worker<h2>Other packages</h2> 1267*cf5a6c84SAndroid Build Coastguard Worker 1268*cf5a6c84SAndroid Build Coastguard Worker<p>System administrators have <a href=https://github.com/landley/toybox/issues/168#issuecomment-583725500>asked</a> what other Linux packages toybox commands 1269*cf5a6c84SAndroid Build Coastguard Workerreplace, so they can annotate alternatives in their package management system.</p> 1270*cf5a6c84SAndroid Build Coastguard Worker 1271*cf5a6c84SAndroid Build Coastguard Worker<p>This section uses the package definitions from Chapter 6 of 1272*cf5a6c84SAndroid Build Coastguard Worker<a href=http://www.linuxfromscratch.org/lfs/downloads/9.0/LFS-BOOK-9.0-NOCHUNKS.html>Linux From Scratch 9.0</a>). Each package lists what we currently 1273*cf5a6c84SAndroid Build Coastguard Workerreplace, pending commands [in square brackets], and what we DON'T plan to 1274*cf5a6c84SAndroid Build Coastguard Workerimplement.</p> 1275*cf5a6c84SAndroid Build Coastguard Worker 1276*cf5a6c84SAndroid Build Coastguard Worker<p>Each "see also" note means the listed package also installs the listed shared 1277*cf5a6c84SAndroid Build Coastguard Workerlibraries. (While toybox contains equivalent functionality to a lot of these 1278*cf5a6c84SAndroid Build Coastguard Workershared libraries in its lib/ directory, it does not currently provide a shared 1279*cf5a6c84SAndroid Build Coastguard Workerlibrary interface.)</p> 1280*cf5a6c84SAndroid Build Coastguard Worker 1281*cf5a6c84SAndroid Build Coastguard Worker<h3>Packages toybox plans to provide complete-ish replacements for:</h3> 1282*cf5a6c84SAndroid Build Coastguard Worker<ul> 1283*cf5a6c84SAndroid Build Coastguard Worker<li><b>file</b>: file (see also: libmagic)</li> 1284*cf5a6c84SAndroid Build Coastguard Worker<li><b>m4</b>: [m4]</li> 1285*cf5a6c84SAndroid Build Coastguard Worker<li><b>bc</b>: [bc] [dc]</li> 1286*cf5a6c84SAndroid Build Coastguard Worker<li><b>bison</b>: [yacc] (not: bison, see also: liby)</li> 1287*cf5a6c84SAndroid Build Coastguard Worker<li><b>flex</b>: [lex] (not: flex flex++, see also: libfl)</li> 1288*cf5a6c84SAndroid Build Coastguard Worker<li><b>make</b>: [make]</li> 1289*cf5a6c84SAndroid Build Coastguard Worker<li><b>sed</b>: sed</li> 1290*cf5a6c84SAndroid Build Coastguard Worker<li><b>grep</b>: grep egrep fgrep</li> 1291*cf5a6c84SAndroid Build Coastguard Worker<li><b>bash</b>: bash sh (not: bashbug)</li> 1292*cf5a6c84SAndroid Build Coastguard Worker<li><b>diffutils</b>: cmp [diff] [diff3] [sdiff]</li> 1293*cf5a6c84SAndroid Build Coastguard Worker<li><b>gawk</b>: [awk] (not: gawk gawk-5.0.1)</li> 1294*cf5a6c84SAndroid Build Coastguard Worker<li><b>findutils</b>: find xargs (not: locate updatedb)</li> 1295*cf5a6c84SAndroid Build Coastguard Worker<li><b>less</b>: less (not: lessecho lesskey)</li> 1296*cf5a6c84SAndroid Build Coastguard Worker<li><b>gzip</b>: zcat [gzip] [gunzip] [zcmp] [zdiff] [zegrep] [zfgrep] [zgrep] [zless] [zmore] 1297*cf5a6c84SAndroid Build Coastguard Worker(not: gzexe uncompress zforce znew)</li> 1298*cf5a6c84SAndroid Build Coastguard Worker<li><b>patch</b>: patch</li> 1299*cf5a6c84SAndroid Build Coastguard Worker<li><b>tar</b>: tar</li> 1300*cf5a6c84SAndroid Build Coastguard Worker<li><b>procps-ng</b>: free pgrep pidof pkill ps sysctl top uptime vmstat w watch 1301*cf5a6c84SAndroid Build Coastguard Worker[pmap] [pwdx] [slabtop] 1302*cf5a6c84SAndroid Build Coastguard Worker(not: tload, see also libprocps)</li> 1303*cf5a6c84SAndroid Build Coastguard Worker<li><b>sysklogd</b>: [klogd] [syslogd]</li> 1304*cf5a6c84SAndroid Build Coastguard Worker<li><b>sysvinit</b>: [init] halt poweroff reboot killall5 [shutdown] 1305*cf5a6c84SAndroid Build Coastguard Worker(not telinit runlevel fstab-decode bootlogd)</li> 1306*cf5a6c84SAndroid Build Coastguard Worker<li><b>man</b>: man (but not accessdb apropos catman lexgrog mandb manpath whatis, 1307*cf5a6c84SAndroid Build Coastguard Workersee also libman libmandb)</li> 1308*cf5a6c84SAndroid Build Coastguard Worker<li><b>vim</b>: vi xxd (but not ex, rview, rvim, view, vim, vimdiff, vimtutor)</li> 1309*cf5a6c84SAndroid Build Coastguard Worker<li><b>sysvinit</b>: [init] halt poweroff reboot killall5 [shutdown] 1310*cf5a6c84SAndroid Build Coastguard Worker(not telinit runlevel fstab-decode bootlogd)</li> 1311*cf5a6c84SAndroid Build Coastguard Worker<li><b>kmod</b>: insmod lsmod rmmod modinfo [modprobe] 1312*cf5a6c84SAndroid Build Coastguard Worker(not: depmod kmod)</li> 1313*cf5a6c84SAndroid Build Coastguard Worker<li><b>attr</b>: [getfattr] setfattr (not: attr, see also: libattr)</li> 1314*cf5a6c84SAndroid Build Coastguard Worker<li><b>shadow</b>: [chfn] [chpasswd] [chsh] [groupadd] [groupdel] [groupmod] 1315*cf5a6c84SAndroid Build Coastguard Worker[newusers] passwd [su] [useradd] [userdel] [usermod] 1316*cf5a6c84SAndroid Build Coastguard Worker[lastlog] [login] [newgidmap] [newuidmap] 1317*cf5a6c84SAndroid Build Coastguard Worker(not: chage expiry faillog groupmems grpck logoutd newgrp nologin pwck sg 1318*cf5a6c84SAndroid Build Coastguard Workervigr vipw, grpconv grpunconv pwconv pwunconv, chgpasswd gpasswd)</li> 1319*cf5a6c84SAndroid Build Coastguard Worker<li><b>psmisc</b>: killall [fuser] [pstree] [peekfd] [prtstat] 1320*cf5a6c84SAndroid Build Coastguard Worker(not: pslog pstree.x11)</li> 1321*cf5a6c84SAndroid Build Coastguard Worker<li><b>inetutils</b>: dnsdomainname [ftp] hostname ifconfig ping ping6 [telnet] [tftp] [traceroute] (not: talk)</li> 1322*cf5a6c84SAndroid Build Coastguard Worker<li><b>coreutils</b>: [ base32 base64 basename cat chgrp chmod chown chroot cksum comm cp cut date 1323*cf5a6c84SAndroid Build Coastguard Workerdd df dirname du echo env expand factor false fmt fold groups head hostid id install 1324*cf5a6c84SAndroid Build Coastguard Workerlink ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup nproc od 1325*cf5a6c84SAndroid Build Coastguard Workerpaste printenv printf pwd readlink realpath rm rmdir seq sha1sum shred 1326*cf5a6c84SAndroid Build Coastguard Workersleep sort split stat sync tac tail tee test timeout touch true truncate 1327*cf5a6c84SAndroid Build Coastguard Workertty uname uniq unlink wc who whoami yes 1328*cf5a6c84SAndroid Build Coastguard Worker[expr] [fold] [join] [numfmt] [runcon] [sha224sum] [sha256sum] [sha384sum] 1329*cf5a6c84SAndroid Build Coastguard Worker[sha512sum] [stty] [b2sum] [tr] [unexpand] 1330*cf5a6c84SAndroid Build Coastguard Worker(not: basenc chcon csplit dir dircolors pathchk 1331*cf5a6c84SAndroid Build Coastguard Workerpinky pr ptx shuf stdbuf sum tsort users vdir, see also libstdbuf)</li> 1332*cf5a6c84SAndroid Build Coastguard Worker<li><b>util-linux</b>: blkid blockdev cal chrt dmesg eject fallocate flock hwclock 1333*cf5a6c84SAndroid Build Coastguard Workerionice kill logger losetup mcookie mkswap more mount mountpoint nsenter 1334*cf5a6c84SAndroid Build Coastguard Workerpivot_root prlimit rename renice rev setsid swapoff swapon switch_root taskset 1335*cf5a6c84SAndroid Build Coastguard Workerumount unshare uuidgen 1336*cf5a6c84SAndroid Build Coastguard Worker[addpart] [fdisk] [findfs] [findmnt] [fsck] [fsfreeze] [fstrim] [getopt] 1337*cf5a6c84SAndroid Build Coastguard Worker[hexdump] [linux32] [linux64] [lsblk] [lscpu] [lsns] [setarch] 1338*cf5a6c84SAndroid Build Coastguard Worker(not: agetty blkdiscard blkzone cfdisk chcpu chmem choom col 1339*cf5a6c84SAndroid Build Coastguard Workercolcrt colrm column ctrlaltdel delpart fdformat fincore fsck.cramfs 1340*cf5a6c84SAndroid Build Coastguard Workerfsck.minix ipcmk ipcrm ipcs isosize last lastb ldattach look lsipc 1341*cf5a6c84SAndroid Build Coastguard Workerlslocks lslogins lsmem mesg mkfs mkfs.bfs mkfs.cramfs mkfs.minix namei partx 1342*cf5a6c84SAndroid Build Coastguard Workerraw readprofile resizepart rfkill rtcwake script scriptreplay 1343*cf5a6c84SAndroid Build Coastguard Workersetterm sfdisk sulogin swaplabel ul 1344*cf5a6c84SAndroid Build Coastguard Workeruname26 utmpdump uuidd uuidparse wall wdctl whereis wipefs 1345*cf5a6c84SAndroid Build Coastguard Workeri386 x86_64 zramctl)</li> 1346*cf5a6c84SAndroid Build Coastguard Worker</ul> 1347*cf5a6c84SAndroid Build Coastguard Worker 1348*cf5a6c84SAndroid Build Coastguard Worker<p>Commentary: toybox init doesn't do runlevels, man and vim are just the 1349*cf5a6c84SAndroid Build Coastguard Workerrelevant commands without the piles of strange overgrowth, and if you want 1350*cf5a6c84SAndroid Build Coastguard Workerto call a toybox binary by another name you can create a symlink to a 1351*cf5a6c84SAndroid Build Coastguard Workersymlink. If somebody really wants to argue for "gzexe" or similar, be 1352*cf5a6c84SAndroid Build Coastguard Workermy guest, but there's a lot of obsolete crap in shadow, coreutils, 1353*cf5a6c84SAndroid Build Coastguard Workerutil-linux...</p> 1354*cf5a6c84SAndroid Build Coastguard Worker 1355*cf5a6c84SAndroid Build Coastguard Worker<p>No idea why LFS is installing inetutils instead of net-tools 1356*cf5a6c84SAndroid Build Coastguard Worker(which contains arp route ifconfig mii-tool nameif netstat and rarp that 1357*cf5a6c84SAndroid Build Coastguard Workertoybox does or might implement, and plipconfig slattach that it probably won't.)</p> 1358*cf5a6c84SAndroid Build Coastguard Worker 1359*cf5a6c84SAndroid Build Coastguard Worker<h3>Packages toybox plans to provide partial replacements for:</h3> 1360*cf5a6c84SAndroid Build Coastguard Worker 1361*cf5a6c84SAndroid Build Coastguard Worker<p>Toybox provides replacements for some binaries from these packages, 1362*cf5a6c84SAndroid Build Coastguard Workerbut there are other useful binaries which this package provides that toybox 1363*cf5a6c84SAndroid Build Coastguard Workercurrently considers out of scope for the project:</p> 1364*cf5a6c84SAndroid Build Coastguard Worker 1365*cf5a6c84SAndroid Build Coastguard Worker<ul> 1366*cf5a6c84SAndroid Build Coastguard Worker<li><b>binutils</b>: strings [ar] [nm] [readelf] [size] [objcopy] [strip] 1367*cf5a6c84SAndroid Build Coastguard Worker(not c++filt, dwp, elfedit, gprof. The following commands belong 1368*cf5a6c84SAndroid Build Coastguard Workerin <a href=/code/qcc>qcc</a>: addr2line as ld objdump ranlib)</li> 1369*cf5a6c84SAndroid Build Coastguard Worker<li><b>bzip2</b>: bunzip2 bzcat [bzcmp] [bzdiff] [bzegrep] [bzfgrep] [bzgrep] [bzless] 1370*cf5a6c84SAndroid Build Coastguard Worker[bzmore] (not: bzip2, bzip2recover, see also libbz2)</li> 1371*cf5a6c84SAndroid Build Coastguard Worker<li><b>xz</b>: [xzcat] [lzcat] [lzcmp] [lzdiff] [lzegrep] [lzfgrep] [lzgrep] 1372*cf5a6c84SAndroid Build Coastguard Worker[lzless] [lzmadec, lzmainfo] [lzmore] [unlzma] [unxz] [xzcat] 1373*cf5a6c84SAndroid Build Coastguard Worker[xzcmp] [xzdec] [xzdiff] [xzegrep] [xzfgrep] [xzgrep] [xzless] [xzmore] 1374*cf5a6c84SAndroid Build Coastguard Worker(not: compression side, see also: liblzma)</li> 1375*cf5a6c84SAndroid Build Coastguard Worker<li><b>ncurses</b>: clear reset (not: everything else, see also: libcurses)</li> 1376*cf5a6c84SAndroid Build Coastguard Worker<li><b>e2fsprogs</b>: chattr lsattr [e2fsck] [mkfs.ext2] [mkfs.ext3] 1377*cf5a6c84SAndroid Build Coastguard Worker[fsck.ext2] [fsck.ext3] [e2label] [resize2fs] [tune2fs] 1378*cf5a6c84SAndroid Build Coastguard Worker(not badblocks compile_et debugfs dumpe2fse2freefrag e2image 1379*cf5a6c84SAndroid Build Coastguard Workere2mmpstatus e2scrub e2scrub_all e2undo e4crypt e4defrag filefrag 1380*cf5a6c84SAndroid Build Coastguard Workerfsck.ext4 logsave mk_cmds mkfs.ext4 mklost+found)</li> 1381*cf5a6c84SAndroid Build Coastguard Worker</ul> 1382*cf5a6c84SAndroid Build Coastguard Worker 1383*cf5a6c84SAndroid Build Coastguard Worker<p>Toybox provides several decompressors but compresses to a single format 1384*cf5a6c84SAndroid Build Coastguard Worker(deflate, ala gzip/zlib). Our e2fsprogs doesn't currently plan to support 1385*cf5a6c84SAndroid Build Coastguard Workerext4 or defrag. The "qcc" reference is because someday an external project to glue 1386*cf5a6c84SAndroid Build Coastguard WorkerQEMU's <a href=https://git.qemu.org/?p=qemu.git;a=blob;f=tcg/README;h=bfa2e4ed246c;hb=HEAD>Tiny Code Generator</a> 1387*cf5a6c84SAndroid Build Coastguard Workerto Fabrice Bellard's old <a href=http://landley.net/hg/tinycc>Tiny C Compiler</a> 1388*cf5a6c84SAndroid Build Coastguard Workermaking a multicall binary that does cc/ld/as for all the targets QEMU 1389*cf5a6c84SAndroid Build Coastguard Workersupports (then use the 1390*cf5a6c84SAndroid Build Coastguard Worker<a href=https://github.com/JuliaComputing/llvm-cbe>LLVM C Backend</a> 1391*cf5a6c84SAndroid Build Coastguard Workerto compile LLVM itself to C for use as a modern replacement for 1392*cf5a6c84SAndroid Build Coastguard Worker<a href=https://en.wikipedia.org/wiki/Cfront>cfront</a> to bootstrap 1393*cf5a6c84SAndroid Build Coastguard WorkerC++ code) is under consideration 1394*cf5a6c84SAndroid Build Coastguard Workeras a successor project to toybox. Until then things like objdump -d 1395*cf5a6c84SAndroid Build Coastguard Worker(requiring target-specific disassembly for an unbounded number of architectures) 1396*cf5a6c84SAndroid Build Coastguard Workerare out of scope for toybox. (This means drawing the line somewhere between 1397*cf5a6c84SAndroid Build Coastguard Workerarchitecture-specific support in file and strace, and including a full 1398*cf5a6c84SAndroid Build Coastguard Workerassembler for each architecture.)</p> 1399*cf5a6c84SAndroid Build Coastguard Worker</span> 1400*cf5a6c84SAndroid Build Coastguard Worker 1401*cf5a6c84SAndroid Build Coastguard Worker<h3>Packages from LFS ch6 toybox does NOT plan to replace:</h3> 1402*cf5a6c84SAndroid Build Coastguard Worker 1403*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p><b> 1404*cf5a6c84SAndroid Build Coastguard Workerlinux-api-headers man-pages glibc zlib readline gmp mpfr mpc gcc pkg-config 1405*cf5a6c84SAndroid Build Coastguard Workerncurses acl libcap psmisc iana-etc libtool gdbm gperf expat perl XML::Parser 1406*cf5a6c84SAndroid Build Coastguard Workerintltool autoconf automake gettext libelf libffi openssl python ninja meson 1407*cf5a6c84SAndroid Build Coastguard Workercheck groff grub libpipeline texinfo 1408*cf5a6c84SAndroid Build Coastguard Worker</b></p></blockquote> 1409*cf5a6c84SAndroid Build Coastguard Worker 1410*cf5a6c84SAndroid Build Coastguard Worker<p>That said, we do implement our own zlib and readline replacements, and 1411*cf5a6c84SAndroid Build Coastguard Workerpresumably _could_ export them as library bindings. Plus we provide 1412*cf5a6c84SAndroid Build Coastguard Workerour own version of a bunch of the section 1 man pages (as command help). 1413*cf5a6c84SAndroid Build Coastguard WorkerPossibly libcap and acl are interesting?</p> 1414*cf5a6c84SAndroid Build Coastguard Worker 1415*cf5a6c84SAndroid Build Coastguard Worker<h3>Misc</h3> 1416*cf5a6c84SAndroid Build Coastguard Worker 1417*cf5a6c84SAndroid Build Coastguard Worker<p>The kbd package has over a dozen commands, we only implement chvt. The 1418*cf5a6c84SAndroid Build Coastguard Workeriproute2 package implements over a dozen commands, there's an "ip" in 1419*cf5a6c84SAndroid Build Coastguard Workerpending but I'm not a fan (ifconfig and route and such should be extended 1420*cf5a6c84SAndroid Build Coastguard Workerto work properly). We don't implement eudev, but toybox's maintainer 1421*cf5a6c84SAndroid Build Coastguard Workercreated busybox mdev way back when (which replaces it) and plans to do a 1422*cf5a6c84SAndroid Build Coastguard Workernew one for toybox as soon as we work out what subset is still needed now that 1423*cf5a6c84SAndroid Build Coastguard Workerdevtmpfs is available.</p> 1424*cf5a6c84SAndroid Build Coastguard Worker 1425*cf5a6c84SAndroid Build Coastguard Worker<hr /><a name=todo /><h2>TODO list</h2> 1426*cf5a6c84SAndroid Build Coastguard Worker 1427*cf5a6c84SAndroid Build Coastguard Worker<ul> 1428*cf5a6c84SAndroid Build Coastguard Worker<li><p>Fill out "development" command list (finish toysh, implement awk, etc.)</p></li> 1429*cf5a6c84SAndroid Build Coastguard Worker 1430*cf5a6c84SAndroid Build Coastguard Worker<p><li>Handle "pending" directory. 1431*cf5a6c84SAndroid Build Coastguard Worker<ul> 1432*cf5a6c84SAndroid Build Coastguard Worker<li>Cleanup and promote the "pending" commands used to run mkroot.</li> 1433*cf5a6c84SAndroid Build Coastguard Worker<ul><li>Enabled by $PENDING in mkroot.sh (sh route)</li></ul> 1434*cf5a6c84SAndroid Build Coastguard Worker 1435*cf5a6c84SAndroid Build Coastguard Worker<li>Cleanup and promote the "pending" commands used to build mkroot.</li> 1436*cf5a6c84SAndroid Build Coastguard Worker<ul><li>In scripts/install.sh the $PENDING list symlinked from the host $PATH 1437*cf5a6c84SAndroid Build Coastguard Workerinto "make airlock" directory (expr git tr bash sh gzip awk bison flex make).</li></ul> 1438*cf5a6c84SAndroid Build Coastguard Worker<li>Cleanup and promote all $PENDING commands used by android 1439*cf5a6c84SAndroid Build Coastguard Worker<ul><li><b>grep pending Android.bp</b> 1440*cf5a6c84SAndroid Build Coastguard Workerin <a href=https://android.googlesource.com/platform/external/toybox>their repo</a> 1441*cf5a6c84SAndroid Build Coastguard Worker(diff expr tr brctl getfattr lsof modprobe more stty traceroute vi)</li></ul> 1442*cf5a6c84SAndroid Build Coastguard Worker</li> 1443*cf5a6c84SAndroid Build Coastguard Worker 1444*cf5a6c84SAndroid Build Coastguard Worker<li>Cleanup/promote/delete remaining "pending" commands</li> 1445*cf5a6c84SAndroid Build Coastguard Worker<ul><li>Once empty, remove toys/pending and maybe collape together other 1446*cf5a6c84SAndroid Build Coastguard Workerdirectories into just toys/*.c (with "default n" meaning examples, and 1447*cf5a6c84SAndroid Build Coastguard Workera "posix_defconfig" target alongside macos/bsd/android).</li></ul> 1448*cf5a6c84SAndroid Build Coastguard Worker 1449*cf5a6c84SAndroid Build Coastguard Worker</ul></li></p> 1450*cf5a6c84SAndroid Build Coastguard Worker 1451*cf5a6c84SAndroid Build Coastguard Worker<li><p>Replace kconfig/ with a new implementation (menu/def/yes/no/old).</p></li> 1452*cf5a6c84SAndroid Build Coastguard Worker 1453*cf5a6c84SAndroid Build Coastguard Worker<p><li>Automate Linux From Scratch build. 1454*cf5a6c84SAndroid Build Coastguard Worker<ul> 1455*cf5a6c84SAndroid Build Coastguard Worker 1456*cf5a6c84SAndroid Build Coastguard Worker<li>Automate the <a href=https://linuxfromscratch.org/lfs/downloads/stable/LFS-BOOK-12.0-NOCHUNKS.html>existing build</a> 1457*cf5a6c84SAndroid Build Coastguard Worker<ul> 1458*cf5a6c84SAndroid Build Coastguard Worker<li>create chroot directory from host (chapters 4-6)</li> 1459*cf5a6c84SAndroid Build Coastguard Worker<li>setup/launch chroot directory (start of chapter 7)</li> 1460*cf5a6c84SAndroid Build Coastguard Worker<li>build in chroot directory (chapters 7-10)</li> 1461*cf5a6c84SAndroid Build Coastguard Worker</ul> 1462*cf5a6c84SAndroid Build Coastguard Worker</li> 1463*cf5a6c84SAndroid Build Coastguard Worker 1464*cf5a6c84SAndroid Build Coastguard Worker<li>Add record-commands support (both inside and outside chroot)</li> 1465*cf5a6c84SAndroid Build Coastguard Worker<li>Build host->chroot part with PATH=$PWD/airlock (moving one command over at a time) 1466*cf5a6c84SAndroid Build Coastguard Worker<ul><li>Set up native compiler, enumerate/build/install "temp stuff" toybox 1467*cf5a6c84SAndroid Build Coastguard Workerdoesn't provide yet (make, busybox commands, etc).</li></ul> 1468*cf5a6c84SAndroid Build Coastguard Worker</li> 1469*cf5a6c84SAndroid Build Coastguard Worker 1470*cf5a6c84SAndroid Build Coastguard Worker<li>Run host->chroot build under mkroot, with airlock built+packaged for 1471*cf5a6c84SAndroid Build Coastguard Workertarget (toybox, native compiler, temp stuff from busybox or "make")</li> 1472*cf5a6c84SAndroid Build Coastguard Worker<li>Run chroot build to completion in chroot under mkroot (kernel etc smoketest)</li> 1473*cf5a6c84SAndroid Build Coastguard Worker<li>Run chroot build outside chroot (keeping toybox at start of $PATH) 1474*cf5a6c84SAndroid Build Coastguard Workerto prove toybox commands sufficient to build ALL packages</li> 1475*cf5a6c84SAndroid Build Coastguard Worker<li>Package LFS build (mkroot/packages/lfs) 1476*cf5a6c84SAndroid Build Coastguard Worker 1477*cf5a6c84SAndroid Build Coastguard Worker<ul> 1478*cf5a6c84SAndroid Build Coastguard Worker<li>host/chroot/target build scripts</li> 1479*cf5a6c84SAndroid Build Coastguard Worker<li><a href=http://ftp.osuosl.org/pub/lfs/lfs-packages/>download</a> and 1480*cf5a6c84SAndroid Build Coastguard Workersetup packages.</li> 1481*cf5a6c84SAndroid Build Coastguard Worker<li>Note: I already did this <a href=https://github.com/landley/control-images/tree/master/images/lfs-bootstrap/mnt>long ago</a> for LFS 6.7.</li> 1482*cf5a6c84SAndroid Build Coastguard Worker</li> 1483*cf5a6c84SAndroid Build Coastguard Worker</ul> 1484*cf5a6c84SAndroid Build Coastguard Worker 1485*cf5a6c84SAndroid Build Coastguard Worker</ul></p> 1486*cf5a6c84SAndroid Build Coastguard Worker 1487*cf5a6c84SAndroid Build Coastguard Worker<li><p>1.0 release</p></li> 1488*cf5a6c84SAndroid Build Coastguard Worker 1489*cf5a6c84SAndroid Build Coastguard Worker<li><p>Tackle AOSP build.</p></li> 1490*cf5a6c84SAndroid Build Coastguard Worker</ul> 1491*cf5a6c84SAndroid Build Coastguard Worker 1492*cf5a6c84SAndroid Build Coastguard Worker<!-- #include "footer.html" --> 1493*cf5a6c84SAndroid Build Coastguard Worker 1494