OSDN Git Service

Merge "Note Debian abandoning LSB and our own decision not to worry about LSB 5.0...
[android-x86/external-toybox.git] / www / roadmap.html
1 <html><head><title>toybox roadmap</title>
2 <!--#include file="header.html" -->
3 <title>Toybox Roadmap</title>
4
5 <h2>Goals and use cases</h2>
6
7 <p>We have several potential use cases for a new set of command line
8 utilities, and are using those to determine which commands to implement
9 for Toybox's 1.0 release.</p>
10
11 <p>The most interesting standards are POSIX-2008 (also known as the Single
12 Unix Specification version 4) and the Linux Standard Base (version 4.1).
13 The main test harness including toybox in Aboriginal Linux and if that can
14 build itself using the result to build Linux From Scratch (version 6.8).
15 We also aim to replace Android's Toolbox.</p>
16
17 <p>At a secondary level we'd like to meet other use cases. We've analyzed
18 the commands provided by similar projects (klibc, sash, sbase, s6, embutils,
19 nash, and beastiebox), along with various vendor configurations of busybox,
20 and some end user requests.</p>
21
22 <p>Finally, we'd like to provide a good replacement for the Bash shell,
23 which was the first program Linux ever ran and remains the standard shell
24 of Linux no matter what Ubuntu says. This doesn't mean including the full
25 set of Bash 4.x functionality, but does involve {various,features} beyond
26 posix.</p>
27
28 <p>See the <a href=status.html>status page</a> for the combined list
29 and progress towards implementing it.</p>
30
31 <ul>
32 <li><a href=#susv4>POSIX-2008/SUSv4</a></li>
33 <li><a href=#sigh>Linux "Standard" Base</a></li>
34 <li><a href=#dev_env>Development Environment</a></li>
35 <li><a href=#android>Android Toolbox</a></li>
36 <li><a href=#tizen>Tizen Core</a></li>
37 <li>Miscelaneous: <a href=#klibc>klibc</a>, <a href=#glibc>glibc</a>,
38 <a href=#sash>sash</a>, <a href=#sbase>sbase</a>, <a href=#s6>s6</a>,
39 <a href=#uclinux>uclinux</a>...</li>
40 </ul>
41
42 <hr />
43 <a name="standards">
44 <h2>Use case: standards compliance.</h2>
45
46 <h3><a name=susv4 /><a href="#susv4">POSIX-2008/SUSv4</a></h3>
47 <p>The best standards are the kind that describe reality, rather than
48 attempting to impose a new one.  (I.E. a good standard should document, not
49 legislate.)</p>
50
51 <p>The kind of standards which describe existing reality tend to be approved by
52 more than one standards body, such ANSI and ISO both approving C.  That's why
53 the IEEE POSIX committee's 2008 standard, the Single Unix Specification version
54 4, and the Open Group Base Specification edition 7 are all the same standard
55 from three sources.</p>
56
57 <p>The <a href="http://pubs.opengroup.org/onlinepubs/9699919799/idx/utilities.html">"utilities"
58 section</a>
59 of these standards is devoted to the unix command line, and are the best such
60 standard for our purposes.  (My earlier work on BusyBox was implemented with
61 regard to SUSv3, an earlier version of this standard.)</p>
62
63 <h3>Problems with the standard</h3>
64
65 <p>Unfortunately, these standards describe a subset of reality, lacking any
66 mention of commands such as init, login, or mount required to actually boot a
67 system. It provides ipcrm and ipcs, but not ipcmk, so you can use System V IPC
68 resources but not create them.</p>
69
70 <p>These standards also contain a large number of commands that are
71 inappropriate for toybox to implement in its 1.0 release.  (Perhaps some of
72 these could be reintroduced in later releases, but not now.)</p>
73
74 <p>Starting with the full "utilities" list, we first remove generally obsolete
75 commands (compess ed ex pr uncompress uccp uustat uux), commands for the
76 pre-CVS "SCCS" source control system (admin delta get prs rmdel sact sccs unget
77 val what), fortran support (asa fort77), and batch processing support (batch
78 qalter qdel qhold qmove qmsg qrerun qrls qselect qsig qstat qsub).</p>
79
80 <p>Some commands are for a compiler toolchain (ar c99 cflow ctags cxref gencat
81 iconv lex m4 make nm strings strip tsort yacc), which is outside of toybox's
82 mandate and should be supplied externally.  (Again, some of these may be
83 revisited later, but not for toybox 1.0.)</p>
84
85 <p>Some commands are part of a command shell, and cannot be implemented as
86 separate executables (alias bg cd command fc fg getopts hash jobs kill read
87 type ulimit umask unalias wait).  These may be revisited as part of a built-in
88 toybox shell, but are not exported into $PATH via symlinks.  (If you fork a
89 child process and have it "cd" then exit, you've accomplished nothing.)</p>
90
91 <p>A few other commands are judgement calls, providing command-line
92 internationalization support (iconv locale localedef), System V inter-process
93 communication (ipcrm ipcs), and cross-tty communication from the minicomputer
94 days (talk mesg write).  The "pax" utility was supplanted by tar, "mailx" is
95 a command line email client, and "lp" submits files for printing to... what
96 exactly?  (cups?)  The standard defines crontab but not crond.</p>
97
98 <p>Removing all of that leaves the following commands, which toybox should
99 implement:</p>
100
101 <blockquote><b>
102 <span id=posix>
103 at awk basename bc cal cat chgrp chmod chown cksum cmp comm cp
104 csplit cut date dd df diff dirname du echo env expand expr false file find
105 fold fuser getconf grep head id join kill link ln logger logname ls man
106 mkdir mkfifo more mv newgrp nice nl nohup od paste patch pathchk printf ps
107 pwd renice rm rmdir sed sh sleep sort split stty tabs tail tee test time
108 touch tput tr true tty uname unexpand uniq unlink uudecode uuencode vi wc
109 who xargs zcat
110 </span>
111 </b></blockquote>
112
113 <h3><a name=sigh /><a href="#sigh">Linux Standard Base</a></h3>
114
115 <p>One attempt to supplement POSIX towards an actual usable system was the
116 Linux Standard Base. Unfortunately, the quality of this "standard" is
117 fairly low.</p>
118
119 <p>POSIX allowed its standards process to be compromised
120 by leaving things out, thus allowing IBM mainframes and Windows NT to drive
121 a truck through the holes and declare themselves compilant. But it means what
122 they DID standardize tends to be respected (if sometimes obsolete).</p>
123
124 <p>The Linux Standard Base's failure mode is different, they respond to
125 pressure by including special-case crap, such as allowing Red Hat to shoehorn
126 RPM into the standard even though all sorts of distros (Debian, Slackware, Arch,
127 Gentoo) don't use it and probably never will. This means anything in the LSB is
128 at best a suggestion: arbitrary portions of this standard are widely
129 ignored.</p>
130
131 <p>The community perception seems to be that the Linux Standard Base is
132 the best standard money can buy, I.E. the Linux Foundation is supported by
133 financial donations form large companies and the LSB represents the interests
134 of those donors more than technical merit. Debian officially
135 <a href=http://lwn.net/Articles/658809>washed its hands of LSB</a> when 5.0
136 came out in 2015, and no longer even pretends to support it (which may affect
137 Debian derivatives like Ubuntu and Knoppix). Toybox hasn't moved to 5.0 for
138 similar reasons.</p>
139
140 <p>That said, Posix by itself isn't enough, and this is the next most
141 comprehensive standards effort for Linux so far.</p>
142
143 <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
144 utilities</a>:</p>
145
146 <blockquote><b>
147 ar at awk batch bc chfn chsh col cpio crontab df dmesg du echo egrep 
148 fgrep file fuser gettext grep groupadd groupdel groupmod groups 
149 gunzip gzip hostname install install_initd ipcrm ipcs killall lpr ls 
150 lsb_release m4 md5sum mknod mktemp more mount msgfmt newgrp od passwd 
151 patch pidof remove_initd renice sed sendmail seq sh shutdown su sync 
152 tar umount useradd userdel usermod xargs zcat
153 </b></blockquote>
154
155 <p>Where posix specifies one of those commands, LSB's deltas tend to be
156 accomodations for broken tool versions which aren't up to date with the
157 standard 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>
158 for examples.)</p>
159
160 <p>Since we've already committed to using our own judgement to skip bits of
161 POSIX, and LSB's "judgement" in this regard is purely bug workarounds to declare
162 various legacy tool implementations "compliant", this means we're mostly
163 interested in the set of tools that aren't specified in posix at all.</p>
164
165 <p>Of these, gettext and msgfmt are internationalization, install_initd and
166 remove_initd aren't present on ubuntu 10.04, lpr is out of scope, and
167 lsb_release is a distro issue (it's a nice command, but the output of
168 lsb_release -a is the name and version number of the linux distro you're
169 running, which toybox doesn't know).</p>
170
171 <p>This leaves:</p>
172
173 <blockquote><b>
174 <span id=lsb>
175 chfn chsh dmesg egrep fgrep groupadd groupdel groupmod groups
176 gunzip gzip hostname install killall md5sum
177 mknod mktemp mount passwd pidof sendmail seq shutdown
178 su sync tar umount useradd userdel usermod zcat
179 </span>
180 </b></blockquote>
181
182 <hr />
183 <a name="dev_env">
184 <h2><a href="#dev_env">Use case: provide a self-hosting development environment</a></h2>
185
186 <p>The following commands are enough to build the Aboriginal Linux development
187 environment, boot it to a shell prompt, and build Linux From Scratch 6.8 under
188 it. (Aboriginal Linux currently uses BusyBox for this, thus provides a
189 drop-in test environment for toybox. We install both implementations side
190 by side, redirecting the symlinks a command at a time until the older
191 package is no longer used, and can be removed.)</p>
192
193 <p>This use case includes running init scripts and other shell scripts, running
194 configure, make, and install in each package, and providing basic command line
195 facilities such as a text editor. (It does not include a compiler toolchain or
196 C library, those are outside the scope of this project.)</p>
197
198 <blockquote><b>
199 <span id=development>
200 bzcat cat cp dirname echo env patch rmdir sha1sum sleep sort sync
201 true uname wc which yes zcat
202 awk basename chmod chown cmp cut date dd diff
203 egrep expr find grep gzip head hostname id install ln ls
204 mkdir mktemp mv od readlink rm sed sh tail tar touch tr uniq
205 wget whoami xargs chgrp comm gunzip less logname split
206 tee test time bunzip2 chgrp chroot comm cpio dmesg
207 dnsdomainname ftpd ftpget ftpput gunzip ifconfig init less
208 logname losetup mdev mount mountpoint nc pgrep pkill 
209 pwd route split stat switch_root tac umount vi
210 </span>
211 </b></blockquote>
212
213 <p>Note: Aboriginal Linux installs bash 2.05b as #!/bin/sh and its scripts
214 require bash extensions not present in shells such as busybox ash.
215 This means that toysh needs to supply several bash extensions _and_ work
216 when called under the name "bash".</p>
217
218 <p>The <a href=http://landley.net/aboriginal>Aboriginal Linux</a>
219 self-bootstrapping build still uses the following busybox commands,
220 not yet supplied by toybox:</p>
221
222 <blockquote><p>
223 awk dd diff expr fdisk ftpd ftpget ftpput gunzip
224 gzip less pgrep ping pkill ps route sh sha512sum tar test tr unxz vi
225 wget xzcat zcat
226 </p></blockquote>
227
228 <p>Many of those are in "pending". Most of the archive commands are needed
229 because busybox tar doesn't call external versions. The remaining "difficult"
230 commands are vi, awk, and sh.</p>
231
232 <hr />
233 <h2><a name=android /><a href="#android">Use case: Replacing Android Toolbox</a></h2>
234
235 <p>Android has a policy against GPL in userspace, so even though BusyBox
236 predates Android by many years, they couldn't use it. Instead they grabbed
237 an old version of ash and implemented their own command line utility set
238 called "toolbox". ash was later replaced by
239 <a href="https://www.mirbsd.org/mksh.htm">mksh</a>; toolbox is being
240 replaced by toybox.</p>
241
242 <p>Toolbox doesn't have its own repository, instead it's part of Android's
243 <a href=https://android.googlesource.com/platform/system/core>system/core
244 git repository</a>.</p>
245
246 <h3>Toolbox commands:</h3>
247
248 <p>According to <a href=https://android.googlesource.com/platform/system/core/+/master/toolbox/Android.mk>
249 system/core/toolbox/Android.mk</a> the toolbox directory builds the
250 following commands:</p>
251
252 <blockquote><b>
253 dd du df getevent iftop ioctl log ls
254 lsof nandread newfs_msdos ps prlimit
255 sendevent start stop top uptime
256 </b></blockquote>
257
258 <h3>Other Android core commands</h3>
259
260 <p>Other than the toolbox directory, the currently interesting
261 subdirectories in the core repository are init,
262 logcat, logwrapper, reboot, and run-as.</p>
263
264 <ul>
265 <li><b>init</b> - Android's PID 1</li>
266 <li><b>logcat</b> - read android log format</li>
267 <li><b>logwrapper</b> - redirect stdio to android log</li>
268 <li><b>reboot</b> - Android's reboot(1)</li>
269 <li><b>run-as</b> - subset of sudo</li>
270 </ul>
271
272 <p>Almost all of these reinvent an existing wheel with less functionality and a
273 different user interface. We may want to provide that interface, but
274 implementing the full commands (fdisk, init, and sudo) come first.</p>
275
276 <h3>Analysis</h3>
277
278 <p>For reference, combining everything listed above, we get:</p>
279
280 <blockquote><b>
281 dd du df getevent iftop init ioctl
282 log logcat logwrapper ls lsof nandread
283 newfs_msdos ps prlimit reboot run-as
284 sendevent start stop top uptime
285 </b></blockquote>
286
287 <p>We may eventually implement all of that, but for toybox 1.0 we need to
288 focus a bit. For our first pass, let's grab just logcat and logwrapper
289 from the "core" commands (since the rest have some full/standard version
290 providing that functionality, which we can implement a shim interface
291 for later).</p>
292
293 <p>This means toybox should implement (or finish implementing):</p>
294 <blockquote><b>
295 <span id=toolbox>
296 dd du df getevent iftop ioctl log logcat logwrapper ls lsof
297 nandread newfs_msdos ps prlimit sendevent
298 start stop top uptime
299 </span>
300 </b></blockquote>
301
302 <hr />
303 <h2><a name=tizen /><a href="#tizen">Use case: Tizen Core</a></h2>
304
305 <p>The Tizen project has expressed a desire to eliminate GPLv3 software
306 from its core system, and is installing toybox as
307 <a href=https://wiki.tizen.org/wiki/Toybox>part of this process</a>.</p>
308
309 <p>They have a fairly long list of new commands they'd like to see in toybox:</p>
310
311 <blockquote><b>
312 <span id=tizen>
313 arch base64 users dir vdir unexpand shred join csplit
314 hostid nproc runcon sha224 sha256 sha384 sha512 sha3 mkfs.vfat fsck.vfat 
315 dosfslabel uname stdbuf pinky diff3 sdiff zcmp zdiff zegrep zfgrep zless zmore
316 </span>
317 </b></blockquote>
318
319 <p>In addition, they'd like to use several commands currently in pending:</p>
320
321 <blockquote><b>
322 <span id=tizen>
323 tar diff printf wget rsync fdisk vi less tr test stty fold expr dd
324 </span>
325 </b></blockquote>
326
327 <p>Also, tizen uses a different Linux Security Module called SMACK, so
328 many of the SELinux options ala ls -Z need smack alternatives in an
329 if/else setup.</p>
330
331 <hr /><a name=klibc />
332 <h2>klibc:</h2>
333
334 <p>Long ago some kernel developers came up with a project called
335 <a href=http://en.wikipedia.org/wiki/Klibc>klibc</a>.
336 After a decade of development it still has no web page or HOWTO,
337 and nobody's quite sure if the license is BSD or GPL. It inexplicably
338 <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
339 replacement.</p>
340
341 <p>In addition to a C library even less capable than bionic (obsoleted by
342 musl), klibc builds a random assortment of executables to run init scripts
343 with. There's no multiplexer command, these are individual executables:</p>
344
345 <blockquote><p>
346 cat chroot cpio dd dmesg false fixdep fstype gunzip gzip halt ipconfig kill
347 kinit ln losetup ls minips mkdir mkfifo mknodes
348 mksyntax mount mv nfsmount nuke pivot_root poweroff readlink reboot resume
349 run-init sh sha1hash sleep sync true umount uname zcat
350 </p></blockquote>
351
352 <p>To get that list, build klibc according to the instructions (I
353 <a href=http://landley.net/notes-2013.html#23-01-2013>looked at</a> version
354 2.0.2 and did cd klibc-*; ln -s /output/of/kernel/make/headers_install
355 linux; make) then <b>echo $(for i in $(find . -type f); do file $i | grep -q
356 executable && basename $i; done | grep -v '[.]g$' | sort -u)</b> to find
357 executables, then eliminated the *.so files and *.shared duplicates.</p>
358
359 <p>Some of those binaries are build-time tools that don't get installed,
360 which removes mknodes, mksyntax, sha1hash, and fixdep from the list.
361 (And sha1hash is just an unpolished sha1sum anyway.)</p>
362
363 <p>The run-init command is more commonly called switch_root, nuke is just
364 "rm -rf -- $@", and minips is more commonly called "ps". I'm not doing aliases
365 for the oddball names.</p>
366
367 <p>Yet more stale forks of dash and gzip sucked in here (see "dubious
368 license terms" above), adding nothing to the other projects we've looked at.
369 But we still need sh, gunzip, gzip, and zcat to replace this package.</p>
370
371 <p>By the time I did the analysis toybox already had cat, chroot, dmesg, false,
372 kill, ln, losetup, ls, mkdir, mkfifo, readlink, rm, switch_root, sleep, sync,
373 true, and uname.</p>
374
375 <p>The low hanging fruit is cpio, dd, ps, mv, and pivot_root.</p>
376
377 <p>The "kinit" command is another gratuitous rename, it's init running as PID 1.
378 The halt, poweroff, and reboot commands work with it.</p>
379
380 <p>I've got mount and umount queued up already, fstype and nfsmount go with
381 those. (And probably smbmount and p9mount, but this hasn't got one. Those
382 are all about querying for login credentials, probably workable into the
383 base mount command.)</p>
384
385 <p>The ipconfig command here has a built in dhcp client, so it's ifconfig
386 and dhcpcd and maybe some other stuff.</p>
387
388 <p>The resume command is... weird. It finds a swap partition and reads data
389 from it into a /proc file, something the kernel is capable of doing itself.
390 (Even though the klibc author
391 <a href=http://www.zytor.com/pipermail/klibc/2006-June/001748.html>attempted
392 to remove</a> that capability from the kernel, current kernel/power/hibernate.c
393 still parses "resume=" on the command line). And yet various distros seem to
394 make use of klibc for this.
395 Given the history of swsusp/hibernate (and 
396 <a href=http://lwn.net/Articles/333007>TuxOnIce</a>
397 and <a href=http://lwn.net/Articles/242107>kexec jump</a>) I've lost track
398 of the current state of the art here. Ah, Documentation/power/userland-swsusp.txt
399 has the API docs, and <a href=http://suspend.sf.net>here's a better
400 tool</a>...</p>
401
402 <p>So the list of things actually in klibc are:</p>
403
404 <blockquote><b>
405 <span id=klibc_cmd>
406 cat chroot dmesg false kill ln losetup ls mkdir mkfifo readlink rm switch_root
407 sleep sync true uname
408
409 cpio dd ps mv pivot_root
410 mount nfsmount fstype umount
411 sh gunzip gzip zcat
412 kinit halt poweroff reboot
413 ipconfig
414 resume
415 </span>
416 </b></blockquote>
417
418 <hr />
419 <a name=glibc />
420 <h2>glibc</h2>
421
422 <p>Rather a lot of command line utilities come bundled with glibc:</p>
423
424 <blockquote><b>
425 catchsegv getconf getent iconv iconvconfig ldconfig ldd locale localedef
426 mtrace nscd rpcent rpcinfo tzselect zdump zic
427 </b></blockquote>
428
429 <p>Of those, musl libc only implements ldd.</p>
430
431 <p>catchsegv is a rudimentary debugger, probably out of scope for toybox.</p>
432
433 <p>iconv has been <a href="#susv4">previously discussed</a>.</p>
434
435 <p>iconvconfig is only relevant if iconv is user-configurable; musl uses a
436 non-configurable iconv.</p>
437
438 <p>getconf is a posix utility which displays several variables from 
439 unistd.h; it probably belongs in the development toolchain.</p>
440
441 <p>getent handles retrieving entries from passwd-style databases
442 (in a rather lame way) and is trivially replacable by grep.</p>
443
444 <p>locale was discussed under <a href=#susv4>posix</a>.
445 localedef compiles locale definitions, which musl currently does not use.</p>
446
447 <p>mtrace is a perl script to use the malloc debugging that glibc has built-in;
448 this is not relevant for musl, and would necessarily vary with libc. </p>
449
450 <p>nscd is a name service caching daemon, which is not yet relevant for musl.
451 rpcinfo and rpcent are related to rpc, which musl does not include.</p>
452
453 <p>The remaining commands involve glibc's bundled timezone database,
454 which seems to be derived from the <a href=http://www.iana.org/time-zones>IANA
455 timezone database</a>. Unless we want to maintain our own fork of the
456 standards body's database like glibc does, these are of no interest,
457 but for completeness:</p>
458
459 <p>tzselect outputs a TZ variable correponding to user input. 
460 The documentation does not indicate how to use it in a script, but it seems
461 that Debian may have done so.
462 zdump prints current time in each of several timezones, optionally
463 outputting a great deal of extra information about each timezone.
464 zic converts a description of a timezone to a file in tz format.</p>
465
466 <p>None of glibc's bundled commands are currently of interest to toybox.</p>
467
468 </b></blockquote>
469
470 <hr />
471 <a name=sash />
472 <h2>Stand-Alone Shell</h2>
473
474 <p>Wikipedia has <a href=http://en.wikipedia.org/wiki/Stand-alone_shell>a good
475 summary of sash</a>, with links. The original Stand-Alone Shell project reached
476 a stopping point, and then <a href=http://www.baiti.net/sash>"sash plus
477 patches"</a> extended it a bit further. The result is a megabyte executable
478 that provides 40 commands.</p>
479
480 <p>Sash is a shell with built-in commands. It doesn't have a multiplexer
481 command, meaning "sash ls -l" doesn't work (you have to go "sash -c 'ls -l'").
482 </p>
483
484 <p>The list of commands can be obtained via building it and doing
485 "echo help | ./sash | awk '{print $1}' | sed 's/^-//' | xargs echo", which
486 gives us:</p>
487
488 <blockquote><b>
489 alias aliasall ar cd chattr chgrp chmod chown cmp cp chroot dd echo ed exec
490 exit file find grep gunzip gzip help kill losetup losetup ln ls lsattr mkdir
491 mknod more mount mv pivot_root printenv prompt pwd quit rm rmdir setenv source
492 sum sync tar touch umask umount unalias where
493 </b></blockquote>
494
495 <p>Plus sh because it's a shell. A dozen or so commands can only sanely be
496 implemented as shell builtins (alias aliasall cd exec exit prompt quit setenv
497 source umask unalias), where is an alias for which, and at triage time toybox
498 already has chgrp, chmod, chown, cmp, cp, chroot, echo, help, kill, losetup,
499 ln, ls, mkdir, mknod, printenv, pwd, rm, rmdir, sync, and touch.</p>
500
501 <p>This leaves:</p>
502
503 <blockquote><b>
504 <span id=sash_cmd>
505 ar chattr dd ed file find grep gunzip gzip lsattr more mount mv pivot_root
506 sh sum tar umount
507 </span>
508 </b></blockquote>
509
510 <p>(For once, this project doesn't include a fork of gzip, instead
511 it sucks in -lz from the host.)</p>
512
513 <hr />
514 <a name=sbase />
515 <h2>sbase:</h2>
516
517 <p>It's <a href=http://git.suckless.org/sbase>on suckless</a>. So far it's
518 implemented:</p>
519
520 <blockquote><p>
521 <span id=sbase_cmd>
522 basename cat chmod chown cksum cmp cp date dirname echo false fold grep head
523 kill ln ls mc mkdir mkfifo mv nl nohup pwd rm seq sleep sort tail tee test
524 touch true tty uname uniq wc yes
525 </span>
526 </p></blockquote>
527
528 <p>And has a TODO list:</p>
529
530 <blockquote><p>
531 <span id=sbase_cmd>
532 cal chgrp chvt comm cut df diff du env expand expr id md5sum nice paste
533 printenv printf readlink rmdir seq sha1sum split sync test tr unexpand unlink
534 who
535 </span>
536 </p></blockquote>
537
538 <p>At triage time, of the first list I still need to do: fold grep mc mv nl. Of
539 the second list: diff expr paste printf split test tr unexpand who.</p>
540
541 <hr />
542 <a name=s6 />
543 <h2>s6</h2>
544
545 <p>The website <a href=http://skarnet.org/software/>skarnet</a> has a bunch
546 of small utilities as part of something called "s6". This includes the
547 <a href=http://skarnet.org/software/s6-portable-utils>s6-portabile-utils</a>
548 and the <a href=http://skarnet.org/software/s6-linux-utils>s6-linux-utils</a>.
549 </p>
550
551 <p>Both packages rely on multiple bespoke external libraries without which
552 they can't compile. The source is completely uncommented and doesn't wrap at
553 80 characters. Doing a find for *.c files brings up the following commands:</p>
554
555 <blockquote><b>
556 <span id=s6>
557 basename cat chmod chown chroot clock cut devd dirname echo env expr false
558 format-filter freeramdisk grep halt head hiercopy hostname linkname ln
559 logwatch ls maximumtime memoryhog mkdir mkfifo mount nice nuke pause
560 pivotchroot poweroff printenv quote quote-filter reboot rename rmrf sleep
561 sort swapoff swapon sync tail test touch true umount uniquename unquote
562 unquote-filter update-symlinks
563 </span>
564 </b></blockquote>
565
566 <p>Triage: memoryhog isn't even listed on the website nor does it have
567 a documentation file, clock seems like a subset
568 of date, devd is some sort of netlink wrapper that spawns its command line
569 every time it gets a message (maybe this is meant to implement part of
570 udev/mdev?), format-filter is sort of awk's '{print $2}' function split out
571 into its own command, hiercopy a subset of "cp -r", maximumtime is something
572 I implemented as a shell script (more/timeout.sh in Aboriginal Linux),
573 nuke isn't the same as klibc (this one's "kill SIG -1" only with hardwared
574 SIG options), pause is a program that literally waits to be killed (I
575 generally sleep 999999999 which is a little over 30 years),
576 pivotchroot is a subset of switch_root, rmrf is rm -rf...</p>
577
578 <p>I see "nuke" resurface, and if "rmrf" wasn't also here I might think
579 klibc had a point.</b>
580
581 <blockquote>
582 basename cat chmod chown chroot cut dirname echo env expr false
583 freeramdisk grep halt head hostname linkname ln
584 logwatch ls mkdir mkfifo mount nice
585 pivotchroot poweroff printenv quote quote-filter reboot rename sleep
586 sort swapoff swapon sync tail test touch true umount uniquename unquote
587 unquote-filter update-symlinks
588 </blockquote>
589
590
591 <hr />
592 <a name=nash />
593 <h2>nash:</h2>
594
595 <p>Red Hat's nash was part of its "mkinitrd" package, replacement for a shell
596 and utilities on the boot floppy back in the 1990's (the same general idea
597 as BusyBox, developed independently). Red Hat discontinued nash development
598 in 2010, replacing it with dracut (which collects together existing packages,
599 including busybox).</p>
600
601 <p>I couldn't figure out how to beat source code out of
602 <a href=http://pkgs.fedoraproject.org/git/mkinitrd>Fedora's current git</a>
603 repository. The last release version that used it was Fedora Core 12
604 which 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>
605 that can be unwound with "rpm2cpio mkinitrd.src.rpm | cpio -i -d -H newc
606 --no-absolute-filenames" and in there is a mkinitrd-6.0.93.tar.bz2 which
607 has the source.</p>
608
609 <p>In addition to being a bit like a command shell, the nash man page lists the
610 following commands:</p>
611
612 <blockquote><p>
613 access echo find losetup mkdevices mkdir mknod mkdmnod mkrootdev mount
614 pivot_root readlink raidautorun setquiet showlabels sleep switchroot umount
615 </p></blockquote>
616
617 <p>Oddly, the only occurrence of the string pivot_root in the nash source code
618 is in the man page, the command isn't there. (It seems to have been removed
619 when the underscoreless switchroot went in.)</p>
620
621 <p>A more complete list seems to be the handlers[] array in nash.c:</p>
622
623 <blockquote><p>
624 access buildEnv cat cond cp daemonize dm echo exec exit find kernelopt
625 loadDrivers loadpolicy mkchardevs mkblktab mkblkdevs mkdir mkdmnod mknod
626 mkrootdev mount netname network null plymouth hotplug killplug losetup
627 ln ls raidautorun readlink resume resolveDevice rmparts setDeviceEnv
628 setquiet setuproot showelfinterp showlabels sleep stabilized status switchroot
629 umount waitdev
630 </p></blockquote>
631
632 <p>This list is nuts: "plymouth" is an alias for "null" which is basically
633 "true" (which thie above list doesn't have). Things like buildEnv and
634 loadDrivers are bespoke Red Hat behavior that might as well be hardwired in
635 to nash's main() without being called.</p>
636
637 <p>Instead of eliminating items
638 from the list with an explanation for each, I'm just going to cherry pick
639 a few: the device mapper (dm, raidautorun) is probably interesting,
640 hotplug (may be obsolete due to kernel changes that now load firmware
641 directly), and another "resume" ala klibc.</p>
642
643 <p>But mostly: I don't care about this one. And neither does Red Hat anymore.</p>
644
645 <p>Verdict: ignore</p>
646
647 <hr />
648 <a name=beastiebox />
649 <h2>Beastiebox</h2>
650
651 <p>Back in 2008, the BSD guys vented some busybox-envy
652 <a href=http://beastiebox.sourceforge.net>on sourceforge</a>. Then stopped.
653 Their repository is still in CVS, hasn't been touched in years, it's a giant
654 hairball of existing code sucked together. (The web page says the author
655 is aware of crunchgen, but decided to do this by hand anyway. This is not
656 a collection of new code, it's a katamari of existing code rolled up in a
657 ball.)</p>
658
659 <p>Combining the set of commands listed on the web page with the set of
660 man pages in the source gives us:</P>
661
662 <blockquote><p>
663 [ cat chmod cp csh date df disklabel dmesg echo ex fdisk fsck fsck_ffs getty
664 halt hostname ifconfig init kill less lesskey ln login ls lv mksh more mount
665 mount_ffs mv pfctl ping poweroff ps reboot rm route sed sh stty sysctl tar test
666 traceroute umount vi wiconfig
667 </p></blockquote>
668
669 <p>Apparently lv is the missing link ed and vi, copyright 1982-1997 (do not
670 want), ex is another obsolete vi mode, lesskey is "used to
671 specify a set of key bindings to be used with less", and csh is a shell they
672 sucked in, [ is an alias for test. Several more bsd-isms that don't have Linux
673 equivalents (even in the ubuntu "install this package" search) are
674 disklabel, fsck_ffs, mount_ffs, and pfctl. And wiconfig is a wavelan interface
675 network card driver utility. Subtracting all that and the commands toybox
676 already implements at triage time, we get:</p>
677
678 <blockquote><p>
679 <span id=beastiebox_cmd>
680 fdisk fsck getty halt ifconfig init kill less mksh more mount mv ping poweroff
681 ps reboot route sed sh stty sysctl tar test traceroute umount vi
682 </span>
683 </p></blockquote>
684
685 <p>Not a hugely interesting list, but eh.</p>
686
687 <p>Verdict: ignore</p>
688
689 <hr />
690 <a name=BsdBox />
691 <h2>BsdBox</h2>
692
693 <p>Somebody decided to do a <a href=https://wiki.freebsd.org/AdrianChadd/BsdBox>multicall binary for freebsd</a>.</p>
694
695 <p>They based it on crunchgen, a tool that glues existing programs together
696 into an archive and uses the name to execute the right one. It has no
697 simplification or code sharing benefits whatsoever, it's basically an
698 archiver that produces executables.</p>
699
700 <p>That's about where I stopped reading.</p>
701
702 <p>Verdict: ignore.</p>
703
704 <hr />
705 <a name=slowaris />
706 <h2>OpenSolaris Busybox</h2>
707
708 <p>Somebody <a href=http://hub.opensolaris.org/bin/view/Project+busybox/>wrote
709 a wiki page</a> saying that Busybox for OpenSolaris would be a good idea.</p>
710
711 <p>The corresponding "files" tab is an auto-generated stub. The project never
712 even got as far as suggesting commands to include before Oracle discontinued
713 OpenSolaris.</p>
714
715 <p>Verdict: ignore.</p>
716
717 <hr />
718 <a name=uclinux />
719 <h2>uClinux</h2>
720
721 <p>Long ago a hardware developer named Jeff Dionne put together a
722 nommu Linux distribution, which involved rewriting a lot of command line
723 utilities that relied on <a href=http://nommu.org/memory-faq.txt>features
724 unavailable on nommu</a> hardware.</p>
725
726 <p>In 2003 Jeff moved to Japan and handed
727 the project off to people who allowed it to roll to a stop. The website
728 turned into a mess of 404 links, the navigation indexes stopped being
729 updated over a decade ago, and the project's CVS repository suffered a
730 hard drive failure for which there were no backups. The project continued
731 to put out "releases" through 2014 (you have to scroll down in the "news"
732 section to find them, the "HTTP download" section in the nav bar on the
733 left hasn't been updated in over a decade), which were hand-updated tarball
734 snapshots mostly consisting of software from the 1990's. For example the
735 2014 release still contained ipfwadm, the package which predated ipchains,
736 which predated iptables, which is in the process of being replaced by
737 nftables.</p>
738
739 <p>Nevertheless, people still try to use this because (at least until the
740 launch of <a href=http://nommu.org>nommu.org</a>) the project was viewed
741 as the place to discuss, develop, and learn about nommu Linux.
742 The role of uclinux.org as an educational resource kept people coming
743 to it long after it had collapsed as a Linux distro.</p>
744
745 <p>Starting around 0.6.0 toybox began to address nommu support with the goal
746 of putting uClinux out of its misery.</p>
747
748 <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
749 subdirectories under "user".</p>
750
751 <h3>Taking out the trash</h3>
752
753 <p>A bunch of packages (<b>inotify-tools, input-event-demon, ipsec-tools, netifd,
754 keepalived, mobile-broadband-provider-info, nuttp, readline, snort,
755 snort-barnyard, socat, sqlite, sysklogd, sysstat, tcl, ubus, uci, udev,
756 unionfs, uqmi, usb_modeswitch, usbutils, util-linux</b>)
757 are hard to evaluate because
758 uclinux has directories for them, but their source isn't actually in the
759 uclinux tree. In some of these the makefiles download a git repo during
760 the build, so I'm assuming you can build the external package if you really
761 care. (Even when I know what these packages do, I'm skipping them
762 because uclinux doesn't actually contain them, and any given snapshot
763 of the build system will bitrot as external web links change over time.)</p>
764
765 <p>Other packages are orphaned, meaning they're not mentioned from any Kconfig
766 or Makefiles outside of their directory, so uclinux can't actually build
767 them: <b>mbus</b> is an orphaned i2c test program expecting to run in some sort
768 of hardwired hardware context, <b>mkeccbin</b> is an orphaned "ECC annotated
769 binary file" generator (meaning it's half of a flash writer),
770 <b>wsc_upnp</b> is a "Ralink WPS" driver (some sort of stale wifi chip)...</p>
771
772 <p>The majority of the remaining packages are probably not of interest to
773 toybox due to being so obsolete or special purpose they may not actually be
774 of interest to anybody anymore. (This list also includes a lot of
775 special-purpose network back-end stuff that's hard for anybody but
776 datacenter admins to evaluate the current relevance of.)</p>
777
778 <blockquote><b><p>
779 arj asterisk boottools bpalogin br2684ctl camserv can4linux cgi_generic
780 cgihtml clamav clamsmtp conntrack-tools cramfs crypto-tools cxxtest
781 ddns3-client de2ts-cal debug demo diald discard dnsmasq dnsmasq2
782 ethattach expat-examples ez-ipupdate fakeidentd
783 fconfig ferret flatfs flthdr freeradius freeswan frob-led frox fswcert
784 game gettyd gnugk haserl horch
785 hostap hping httptunnel ifattach ipchains
786 ipfwadm ipmasqadm ipportfw ipredir ipset iso_client
787 jamvm jffs-tools jpegview jquery-ui kendin-config kismet klaxon kmod
788 l2tpd lcd ledcmd ledcon lha lilo lirc lissa load loattach
789 lpr lrpstat lrzsz mail mbus mgetty microwin ModemManager msntp musicbox
790 nooom null openswan openvpn palmbot pam_* pcmcia-cs playrt plugdaemon pop3proxy
791 potrace qspitest quagga radauth
792 ramimage readprofile rdate readprofile routed rrdtool rtc-ds1302
793 sendip ser sethdlc setmac setserial sgutool sigs siproxd slattach
794 smtpclient snmpd net-snmp snortrules speedtouch squashfs scep sslwrap stp
795 stunnel tcpblast tcpdump tcpwrappers threaddemos tinylogin tinyproxy
796 tpt tripwire unrar unzoo version vpnled w3cam xl2tpd zebra
797 </p></b></blockquote>
798     
799 <p>This stuff is all over the place: arj, lha, rar, and zoo are DOS archivers,
800 ethattach describes itself as just "a network tool",
801 mail is a textmode smtp mailer literally described as "Some kind of mail
802 proggy" in uclinux's kconfig (as opposed to clamsmtp and smtpclient and
803 so on), this gettyd isn't a generic version but specifically a
804 hardwired ppp dialin utility, mgetty isn't a generic version but is combined
805 with "sendfax", hostap is an intersil prism driver, wlan-ng is also an
806 intersil prism dirver, null is a program to intentionally dereference a
807 null pointer (in case you needed one), iso_client is a
808 "Demo Application for the USB Device Driver", kendin-config is
809 "for configuring the Micrel Kendin KS8995M over QSPI", speedtouch configures
810 a specific brand of asdl modem, portmap is part of Anfs,
811 ferret, linux-igd, and miniupnp are all upnp packages,
812 lanbypass "can be used to control the LAN
813 bypass switches on the Advantech x86 based hardware platforms", lcd is
814 "test of lcddma device driver" (an out-of-tree Coldfire driver apparently
815 lost to history, the uclinux linux-2.4.x directory has a config symbol for
816 it, but nothing in the code actually _uses_ it...), qspitest is another
817 coldfire thing, mii-tool-fec is
818 "strictly for the FEC Ethernet driver as implemented (and modified) for
819 the uCdimm5272", rtc-ds1302 and rtc-m41t11 are usermode drivers for specific
820 clock chips, stunnel is basically "openssl s_client -quiet -connect",
821 potrace is a bitmap to vector graphic converter, radauth performs command line
822 authentication against a radius server,
823 clamav, klaxon, ferret, l7-protocols, and nessus are very old network security
824 software (it's got a stale snapshot of nmap too), xl2tpd is a PPP over UDP
825 tunnel (rfc 2661), zebra is the package quagga replaced,
826 lilo is the x86-only bootloader that predated grub (and recently discontinued
827 development), lissa is a "framebuffer graphics demo" from
828 1998, the squashfs package here is the out of tree patches for 2.4 kernels
829 and such before the filesystem was merged upstream (as opposed to the
830 squashfs-new package which is a snapshot of the userspace tool from 2011),
831 load is basically "dd file /dev/spi", version is basically "cat /proc/version",
832 microwin is a port of the WinCE graphics API to Linux, scep is a 2003
833 implementation of an IETF draft abandoned in 2010, tpt depends on
834 Andrew Morton's 15 year old unmerged "timepegs" kernel patch using the pentium
835 cycle counter, vpnled controls a light that reboots systems (what?),
836 w3cam is a video4linux 1.0 client (v4l2 showed up during 2.5 and support for
837 the old v4l1 was removed in 2.6.38 back in 2011), busybox ate tinylogin
838 over a decade ago, lrpstat is a java network monitor
839 from 2001, lrzsz is zmodem/ymodem/zmodem, msntp and stp implement rfc2030
840 meaning it overflows in 2036 (the package was last updated in 2000), rdate
841 is rfc 868 meaning it also overflows in 2036 (which is why ntp was invented
842 a few decades back), reiserfsprogs development stopped abruptly after
843 Hans Reiser was convicted of murdering his wife Nina (denying it on the
844 stand and then leading them to the body as part of his plea bargain during
845 sentencing)...
846 </p>
847
848 <p>Seriously, there's a lot of crap in there. It's hard to analyze most
849 of it far enough to prove it _doesn't_ do anything.</p>
850
851 <h3>Non-toybox programs</h3>
852
853 <p>The following software may actually still do something intelligible
854 (although the package versions tend to be years out of date), but
855 it's not a direction toybox has chosen to go in.</p>
856
857 <p>There are several programming languages (<b>bash, lua, jamvm, tinytcl,
858 perl, python</b>) in there. Maybe someone somewhere wants a 2008 release of a
859 java virtual machine tested to work on nommu systems (jamvm), but it's out
860 of scope for toybox.</p>
861
862 <p>A bunch of benchmark programs: <b>cpu, dhrystone, mathtest, nbench, netperf,
863 netpipe, and whetstone</b>.</p>
864
865 <p>A bunch of web servers: <b>appWeb, boa, fnord (via tcpserver), goahead, httpd,
866 mini_httpd, and thttpd</b>.</p>
867
868 <p>A bunch of shells: <b>msh</b> is a clever (I.E. obfuscated) little shell,
869 <b>nwsh</b> is "new shell" (that's what it called itself in 1999 anyway),
870 <b>sash</b> is another shell with a bunch of builtins (ls, ps, df, cp, date, reboot,
871 and shutdown, this roadmap analyzes it <a href="#sash">elsewhere</a>),
872 <b>sh</b> is a very old minix shell fork, and <b>tcsh</b> is also a shell.</p>
873
874 <p>Also in this category, we have:</p>
875
876 <blockquote><b><p>
877 dropbear jffs-tools jpegview kexec-tools bind ctorrent
878 iperf iproute2 ip-sentinel iptables kexec
879 nmap oggplay openssl oprofile p7zip pppd pptp play vplay
880 hdparm mp3play at clock
881 mtd-utils mysql logrotate brcfg bridge-utils flashw
882 ebtables etherwake ethtool expect gdb gdbserver hostapd
883 lm_sensors load netflash netstat-nat
884 radvd recover rootloader resolveip rp-pppoe
885 rsyslog rsyslogd samba smbmount squashfs-new squid ssh strace tip
886 uboot-envtools ulogd usbhubctrl vconfig vixie-cron watchdogd
887 wireless_tools wpa_supplicant
888 </p></b></blockquote>
889
890 <p>An awful lot of those are borderline: play and vplay are wav file
891 audio players, there's oprofile _and_ readprofile (which just reads kernel
892 profiling data from /proc/profile),
893 radvd is a "routr advertisement daemon" (ipv6 stateless autoconf),
894 ctorrent is a bittorent client, 
895 lm_sensors is hardware (heat?) monitoring,
896 resolveip is dig only less so,
897 rp-pppoe is ppp over ethernet,
898 ebtables is an ethernet version of iptables (for bridging),
899 their dropbear is from 2012, and that ssh version is from 2011
900 (which means it's about nine months too _old_ to have the heartbleed bug).
901 There's both ulogd and ulogd2 (no idea why), and pppd is version 2.4 but
902 there's a ppd-2.3 directory also.</p>
903
904 <p>Lots of flash stuff:
905 flashw is a flash writer, load is an spi flash loader, netflash writes
906 to flash via tftp,
907 recover is also a reflash daemon intended to come up when the system can't boot,
908 rootloader seems to be another reflash daemon but without dhcp.</p>
909
910 <h3>Already in roadmap</h3>
911
912 <p>The following packages contain commands already in the toybox roadmap:</p>
913
914 <blockquote><b><p>
915 agetty cal cksum cron dhcpcd dhcpcd-new dhcpd dhcp-isc dosfstools e2fsprogs
916 elvis-tiny levee fdisk fileutils ftp ftpd grep hd hwclock inetd init ntp
917 iputils login module-init-tools netcat shutils ntpdate lspci ping procps
918 proftpd rsync shadow shutils stty sysutils telnet telnetd tftp tftpd traceroute
919 unzip wget mawk net-tools
920 </p></b></blockquote>
921
922 <p>There are some duplicates in there, levee is a tiny vi implementation
923 like elvis-tiny, ntp and ntpdate overlap, etc.</p>
924
925 <p>Verdict: We don't really need to do a whole lot special for nommu
926 systems, just get the existing toybox roadmap working on nommu and
927 we're good. The uClinux project can rest in peace.</p>
928
929 <hr />
930 <h2>Requests:</h2>
931
932 <p>The following additional commands have been requested (and often submitted)
933 by various users:</p>
934 <blockquote><b>
935 <span id=request>
936 dig freeramdisk getty halt hexdump hwclock klogd modprobe ping ping6 pivot_root
937 poweroff readahead rev sfdisk sudo syslogd taskset telnet telnetd tracepath
938 traceroute unzip usleep vconfig zip free login modinfo unshare netcat help w
939 ntpd iwconfig iwlist rdate
940 dos2unix unix2dos catv clear
941 pmap realpath setsid timeout truncate
942 mkswap swapon swapoff
943 count oneit fstype
944 acpi blkid eject pwdx
945 sulogin rfkill bootchartd
946 arp makedevs sysctl killall5 crond crontab deluser last mkpasswd watch
947 ipaddr iplink iproute blockdev rpm2cpio arping brctl dumpleases fsck
948 tcpsvd tftpd
949 factor fallocate fsfreeze inotifyd lspci nbd-client partprobe strings
950 base64 mix
951 reset hexedit nsenter shred
952 </span>
953 </b></blockquote>
954
955 <!-- #include "footer.html" -->
956