roadmap.html 68 KB

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