blob: 4aa6d87efd886dd977f7cb4b814edacdd1deb96b [file] [log] [blame]
Rob Landley8f90d3a2012-07-21 23:58:40 -05001<!--#include file="header.html" -->
2<title>Toybox Roadmap</title>
3
4<h2>Goals and use cases</h2>
5
6<p>We have several potential use cases for a new set of command line
7utilities, and are using those to determine which commands to implement
8for Toybox's 1.0 release.</p>
9
Rob Landley9a69a922013-02-23 18:32:08 -060010<p>The most interesting standards are POSIX-2008 (also known as the Single
11Unix Specification version 4) and the Linux Standard Base (version 4.1).
12The main test harness including toybox in Aboriginal Linux and if that can
13build itself using the result to build Linux From Scratch (version 6.8).
14We also aim to replace Android's Toolbox.</p>
15
16<p>At a secondary level we'd like to meet other use cases. We've analyzed
17the commands provided by similar projects (klibc, sash, sbase, s6, embutils,
18nash, and beastiebox), along with various vendor configurations of busybox,
19and some end user requests.</p>
20
21<p>Finally, we'd like to provide a good replacement for the Bash shell,
22which was the first program Linux ever ran and remains the standard shell
23of Linux no matter what Ubuntu says. This doesn't mean including the full
24set of Bash 4.x functionality, but does involve {various,features} beyond
25posix.</p>
Rob Landley8f90d3a2012-07-21 23:58:40 -050026
27<p>See the <a href=status.html>status page</a> for the combined list
28and progress towards implementing it.</p>
29
Rob Landley9a69a922013-02-23 18:32:08 -060030<ul>
31<li><a href=#susv4>POSIX-2008/SUSv4</a></li>
32<li><a href=#sigh>Linux "Standard" Base</a></li>
33<li><a href=#dev_env>Development Environment</a></li>
34<li><a href=#android>Android Toolbox</a></li>
35<li>Miscelaneous: <a href=#klibc>klibc</a>, <a href=#sash>sash</a>,
Rob Landleyca04c7f2013-03-27 22:34:28 -050036<a href=#sbase>sbase</a>, <a href=#s6>s6</a>...</li>
Rob Landley9a69a922013-02-23 18:32:08 -060037</ul>
38
Rob Landley8f90d3a2012-07-21 23:58:40 -050039<hr />
40<a name="standards">
41<h2>Use case: standards compliance.</h2>
42
Rob Landley571b0702012-11-13 16:13:45 -060043<h3><a name=susv4 /><a href="#susv4">POSIX-2008/SUSv4</a></h3>
Rob Landley8f90d3a2012-07-21 23:58:40 -050044<p>The best standards are the kind that describe reality, rather than
45attempting to impose a new one. (I.E. a good standard should document, not
46legislate.)</p>
47
48<p>The kind of standards which describe existing reality tend to be approved by
49more than one standards body, such ANSI and ISO both approving C. That's why
50the IEEE POSIX committee's 2008 standard, the Single Unix Specification version
514, and the Open Group Base Specification edition 7 are all the same standard
52from three sources.</p>
53
Rob Landley62f00212012-12-06 15:15:30 -060054<p>The <a href="http://pubs.opengroup.org/onlinepubs/9699919799/idx/utilities.html">"utilities"
Rob Landley8f90d3a2012-07-21 23:58:40 -050055section</a>
56of these standards is devoted to the unix command line, and are the best such
57standard for our purposes. (My earlier work on BusyBox was implemented with
58regard to SUSv3, an earlier version of this standard.)</p>
59
60<h3>Problems with the standard</h3>
61
62<p>Unfortunately, these standards describe a subset of reality, lacking any
63mention of commands such as init, login, or mount required to actually boot a
64system. It provides ipcrm and ipcs, but not ipcmk, so you can use System V IPC
65resources but not create them.</p>
66
67<p>These standards also contain a large number of commands that are
68inappropriate for toybox to implement in its 1.0 release. (Perhaps some of
69these could be reintroduced in later releases, but not now.)</p>
70
71<p>Starting with the full "utilities" list, we first remove generally obsolete
72commands (compess ed ex pr uncompress uccp uustat uux), commands for the
73pre-CVS "SCCS" source control system (admin delta get prs rmdel sact sccs unget
74val what), fortran support (asa fort77), and batch processing support (batch
75qalter qdel qhold qmove qmsg qrerun qrls qselect qsig qstat qsub).</p>
76
77<p>Some commands are for a compiler toolchain (ar c99 cflow ctags cxref gencat
78iconv lex m4 make nm strings strip tsort yacc), which is outside of toybox's
79mandate and should be supplied externally. (Again, some of these may be
80revisited later, but not for toybox 1.0.)</p>
81
82<p>Some commands are part of a command shell, and cannot be implemented as
83separate executables (alias bg cd command fc fg getopts hash jobs kill read
84type ulimit umask unalias wait). These may be revisited as part of a built-in
85toybox shell, but are not exported into $PATH via symlinks. (If you fork a
86child process and have it "cd" then exit, you've accomplished nothing.)</p>
87
88<p>A few other commands are judgement calls, providing command-line
89internationalization support (iconv locale localedef), System V inter-process
90communication (ipcrm ipcs), and cross-tty communication from the minicomputer
91days (talk mesg write). The "pax" utility was supplanted by tar, "mailx" is
92a command line email client, and "lp" submits files for printing to... what
93exactly? (cups?) The standard defines crontab but not crond.</p>
94
95<p>Removing all of that leaves the following commands, which toybox should
96implement:</p>
97
98<blockquote><b>
99<span id=posix>
100at awk basename bc cal cat chgrp chmod chown cksum cmp comm cp
101csplit cut date dd df diff dirname du echo env expand expr false file find
102fold fuser getconf grep head id join kill link ln logger logname ls man
103mkdir mkfifo more mv newgrp nice nl nohup od paste patch pathchk printf ps
104pwd renice rm rmdir sed sh sleep sort split stty tabs tail tee test time
105touch tput tr true tty uname unexpand uniq unlink uudecode uuencode vi wc
106who xargs zcat
107</span>
108</b></blockquote>
109
Rob Landley571b0702012-11-13 16:13:45 -0600110<h3><a name=sigh /><a href="#sigh">Linux Standard Base</a></h3>
Rob Landley8f90d3a2012-07-21 23:58:40 -0500111
112<p>One attempt to supplement POSIX towards an actual usable system was the
113Linux Standard Base. Unfortunately, the quality of this "standard" is
114fairly low.</p>
115
116<p>POSIX allowed its standards process to be compromised
117by leaving things out, thus allowing IBM mainframes and Windows NT to drive
118a truck through the holes and declare themselves compilant. But it means what
119they DID standardize tends to be respected.</p>
120
121<p>The Linux Standard Base's failure mode is different, they respond to
122pressure by including special-case crap, such as allowing Red Hat to shoehorn
Rob Landley62f00212012-12-06 15:15:30 -0600123RPM on the standard even though all sorts of distros (Debian, Slackware, Arch,
124Gentoo) don't use it and probably never will. This means anything in the LSB is
Rob Landley8f90d3a2012-07-21 23:58:40 -0500125at best a suggestion: arbitrary portions of this standard are widely
126ignored.</p>
127
128<p>The LSB does specify a <a href=http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/cmdbehav.html>list of command line
129utilities</a>:</p>
130
131<blockquote><b>
132ar at awk batch bc chfn chsh col cpio crontab df dmesg du echo egrep
133fgrep file fuser gettext grep groupadd groupdel groupmod groups
134gunzip gzip hostname install install_initd ipcrm ipcs killall lpr ls
135lsb_release m4 md5sum mknod mktemp more mount msgfmt newgrp od passwd
136patch pidof remove_initd renice sed sendmail seq sh shutdown su sync
137tar umount useradd userdel usermod xargs zcat
138</b></blockquote>
139
140<p>Where posix specifies one of those commands, LSB's deltas tend to be
141accomodations for broken tool versions which aren't up to date with the
142standard 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>
143for examples.)</p>
144
145<p>Since we've already committed to using our own judgement to skip bits of
146POSIX, and LSB's "judgement" in this regard is purely bug workarounds to declare
147various legacy tool implementations "compliant", this means we're mostly
148interested in the set of tools that aren't specified in posix at all.</p>
149
150<p>Of these, gettext and msgfmt are internationalization, install_initd and
151remove_initd aren't present on ubuntu 10.04, lpr is out of scope, and
152lsb_release is a distro issue (it's a nice command, but the output of
153lsb_release -a is the name and version number of the linux distro you're
154running, which toybox doesn't know).</p>
155
156<p>This leaves:</p>
157
158<blockquote><b>
159<span id=lsb>
160chfn chsh dmesg egrep fgrep groupadd groupdel groupmod groups
161gunzip gzip hostname install killall md5sum
162mknod mktemp mount passwd pidof sendmail seq shutdown
163su sync tar umount useradd userdel usermod zcat
164</span>
165</b></blockquote>
166
167<hr />
168<a name="dev_env">
Rob Landley571b0702012-11-13 16:13:45 -0600169<h2><a href="#dev_env">Use case: provide a self-hosting development environment</a></h2>
Rob Landley8f90d3a2012-07-21 23:58:40 -0500170
171<p>The following commands are enough to build the Aboriginal Linux development
172environment, boot it to a shell prompt, and build Linux From Scratch 6.8 under
173it. (Aboriginal Linux currently uses BusyBox for this, thus provides a
174drop-in test environment for toybox. We install both implementations side
175by side, redirecting the symlinks a command at a time until the older
176package is no longer used, and can be removed.)</p>
177
178<p>This use case includes running init scripts and other shell scripts, running
179configure, make, and install in each package, and providing basic command line
180facilities such as a text editor. (It does not include a compiler toolchain or
181C library, those are outside the scope of this project.)</p>
182
183<blockquote><b>
184<span id=development>
185bzcat cat cp dirname echo env patch rmdir sha1sum sleep sort sync
186true uname wc which yes zcat
187awk basename bzip2 chmod chown cmp cut date dd diff
188egrep expr find grep gzip head hostname id install ln ls
189mkdir mktemp mv od readlink rm sed sh tail tar touch tr uniq
190wget whoami xargs chgrp comm gunzip less logname man split
191tee test time bunzip2 chgrp chroot comm cpio dmesg
192dnsdomainname ftpd ftpget ftpput gunzip ifconfig init less
193logname losetup man mdev mount mountpoint nc pgrep pkill
194pwd route split stat switch_root tac umount vi
195</span>
196</b></blockquote>
197
198<p>Note: Aboriginal Linux installs bash 2.05b as #!/bin/sh and its scripts
199require bash extensions not present in shells such as busybox ash.
200This means that toysh needs to supply several bash extensions _and_ work
201when called under the name "bash".</p>
202
203<hr />
Rob Landley571b0702012-11-13 16:13:45 -0600204<h2><a name=android /><a href="#android">Use case: Replacing Android Toolbox</a></h2>
Rob Landley8f90d3a2012-07-21 23:58:40 -0500205
Rob Landleyfdc10c92012-10-16 17:09:30 -0500206<p>Android has a policy against GPL in userspace, so even though BusyBox
207predates Android by many years, they couldn't use it. Instead they grabbed
208an old version of ash and implemented their own command line utility set
209called "toolbox".</p>
Rob Landley8f90d3a2012-07-21 23:58:40 -0500210
Rob Landleyfdc10c92012-10-16 17:09:30 -0500211<p>Toolbox doesn't have its own repository, instead it's part of Android's
212<a href=https://android.googlesource.com/platform/system/core>system/core
213git repository</a> (this analysis looked at commit 51ccef27cab58).</p>
Rob Landley8f90d3a2012-07-21 23:58:40 -0500214
Rob Landleyfdc10c92012-10-16 17:09:30 -0500215<h3>Toolbox commands:</h3>
216
217<p>According to core/toolbox/Android.mk the toolbox directory builds the
218following commands:</p>
Rob Landley8f90d3a2012-07-21 23:58:40 -0500219
220<blockquote><b>
Rob Landleyfdc10c92012-10-16 17:09:30 -0500221ls mount cat ps kill ln insmod rmmod lsmod ifconfig setconsole
222rm mkdir rmdir reboot getevent sendevent date wipe sync umount
223start stop notify cmp dmesg route hd dd df getprop setprop watchprops
224log sleep renice printenv smd chmod chown newfs_msdos netstat ioctl
225mv schedtop top iftop id uptime vmstat nandread ionice touch lsof md5 r
Rob Landley9a69a922013-02-23 18:32:08 -0600226cp du grep watchdogd
Rob Landley8f90d3a2012-07-21 23:58:40 -0500227</b></blockquote>
228
Rob Landleyfdc10c92012-10-16 17:09:30 -0500229<p>If selinux is enabled, you also get:</p>
230<blockquote><b>
231getenforce setenforce chcon restorecon runcon getsebool setsebool load_policy
232</b></blockquote>
Rob Landley8f90d3a2012-07-21 23:58:40 -0500233
Rob Landleyfdc10c92012-10-16 17:09:30 -0500234<p>The Android.mk file also refers to dynarray.c and toolbox.c as library
235code. This leaves the following apparently unused C files in toolbox/*.c, each
236of which has a command_main() function and seems to implement a standalone
237command:</p>
238
239<blockquote><b>
240alarm exists lsusb readtty rotatefb setkey syren
241</b></blockquote>
242
243<h3>Command shell (ash)</h3>
244
245<p>The core/sh subdirectory contains a fork of ash 1.17, and sucks in
246liblinenoise to provide command line history/editing.</p>
247
248<h3>Other Android core commands</h3>
249
250<p>Other than the toolbox and sh directories, the currently interesting
251subdirectories in the core repository are fs_mgr, gpttool, init,
252logcat, logwrapper, mkbootimg, netcfg, run-as, and sdcard.</p>
253
254<ul>
255<li><b>fs_mgr</b> - subset of mount</li>
256<li><b>gpttool</b> - subset of fdisk</li>
257<li><b>init</b> - Android's PID 1</li>
258<li><b>logcat</b> - read android log format</li>
259<li><b>logwrapper</b> - redirect stdio to android log</li>
260<li><b>mkbootimg</b> - create signed boot image</li>
261<li><b>netcfg</b> - network configuration (sucks in libnetutils)</li>
262<li><b>run-as</b> - subset of sudo</li>
263<li><b>sdcard</b> - FUSE wrapper to squash UID/GID/permissions to what FAT supports.</li>
264</ul>
265
266<p>Almost all of these reinvent an existing wheel with less functionality and a
267different user interface. We may want to provide that interface, but
268implementing the full commands (mount, fdisk, init, ifconfig with dhcp,
269and sudo) come first.</p>
270
271<p>Although logcat/logwrapper also reinvent a wheel, Android did so in the
272kernel and these provide an interface to that.</p>
273
274<p>Also, gpttool and mkbootimg are install tools, and sdcard looks like a
275testing tool. These aren't a priority if android wants to use its own
276bespoke code to install itself.</p>
277
278<h3>Analysis</h3>
279
280<p>For reference, combining everything listed above, we get:</p>
281
282<blockquote><b>
Rob Landley9a69a922013-02-23 18:32:08 -0600283alarm ash cat chcon chmod chown cmp cp date dd df dmesg du exists fs_mgr
284getenforce
285getevent getprop getsebool gpttool grep hd id ifconfig iftop init insmod ioctl
Rob Landleyfdc10c92012-10-16 17:09:30 -0500286ionice kill ln load_policy log logcat logwrapper ls lsmod lsof lsusb md5
287mkbootimg mkdir mount mv nandread netcfg netstat newfs_msdos notify printenv
288ps r readtty reboot renice restorecon rm rmdir rmmod rotatefb route run-as
289runcon schedtop sdcard sendevent setconsole setenforce setkey setprop setsebool
Rob Landley9a69a922013-02-23 18:32:08 -0600290sleep smd start stop sync syren top touch umount uptime vmstat watchdogd
291watchprops wipe
Rob Landleyfdc10c92012-10-16 17:09:30 -0500292</b></blockquote>
293
294<p>We may eventually implement all of that, but for toybox 1.0 we need to
295focus a bit. For our first pass, let's ignore selinux, strip out the "unlisted"
296commands except lsusb, and grab just logcat and logwrapper from the "core"
297commands (since the rest have some full/standard version providing that
298functionality, which we can implement a shim interface for later).</p>
299
300<p>This means toybox should implement:</p>
Rob Landley8f90d3a2012-07-21 23:58:40 -0500301<blockquote><b>
302<span id=toolbox>
Rob Landley9a69a922013-02-23 18:32:08 -0600303cat chmod chown cmp cp date dd df dmesg du getevent getprop grep hd id ifconfig
304iftop insmod ioctl ionice kill ln log logcat logwrapper ls lsmod lsof lsusb md5
305mkdir mount mv nandread
Rob Landleyfdc10c92012-10-16 17:09:30 -0500306netstat newfs_msdos notify printenv ps r reboot renice rm rmdir rmmod route
307schedtop sendevent setconsole setprop sleep smd start stop sync top touch
Rob Landley9a69a922013-02-23 18:32:08 -0600308umount uptime vmstat watchprops watchdogd wipe
Rob Landley8f90d3a2012-07-21 23:58:40 -0500309</span>
Rob Landleyc26ca6e2013-01-31 04:05:56 -0600310</b></blockquote>
Rob Landleyfdc10c92012-10-16 17:09:30 -0500311
312<p>The following Toolbox commands are already covered in previous
313sections of this analysis:</p>
314
315<blockquote><b>
Rob Landley9a69a922013-02-23 18:32:08 -0600316cat chmod chown cmp cp date dd df dmesg du grep id ifconfig insmod kill ln ls
317lsmod mkdir mount mv ps renice rm rmdir rmmod route sleep sync top touch umount
Rob Landleyfdc10c92012-10-16 17:09:30 -0500318</b></blockquote>
319
320<p>Which leaves the following commands as new from Toolbox:</p>
321
322<blockquote><b>
323getevent getprop hd iftop ioctl ionice log lsof nandread netstat
324newfs_msdos notify printenv r reboot schedtop sendevent setconsole
Rob Landley9a69a922013-02-23 18:32:08 -0600325setprop smd start stop top uptime vmstat watchprops watchdogd wipe
Rob Landley8f90d3a2012-07-21 23:58:40 -0500326</b></blockquote>
327
Rob Landley9a69a922013-02-23 18:32:08 -0600328<hr /><a name=klibc />
329<h2>kblic:</h2>
330
331<p>Long ago some kernel developers came up with a project called
332<a href=http://en.wikipedia.org/wiki/Klibc>klibc</a>.
333After a decade of development it still has no web page or HOWTO,
334and nobody's quite sure if the license is BSD or GPL. It inexplicably
335<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
336replacement.</p>
337
338<p>In addition to a C library even less capable than bionic (obsoleted by
339musl), klibc builds a random assortment of executables to run init scripts
340with. There's no multiplexer command, these are individual executables:</p>
341
342<blockquote><p>
343cat chroot cpio dd dmesg false fixdep fstype gunzip gzip halt ipconfig kill
344kinit ln losetup ls minips mkdir mkfifo mknodes
345mksyntax mount mv nfsmount nuke pivot_root poweroff readlink reboot resume
346run-init sh sha1hash sleep sync true umount uname zcat
347</p></blockquote>
348
349<p>To get that list, build klibc according to the instructions (I
350<a href=http://landley.net/notes-2013.html#23-01-2013>looked at</a> version
3512.0.2 and did cd klibc-*; ln -s /output/of/kernel/make/headers_install
352linux; make) then <b>echo $(for i in $(find . -type f); do file $i | grep -q
353executable && basename $i; done | grep -v '[.]g$' | sort -u)</b> to find
354executables, then eliminated the *.so files and *.shared duplicates.</p>
355
356<p>Some of those binaries are build-time tools that don't get installed,
357which removes mknodes, mksyntax, sha1hash, and fixdep from the list.
358(And sha1hash is just an unpolished sha1sum anyway.)</p>
359
360<p>The run-init command is more commonly called switch_root, nuke is just
361"rm -rf -- $@", and minips is more commonly called "ps". I'm not doing aliases
362for the oddball names.</p>
363
364<p>Yet more stale forks of dash and gzip sucked in here (see "dubious
365license terms" above), adding nothing to the other projects we've looked at.
366But we still need sh, gunzip, gzip, and zcat to replace this package.</p>
367
368<p>By the time I did the analysis toybox already had cat, chroot, dmesg, false,
369kill, ln, losetup, ls, mkdir, mkfifo, readlink, rm, switch_root, sleep, sync,
370true, and uname.</p>
371
372<p>The low hanging fruit is cpio, dd, ps, mv, and pivot_root.</p>
373
374<p>The "kinit" command is another gratuitous rename, it's init running as PID 1.
375The halt, poweroff, and reboot commands work with it.</p>
376
377<p>I've got mount and umount queued up already, fstype and nfsmount go with
378those. (And probably smbmount and p9mount, but this hasn't got one. Those
379are all about querying for login credentials, probably workable into the
380base mount command.)</p>
381
382<p>The ipconfig command here has a built in dhcp client, so it's ifconfig
383and dhcpcd and maybe some other stuff.</p>
384
385<p>The resume command is... weird. It finds a swap partition and reads data
386from it into a /proc file, something the kernel is capable of doing itself.
387(Even though the klibc author
388<a href=http://www.zytor.com/pipermail/klibc/2006-June/001748.html>attempted
389to remove</a> that capability from the kernel, current kernel/power/hibernate.c
390still parses "resume=" on the command line). And yet various distros seem to
391make use of klibc for this>
392Given the history of swsusp/hibernate (and
393<a href=http://lwn.net/Articles/333007>TuxOnIce</a>
394and <a href=http://lwn.net/Articles/242107>kexec jump</a>) I've lost track
395of the current state of the art here. Ah, Documentation/power/userland-swsusp.txt
396has the API docs, and <a href=http://suspend.sf.net>here's a better
397tool</a>...</p>
398
399<p>So the list of things actually in klibc are:</p>
400
401<blockquote><b>
402<span id=klibc_cmd />
403cat chroot dmesg false kill ln losetup ls mkdir mkfifo readlink rm switch_root
404sleep sync true uname
405
406cpio dd ps mv pivot_root
407mount nfsmount fstype umount
408sh gunzip gzip zcat
409kinit halt poweroff reboot
410ipconfig
411resume
412</span>
413</b></blockquote>
414
415<hr />
416<a name=sash />
417<h2>Stand-Alone Shell</h2>
418
419<p>Wikipedia has <a href=http://en.wikipedia.org/wiki/Stand-alone_shell>a good
420summary of sash</a>, with links. The original Stand-Alone Shell project reached
421a stopping point, and then <a href=http://www.baiti.net/sash>"sash plus
422patches"</a> extended it a bit further. The result is a megabyte executable
423that provides 40 commands.</p>
424
425<p>Sash is a shell with built-in commands. It doesn't have a multiplexer
426command, meaning "sash ls -l" doesn't work (you have to go "sash -c 'ls -l'").
427</p>
428
429<p>The list of commands can be obtained via building it and doing
430"echo help | ./sash | awk '{print $1}' | sed 's/^-//' | xargs echo", which
431gives us:</p>
432
433<blockquote><b>
434alias aliasall ar cd chattr chgrp chmod chown cmp cp chroot dd echo ed exec
435exit file find grep gunzip gzip help kill losetup losetup ln ls lsattr mkdir
436mknod more mount mv pivot_root printenv prompt pwd quit rm rmdir setenv source
437sum sync tar touch umask umount unalias where
438</b></blockquote>
439
440<p>Plus sh because it's a shell. A dozen or so commands can only sanely be
441implemented as shell builtins (alias aliasall cd exec exit prompt quit setenv
442source umask unalias), where is an alias for which, and at triage time toybox
443already has chgrp, chmod, chown, cmp, cp, chroot, echo, help, kill, losetup,
444ln, ls, mkdir, mknod, printenv, pwd, rm, rmdir, sync, and touch.</p>
445
446<p>This leaves:</p>
447
448<blockquote><b>
449<span id=sash_cmd>
450ar chattr dd ed file find grep gunzip gzip lsattr more mount mv pivot_root
451sh sum tar umount
452</span>
453</b></blockquote>
454
455<p>(For once, this project doesn't include a fork of gzip, instead
456it sucks in -lz from the host.)</p>
457
458<hr />
459<a name=sbase />
460<h2>sbase:</h2>
461
462<p>It's <a href=http://git.suckless.org/sbase>on suckless</a>. So far it's
463implemented:</p>
464
465<blockquote><p>
466<span id=sbase_cmd />
467basename cat chmod chown cksum cmp cp date dirname echo false fold grep head
468kill ln ls mc mkdir mkfifo mv nl nohup pwd rm seq sleep sort tail tee test
469touch true tty uname uniq wc yes
470</span>
471</p></blockquote>
472
473<p>And has a TODO list:</p>
474
475<blockquote><p>
476<span id=sbase_cmd />
477cal chgrp chvt comm cut df diff du env expand expr id md5sum nice paste
478printenv printf readlink rmdir seq sha1sum split sync test tr unexpand unlink
479who
480</span>
481</p></blockquote>
482
483<p>At triage time, of the first list I still need to do: fold grep mc mv nl. Of
484the second list: diff expr paste printf split test tr unexpand who.</p>
485
486<hr />
487<a name=s6 />
488<h2>s6</h2>
489
490<p>The website <a href=http://skarnet.org/software/>skarnet</a> has a bunch
491of small utilities as part of something called "s6". This includes the
492<a href=http://skarnet.org/software/s6-portable-utils>s6-portabile-utils</a>
493and the <a href=http://skarnet.org/software/s6-linux-utils>s6-linux-utils</a>.
494</p>
495
496<p>Both packages rely on multiple bespoke external libraries without which
497they can't compile. The source is completely uncommented and doesn't wrap at
49880 characters. Doing a find for *.c files brings up the following commands:</p>
499
500<blockquote><b>
501<span id=s6>
502basename cat chmod chown chroot clock cut devd dirname echo env expr false
503format-filter freeramdisk grep halt head hiercopy hostname linkname ln
504logwatch ls maximumtime memoryhog mkdir mkfifo mount nice nuke pause
505pivotchroot poweroff printenv quote quote-filter reboot rename rmrf sleep
506sort swapoff swapon sync tail test touch true umount uniquename unquote
507unquote-filter update-symlinks
508</span>
509</b></blockquote>
510
511<p>Triage: memoryhog isn't even listed on the website nor does it have
512a documentation file, clock seems like a subset
513of date, devd is some sort of netlink wrapper that spawns its command line
514every time it gets a message (maybe this is meant to implement part of
515udev/mdev?), format-filter is sort of awk's '{print $2}' function split out
516into its own command, hiercopy a subset of "cp -r", maximumtime is something
517I implemented as a shell script (more/timeout.sh in Aboriginal Linux),
518nuke isn't the same as klibc (this one's "kill SIG -1" only with hardwared
519SIG options), pause is a program that literally waits to be killed (I
520generally sleep 999999999 which is a little over 30 years),
521pivotchroot is a subset of switch_root, rmrf is rm -rf...</p>
522
523<p>I see "nuke" resurface, and if "rmrf" wasn't also here I might think
524klibc had a point.</b>
525
526<blockquote>
527basename cat chmod chown chroot cut dirname echo env expr false
528freeramdisk grep halt head hostname linkname ln
529logwatch ls mkdir mkfifo mount nice
530pivotchroot poweroff printenv quote quote-filter reboot rename sleep
531sort swapoff swapon sync tail test touch true umount uniquename unquote
532unquote-filter update-symlinks
533</blockquote>
534
535
536<hr />
537<a name=nash />
538<h2>nash:</h2>
539
540<p>Red Hat's nash was part of its "mkinitrd" package, replacement for a shell
541and utilities on the boot floppy back in the 1990's (the same general idea
542as BusyBox, developed independently). Red Hat discontinued nash development
543in 2010, replacing it with dracut (which collects together existing packages,
544including busybox).</p>
545
546<p>I couldn't figure out how to beat source code out of
547<a href=http://pkgs.fedoraproject.org/git/mkinitrd>Fedora's current git</a>
548repository. The last release version that used it was Fedora Core 12
549which 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>
550that can be unwound with "rpm2cpio mkinitrd.src.rpm | cpio -i -d -H newc
551--no-absolute-filenames" and in there is a mkinitrd-6.0.93.tar.bz2 which
552has the source.</p>
553
554<p>In addition to being a bit like a command shell, the nash man page lists the
555following commands:</p>
556
557<blockquote><p>
558access echo find losetup mkdevices mkdir mknod mkdmnod mkrootdev mount
559pivot_root readlink raidautorun setquiet showlabels sleep switchroot umount
560</p></blockquote>
561
562<p>Oddly, the only occurrence of the string pivot_root in the nash source code
563is in the man page, the command isn't there. (It seems to have been removed
564when the underscoreless switchroot went in.)</p>
565
566<p>A more complete list seems to be the handlers[] array in nash.c:</p>
567
568<blockquote><p>
569access buildEnv cat cond cp daemonize dm echo exec exit find kernelopt
570loadDrivers loadpolicy mkchardevs mkblktab mkblkdevs mkdir mkdmnod mknod
571mkrootdev mount netname network null plymouth hotplug killplug losetup
572ln ls raidautorun readlink resume resolveDevice rmparts setDeviceEnv
573setquiet setuproot showelfinterp showlabels sleep stabilized status switchroot
574umount waitdev
575</p></blockquote>
576
577<p>This list is nuts: "plymouth" is an alias for "null" which is basically
578"true" (which thie above list doesn't have). Things like buildEnv and
579loadDrivers are bespoke Red Hat behavior that might as well be hardwired in
580to nash's main() without being called.</p>
581
582<p>Instead of eliminating items
583from the list with an explanation for each, I'm just going to cherry pick
584a few: the device mapper (dm, raidautorun) is probably interesting,
585hotplug (may be obsolete due to kernel changes that now load firmware
586directly), and another "resume" ala klibc.</p>
587
588<p>But mostly: I don't care about this one. And neither does Red Hat anymore.</p>
589
Rob Landleyca04c7f2013-03-27 22:34:28 -0500590<p>Verdict: ignore</p>
591
Rob Landley9a69a922013-02-23 18:32:08 -0600592<hr />
593<a name=beastiebox />
594<h2>Beastiebox</h2>
595
596<p>Back in 2008, the BSD guys vented some busybox-envy
597<a href=http://beastiebox.sourceforge.net>on sourceforge</a>. Then stopped.
598Their repository is still in CVS, hasn't been touched in years, it's a giant
599hairball of existing code sucked together. (The web page says the author
600is aware of crunchgen, but decided to do this by hand anyway. This is not
601a collection of new code, it's a katamari of existing code rolled up in a
602ball.)</p>
603
604<p>Combining the set of commands listed on the web page with the set of
605man pages in the source gives us:</P>
606
607<blockquote><p>
608[ cat chmod cp csh date df disklabel dmesg echo ex fdisk fsck fsck_ffs getty
609halt hostname ifconfig init kill less lesskey ln login ls lv mksh more mount
610mount_ffs mv pfctl ping poweroff ps reboot rm route sed sh stty sysctl tar test
611traceroute umount vi wiconfig
612</p></blockquote>
613
614<p>Apparently lv is the missing link ed and vi, copyright 1982-1997 (do not
615want), ex is another obsolete vi mode, lesskey is "used to
616specify a set of key bindings to be used with less", and csh is a shell they
617sucked in, [ is an alias for test. Several more bsd-isms that don't have Linux
618equivalents (even in the ubuntu "install this package" search) are
619disklabel, fsck_ffs, mount_ffs, and pfctl. And wiconfig is a wavelan interface
620network card driver utility. Subtracting all that and the commands toybox
621already implements at triage time, we get:</p>
622
623<blockquote><p>
624<span id=beastiebox_cmd>
625fdisk fsck getty halt ifconfig init kill less mksh more mount mv ping poweroff
626ps reboot route sed sh stty sysctl tar test traceroute umount vi
627</span>
628</p></blockquote>
629
630<p>Not a hugely interesting list, but eh.</p>
631
Rob Landleyca04c7f2013-03-27 22:34:28 -0500632<p>Verdict: ignore</p>
633
634<hr />
635<a name=BsdBox />
636<h2>BsdBox</h2>
637
638<p>Somebody decided to do a <a href=https://wiki.freebsd.org/AdrianChadd/BsdBox>multicall binary for freebsd</a>.</p>
639
640<p>They based it on crunchgen, a tool that glues existing programs together
641into an archive and uses the name to execute the right one. It has no
642simplification or code sharing benefits whatsoever, it's basically an
643archiver that produces executables.</p>
644
645<p>That's about where I stopped reading.</p>
646
647<p>Verdict: ignore.</p>
648
649<hr />
650<a name=slowaris />
651<h2>OpenSolaris Busybox</h2>
652
653<p>Somebody <a href=http://hub.opensolaris.org/bin/view/Project+busybox/>wrote
654a wiki page</a> saying that Busybox for OpenSolaris would be a good idea.</p>
655
656<p>The corresponding "files" tab is an auto-generated stub. The project never
657even got as far as suggesting commands to include before Oracle discontinued
658OpenSolaris.</p>
659
660<p>Verdict: ignore.</p>
661
Rob Landley8f90d3a2012-07-21 23:58:40 -0500662<hr />
663<h2>Requests:</h2>
664
665<p>The following additional commands have been requested by various users:</p>
666<blockquote><b>
667<span id=request>
668freeramdisk getty halt hexdump hwclock klogd modprobe ping ping6 pivot_root
Rob Landleyca04c7f2013-03-27 22:34:28 -0500669poweroff readahead rev sfdisk sudo syslogd taskset telnet telnetd tracepath
670traceroute unzip usleep vconfig zip free login modinfo unshare netcat help w
Rob Landley8f90d3a2012-07-21 23:58:40 -0500671</span>
672</b></blockquote>
673
674<!-- #include "footer.html" -->
675