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