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