1*cf5a6c84SAndroid Build Coastguard Worker<html><head><title>toybox news</title> 2*cf5a6c84SAndroid Build Coastguard Worker<!--#include file="header.html" --> 3*cf5a6c84SAndroid Build Coastguard Worker 4*cf5a6c84SAndroid Build Coastguard Worker<p>Toybox combines the most common Linux command line utilities together 5*cf5a6c84SAndroid Build Coastguard Workerinto a single BSD-licensed executable that's simple, small, fast, 6*cf5a6c84SAndroid Build Coastguard Workerreasonably standards-compliant, and powerful enough to turn Android into 7*cf5a6c84SAndroid Build Coastguard Workera development environment. See the links on the left for details.</p> 8*cf5a6c84SAndroid Build Coastguard Worker 9*cf5a6c84SAndroid Build Coastguard Worker<h2>News</h2> 10*cf5a6c84SAndroid Build Coastguard Worker 11*cf5a6c84SAndroid Build Coastguard Worker<!-- new entry template 12*cf5a6c84SAndroid Build Coastguard Worker<a name="DD-MM-YYYY" /><a href="#01-01-2001"><hr><h2><b>Jan 1, 2001</b></h2></a> 13*cf5a6c84SAndroid Build Coastguard Worker<blockquote> 14*cf5a6c84SAndroid Build Coastguard Worker<p> 15*cf5a6c84SAndroid Build Coastguard WorkerDon't Panic 16*cf5a6c84SAndroid Build Coastguard Worker</p> - The Hitchhiker's Guide to the Galaxy</p> 17*cf5a6c84SAndroid Build Coastguard Worker</blockquote> 18*cf5a6c84SAndroid Build Coastguard Worker 19*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.0.1.tar.gz>Toybox 0.0.1</a> 20*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.0.1>git commit</a>) 21*cf5a6c84SAndroid Build Coastguard Workeris out, with prebuilt <a href=downloads/binaries/0.0.1>static binaries</a> and 22*cf5a6c84SAndroid Build Coastguard Worker<a href=downloads/binaries/mkroot/0.0.1>mkroot images</a> 23*cf5a6c84SAndroid Build Coastguard Workerbootable under QEMU (built using a <a href=https://github.com/landley/linux/tree/mkroot-0.1>lightly patched</a> linux-0.1).</p> 24*cf5a6c84SAndroid Build Coastguard Worker 25*cf5a6c84SAndroid Build Coastguard Worker<p>New commands</p> 26*cf5a6c84SAndroid Build Coastguard Worker 27*cf5a6c84SAndroid Build Coastguard Worker<u>Features</u>: 28*cf5a6c84SAndroid Build Coastguard Worker<u>Bugfixes</u>: 29*cf5a6c84SAndroid Build Coastguard Worker<u>Library</u>: 30*cf5a6c84SAndroid Build Coastguard Worker<u>Mkroot</u>: 31*cf5a6c84SAndroid Build Coastguard Worker<u>Pending</u>: 32*cf5a6c84SAndroid Build Coastguard Worker<u>Cleanup</u>: 33*cf5a6c84SAndroid Build Coastguard Worker<u>Portability</u>: 34*cf5a6c84SAndroid Build Coastguard Worker<u>Documentation</u>: 35*cf5a6c84SAndroid Build Coastguard Worker<u>Plumbing</u>: 36*cf5a6c84SAndroid Build Coastguard Worker<u>Test suite</u>: 37*cf5a6c84SAndroid Build Coastguard Worker<u>Build</u>: 38*cf5a6c84SAndroid Build Coastguard Worker--> 39*cf5a6c84SAndroid Build Coastguard Worker 40*cf5a6c84SAndroid Build Coastguard Worker<a name="08-04-2024" /><a href="#08-04-2024"><hr><h2><b>April 8, 2024</b></h2></a> 41*cf5a6c84SAndroid Build Coastguard Worker<blockquote> 42*cf5a6c84SAndroid Build Coastguard Worker<p>Another thing that got forgotten was the fact that against all probability a 43*cf5a6c84SAndroid Build Coastguard Workersperm whale had suddenly been called into existence several miles above the 44*cf5a6c84SAndroid Build Coastguard Workersurface of an alien planet. And since this is not a naturally tenable position 45*cf5a6c84SAndroid Build Coastguard Workerfor a whale, this poor innocent creature had very little time to come to terms 46*cf5a6c84SAndroid Build Coastguard Workerwith its identity as a whale before it then had to come to terms with not being 47*cf5a6c84SAndroid Build Coastguard Workera whale any more.</p> 48*cf5a6c84SAndroid Build Coastguard Worker<p>- The Hitchhiker's Guide to the Galaxy</p> 49*cf5a6c84SAndroid Build Coastguard Worker</blockquote> 50*cf5a6c84SAndroid Build Coastguard Worker 51*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.8.11.tar.gz>Toybox 0.8.11</a> 52*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.8.11>git commit</a>) 53*cf5a6c84SAndroid Build Coastguard Workeris out, with prebuilt <a href=/bin/toybox/0.8.11>static binaries</a> and 54*cf5a6c84SAndroid Build Coastguard Worker<a href=/bin/mkroot/0.8.11>mkroot images</a> 55*cf5a6c84SAndroid Build Coastguard Workerbootable under QEMU (built using a <a href=/bin/mkroot/0.8.11/linux-patches>lightly patched</a> linux-6.8).</p> 56*cf5a6c84SAndroid Build Coastguard Worker 57*cf5a6c84SAndroid Build Coastguard Worker<p>Highlights include a new <a href=quickstart.html>quickstart</a> 58*cf5a6c84SAndroid Build Coastguard Workerweb page, shorter <a href=/bin>/bin</a> links to prebuilt binaries, 59*cf5a6c84SAndroid Build Coastguard Workerlots of work on mkroot, and a new "canned" toybox build to reduce 60*cf5a6c84SAndroid Build Coastguard Workerdependencies.</p> 61*cf5a6c84SAndroid Build Coastguard Worker 62*cf5a6c84SAndroid Build Coastguard Worker<p><u>New commands</u>: 63*cf5a6c84SAndroid Build Coastguard WorkerRob added <b>tsort</b>, and promoted <b>fold</b> and <b>getopt</b>. 64*cf5a6c84SAndroid Build Coastguard WorkerOliver Webb added <b>ts</b> and <b>csplit</b>, and 65*cf5a6c84SAndroid Build Coastguard WorkerElliott added <b>memeater</b>.</p> 66*cf5a6c84SAndroid Build Coastguard Worker 67*cf5a6c84SAndroid Build Coastguard Worker<p>And one command got temporarily de-promoted: <b>passwd</b> is "default n" 68*cf5a6c84SAndroid Build Coastguard Worker(disabled in defconfig) this release due to the ongoing lib/passwd.c 69*cf5a6c84SAndroid Build Coastguard Workerinfrastructure rewrite that isn't quite done yet. (See the Library section.)</p> 70*cf5a6c84SAndroid Build Coastguard Worker 71*cf5a6c84SAndroid Build Coastguard Worker<u>Features</u>: 72*cf5a6c84SAndroid Build Coastguard WorkerThe new "<a href=https://github.com/landley/toybox/commit/d1acc6e88be5>canned</a>" 73*cf5a6c84SAndroid Build Coastguard Workertoybox build in <b>scripts/prereq/build.sh</b> lets toybox provide its own 74*cf5a6c84SAndroid Build Coastguard Workerbuild prerequisites by compiling a minimal toybox against saved headers (ala 75*cf5a6c84SAndroid Build Coastguard Worker"cc -I scripts/prereq/generated file1.c file2.c..."). This provides 76*cf5a6c84SAndroid Build Coastguard Workermost of the commands toybox needs to configure and build itself (except make, 77*cf5a6c84SAndroid Build Coastguard Workerbash, and the compiler toolchain). This may help <a href=https://github.com/landley/toybox/commit/3bbc31c78b41>bootstrap</a> toybox on systems 78*cf5a6c84SAndroid Build Coastguard Workerthat don't provide a modern Linux command line out of the box: install 79*cf5a6c84SAndroid Build Coastguard Workertoybox-prereq at the start of the $PATH, add 80*cf5a6c84SAndroid Build Coastguard Workera .config file, and run <b>scripts/make.sh</b>.</p> 81*cf5a6c84SAndroid Build Coastguard Worker 82*cf5a6c84SAndroid Build Coastguard Worker<p>New <b>mv -x</b> option to atomically swap two files, 83*cf5a6c84SAndroid Build Coastguard Worker<b>env -e FILE</b> executes a different command than argv[0] on the command 84*cf5a6c84SAndroid Build Coastguard Workerline, the <b>reset</b> command now puts raw terminals back into "cooked" mode, 85*cf5a6c84SAndroid Build Coastguard Workernegative offsets in <b>sort -k</b> count right to left, 86*cf5a6c84SAndroid Build Coastguard Worker<b>setsid</b> grabs the tty more forcefully (removing the need for getty) 87*cf5a6c84SAndroid Build Coastguard Workerand the -cc option will try to steal it, 88*cf5a6c84SAndroid Build Coastguard Worker<b>mount</b> now shows file= when displaying loopback mounts, 89*cf5a6c84SAndroid Build Coastguard Worker<b>wc -L</b> shows longest line length, 90*cf5a6c84SAndroid Build Coastguard Worker<b>tar -h</b> now detects a lot more hardlinks, 91*cf5a6c84SAndroid Build Coastguard Worker<b>cp</b> now copies xattrs for directories (not just files).</p> 92*cf5a6c84SAndroid Build Coastguard Worker 93*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott taught <b>file</b> to recognize wasm binary modules and 94*cf5a6c84SAndroid Build Coastguard Workerdisplay JPEG width/height, added the LOWER_UP, DORMANT, and ECHO 95*cf5a6c84SAndroid Build Coastguard Workerflags to <b>ifconfig</b>, added PAC and BTI decoding to <b>readelf</b>, 96*cf5a6c84SAndroid Build Coastguard Workercache size querying to <b>sysconf</b> (supported by glibc and bionic but 97*cf5a6c84SAndroid Build Coastguard Workernot musl-libc), and added a "paste" menu to <b>microcom</b>. Kalesh Singh 98*cf5a6c84SAndroid Build Coastguard Workertaught <b>readelf</b> to decode a new note type (NT_ANDROID_TYPE_PAD_SEGMENT). 99*cf5a6c84SAndroid Build Coastguard WorkerChristopher Ferris improved <b>readelf</b> section flags handling, 100*cf5a6c84SAndroid Build Coastguard Workerwith test. Oliver Webb suggested <b>count -l</b>. 101*cf5a6c84SAndroid Build Coastguard WorkerAditya submitted <b>netcat -z</b>.</p> 102*cf5a6c84SAndroid Build Coastguard Worker 103*cf5a6c84SAndroid Build Coastguard Worker<u>Bugfixes</u>: 104*cf5a6c84SAndroid Build Coastguard WorkerFixed <b>printf \0</b> and <b>grep -w</b> (which never quite worked right), 105*cf5a6c84SAndroid Build Coastguard Worker<b>ls -k</b> now switches off --block-size, 106*cf5a6c84SAndroid Build Coastguard Worker<b>install -dm 02750</b> works (sticky bit support for -d), 107*cf5a6c84SAndroid Build Coastguard Worker<b>tar</b> is better at following symlinks and extracting records with broken 108*cf5a6c84SAndroid Build Coastguard Workermetadata, <b>gzip</b> now knows 109*cf5a6c84SAndroid Build Coastguard Workerknows how to rename between "tgz/tar" extensions, 110*cf5a6c84SAndroid Build Coastguard Worker<b>mkpasswd -m sha*</b> salt length can now range from 8-16, not just 16, 111*cf5a6c84SAndroid Build Coastguard Worker<b>ps</b> can now handle an session ID of 0 (which is what PID 1 starts with 112*cf5a6c84SAndroid Build Coastguard Workerbefore the first call to setsid()), 113*cf5a6c84SAndroid Build Coastguard Worker<b>pwgen</b> can now use ~ in output, 114*cf5a6c84SAndroid Build Coastguard Worker<b>xargs</b> now stops when a child exits with 255, 115*cf5a6c84SAndroid Build Coastguard Worker<b>iconv</b> now exits with error if any characters failed to convert with -c, 116*cf5a6c84SAndroid Build Coastguard Workerthings like <b>truncate -s 1e2</b> were saying "too large" and now correctly 117*cf5a6c84SAndroid Build Coastguard Workersay "not integer" (it's not scientific notation, it's exabyte suffix with 118*cf5a6c84SAndroid Build Coastguard Workertrailing garbage), 119*cf5a6c84SAndroid Build Coastguard Worker<b>timeout</b> now takes its exit code from SIGCHLD instead of wait() 120*cf5a6c84SAndroid Build Coastguard Workerto fix a race condition (SIGCHLD can happen before calling wait and the 121*cf5a6c84SAndroid Build Coastguard Workerkernel won't deliver status twice, so you can't wait AND have the 122*cf5a6c84SAndroid Build Coastguard Workersignal handler). The usual round of gcc warnings got tracked down, confirmed 123*cf5a6c84SAndroid Build Coastguard Workerto be useless, and removed, but despite gcc constantly warning "variable is 124*cf5a6c84SAndroid Build Coastguard Workernot actually used uninitialized" there were some uninitialized variables in 125*cf5a6c84SAndroid Build Coastguard Worker<b>dd</b> it DIDN'T warn about: found and fixed.</p> 126*cf5a6c84SAndroid Build Coastguard Worker 127*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott added an error message to catch <b>xxd -r</b> receiving -p format 128*cf5a6c84SAndroid Build Coastguard Workerinput without -p, 129*cf5a6c84SAndroid Build Coastguard Workerfixed <b>readelf -n</b> for x86-64 ibt/shstk notes 130*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/commit/6c23ff0168c1>whatever those 131*cf5a6c84SAndroid Build Coastguard Workerare</a>), 132*cf5a6c84SAndroid Build Coastguard Workerand fixed <b>blkid</b> not to check filesystem signatures that would continue 133*cf5a6c84SAndroid Build Coastguard Workerpast the end of the loaded buffer. 134*cf5a6c84SAndroid Build Coastguard WorkerMichael Shavit pointed out that <b>devmem</b> command line number parsing 135*cf5a6c84SAndroid Build Coastguard Workerwasn't unsigned (although fixing that means it no longer parses the kmg unit 136*cf5a6c84SAndroid Build Coastguard Workersuffixes). 137*cf5a6c84SAndroid Build Coastguard WorkerPeter Collingbourne fixed <b>inotifyd</b> skipping the first mask character. 138*cf5a6c84SAndroid Build Coastguard WorkerTaisuke Matsushiro fixed a fencepost error preventing <b>stty</b> from 139*cf5a6c84SAndroid Build Coastguard Workersetting serial baud rate to 57600. 140*cf5a6c84SAndroid Build Coastguard WorkerAskar Safin fixed a typo in mkroot/packages/busybox.</p> 141*cf5a6c84SAndroid Build Coastguard Worker 142*cf5a6c84SAndroid Build Coastguard Worker<u>Library</u>: 143*cf5a6c84SAndroid Build Coastguard WorkerThe in-progress rewrite of <b>lib/password.c</b> no longer uses shadow.h 144*cf5a6c84SAndroid Build Coastguard Worker(which lets it build against bionic), 145*cf5a6c84SAndroid Build Coastguard Workerand a new <b>lib/hash.c</b> where toybox implements its own crypt() using 146*cf5a6c84SAndroid Build Coastguard Workerthe md5/sha1/sha3 etc hash functions we've already got (to work around glibc's 147*cf5a6c84SAndroid Build Coastguard Workerongoing deprecation of posix features), but neither are quite finished yet. 148*cf5a6c84SAndroid Build Coastguard WorkerNew <b>lib/elf.c</b> with plumbing shared by <b>file</b> and <b>readelf</b>, with 149*cf5a6c84SAndroid Build Coastguard Workeradditional arm and riscv flag decoding, 150*cf5a6c84SAndroid Build Coastguard Workerthe <b>peek()</b> family of functions now return long long instead of 151*cf5a6c84SAndroid Build Coastguard Workerint64_t so the base types are consistent on 32/64 bit, 152*cf5a6c84SAndroid Build Coastguard Worker<b>lib/args.c</b> now handles the high bit octal escape sequences in trailing 153*cf5a6c84SAndroid Build Coastguard Worker[-abc] blocks, so you can have punctuation participate in option groups, 154*cf5a6c84SAndroid Build Coastguard Workerswitching off an option via grouping now sets it back to its default 155*cf5a6c84SAndroid Build Coastguard Workervalue (not to zero), and numeric and date parsing report out of range numeric 156*cf5a6c84SAndroid Build Coastguard Workeror millisecond values.</p> 157*cf5a6c84SAndroid Build Coastguard Worker 158*cf5a6c84SAndroid Build Coastguard Worker<u>Mkroot</u>: 159*cf5a6c84SAndroid Build Coastguard WorkerThere's a <b>README</b> in the mkroot directory now. (Microsoft Github was 160*cf5a6c84SAndroid Build Coastguard Workerpicking up the README.root file used by the tar-for-web.sh script 161*cf5a6c84SAndroid Build Coastguard Workerand showing that instead.) 162*cf5a6c84SAndroid Build Coastguard WorkerExtended <b>run-qemu.sh</b> so it can be run from other directories 163*cf5a6c84SAndroid Build Coastguard Worker(prepending $(dirname $0)/ to linux-kernel and initramfs.cpio.gz when 164*cf5a6c84SAndroid Build Coastguard Workerloading them into qemu). 165*cf5a6c84SAndroid Build Coastguard WorkerThe initramfs now has <b>/etc/os-release</b> with the toybox $VERSION. 166*cf5a6c84SAndroid Build Coastguard WorkerThe big if/else staircase of linux kernel target configurations 167*cf5a6c84SAndroid Build Coastguard Workermoved into its own <b>get_target_config()</b> shell function, with 168*cf5a6c84SAndroid Build Coastguard Workera big comment block right before it explaining what all the variables 169*cf5a6c84SAndroid Build Coastguard Workerit sets mean, and the generic kconfig symbol list got moved out to 170*cf5a6c84SAndroid Build Coastguard Workera <b>GENERIC_KCONF</b> variable assignment right after that function. 171*cf5a6c84SAndroid Build Coastguard WorkerThe <b>microconfig</b> format got compressed slightly more 172*cf5a6c84SAndroid Build Coastguard Workerby use of bash brace expansion, decoded to comma separated values by 173*cf5a6c84SAndroid Build Coastguard Workerthe be2csv function ala KCONF="$(be2csv SPI{,_BITBANG} IOMMU_SUPPORT)" . 174*cf5a6c84SAndroid Build Coastguard WorkerThe init script no longer calls <b>oneit</b>, instead doing the work in the 175*cf5a6c84SAndroid Build Coastguard Workerinit script. (Redirect stdin/out/err to the "real" console device on 176*cf5a6c84SAndroid Build Coastguard Workerthe last line of /sys/class/tty/console/active, call setsid, trap SIGCHLD, 177*cf5a6c84SAndroid Build Coastguard Workerreboot when the shell exits. This (and the setsid tty stealing upgrades) also 178*cf5a6c84SAndroid Build Coastguard Workerfixed <b>ps</b> not showing any processes in mkroot because stdin/stdout weren't 179*cf5a6c84SAndroid Build Coastguard Workerproperly claimed as the controlling tty. 180*cf5a6c84SAndroid Build Coastguard WorkerThe base kernel config now uses <b>CONFIG_PANIC_TIMEOUT=1</b> so 181*cf5a6c84SAndroid Build Coastguard Workerwe don't have to say panic=1 on the kernel command line anymore. 182*cf5a6c84SAndroid Build Coastguard WorkerThe baseconfig now automatically adds CONFIG_MODULES and 183*cf5a6c84SAndroid Build Coastguard WorkerCONFIG_MODULES_UNLOAD when any <b>$MODULES</b> are listed. 184*cf5a6c84SAndroid Build Coastguard WorkerMoved the kernel modules archive into the "docs" directory. 185*cf5a6c84SAndroid Build Coastguard WorkerNew <b>$NOTOYBOX</b> variable skips the toybox build if set. 186*cf5a6c84SAndroid Build Coastguard WorkerThe <b>$DTB</b> files no longer have a path, instead using "find" 187*cf5a6c84SAndroid Build Coastguard Workerto install them. 188*cf5a6c84SAndroid Build Coastguard WorkerThe build now creates the externally loadable cpio.gz file even when 189*cf5a6c84SAndroid Build Coastguard Workerbuilding initramfs into the kernel, but sticks it in the docs/ subdirectory 190*cf5a6c84SAndroid Build Coastguard Workerwhen it's not used.</p> 191*cf5a6c84SAndroid Build Coastguard Worker 192*cf5a6c84SAndroid Build Coastguard Worker<p>Several new <b>mcm-buildall.sh</b> targets (or1k, riscv32, riscv64, sh4eb) 193*cf5a6c84SAndroid Build Coastguard Workertaking advantage of upstream musl-cross-make updating itself to use 194*cf5a6c84SAndroid Build Coastguard Workermusl-1.2.5. The target list in mcm-buildall.sh moved into a <b>TARGETS=()</b> 195*cf5a6c84SAndroid Build Coastguard Workerarray with a big comment before it explaining the format, and the script 196*cf5a6c84SAndroid Build Coastguard Workeris better about building host toolchains 197*cf5a6c84SAndroid Build Coastguard Workerto build other cross compilers with: it tries to autodetect the host 198*cf5a6c84SAndroid Build Coastguard Workertype (moving the relevant one to the front of the build list), and 199*cf5a6c84SAndroid Build Coastguard Workerwill also build a missing host toolchain when given targets on the 200*cf5a6c84SAndroid Build Coastguard Workercommand line. Added microblaze and or1k kernel configs, neither of which 201*cf5a6c84SAndroid Build Coastguard Workerknow how to exit qemu yet. (If Linux has got a reboot mechanism it knows 202*cf5a6c84SAndroid Build Coastguard Workerhow to poke that qemu is listening for on either virtual board, I haven't 203*cf5a6c84SAndroid Build Coastguard Workerfound it yet.) Also added sh4eb with FDPIC support (see kernel patch, which 204*cf5a6c84SAndroid Build Coastguard Workerallows qemu-system-sh4eb to run the sh2eb nommu root filesystem), and armv4l 205*cf5a6c84SAndroid Build Coastguard Worker(the 486 of arm).</p> 206*cf5a6c84SAndroid Build Coastguard Worker 207*cf5a6c84SAndroid Build Coastguard Worker<u>Pending</u>: 208*cf5a6c84SAndroid Build Coastguard WorkerElliott fixed and improved <b>strace</b>, translating more system calls. 209*cf5a6c84SAndroid Build Coastguard WorkerRob enabled command recursion in <b>toysh</b> (so it can call non-builtins as 210*cf5a6c84SAndroid Build Coastguard Workerbuiltins), fixed calling "exec" on NOFORK commands (which MUST run 211*cf5a6c84SAndroid Build Coastguard Workerin the shell's process context), redid the code to handle trailing 212*cf5a6c84SAndroid Build Coastguard Workerbackslashes gluing lines together, and it no longer leaks script 213*cf5a6c84SAndroid Build Coastguard Workerfilehandles into child processes. 214*cf5a6c84SAndroid Build Coastguard WorkerOliver Webb noticed that OLDTOY(MAYFORK) aliases didn't become shell 215*cf5a6c84SAndroid Build Coastguard Workerbuiltins, added <b>tr -t</b>, in <b>vi</b> added line gotos in ex mode, 216*cf5a6c84SAndroid Build Coastguard Worker'g', 'v', 'j' commands, and backwards search, cleaned up stuff in 217*cf5a6c84SAndroid Build Coastguard Worker<b>xzcat</b>, <b>getopt</b>, <b>bc</b>, and removed a bunch of useless autogenerated 218*cf5a6c84SAndroid Build Coastguard Worker<b>bc</b> tests. Jarno Mäkipää added the list of supported commands to <b>vi</b>'s 219*cf5a6c84SAndroid Build Coastguard Workerhelp text. 220*cf5a6c84SAndroid Build Coastguard WorkerMathieu Anquetin fixed <b>ip link set</b> parsing, and NUL byte handling 221*cf5a6c84SAndroid Build Coastguard Workerin <b>hexdump</b>. 222*cf5a6c84SAndroid Build Coastguard WorkerGeneral cleanup passes on <b>expr</b> (which now uses 64 bit comparisons), 223*cf5a6c84SAndroid Build Coastguard Worker<b>tr</b>, and <b>dhcpd</b>.</p> 224*cf5a6c84SAndroid Build Coastguard Worker 225*cf5a6c84SAndroid Build Coastguard Worker<u>Cleanup</u>: 226*cf5a6c84SAndroid Build Coastguard Workerpass over <b>lsattr</b>, <b>getconf</b>, <b>acpi</b>, and <b>blkid</b>. 227*cf5a6c84SAndroid Build Coastguard WorkerUse FLAG() macros in <b>ifconfig</b> and <b>restorecon</b>. Removed TODO block 228*cf5a6c84SAndroid Build Coastguard Workerfrom <b>nbd-client</b>. 229*cf5a6c84SAndroid Build Coastguard WorkerMore error_msg("%s", str) converted to error_msg_raw(str). 230*cf5a6c84SAndroid Build Coastguard WorkerTrimmed the GLOBALS() sizes (using <b>scripts/probes/GLOBALS</b>): 231*cf5a6c84SAndroid Build Coastguard Workerremoved 1k of global data from <b>cksum</b> and switched a 2k global 232*cf5a6c84SAndroid Build Coastguard Workerin <b>grep</b> to a malloc. Simplified scripts/probes/bloatcheck and 233*cf5a6c84SAndroid Build Coastguard Workermkroot/record-commands.</p> 234*cf5a6c84SAndroid Build Coastguard Worker 235*cf5a6c84SAndroid Build Coastguard Worker<u>Portability</u>: 236*cf5a6c84SAndroid Build Coastguard WorkerFixed <b>truncate -s 8g</b> on 32 bit hosts, 237*cf5a6c84SAndroid Build Coastguard Workerupdated <b>mcm-buildall.sh</b> to autodetect host type and automatically 238*cf5a6c84SAndroid Build Coastguard Workerselect newer package versions, 239*cf5a6c84SAndroid Build Coastguard Workerand moved the <b>linux32</b> command to its own file because BSD can't 240*cf5a6c84SAndroid Build Coastguard Workerbuild it. 241*cf5a6c84SAndroid Build Coastguard WorkerMacOS had a use-after-free with the getpwuid() return value being recycled 242*cf5a6c84SAndroid Build Coastguard Workera more aggressively than Linux. 243*cf5a6c84SAndroid Build Coastguard WorkerElliott fixed diff.test to work with mksh, and posix_fallocate() 244*cf5a6c84SAndroid Build Coastguard Workerto work with MacOS. 245*cf5a6c84SAndroid Build Coastguard WorkerMore commands enabled in <b>make bsd_defconfig</b> and <b>make 246*cf5a6c84SAndroid Build Coastguard Workermacos_defconfig</b>. 247*cf5a6c84SAndroid Build Coastguard WorkerAdded some (void) typecasts to netstat, oneit, and watchdog to try to 248*cf5a6c84SAndroid Build Coastguard Workershut up compilers that insist on responding to uncorrectable failures. 249*cf5a6c84SAndroid Build Coastguard Worker(Such as fgets() reading known /proc data from the kernel, writes to 250*cf5a6c84SAndroid Build Coastguard Workerthe watchdog timer that will reboot the system if they fail, or PID 1 calling 251*cf5a6c84SAndroid Build Coastguard Workerdup() on stdin to create stdout and stderr after closing the old ones. 252*cf5a6c84SAndroid Build Coastguard WorkerIf any of that goes wrong, what are we supposed to do about it?)</p> 253*cf5a6c84SAndroid Build Coastguard Worker 254*cf5a6c84SAndroid Build Coastguard Worker<u>Documentation</u>: 255*cf5a6c84SAndroid Build Coastguard WorkerThe website now has a <a href=quick.html>quickstart</a> page, 256*cf5a6c84SAndroid Build Coastguard Workerand the site now defaults to the about page (updated index.html symlink). 257*cf5a6c84SAndroid Build Coastguard WorkerThe "current release" is now in the common header displayed by most pages. 258*cf5a6c84SAndroid Build Coastguard WorkerThe mkroot dir has a 259*cf5a6c84SAndroid Build Coastguard Worker<a href=https://github.com/landley/toybox/blob/0.8.11/mkroot/README>README</a>, and its <a href=faq.html#mkroot>faq entry</a> 260*cf5a6c84SAndroid Build Coastguard Workerhas been updated. 261*cf5a6c84SAndroid Build Coastguard WorkerNew option to compress help text with <b>gzip</b>, and help text size now shows 262*cf5a6c84SAndroid Build Coastguard Workerup in <b>make bloatcheck</b>. 263*cf5a6c84SAndroid Build Coastguard WorkerFix <b>sed --help</b> to show full help, <b>patch -F</b> is now mentioned 264*cf5a6c84SAndroid Build Coastguard Workerin the help text, tweaks to help text in <b>cut</b>, <b>grep</b>, 265*cf5a6c84SAndroid Build Coastguard Worker<b>blkdiscard</b>. 266*cf5a6c84SAndroid Build Coastguard WorkerElliott did a cleanup pass over "usage:" lines and alphabetized more help text 267*cf5a6c84SAndroid Build Coastguard Workeroptions. 268*cf5a6c84SAndroid Build Coastguard WorkerChristian Koestlin fixed a typo in the <b>dmesg</b> docs. 269*cf5a6c84SAndroid Build Coastguard WorkerThe <a href=release.txt>release 270*cf5a6c84SAndroid Build Coastguard Workerprocedure checklist</a> has been updated, and the README generated 271*cf5a6c84SAndroid Build Coastguard Workerby <b>mkroot/tar-for-web.sh</b> got updated. 272*cf5a6c84SAndroid Build Coastguard WorkerNew faq entry explaining why toybox doesn't have (or need) cttyhack, 273*cf5a6c84SAndroid Build Coastguard Workerand the architecture list got updated to match mcm-buildall.sh. 274*cf5a6c84SAndroid Build Coastguard WorkerThe usual roadmap updates.</p> 275*cf5a6c84SAndroid Build Coastguard Worker 276*cf5a6c84SAndroid Build Coastguard Worker<p>New <b>scripts/probes/cmd2dpkg</b> script shows what 277*cf5a6c84SAndroid Build Coastguard Workerdebian package (if any) each toybox command lives in, but only checks 278*cf5a6c84SAndroid Build Coastguard Workerinstalled packages (dpkg-query -S "$(which $COMMAND)") and debian breaks 279*cf5a6c84SAndroid Build Coastguard Workerup source packages strangely, so did not used it to redo the roadmap section 280*cf5a6c84SAndroid Build Coastguard Workerlisting packages (created using Linux From Scratch's list of commands 281*cf5a6c84SAndroid Build Coastguard Workerinstalled by each source package).</p> 282*cf5a6c84SAndroid Build Coastguard Worker 283*cf5a6c84SAndroid Build Coastguard Worker<u>Plumbing</u>: 284*cf5a6c84SAndroid Build Coastguard WorkerThe <b>yes</b> command now uses writev() to go way faster, mostly to 285*cf5a6c84SAndroid Build Coastguard Workerprove it can. 286*cf5a6c84SAndroid Build Coastguard WorkerThe default <b>stdout</b> buffer type switched to block buffering to make 287*cf5a6c84SAndroid Build Coastguard WorkerElliott happy, which is a rich source of bugs (many of which Elliott 288*cf5a6c84SAndroid Build Coastguard Workerhas already whack-a-moled) and means among other things 289*cf5a6c84SAndroid Build Coastguard Workerthat mixing write() and fwrite() calls now requires manual flushing. 290*cf5a6c84SAndroid Build Coastguard WorkerMeanwhile xflush() became xferror() because it usually 291*cf5a6c84SAndroid Build Coastguard Workerwasn't flushing anyway, and now that's more noticeable. 292*cf5a6c84SAndroid Build Coastguard WorkerRemoved <b>TOYFLAG_LOCALE</b> and just set utf8 locale for all commands. 293*cf5a6c84SAndroid Build Coastguard WorkerThe dirtree code now sets <b>DIRTREE_SYMFOLLOW</b> in "again" when we followed 294*cf5a6c84SAndroid Build Coastguard Workera symlink to get to this node, callers checking <b>DIRTREE_COMEAGAIN</b> need 295*cf5a6c84SAndroid Build Coastguard Workerto mask out the bit they're interested in. 296*cf5a6c84SAndroid Build Coastguard WorkerImproved <b>scripts/probes/findglobals</b> output to be more legible.</p> 297*cf5a6c84SAndroid Build Coastguard Worker 298*cf5a6c84SAndroid Build Coastguard Worker<u>Test suite</u>: 299*cf5a6c84SAndroid Build Coastguard WorkerAdded <b>make test_help test_install</b> targets. (The standalone 300*cf5a6c84SAndroid Build Coastguard Workercommand targets conflict with the help/install make targets, but you 301*cf5a6c84SAndroid Build Coastguard Workercan still build them via scripts/single.sh and there's no reason not 302*cf5a6c84SAndroid Build Coastguard Workerto be able to individually test them.) 303*cf5a6c84SAndroid Build Coastguard WorkerNew <b>utf8locale</b> shell function attempts to enable a UTF8 locale for 304*cf5a6c84SAndroid Build Coastguard WorkerTEST_HOST, which was used to fix <b>wc.test</b>. 305*cf5a6c84SAndroid Build Coastguard WorkerColin Cross fixed <b>pidof.test</b> when stdout is a socket. 306*cf5a6c84SAndroid Build Coastguard WorkerSomething called "ecryptfs" has a maximum filename length of 143 bytes, 307*cf5a6c84SAndroid Build Coastguard Workerso our <b>tar.test</b> for long filenames support needs to be skipped there 308*cf5a6c84SAndroid Build Coastguard Workerbecause the filesystem can't handle it. Similarly, our <b>truncate.test</b> 309*cf5a6c84SAndroid Build Coastguard Workerwas failing because storing nothing on ecryptfs wasts more space than expected. 310*cf5a6c84SAndroid Build Coastguard WorkerThe <b>tar</b> tests now fetch user/group names with "stat" because 311*cf5a6c84SAndroid Build Coastguard Workerbetween Linux, Android, FreeBSD, and MacOS, there aren't really consistent 312*cf5a6c84SAndroid Build Coastguard Workeruser and group names for any existing files. Added nbd-client.test 313*cf5a6c84SAndroid Build Coastguard WorkerThiébaud Weksteen fixed the <b>getfattr</b>/<b>setfattr</b> tests on 314*cf5a6c84SAndroid Build Coastguard Workerfilesystems using selinux. Oliver Webb added <b>sha3sum</b> tests. 315*cf5a6c84SAndroid Build Coastguard WorkerElliott stabilized another slightly racy <b>ifconfig</b> test (big test 316*cf5a6c84SAndroid Build Coastguard Workerfarm, hits the weird corner cases).</p> 317*cf5a6c84SAndroid Build Coastguard Worker 318*cf5a6c84SAndroid Build Coastguard Worker<u>Build</u>: 319*cf5a6c84SAndroid Build Coastguard WorkerLots of changes to <b>scripts/make.sh</b> and friends to speed up and parallelize 320*cf5a6c84SAndroid Build Coastguard Workerheader generation. The build now figures out which toys/*/*.c files 321*cf5a6c84SAndroid Build Coastguard Workerto compile by searching for unindented USE() macros wrapping NEW(commandname), 322*cf5a6c84SAndroid Build Coastguard Workerwhich among other things fixes enabling the builtins when selecting just 323*cf5a6c84SAndroid Build Coastguard WorkerCONFIG_SH in menuconfig (instead of doing a "make sh" single command build). 324*cf5a6c84SAndroid Build Coastguard WorkerIt also probes for optional shared libraries in parallel. 325*cf5a6c84SAndroid Build Coastguard WorkerNew <b>scripts/probes</b> directory to collect scripts that aren't actually 326*cf5a6c84SAndroid Build Coastguard Workerused by the build, with a README in it. 327*cf5a6c84SAndroid Build Coastguard WorkerUpdated .gitignore so it doesn't complain about spurious name collisions in 328*cf5a6c84SAndroid Build Coastguard Workersubdirectories. Elliott shut up a 329*cf5a6c84SAndroid Build Coastguard Worker<a href=https://github.com/landley/toybox/commit/2c36636377e1>truly sad</a> 330*cf5a6c84SAndroid Build Coastguard Workerwarning where despite sizeof(ptrdiff_t) always being sizeof(long), gcc 331*cf5a6c84SAndroid Build Coastguard Workernevertheless warns if you printf("%ld", ptr-ptr) and wants a magic invented 332*cf5a6c84SAndroid Build Coastguard Worker"%td" type on 32 bit systems (but is just fine on 64 bit). (Or we could add a 333*cf5a6c84SAndroid Build Coastguard Workerliterally NOP typecast to long.) And silenced a spurious gcc 13.2 warning 334*cf5a6c84SAndroid Build Coastguard Workerin date.c. And Rob shut up <a href=https://github.com/landley/toybox/commit/a17fee778851>more broken gcc warnings</a>. 335*cf5a6c84SAndroid Build Coastguard WorkerUpdated .gitignore so it doesn't complain about spurious name collisions in 336*cf5a6c84SAndroid Build Coastguard Workersubdirectories.</p> 337*cf5a6c84SAndroid Build Coastguard Worker 338*cf5a6c84SAndroid Build Coastguard Worker<a name="30-07-2023" /><a href="#30-07-2023"><hr><h2><b>July 30, 2023</b></h2></a> 339*cf5a6c84SAndroid Build Coastguard Worker<blockquote> 340*cf5a6c84SAndroid Build Coastguard Worker<p>The way it functioned was very interesting. When the Drink button was 341*cf5a6c84SAndroid Build Coastguard Workerpressed it made an instant but highly detailed examination of the subject's 342*cf5a6c84SAndroid Build Coastguard Workertaste buds, a spectroscopic analysis of the subject's metabolism and then 343*cf5a6c84SAndroid Build Coastguard Workersent tiny experimental signals down the neural pathways to the taste centers 344*cf5a6c84SAndroid Build Coastguard Workerof the subject's brain to see what was likely to go down well. However, no 345*cf5a6c84SAndroid Build Coastguard Workerone knew quite why it did this because it invariably delivered a cupful of 346*cf5a6c84SAndroid Build Coastguard Workerliquid that was almost, but not quite, entirely unlike tea.</p> 347*cf5a6c84SAndroid Build Coastguard Worker<p>- The Hitchhiker's Guide to the Galaxy</p> 348*cf5a6c84SAndroid Build Coastguard Worker</blockquote> 349*cf5a6c84SAndroid Build Coastguard Worker 350*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.8.10.tar.gz>Toybox 0.8.10</a> 351*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.8.10>git commit</a>) 352*cf5a6c84SAndroid Build Coastguard Workeris out, with prebuilt <a href=downloads/binaries/0.8.10>static binaries</a> and 353*cf5a6c84SAndroid Build Coastguard Worker<a href=downloads/binaries/mkroot/0.8.10>mkroot images</a> 354*cf5a6c84SAndroid Build Coastguard Workerbootable under QEMU (built using a <a href=https://github.com/landley/linux/tree/mkroot-6.4>lightly patched</a> linux-6.4).</p> 355*cf5a6c84SAndroid Build Coastguard Worker 356*cf5a6c84SAndroid Build Coastguard Worker<p>New command <b>shuf</b>, and Elliott added <b>i2ctransfer</b>. 357*cf5a6c84SAndroid Build Coastguard WorkerFinished cleaning up <b>dd</b> a promoted it out of pending.</p> 358*cf5a6c84SAndroid Build Coastguard Worker 359*cf5a6c84SAndroid Build Coastguard Worker<p>Lots of changes to mkroot, <a href=http://landley.net/talks/mkroot-2023.txt>working</a> 360*cf5a6c84SAndroid Build Coastguard Workeron updated documentation but the release is already overdue...</p> 361*cf5a6c84SAndroid Build Coastguard Worker 362*cf5a6c84SAndroid Build Coastguard Worker<p><u>Features</u>: 363*cf5a6c84SAndroid Build Coastguard WorkerAdded a bunch of options to <b>tar</b> (-s --ignore-case --wildcards 364*cf5a6c84SAndroid Build Coastguard Worker--anchored --wildcards-match-slash --one-file-system), <b>ls --sort</b> 365*cf5a6c84SAndroid Build Coastguard Worker(which takes a comma separated list of fallback sorts, and new 366*cf5a6c84SAndroid Build Coastguard Workersort types to sort by extension, case insensitive, and directory first), 367*cf5a6c84SAndroid Build Coastguard Worker<b>cpio -R</b> to set user/group of all files and <b>cpio -L</b> to 368*cf5a6c84SAndroid Build Coastguard Workerfollow symlinks, <b>gzip -t</b> to test file integrity, <b>find -readable</b>, 369*cf5a6c84SAndroid Build Coastguard Worker<b>cut -DFR</b> now has --longopts aliases (as suggested by the coreutils list). 370*cf5a6c84SAndroid Build Coastguard WorkerTaught <b>blkid</b> to recognize iso (cdrom) image files, <b>oneit</b> now 371*cf5a6c84SAndroid Build Coastguard Workerautodetects console from sysfs with no -c argument, added "next address" 372*cf5a6c84SAndroid Build Coastguard Workersupport to <b>i2cget</b> and enforced bus limit, 373*cf5a6c84SAndroid Build Coastguard Workeradded posix 1x2x3 support to <b>dd</b> (with overflow detection, and 0x 374*cf5a6c84SAndroid Build Coastguard Workerat the start still means hexadecimal).</p> 375*cf5a6c84SAndroid Build Coastguard Worker 376*cf5a6c84SAndroid Build Coastguard Worker<p>Jarno Mäkipää taught <b>i2cget</b> to read without passing a command byte. 377*cf5a6c84SAndroid Build Coastguard WorkerElliott added <b>xxd -e</b> (little endian), <b>lspci -x</b> (hex dump of 378*cf5a6c84SAndroid Build Coastguard Workerpci config space), <b>ls --block-size</b>, widened the default 379*cf5a6c84SAndroid Build Coastguard WorkerVSIZE field width in Android's default <b>ps</b> display (they're up to 10 gigabytes of 380*cf5a6c84SAndroid Build Coastguard WorkerASLR padding for hello world), and increased the <b>vi</b>/<b>top</b> 381*cf5a6c84SAndroid Build Coastguard Workeroutput buffer size to reduce flicker redrawing the screen.</p> 382*cf5a6c84SAndroid Build Coastguard Worker 383*cf5a6c84SAndroid Build Coastguard Worker<p><u>Bugfixes</u>: 384*cf5a6c84SAndroid Build Coastguard WorkerTaught <b>switch_root</b> to move mountpoints into the new root. 385*cf5a6c84SAndroid Build Coastguard WorkerThe <b>head</b> command now uses lseek to restore unused data from seekable 386*cf5a6c84SAndroid Build Coastguard Workerinputs (tested with <b>read i; echo =$i; head -n 1; done < input</b>). 387*cf5a6c84SAndroid Build Coastguard WorkerIn <b>lspci</b> handle PCI bridges and don't show "revision 0". 388*cf5a6c84SAndroid Build Coastguard WorkerMissing /proc entries no longer cause <b>vmstat</b> errors, the output 389*cf5a6c84SAndroid Build Coastguard Workerfits into 80 columns more often, and adds reclaimable to the cached field. 390*cf5a6c84SAndroid Build Coastguard WorkerFix </b>help -u -au</b>, and the "see othercommand" generation. 391*cf5a6c84SAndroid Build Coastguard WorkerAdding fuzz support subtly broke <b>patch</b> in a couple places: fixed -R and 392*cf5a6c84SAndroid Build Coastguard Workermatching EOF. Trying to create a directory that already exists is no longer an 393*cf5a6c84SAndroid Build Coastguard Workererror for <b>cpio -i</b>, and <b>-d</b> just warns about directory creation 394*cf5a6c84SAndroid Build Coastguard Workerfailure instead of exiting. Adding <b>--wildcards</b> logic to <b>tar</b> 395*cf5a6c84SAndroid Build Coastguard Workerbroke the full string 396*cf5a6c84SAndroid Build Coastguard Workermatching (it checked after every / but not at the start of the string 397*cf5a6c84SAndroid Build Coastguard Workerwhen there weren't any), and <b>tar</b> now waits for the compression program 398*cf5a6c84SAndroid Build Coastguard Workerto exit and passes on any error result instead of killing it (which could 399*cf5a6c84SAndroid Build Coastguard Workertruncate output). Fixed more <b>realpath/readlink</b> corner cases, with tests. 400*cf5a6c84SAndroid Build Coastguard WorkerFix a <b>sed</b> bug when s//&/ (the copy-matched-text operator) was the 401*cf5a6c84SAndroid Build Coastguard Workerfirst change made to the string. Fix error message for <b>find</b> -commands 402*cf5a6c84SAndroid Build Coastguard Workerthat need an argument but were at the end of the command line (it said 403*cf5a6c84SAndroid Build Coastguard Worker"unknown command" instead of "command needs argument"). Fixed <b>killall5</b> 404*cf5a6c84SAndroid Build Coastguard Workerparsing of command names with spaces in them. Fixed <b>grep -m -A</b> used 405*cf5a6c84SAndroid Build Coastguard Workertogether (-m stops new matches but -A still shows lines after match). 406*cf5a6c84SAndroid Build Coastguard WorkerFixed <b>mv</b> to --preserve=all when copying between filesystems. 407*cf5a6c84SAndroid Build Coastguard WorkerMoved the EPIPE skip from perror_exit() to verror_msg() so we never 408*cf5a6c84SAndroid Build Coastguard Workeroutput a "hey, our output pipe unexpected closed!" error message when 409*cf5a6c84SAndroid Build Coastguard Workerwe're not the last command in a pipeline.</p> 410*cf5a6c84SAndroid Build Coastguard Worker 411*cf5a6c84SAndroid Build Coastguard Worker<p>Franke Busse reported that <b>bunzip2</b> was deleting its input file 412*cf5a6c84SAndroid Build Coastguard Workeron error, and <b>date -s +abc</b> was segfaulting. 413*cf5a6c84SAndroid Build Coastguard WorkerJooyung Han fixed <b>nsenter</b> using -C and -t together. 414*cf5a6c84SAndroid Build Coastguard WorkerMore fixes from Eric Roshan-Eisner's toysh fuzzing, and he also sent a fix 415*cf5a6c84SAndroid Build Coastguard Workerfor an error message in the <b>patch</b> command. 416*cf5a6c84SAndroid Build Coastguard WorkerElliott fixed stdin handling in <b>log</b> and <b>logger</b> to read a line at 417*cf5a6c84SAndroid Build Coastguard Workera time and log each one separately, fixed an off by one bounds check 418*cf5a6c84SAndroid Build Coastguard Workerin <b>readelf</b> (and factored out the bounds checking logic so it's 419*cf5a6c84SAndroid Build Coastguard Workercommon between sections, and improved the error messages), fixed 420*cf5a6c84SAndroid Build Coastguard Workera <b>gpiod</b> crash.</p> 421*cf5a6c84SAndroid Build Coastguard Worker 422*cf5a6c84SAndroid Build Coastguard Worker<p><u>Library</u>: 423*cf5a6c84SAndroid Build Coastguard WorkerImplemented DIRTREE_BREADTH to do breadth first processing of directories 424*cf5a6c84SAndroid Build Coastguard Worker(among other things, allowing entries to be sorted and processed in a 425*cf5a6c84SAndroid Build Coastguard Workerconsistent order). The dirtree plumbing now has macros for the mode bits 426*cf5a6c84SAndroid Build Coastguard Workerinstead of hardwired numbers, 427*cf5a6c84SAndroid Build Coastguard Workerbetter adler32 calculation in deflate.c, 428*cf5a6c84SAndroid Build Coastguard Workerand <b>fs_type_name()</b> can now convert most of the linux/magic.h constants 429*cf5a6c84SAndroid Build Coastguard Workerinto "mount -t TYPE" names.</p> 430*cf5a6c84SAndroid Build Coastguard Worker 431*cf5a6c84SAndroid Build Coastguard Worker<p><u>Mkroot</u>: 432*cf5a6c84SAndroid Build Coastguard WorkerMoved mkroot into its own directory: you now run <b>mkroot/mkroot.sh</b> instead 433*cf5a6c84SAndroid Build Coastguard Workerof scripts/mkroot.sh, and all the mkroot plumbing should be under there now. 434*cf5a6c84SAndroid Build Coastguard WorkerWhat was scripts/root is now <b>mkroot/packages</b>, and I added a "busybox" 435*cf5a6c84SAndroid Build Coastguard Workerpackage to download and build that (useful for testing command 436*cf5a6c84SAndroid Build Coastguard Workerimplementations side by side).</p> 437*cf5a6c84SAndroid Build Coastguard Worker 438*cf5a6c84SAndroid Build Coastguard Worker<p>Reorganized the contents of each root/$ARCH build directory so only 439*cf5a6c84SAndroid Build Coastguard Workerthe files necessary to run are at the top level, and everything else 440*cf5a6c84SAndroid Build Coastguard Worker(kernel configs) is in a docs/ subdirectory. Added linux-microconfig 441*cf5a6c84SAndroid Build Coastguard Workerwith the three CSV lines actually used by the build. 442*cf5a6c84SAndroid Build Coastguard WorkerNew <b>mkroot/tar-for-web.sh</b> script that generates tarballs for 443*cf5a6c84SAndroid Build Coastguard Workeruploading to the web page and adds two README files (one at the top level 444*cf5a6c84SAndroid Build Coastguard Workerand one to each tarball's docs directory). The generated tarballs don't 445*cf5a6c84SAndroid Build Coastguard Workercontain the fs/ dir, instead the README explains how to extract 446*cf5a6c84SAndroid Build Coastguard Workerand recreate the cpio.gz archive.</p> 447*cf5a6c84SAndroid Build Coastguard Worker 448*cf5a6c84SAndroid Build Coastguard Worker<p>Taught KCONF=value,value,value... CSV format to understand NAME=VALUE 449*cf5a6c84SAndroid Build Coastguard Workerentries, and merged most KERNEL_CONFIG lines into KCONF. 450*cf5a6c84SAndroid Build Coastguard Worker(Note that while it can handle NAME="this that" you need to escape it as 451*cf5a6c84SAndroid Build Coastguard WorkerNAME=\"this\ that\" to work right.) Added the legacy NLS 452*cf5a6c84SAndroid Build Coastguard Workerdependencies the VFAT driver needs (even though we selected UTF8) to the 453*cf5a6c84SAndroid Build Coastguard Workerbase config. The init script now tests if stdin is open via 454*cf5a6c84SAndroid Build Coastguard Worker"2>/dev/null <0 || blah" so only does the exec redirect for /dev/console 455*cf5a6c84SAndroid Build Coastguard Workerwhen necessary. 456*cf5a6c84SAndroid Build Coastguard WorkerFixed the .config checker to replace the toybox config when CONFIG_SH=y 457*cf5a6c84SAndroid Build Coastguard Workerisn't set, so "make defconfig; mkroot/mkroot.sh" should work now. 458*cf5a6c84SAndroid Build Coastguard WorkerSwitched initramfs packaging to use more portable <b>cpio -R 0:0</b> 459*cf5a6c84SAndroid Build Coastguard Workerinstead of --no-preserve-owner. Moved the -m 256 before $@ in run-qemu.sh 460*cf5a6c84SAndroid Build Coastguard Workerso setting memory size on the command line overrides the default. 461*cf5a6c84SAndroid Build Coastguard WorkerThe <b>mkroot/record-commands</b> setup script will now use logpath 462*cf5a6c84SAndroid Build Coastguard Workerout of the $PATH if it exists, rather than having to compile it each time. 463*cf5a6c84SAndroid Build Coastguard WorkerBo Svangård fixed a typo in the cpio command line that's ignored by toybox but 464*cf5a6c84SAndroid Build Coastguard Workerbreaks with the host tools.</p> 465*cf5a6c84SAndroid Build Coastguard Worker 466*cf5a6c84SAndroid Build Coastguard Worker<p><u>Pending</u>: 467*cf5a6c84SAndroid Build Coastguard WorkerMoritz Weber put in more work on <b>git</b> (still very unfinished). 468*cf5a6c84SAndroid Build Coastguard WorkerEli Lipsitz fixed bugs in init and login. Elliott added risc-v support 469*cf5a6c84SAndroid Build Coastguard Workerto strace, and fixed :w in vi (it didn't 470*cf5a6c84SAndroid Build Coastguard Workertakes a filename argument and would crash if you started with no filename) 471*cf5a6c84SAndroid Build Coastguard Workerand improved error reporting. Jarno Mäkipää taught vi about backspace 472*cf5a6c84SAndroid Build Coastguard Workerand improved empty file handling. Rob fixed vi -s. Various cleanups to 473*cf5a6c84SAndroid Build Coastguard Worker<b>tcpsvd</b>.</p> 474*cf5a6c84SAndroid Build Coastguard Worker 475*cf5a6c84SAndroid Build Coastguard Worker<p>More toysh work: command line option parsing stops at first nonoption argument, 476*cf5a6c84SAndroid Build Coastguard Workerall piped segments are now implicitly subshelled so variable 477*cf5a6c84SAndroid Build Coastguard Workerlifetimes match bash's and loops don't have to exit before proceedinng to the 478*cf5a6c84SAndroid Build Coastguard Workernext one (ala "while true; do echo hello; done | while read i; do echo $i; done" 479*cf5a6c84SAndroid Build Coastguard Workerhanging on a full output pipe). Several changes to HERE document processing 480*cf5a6c84SAndroid Build Coastguard Worker(variable expansions can cause line continuations in a HERE document, etc), 481*cf5a6c84SAndroid Build Coastguard Workerand better line continuation handling in general, added set -u, 482*cf5a6c84SAndroid Build Coastguard Workerfixed if/while return codes, wired up the "local" builtin, fixed an escape 483*cf5a6c84SAndroid Build Coastguard Workerpassthrough bug reported by Mingliang Hu, support undelimited redirects 484*cf5a6c84SAndroid Build Coastguard Worker(ala cat<file with no spaces), fixed ${X::} with no arguments.</p> 485*cf5a6c84SAndroid Build Coastguard Worker 486*cf5a6c84SAndroid Build Coastguard Worker<p><u>Cleanup</u>: 487*cf5a6c84SAndroid Build Coastguard WorkerConverted <b>chgrp</b> to FLAG() macros and did some minor cleanup on <b>bootchartd</b>, 488*cf5a6c84SAndroid Build Coastguard Worker(which needs tests), <b>basename</b>, <b>bzcat</b>, <b>test</b>, 489*cf5a6c84SAndroid Build Coastguard Worker<b>i2cdetect</b>. Elliott switched <b>flock</b> 490*cf5a6c84SAndroid Build Coastguard Workerto FLAG() macros, switched nohup to use octal permissions insted of macros, 491*cf5a6c84SAndroid Build Coastguard Workerwidened the default VSIZE field width in Android's default <b>ps</b> display 492*cf5a6c84SAndroid Build Coastguard Worker(which is now inserting 10 gigabytes of ASLR padding into "hello world"), and increased 493*cf5a6c84SAndroid Build Coastguard Workerthe vi/top output buffer size to reduce flicker redrawing the screen. Multiple cleanups to 494*cf5a6c84SAndroid Build Coastguard Worker<b>cpio</b>. Added requested --gratuitous-longopt synonyms to <b>ls</b>. 495*cf5a6c84SAndroid Build Coastguard WorkerConsistently capitalize TODO comments in the tree so they're easier to search for. 496*cf5a6c84SAndroid Build Coastguard WorkerSilence yet more perennial "warning: variable is never used uninitialized" gcc false 497*cf5a6c84SAndroid Build Coastguard Workerpositives.</p> 498*cf5a6c84SAndroid Build Coastguard Worker 499*cf5a6c84SAndroid Build Coastguard Worker<p><u>Portability</u>: 500*cf5a6c84SAndroid Build Coastguard Workerutf-8 support still isn't automatic in libc (you have to set an appropriate locale to 501*cf5a6c84SAndroid Build Coastguard Workerenable it), and locales aren't entirely standardized: try C.UTF-8 (which MacOS hasn't got) 502*cf5a6c84SAndroid Build Coastguard Workerand fall back to en_US.UTF-8 (which Gentoo hasn't got). 503*cf5a6c84SAndroid Build Coastguard WorkerRemoved itoa() from seq.c because cygwin pollutes the namespace with 504*cf5a6c84SAndroid Build Coastguard WorkerDOS debris.</p> 505*cf5a6c84SAndroid Build Coastguard Worker 506*cf5a6c84SAndroid Build Coastguard Worker<p>Dan Bryant renamed xrunread()'s "stdin" argument to "to_stdin" to work around 507*cf5a6c84SAndroid Build Coastguard Workerbroken headers that #define stdin as a macro instead of a global variable. 508*cf5a6c84SAndroid Build Coastguard WorkerElliott enabled copy_file_range() on Android.</p> 509*cf5a6c84SAndroid Build Coastguard Worker 510*cf5a6c84SAndroid Build Coastguard Worker<p><u>Documentation</u>: 511*cf5a6c84SAndroid Build Coastguard WorkerCalling <b>command --help</b> and <b>toybox --help command</b> shows 512*cf5a6c84SAndroid Build Coastguard Workerthe toybox URL banner, but "help command" doesn't. 513*cf5a6c84SAndroid Build Coastguard WorkerReorder the <b>find</b> help text so match filters that take an argument are mostly 514*cf5a6c84SAndroid Build Coastguard Workerin the left column. Minor help text tweaks in sleep, find, xxd, cpio. 515*cf5a6c84SAndroid Build Coastguard WorkerThe README now points to the same binary cross compilers as the FAQ. 516*cf5a6c84SAndroid Build Coastguard WorkerUpdate <b>sed</b> help text now that -e and -f get processed in command 517*cf5a6c84SAndroid Build Coastguard Workerline order when used together.</p> 518*cf5a6c84SAndroid Build Coastguard Worker 519*cf5a6c84SAndroid Build Coastguard Worker<p><u>Plumbing</u>: 520*cf5a6c84SAndroid Build Coastguard WorkerThe FLAG() macros now always return 1 or 0, so we can CONSTANT*FLAG(X) without needing 521*cf5a6c84SAndroid Build Coastguard Workera !! in there. The help plumbing now has HELP_FLAGS. 522*cf5a6c84SAndroid Build Coastguard WorkerEach command's option string in NEWTOY() may now use octal escapes with the 523*cf5a6c84SAndroid Build Coastguard Workerhigh bit set to use control characters as option flags, with the resulting 524*cf5a6c84SAndroid Build Coastguard WorkerFLAG_X## macro using the 2 digit hex value (without the high bit set). For 525*cf5a6c84SAndroid Build Coastguard Workerexample if you needed "command -:" then ":" is ascii 58 (hex 3A, 526*cf5a6c84SAndroid Build Coastguard Workertoybox's <b>ascii</b> command is useful for this), +128 is 186, which in octal 527*cf5a6c84SAndroid Build Coastguard Workerbecomes "\272" and tested with if (FLAG(X3A)) in the code.</p> 528*cf5a6c84SAndroid Build Coastguard Worker 529*cf5a6c84SAndroid Build Coastguard Worker<p><u>Test suite</u>: 530*cf5a6c84SAndroid Build Coastguard WorkerEach command.test now runs in an empty subdirectory, and working files like 531*cf5a6c84SAndroid Build Coastguard Workerexpected/actual go elsewhere (only "input" is created for you in there, and only 532*cf5a6c84SAndroid Build Coastguard Workerwhen you provide input in the current test's 4th argument), so the directory 533*cf5a6c84SAndroid Build Coastguard Workerlisting doesn't contain anything the test didn't put there. (This simplified 534*cf5a6c84SAndroid Build Coastguard Workerseveral tests.) 535*cf5a6c84SAndroid Build Coastguard WorkerThe realpath test broke on mksh (which doesn't export $PWD by default). 536*cf5a6c84SAndroid Build Coastguard WorkerElliott fixed the ifconfig tests on android. General tidying and adding 537*cf5a6c84SAndroid Build Coastguard Workertests to sed, ls, modinfo. The tar tests broke on github because it 538*cf5a6c84SAndroid Build Coastguard Workerswitched to a filesystem that can't do sparse files with 4k granularity, 539*cf5a6c84SAndroid Build Coastguard Workeradded a check to skip those tests (and also skip them on MacOS, which 540*cf5a6c84SAndroid Build Coastguard Workerfails for a different reason.) 541*cf5a6c84SAndroid Build Coastguard WorkerWhen a test's name field was blank (meaning the actual test command line 542*cf5a6c84SAndroid Build Coastguard Workershould be displayed as the name) the test plumbing was adding the command 543*cf5a6c84SAndroid Build Coastguard Workername to the display twice. 544*cf5a6c84SAndroid Build Coastguard WorkerThe <b>make tests</b> target now defaults to building toybox with ASAN when 545*cf5a6c84SAndroid Build Coastguard Workernot testing an existing binary. (You still have to specify ASAN=1 manually 546*cf5a6c84SAndroid Build Coastguard Workerfor individual command tests.)</p> 547*cf5a6c84SAndroid Build Coastguard Worker 548*cf5a6c84SAndroid Build Coastguard Worker<p>Fixed <b>demo_utf8towc</b> which had the range check backwards (0x10ffff is 549*cf5a6c84SAndroid Build Coastguard Workerthe biggest _output_, not input). The range check was an attempt to avoid 550*cf5a6c84SAndroid Build Coastguard Workerspending a long time going through all 4 billion entries, but wasn't testing 551*cf5a6c84SAndroid Build Coastguard Workereverything it needed to, so now it advances the counter with a bit shift 552*cf5a6c84SAndroid Build Coastguard Workerbased on the number of bytes consumed by the match (avoiding large swaths 553*cf5a6c84SAndroid Build Coastguard Workerof redundant checks but still theoretically testing all meaningfully different 554*cf5a6c84SAndroid Build Coastguard Worker4 byte inputs).</p> 555*cf5a6c84SAndroid Build Coastguard Worker 556*cf5a6c84SAndroid Build Coastguard Worker<p><u>Build</u>: 557*cf5a6c84SAndroid Build Coastguard WorkerFix return code of verbose mode in scripts/build.sh so <b>make V=1</b> succeeds. 558*cf5a6c84SAndroid Build Coastguard WorkerSpeed up the MacOS build: their gsed is slow to launch so avoid one repeated call in a 559*cf5a6c84SAndroid Build Coastguard Workerloop, and reimplement the wait $PID codepath because their bash is 17 years old. 560*cf5a6c84SAndroid Build Coastguard WorkerThe llvm+bionic toolchain warns about printf(" "+FLAG(m)) unless you add an 561*cf5a6c84SAndroid Build Coastguard Workerextra ,0 argument, but gcc+glibc warns if you DO add the extra argument... so 562*cf5a6c84SAndroid Build Coastguard WorkerI used the write() system call to avoid the compiler "helping" in a way I 563*cf5a6c84SAndroid Build Coastguard Workercan't make it STOP. Similarly, now that FLAG(u) is always 1 or 0, 564*cf5a6c84SAndroid Build Coastguard Worker<b>size = FLAG(u) ? : sizeof(toybuf)</b> 565*cf5a6c84SAndroid Build Coastguard Workeris either 1 or 4096, which is what I _want_, and the compiler warning about it 566*cf5a6c84SAndroid Build Coastguard Workeris counterproductive. LLVM needs a new -Wno-invalid-source-encoding flag 567*cf5a6c84SAndroid Build Coastguard Workeror else it complains about octal escapes in string constants. (When I want 568*cf5a6c84SAndroid Build Coastguard Workerto put utf-8 in there I can just do so, why would I octal escape it? 569*cf5a6c84SAndroid Build Coastguard WorkerStop "helping".)</p> 570*cf5a6c84SAndroid Build Coastguard Worker 571*cf5a6c84SAndroid Build Coastguard Worker<a name="10-01-2023" /><a href="#10-01-2023"><hr><h2><b>January 10, 2023</b></h2></a> 572*cf5a6c84SAndroid Build Coastguard Worker<blockquote> 573*cf5a6c84SAndroid Build Coastguard Worker<p>"Why," Arthur said, "is there a sofa in that field?"</br> 574*cf5a6c84SAndroid Build Coastguard Worker"I told you!" shouted Ford, leaping to his feet. "Eddies in the space-time 575*cf5a6c84SAndroid Build Coastguard Workercontinuum!"</br> 576*cf5a6c84SAndroid Build Coastguard Worker"And this is his sofa, is it?"</p> 577*cf5a6c84SAndroid Build Coastguard Worker<p>- The Hitchhiker's Guide to the Galaxy</p> 578*cf5a6c84SAndroid Build Coastguard Worker</blockquote> 579*cf5a6c84SAndroid Build Coastguard Worker 580*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.8.9.tar.gz>Toybox 0.8.9</a> 581*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.8.9>git commit</a>) 582*cf5a6c84SAndroid Build Coastguard Workeris out, with prebuilt <a href=downloads/binaries/0.8.9>static binaries</a> and 583*cf5a6c84SAndroid Build Coastguard Worker<a href=downloads/binaries/mkroot/0.8.9>mkroot images</a> 584*cf5a6c84SAndroid Build Coastguard Workerbootable under QEMU (built using a <a href=https://github.com/landley/linux/tree/mkroot-6.1>lightly patched</a> linux-6.1).</p> 585*cf5a6c84SAndroid Build Coastguard Worker 586*cf5a6c84SAndroid Build Coastguard Worker<p>The new <b>nbd-server</b> command interoperates with nbd-client to serve 587*cf5a6c84SAndroid Build Coastguard Workernetwork block devices (using the v1 protocol), and Moritz Weber contributed a read-only <b>git</b> 588*cf5a6c84SAndroid Build Coastguard Workerimplementation to pending.</p> 589*cf5a6c84SAndroid Build Coastguard Worker 590*cf5a6c84SAndroid Build Coastguard Worker<p><u>Features</u>: New <b>grep</b> fast path for fixed or simple patterns that 591*cf5a6c84SAndroid Build Coastguard Workerdon't need the full regex engine (I.E. "^", ".", "$" but not "*" or "[]") 592*cf5a6c84SAndroid Build Coastguard Workermost noticeable when searching for many patterns at once. 593*cf5a6c84SAndroid Build Coastguard WorkerImproved <b>tar --xform</b> support parsing flags= and trailing s/// scope 594*cf5a6c84SAndroid Build Coastguard Workerflags (but using --xform now requires toybox sed in the $PATH).</p> 595*cf5a6c84SAndroid Build Coastguard Worker 596*cf5a6c84SAndroid Build Coastguard Worker<p>Added <b>sort -C</b>, <b>lsusb -i</b>, <b>netcat -n</b>, 597*cf5a6c84SAndroid Build Coastguard Worker<b>swapoff -a -v</b>, <b>httpd -v</b>, <b>nbd-client -b</b>, 598*cf5a6c84SAndroid Build Coastguard Workera <b>uname -p</b> stub to mollify package builds, 599*cf5a6c84SAndroid Build Coastguard Worker<b>sleep</b> accepts multiple arguments, 600*cf5a6c84SAndroid Build Coastguard Worker<b>sed</b> now parses interlaced -e and -f arguments in order, 601*cf5a6c84SAndroid Build Coastguard Workerseveral new options in <b>readlink</b> and <b>realpath</b> (and better 602*cf5a6c84SAndroid Build Coastguard Workerhandling of relative paths), and UDP mode in netcat is more useful now: 603*cf5a6c84SAndroid Build Coastguard Worker<b>netcat -u -s 127.0.0.1 -p 9876 -l</b> can type at <b>netcat -u 127.0.0.1 9876</b> 604*cf5a6c84SAndroid Build Coastguard Workerin both directions. (Figuring out when the other side hangs up is an unsolved 605*cf5a6c84SAndroid Build Coastguard Workerproblem, but that's UDP for you.) 606*cf5a6c84SAndroid Build Coastguard WorkerElliott added <b>ls -N</b>.</p> 607*cf5a6c84SAndroid Build Coastguard Worker 608*cf5a6c84SAndroid Build Coastguard Worker<p><u>Bugfixes</u>: Fixed off by one error in <b>sort -c</b> output, 609*cf5a6c84SAndroid Build Coastguard Workerfixed <b>sed -z</b> and other sed cases where Linux has never obeyed 610*cf5a6c84SAndroid Build Coastguard WorkerPosix (N at EOF does a default print, l escapes \n), 611*cf5a6c84SAndroid Build Coastguard Worker<b>patch --dry-run</b> should no longer create or delete files, 612*cf5a6c84SAndroid Build Coastguard Worker<b>gzip</b>/<b>zcat</b> couldn't handle concatenated archives, 613*cf5a6c84SAndroid Build Coastguard Workerthe ./configure of gmake 4.3 depends on <b>test</b> treating one argument -a as a synonym for -e, 614*cf5a6c84SAndroid Build Coastguard Workerautodetectiong compression types in <b>tar</b> should be more reliable now 615*cf5a6c84SAndroid Build Coastguard Workerand sanitize weird path corner cases (like .. past /) better, 616*cf5a6c84SAndroid Build Coastguard Worker<b>scripts/make.sh</b> (and thus "make toybox") should no longer truncate log 617*cf5a6c84SAndroid Build Coastguard Workerfiles stderr is redirected to, 618*cf5a6c84SAndroid Build Coastguard Worker<b>httpd</b> now handles ? and # in URLs, 619*cf5a6c84SAndroid Build Coastguard Worker<b>xxd</b> disables columns for -c 0 and groups for -g 0 (so you can get 620*cf5a6c84SAndroid Build Coastguard Workera long interrupted string of hex digits out of it), two fixes to 621*cf5a6c84SAndroid Build Coastguard Worker<b>mountpoint</b> (the conversion to same_file() was inappropriate because 622*cf5a6c84SAndroid Build Coastguard Workerthe logic isn't quite the same, and -q should also quiet "not found" errors), 623*cf5a6c84SAndroid Build Coastguard Workerfixed <b>httpd</b> not always displaying index.html files instead of directory 624*cf5a6c84SAndroid Build Coastguard Workercontents, fixed <b>comm -</b> not recognizing it as stdin, and multiple fixes to 625*cf5a6c84SAndroid Build Coastguard Worker<b>timeout</b> which now kills process group and thus child processes, 626*cf5a6c84SAndroid Build Coastguard Workerisn't suspended by SIGTTIN, and recursive commands it calls don't 627*cf5a6c84SAndroid Build Coastguard Workerinherit an inappropriate SIGCHLD handler.</p> 628*cf5a6c84SAndroid Build Coastguard Worker 629*cf5a6c84SAndroid Build Coastguard Worker<p>Yi-Yo Chiang fixed loopback <b>mount</b> (the recent switch to xrunread() 630*cf5a6c84SAndroid Build Coastguard Workerkept the newline from losetup's output) and added <b>tail +123</b> 631*cf5a6c84SAndroid Build Coastguard Worker(old-style synonym for tail -n +123). 632*cf5a6c84SAndroid Build Coastguard WorkerDaniel Mentz added scmversion to the <b>modinfo</b> tag list (Android uses 633*cf5a6c84SAndroid Build Coastguard Workerit for external modules). Alexander Holler fixed <b>su</b> to not require 634*cf5a6c84SAndroid Build Coastguard Worker/etc/shadow when run as root, and nomas2000 reported an inverted test in 635*cf5a6c84SAndroid Build Coastguard Worker<b>date</b>'s check for trailing rubbish. Daniel Mentz fixed an off by 636*cf5a6c84SAndroid Build Coastguard Workerone in <b>grep -f</b> that discarded the last character of the pattern file's 637*cf5a6c84SAndroid Build Coastguard Workercontents. Kelvin Zhang made <b>modinfo</b> better at handling symlinks. 638*cf5a6c84SAndroid Build Coastguard WorkerAntoni Villalonga fixed <b>fmt</b> on 64 bit big endian systems (like s390x and 639*cf5a6c84SAndroid Build Coastguard Workerpowerpc). Li Cheng fixed <b>mount</b>'s type detection not autodetecting 640*cf5a6c84SAndroid Build Coastguard Workerthe need to bind mount files when type "none" was specified in fstab. 641*cf5a6c84SAndroid Build Coastguard WorkerTomasz Sterna reported that <b>modprobe</b> resolving dependencies shouldn't 642*cf5a6c84SAndroid Build Coastguard Workerfeed a NULL pointer to the syscall's options arguments (the kernel goes -EWTF), 643*cf5a6c84SAndroid Build Coastguard Workerand Vincent Donnefort made modprobe work when /proc/modules isn't available.</p> 644*cf5a6c84SAndroid Build Coastguard Worker 645*cf5a6c84SAndroid Build Coastguard Worker<p><u>Library</u>: 646*cf5a6c84SAndroid Build Coastguard WorkerThe TOYFLAG_ARGFAIL() exit value is now the default <b>error_msg()</b> sets, 647*cf5a6c84SAndroid Build Coastguard Worker<b>sendfile()</b> now falls back to the read/write loop for any error (not just 648*cf5a6c84SAndroid Build Coastguard WorkerEINVAL, the kernel sends ENOSYS and EXDEV and who knows what else), 649*cf5a6c84SAndroid Build Coastguard Worker<b>xgetrandom()</b> can now return arbitrary amounts of data (looping internally 650*cf5a6c84SAndroid Build Coastguard Workeras necessary), 651*cf5a6c84SAndroid Build Coastguard Worker<b>xwaitpid()</b> returns status 127 for cases (like bad PID) which don't 652*cf5a6c84SAndroid Build Coastguard Workerreturn a status for the PID, 653*cf5a6c84SAndroid Build Coastguard Workerseveral fixes to <b>xabspath()</b> as part of the readlink/realpath work, 654*cf5a6c84SAndroid Build Coastguard Workernew <b>octal_deslash()</b> to remove octal escapes common in kernel strings 655*cf5a6c84SAndroid Build Coastguard Worker(ala /proc/mounts), 656*cf5a6c84SAndroid Build Coastguard Workerthe <b>FLAG_x</b> macros always use a 64 bit type now (so you don't have to 657*cf5a6c84SAndroid Build Coastguard Workerworry about toys.optflags &= ~FLAG_x; blanking the top 32 bits), 658*cf5a6c84SAndroid Build Coastguard Workerreplaced memcmp() with new library function <b>smemcmp()</b> to placate ASAN 659*cf5a6c84SAndroid Build Coastguard Workerwhen returning first difference in known differing arguments of unequal length. 660*cf5a6c84SAndroid Build Coastguard WorkerElliott added three more filesystem types to <b>fs_type_name()</b> which is 661*cf5a6c84SAndroid Build Coastguard Workerused by <b>stat -f</b> and friends.</p> 662*cf5a6c84SAndroid Build Coastguard Worker 663*cf5a6c84SAndroid Build Coastguard Worker<p><u>Mkroot</u>: 664*cf5a6c84SAndroid Build Coastguard WorkerNew <b>scripts/test_mkroot.sh</b> runs each target under qemu to confirm 665*cf5a6c84SAndroid Build Coastguard Worker1) it boots, 2) the block device works, 3) networking works, and 4) the clock is set 666*cf5a6c84SAndroid Build Coastguard Workerreasonably. It runs them in parallel, with an httpd instance on the host to 667*cf5a6c84SAndroid Build Coastguard Workerfetch a file from, and a timeout to detect hangs. 668*cf5a6c84SAndroid Build Coastguard WorkerNew <b>scripts/root/overlay</b> package copies $OVERLAY directory into 669*cf5a6c84SAndroid Build Coastguard Workertarget filesystem, ala <b>scripts/mkroot.sh overlay OVERLAY=$PWD/blah</b> 670*cf5a6c84SAndroid Build Coastguard WorkerThe init script now mounts any /dev/?da on /mnt and when /mnt/init exists 671*cf5a6c84SAndroid Build Coastguard Workersets $HANDOFF to that instead of running a shell prompt, so you can provide 672*cf5a6c84SAndroid Build Coastguard Workerautomated control images that run code in the emulator automatically. (The 673*cf5a6c84SAndroid Build Coastguard Workeremulator process still when whatever $HANDOFF called exits.)</p> 674*cf5a6c84SAndroid Build Coastguard Worker 675*cf5a6c84SAndroid Build Coastguard Worker<p>Some kernel changes finally made it upstream so we can drop workarounds 676*cf5a6c84SAndroid Build Coastguard Workerfor them, such as kernel commit 677*cf5a6c84SAndroid Build Coastguard Worker<a href=https://github.com/torvalds/linux/commit/f8f0d06438e5>f8f0d06438e5</a> 678*cf5a6c84SAndroid Build Coastguard Workerfixing the <a href=https://landley.net/notes-2014.html#13-08-2014>longstanding</a> 679*cf5a6c84SAndroid Build Coastguard Worker"allnoconfig has =y" issue so miniconfig doesn't need to add a magic #comment 680*cf5a6c84SAndroid Build Coastguard Workerline forcing a symbol OFF anymore. The remaining kernel patches (including 681*cf5a6c84SAndroid Build Coastguard Workerseveral maintained locally but hadn't merged into mkroot) moved to a 682*cf5a6c84SAndroid Build Coastguard Worker<a href=https://github.com/landley/linux/tree/mkroot-6.1>seperate repository</a> 683*cf5a6c84SAndroid Build Coastguard Workerso mkroot.sh doesn't have to call sed on the build snapshot. (They're are also 684*cf5a6c84SAndroid Build Coastguard Workerincluded in the mkroot binary release directory, and were all submitted to lkml 685*cf5a6c84SAndroid Build Coastguard Workermonths if not years ago.)</p> 686*cf5a6c84SAndroid Build Coastguard Worker 687*cf5a6c84SAndroid Build Coastguard Worker<p>The host airlock setup (creating the temporary restricted environment 688*cf5a6c84SAndroid Build Coastguard Workermkroot builds packages in both so they don't pick up strange dependencies from 689*cf5a6c84SAndroid Build Coastguard Workerthe host, and to prove the build can use the toybox commands) 690*cf5a6c84SAndroid Build Coastguard Workerremoved a bunch of commands (dd, diff, vi, xzcat, ar, nm) no longer 691*cf5a6c84SAndroid Build Coastguard Workerneeded by the linux-6.1 build. The kernel patches also remove the need 692*cf5a6c84SAndroid Build Coastguard Workerfor gcc (it can use the "cc" symlink all modern distros install, and 693*cf5a6c84SAndroid Build Coastguard Workerautodetects whether that points to gcc or clang) and bc (which is just 694*cf5a6c84SAndroid Build Coastguard Worker<a href=https://landley.net/notes-2013.html#18-05-2013>generally obsolete</a>). 695*cf5a6c84SAndroid Build Coastguard WorkerLeft those two in for one more release, but NEXT time building a vanilla 696*cf5a6c84SAndroid Build Coastguard Workerkernel without the <a href=https://landley.net/toybox/downloads/binaries/mkroot/0.8.9/linux-patches/0001-try-generic-compiler-name-cc-before-falling-back-to-.patch>gcc removal patch</a> 697*cf5a6c84SAndroid Build Coastguard Workerand <a href=https://landley.net/toybox/downloads/binaries/mkroot/0.8.9/linux-patches/0004-Replace-timeconst.bc-with-mktimeconst.c.patch>bc removal patch</a> 698*cf5a6c84SAndroid Build Coastguard Workermay require you to add <b>HOST_EXTRA="gcc bc"</b> to the mkroot command line 699*cf5a6c84SAndroid Build Coastguard Workerfor the airlock build to add extra symlinks to root/build/airlock.</p> 700*cf5a6c84SAndroid Build Coastguard Worker 701*cf5a6c84SAndroid Build Coastguard Worker<p>Added a kernel build for powerpc64 big endian, 702*cf5a6c84SAndroid Build Coastguard Workerm68k and powerpc now support "run-qemu.sh -hda file.img", and m68k only 703*cf5a6c84SAndroid Build Coastguard Workerhas one /dev/?db (disabled Apple Desktop Bus in the config). 704*cf5a6c84SAndroid Build Coastguard WorkerAdded basic module support (the kernel build saves modules in modules.cpio.gz 705*cf5a6c84SAndroid Build Coastguard Workerso it can extract them when you rebuild the root filesystem but not the kernel) 706*cf5a6c84SAndroid Build Coastguard Workerand added <b>scripts/root/tests</b> which (among other things) builds two 707*cf5a6c84SAndroid Build Coastguard Workerinnocuous modules that depend on each other (fscache and cachefiles) for 708*cf5a6c84SAndroid Build Coastguard Workermodprobe/insmod testing that hopefully won't break anything else. (If 709*cf5a6c84SAndroid Build Coastguard Workerthere was a scripts/root/pending/ tests would be in it: it does not actually 710*cf5a6c84SAndroid Build Coastguard Workerrun the test suite under mkroot yet, because toysh needs work.)</p> 711*cf5a6c84SAndroid Build Coastguard Worker 712*cf5a6c84SAndroid Build Coastguard Worker<p><u>Pending</u>: Elliott made <b>strace</b> build on 32-bit x86. 713*cf5a6c84SAndroid Build Coastguard WorkerJames Farrell added <b>diff -f</b>. 714*cf5a6c84SAndroid Build Coastguard WorkerAlexander Holler fixed two parameter substitution bugs in <b>toysh</b>. 715*cf5a6c84SAndroid Build Coastguard WorkerRob fixed assignment suppression, && and || parsing, math 716*cf5a6c84SAndroid Build Coastguard Workerpriority, a number of ASAN test failures, untangled and commented the 717*cf5a6c84SAndroid Build Coastguard Workerbrace expansion logic, and other ongoing shell work.</p> 718*cf5a6c84SAndroid Build Coastguard Worker 719*cf5a6c84SAndroid Build Coastguard Worker<p>A large rewrite of diff happened but couldn't be checked in unfinished 720*cf5a6c84SAndroid Build Coastguard Workerbecause if people are using stuff out of pending, how do you do a pending for 721*cf5a6c84SAndroid Build Coastguard Workerpending? (Meta-pending?)</p> 722*cf5a6c84SAndroid Build Coastguard Worker 723*cf5a6c84SAndroid Build Coastguard Worker<p><u>Cleanup</u>: 724*cf5a6c84SAndroid Build Coastguard Worker<b>cksum</b>, <b>od</b>, <b>file</b>, <b>getopt</b>, <b>gpiod</b>, 725*cf5a6c84SAndroid Build Coastguard Worker<b>nbd-client</b>, better output messages for <b>host</b>, 726*cf5a6c84SAndroid Build Coastguard Workerand make <b>base64</b> use line buffering. 727*cf5a6c84SAndroid Build Coastguard WorkerMoved -Wno-string-plus-int into portability.sh and had it only apply to 728*cf5a6c84SAndroid Build Coastguard Workerclang. Moved num_cache() out of lib into netstat (its only user).</p> 729*cf5a6c84SAndroid Build Coastguard Worker 730*cf5a6c84SAndroid Build Coastguard Worker<p>In the test suite plumbing, $SKIPNEXT was replaced by <b>$SKIP</b> holding 731*cf5a6c84SAndroid Build Coastguard Workera count that counts down with each test (so you can easily skip a block of 732*cf5a6c84SAndroid Build Coastguard Workertests). Fixed <b>txpect</b> to actually listen to error code (oops) and to not 733*cf5a6c84SAndroid Build Coastguard Workercomplain about multiple X. The old dochroot() and mkchroot() shell functions were removed from 734*cf5a6c84SAndroid Build Coastguard Workerscripts/runtest.sh because they required root access to use (which mkroot 735*cf5a6c84SAndroid Build Coastguard Workerdoes not). More conversion to use <b>testcmd</b> in individual command.tests 736*cf5a6c84SAndroid Build Coastguard Worker(both to remove workarounds for shell builtins, and to be more concise). 737*cf5a6c84SAndroid Build Coastguard WorkerRemove redundant cleanup from several tests (which run as proper child processes 738*cf5a6c84SAndroid Build Coastguard Workernow, and the work directory is deleted and recreated between each, so 739*cf5a6c84SAndroid Build Coastguard Workerindividual tests need less cleanup).</p> 740*cf5a6c84SAndroid Build Coastguard Worker 741*cf5a6c84SAndroid Build Coastguard Worker<p><u>Portability</u>: More tests now pass on MacOS and FreeBSD 742*cf5a6c84SAndroid Build Coastguard Worker(weird filesystems, root vs wheel group name, dealing with headers that 743*cf5a6c84SAndroid Build Coastguard Workerdefine stdin as a macro and don't define PATH_MAX, the ancient bash in MacOS 744*cf5a6c84SAndroid Build Coastguard Workerdoesn't understand &>>, won't let normal users use "chmod +s", 745*cf5a6c84SAndroid Build Coastguard Workersymlinks don't have all permission bits set, no O_PATH and the Linux definition 746*cf5a6c84SAndroid Build Coastguard Workeris used for something else, and so on), at least half of which Elliott did. 747*cf5a6c84SAndroid Build Coastguard WorkerNot sure we've quite got Mac and BSD 748*cf5a6c84SAndroid Build Coastguard Workerdoing "gmake test_singlecommand" right yet, but it's a lot closer. 749*cf5a6c84SAndroid Build Coastguard WorkerAdded all the commands to <b>make bsd_defconfig</b> that compile on FreeBSD 13 750*cf5a6c84SAndroid Build Coastguard Worker(which is no guarantee they WORK). 751*cf5a6c84SAndroid Build Coastguard WorkerASAN=1 should work in more places now, including <b>make_test_command</b>. 752*cf5a6c84SAndroid Build Coastguard WorkerThe build uses $CC insted of cc in more places, and doesn't apply $ASAN 753*cf5a6c84SAndroid Build Coastguard Workerfor $HOSTCC (the legacy kconfig/ directory stands no chance).</p> 754*cf5a6c84SAndroid Build Coastguard Worker 755*cf5a6c84SAndroid Build Coastguard WorkerFedora inexplicably sticks \x09 style hex escapes into the dmesg output and 756*cf5a6c84SAndroid Build Coastguard Workerexpects them to be parsed. 757*cf5a6c84SAndroid Build Coastguard WorkerAndroid is still running the test suite under mksh which doesn't 758*cf5a6c84SAndroid Build Coastguard Workerunderstand bashisms like <(command). LLVM insisted that "ptr - 1" could 759*cf5a6c84SAndroid Build Coastguard Workernever be NULL (demonstrably untrue) and needed some (unsigned long) typecasts 760*cf5a6c84SAndroid Build Coastguard Workerto force it to actually do the math. 761*cf5a6c84SAndroid Build Coastguard WorkerKhem Raj aliased timer_settime to timer_settime64 when the first isn't 762*cf5a6c84SAndroid Build Coastguard Workeravailable. Antoni Villalonga debianized some install paths and added 763*cf5a6c84SAndroid Build Coastguard Workera bunch of --longopt synonyms for existing options that package builds 764*cf5a6c84SAndroid Build Coastguard Workeruse.</p> 765*cf5a6c84SAndroid Build Coastguard Worker 766*cf5a6c84SAndroid Build Coastguard Worker<p><u>Documentation</u>: The <a href=help.html>help page</a> 767*cf5a6c84SAndroid Build Coastguard Workergeneration logic (toybox help -av) now filter out invisible aliases and 768*cf5a6c84SAndroid Build Coastguard Workeroutputs "See command" for visible aliases, plus fixes for broken corner 769*cf5a6c84SAndroid Build Coastguard Workercases like <b>nohup --help</b>. 770*cf5a6c84SAndroid Build Coastguard WorkerThe <a href=https://landley.net/toybox/git>local git repo</a> 771*cf5a6c84SAndroid Build Coastguard Workernow has a simple index.html generated by a 772*cf5a6c84SAndroid Build Coastguard Worker<a href=https://github.com/landley/toybox/blob/0.8.9/scripts/git-static-index.sh>small shell script</a>, 773*cf5a6c84SAndroid Build Coastguard Workerlinking to the <b>git format-patch</b> files for 774*cf5a6c84SAndroid Build Coastguard Workereach commit, applicable via <b>git am</b>.</p> 775*cf5a6c84SAndroid Build Coastguard Worker 776*cf5a6c84SAndroid Build Coastguard Worker<p>There was a 777*cf5a6c84SAndroid Build Coastguard Worker<a href=https://github.com/landley/toybox/pull/244>bug report</a> that specifying the cross compiler prefix twice 778*cf5a6c84SAndroid Build Coastguard Workerincludes the prefix twice (ala CROSS_COMPILE=prefix- CC=prefix-cc results in 779*cf5a6c84SAndroid Build Coastguard Workerprefix-prefix-cc) which is what happens when you ask it to do that, yes. It's now 780*cf5a6c84SAndroid Build Coastguard Worker<a href=faq.html#cross>better documented</a>. (See also 781*cf5a6c84SAndroid Build Coastguard Worker<a href=https://lkml.iu.edu/hypermail/linux/kernel/2202.0/01505.html>this kernel patch</a>.)</p> 782*cf5a6c84SAndroid Build Coastguard Worker 783*cf5a6c84SAndroid Build Coastguard Worker<p>Yi-Yo Chiang's losetup fix spawned an email thread where the 784*cf5a6c84SAndroid Build Coastguard Workerandroid developers <a href=http://lists.landley.net/pipermail/toybox-landley.net/2022-August/029139.html>explained</a> why Android doesn't (and can't) 785*cf5a6c84SAndroid Build Coastguard Workeruse devtmpfs. Rob forwarded a link to linux weekly news to see if he could get 786*cf5a6c84SAndroid Build Coastguard Workerany attention from the kernel guys, but they didn't reply.</p> 787*cf5a6c84SAndroid Build Coastguard Worker 788*cf5a6c84SAndroid Build Coastguard Worker<a name="12-08-2022" /><a href="#12-08-2022"><hr><h2><b>August 12, 2022</b></h2></a> 789*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p> 790*cf5a6c84SAndroid Build Coastguard WorkerHuge as office blocks, silent as birds. They hung in the air exactly the same 791*cf5a6c84SAndroid Build Coastguard Workerway that bricks don't.</p> 792*cf5a6c84SAndroid Build Coastguard Worker<p>- The Hitchhiker's Guide to the Galaxy</p> 793*cf5a6c84SAndroid Build Coastguard Worker</p></blockquote> 794*cf5a6c84SAndroid Build Coastguard Worker 795*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.8.8.tar.gz>Toybox 0.8.8</a> 796*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.8.8>git commit</a>) 797*cf5a6c84SAndroid Build Coastguard Workeris out, with prebuilt <a href=downloads/binaries/0.8.8>static binaries</a> and 798*cf5a6c84SAndroid Build Coastguard Worker<a href=downloads/binaries/mkroot/0.8.8>mkroot images</a> 799*cf5a6c84SAndroid Build Coastguard Workerbootable under QEMU (built using vanilla linux-5.19).</p> 800*cf5a6c84SAndroid Build Coastguard Worker 801*cf5a6c84SAndroid Build Coastguard Worker<p>No new or promoted commands this time. (Time based releases mean NOT 802*cf5a6c84SAndroid Build Coastguard Workerholding the release to wait for things like that.)</p> 803*cf5a6c84SAndroid Build Coastguard Worker 804*cf5a6c84SAndroid Build Coastguard Worker<p>Thanks to Google for sponsoring the project's maintainer to focus on toybox 805*cf5a6c84SAndroid Build Coastguard Workerfor a while. (They want a hermetic build, I want Android to build under 806*cf5a6c84SAndroid Build Coastguard WorkerAndroid. Working on it...)</p> 807*cf5a6c84SAndroid Build Coastguard Worker 808*cf5a6c84SAndroid Build Coastguard Worker<p><u>Features</u>: 809*cf5a6c84SAndroid Build Coastguard WorkerThe new <b>timeout -i</b> option kills a command for inactivity (output 810*cf5a6c84SAndroid Build Coastguard Workerto stdout resets the timer). 811*cf5a6c84SAndroid Build Coastguard WorkerBasic support for <b>tar --xform</b> (but not yet the special tar-only s///x 812*cf5a6c84SAndroid Build Coastguard Workeroptions). 813*cf5a6c84SAndroid Build Coastguard Worker--long options now support unambigous abbrevations by default, so you can 814*cf5a6c84SAndroid Build Coastguard Workergo "ls --col" and it'll figure out you mean --color. 815*cf5a6c84SAndroid Build Coastguard WorkerAdded <b>blkid -o</b> understanding "full", "value", and "export" output 816*cf5a6c84SAndroid Build Coastguard Workerformats. Added <b>nsenter -C</b> (cgroup namespace) and <b>-a</b> (enable all 817*cf5a6c84SAndroid Build Coastguard Workersupported namespaces). 818*cf5a6c84SAndroid Build Coastguard WorkerAdded <b>mount -R</b> and switched the bind mount default to be recursive 819*cf5a6c84SAndroid Build Coastguard Worker(it still autodetects --bind and --loop mounts based on the source/target type, 820*cf5a6c84SAndroid Build Coastguard Workerall --bind or --rbind do is switch the recursive flag on and off).</p> 821*cf5a6c84SAndroid Build Coastguard Worker 822*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott implemented <b>tar --null</b>, 823*cf5a6c84SAndroid Build Coastguard Workerand taught <b>file</b> to recognize some Linux kernel images, and 824*cf5a6c84SAndroid Build Coastguard Workerbinaries for Linux's <a href=https://github.com/torvalds/linux/commit/fa96b57c1490>newly merged</a> 825*cf5a6c84SAndroid Build Coastguard Workerarch/loongarch (a <a href=https://linleygroup.com/newsletters/newsletter_detail.php?num=4623>mips64 variant</a> 826*cf5a6c84SAndroid Build Coastguard Workerfrom <a href=https://phoronix.com/news/LoongArch-MIPS-Copy-Kernel>china</a>).</p> 827*cf5a6c84SAndroid Build Coastguard Worker 828*cf5a6c84SAndroid Build Coastguard Worker<p><u>Bugfixes</u>: 829*cf5a6c84SAndroid Build Coastguard WorkerSeveral cleanups to taskset, mostly due to reviewing it before making 830*cf5a6c84SAndroid Build Coastguard Workeran explainer video, but the review found an inappropriate use of 831*cf5a6c84SAndroid Build Coastguard WorkerTOYFLAG_STAYROOT that got fixed. 832*cf5a6c84SAndroid Build Coastguard WorkerArgument parsing for <b>unshare</b> and <b>nsenter</b> should now match 833*cf5a6c84SAndroid Build Coastguard Workerdebian's (I.E. "unshare -npu" works the same as "unshare -n -p -u" not 834*cf5a6c84SAndroid Build Coastguard Worker"unshare --net=pu"). 835*cf5a6c84SAndroid Build Coastguard Worker<b>kill 1</b> no longer says "unknown pid 1: not permitted" (it 836*cf5a6c84SAndroid Build Coastguard Workersays "bad pid" like everywhere else). 837*cf5a6c84SAndroid Build Coastguard Worker<b>test -x</b> and friends now test live access, not permission bits. 838*cf5a6c84SAndroid Build Coastguard Worker(Root ignores a lot of permissions, chmod u-x blocks you from executing your 839*cf5a6c84SAndroid Build Coastguard Workerown file even if g+x and o+x should let you access it, things like selinux can 840*cf5a6c84SAndroid Build Coastguard Workerfurther break the unix permission model, etc). 841*cf5a6c84SAndroid Build Coastguard Worker 842*cf5a6c84SAndroid Build Coastguard Worker<p>In lib/ a fencepost error in <b>chomp()</b> could read one byte past the start of the string, and 843*cf5a6c84SAndroid Build Coastguard Worker<b>xpclose_both()</b> no longer closes the parent's stdin and stdout 844*cf5a6c84SAndroid Build Coastguard Workerwhen they're explicitly passed through to the child. 845*cf5a6c84SAndroid Build Coastguard WorkerIn scripts/runtest.sh, moving tests into subshells broke failure reporting with VERBOSE=all. 846*cf5a6c84SAndroid Build Coastguard WorkerWhile "make install" was creating directories when $PREFIX pointed to a 847*cf5a6c84SAndroid Build Coastguard Workernonexistent directory, "make toybox" didn't even though it tried to place the 848*cf5a6c84SAndroid Build Coastguard Workeroutput file there.</p> 849*cf5a6c84SAndroid Build Coastguard Worker 850*cf5a6c84SAndroid Build Coastguard Worker<p>James Farrell switched the test suite from detecting root via $UID to 851*cf5a6c84SAndroid Build Coastguard Worker$(id -u). (It's not a security issue, this just controls which tests we attempt. 852*cf5a6c84SAndroid Build Coastguard WorkerIt's another workaround for missing features in mksh.) 853*cf5a6c84SAndroid Build Coastguard WorkerTaolaw spotted that httpd could segfault when xabspath() returns NULL 854*cf5a6c84SAndroid Build Coastguard Worker(for error conditions such as infinitely looping symlinks 855*cf5a6c84SAndroid Build Coastguard Workeror "." not resolving when the current directory was deleted).</p> 856*cf5a6c84SAndroid Build Coastguard Worker 857*cf5a6c84SAndroid Build Coastguard Worker<p><u>Documentation</u>: 858*cf5a6c84SAndroid Build Coastguard WorkerWe <a href=design.html>recorded</a> the 859*cf5a6c84SAndroid Build Coastguard Workermove from C99 to the C11 standard, which was actually made a while ago: 860*cf5a6c84SAndroid Build Coastguard Workerthe typecast constants we've 861*cf5a6c84SAndroid Build Coastguard Workerbeen using for a while are a 2011 feature not available in the 1999 edition 862*cf5a6c84SAndroid Build Coastguard Workerof the C standard. (This came up when we had to move to C11's "_Noreturn" to work around a compiler bug in llvm. 863*cf5a6c84SAndroid Build Coastguard WorkerYes __attribute__((__noreturn__)) should be identical, that's the bug part.)</p> 864*cf5a6c84SAndroid Build Coastguard Worker 865*cf5a6c84SAndroid Build Coastguard Worker<p>The website's nav bar got updated (among other things, linking to 866*cf5a6c84SAndroid Build Coastguard Workerour <a href=https://www.youtube.com/channel/UC4VFy3wc1nzq5tUHhiti6fw>youtube 867*cf5a6c84SAndroid Build Coastguard Workerchannel</a>), and the FAQ entry on cross compiling got 868*cf5a6c84SAndroid Build Coastguard Workerexpanded. 869*cf5a6c84SAndroid Build Coastguard WorkerThe toys/example commands moved from "make list" to "make list_example" 870*cf5a6c84SAndroid Build Coastguard Worker(since they're not enabled in defconfig either). 871*cf5a6c84SAndroid Build Coastguard WorkerThe cross compiling example command line in "make help" now sets 872*cf5a6c84SAndroid Build Coastguard WorkerLDFLAGS=--static instead of putting that in CFLAGS.</p> 873*cf5a6c84SAndroid Build Coastguard Worker 874*cf5a6c84SAndroid Build Coastguard Worker<p>The web archive is back, and since the missing messages were 875*cf5a6c84SAndroid Build Coastguard Workernever delivered (the mailserver trying to deliver them timed out and bounced 876*cf5a6c84SAndroid Build Coastguard Workerthem back after a couple days) this means unlike previous failures the web 877*cf5a6c84SAndroid Build Coastguard Workerarchive isn't out of sync with reality: the hole was the list actually being 878*cf5a6c84SAndroid Build Coastguard Workerdown until Dreamhost tech support figured out what they broke this time.</p> 879*cf5a6c84SAndroid Build Coastguard Worker 880*cf5a6c84SAndroid Build Coastguard Worker<p><u>Pending</u>: 881*cf5a6c84SAndroid Build Coastguard WorkerMore work on toysh: case/esac was confused by nested flow control blocks, 882*cf5a6c84SAndroid Build Coastguard Workersupport for [[ < > =~ ]] tests, implemented the rest of the $((math)) 883*cf5a6c84SAndroid Build Coastguard Workeroperators and support for ((math)) tests and "for ((math;math;math))" loops, 884*cf5a6c84SAndroid Build Coastguard Workerand so on. (The next toysh goal is to get the test suite running under mkroot, but 885*cf5a6c84SAndroid Build Coastguard Workerother stuff keeps coming up.) 886*cf5a6c84SAndroid Build Coastguard WorkerJames Farrell upgraded diff, adding three line format options and support 887*cf5a6c84SAndroid Build Coastguard Workerfor diffing FIFOs. 888*cf5a6c84SAndroid Build Coastguard WorkerRob did several rounds of dd cleanup, then got distracted by diff cleanup 889*cf5a6c84SAndroid Build Coastguard Workerwhich turned into a complete rewrite of diff. 890*cf5a6c84SAndroid Build Coastguard WorkerNeither was ready to promote in time for this release though (although the release 891*cf5a6c84SAndroid Build Coastguard Workergot delayed almost a week before Rob admitted that).</p> 892*cf5a6c84SAndroid Build Coastguard Worker 893*cf5a6c84SAndroid Build Coastguard Worker<p><u>Library</u>: 894*cf5a6c84SAndroid Build Coastguard WorkerThe <b>lib/args.c</b> command line parser now has two optional modifiers 895*cf5a6c84SAndroid Build Coastguard Worker(" " and ";") for each argument type, providing 4 combinations (both unset, 896*cf5a6c84SAndroid Build Coastguard Workerboth set, one of each set), and all 4 now have defined semantics and 897*cf5a6c84SAndroid Build Coastguard Workertests/skeleton.test exercises them. (This was motivated by <b>unshare</b> 898*cf5a6c84SAndroid Build Coastguard Workerneeding a new combination to match the debian behavior.) 899*cf5a6c84SAndroid Build Coastguard Worker<b>lib/args.c</b> also added "~" to collate bare longopts (so multiple bare 900*cf5a6c84SAndroid Build Coastguard Workerlongopts can be synonyms setting the same flag or argument variable).</p> 901*cf5a6c84SAndroid Build Coastguard Worker 902*cf5a6c84SAndroid Build Coastguard Worker<p>New function <b>xrunread()</b> which launches a child function, writes a 903*cf5a6c84SAndroid Build Coastguard Workerstring to its stdin, and returns everything the child wrote to stdout as another 904*cf5a6c84SAndroid Build Coastguard Workerstring (or NULL if it couldn't run or exited with an error), leaving 905*cf5a6c84SAndroid Build Coastguard Workerstderr alone (so it goes to the same place the parent's goes).</p> 906*cf5a6c84SAndroid Build Coastguard Worker 907*cf5a6c84SAndroid Build Coastguard Worker<p>New functions <b>same_file()</b> and <b>same_def_ino()</b> to simplify 908*cf5a6c84SAndroid Build Coastguard Workerfile metadata comparisons. (If you're wondering why something so simple should 909*cf5a6c84SAndroid Build Coastguard Workerhave a function encapsulating the logic, this release also has at least 3 910*cf5a6c84SAndroid Build Coastguard Workerdifferent bugfix commits for thinkos from switching all the commands over 911*cf5a6c84SAndroid Build Coastguard Workerto use them instead of doing the test ourselves. All missing/extra ! or 912*cf5a6c84SAndroid Build Coastguard Worker&& vs || level stuff.)</p> 913*cf5a6c84SAndroid Build Coastguard Worker 914*cf5a6c84SAndroid Build Coastguard Worker<p>The <b>exit_signal()</b> handler now blocks signals so <b>sigatexit()</b> won't 915*cf5a6c84SAndroid Build Coastguard Workerre-enter the list when it receives two different killer signals. (Since 916*cf5a6c84SAndroid Build Coastguard Worker<b>xexit()</b> capture uses siglongjmp() this should clean itself up 917*cf5a6c84SAndroid Build Coastguard Workerwhen not actually exiting.)</p> 918*cf5a6c84SAndroid Build Coastguard Worker 919*cf5a6c84SAndroid Build Coastguard Worker<p><u>Plumbing</u>: 920*cf5a6c84SAndroid Build Coastguard WorkerSeveral warning suppressions due to things like llvm's fortify finding 921*cf5a6c84SAndroid Build Coastguard Workerfalse positives, gcc's "int and long are identical on 32 bits!" warnings 922*cf5a6c84SAndroid Build Coastguard Worker(yes... they are), the MacOS build being crotchety about vfork()... All verified 923*cf5a6c84SAndroid Build Coastguard Workernon-issues at present.</p> 924*cf5a6c84SAndroid Build Coastguard Worker 925*cf5a6c84SAndroid Build Coastguard Worker<p>The build plumbing now puts more effort into resolving dependencies and figuring 926*cf5a6c84SAndroid Build Coastguard Workerout when stuff needs to be rebuilt. This includes noticing when the 927*cf5a6c84SAndroid Build Coastguard Workertoolchain we're building with changes flags, and outputting a warning 928*cf5a6c84SAndroid Build Coastguard Workerwhen it detects the need to run "make oldconfig" again. (At the moment 929*cf5a6c84SAndroid Build Coastguard Workercalling kconfig/ from scripts/ would be a layering violation: I need to 930*cf5a6c84SAndroid Build Coastguard Workerrewrite kconfig from scratch before it can do that automatically.).</p> 931*cf5a6c84SAndroid Build Coastguard Worker 932*cf5a6c84SAndroid Build Coastguard Worker<p>Removed most compile time probes from <b>scripts/genconfig.sh</b>, 933*cf5a6c84SAndroid Build Coastguard Workerreplaced with things like #ifdef (_NR_syscall) and 934*cf5a6c84SAndroid Build Coastguard Worker#if __has_include(<utmpx.h>), or acknowledging when a probe is a bug 935*cf5a6c84SAndroid Build Coastguard Workerworkaround for a specific libc version and testing for that instead, 936*cf5a6c84SAndroid Build Coastguard Workerplus simply deleting some config options due to the 7 year horizon expiring 937*cf5a6c84SAndroid Build Coastguard Workerso we can trust it to be there now.</p> 938*cf5a6c84SAndroid Build Coastguard Worker 939*cf5a6c84SAndroid Build Coastguard Worker<p>Usual batch of musl workarounds for behavior that 940*cf5a6c84SAndroid Build Coastguard Worker<a href=https://github.com/landley/toybox/commit/9a5d7a063c8c>doesn't match</a> 941*cf5a6c84SAndroid Build Coastguard Workerglibc and bionic or where they've been 942*cf5a6c84SAndroid Build Coastguard Worker<a href=https://www.openwall.com/lists/musl/2022/07/27/5>arguing about</a> 943*cf5a6c84SAndroid Build Coastguard Workerstuff for years without actually fixing it. 944*cf5a6c84SAndroid Build Coastguard WorkerEd Maste of FreeBSD added some FreeBSD checks/cases to 945*cf5a6c84SAndroid Build Coastguard Workerlib/portability.[hc], mostly in places we already supported Apple or 946*cf5a6c84SAndroid Build Coastguard WorkerOpenBSD. 947*cf5a6c84SAndroid Build Coastguard WorkerThe top level "configure" is now re-entrant (shouldn't append stuff 948*cf5a6c84SAndroid Build Coastguard Workerto enviornment varibles like $CFLAGS twice when read twice). 949*cf5a6c84SAndroid Build Coastguard WorkerThe MacOS defconfig now includes a lot more commands.</p> 950*cf5a6c84SAndroid Build Coastguard Worker 951*cf5a6c84SAndroid Build Coastguard Worker<p><u>Test suite</u>: 952*cf5a6c84SAndroid Build Coastguard WorkerThe diff for failing tests is now output after the FAIL line instead 953*cf5a6c84SAndroid Build Coastguard Workerof before, "make tests" now runs tar.test by default, 954*cf5a6c84SAndroid Build Coastguard Workera new skeleton.test uses toys/example/skeleton.c to exercise the 955*cf5a6c84SAndroid Build Coastguard Workerlib/args.c command line parsing plumbing, 956*cf5a6c84SAndroid Build Coastguard Workerscripts/runtest.sh now uses do_pass and do_fail consistently, 957*cf5a6c84SAndroid Build Coastguard Workerand Rob keeps accidentally checking in bashisms and Elliott keeps submitting 958*cf5a6c84SAndroid Build Coastguard Workerpatches to remove them because android runs the tests under mksh and 959*cf5a6c84SAndroid Build Coastguard Workertoysh isn't ready yet.</p> 960*cf5a6c84SAndroid Build Coastguard Worker 961*cf5a6c84SAndroid Build Coastguard Worker<p>Work in progress to make TEST_HOST=1 pass on newer debian, which is a moving 962*cf5a6c84SAndroid Build Coastguard Workertarget. (The tests didn't change, but the behavior of the gnu utilities 963*cf5a6c84SAndroid Build Coastguard Workeris not consistent. Or standardized. Or coherent. Or predictable. Or sane.) 964*cf5a6c84SAndroid Build Coastguard WorkerSome minor changes to commands like <b>xxd</b> and <b>cmp</b> to 965*cf5a6c84SAndroid Build Coastguard Workermake their output look more like what debian's currently producing.</p> 966*cf5a6c84SAndroid Build Coastguard Worker 967*cf5a6c84SAndroid Build Coastguard Worker<p>Making the tests pass on MacOS is harder: that calls group 0 "wheel" 968*cf5a6c84SAndroid Build Coastguard Workerinstead of "root" (so things like "tar.test" don't get the same result), 969*cf5a6c84SAndroid Build Coastguard Workerstuff like "du" or "ls" often cares what filesystem you're mounted on 970*cf5a6c84SAndroid Build Coastguard Worker(and MacOS hasn't even got the same ones _available_), 971*cf5a6c84SAndroid Build Coastguard Workerand we even found a mac kernel bug where extending a sparse 972*cf5a6c84SAndroid Build Coastguard Workerfile sparsely allocates the previous length as actual zeroed disk space 973*cf5a6c84SAndroid Build Coastguard Worker(ala "truncate -s 3m file; truncate -s 5m file; du file" says it's using 974*cf5a6c84SAndroid Build Coastguard Worker3 megabytes of disk space). There's probably more but 975*cf5a6c84SAndroid Build Coastguard Workerthat's where we stopped looking for now: since Rob doesn't have a mac 976*cf5a6c84SAndroid Build Coastguard Workerto test on and the github tests don't reliably run when new commits are 977*cf5a6c84SAndroid Build Coastguard Workerpushed (skipped when the servers are busy), fixing this hasn't 978*cf5a6c84SAndroid Build Coastguard Workerbeen a priority. Lots of little red X in the github history because of this, 979*cf5a6c84SAndroid Build Coastguard Workerthough...</p> 980*cf5a6c84SAndroid Build Coastguard Worker 981*cf5a6c84SAndroid Build Coastguard Worker<p><u>Mkroot</u>: 982*cf5a6c84SAndroid Build Coastguard WorkerThe output file names are now consistent across architectures: each 983*cf5a6c84SAndroid Build Coastguard Workerroot/$TARGET directory now contains an <b>fs</b> subdirectory with the 984*cf5a6c84SAndroid Build Coastguard Workerexpanded root filesystem, packaged into <b>initramfs.cpio.gz</b>, 985*cf5a6c84SAndroid Build Coastguard Workera <b>linux-kernel</b> built from <b>linux-fullconfig</b> which is built 986*cf5a6c84SAndroid Build Coastguard Workerfrom <b>linux-miniconfig</b>, and a <b>run-qemu.sh</b> script to launch 987*cf5a6c84SAndroid Build Coastguard Workerit under qemu. No more architecture name in the filenames (that's what 988*cf5a6c84SAndroid Build Coastguard Workerthe directory name is for), and no more "bzImage" or "vmlinux" depending 989*cf5a6c84SAndroid Build Coastguard Workeron what filename the kernel build produced.</p> 990*cf5a6c84SAndroid Build Coastguard Worker 991*cf5a6c84SAndroid Build Coastguard Worker<p>The fs/init script has better chroot support (not warning about /dev/shm and 992*cf5a6c84SAndroid Build Coastguard Worker/dev/pts already existing). 993*cf5a6c84SAndroid Build Coastguard WorkerThe airlock build no longer includes ftpd (you can use 994*cf5a6c84SAndroid Build Coastguard Workerhttpd and wget, scp out of dropbear, mount a network filesystem from the 995*cf5a6c84SAndroid Build Coastguard Workerhost, or if you really want to still use ftp can match ftpget and ftpput). 996*cf5a6c84SAndroid Build Coastguard WorkerWhen mkroot is downloading extra packages (for example in the dropbear build), 997*cf5a6c84SAndroid Build Coastguard Workerit falls back to the host wget if it can't fetch with toybox's version. 998*cf5a6c84SAndroid Build Coastguard Worker(This is because toybox hasn't got built-in https support yet, it's on the 999*cf5a6c84SAndroid Build Coastguard Workertodo list.) 1000*cf5a6c84SAndroid Build Coastguard WorkerUpdated the dropbear build to the current version and fixed a compiler 1001*cf5a6c84SAndroid Build Coastguard Workerpath issue. 1002*cf5a6c84SAndroid Build Coastguard WorkerFixed version skew in the <a href=http://lkml.iu.edu/hypermail/linux/kernel/2110.3/00278.html>workaround</a> 1003*cf5a6c84SAndroid Build Coastguard Workerso the Linux kernel build doesn't require a third ELF package (but only 1004*cf5a6c84SAndroid Build Coastguard Workerfor x86, not for any other architecture).</p> 1005*cf5a6c84SAndroid Build Coastguard Worker 1006*cf5a6c84SAndroid Build Coastguard Worker<a name="23-07-2022" /><a href="#23-07-2022"><hr><h2><b>July 23, 2022</b></h2></a> 1007*cf5a6c84SAndroid Build Coastguard Worker<p>Sorry the mailing list has been down since the 19th, Dreamhost 1008*cf5a6c84SAndroid Build Coastguard Worker<a href=https://landley.net/notes-2022.html#22-07-2022>happened 1009*cf5a6c84SAndroid Build Coastguard Workeragain</a>. (First the web archive was empty, then it was down, then it was 1010*cf5a6c84SAndroid Build Coastguard Workerrestored from a backup taken before the "upgrade" but was not updating with 1011*cf5a6c84SAndroid Build Coastguard Workernew messages, which they denied was an actual problem but now timeout bounce 1012*cf5a6c84SAndroid Build Coastguard Workermessages from all the attempts to send to it since it broke have started 1013*cf5a6c84SAndroid Build Coastguard Workercoming back saying a path doesn't exist on their server...)</p> 1014*cf5a6c84SAndroid Build Coastguard Worker 1015*cf5a6c84SAndroid Build Coastguard Worker<p>Dreamhost tech support has been informed of the issue a half-dozen times, 1016*cf5a6c84SAndroid Build Coastguard Workerand did at least replace the "Currently there are no messages" page with a 1017*cf5a6c84SAndroid Build Coastguard Workerbackup from before they broke it on the first day. Unfortunately they have yet 1018*cf5a6c84SAndroid Build Coastguard Workerto acknowledge anything else is wrong with it since then, and don't seem to 1019*cf5a6c84SAndroid Build Coastguard Workerhave support staff working over the weekend. This used to be an 1020*cf5a6c84SAndroid Build Coastguard Worker<a href=https://landley.net/dreamhost.txt>annual</a> 1021*cf5a6c84SAndroid Build Coastguard Worker<a href=https://landley.net/dreamhost2.txt>event</a> for them, 1022*cf5a6c84SAndroid Build Coastguard Workerbut they hadn't done a truly major breakage in 1023*cf5a6c84SAndroid Build Coastguard Worker<a href=#12-21-2015>a while</a>. I _think_ the 11 month gap that last link 1024*cf5a6c84SAndroid Build Coastguard Workermentions is still missing, but the server's down again (or at least timing 1025*cf5a6c84SAndroid Build Coastguard Workerout) so I can't check.</p> 1026*cf5a6c84SAndroid Build Coastguard Worker</span> 1027*cf5a6c84SAndroid Build Coastguard Worker 1028*cf5a6c84SAndroid Build Coastguard Worker<a name="06-05-2022" /><a href="#06-05-2022"><hr><h2><b>May 6, 2022</b></h2></a> 1029*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p> 1030*cf5a6c84SAndroid Build Coastguard WorkerThe mighty ships tore across the empty wastes of space and 1031*cf5a6c84SAndroid Build Coastguard Workerfinally dived screaming on to the first planet they came across - which 1032*cf5a6c84SAndroid Build Coastguard Workerhappened to be the Earth - where due to a terrible miscalculation of scale 1033*cf5a6c84SAndroid Build Coastguard Workerthe entire battle fleet was accidentally swallowed by a small dog.</p> 1034*cf5a6c84SAndroid Build Coastguard Worker<p>- The Hitchhiker's Guide to the Galaxy</p></blockquote> 1035*cf5a6c84SAndroid Build Coastguard Worker 1036*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.8.7.tar.gz>Toybox 0.8.7</a> 1037*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.8.7>git commit</a>) 1038*cf5a6c84SAndroid Build Coastguard Workeris out, with prebuilt <a href=downloads/binaries/0.8.7>static binaries</a> and 1039*cf5a6c84SAndroid Build Coastguard Worker<a href=downloads/binaries/mkroot/0.8.7>mkroot images</a> 1040*cf5a6c84SAndroid Build Coastguard Workerbootable under QEMU (using vanilla linux-5.17).</p> 1041*cf5a6c84SAndroid Build Coastguard Worker 1042*cf5a6c84SAndroid Build Coastguard Worker<p>Rob also <a href=downloads/binaries/toolchains/latest>uploaded</a> 1043*cf5a6c84SAndroid Build Coastguard Workerthe prebuilt binary cross and native compilers used to build those 1044*cf5a6c84SAndroid Build Coastguard Workermkroot images (there's a <a href=downloads/binaries/toolchains/latest/README>README</a> 1045*cf5a6c84SAndroid Build Coastguard Workerin there), and started producing 1046*cf5a6c84SAndroid Build Coastguard Worker<a href=https://www.youtube.com/channel/UC4VFy3wc1nzq5tUHhiti6fw>tutorial videos</a> explaining the 1047*cf5a6c84SAndroid Build Coastguard Workertoybox commands, their implementation, toybox's infrastructure...</p> 1048*cf5a6c84SAndroid Build Coastguard Worker 1049*cf5a6c84SAndroid Build Coastguard Worker<p>The commands <b>host</b>, <b>wget</b>, <b>openvt</b>, and 1050*cf5a6c84SAndroid Build Coastguard Worker<b>deallocvt</b> were cleaned up and promoted. 1051*cf5a6c84SAndroid Build Coastguard WorkerElliott contributed the new commands <b>uclampset</b>, <b>gpiodetect</b>, 1052*cf5a6c84SAndroid Build Coastguard Worker<b>gpioinfo</b>, <b>gpioiget</b>, <b>gpiofind</b>, and <b>gpioset</b>, 1053*cf5a6c84SAndroid Build Coastguard Workerand Rob wrote a simple <b>httpd</b> (largely to give wget.test something to 1054*cf5a6c84SAndroid Build Coastguard Workertalk to).</p> 1055*cf5a6c84SAndroid Build Coastguard Worker 1056*cf5a6c84SAndroid Build Coastguard Worker<p>One command was removed: <b>catv</b> didn't really serve a purpose 1057*cf5a6c84SAndroid Build Coastguard Worker(everybody just uses <b>cat -v</b>).</p> 1058*cf5a6c84SAndroid Build Coastguard Worker 1059*cf5a6c84SAndroid Build Coastguard Worker 1060*cf5a6c84SAndroid Build Coastguard Worker 1061*cf5a6c84SAndroid Build Coastguard Worker 1062*cf5a6c84SAndroid Build Coastguard Worker<p><u>Features</u>: 1063*cf5a6c84SAndroid Build Coastguard Worker<b>top</b> can now move the list with the LEFT/RIGHT cursor keys (changing the 1064*cf5a6c84SAndroid Build Coastguard Workersort field is now SHIFT LEFT/RIGHT). Added <b>find -samefile</b>, 1065*cf5a6c84SAndroid Build Coastguard Worker<b>cmp -n</b> (and wired up skip1 skip2), 1066*cf5a6c84SAndroid Build Coastguard Worker<b>tar --strip components</b> (and tar --owner and --group can now specify :UID and :GID making tar.test more portable), 1067*cf5a6c84SAndroid Build Coastguard Worker<b>lsusb</b> and </b>lspci</b> now read /etc/{usb,pci}.ids[.gz] (when 1068*cf5a6c84SAndroid Build Coastguard Workeravailable) to provide human readable device descriptions, 1069*cf5a6c84SAndroid Build Coastguard Worker<b>ifconfig</b> can now rename interfaces. 1070*cf5a6c84SAndroid Build Coastguard WorkerMoritz Weber added <b>wget</b> post support for form data. 1071*cf5a6c84SAndroid Build Coastguard WorkerIn toysh, <b>cd</b> got updated ("cd -" jumps to $OLDPWD, 1072*cf5a6c84SAndroid Build Coastguard Workerand cd can now handle deleted directories).</p> 1073*cf5a6c84SAndroid Build Coastguard Worker 1074*cf5a6c84SAndroid Build Coastguard Worker<p><u>Bugfixes</u>: 1075*cf5a6c84SAndroid Build Coastguard Worker<b>cp --preserve xattr,context</b> work together now, and 1076*cf5a6c84SAndroid Build Coastguard WorkerDario Freni fixed <b>cp --xattr</b> to avoid copying selinux context. 1077*cf5a6c84SAndroid Build Coastguard WorkerThe <b>sort -u</b> option now implies -s, <b>wget -O -</b> now writes to stdout, 1078*cf5a6c84SAndroid Build Coastguard Worker<b>pwget -B</b> removes more characters other implementations don't emit, 1079*cf5a6c84SAndroid Build Coastguard Worker</b>time</b>'s realtime output was not properly zero padding the fractional 1080*cf5a6c84SAndroid Build Coastguard Workerpart, and <b>sed</b> now works with multiple w to the same file. 1081*cf5a6c84SAndroid Build Coastguard WorkerFixed <b>nl -E</b>, <b>realpath -e</b>, <b>find</b> -newerXY and @time.nanosecond parsing, 1082*cf5a6c84SAndroid Build Coastguard WorkerVarious <b>sh</b> (it handles ${X: -1:1} properly now, 1083*cf5a6c84SAndroid Build Coastguard Workerwhich is not the same as ${X:-1:1} because :- has special meaning). 1084*cf5a6c84SAndroid Build Coastguard WorkerThe <b>hello</b> command in the examples directory now wait for a keypress before 1085*cf5a6c84SAndroid Build Coastguard Workerexiting when run as PID 1 (because calling wait() returned "No child process" 1086*cf5a6c84SAndroid Build Coastguard Workerimmediately.) 1087*cf5a6c84SAndroid Build Coastguard WorkerThe multiplexer's <b>toybox command --help</b> once again shows the command's 1088*cf5a6c84SAndroid Build Coastguard Workerhelp (not toybox --help). 1089*cf5a6c84SAndroid Build Coastguard WorkerElliott fixed a strip bug in the MacOS build, taught <b>file</b> not to be confused 1090*cf5a6c84SAndroid Build Coastguard Workerby ELF BSS sections but to otherwise detect more invalid ELF files, 1091*cf5a6c84SAndroid Build Coastguard Workerand fixed an <b>xargs</b> bug where stdin was inappropriately O_CLOEXEC. 1092*cf5a6c84SAndroid Build Coastguard WorkerGithub user hg42 reported a bug where <b>tar</b> was looping trying to remove ".." 1093*cf5a6c84SAndroid Build Coastguard Workerat the start of names.</p> 1094*cf5a6c84SAndroid Build Coastguard Worker 1095*cf5a6c84SAndroid Build Coastguard Worker<p><u>Library</u>: 1096*cf5a6c84SAndroid Build Coastguard WorkerTaught flags.h to #define its own CLEANUP macros so switching FLAG() 1097*cf5a6c84SAndroid Build Coastguard Workercontexts requires fewer steps. 1098*cf5a6c84SAndroid Build Coastguard WorkerWhen args.c is just enforcing max/min argument count but collecting no 1099*cf5a6c84SAndroid Build Coastguard Workeroptions, imply "?" so "command -123" isn't an unknown option. 1100*cf5a6c84SAndroid Build Coastguard WorkerMoved lib/help.c into main.c (nothing else in lib/ had to rebuild 1101*cf5a6c84SAndroid Build Coastguard Workerwhen the config changes which commands are enabled). 1102*cf5a6c84SAndroid Build Coastguard WorkerThe remains of linestack.c were renamed utf8.c, and 1103*cf5a6c84SAndroid Build Coastguard Workertoys.h now includes sys/syscall.h so commands don't have to.</p> 1104*cf5a6c84SAndroid Build Coastguard Worker 1105*cf5a6c84SAndroid Build Coastguard Worker<p>Yank things with only one remaining user: moved get_line() 1106*cf5a6c84SAndroid Build Coastguard Workerto patch.c, struct str_len to bc.c, and struct ptr_len to ps.c 1107*cf5a6c84SAndroid Build Coastguard WorkerRemoved tty_esc() and tty_jump() wrappers. 1108*cf5a6c84SAndroid Build Coastguard WorkerVarious cleanups to lib/password.c and lib/tty.c. 1109*cf5a6c84SAndroid Build Coastguard WorkerRemoved the PEDANTIC_ARGS config option which just set a macro that was never 1110*cf5a6c84SAndroid Build Coastguard Workerused, xsignal_all_killers() now takes SIG_DFL as the reset value instead 1111*cf5a6c84SAndroid Build Coastguard Workerof explicitly checking for NULL, 1112*cf5a6c84SAndroid Build Coastguard Workerchomp() now removes any number of trailing \r\n, and it's now safe to 1113*cf5a6c84SAndroid Build Coastguard Workerllist_pop(0) just like dlist_pop(0). 1114*cf5a6c84SAndroid Build Coastguard WorkerLongPing Wei improved support for copy_file_range().</p> 1115*cf5a6c84SAndroid Build Coastguard Worker 1116*cf5a6c84SAndroid Build Coastguard Worker<p><u>Build</u>: 1117*cf5a6c84SAndroid Build Coastguard WorkerIf you don't set $PREFIX, <b>make install</b> now defaults to $PWD/install 1118*cf5a6c84SAndroid Build Coastguard Worker(which does not require root access to write to, and you can tar up your 1119*cf5a6c84SAndroid Build Coastguard Workerpile of symlinks from there). 1120*cf5a6c84SAndroid Build Coastguard WorkerMore command sub-options removed (NETCAT_LISTEN and CAT_V).</p> 1121*cf5a6c84SAndroid Build Coastguard Worker 1122*cf5a6c84SAndroid Build Coastguard Worker<p>Some of the uglier scripts/make.sh plumbing moved into scripts/portability.sh 1123*cf5a6c84SAndroid Build Coastguard Worker(which should now be safe to source twice), 1124*cf5a6c84SAndroid Build Coastguard Workerand moved almost all config varible definitions to "configure" now. The 1125*cf5a6c84SAndroid Build Coastguard Workernew $GENDIR variable theoretically lets the "generated" directory live 1126*cf5a6c84SAndroid Build Coastguard Workersomewhere else (not very tested yet). 1127*cf5a6c84SAndroid Build Coastguard WorkerVarious tweaks to scripts/make.sh to try to avoid unnecessary rebuilds 1128*cf5a6c84SAndroid Build Coastguard Workerand library probes when toolchain and config haven't changed. 1129*cf5a6c84SAndroid Build Coastguard WorkerAdded -Wno-pointer-sign to $CFLAGS because passing an unsigned char * to a 1130*cf5a6c84SAndroid Build Coastguard Workerfunction that expects char * is not a problem. 1131*cf5a6c84SAndroid Build Coastguard Worker 1132*cf5a6c84SAndroid Build Coastguard Worker<p>The airlock install in scripts/install.sh had the $PENDING items sorted 1133*cf5a6c84SAndroid Build Coastguard Workerinto "started" and "not started". Add git and bash to $PENDING (used 1134*cf5a6c84SAndroid Build Coastguard Workerout of $PATH by --version and the powerpc64le build, respectively).</p> 1135*cf5a6c84SAndroid Build Coastguard Worker 1136*cf5a6c84SAndroid Build Coastguard Worker<p><u>Cleanup</u>: 1137*cf5a6c84SAndroid Build Coastguard WorkerRemoved the lib/linestack.c plumbing (which was never finished and hadn't 1138*cf5a6c84SAndroid Build Coastguard Workerbeen touched in years). 1139*cf5a6c84SAndroid Build Coastguard WorkerMerged lspci.c into lsusb.c (so they can share config file reading 1140*cf5a6c84SAndroid Build Coastguard Workerinfrastructure), and merged chvt/deallocvt into openvt.c. 1141*cf5a6c84SAndroid Build Coastguard WorkerMinor cleanups to ping, fsync, ionice, pmap, truncate, timeout, tty, 1142*cf5a6c84SAndroid Build Coastguard Workerfactor, mount. 1143*cf5a6c84SAndroid Build Coastguard WorkerWent through and replaced \033 with \e in strings (since clang supports 1144*cf5a6c84SAndroid Build Coastguard Workerit and \033 is just awkward). Added LL to constant 0 in the FLAG macros 1145*cf5a6c84SAndroid Build Coastguard Workerto prevent gcc from warning that 0<<32 might produce 0. 1146*cf5a6c84SAndroid Build Coastguard WorkerMoved llvm's -Wno-string-plus-int into configure instead of probing 1147*cf5a6c84SAndroid Build Coastguard Workerfor it, since gcc no longer dies when asked to suppress an unknown warning.</p> 1148*cf5a6c84SAndroid Build Coastguard Worker 1149*cf5a6c84SAndroid Build Coastguard Worker<p><u>mkroot</u>: 1150*cf5a6c84SAndroid Build Coastguard Workerthe ANSI escape to undo QEMU's wordwrap bug is now in both the init script 1151*cf5a6c84SAndroid Build Coastguard Workerand launch wrapper script (so wordwrap isn't broken while running the 1152*cf5a6c84SAndroid Build Coastguard Workeremulated system, nor if the emulated system fails to run). 1153*cf5a6c84SAndroid Build Coastguard WorkerIf devtmpfs was already mounted on /dev, we still need to create dev/pts. 1154*cf5a6c84SAndroid Build Coastguard WorkerThe init script now includes the linux kernel bug workaround to enable ping 1155*cf5a6c84SAndroid Build Coastguard Workersupport. The armv7 target enabled CONFIG_ARM_LPAE in the kernel to work around 1156*cf5a6c84SAndroid Build Coastguard Workeraround <a href=https://bugs.launchpad.net/qemu/+bug/1790975>a QEMU bug</a> 1157*cf5a6c84SAndroid Build Coastguard Workerthat's gone unfixed for 4 years. Enable network support in m68k target. 1158*cf5a6c84SAndroid Build Coastguard WorkerThe mcm-buildall.sh script got some minor updates, and the resulting 1159*cf5a6c84SAndroid Build Coastguard Workercross and native compiler binaries are now downloadable so you don't have 1160*cf5a6c84SAndroid Build Coastguard Workerto run the build if you don't want to.</p> 1161*cf5a6c84SAndroid Build Coastguard Worker 1162*cf5a6c84SAndroid Build Coastguard Worker<p><u>Docs</u>: 1163*cf5a6c84SAndroid Build Coastguard Worker"toybox --help" no longer says "see toybox --help". 1164*cf5a6c84SAndroid Build Coastguard WorkerThere's an ANSI escape cheat sheet at the start of lib/tty.c. 1165*cf5a6c84SAndroid Build Coastguard WorkerReworded some command directory READMEs, and tweaked menuconfig display. 1166*cf5a6c84SAndroid Build Coastguard WorkerConverted www/doc/mount.html and www/doc/ext2.html from text to html. 1167*cf5a6c84SAndroid Build Coastguard WorkerFreshened up design.html a little (and fixed some typos pointed out by 1168*cf5a6c84SAndroid Build Coastguard WorkerPeter Ennis). 1169*cf5a6c84SAndroid Build Coastguard WorkerReplaced the git internals video URL in roadmap.html with a different 1170*cf5a6c84SAndroid Build Coastguard Workerperformance of the same talk that hasn't been made private. 1171*cf5a6c84SAndroid Build Coastguard WorkerAdded the kconfig-language.txt from Linux-2.6.12 to the kconfig/ directory.</p> 1172*cf5a6c84SAndroid Build Coastguard Worker 1173*cf5a6c84SAndroid Build Coastguard Worker<a name="30-11-2021" /><a href="#30-11-2021"><hr><h2><b>November 30, 2021</b></h2></a> 1174*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p> 1175*cf5a6c84SAndroid Build Coastguard WorkerBusy? We'll I've just got this bulldozer to lie in front of or otherwise it'll 1176*cf5a6c84SAndroid Build Coastguard Workerknock my house down but otherwise no, not especially, why?</p> 1177*cf5a6c84SAndroid Build Coastguard Worker<p>- The Hitchhiker's Guide to the Galaxy</p></blockquote> 1178*cf5a6c84SAndroid Build Coastguard Worker 1179*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.8.6.tar.gz>Toybox 0.8.6</a> 1180*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.8.6>git commit</a>) 1181*cf5a6c84SAndroid Build Coastguard Workeris out, with prebuilt <a href=downloads/binaries/0.8.6>static binaries</a> and 1182*cf5a6c84SAndroid Build Coastguard Worker<a href=downloads/binaries/mkroot/0.8.6>mkroot images</a> 1183*cf5a6c84SAndroid Build Coastguard Workerbootable under QEMU (using vanilla linux-5.15).</p> 1184*cf5a6c84SAndroid Build Coastguard Worker 1185*cf5a6c84SAndroid Build Coastguard Worker<p><u>Make root</u>: The <a href=faq.html#mkroot>system builder</a> got upgraded, with better 1186*cf5a6c84SAndroid Build Coastguard Workerlogging and layout of the output directory, plus <a href=https://github.com/landley/toybox/blob/0.8.6/scripts/mkroot.sh>scripts/mkroot.sh</a> 1187*cf5a6c84SAndroid Build Coastguard Workershould be easier to read and understand now. 1188*cf5a6c84SAndroid Build Coastguard Worker(Also added basic support for the <a href=http://lists.landley.net/pipermail/toybox-landley.net/2021-August/012497.html>qualcomm hexagon</a>, 1189*cf5a6c84SAndroid Build Coastguard Workeralthough it just builds a chroot filesystem, you can't boot a hexagon kernel under qemu 1190*cf5a6c84SAndroid Build Coastguard Worker<a href=https://lists.nongnu.org/archive/html/qemu-devel/2021-07/msg06430.html>quite yet</a>.)</p> 1191*cf5a6c84SAndroid Build Coastguard Worker</p> 1192*cf5a6c84SAndroid Build Coastguard Worker 1193*cf5a6c84SAndroid Build Coastguard Worker<p><u>New commands</u>: Rob added <b>linux32</b>. 1194*cf5a6c84SAndroid Build Coastguard WorkerDan Brown added <b>sha256sum</b> (and the related 224/384/512 variants). 1195*cf5a6c84SAndroid Build Coastguard WorkerIn pending, Elliott contributed <b>strace</b> and 1196*cf5a6c84SAndroid Build Coastguard WorkerMoritz Röhrich contributed <b>hexdump</b>.</p> 1197*cf5a6c84SAndroid Build Coastguard Worker 1198*cf5a6c84SAndroid Build Coastguard Worker<p><u>Features</u>: 1199*cf5a6c84SAndroid Build Coastguard WorkerElliott added <b>date -s</b>, <b>pmap -p</b>, <b>tail -F -s</b>, <b>kill -0</b>, 1200*cf5a6c84SAndroid Build Coastguard Worker<b>reboot/halt/poweroff -d</b>, taught <b>file</b> to 1201*cf5a6c84SAndroid Build Coastguard Workerrecognize Mach-o universal binaries, made Android's <b>log</b> 1202*cf5a6c84SAndroid Build Coastguard Workertake input from stdin when it has no arguments, added <b>tail --bytes --lines</b> 1203*cf5a6c84SAndroid Build Coastguard Worker(the --long synonyms for -c and -n), 1204*cf5a6c84SAndroid Build Coastguard Workeradded <b>i2cdetect -q</b>, taught <b>i2cdump</b> to write XX for 1205*cf5a6c84SAndroid Build Coastguard Workerread failures, made <b>timeout</b> use the monotonic clock, 1206*cf5a6c84SAndroid Build Coastguard Workerand modernized the output of <b>uptime</b>.</p> 1207*cf5a6c84SAndroid Build Coastguard Worker 1208*cf5a6c84SAndroid Build Coastguard Worker<p>Rob added <b>find -quit -lname -ilname</b> and <b>-d</b> as a synonym for -depth, 1209*cf5a6c84SAndroid Build Coastguard Workertaught <b>cut -d $'\n'</b> 1210*cf5a6c84SAndroid Build Coastguard Workerto cut by line and added posix <b>cut -nb</b> (which wraps to the start of -c 1211*cf5a6c84SAndroid Build Coastguard Workerutf8 characters), added <b>cpio --ignore-devno --renumber-inodes</b>, 1212*cf5a6c84SAndroid Build Coastguard Workertaught <b>cal</b> to use 3 arguments (day month year), added <b>tar --selinux</b> 1213*cf5a6c84SAndroid Build Coastguard Workersupport and a "had errors" message at the end, made <b>uname -o</b> 1214*cf5a6c84SAndroid Build Coastguard Workersay "Toybox", and fixed the <b>grep -Fw</b> combination (used by the 64 bit 1215*cf5a6c84SAndroid Build Coastguard Workerpowerpc kernel build).</p> 1216*cf5a6c84SAndroid Build Coastguard Worker 1217*cf5a6c84SAndroid Build Coastguard Worker<p>Ella-0 added <b>split -n</b>. Peter Collingbourne added <b>grep -L</b>.</p> 1218*cf5a6c84SAndroid Build Coastguard Worker 1219*cf5a6c84SAndroid Build Coastguard Worker<p><u>Outside world</u>: The 0BSD license is <a href=https://lwn.net/Articles/868882/>now part</a> of the 1220*cf5a6c84SAndroid Build Coastguard Worker<a href=https://standards.iso.org/ittf/PubliclyAvailableStandards/>ISO-5962</a> 1221*cf5a6c84SAndroid Build Coastguard Workerstandard. Of the currently <a href=https://github.com/search?q=license%3A0bsd&type=Repositories&ref=advsearch>38k 0BSD licensed projects on github</a> toybox 1222*cf5a6c84SAndroid Build Coastguard Workerisn't even the most popular, it's fourth.</p> 1223*cf5a6c84SAndroid Build Coastguard Worker 1224*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott asked that toybox's <b>cut -DF</b> feature (a cheaper 1225*cf5a6c84SAndroid Build Coastguard Workeralternative to <b>awk '{print $3}'</b> be supported by other packages so 1226*cf5a6c84SAndroid Build Coastguard Workerit might someday make it into posix, so Rob 1227*cf5a6c84SAndroid Build Coastguard Worker<a href=http://lists.busybox.net/pipermail/busybox/2021-June/088886.html>submitted it to busybox</a> 1228*cf5a6c84SAndroid Build Coastguard Workerwhere it was <a href=https://git.busybox.net/busybox/commit/?id=0068ce2fa0e3>eventually merged</a>.</p> 1229*cf5a6c84SAndroid Build Coastguard Worker 1230*cf5a6c84SAndroid Build Coastguard Worker<p>Added a local <a href=https://landley.net/toybox/git>git mirror</a> for 1231*cf5a6c84SAndroid Build Coastguard Workerthose reluctant to trust Microsoft Github.</p> 1232*cf5a6c84SAndroid Build Coastguard Worker 1233*cf5a6c84SAndroid Build Coastguard Worker<p>In the web nav bar, our <a href=https://isfreenodedeadyet.com/>freenode</a> 1234*cf5a6c84SAndroid Build Coastguard Workerchannel moved to libera.chat 1235*cf5a6c84SAndroid Build Coastguard Worker(like <a href=https://boingboing.net/2021/05/19/freenode-irc-staff-quit-after-new-owner-seizes-control.html>everyone else's</a>; 1236*cf5a6c84SAndroid Build Coastguard Worker<a href=https://lwn.net/Articles/856543/>there</a> 1237*cf5a6c84SAndroid Build Coastguard Worker<a href=https://hackaday.com/2021/05/20/freenode-debacle-prompts-staff-exodus-new-network/>was</a> 1238*cf5a6c84SAndroid Build Coastguard Worker<a href=https://twitter.com/marcan42/status/1396280769778098185>a</a> 1239*cf5a6c84SAndroid Build Coastguard Worker<a href=https://twitter.com/mjg59/status/1396237336988446722>certain</a> 1240*cf5a6c84SAndroid Build Coastguard Worker<a href=https://www.devever.net/~hl/freenode_abuse>amount</a> 1241*cf5a6c84SAndroid Build Coastguard Worker<a href=https://twitter.com/TwitchiH/status/1395756163527028739>of</a> 1242*cf5a6c84SAndroid Build Coastguard Worker<a href=https://twitter.com/joepie91/status/1395364883303182339>drama</a> 1243*cf5a6c84SAndroid Build Coastguard Worker<a href=https://twitter.com/RichFelker/status/1404816846734385164>involved</a>).</p> 1244*cf5a6c84SAndroid Build Coastguard Worker 1245*cf5a6c84SAndroid Build Coastguard Worker<p><u>Pending</u>: lots more work on <b>toysh</b>: it has basic $((math)) support 1246*cf5a6c84SAndroid Build Coastguard Workernow, += assignment, the "declare" command and corresponding variable 1247*cf5a6c84SAndroid Build Coastguard Workertypes (declare -i, declare -u, etc), several bugfixes, greatly 1248*cf5a6c84SAndroid Build Coastguard Workerimproved support for background processes on NOMMU systems, and a bunch 1249*cf5a6c84SAndroid Build Coastguard Workermore sh.test entries.</p> 1250*cf5a6c84SAndroid Build Coastguard Worker 1251*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott fixed <b>modprobe</b>'s parsing of short lines. Rob fixed a 1252*cf5a6c84SAndroid Build Coastguard Workerdivision by zero error when <b>vi</b> tries to edit a zero length file. 1253*cf5a6c84SAndroid Build Coastguard WorkerAnqi Dong made sure that syslogd messages sent to sockets end with a 1254*cf5a6c84SAndroid Build Coastguard Workernewline. Eric Molitor significantly upgrade <b>wget</b> with http 1.1, 1255*cf5a6c84SAndroid Build Coastguard Workerchunked encoding, and (external library) https (TLS 1.2) support, 1256*cf5a6c84SAndroid Build Coastguard Workerplus several bugfixes. Michael Hope fixed <b>tftpd</b>'s option parsing.</p> 1257*cf5a6c84SAndroid Build Coastguard Worker 1258*cf5a6c84SAndroid Build Coastguard Worker<p><u>Documentation</u>: The roadmap.html and status.html pages 1259*cf5a6c84SAndroid Build Coastguard Workergot noticeable updates. (status.html is now directly generated by 1260*cf5a6c84SAndroid Build Coastguard Workerscripts/mkstatus.py, the old status.html wrapper that server-side-included 1261*cf5a6c84SAndroid Build Coastguard Workerstatus.gen has been removed). 1262*cf5a6c84SAndroid Build Coastguard WorkerThe <a href=design.html>design</a> 1263*cf5a6c84SAndroid Build Coastguard Workerpage provides better links to the LP64 documentation, and the 1264*cf5a6c84SAndroid Build Coastguard Worker<a href=code.html>code</a> page explains a corner case where the filename 1265*cf5a6c84SAndroid Build Coastguard Workerand first command name expect to match (and how to work around it if they don't). 1266*cf5a6c84SAndroid Build Coastguard WorkerSome website files weren't in the repository: two jpegs linked from html 1267*cf5a6c84SAndroid Build Coastguard Workerfiles, and the www/.htaccess file that triggers the server side includes 1268*cf5a6c84SAndroid Build Coastguard Workerin the navigation menu is now checked in. Johannes Schmitz fixed a 1269*cf5a6c84SAndroid Build Coastguard Workertypo in about.html.</p> 1270*cf5a6c84SAndroid Build Coastguard Worker 1271*cf5a6c84SAndroid Build Coastguard Worker<p>The <b>shred</b> usage line now includes all options. 1272*cf5a6c84SAndroid Build Coastguard WorkerThe <b>logwrapper</b> command now warns when it isn't built standalone. 1273*cf5a6c84SAndroid Build Coastguard WorkerThe <b>help</b> command no longer shows a header line about toybox unless 1274*cf5a6c84SAndroid Build Coastguard Workerit's called with no arguments. (It still shows it for command --help.) 1275*cf5a6c84SAndroid Build Coastguard WorkerThe --help option no longer needs to be the first option, and is 1276*cf5a6c84SAndroid Build Coastguard Workerchecked before the "Not root" error message for restricted commands.</p> 1277*cf5a6c84SAndroid Build Coastguard Worker 1278*cf5a6c84SAndroid Build Coastguard Worker<p><u>Bugfixes</u>: 1279*cf5a6c84SAndroid Build Coastguard WorkerElliott made <b>ps</b> exit with status 1 if no processes were shown (for LTP), 1280*cf5a6c84SAndroid Build Coastguard Workerfixed an off-by-one in <b>dmesg</b> and a bounds check in <b>netstat</b>, 1281*cf5a6c84SAndroid Build Coastguard Workerfixed <b>pidof -s</b>, and taught <b>rmmod</b> to handle multiple arguments. 1282*cf5a6c84SAndroid Build Coastguard WorkerDenys Vlasenko pointed out that <b>free -t</b> is "total" not "terabytes". 1283*cf5a6c84SAndroid Build Coastguard WorkerSamanta Navarro pointed out a leftover 32 bit limitation in argument groups. 1284*cf5a6c84SAndroid Build Coastguard WorkerMikhail Kashkarov fixed mkdir's error handling for existing directories 1285*cf5a6c84SAndroid Build Coastguard Workerwithout -p. 1286*cf5a6c84SAndroid Build Coastguard WorkerRob fixed the 32 bit <b>readelf</b> build on Android, fixed a race condition 1287*cf5a6c84SAndroid Build Coastguard Workerin <b>tar</b> leading 1288*cf5a6c84SAndroid Build Coastguard Workerto the occasional spurious archiver warning, 1289*cf5a6c84SAndroid Build Coastguard Worker<a href=https://github.com/landley/toybox/commit/127cff38809e>changed cp</a> 1290*cf5a6c84SAndroid Build Coastguard Workerto work around a posix violation in the kernel, made xparsedate() handle more 1291*cf5a6c84SAndroid Build Coastguard Workerwhitespace and ignore trailing + or - (a NOP timezone), made <b>su</b> log the 1292*cf5a6c84SAndroid Build Coastguard Workerright username, switched getuid() checks to geteuid() in <b>df</b> and <b>ping</b>, 1293*cf5a6c84SAndroid Build Coastguard Workerfixed a place in the test suite where do_test() 1294*cf5a6c84SAndroid Build Coastguard Workercould get confused by symlinks in the $PATH (calling realpath too early 1295*cf5a6c84SAndroid Build Coastguard Workerand losing the name of the command being run), 1296*cf5a6c84SAndroid Build Coastguard Workermade <b>env -i</b> use the old $PATH to run its command, 1297*cf5a6c84SAndroid Build Coastguard Workerand made <b>grep --color</b> highlight all matches.</p> 1298*cf5a6c84SAndroid Build Coastguard Worker 1299*cf5a6c84SAndroid Build Coastguard Worker<p>Worked around a bug in glibc+gcc 9.3 where linking against librt.a 1300*cf5a6c84SAndroid Build Coastguard Worker(for things like timer_create()) pulls in libgcc_eh.a which uses 1301*cf5a6c84SAndroid Build Coastguard Workerthreads, meaning you can't statically link against librt.a from 1302*cf5a6c84SAndroid Build Coastguard Workera non-threaded app. (I hadn't noticed because it works fine with the musl 1303*cf5a6c84SAndroid Build Coastguard Workerand llvm/bionic toolchains, only fails statically linking on e.g. debian.) 1304*cf5a6c84SAndroid Build Coastguard WorkerThe <a href=https://github.com/torvalds/linux/commit/d18760560593>kernel fix</a> for the cpio encrypted filesystem issue worked around in 0.8.5 made 1305*cf5a6c84SAndroid Build Coastguard Workerit in. Similarly, the 1306*cf5a6c84SAndroid Build Coastguard WorkerFS_IOC_{GET,SET}{VERSION,FLAGS} ioctl family are <a href=https://www.spinics.net/lists/linux-api/msg49101.html>historically broken</a> 1307*cf5a6c84SAndroid Build Coastguard Worker(taking an unsigned int argument while advertising signed long), 1308*cf5a6c84SAndroid Build Coastguard Workerwhich <a href=https://github.com/landley/toybox/commit/dcfac5c983ad>we fixed</a> and reported upstream to a long 1309*cf5a6c84SAndroid Build Coastguard Workerround of bikeshedding (sadly 1310*cf5a6c84SAndroid Build Coastguard Workerthe result seems to have been the man page maintainer 1311*cf5a6c84SAndroid Build Coastguard Worker<a href=https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/man2?id=3de87d46840d>giving up</a> 1312*cf5a6c84SAndroid Build Coastguard Workeron documenting ioctls at all.</p> 1313*cf5a6c84SAndroid Build Coastguard Worker 1314*cf5a6c84SAndroid Build Coastguard Worker<p><u>Cleanups</u>: 1315*cf5a6c84SAndroid Build Coastguard Worker<b>cut</b> switched to FLAG() macros and no longer allows -f with -F, 1316*cf5a6c84SAndroid Build Coastguard Worker<b>eject</b> uses FLAG() macros and the linux/eject.h header, 1317*cf5a6c84SAndroid Build Coastguard Workerprettycool@protonmail added tabs to <b>time</b>'s output, and Rob removed 1318*cf5a6c84SAndroid Build Coastguard Workerthe floating point dependency from time. Minor cleanups 1319*cf5a6c84SAndroid Build Coastguard Workerto lsattr, lspci, nsenter, xxd, file, insmod, modprobe, arp, bootchartd, pmap, 1320*cf5a6c84SAndroid Build Coastguard Workercomm, lsof, blkid, crond, init, userdel, makedevs, and scripts/make.sh. 1321*cf5a6c84SAndroid Build Coastguard WorkerThe "int fd = fd;" 1322*cf5a6c84SAndroid Build Coastguard Workerinitialization hack to shut up gcc's "may be used uninitalized, but isn't" false 1323*cf5a6c84SAndroid Build Coastguard Workerpositive warning has been replaced by a QUIET macro that resolves 1324*cf5a6c84SAndroid Build Coastguard Workerto nothing on llvm (which doesn't have the gcc bug). 1325*cf5a6c84SAndroid Build Coastguard WorkerRyan Pritchard reported a bug where <b>alias ls="ls --color"</b> would prevent 1326*cf5a6c84SAndroid Build Coastguard Worker--help or --version from being the first argument to the command, which was 1327*cf5a6c84SAndroid Build Coastguard Workera pain to fix without breaking things like <b>echo -- --version</b> and 1328*cf5a6c84SAndroid Build Coastguard Worker<b>basename -s --help file--help</b>. 1329*cf5a6c84SAndroid Build Coastguard Worker(Both toy_singleinit() in main.c _and_ get_optflags() in lib/args.c now 1330*cf5a6c84SAndroid Build Coastguard Workercheck for those.)</p> 1331*cf5a6c84SAndroid Build Coastguard Worker 1332*cf5a6c84SAndroid Build Coastguard Worker<p><u>Infrastructure</u>: 1333*cf5a6c84SAndroid Build Coastguard Workerxabspath() now has a more granular (flag based) control interface.</p> 1334*cf5a6c84SAndroid Build Coastguard Worker 1335*cf5a6c84SAndroid Build Coastguard Worker<p><b>scripts/make.sh</b> now uses wait -n (available since bash 4.3 in February 2014) 1336*cf5a6c84SAndroid Build Coastguard Workerto keep the processors busier during a parallel build. 1337*cf5a6c84SAndroid Build Coastguard WorkerTests are now running in a subshell, which means functions and local 1338*cf5a6c84SAndroid Build Coastguard Workervariables defined in one don't pollute others during "make tests". 1339*cf5a6c84SAndroid Build Coastguard Worker 1340*cf5a6c84SAndroid Build Coastguard Worker<p>Guo Chuang reported that lsattr won't build on an 8 year old version of 1341*cf5a6c84SAndroid Build Coastguard Worker<a href=https://github.com/landley/toybox/pull/292#issuecomment-899895909>centos</a>, 1342*cf5a6c84SAndroid Build Coastguard Workerwhich is still supported for 2 more years because Red Hat can 1343*cf5a6c84SAndroid Build Coastguard Workerbe paid to have a 10 year support horizon, longer than toybox's 7. Rob 1344*cf5a6c84SAndroid Build Coastguard Workerfixed it (and merged a similarly ancient compilation failure fix when 1345*cf5a6c84SAndroid Build Coastguard Workerbuilding pending/ip.c against a 3.10 kernel), 1346*cf5a6c84SAndroid Build Coastguard Workerbut the <a href=http://lists.landley.net/pipermail/toybox-landley.net/2021-August/012537.html>philosophal argument</a> 1347*cf5a6c84SAndroid Build Coastguard Workerremains <a href=http://lists.landley.net/pipermail/toybox-landley.net/2021-September/012603.html>unresolved</a>.</p> 1348*cf5a6c84SAndroid Build Coastguard Worker 1349*cf5a6c84SAndroid Build Coastguard Worker<p>Standalone builds can now override the .config file location with 1350*cf5a6c84SAndroid Build Coastguard WorkerKCONFIG_CONFIG same as the multiplexer build. scripts/single.sh can 1351*cf5a6c84SAndroid Build Coastguard Workernow cope with a missing .config file (it uses the defconfig values 1352*cf5a6c84SAndroid Build Coastguard Workerfor the CONFIG_TOYBOX_* global symbols). 1353*cf5a6c84SAndroid Build Coastguard Worker"make install_airlock" no longer needs host versions of sha256sum and sha512sum.</p> 1354*cf5a6c84SAndroid Build Coastguard Worker 1355*cf5a6c84SAndroid Build Coastguard Worker<p>In the test suite, <b>VERBOSE=spam</b> now shows expands successful tests 1356*cf5a6c84SAndroid Build Coastguard Workerlike it would for errors.</p> 1357*cf5a6c84SAndroid Build Coastguard Worker 1358*cf5a6c84SAndroid Build Coastguard Worker<p><b>scripts/record-commands</b> got updated and logwrapper got renamed <b>logpath</b>.</p> 1359*cf5a6c84SAndroid Build Coastguard Worker 1360*cf5a6c84SAndroid Build Coastguard Worker<a name="19-05-2021" /><a href="#19-05-2021"><hr><h2><b>May 19, 2021</b></h2></a> 1361*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>It was of course a descendant of these eccentric poets 1362*cf5a6c84SAndroid Build Coastguard Workerwho invented the spurious tales of impending doom which enabled the people of 1363*cf5a6c84SAndroid Build Coastguard WorkerGolgafrincham to rid themselves of the useless third of their population. 1364*cf5a6c84SAndroid Build Coastguard WorkerThe other two-thirds stayed firmly at home and lived full, rich and happy lives 1365*cf5a6c84SAndroid Build Coastguard Workeruntil they were all suddenly wiped out by a virulent disease contracted from 1366*cf5a6c84SAndroid Build Coastguard Workera dirty telephone.</p><p>- The Hitchhiker's Guide to the Galaxy</p></blockquote> 1367*cf5a6c84SAndroid Build Coastguard Worker 1368*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.8.5.tar.gz>Toybox 0.8.5</a> 1369*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.8.5>git commit</a>) 1370*cf5a6c84SAndroid Build Coastguard Workeris out, with prebuilt <a href=downloads/binaries/0.8.5>static binaries</a> and 1371*cf5a6c84SAndroid Build Coastguard Worker<a href=downloads/binaries/mkroot/0.8.5>mkroot images</a> 1372*cf5a6c84SAndroid Build Coastguard Workerbootable under QEMU (using vanilla linux-5.12, except that s390 needed another 1373*cf5a6c84SAndroid Build Coastguard Worker<a href=http://lkml.iu.edu/hypermail/linux/kernel/2105.2/02904.html>perl 1374*cf5a6c84SAndroid Build Coastguard Workerremoval patch</a>).</p> 1375*cf5a6c84SAndroid Build Coastguard Worker 1376*cf5a6c84SAndroid Build Coastguard Worker<p>This development cycle had thirty commits to sh.c fixing bugs and adding 1377*cf5a6c84SAndroid Build Coastguard Workerfeatures to <b>toysh</b>. Shell functions and local variables are now implemented, 1378*cf5a6c84SAndroid Build Coastguard Workeralong with the "set" builtin and trace support, and job control is 1379*cf5a6c84SAndroid Build Coastguard Workerabout halfway in. The shell as a whole is <a href=https://en.wikipedia.org/wiki/Ninety%E2%80%93ninety_rule>maybe 80% done</a>, but still 1380*cf5a6c84SAndroid Build Coastguard Workerhas some obvious gaps like $((math)) and interactive command line 1381*cf5a6c84SAndroid Build Coastguard Workerhistory/editing, plus a bunch of testing.</p> 1382*cf5a6c84SAndroid Build Coastguard Worker 1383*cf5a6c84SAndroid Build Coastguard Worker<p><u>New commands</u>: 1384*cf5a6c84SAndroid Build Coastguard WorkerMoritz Röhrich added <b>pwgen</b> and <b>base32</b>, and 1385*cf5a6c84SAndroid Build Coastguard WorkerElliott Hughes added <b>unicode</b>. The 1386*cf5a6c84SAndroid Build Coastguard Worker<b>readelf</b> command got promoted out of pending, and 1387*cf5a6c84SAndroid Build Coastguard Worker<b>sha3sum</b> is now switched on in defconfig.</p> 1388*cf5a6c84SAndroid Build Coastguard Worker 1389*cf5a6c84SAndroid Build Coastguard Worker<p>Michael Christensen added <b>chsh</b> to pending, which hasn't been promoted 1390*cf5a6c84SAndroid Build Coastguard Workeryet because it's part of a group of commands (useradd, userdel, groupadd, 1391*cf5a6c84SAndroid Build Coastguard Workergroupdel) that should all be promoted together at some point 1392*cf5a6c84SAndroid Build Coastguard Worker(and depend on lib/passwd.c, which could use some more work).</p> 1393*cf5a6c84SAndroid Build Coastguard Worker 1394*cf5a6c84SAndroid Build Coastguard Worker<p><u>Upgrades</u>: 1395*cf5a6c84SAndroid Build Coastguard Worker<b>cpio</b> now supports extracting multiple concatenated archives. 1396*cf5a6c84SAndroid Build Coastguard Worker<b>file</b> now recognizes android's new XML binary format. 1397*cf5a6c84SAndroid Build Coastguard Worker<b>devmem</b> now works on nommu, can handle 0x prefxes on the address, 1398*cf5a6c84SAndroid Build Coastguard Workerand prints 1399*cf5a6c84SAndroid Build Coastguard Workerhex or decimal output to match the address type. 1400*cf5a6c84SAndroid Build Coastguard Worker<b>df</b> -a now shows overmounted filesystems. 1401*cf5a6c84SAndroid Build Coastguard Worker<b>test</b> -k checks the sticky bit. 1402*cf5a6c84SAndroid Build Coastguard WorkerAdded -t to <b>install</b>, <b>cp</b>, and <b>mv</b>, and -u to <b>cp</b> 1403*cf5a6c84SAndroid Build Coastguard Workerand <b>cpio</b>. 1404*cf5a6c84SAndroid Build Coastguard Worker<b>find</b> -executable checks that _we_ can execute them (u+x could be owned 1405*cf5a6c84SAndroid Build Coastguard Workerby a different user or have selinux weirdness).</p> 1406*cf5a6c84SAndroid Build Coastguard Worker 1407*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott added several features to <b>date</b> (--iso, %:z output format, and 1408*cf5a6c84SAndroid Build Coastguard Worker--utc as a synonym for -u), added a <b>sed</b> s///x option, 1409*cf5a6c84SAndroid Build Coastguard Workeradded units to <b>ulimit</b> output, and 1410*cf5a6c84SAndroid Build Coastguard Workermade several UI changes to <b>hexedit</b> including a color 1411*cf5a6c84SAndroid Build Coastguard Workermode (which is now the default, press x to toggle between old and new 1412*cf5a6c84SAndroid Build Coastguard Workerdisplay), masked out the file type in <b>chmod</b> error messages and 1413*cf5a6c84SAndroid Build Coastguard Workertaught it to handle complex modes (like u+s+s), 1414*cf5a6c84SAndroid Build Coastguard Workerhardened <b>file</b> and <b>readelf</b> against invalid input, 1415*cf5a6c84SAndroid Build Coastguard Workeradded a portability.h workaround for macos statvfs for <b>df</b>, 1416*cf5a6c84SAndroid Build Coastguard Workerenabled line buffering in <b>echo</b> and <b>yes</b>, 1417*cf5a6c84SAndroid Build Coastguard Workerand significatly sped up <b>tr</b>. Rob similarly optimized <b>seq</b> 1418*cf5a6c84SAndroid Build Coastguard Workerand <b>count</b>.</p> 1419*cf5a6c84SAndroid Build Coastguard Worker 1420*cf5a6c84SAndroid Build Coastguard Worker<p><b>make tests</b> now defaults to VERBOSE=fail (and now has VERBOSE=all to 1421*cf5a6c84SAndroid Build Coastguard Workercontinue after failure, and VERBOSE=quiet to show FAIL: lines without 1422*cf5a6c84SAndroid Build Coastguard Workerdiff -u output). 1423*cf5a6c84SAndroid Build Coastguard WorkerCleanups to tee, netstat, file, and df. Added "static" annotations in a 1424*cf5a6c84SAndroid Build Coastguard Workerlot of commands, made more things use FLAG() macros. Ethan Sommer pointed out 1425*cf5a6c84SAndroid Build Coastguard Workeran unnecessary wrapper function in chgrp. 1426*cf5a6c84SAndroid Build Coastguard WorkerIn pending, Elliott did some cleanups and bugfixes to gettty, telnet, telnetd, 1427*cf5a6c84SAndroid Build Coastguard Workertftpd, init, modprobe, and dd, and added more features to vi. 1428*cf5a6c84SAndroid Build Coastguard WorkerRob did some cleanup on modprobe.</p> 1429*cf5a6c84SAndroid Build Coastguard Worker 1430*cf5a6c84SAndroid Build Coastguard Worker<p><u>Bugfixes</u>: 1431*cf5a6c84SAndroid Build Coastguard WorkerYi-Yo Chiang fixed a <b>rm</b> bug where -f could get confused by read 1432*cf5a6c84SAndroid Build Coastguard Workeronly filesystems and produce an error trying to unlink a nonexistent 1433*cf5a6c84SAndroid Build Coastguard Workerfile, pointed out <b>install</b> -D was broken when the target file 1434*cf5a6c84SAndroid Build Coastguard Workeralready exists, pointed out a <b>cpio</b> interaction with certain encrypted 1435*cf5a6c84SAndroid Build Coastguard Workerfilesystems where readlink() wouldn't write as much payload as the header 1436*cf5a6c84SAndroid Build Coastguard Workerpromised (corrupting the archive) and fixed another cpio bug where -t test 1437*cf5a6c84SAndroid Build Coastguard Workermode would chown() files, and fixed quoting in mount.test. 1438*cf5a6c84SAndroid Build Coastguard WorkerElliott fixed a sequencing issue in <b>setsid</b>'s system calls, 1439*cf5a6c84SAndroid Build Coastguard Workerfixed some <b>sed</b> tests (sed's lie-to-autoconf --version 1440*cf5a6c84SAndroid Build Coastguard Workeroutput was preventing toyonly tests from triggering) and 1441*cf5a6c84SAndroid Build Coastguard Workerfixed <b>tar</b>'s base 256 output for very large files. 1442*cf5a6c84SAndroid Build Coastguard WorkerNir Lichtman pointed out that <b>rm</b> -p shouldn't try to rmdir / at the end, 1443*cf5a6c84SAndroid Build Coastguard WorkerLuke Frankart pointed out a typo that broke <b>test</b> checking file modes, 1444*cf5a6c84SAndroid Build Coastguard WorkerFiras Khalil Khana fixed a duplicate entry in the roadmap, 1445*cf5a6c84SAndroid Build Coastguard WorkerEthan Sommer fixed <b>install</b> -Dt, 1446*cf5a6c84SAndroid Build Coastguard WorkerAndy Hu requested that <b>mount</b> handle mixed options like 1447*cf5a6c84SAndroid Build Coastguard Worker-tnomsdos,smbfs. 1448*cf5a6c84SAndroid Build Coastguard WorkerDenys Nykula reported a <b>chmod</b> regression, 1449*cf5a6c84SAndroid Build Coastguard Workerasm89 pointed out a <b>netcat</b> bug writing transactions larger than 1450*cf5a6c84SAndroid Build Coastguard Worker4k, 1451*cf5a6c84SAndroid Build Coastguard WorkerDaniel Santana fixed <b>df</b> combining -P and -k, 1452*cf5a6c84SAndroid Build Coastguard WorkerRobin Hsu fixed <b>grep</b> getting confused by libc setting errno when 1453*cf5a6c84SAndroid Build Coastguard Workera library function call succeeded. 1454*cf5a6c84SAndroid Build Coastguard WorkerPuck Meerburg taught the <b>gunzip</b> code not to be confused by FEXTRA entries 1455*cf5a6c84SAndroid Build Coastguard Worker(as described in RFC 1952) and added a test suite entry for that.</p> 1456*cf5a6c84SAndroid Build Coastguard Worker 1457*cf5a6c84SAndroid Build Coastguard Worker<p><b>find</b> handles empty arguments properly now (with test), <b>date</b> 1458*cf5a6c84SAndroid Build Coastguard Worker-I with no arguments no longer segfaults, <b>grep</b> -f /dev/null no 1459*cf5a6c84SAndroid Build Coastguard Workerlonger adds a "" regex matching everything, -z no longer splits patterns 1460*cf5a6c84SAndroid Build Coastguard Workeron \n, and -o can print zero length matches, 1461*cf5a6c84SAndroid Build Coastguard Worker<b>cp</b> -t works with one argument and with --parents. 1462*cf5a6c84SAndroid Build Coastguard Worker<b>readelf</b> displays properly in 80 columns and doesn't reject .bss 1463*cf5a6c84SAndroid Build Coastguard Workeroff end of file, and <b>sed</b> s///2 now works when there isn't more than one 1464*cf5a6c84SAndroid Build Coastguard Workermatch. 1465*cf5a6c84SAndroid Build Coastguard Worker<b>tar</b> now removes empty directories where it wants to put a non-directory. 1466*cf5a6c84SAndroid Build Coastguard Worker<b>microcom</b> sets serial device terminal attributes correctly.</p> 1467*cf5a6c84SAndroid Build Coastguard Worker 1468*cf5a6c84SAndroid Build Coastguard Worker<p>The prebuilt x86-64 binaries shouldn't segfault on older x86-64 processors 1469*cf5a6c84SAndroid Build Coastguard Workeranymore (workaround for gcc bug). 1470*cf5a6c84SAndroid Build Coastguard WorkerCross compiling was sometimes confusing install.sh because it created 1471*cf5a6c84SAndroid Build Coastguard Workera hyphenated "toybox-$TARGET" and then tried to make symlinks to just "toybox".</p> 1472*cf5a6c84SAndroid Build Coastguard Worker 1473*cf5a6c84SAndroid Build Coastguard Worker<p><u>Build</u>: 1474*cf5a6c84SAndroid Build Coastguard WorkerCONFIG_TOYBOX_I18N went away: toybox builds always support utf8 now. 1475*cf5a6c84SAndroid Build Coastguard WorkerElla-0 added OpenBSD support (but not a separate defconfig, try 1476*cf5a6c84SAndroid Build Coastguard Worker"make freebsd_defconfig").</p> 1477*cf5a6c84SAndroid Build Coastguard Worker 1478*cf5a6c84SAndroid Build Coastguard Worker<p><u>Library</u>: 1479*cf5a6c84SAndroid Build Coastguard Workerutf8towc() is now unsigned instead of wchar_t, matching wctoutf8(). 1480*cf5a6c84SAndroid Build Coastguard Workerxclose() tests if fd is -1 so the caller doesn't have to. 1481*cf5a6c84SAndroid Build Coastguard Workertxpect (the test suite's built-in "expect", implemented in shell) can 1482*cf5a6c84SAndroid Build Coastguard Workernow do regex matches, and sh.test uses this.</p> 1483*cf5a6c84SAndroid Build Coastguard Worker 1484*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott added the failing regex to the xregcomp() error message, and 1485*cf5a6c84SAndroid Build Coastguard Workermade multiple portability tweaks (header tweaks to build in more 1486*cf5a6c84SAndroid Build Coastguard Workerenvironments, running tests on Raspberry Pi OS and under mksh, 1487*cf5a6c84SAndroid Build Coastguard Workerfix utf8 locale selection on macos).</p> 1488*cf5a6c84SAndroid Build Coastguard Worker 1489*cf5a6c84SAndroid Build Coastguard Worker<p><u>Docs</u>: 1490*cf5a6c84SAndroid Build Coastguard Worker<b>chmod</b>'s help text explains why o+s doesn't set +t (and has a 1491*cf5a6c84SAndroid Build Coastguard Workertest for it). The <b>echo</b> help text is more compact. 1492*cf5a6c84SAndroid Build Coastguard WorkerChecked in a better conversion of <a href=https://landley.net/toybox/toycans.png>toycans.png</a>.</p> 1493*cf5a6c84SAndroid Build Coastguard Worker 1494*cf5a6c84SAndroid Build Coastguard Worker<a name="24-10-2020" /><a href="#24-10-2020"><hr><h2><b>October 24, 2020</b></h2></a> 1495*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p> 1496*cf5a6c84SAndroid Build Coastguard Worker"We are now cruising at a level of two to the power of twenty-five thousand to 1497*cf5a6c84SAndroid Build Coastguard Workerone against and falling, and we will be restoring normality just as soon as we 1498*cf5a6c84SAndroid Build Coastguard Workerare sure what is normal anyway."</p> 1499*cf5a6c84SAndroid Build Coastguard Worker<p>- The Hitchhiker's Guide to the Galaxy</p> 1500*cf5a6c84SAndroid Build Coastguard Worker</blockquote> 1501*cf5a6c84SAndroid Build Coastguard Worker 1502*cf5a6c84SAndroid Build Coastguard Worker<p>After a longer and slightly more 1503*cf5a6c84SAndroid Build Coastguard Worker<a href=https://github.com/landley/toybox/commit/07a896862ddf>turbulent</a> 1504*cf5a6c84SAndroid Build Coastguard Workerdevelopment cycle than some, 1505*cf5a6c84SAndroid Build Coastguard Worker<a href=downloads/toybox-0.8.4.tar.gz>Toybox 0.8.4</a> 1506*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.8.4>git commit</a>) 1507*cf5a6c84SAndroid Build Coastguard Workeris out with new commands <b>sha3sum</b> and <b><a href=https://github.com/landley/toybox/commit/6b4c32ae3986>watchdog</a></b>.</p> 1508*cf5a6c84SAndroid Build Coastguard Worker 1509*cf5a6c84SAndroid Build Coastguard Worker<p>There are <a href=downloads/binaries/mkroot/0.8.4>prebuilt mkroot binaries</a> 1510*cf5a6c84SAndroid Build Coastguard Workernow, tiny toybox linux systems for a dozen architectures, all bootable under 1511*cf5a6c84SAndroid Build Coastguard Workerqemu. (The vmlinux in each tarball is a vanilla linux-5.9 kernel built 1512*cf5a6c84SAndroid Build Coastguard Workerfrom the included config file.)</p> 1513*cf5a6c84SAndroid Build Coastguard Worker 1514*cf5a6c84SAndroid Build Coastguard Worker<p>The FAQ got <a href=faq.html>noticeably larger</a>, and the README has 1515*cf5a6c84SAndroid Build Coastguard Workermore links. New command features include the <b>sed -s</b> flag, 1516*cf5a6c84SAndroid Build Coastguard Worker<b>cpio --no-preserve-owner</b> now affects archive creation, 1517*cf5a6c84SAndroid Build Coastguard WorkerElliott added <b>tar -I</b> and multi-type 1518*cf5a6c84SAndroid Build Coastguard Worker<b>find -type a,b,c</b> support, Mark Salyzyn added <b>xargs -P</b> to 1519*cf5a6c84SAndroid Build Coastguard Workerrun parallel jobs, the <b>ps</b> and <b>top</b> commands 1520*cf5a6c84SAndroid Build Coastguard Workernow autodetect pid length, and <b>top</b> adjusts units for memory display based on 1521*cf5a6c84SAndroid Build Coastguard Workersystem size.</p> 1522*cf5a6c84SAndroid Build Coastguard Worker 1523*cf5a6c84SAndroid Build Coastguard Worker<p><u>Toysh and toyroot</u>: 1524*cf5a6c84SAndroid Build Coastguard Workerlots of new work on <b>toysh</b>: 29 commits to sh.c since last release, adding 1500 1525*cf5a6c84SAndroid Build Coastguard Workerlines and deleting 700, plus a bunch of sh.tests entries). Since last release 1526*cf5a6c84SAndroid Build Coastguard Workerwe implemented wildcards, case/esac and select, brace expansion sequences 1527*cf5a6c84SAndroid Build Coastguard Worker(ala {1..10..2} and {a..z}), 1528*cf5a6c84SAndroid Build Coastguard Workerthe remaining variable slice types ${a#y} ${a%y} ${a^y} ${a,y} 1529*cf5a6c84SAndroid Build Coastguard Worker${a/search/replace}, the "<b>source</b>" shell builtin, 1530*cf5a6c84SAndroid Build Coastguard Workerthe start of job control, and several bugfixes. 1531*cf5a6c84SAndroid Build Coastguard WorkerPlus the standalone "<b>make sh</b>" build understands MAYFORK now. It's 1532*cf5a6c84SAndroid Build Coastguard Workerstill missing features like functions() and $((math)) but it's getting 1533*cf5a6c84SAndroid Build Coastguard Workerclose to usable now.</p> 1534*cf5a6c84SAndroid Build Coastguard Worker 1535*cf5a6c84SAndroid Build Coastguard Worker<p><u>Documentation</u>: 1536*cf5a6c84SAndroid Build Coastguard WorkerSome of the README contents moved to the FAQ, and the README's "presentations" 1537*cf5a6c84SAndroid Build Coastguard Workersection got some new links. Several new <a href=faq.html>FAQ</a> entries explaining things like 1538*cf5a6c84SAndroid Build Coastguard Workermkroot ("how do I build a working Linux system 1539*cf5a6c84SAndroid Build Coastguard Workerwith toybox"), cross compiling (how to get/setup the 2 compilers and 1540*cf5a6c84SAndroid Build Coastguard Worker3 libc we regression test against), and "where does toybox fit into the 1541*cf5a6c84SAndroid Build Coastguard Workerlinux/android ecosystem". 1542*cf5a6c84SAndroid Build Coastguard WorkerThe "toybox --help" output now lists the project's web page (<a href=https://github.com/landley/toybox/issues/50>by request</a>). 1543*cf5a6c84SAndroid Build Coastguard WorkerElliott removed 1544*cf5a6c84SAndroid Build Coastguard Workergetevent (an android board bringup/hardware debugging tool built by running 1545*cf5a6c84SAndroid Build Coastguard Workera python script against kernel headers, not really in scope for toybox), 1546*cf5a6c84SAndroid Build Coastguard Workerfixed xargs help formatting, and taught the toybox multiplexer's 1547*cf5a6c84SAndroid Build Coastguard Workercommand list output (and "kill -l") to measure the current the terminal width 1548*cf5a6c84SAndroid Build Coastguard Workerwhen wordwrapping (previously hardwired to 80 columns). 1549*cf5a6c84SAndroid Build Coastguard WorkerIf you're curious, I checked in my <a href=www/release.txt>release procedure 1550*cf5a6c84SAndroid Build Coastguard Workerchecklist</a>, and 1551*cf5a6c84SAndroid Build Coastguard Workerfixed a stale link in the nav bar on the left ("statistics" changed domains). 1552*cf5a6c84SAndroid Build Coastguard WorkerFiras Khalil Khana fixed some issues in the roadmap, and Rob 1553*cf5a6c84SAndroid Build Coastguard Workertweaked the roadmap so status.html is slightly more current.</p> 1554*cf5a6c84SAndroid Build Coastguard Worker 1555*cf5a6c84SAndroid Build Coastguard Worker<p><u>Tests</u>: 1556*cf5a6c84SAndroid Build Coastguard WorkerThe "make tests" target now fails if any of the tests it ran failed. 1557*cf5a6c84SAndroid Build Coastguard WorkerLots of TEST_HOST tests got fixed (checking for specific error messages exposes 1558*cf5a6c84SAndroid Build Coastguard WorkerTEST_HOST to version skew, and scripts/test.sh will now skip TEST_HOST 1559*cf5a6c84SAndroid Build Coastguard Workercommands that aren't installed) and added toyonly annotations as necessary 1560*cf5a6c84SAndroid Build Coastguard Worker(replacing most uses of SKIP_HOST). 1561*cf5a6c84SAndroid Build Coastguard WorkerEric Molitor added automated github tests on MacOS and Ubuntu using their 1562*cf5a6c84SAndroid Build Coastguard Worker"workflows" thing. 1563*cf5a6c84SAndroid Build Coastguard WorkerThe clang asan plumbing slows some code down more than 10 times, so some testing timeouts were expanded. 1564*cf5a6c84SAndroid Build Coastguard Worker 1565*cf5a6c84SAndroid Build Coastguard Worker<p><u>Pending</u>: 1566*cf5a6c84SAndroid Build Coastguard WorkerEric Molitor did a bunch of work on route: moved it to sbin, added xsend and 1567*cf5a6c84SAndroid Build Coastguard Workerxrecv, taught display_routes() and setroute to use the rtnetlink API and 1568*cf5a6c84SAndroid Build Coastguard Workerdo hostname lookups, added support for mss, win, and irtt, merged ipv6 and ipv4 1569*cf5a6c84SAndroid Build Coastguard Workercodepaths with autodetection of address type, implemented RTA_CACHEINFO 1570*cf5a6c84SAndroid Build Coastguard Workersupport, switched exit paths to perror_exit(), and removed unused code. 1571*cf5a6c84SAndroid Build Coastguard WorkerEthan Sommer fixed warnings in dhcpd, removed a bunch of unnecessary 1572*cf5a6c84SAndroid Build Coastguard Worker; after GLOBALS() blocks and an unnecessary return in df. 1573*cf5a6c84SAndroid Build Coastguard WorkerErik Moqvist fixed dns setting in the dhcp client. 1574*cf5a6c84SAndroid Build Coastguard WorkerRob did some cleanup on bootchartd, traceroute, getty... 1575*cf5a6c84SAndroid Build Coastguard WorkerElliott fixed getty to reliably update utmp. 1576*cf5a6c84SAndroid Build Coastguard WorkerChris Sarra added ipv6 support to wget. 1577*cf5a6c84SAndroid Build Coastguard WorkerAriadne Conill submitted several small fixes from testing Alpine Linux with 1578*cf5a6c84SAndroid Build Coastguard Workertoybox, and Antoni Villalonga i Noceras fixed typos in error messages.</p> 1579*cf5a6c84SAndroid Build Coastguard Worker 1580*cf5a6c84SAndroid Build Coastguard Worker<p><u>Bugfixes</u>: 1581*cf5a6c84SAndroid Build Coastguard WorkerElliott avoided sign extension in devmem, and Ethan Sommer switched it from 1582*cf5a6c84SAndroid Build Coastguard Workergetpagesize() to posix sysconf(_SC_PAGESIZE). 1583*cf5a6c84SAndroid Build Coastguard WorkerElliott fixed chmod -R 1584*cf5a6c84SAndroid Build Coastguard Workerignoring dangling symlinks, fixed stty <a href=https://github.com/landley/toybox/issues/251>misparsing c_iflags</a>, fixed the chattr f2fs test with 1585*cf5a6c84SAndroid Build Coastguard Workercompression enabled, taught blkid not to show empty tags, taught xparsedate() 1586*cf5a6c84SAndroid Build Coastguard Workerto read date's default output format, fixed a recent echo -e \0 regression, 1587*cf5a6c84SAndroid Build Coastguard Workerchanged cpio -p parsing to match a <a href=http://lists.landley.net/pipermail/toybox-landley.net/2020-August/011955.html>bug</a> in the gnu version 1588*cf5a6c84SAndroid Build Coastguard Workerwhich an existing script <a href=https://github.com/landley/toybox/commit/fa1af3b085cc>depended on</a>, 1589*cf5a6c84SAndroid Build Coastguard Workerand switched hwclock back to looking 1590*cf5a6c84SAndroid Build Coastguard Workeronly at /dev/rtc0 for <a href=https://github.com/landley/toybox/commit/70e2232ce61c>reasons</a> involving kernel version skew and vendor bug reports.</p> 1591*cf5a6c84SAndroid Build Coastguard Worker 1592*cf5a6c84SAndroid Build Coastguard Worker<p>David Legault pointed out that unescape2() (and thus echo -e) wasn't handling 1593*cf5a6c84SAndroid Build Coastguard Worker\0 right. 1594*cf5a6c84SAndroid Build Coastguard WorkerKhem Raj reported that mips glibc doesn't have SIGSTKFLT, leading to 1595*cf5a6c84SAndroid Build Coastguard Workera build break if we assume glibc behaves consistently, which led to a bunch of 1596*cf5a6c84SAndroid Build Coastguard Workermacos signal portability cleanups from Elliott. 1597*cf5a6c84SAndroid Build Coastguard WorkerWilliam Djupström fixed tar extracting long file paths, adding hardlinks 1598*cf5a6c84SAndroid Build Coastguard Workerto an archive, and reported that --exclude wasn't working. 1599*cf5a6c84SAndroid Build Coastguard WorkerPeter McConalogue pointed out that cp/mv -i prompt should 1600*cf5a6c84SAndroid Build Coastguard Workerdefault N, and mv should only prompt when stdin is a tty. 1601*cf5a6c84SAndroid Build Coastguard WorkerPatrick Oppenlander made rtcwake and hwclock default to UTC if /dev/adjtime 1602*cf5a6c84SAndroid Build Coastguard Workerisn't available, suggested watchdog catch SIGINT, and caught an 1603*cf5a6c84SAndroid Build Coastguard Workeruninitialized offset in blkdiscard which gcc apparently didn't. 1604*cf5a6c84SAndroid Build Coastguard WorkerRyan Pritchard reported that <b>file</b> wasn't getting gif heights right, 1605*cf5a6c84SAndroid Build Coastguard Workerand Elliott added gif version output so TEST_HOST provided similar output. 1606*cf5a6c84SAndroid Build Coastguard WorkerMartin Stjernholm fixed <b>cp -P</b> to not follow symlinks and updated 1607*cf5a6c84SAndroid Build Coastguard Workerthe help text to say it's not the default. 1608*cf5a6c84SAndroid Build Coastguard WorkerAntoni Villalonga added more --long asiases to <b>chgrp/chown/rmdir</b>. 1609*cf5a6c84SAndroid Build Coastguard Worker 1610*cf5a6c84SAndroid Build Coastguard Worker<p>The symlink indirection code subtly broke xexec() so it would still try to call 1611*cf5a6c84SAndroid Build Coastguard Workera builtin when given a path to a command (fixed now). 1612*cf5a6c84SAndroid Build Coastguard WorkerThe code to trip \n off xgetline() was using the length of the allocation 1613*cf5a6c84SAndroid Build Coastguard Workerinstead of the length of the read. 1614*cf5a6c84SAndroid Build Coastguard WorkerNetcat no longer leaks sockfd into child processes. 1615*cf5a6c84SAndroid Build Coastguard WorkerPatch "fuzz" support was outputting context lines from the hunk, not the 1616*cf5a6c84SAndroid Build Coastguard Workerfile. Chrisrfq fixed i2cdetect parameter reading. 1617*cf5a6c84SAndroid Build Coastguard WorkerChris Sarra taught dd not to throw an error trying to truncate device files, 1618*cf5a6c84SAndroid Build Coastguard Workeradded a misshing fflush() to lib/password.c, fixed a parse error in logger 1619*cf5a6c84SAndroid Build Coastguard Workerpreventing local facility logging from working right, taught init 1620*cf5a6c84SAndroid Build Coastguard Workerto reload inittab when it receives SIGHUP, and fixed a memory leak in tar.</p> 1621*cf5a6c84SAndroid Build Coastguard Worker 1622*cf5a6c84SAndroid Build Coastguard Worker<p><u>Library</u>: 1623*cf5a6c84SAndroid Build Coastguard WorkerNew xvdaemon() function daemonizing on nommu systems, to wean commands 1624*cf5a6c84SAndroid Build Coastguard Workeroff daemon() which requires TOYBOX_FORK. 1625*cf5a6c84SAndroid Build Coastguard WorkerTeach sendfile_len() to use copy_file_range() when available, with compile 1626*cf5a6c84SAndroid Build Coastguard Workertime probe. Fix xsignal_all_killers() to install the correct handler. 1627*cf5a6c84SAndroid Build Coastguard WorkerRob switched dirtree_path() to a non-recursive implementation, and 1628*cf5a6c84SAndroid Build Coastguard Workertaught dirtree that a top level entry named "" is equivalent to 1629*cf5a6c84SAndroid Build Coastguard Worker"." but should not show up in dirtree_path(), 1630*cf5a6c84SAndroid Build Coastguard Workerread_password() now reads from tty device rather than stdin, and handles ctrl-c and ctrl-d, and 1631*cf5a6c84SAndroid Build Coastguard Workerhuman_readable() now has HR_NODOT so it can print single digit numbers without going "0.0". 1632*cf5a6c84SAndroid Build Coastguard WorkerPetri Gynther increased the vmstat column sizes so it didn't fit 1633*cf5a6c84SAndroid Build Coastguard Workerin 80 columns anymore. 1634*cf5a6c84SAndroid Build Coastguard WorkerElliott added UTC offset support to xparsedate().</p> 1635*cf5a6c84SAndroid Build Coastguard Worker 1636*cf5a6c84SAndroid Build Coastguard Worker<p><u>Infrastructure</u>: 1637*cf5a6c84SAndroid Build Coastguard Workermkroot now only passes --no-preserve-owner to cpio (so initramfs files 1638*cf5a6c84SAndroid Build Coastguard Workerbelong to root rather than whichever user ran the build) when using toybox's 1639*cf5a6c84SAndroid Build Coastguard Workerversion, because the other one is brain-damaged and errors out not 1640*cf5a6c84SAndroid Build Coastguard Workerunderstanding it. (It understands it for extract, but not create. Yes really.) 1641*cf5a6c84SAndroid Build Coastguard WorkerNew PENDING variable you can set to enable more than just sh and route out 1642*cf5a6c84SAndroid Build Coastguard Workerof pending. 1643*cf5a6c84SAndroid Build Coastguard WorkerThe "make distclean" no longer deletes root_download (where mkroot's "extra plumbing" 1644*cf5a6c84SAndroid Build Coastguard Workerfile saves source code downloads it tarballs, such as dropbear).</p> 1645*cf5a6c84SAndroid Build Coastguard Worker 1646*cf5a6c84SAndroid Build Coastguard Worker<p><u>Cleanup</u>: 1647*cf5a6c84SAndroid Build Coastguard WorkerCleanup openvt (35 lines added, 78 lines removed) 1648*cf5a6c84SAndroid Build Coastguard WorkerCleanup blkdiscard so lib/args.c parses the -o and -l numbers, which means 1649*cf5a6c84SAndroid Build Coastguard Worker32 bit systems are limited to 2 gigabyte sizes which is a TODO item systemwide. 1650*cf5a6c84SAndroid Build Coastguard Workeroneit now uses flag macros and mentions -rn in the help. demo-utf8towc 1651*cf5a6c84SAndroid Build Coastguard Workernow has main.c call setlocale for it. 1652*cf5a6c84SAndroid Build Coastguard WorkerSome cleanup on stty.</p> 1653*cf5a6c84SAndroid Build Coastguard Worker 1654*cf5a6c84SAndroid Build Coastguard Worker<a name="11-05-2020" /><a href="#11-05-2020"><hr><h2><b>May 11, 2020</b></h2></a> 1655*cf5a6c84SAndroid Build Coastguard Worker<blockquote> 1656*cf5a6c84SAndroid Build Coastguard Worker<p>Ford: Ah. A 1657*cf5a6c84SAndroid Build Coastguard Worker<a href=https://www.youtube.com/watch?v=WSsR419HBpQ>towel</a>. 1658*cf5a6c84SAndroid Build Coastguard WorkerKeep this and guard it with your life.</p> 1659*cf5a6c84SAndroid Build Coastguard Worker<p>Arthur: Huh?</p> 1660*cf5a6c84SAndroid Build Coastguard Worker<p>Ford: Listen, it's a tough universe. There's all sorts of people and things 1661*cf5a6c84SAndroid Build Coastguard Workertrying to do you, kill you, rip you off, everything. If you're going to 1662*cf5a6c84SAndroid Build Coastguard Workersurvive out there, you've really got to know where your 1663*cf5a6c84SAndroid Build Coastguard Worker<a href=towel.jpg>towel</a> is.</p> 1664*cf5a6c84SAndroid Build Coastguard Worker<p>- The Hitchhiker's Guide to the Galaxy</p> 1665*cf5a6c84SAndroid Build Coastguard Worker</blockquote> 1666*cf5a6c84SAndroid Build Coastguard Worker 1667*cf5a6c84SAndroid Build Coastguard Worker<p>Despite everything <a href=downloads/toybox-0.8.3.tar.gz>Toybox 0.8.3</a> 1668*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.8.3>git commit</a>) 1669*cf5a6c84SAndroid Build Coastguard Workeris finally out, with new commands <b>rtcwake</b> from Elliott Hughes and 1670*cf5a6c84SAndroid Build Coastguard Worker<b>blkdiscard</b> from Patrick Oppenlander. 1671*cf5a6c84SAndroid Build Coastguard WorkerThe big news is "<b>make root</b>" now boots to a shell prompt, 1672*cf5a6c84SAndroid Build Coastguard Workerwith toysh making it all the way through toyroot's init script. 1673*cf5a6c84SAndroid Build Coastguard Worker(Some people were looking forward to <b>patch --fuzz</b> support too.)</p> 1674*cf5a6c84SAndroid Build Coastguard Worker 1675*cf5a6c84SAndroid Build Coastguard Worker<p><u>Toyroot</u>: <b>make root</b> now does what it says on the tin, it 1676*cf5a6c84SAndroid Build Coastguard Workerbuilds a bootable toybox-based Linux system using two source 1677*cf5a6c84SAndroid Build Coastguard Workerpackages (toybox and linux). The trivial version is "make root && sudo chroot 1678*cf5a6c84SAndroid Build Coastguard Workerroot/host/fs /init". Here's 1679*cf5a6c84SAndroid Build Coastguard Workera <a href=http://lists.landley.net/pipermail/toybox-landley.net/2020-April/011667.html>post with instructions</a> if you want to know how to build the 1680*cf5a6c84SAndroid Build Coastguard Workercross compilers for testing the various architectures. The self-contained 1681*cf5a6c84SAndroid Build Coastguard Worker<a href=https://github.com/landley/toybox/blob/0.8.3/scripts/mkroot.sh>script 1682*cf5a6c84SAndroid Build Coastguard Workerthat builds a simple bootable Linux system</a> is 250 lines long, and 1683*cf5a6c84SAndroid Build Coastguard Workershould be easy to read if you want to know how it works.</p> 1684*cf5a6c84SAndroid Build Coastguard Worker 1685*cf5a6c84SAndroid Build Coastguard Worker<p>It also has basic module support, meaning arguments that aren't X=Y variable 1686*cf5a6c84SAndroid Build Coastguard Workerassignments are the names of scripts to run to build more 1687*cf5a6c84SAndroid Build Coastguard Workerpackages at the end of the build. I checked in an <a href=https://github.com/landley/toybox/blob/master/scripts/root/dropbear>example package</a>, 1688*cf5a6c84SAndroid Build Coastguard Workerand there's generic "download and extract source tarballs" 1689*cf5a6c84SAndroid Build Coastguard Worker<a href=https://github.com/landley/toybox/blob/master/scripts/root/plumbing>plumbing</a> available to such modules. 1690*cf5a6c84SAndroid Build Coastguard Worker(The Makefile doesn't know how to pass module names through to the script, 1691*cf5a6c84SAndroid Build Coastguard Workerso instead of "make root" you have to 1692*cf5a6c84SAndroid Build Coastguard Workercall the script directly, ala "scripts/mkroot.sh CROSS=sh4 LINUX=~/linux dropbear".)</p> 1693*cf5a6c84SAndroid Build Coastguard Worker 1694*cf5a6c84SAndroid Build Coastguard Worker<p>The resulting root filesystem now uses /root as the home 1695*cf5a6c84SAndroid Build Coastguard Workerdir for UID 0, and creates /dev/fd and /dev/shm in devtmpfs. The build works 1696*cf5a6c84SAndroid Build Coastguard Workeraround a kernel 1697*cf5a6c84SAndroid Build Coastguard Workerbuild bug where "make distclean" doesn't work in a "cp -sfR" symlink 1698*cf5a6c84SAndroid Build Coastguard Workerdirectory. (The bug meant if you pointed LINUX= at unclean source, it was 1699*cf5a6c84SAndroid Build Coastguard Workerunhappy, so now it distcleans the source directory before copying it. This 1700*cf5a6c84SAndroid Build Coastguard Workermodifies said source directory, which is not ideal, but as usual the kernel guys 1701*cf5a6c84SAndroid Build Coastguard Worker<a href=http://lkml.iu.edu/hypermail/linux/kernel/2002.2/00083.html>ignored 1702*cf5a6c84SAndroid Build Coastguard Workerthe bug report</a>, so a workaround was required.) 1703*cf5a6c84SAndroid Build Coastguard WorkerThe CROSS=all build announces each target in the title bar, puts 1704*cf5a6c84SAndroid Build Coastguard Workerits logs into root/log, and has better trap handling to stop with one 1705*cf5a6c84SAndroid Build Coastguard Workerctrl-c. 1706*cf5a6c84SAndroid Build Coastguard WorkerSince last release it uses a more concise config format for the various kernel 1707*cf5a6c84SAndroid Build Coastguard Workerarch targets (which shrank the script by about 50%), and merged 1708*cf5a6c84SAndroid Build Coastguard Workerthe old (now removed) scripts/cross.sh into the main script so 1709*cf5a6c84SAndroid Build Coastguard Worker"make CROSS=armv7l LINUX=~/linux" is 1710*cf5a6c84SAndroid Build Coastguard Workerliterally just a call to "scripts/mkroot.sh CROSS=armv7l LINUX=~/linux" now.</p> 1711*cf5a6c84SAndroid Build Coastguard Worker 1712*cf5a6c84SAndroid Build Coastguard Worker<p>As for <b>scripts/mcm-buildall.sh</b> building cross compilers, 1713*cf5a6c84SAndroid Build Coastguard Workerof COURSE gcc 8.3 requires a different configuration to build the same 1714*cf5a6c84SAndroid Build Coastguard Workertoolchain as previous versions, it's gcc. It now builds a proper 1715*cf5a6c84SAndroid Build Coastguard Workernommu libc for sh2eb without a broken fork() call in it that can never 1716*cf5a6c84SAndroid Build Coastguard Workerbe used but prevents compile-time probes from detecting nommu, 1717*cf5a6c84SAndroid Build Coastguard Workerand checks that the cross compiler completed before trying to build 1718*cf5a6c84SAndroid Build Coastguard Workerthe native compiler.</p> 1719*cf5a6c84SAndroid Build Coastguard Worker 1720*cf5a6c84SAndroid Build Coastguard Worker<p>This was all tested with a recent 1721*cf5a6c84SAndroid Build Coastguard Worker<a href=https://github.com/richfelker/musl-cross-make/commit/5086175f2902>version</a> 1722*cf5a6c84SAndroid Build Coastguard Workerof musl-cross-make with the top level Makefile 1723*cf5a6c84SAndroid Build Coastguard Workeredited to use BINUTILS_VER = 2.32 because the newer one 1724*cf5a6c84SAndroid Build Coastguard Worker<a href=https://www.spinics.net/lists/linux-sh/msg56844.html>breaks the kernel 1725*cf5a6c84SAndroid Build Coastguard Workerbuild</a> 1726*cf5a6c84SAndroid Build Coastguard Workerand LINUX_VER = 4.19.90 because the default musl-cross-make config uses an 1727*cf5a6c84SAndroid Build Coastguard Workerout-of-tree headers package for some reason (those who forget history are 1728*cf5a6c84SAndroid Build Coastguard Worker<a href=https://lkml.org/lkml/2006/4/28/194>doomed to repeat it</a>) which 1729*cf5a6c84SAndroid Build Coastguard Workerbreaks m68k and s390x. I won't post binaries of the resulting toolchains 1730*cf5a6c84SAndroid Build Coastguard Workerbecause they're GPLv3, but <a href=https://musl.cc/>Thalheim might</a>. 1731*cf5a6c84SAndroid Build Coastguard Worker(I've also <a href=http://lists.landley.net/pipermail/toybox-landley.net/2020-May/011673.html>test built</a> 1732*cf5a6c84SAndroid Build Coastguard Workerwith the Android NDK, but bionic's startup code currently segfaults before 1733*cf5a6c84SAndroid Build Coastguard Workercalling main() if it can't open /dev/null, and the kernel guys 1734*cf5a6c84SAndroid Build Coastguard Worker<a href=https://lkml.org/lkml/2017/9/13/651>ignored my patches</a> to 1735*cf5a6c84SAndroid Build Coastguard Workermake CONFIG_DEVTMPFS_MOUNT work in initramfs.)</p> 1736*cf5a6c84SAndroid Build Coastguard Worker 1737*cf5a6c84SAndroid Build Coastguard Worker<p>At the moment toyroot cheats and uses two commands out of pending: toysh 1738*cf5a6c84SAndroid Build Coastguard Workeris about 80% of the way to being useful but still missing some 1739*cf5a6c84SAndroid Build Coastguard Workerobvious features like function support, job and terminal control, command 1740*cf5a6c84SAndroid Build Coastguard Workerhistory, $((math)), wildcard expansion... plus a lot of bash features like array 1741*cf5a6c84SAndroid Build Coastguard Workervariables, so it isn't out of pending yet. And route needs to be redone to use the 1742*cf5a6c84SAndroid Build Coastguard Workernetlink interface that can handle multiple routing tables. For the moment 1743*cf5a6c84SAndroid Build Coastguard Workerscripts/mkroot.sh adds both of them to defconfig if you haven't already 1744*cf5a6c84SAndroid Build Coastguard Workergot a .config when you run it. (If you build and can't boot, your .config 1745*cf5a6c84SAndroid Build Coastguard Workerprobably hasn't got CONFIG_SH switched on. Fix it in menuconfig, or 1746*cf5a6c84SAndroid Build Coastguard Workerrm .config and try gain.)</p> 1747*cf5a6c84SAndroid Build Coastguard Worker 1748*cf5a6c84SAndroid Build Coastguard Worker<p><u>New toybox features</u>: 1749*cf5a6c84SAndroid Build Coastguard WorkerElliott taught <b>patch</b> to understand [FILE [PATCH]] arguments, made 1750*cf5a6c84SAndroid Build Coastguard Worker<b>cal</b> highlight the current day, added -T to <b>cp</b>/<b>mv</b>, 1751*cf5a6c84SAndroid Build Coastguard Workerdid a lot of work on <b>lsattr</b>/<b>chattr</b> (including adding -p 1752*cf5a6c84SAndroid Build Coastguard Workerand "chattr ="), added tar --absolute-names, taught <b>id</b> to 1753*cf5a6c84SAndroid Build Coastguard Workersupport numeric lookup and handle unknown groups, made -G show all 1754*cf5a6c84SAndroid Build Coastguard Workergroups, and removed context= from -Z. 1755*cf5a6c84SAndroid Build Coastguard WorkerRob added <b>patch -F</b> (fuzz factor) support and <b>help -u</b> (usage only), 1756*cf5a6c84SAndroid Build Coastguard Workertaught <b>echo -e</b> about bash extensions like \uXXXX unicode escapes, 1757*cf5a6c84SAndroid Build Coastguard Worker<b>netcat -L</b> no longer automatically includes stderr (new -E 1758*cf5a6c84SAndroid Build Coastguard Workeroption does that), 1759*cf5a6c84SAndroid Build Coastguard Worker<b>setsid</b> now uses -c (like the man page says) instead of -t, and added 1760*cf5a6c84SAndroid Build Coastguard Worker-w (wait) and -d (detach from tty). 1761*cf5a6c84SAndroid Build Coastguard WorkerAndrew Ilijic added <b>ls -w</b>, removed trailing whitespace on output, 1762*cf5a6c84SAndroid Build Coastguard Workerand added tests for -C and -x.</p> 1763*cf5a6c84SAndroid Build Coastguard Worker 1764*cf5a6c84SAndroid Build Coastguard Worker<p><u>Library</u>: 1765*cf5a6c84SAndroid Build Coastguard Workeranother fix to 32 bit option parsing of long long optflag values, 1766*cf5a6c84SAndroid Build Coastguard Workerremove getdirname() and just use the libc function (which modifies 1767*cf5a6c84SAndroid Build Coastguard Workerits argument, but we don't have to free a malloc), 1768*cf5a6c84SAndroid Build Coastguard Workerdlist_terminate() can now be called repeatedly on the same list, 1769*cf5a6c84SAndroid Build Coastguard Workernew relative_path() function finds path from one directory to another, 1770*cf5a6c84SAndroid Build Coastguard Workerand readfd() works like readfile() but on an already open fd. 1771*cf5a6c84SAndroid Build Coastguard WorkerUse MPATH macros in mkpathat(). Elliott added macOS versions of 1772*cf5a6c84SAndroid Build Coastguard Workerdev_minor()/dev_major()/makedev() to portability.c, 1773*cf5a6c84SAndroid Build Coastguard Workerimplemented posix_fallocate() for macOS, removed a 1774*cf5a6c84SAndroid Build Coastguard Workerleftover uClibc workaround in fallocate that was breaking macOS, 1775*cf5a6c84SAndroid Build Coastguard Workerand moved the table of ELF architectures from file to lib/lib.c (so 1776*cf5a6c84SAndroid Build Coastguard Workerreadelf can share). 1777*cf5a6c84SAndroid Build Coastguard WorkerPark Ju Hyung pointed out the fast path of fdlength() was commented out, 1778*cf5a6c84SAndroid Build Coastguard Workerand we switched it to the 64 bit API while we were there (and then Elliott 1779*cf5a6c84SAndroid Build Coastguard Workeradded macOS support). 1780*cf5a6c84SAndroid Build Coastguard WorkerJoeky taught file to recognize 7z archives.</p> 1781*cf5a6c84SAndroid Build Coastguard Worker 1782*cf5a6c84SAndroid Build Coastguard Worker<p><u>Pending</u>: 1783*cf5a6c84SAndroid Build Coastguard WorkerThe shell got a bunch of work: standalone "make sh" now includes the 1784*cf5a6c84SAndroid Build Coastguard Workermultiplexer for builtin commands like "exit" and "cd". Added MAYFORK annotation 1785*cf5a6c84SAndroid Build Coastguard Workerfor commands that exist in the $PATH but can also be run within the shell 1786*cf5a6c84SAndroid Build Coastguard Workerprocess (and sometimes have different behavior within the shell): 1787*cf5a6c84SAndroid Build Coastguard Workercurrently applied to help, echo, false, kill, printf, pwd, test, time, and 1788*cf5a6c84SAndroid Build Coastguard Workertrue.</p> 1789*cf5a6c84SAndroid Build Coastguard Worker 1790*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott added new commands <b>getopt</b> and <b>readelf</b>. 1791*cf5a6c84SAndroid Build Coastguard WorkerJarno Mäkipää taught wget how to follow http 301 and 302 redirects, 1792*cf5a6c84SAndroid Build Coastguard Workerand did lots of work on vi. (Elliott also did work on vi.) 1793*cf5a6c84SAndroid Build Coastguard WorkerGavin Howard fixed a comparison bug in bc. 1794*cf5a6c84SAndroid Build Coastguard WorkerEthan Sommer fixed numerous small issues (including several build 1795*cf5a6c84SAndroid Build Coastguard Workerwarnings and FLAG() macro conversions).</p> 1796*cf5a6c84SAndroid Build Coastguard Worker 1797*cf5a6c84SAndroid Build Coastguard Worker<p><u>Bugfixes</u>: 1798*cf5a6c84SAndroid Build Coastguard Worker<b>tar</b> extract now deletes files and symlinks where it's making a directory, 1799*cf5a6c84SAndroid Build Coastguard Worker<b>find -L -type -l</b> now finds dangling symlinks, extra #ifdefs in 1800*cf5a6c84SAndroid Build Coastguard Workerportability.h prevent old gcc versions from barfing on __has_include(), 1801*cf5a6c84SAndroid Build Coastguard Workerxgetline() now returns NULL at EOF, tee with no arguments was 1802*cf5a6c84SAndroid Build Coastguard Workerwriting to stdout twice, setsid works on nommu (I.E. vfork) now, 1803*cf5a6c84SAndroid Build Coastguard Worker<b>netcat -L</b> no longer accumulates zombie processes, 1804*cf5a6c84SAndroid Build Coastguard Worker<b>sntp</b> now uses adjtimex instead of adjtime (to build on bionic). 1805*cf5a6c84SAndroid Build Coastguard Workerxcreate_stdio() was checking WARN_ONLY in the wrong field (and tar was 1806*cf5a6c84SAndroid Build Coastguard Workerpassing it in the wrong field, so it worked there). 1807*cf5a6c84SAndroid Build Coastguard WorkerSeveral people wrestled with the <b>xargs</b> "argument too long" problem. 1808*cf5a6c84SAndroid Build Coastguard WorkerAlessio Balsini fixed memory leaks in loopback_setup() and "wayling" 1809*cf5a6c84SAndroid Build Coastguard Workeradded a missing continue to losetup. 1810*cf5a6c84SAndroid Build Coastguard WorkerElliott fixed xargs -E, various things in modinfo, 1811*cf5a6c84SAndroid Build Coastguard Workeradded an error check to gzip when using zlib (which copies non-gzip data to 1812*cf5a6c84SAndroid Build Coastguard Workerthe output verbatim for some reason), 1813*cf5a6c84SAndroid Build Coastguard Workerfound an case where dirtree could use 1814*cf5a6c84SAndroid Build Coastguard Workeruninitialized data and silenced "Invalid argument" warnings (triggered by 1815*cf5a6c84SAndroid Build Coastguard WorkerAndroid's selinux policies making stat() and readlink() fail), 1816*cf5a6c84SAndroid Build Coastguard Workerfixed locale support in macOS (both in iconv 1817*cf5a6c84SAndroid Build Coastguard Workerand in main.c), taught stat to show filesystem time on macOS, 1818*cf5a6c84SAndroid Build Coastguard Workerfixed a 32 bit truncation in sntp, fixed a memory access one byte outside 1819*cf5a6c84SAndroid Build Coastguard Workerof its array in patch.c, removed the cpio --trailer option, 1820*cf5a6c84SAndroid Build Coastguard Workerand widened the pid display fields in ps to 1821*cf5a6c84SAndroid Build Coastguard Worker6 digits. Rich Felker fixed find.c assuming 1822*cf5a6c84SAndroid Build Coastguard Workertime_t is a long (y2038 issue on 32 bit). 1823*cf5a6c84SAndroid Build Coastguard WorkerGreg Kaiser fixed a thinko in get_block_device_size(). 1824*cf5a6c84SAndroid Build Coastguard WorkerJarno Mäkipää fixed utf8 support in cut -C, and cp --parents. 1825*cf5a6c84SAndroid Build Coastguard WorkerDavid Legault complained that dir/.* tells rm to delete dir/.. and we'd do it. 1826*cf5a6c84SAndroid Build Coastguard WorkerJakeSFR pointed out a bug in file's identification of broken symlinks. 1827*cf5a6c84SAndroid Build Coastguard WorkerWilliam Haddon fixed cp to treat a directory with a trailing slash 1828*cf5a6c84SAndroid Build Coastguard Workerteh same as one without. 1829*cf5a6c84SAndroid Build Coastguard WorkerDenys Nykula fixed rm -i not to prompt for an empty "" argument. 1830*cf5a6c84SAndroid Build Coastguard WorkerSebiderSushi reported that chmod g+s wasn't working. 1831*cf5a6c84SAndroid Build Coastguard WorkerThe linux kernel doesn't let an O_PATH fd work with fgetxattr(), so 1832*cf5a6c84SAndroid Build Coastguard WorkerElliott switched <b>ls</b> to use the path-based functions now (which is racy, 1833*cf5a6c84SAndroid Build Coastguard Workerit means you can stat() one inode and get the xattrs for a different one, 1834*cf5a6c84SAndroid Build Coastguard Workerbut nobody in kernel land seems to use xattrs much so they're not fully 1835*cf5a6c84SAndroid Build Coastguard Workersupported by the API, and who's crazy enough to use xattrs for security 1836*cf5a6c84SAndroid Build Coastguard Workeranyway). Derick Pallas pointed out an xclearenv() bug. 1837*cf5a6c84SAndroid Build Coastguard WorkerAtatsulo (or possibly luolongjuna) did a lot of work on the <b>ping</b> 1838*cf5a6c84SAndroid Build Coastguard Workercommand: pointed out min/range/max were out of order, 1839*cf5a6c84SAndroid Build Coastguard Workerthat we shouldn't print a summary unless we received at least one 1840*cf5a6c84SAndroid Build Coastguard Workerreply packet, and implemented ttl support.</p> 1841*cf5a6c84SAndroid Build Coastguard Worker 1842*cf5a6c84SAndroid Build Coastguard Worker<p><u>Build plumbing</u>: 1843*cf5a6c84SAndroid Build Coastguard WorkerThe "make root CROSS=all" build announces each target in the title bar, puts 1844*cf5a6c84SAndroid Build Coastguard Workerits logs into root/log, and has better trap handling to stop with one 1845*cf5a6c84SAndroid Build Coastguard Workerctrl-c.</p> 1846*cf5a6c84SAndroid Build Coastguard Worker 1847*cf5a6c84SAndroid Build Coastguard Worker<p>Fixed scripts/single.sh to work when PREFIX has no trailing slash, 1848*cf5a6c84SAndroid Build Coastguard Workermake silentoldconfig no longer feeds "y" to kconfig (which puts menus in a 1849*cf5a6c84SAndroid Build Coastguard Workerloop) and instead just feeds in newlines to accept whatever the default is. 1850*cf5a6c84SAndroid Build Coastguard WorkerThe non-git version number I keep forgetting to update each release moved 1851*cf5a6c84SAndroid Build Coastguard Workerfrom main.c to toys.h. 1852*cf5a6c84SAndroid Build Coastguard WorkerFixed a couple different errors in mkflags.c (one of which caused ls --color 1853*cf5a6c84SAndroid Build Coastguard Workerto set all the other flags).</p> 1854*cf5a6c84SAndroid Build Coastguard Worker 1855*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott added more macos support and tests, and added 1856*cf5a6c84SAndroid Build Coastguard Workerfallocate, cp, mktemp, and mv to the macOS defconfig.</p> 1857*cf5a6c84SAndroid Build Coastguard Worker 1858*cf5a6c84SAndroid Build Coastguard Worker<p><u>Cleanup</u>: 1859*cf5a6c84SAndroid Build Coastguard WorkerRob did some cleanup on xargs, ls, md5sum, and sort, tidied up main.c a bit, 1860*cf5a6c84SAndroid Build Coastguard Workermade cp, base64, dmesg, and free use FLAG macros, 1861*cf5a6c84SAndroid Build Coastguard Workerand switched fallocate to new style global names. 1862*cf5a6c84SAndroid Build Coastguard WorkerElliott Hughes switched rfkill from the old byte at a time get_line() 1863*cf5a6c84SAndroid Build Coastguard Workerto libc getline(), made du use FLAG() macros, and mad chattr use 1864*cf5a6c84SAndroid Build Coastguard Workerstandard toybox argument parsing for -v and -p. 1865*cf5a6c84SAndroid Build Coastguard WorkerSeveral commands (help, cp) had sub-options removed from menuconfig. 1866*cf5a6c84SAndroid Build Coastguard WorkerMerged realpath into readlink.c, and use xabspath() instead of libc realpath().</p> 1867*cf5a6c84SAndroid Build Coastguard Worker 1868*cf5a6c84SAndroid Build Coastguard Worker<p><u>Documentation</u>: 1869*cf5a6c84SAndroid Build Coastguard WorkerNew roadmap section about <a href=roadmap.html#packages>other packages</a> 1870*cf5a6c84SAndroid Build Coastguard Workerthat toybox can (eventually) replace.</p> 1871*cf5a6c84SAndroid Build Coastguard Worker 1872*cf5a6c84SAndroid Build Coastguard Worker<p>Update roadmap to note that posix-2008 moved to a different URL (content 1873*cf5a6c84SAndroid Build Coastguard Workerat the old URL undergoes random changes), and link to the IETF RFCs. 1874*cf5a6c84SAndroid Build Coastguard Workerdesign.html explains more of the history of environment sizes on links 1875*cf5a6c84SAndroid Build Coastguard Workerand has a #bits anchor tag.</p> 1876*cf5a6c84SAndroid Build Coastguard Worker 1877*cf5a6c84SAndroid Build Coastguard Worker<p>Update the <a href=design.html#bits>LP64 section</a> of design.html to 1878*cf5a6c84SAndroid Build Coastguard Workerfish the documents out of archive.org now that unix.org is gone, 1879*cf5a6c84SAndroid Build Coastguard Workerand show the actual size table locally.</p> 1880*cf5a6c84SAndroid Build Coastguard Worker 1881*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott improved the help of <b>date</b> and <b>chattr</b>, and 1882*cf5a6c84SAndroid Build Coastguard Workermade the usage: lines in the posix directory more consistent.</p> 1883*cf5a6c84SAndroid Build Coastguard Worker 1884*cf5a6c84SAndroid Build Coastguard Worker<p>Shrank the sed help from 150 lines to 90-ish.</p> 1885*cf5a6c84SAndroid Build Coastguard Worker 1886*cf5a6c84SAndroid Build Coastguard Worker<p><u>Tests</u>: 1887*cf5a6c84SAndroid Build Coastguard WorkerNew "txpect" performs interactive tests, running through a sequence of 1888*cf5a6c84SAndroid Build Coastguard Workerwrites to a command's stdin and reads from stdout and stderr, when failing it 1889*cf5a6c84SAndroid Build Coastguard Workerreports the first non-matching step. (This for example lets sh.test check 1890*cf5a6c84SAndroid Build Coastguard Workerthe shell line continuation logic prompts with $PS1 and $PS2 appropriately 1891*cf5a6c84SAndroid Build Coastguard Workerwith various unfinished input lines, and that "echo hello; if" doesn't 1892*cf5a6c84SAndroid Build Coastguard Workeroutput hello before prompting for the next line of input.) Added 1893*cf5a6c84SAndroid Build Coastguard WorkerVERBOSE=xpect to print out each read and write successfully performed by txpect.</p> 1894*cf5a6c84SAndroid Build Coastguard Worker 1895*cf5a6c84SAndroid Build Coastguard Worker<p>runtest.sh only creates an "input" file when the input argument isn't empty, 1896*cf5a6c84SAndroid Build Coastguard WorkerEVAL doesn't supply -- (you have to provide your own if you want that).</p> 1897*cf5a6c84SAndroid Build Coastguard Worker 1898*cf5a6c84SAndroid Build Coastguard Worker<p>Rob added basic <b>stat</b>, <b>patch</b>, and <b>tee</b> tests. 1899*cf5a6c84SAndroid Build Coastguard WorkerJarno added a bunch of <b>vi</b> tests. 1900*cf5a6c84SAndroid Build Coastguard WorkerElliott fixed tests for <b>ifconfig</b>, <b>lsattr</b>, <b>chattr</b>, 1901*cf5a6c84SAndroid Build Coastguard Workerand <b>date</b>, added tests for find, id, xargs, and made 1902*cf5a6c84SAndroid Build Coastguard Workerthe id, iconv, env, file, printf and cat tests work on macOS (and skipped 1903*cf5a6c84SAndroid Build Coastguard Workerthe du tests there). Rob cleaned up chmod tests.</p> 1904*cf5a6c84SAndroid Build Coastguard Worker 1905*cf5a6c84SAndroid Build Coastguard Worker<p><u>Sheer pedantry</u>: 1906*cf5a6c84SAndroid Build Coastguard Workertrue and false now have usage: lines (which you have to "help false" to see 1907*cf5a6c84SAndroid Build Coastguard Workerbecause they (intentionally!) don't support --help. 1908*cf5a6c84SAndroid Build Coastguard WorkerRenamed get_chunk()/dump_chunk() to read_chunk()/write_chunk() in tail.c 1909*cf5a6c84SAndroid Build Coastguard WorkerElliott fixed some typos.</p> 1910*cf5a6c84SAndroid Build Coastguard Worker 1911*cf5a6c84SAndroid Build Coastguard Worker<a name="18-10-2019" /><a href="#18-10-2019"><hr><h2><b>October 18, 2019</b></h2></a> 1912*cf5a6c84SAndroid Build Coastguard Worker<blockquote> 1913*cf5a6c84SAndroid Build Coastguard Worker<p>"In those days spirits were brave, the stakes were high, men were real 1914*cf5a6c84SAndroid Build Coastguard Workermen, women were real women and small furry creatures from Alpha Centauri 1915*cf5a6c84SAndroid Build Coastguard Workerwere real small furry creatures from Alpha Centauri." 1916*cf5a6c84SAndroid Build Coastguard Worker</p> <p>- The Hitchhiker's Guide to the Galaxy</p> 1917*cf5a6c84SAndroid Build Coastguard Worker</blockquote> 1918*cf5a6c84SAndroid Build Coastguard Worker 1919*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.8.2.tar.gz>Toybox 0.8.2</a> 1920*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.8.2>git commit</a>) 1921*cf5a6c84SAndroid Build Coastguard Workeris finally out (only two months late).</p> 1922*cf5a6c84SAndroid Build Coastguard Worker 1923*cf5a6c84SAndroid Build Coastguard Worker<p>The new commands this time are minor variants of existing ones 1924*cf5a6c84SAndroid Build Coastguard Worker(<b>dnsdomainname</b> is hostname -d, <b>arch</b> is uname -m), but about 1925*cf5a6c84SAndroid Build Coastguard Worker1/3 of toysh got implemented in pending, <a href=https://github.com/landley/mkroot>mkroot</a> got merged as a "make root" target (see Build), 1926*cf5a6c84SAndroid Build Coastguard Workerand Android's <a href=http://lists.landley.net/pipermail/toybox-landley.net/2019-August/010845.html>hermetic build</a> 1927*cf5a6c84SAndroid Build Coastguard Workerwork continued resulting in a lot of fixes.</p> 1928*cf5a6c84SAndroid Build Coastguard Worker 1929*cf5a6c84SAndroid Build Coastguard Worker<p>The android-specific <b>getprop</b>, <b>setprop</b>, <b>start</b>, and <b>stop</b> 1930*cf5a6c84SAndroid Build Coastguard Workercommands were removed from toybox because they grew dependencies on android 1931*cf5a6c84SAndroid Build Coastguard Workerlibraries, and since toybox tries to avoid mandatory external dependencies 1932*cf5a6c84SAndroid Build Coastguard Workerthey moved to another package.</p> 1933*cf5a6c84SAndroid Build Coastguard Worker 1934*cf5a6c84SAndroid Build Coastguard Worker<p><u>Build</u>: 1935*cf5a6c84SAndroid Build Coastguard WorkerThe new "make root" target builds a simple toybox root filesystem, 1936*cf5a6c84SAndroid Build Coastguard Workerusing scripts/mkroot.sh which is a stripped 1937*cf5a6c84SAndroid Build Coastguard Workerdown version of the external <a href=https://github.com/landley/mkroot>mkroot</a> 1938*cf5a6c84SAndroid Build Coastguard Workerproject merged into toybox. (Alas, at the moment it wants sh and route out 1939*cf5a6c84SAndroid Build Coastguard Workerof pending, which aren't quite load bearing yet.)</p> 1940*cf5a6c84SAndroid Build Coastguard Worker 1941*cf5a6c84SAndroid Build Coastguard Worker<p>The new "scripts/mcm-buildall.sh" convenience script builds cross 1942*cf5a6c84SAndroid Build Coastguard Workercompilers based on gcc+musl multiple targets (arm, x86, mips, m68k, s390, 1943*cf5a6c84SAndroid Build Coastguard Workermicroblaze...) 1944*cf5a6c84SAndroid Build Coastguard Workerusing <a href=https://github.com/richfelker/musl-cross-make>musl-cross-make</a>, 1945*cf5a6c84SAndroid Build Coastguard Workerand a new scripts/cross.sh to easily cross compile for one or more targets 1946*cf5a6c84SAndroid Build Coastguard Workerusing the resulting compilers. (This works with "make root", "make 1947*cf5a6c84SAndroid Build Coastguard Workertoybox", and other builds understanding the CROSS_COMPILE environment variable.)</p> 1948*cf5a6c84SAndroid Build Coastguard Worker 1949*cf5a6c84SAndroid Build Coastguard Worker<p>Setting the environment variable ASAN=1 enables the 1950*cf5a6c84SAndroid Build Coastguard Workerllvm address sanitizer. (You may need to 1951*cf5a6c84SAndroid Build Coastguard Workerexport ASAN_SYMBOLIZER_PATH on debian to use it, they add the version number to 1952*cf5a6c84SAndroid Build Coastguard Workerthe filename in /usr/bin which confuses llvm.)</p> 1953*cf5a6c84SAndroid Build Coastguard Worker 1954*cf5a6c84SAndroid Build Coastguard Worker<p>Patrick Oppenlander fixed make -j (our make is a wrapper around 1955*cf5a6c84SAndroid Build Coastguard Workerscripts/make.sh which was already doing a parallel build, but if you called 1956*cf5a6c84SAndroid Build Coastguard Workermake with -j it wouldn't wait for make.sh to finish and the build broke).</b> 1957*cf5a6c84SAndroid Build Coastguard Worker 1958*cf5a6c84SAndroid Build Coastguard Worker<p>Lots of fixes for the MacOS build.</p> 1959*cf5a6c84SAndroid Build Coastguard Worker 1960*cf5a6c84SAndroid Build Coastguard Worker<p><u>New options</u>: 1961*cf5a6c84SAndroid Build Coastguard WorkerWe upgraded <b>tar</b> to extract some older tarballs, <b>file</b> added -b and -s 1962*cf5a6c84SAndroid Build Coastguard Workeroptions and can also recognize older tarballs, 1963*cf5a6c84SAndroid Build Coastguard Workersome xz archives, .otf fonts, perf/simpleperf data files, 1964*cf5a6c84SAndroid Build Coastguard Workerandroid boot images, and dtb files. Upgraded <b>file</b> to show the device type 1965*cf5a6c84SAndroid Build Coastguard Workerfor block and char devices, the target for symlinks, and it says _why_ it can't 1966*cf5a6c84SAndroid Build Coastguard Workeropen a file.</p> 1967*cf5a6c84SAndroid Build Coastguard Worker 1968*cf5a6c84SAndroid Build Coastguard Worker<p>Several commands ignore some options rather than erroring on them: 1969*cf5a6c84SAndroid Build Coastguard Worker<b>patch</b> ignores the -f -g# and --no-backup-if-mismatch options 1970*cf5a6c84SAndroid Build Coastguard Worker(all of which we were already doing by default anyway), and <b>xargs</b> 1971*cf5a6c84SAndroid Build Coastguard Workerignores -P# (which requests parallel execution, maybe add it later but 1972*cf5a6c84SAndroid Build Coastguard Workersingle threading works), and Denys Nykula made <b>wget</b> ignore 1973*cf5a6c84SAndroid Build Coastguard Worker--no-check-ceritificate and <b>gzip</b> ignore -n (again, we weren't doing 1974*cf5a6c84SAndroid Build Coastguard Workereither anyway) to satisfy pkgsrc.</p> 1975*cf5a6c84SAndroid Build Coastguard Worker 1976*cf5a6c84SAndroid Build Coastguard Worker<p>William Haddon taught <b>diff</b> and <b>patch</b> to support special characters in path 1977*cf5a6c84SAndroid Build Coastguard Workernames (via quoting) and more timestamp formats. 1978*cf5a6c84SAndroid Build Coastguard WorkerEric Molitor implemented <b>nl</b> -v (with negative and zero starting values), 1979*cf5a6c84SAndroid Build Coastguard Workerand fixed a MacOS compatibility issue in the build scripts. 1980*cf5a6c84SAndroid Build Coastguard WorkerTom Cherry added <b>netcat</b> -U (UNIX domain socket support). 1981*cf5a6c84SAndroid Build Coastguard WorkerDenys Nykula taught <b>wget</b> to call ftpget for ftp:// URLs. 1982*cf5a6c84SAndroid Build Coastguard WorkerEthan Sommer added ln -t and rmdir --ignore-fail-on-non-empty. 1983*cf5a6c84SAndroid Build Coastguard WorkerElliott Hughes added <b>grep</b> -R, <b>killall</b> -w, tar --mode, 1984*cf5a6c84SAndroid Build Coastguard Worker fixed <b>ls</b> -Z and spacing in -lZ and --full-time, 1985*cf5a6c84SAndroid Build Coastguard Workeradded <b>xargs</b> --max-args and removed xargs -I (which we never actually 1986*cf5a6c84SAndroid Build Coastguard Workersupported) and tweaked the size calculation to more closely match other 1987*cf5a6c84SAndroid Build Coastguard Workerversions, 1988*cf5a6c84SAndroid Build Coastguard Workeradded xargs -o and made -p read from /dev/tty, added <b>blkid</b> -s, SEC_TYPE for ext3, 1989*cf5a6c84SAndroid Build Coastguard Workermsdos, and ntfs, f2fs and ntfs LABEL, fixed vfat/ntfs UUID, and switched 1990*cf5a6c84SAndroid Build Coastguard Workerthe endianness for UUID of msdos/ntfs/vfat, simplified the octal mode 1991*cf5a6c84SAndroid Build Coastguard Workerdisplay in <b>lsof</b>, added <b>pidof</b> -x (thus making the default behavior _not_ 1992*cf5a6c84SAndroid Build Coastguard Workerbe -x).</p> 1993*cf5a6c84SAndroid Build Coastguard Worker 1994*cf5a6c84SAndroid Build Coastguard Worker<p>When readdir() succeeds but stat() fails, <b>ls</b> now prints "??? ? ? filename" 1995*cf5a6c84SAndroid Build Coastguard Workerentries instead of "cannot access" errors. (Still trying to make ls / on 1996*cf5a6c84SAndroid Build Coastguard Workerandroid work more gracefully with the SELinux weirdness they added in 9.)</p> 1997*cf5a6c84SAndroid Build Coastguard Worker 1998*cf5a6c84SAndroid Build Coastguard Worker<p>Added %C to <b>stat</b> and made it show device type in its default output, 1999*cf5a6c84SAndroid Build Coastguard Worker<b>cmp</b> now works 2000*cf5a6c84SAndroid Build Coastguard Workerwith 1 argument (implicit - as second argument reading from stdin). 2001*cf5a6c84SAndroid Build Coastguard Worker<b>sed</b> added exit codes to the q command (q123), added Q, and fixed a 2002*cf5a6c84SAndroid Build Coastguard Workerbad error message with "!". 2003*cf5a6c84SAndroid Build Coastguard WorkerRemoved TAIL_SEEK config option (it just always does that now), 2004*cf5a6c84SAndroid Build Coastguard Worker<b>find</b> grew several new options (%Z, -true, -false, and -newerXY), <b>ln</b> added -T. 2005*cf5a6c84SAndroid Build Coastguard WorkerThe argument to <b>mktmp</b> --tmpdir is now optional.</p> 2006*cf5a6c84SAndroid Build Coastguard Worker 2007*cf5a6c84SAndroid Build Coastguard Worker<p><u>Bugfixes</u>: 2008*cf5a6c84SAndroid Build Coastguard WorkerThe unshare probe bit-rotted so it was impossible to build <b>unshare</b> 2009*cf5a6c84SAndroid Build Coastguard Workerand <b>nsenter</b> on some distros. 2010*cf5a6c84SAndroid Build Coastguard WorkerCommit 771e94e2a08 broke toybox's ability to say "unknown command" when 2011*cf5a6c84SAndroid Build Coastguard Workeryou pointed a symlink at it that it that didn't correspond to a command, 2012*cf5a6c84SAndroid Build Coastguard Workerpointing a symlink at another symlink 2013*cf5a6c84SAndroid Build Coastguard Workerto make toybox run a command under a name it doesn't recognize 2014*cf5a6c84SAndroid Build Coastguard Worker(ln -s toybox sh; ln -s sh ash) had an off by one error, 2015*cf5a6c84SAndroid Build Coastguard Worker<b>ifconfig</b> no longer error_exits if the "read mac address" ioctl fails (Android N 2016*cf5a6c84SAndroid Build Coastguard Workerand later block that for non-root users to prevent device tracking). 2017*cf5a6c84SAndroid Build Coastguard WorkerWhen the libcrypto library was disabled, md5sum was building commands it 2018*cf5a6c84SAndroid Build Coastguard Workerhasn't got built-in support for yet (like sha3sum) which acted like redundant 2019*cf5a6c84SAndroid Build Coastguard Workercopies of md5sum, 2020*cf5a6c84SAndroid Build Coastguard Worker<b>tar</b> wasn't correctly reading or writing sparse files with a hole at 2021*cf5a6c84SAndroid Build Coastguard Workerthe end, and tar tzf blah.tar.xz was calling xz when it meant xzcat, 2022*cf5a6c84SAndroid Build Coastguard Worker<b>xargs</b> would spuriously fail on large memory systems (due to a missing 2023*cf5a6c84SAndroid Build Coastguard Worker"unsigned" in a typecast), 2024*cf5a6c84SAndroid Build Coastguard Worker<b>basename</b> can now remove suffixes starting with a dash, 2025*cf5a6c84SAndroid Build Coastguard Worker<b>cp</b> -r unlinks() an existing symlink before trying to 2026*cf5a6c84SAndroid Build Coastguard Workerrecreate the symlink (otherwise cp -r into an existing directory will 2027*cf5a6c84SAndroid Build Coastguard Workertry to follow the existing symlink and create another symlink at its 2028*cf5a6c84SAndroid Build Coastguard Workerdestination, failing if a file already exists there, which 2029*cf5a6c84SAndroid Build Coastguard Workerwas confusing gentoo's package manager), <b>timeout</b> now produces the 2030*cf5a6c84SAndroid Build Coastguard Workerright exit code when the timed command intercepts the exit signal, 2031*cf5a6c84SAndroid Build Coastguard Workerand <b>hostname</b> -d no longer segfaults on machines with no domain name.</p> 2032*cf5a6c84SAndroid Build Coastguard Worker 2033*cf5a6c84SAndroid Build Coastguard Worker<p>Denys Nykula fixed the <b>ftpget</b> freeze (it was sending REST instead 2034*cf5a6c84SAndroid Build Coastguard Workerof RETR), made <b>mv</b> work with a trailing slash in the source, 2035*cf5a6c84SAndroid Build Coastguard Workerfixed a <b>find</b> segfault, 2036*cf5a6c84SAndroid Build Coastguard Workerand made <b>env</b> always exec rather than recursing to a builtin 2037*cf5a6c84SAndroid Build Coastguard Worker(on the theory #!/usr/bin/env is expected to search the $PATH).</p> 2038*cf5a6c84SAndroid Build Coastguard Worker 2039*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott improved <b>killall</b>'s handling of long filenames, made <b>kill</b> work 2040*cf5a6c84SAndroid Build Coastguard Workerwhen killall5 is disabled (missing FORCE_FLAGS), fixed error reporting in 2041*cf5a6c84SAndroid Build Coastguard Worker<b>hostname</b>, fixed several things in <b>xargs</b>, 2042*cf5a6c84SAndroid Build Coastguard Workermade <b>printf</b> \c and \0 octal escapes work, fixed a <b>find</b> -name corner 2043*cf5a6c84SAndroid Build Coastguard Workercase (find src/*.c -name file.c) and find dangling symlink behavior, 2044*cf5a6c84SAndroid Build Coastguard Workermade some <b>rm</b> error messages consistent, fixed \x behavior in echo and 2045*cf5a6c84SAndroid Build Coastguard Workerprintf, fixed linestack.c's buffer length for utf8 U+XXXX escape printing, 2046*cf5a6c84SAndroid Build Coastguard Workerfixed a race in <b>losetup</b>, fixed <b>grep</b> -F with multiple matches on the same 2047*cf5a6c84SAndroid Build Coastguard Workerline and an -I failure in the existing grep tests, made <b>readlink</b> notice 2048*cf5a6c84SAndroid Build Coastguard Workerwhen it has more than one argument, and made various 2049*cf5a6c84SAndroid Build Coastguard Workerfixes to <b>modinfo</b>.</p> 2050*cf5a6c84SAndroid Build Coastguard Worker 2051*cf5a6c84SAndroid Build Coastguard Worker<p>Ethan Sommer reported that <b>stat</b> of an suid/sticky file output 5 digits of 2052*cf5a6c84SAndroid Build Coastguard Workeroctal stat date instead of 4. 2053*cf5a6c84SAndroid Build Coastguard WorkerRob fixed an unaligned access in <b>grep</b>. Alessio Balsini removed an incorrect 2054*cf5a6c84SAndroid Build Coastguard Workernull termination in <b>losetup</b>. 2055*cf5a6c84SAndroid Build Coastguard WorkerJarno Mäkipää fixed <b>hexedit</b> 2056*cf5a6c84SAndroid Build Coastguard Workerscrolling up and down on older terminals, and fixed <b>ls</b> segfaulting with a broken 2057*cf5a6c84SAndroid Build Coastguard Worker(non-UTF8) locale (didn't expect wcrtomb to return -1). 2058*cf5a6c84SAndroid Build Coastguard WorkerAndrew Ilijic made ls put 2 spaces between columns like other implementations 2059*cf5a6c84SAndroid Build Coastguard Worker(which helps when terminals get confused and apply UTF8 combining characters 2060*cf5a6c84SAndroid Build Coastguard Workerto the space after a filename). 2061*cf5a6c84SAndroid Build Coastguard Worker</p> 2062*cf5a6c84SAndroid Build Coastguard Worker 2063*cf5a6c84SAndroid Build Coastguard Worker<p><u>Library</u>: 2064*cf5a6c84SAndroid Build Coastguard WorkerAdded dlist_lpop() to use a dlist as a stack (it removes the last entry 2065*cf5a6c84SAndroid Build Coastguard Workerinstead of the first), and dlist_pop() now works on a dlist_terminate()d list. 2066*cf5a6c84SAndroid Build Coastguard WorkerDIRTREE_STATLESS returns entries we couldn't stat() (with a zeroed ->st 2067*cf5a6c84SAndroid Build Coastguard Workerfield, and ->again |= 2), but filling in the file type from readdir(). 2068*cf5a6c84SAndroid Build Coastguard WorkerCoversions between signal names and numbers now include all the Linux signals, 2069*cf5a6c84SAndroid Build Coastguard Workernot just posix ones. The functions sig_to_num() and num_to_sig() moved into 2070*cf5a6c84SAndroid Build Coastguard Workerlib/portability.h, because MacOS has different signals. 2071*cf5a6c84SAndroid Build Coastguard WorkerTOYFLAG_MAYFORK allows commands to run in toysh's process without forking, 2072*cf5a6c84SAndroid Build Coastguard Workerbut also makes them accessable from the toybox multiplexer or standalone. 2073*cf5a6c84SAndroid Build Coastguard WorkerA MAYFORK command has to clean up after itself (even in error paths) and 2074*cf5a6c84SAndroid Build Coastguard Workercan't discard anything we need to keep (such as closing stdout).</p> 2075*cf5a6c84SAndroid Build Coastguard Worker 2076*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott did a big xbind/xconnect cleanup (adding xbindany and xconnectany), 2077*cf5a6c84SAndroid Build Coastguard Workertaught xregcomp that an empty regex matches the whole line 2078*cf5a6c84SAndroid Build Coastguard Worker(because FreeBSD, and thus MacOS, doesn't already do that), and 2079*cf5a6c84SAndroid Build Coastguard Workerreplaced several uses of get_line() (which does single byte reads) 2080*cf5a6c84SAndroid Build Coastguard Workerwith getline() (which doesn't).</p> 2081*cf5a6c84SAndroid Build Coastguard Worker 2082*cf5a6c84SAndroid Build Coastguard Worker<p><u>Plumbing</u>: 2083*cf5a6c84SAndroid Build Coastguard Worker"make clean" doesn't produce a screenful of unnecessary output now, 2084*cf5a6c84SAndroid Build Coastguard Workerrm, ln, cp, kill, and netcat use the FLAG() macros now, makedevs uses the new 2085*cf5a6c84SAndroid Build Coastguard WorkerGLOBALS naming format, timeout now uses xwaitpid(), and we fixed an 2086*cf5a6c84SAndroid Build Coastguard Workeroff by one error in xwaitpid().</p> 2087*cf5a6c84SAndroid Build Coastguard Worker 2088*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott removed a workaround for old NDK versions from getconf and 2089*cf5a6c84SAndroid Build Coastguard Workermoved sort off of get_rawline() (which let us remove it). 2090*cf5a6c84SAndroid Build Coastguard WorkerRob undid some loop unrolling in md5sum/sha1sum (we have libcrypto if you want 2091*cf5a6c84SAndroid Build Coastguard Workeran assembly optimized version instead of an understandable version).</p> 2092*cf5a6c84SAndroid Build Coastguard Worker 2093*cf5a6c84SAndroid Build Coastguard Worker<p>Android ndk-r20 doesn't define the __ANDROID_NDK__ symbol, so we switched 2094*cf5a6c84SAndroid Build Coastguard Workerto using clang's __has_include() (which is an undefined macro and thus a NOP 2095*cf5a6c84SAndroid Build Coastguard Workerresolving to false on gcc).</p> 2096*cf5a6c84SAndroid Build Coastguard Worker 2097*cf5a6c84SAndroid Build Coastguard Worker<p><u>Pending</u>: 2098*cf5a6c84SAndroid Build Coastguard WorkerRob did a lot of work on toysh: continuation support works (it knows when to ask 2099*cf5a6c84SAndroid Build Coastguard Workerfor another line of text and when to run what it's got), as do 2100*cf5a6c84SAndroid Build Coastguard Workernested if/else/elif statements, and while and for loops (supporting "for i" 2101*cf5a6c84SAndroid Build Coastguard Workerand "for i in", but not for ((;;)) yet). 2102*cf5a6c84SAndroid Build Coastguard WorkerIt parses pipes and redirections but doesn't perform them yet. 2103*cf5a6c84SAndroid Build Coastguard WorkerThe next big todo chunk is environment variable resolution. 2104*cf5a6c84SAndroid Build Coastguard Worker</p> 2105*cf5a6c84SAndroid Build Coastguard Worker 2106*cf5a6c84SAndroid Build Coastguard Worker<p>Gavin Howard fixed some bugs in bc, such as not returning error when raising 2107*cf5a6c84SAndroid Build Coastguard Workerzero to a negative power. 2108*cf5a6c84SAndroid Build Coastguard WorkerJarno Mäkipää continues to extend vi, adding yank and push, support for tabs, 2109*cf5a6c84SAndroid Build Coastguard Workerrewriting delete, changing the drawing code, etc. Elliott also added several 2110*cf5a6c84SAndroid Build Coastguard Workerfixes and features to vi, 2111*cf5a6c84SAndroid Build Coastguard Workerfixed host to cope with large DNS responses, switched crontab to 2112*cf5a6c84SAndroid Build Coastguard Workeruse getline(), did work on man, fixed fixed several things in dd, 2113*cf5a6c84SAndroid Build Coastguard Workerimplemented diff --strip-trailing-cr and made diff not need /tmp. 2114*cf5a6c84SAndroid Build Coastguard WorkerMike Bennett added extended attribute support to ip.c's route change.</p> 2115*cf5a6c84SAndroid Build Coastguard Worker 2116*cf5a6c84SAndroid Build Coastguard Worker<p><u>Test suite</u>: The killall and pgrep tests were having occasional 2117*cf5a6c84SAndroid Build Coastguard Workerspurious failures due to a race condition (the test script would fork() 2118*cf5a6c84SAndroid Build Coastguard Workerto call sleep and for just a moment there were two instances of the test 2119*cf5a6c84SAndroid Build Coastguard Workerscript, reporting an extra process if killall or pgrep ran then). 2120*cf5a6c84SAndroid Build Coastguard Worker 2121*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott Hughes did a lot of work on the test suite: add kill -l tests, 2122*cf5a6c84SAndroid Build Coastguard Workermake losetup.test notice (and skip) if loopback 2123*cf5a6c84SAndroid Build Coastguard Workerdevices area already in use, blkid.test can TEST_HOST e2fsprogs blkid now, 2124*cf5a6c84SAndroid Build Coastguard Workermodinfo.test notices (and skips) if there's no /proc/modules or modules 2125*cf5a6c84SAndroid Build Coastguard Workerdirectory, ifconfig.test skips if "dummy0 up" fails and disabled the 2126*cf5a6c84SAndroid Build Coastguard Workerpointtopoint tests entirely (the kernel never supported it?), 2127*cf5a6c84SAndroid Build Coastguard Workertruncate.test is less 2128*cf5a6c84SAndroid Build Coastguard Workerconfused by SELinux, hostname.test can run some tests as non-root, 2129*cf5a6c84SAndroid Build Coastguard Workeraddressed a race condition in killall.test on slow systems, 2130*cf5a6c84SAndroid Build Coastguard Workermade chgrp.test, chown.test, and tar.test handle an empty /etc/passwd or /etc/group 2131*cf5a6c84SAndroid Build Coastguard Worker(we were checking whether they were _there_ but some android devics have 2132*cf5a6c84SAndroid Build Coastguard Workerempty ones), 2133*cf5a6c84SAndroid Build Coastguard Workerfixed a couple things in env.test, extended killall.test to explicitly cover 2134*cf5a6c84SAndroid Build Coastguard Workerlong and short names (and not assume the shell is /bin/sh), taught split.test not to rely on bash process substitution, 2135*cf5a6c84SAndroid Build Coastguard Workeradded missing TZ=utc to touch.test, fixed cp.test to pass for root 2136*cf5a6c84SAndroid Build Coastguard Workeror with a restrictive umask, and fixed the FAILCOUNT arithmetic to use more portable 2137*cf5a6c84SAndroid Build Coastguard Worker$(()). Elliott also made some tests more flexible (find.test can handle any 2138*cf5a6c84SAndroid Build Coastguard Workererror message about symlink loops, etc), and disabled others (such as du) 2139*cf5a6c84SAndroid Build Coastguard Workerwhen SELinux is enabled.</p> 2140*cf5a6c84SAndroid Build Coastguard Worker 2141*cf5a6c84SAndroid Build Coastguard Worker<p>Rob taught testcmd not to use the shell builtin for TEST_HOST unless there 2142*cf5a6c84SAndroid Build Coastguard Workerisn't one in the $PATH, work if $PWD has a space in it, 2143*cf5a6c84SAndroid Build Coastguard Workerand make kill.test stop testing the shell builtin 2144*cf5a6c84SAndroid Build Coastguard Workerinsead of the command, quieted tests that were producing output 2145*cf5a6c84SAndroid Build Coastguard Workerother than their PASS/FAIL line, and made NOSPACE tests ignore the 2146*cf5a6c84SAndroid Build Coastguard Workerpresence/absence of leading/trailing whitespace as well as differences 2147*cf5a6c84SAndroid Build Coastguard Workerin the amount of space.</p> 2148*cf5a6c84SAndroid Build Coastguard Worker 2149*cf5a6c84SAndroid Build Coastguard Worker<p><u>Documentation</u>: 2150*cf5a6c84SAndroid Build Coastguard WorkerThe <a href=roadmap.html>roadmap</a> got freshened up a bit, with updates 2151*cf5a6c84SAndroid Build Coastguard Workerfor android from Elliott. 2152*cf5a6c84SAndroid Build Coastguard WorkerIn <a href=design.html>the design page</a> the Features section starts with 2153*cf5a6c84SAndroid Build Coastguard Worker4 new paragraphs about the scope of toybox, and a new License section talks 2154*cf5a6c84SAndroid Build Coastguard Workerabout 0BSD. 2155*cf5a6c84SAndroid Build Coastguard WorkerThe "./toybox --help" output now explains how to do install_flat by hand.</p> 2156*cf5a6c84SAndroid Build Coastguard Worker 2157*cf5a6c84SAndroid Build Coastguard Worker<p><u>Sheer pedantry</u>: 2158*cf5a6c84SAndroid Build Coastguard WorkerElliott fixed a double close in loopfiles_lines() so strace doesn't 2159*cf5a6c84SAndroid Build Coastguard Workerhave an EBADF in it, and added a missing "static" in lib/net.c.</p> 2160*cf5a6c84SAndroid Build Coastguard Worker 2161*cf5a6c84SAndroid Build Coastguard Worker<a name="21-05-2019" /><a href="#21-05-2019"><hr><h2><b>May 21, 2019</b></h2></a> 2162*cf5a6c84SAndroid Build Coastguard Worker<blockquote> 2163*cf5a6c84SAndroid Build Coastguard Worker<p>"I like the cover," he said. "'Don't Panic.' It's the first helpful or intelligible thing anybody's said to me all day."</p> <p>- The Hitchhiker's Guide to the Galaxy</p> 2164*cf5a6c84SAndroid Build Coastguard Worker</blockquote> 2165*cf5a6c84SAndroid Build Coastguard Worker 2166*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.8.1.tar.gz>Toybox 0.8.1</a> 2167*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.8.1>git commit</a>) 2168*cf5a6c84SAndroid Build Coastguard Workeris out.</p> 2169*cf5a6c84SAndroid Build Coastguard Worker 2170*cf5a6c84SAndroid Build Coastguard Worker<p>Android is now using toybox as part of a <a href=http://lists.landley.net/pipermail/toybox-landley.net/2018-November/009824.html>"hermetic" build</a> 2171*cf5a6c84SAndroid Build Coastguard Worker(meaning Android is building under toybox, which is halfway to Android 2172*cf5a6c84SAndroid Build Coastguard Workerbuilding under Android). See Android's <a href=https://android.googlesource.com/platform/prebuilts/build-tools/+log>build-tools</a> and <a href=https://android.googlesource.com/platform/build/soong/+log>soong</a> repositories to follow along with development, or check the list for the <a href=http://lists.landley.net/pipermail/toybox-landley.net/2019-May/010485.html>current status</a>.</p> 2173*cf5a6c84SAndroid Build Coastguard Worker 2174*cf5a6c84SAndroid Build Coastguard Worker<p><u>New commands</u>: Isaac Dunham added <b>mcookie</b>, which is used by 2175*cf5a6c84SAndroid Build Coastguard WorkerX11. Elliott Hughes added <b>devmem</b>, which replaces toolbox's "r".</p> 2176*cf5a6c84SAndroid Build Coastguard Worker 2177*cf5a6c84SAndroid Build Coastguard Worker<p><u>Promoted</u>: <b>tar</b>, <b>gunzip</b>, and <b>zcat</b> were cleaned 2178*cf5a6c84SAndroid Build Coastguard Workerup and moved out of pending. 2179*cf5a6c84SAndroid Build Coastguard WorkerTar is a near-rewrite with support for --owner --group and --sparse, 2180*cf5a6c84SAndroid Build Coastguard Workercapable of autodetecting "wget blah.tar.bz2 -O - | tar xv", a --restrict option 2181*cf5a6c84SAndroid Build Coastguard Workerthat only allows files to extract into a single subdirectory, and so on.</p> 2182*cf5a6c84SAndroid Build Coastguard Worker 2183*cf5a6c84SAndroid Build Coastguard Worker<p><u>Added to pending</u>: 2184*cf5a6c84SAndroid Build Coastguard WorkerJarno Mäkipää contributed a new <b>vi</b> implementation. Makepost added 2185*cf5a6c84SAndroid Build Coastguard Worker<b>man</b>.</p> 2186*cf5a6c84SAndroid Build Coastguard Worker 2187*cf5a6c84SAndroid Build Coastguard Worker<p><u>Updates</u>: Elliott added <b>find</b> -wholename/-iwholename, -printf, 2188*cf5a6c84SAndroid Build Coastguard Workerand -context, <b>grep</b> --exclude-dir, and <b>echo</b> -E. 2189*cf5a6c84SAndroid Build Coastguard WorkerRob added <b>blkid</b> -U and -L, <b>mount</b> now has UUID= support via blkid -U, 2190*cf5a6c84SAndroid Build Coastguard Workeryou can now specify TZ="blah" in the <b>date</b> -d input string (although 2191*cf5a6c84SAndroid Build Coastguard Workerwhy the double quotes are required is an open question), and <b>sed</b> now 2192*cf5a6c84SAndroid Build Coastguard Workerunderstands ,+N relative ranges. Makepost added <b>rm</b> -v. 2193*cf5a6c84SAndroid Build Coastguard WorkerThe human_readable fields in <b>ps</b>/<b>top</b>/<b>iotop</b> now use all 2194*cf5a6c84SAndroid Build Coastguard Workeravailable space to show more precision, <b>iotop</b> displays swap bandwidth 2195*cf5a6c84SAndroid Build Coastguard Workerproperly (it was showing a signed field as unsigned), and 2196*cf5a6c84SAndroid Build Coastguard Worker<b>touch</b> -t and -d autodetect the time format.</p> 2197*cf5a6c84SAndroid Build Coastguard Worker 2198*cf5a6c84SAndroid Build Coastguard Worker<p><u>Cleanups</u>: In pending Rob did some bc cleanup, 2199*cf5a6c84SAndroid Build Coastguard WorkerColin Davidson did some arp cleanup, 2200*cf5a6c84SAndroid Build Coastguard WorkerUros Prestor fixed route argument parsing, and 2201*cf5a6c84SAndroid Build Coastguard Workerin bc Daniel Rosenberg fixed bc_vec_concat()'s allocation and 2202*cf5a6c84SAndroid Build Coastguard WorkerGavin Howard fixed an overflow bug in bc_num_ulong().</p> 2203*cf5a6c84SAndroid Build Coastguard Worker 2204*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott made scan_key() detect cursor keys and such with several more 2205*cf5a6c84SAndroid Build Coastguard Workerterminal types, made more better about directories and non-tty output, 2206*cf5a6c84SAndroid Build Coastguard Workercleaned up inconsistent uses of ARRAY_LEN(), taught file 2207*cf5a6c84SAndroid Build Coastguard Workerto recognize a c-sky ELF machine, and fixed timezone and daylight 2208*cf5a6c84SAndroid Build Coastguard Workersavings time issues in date and its tests. 2209*cf5a6c84SAndroid Build Coastguard WorkerRob simplified netcat and ping using new lib/net.c infrastructure. 2210*cf5a6c84SAndroid Build Coastguard WorkerWhen run as non-PID 1 (for a chroot) oneit's exit code now indicates 2211*cf5a6c84SAndroid Build Coastguard Workerwhich signal it's exiting due to. 2212*cf5a6c84SAndroid Build Coastguard WorkerHadrian Węgrzynowski #defined constants for mkpathat. 2213*cf5a6c84SAndroid Build Coastguard WorkerDate now uses the current time for unspecified fields (instead of zeroing 2214*cf5a6c84SAndroid Build Coastguard Workerthem), and should set the weekday properly. 2215*cf5a6c84SAndroid Build Coastguard WorkerSort's -k2.3,4.5 syntax is now documented and behaves more closely to 2216*cf5a6c84SAndroid Build Coastguard Workerother implementations (silly as that behavior is). 2217*cf5a6c84SAndroid Build Coastguard WorkerSignificant speedup to sed s/a/b/g on a megabyte long line (it was 2218*cf5a6c84SAndroid Build Coastguard WorkerO(n^2) and now it's quite snappy).</p> 2219*cf5a6c84SAndroid Build Coastguard Worker 2220*cf5a6c84SAndroid Build Coastguard Worker<p>Several cases of warning about stdout failing to write were silenced 2221*cf5a6c84SAndroid Build Coastguard Workerbecause things like piping the output to head means stdout is a special 2222*cf5a6c84SAndroid Build Coastguard Workercase: its output is often discarded and that's fine. And xprintf() 2223*cf5a6c84SAndroid Build Coastguard Workerand friends only checks stdout for errors so it can exit early ("yes | head" 2224*cf5a6c84SAndroid Build Coastguard Workershould not spin endlessly) without actually flushing anything. 2225*cf5a6c84SAndroid Build Coastguard WorkerThere's an ongoing design debate about line buffering stdin and stdout 2226*cf5a6c84SAndroid Build Coastguard Workerthat'll have to be resolved next dev cycle.</p> 2227*cf5a6c84SAndroid Build Coastguard Worker 2228*cf5a6c84SAndroid Build Coastguard Worker<p><u>Bugs</u>: 2229*cf5a6c84SAndroid Build Coastguard WorkerElliott sent in a lot of fixes for building AOSP with toybox: 2230*cf5a6c84SAndroid Build Coastguard Workersupport for more date formats, sed substitution of empty capture groups 2231*cf5a6c84SAndroid Build Coastguard Workerand an endless loop with -EPIPE, fixed find -path/-ipath, made loggit() 2232*cf5a6c84SAndroid Build Coastguard Workeronly feed LOG_AUTH to syslog when we have a tty, gave grep a bunch 2233*cf5a6c84SAndroid Build Coastguard Workerof --longname synonyms for short options, added getfattr --only-values, 2234*cf5a6c84SAndroid Build Coastguard Workerand timeout --foreground --preserve-status and --signal.</p> 2235*cf5a6c84SAndroid Build Coastguard Worker 2236*cf5a6c84SAndroid Build Coastguard Worker<p>Top got a lot of tweaks: it no longer collates thread's CPU usage into the 2237*cf5a6c84SAndroid Build Coastguard Workerparent thread (in -H mode), hides the cursor in interactive mode, updates the 2238*cf5a6c84SAndroid Build Coastguard Workerdisplay properly in batch mode, and accepts ENTER 2239*cf5a6c84SAndroid Build Coastguard Workeras a synonym for SPACE when refreshing the display. The header lines 2240*cf5a6c84SAndroid Build Coastguard Workernow abbreviate long numbers with units (via human_readable()), 2241*cf5a6c84SAndroid Build Coastguard Workermore reliably spans the terminal width, and says "Thread" instead 2242*cf5a6c84SAndroid Build Coastguard Workerof "Task" when it's showing threads. The task/thread count now adds up 2243*cf5a6c84SAndroid Build Coastguard Worker(understanding more kernel states and treating unknown ones as "sleeping"). 2244*cf5a6c84SAndroid Build Coastguard WorkerTop now treats -o "" as an error (previously it displayed an empty screen).</p> 2245*cf5a6c84SAndroid Build Coastguard Worker 2246*cf5a6c84SAndroid Build Coastguard Worker<p>William Djupström pointed out login needs to chown() the tty, and made it 2247*cf5a6c84SAndroid Build Coastguard Workerclear the environment when -p is absent. 2248*cf5a6c84SAndroid Build Coastguard WorkerVidar Holen fixed inverted find -exec exit status. 2249*cf5a6c84SAndroid Build Coastguard WorkerRob made chgrp() stop relying on libc's printf("%s", NULL) printing "(null)" 2250*cf5a6c84SAndroid Build Coastguard Workerbecause a <a href=https://github.com/varnishcache/varnish-cache/issues/2879>newly added gcc bug</a> turns that into a build break, and 2251*cf5a6c84SAndroid Build Coastguard Workerfixed an outright embarassing xstrndup() bug. 2252*cf5a6c84SAndroid Build Coastguard WorkerLiwugang fixed a segfault when stat's format string had a trailing %. 2253*cf5a6c84SAndroid Build Coastguard WorkerA missing else in grep meant -x was sometimes ignored.</p> 2254*cf5a6c84SAndroid Build Coastguard Worker 2255*cf5a6c84SAndroid Build Coastguard Worker<p><u>Infrastructure</u>: 2256*cf5a6c84SAndroid Build Coastguard Workerin the build scripts/portability.sh now tests that the compiler it's trying 2257*cf5a6c84SAndroid Build Coastguard Workerto use exists up front. We no longer link against librt because on glibc that's 2258*cf5a6c84SAndroid Build Coastguard Workerpulling in libpthread for some unknown reason.</p> 2259*cf5a6c84SAndroid Build Coastguard Worker 2260*cf5a6c84SAndroid Build Coastguard Worker<p>TOYFLAG_ARGFAIL() lets commands return custom exit values when option parsing 2261*cf5a6c84SAndroid Build Coastguard Workerfails (because AOSP build scripts cared), so timeout --unknown returns 125 2262*cf5a6c84SAndroid Build Coastguard Workerand so on: chroot, diff, cmp, env, grep, nohup, and sort also use it now with 2263*cf5a6c84SAndroid Build Coastguard Workervarious values.</p> 2264*cf5a6c84SAndroid Build Coastguard Worker 2265*cf5a6c84SAndroid Build Coastguard Worker<p>New FLAG() macros: FLAG(x) expands to (toys.optflags&FLAG_x) and returns 2266*cf5a6c84SAndroid Build Coastguard Workerzero if the command line argument's bit isn't set and nonzero if it is 2267*cf5a6c84SAndroid Build Coastguard Worker(meaning -x was or wasn't encountered on the command line this time by 2268*cf5a6c84SAndroid Build Coastguard Workerlib/args.c). Lots of commands got converted to use them.</p> 2269*cf5a6c84SAndroid Build Coastguard Worker 2270*cf5a6c84SAndroid Build Coastguard Worker<p>New lib/env.c with reset_env(), xsetenv(), and xunsetenv() which frees 2271*cf5a6c84SAndroid Build Coastguard Workerthe old environment variable when it wasn't inherited from exec(). This 2272*cf5a6c84SAndroid Build Coastguard Workerlets long-running loops reset environment variables without memory leaks.</p> 2273*cf5a6c84SAndroid Build Coastguard Worker 2274*cf5a6c84SAndroid Build Coastguard Worker<p>New xnotify() plumbing in lib/portability.c with Linux and Mac versions 2275*cf5a6c84SAndroid Build Coastguard Worker(which should also work on BSD).</p> 2276*cf5a6c84SAndroid Build Coastguard Worker 2277*cf5a6c84SAndroid Build Coastguard Worker<p>New xparsedate() and xvali_date() functions allow date, tar --mtime, and 2278*cf5a6c84SAndroid Build Coastguard Workertouch to understand the same date formats, 2279*cf5a6c84SAndroid Build Coastguard Workerxpopen_both() now knows how to use existing filehandles for the child's 2280*cf5a6c84SAndroid Build Coastguard Workerstdin/stdout, and no longer redirects stderr (which hides errors), 2281*cf5a6c84SAndroid Build Coastguard Workernew nanomove(), nanodiff(), union socksaddr, xrecvwait(), 2282*cf5a6c84SAndroid Build Coastguard Workerand human_readable_long() to show more than 3 digits of output.</p> 2283*cf5a6c84SAndroid Build Coastguard Worker 2284*cf5a6c84SAndroid Build Coastguard Worker<p>Taught xgetaddrinfo() to return a wildcard address for a NULL host, 2285*cf5a6c84SAndroid Build Coastguard Workerxconnbind() sets SO_REUSEADDR by default, 2286*cf5a6c84SAndroid Build Coastguard Workerfileunderdir() returns the abspath to the file now (since we had to work 2287*cf5a6c84SAndroid Build Coastguard Workerit out anyway), and 2288*cf5a6c84SAndroid Build Coastguard Workerxabspath() uses O_PATH now (because Android's SELinux rules got more aggressive).</p> 2289*cf5a6c84SAndroid Build Coastguard Worker 2290*cf5a6c84SAndroid Build Coastguard Worker<p>Several new xsendfile() variants, including sendfile_len() to copy 2291*cf5a6c84SAndroid Build Coastguard Workera specific amount of data and xsendfile_pad() to append zeroes to the 2292*cf5a6c84SAndroid Build Coastguard Workeroutput when there isn't enough input.</p> 2293*cf5a6c84SAndroid Build Coastguard Worker 2294*cf5a6c84SAndroid Build Coastguard Worker<p>regexec0() is now using libc's REG_STARTEND supported by every libc out 2295*cf5a6c84SAndroid Build Coastguard Workerthere _except_ musl. (It originated in BSD and was adopted by glibc, bionic, 2296*cf5a6c84SAndroid Build Coastguard Workerand uClibc 15 years ago, and is also supported in macosx. Musl's maintainer 2297*cf5a6c84SAndroid Build Coastguard Worker<a href=https://www.openwall.com/lists/musl/2013/01/15/26>turned down</a> 2298*cf5a6c84SAndroid Build Coastguard Workerthe feature request as an invalid use case he didn't think they should 2299*cf5a6c84SAndroid Build Coastguard Workerbe trying to do.)</p> 2300*cf5a6c84SAndroid Build Coastguard Worker 2301*cf5a6c84SAndroid Build Coastguard Worker<p><u>Docs</u>: 2302*cf5a6c84SAndroid Build Coastguard Workerthe <a href=license.html>license page</a> now has an SPDX identifier, and links to more 2303*cf5a6c84SAndroid Build Coastguard Workerhistory/context. The actual LICENSE file had its title line removed 2304*cf5a6c84SAndroid Build Coastguard Workerso <a href=https://github.com/github/choosealicense.com/pull/643#issuecomment-463746027>github could recognize it</a> as 0BSD. (We're still waiting for 2305*cf5a6c84SAndroid Build Coastguard Worker"<a href=https://github.com/github/choosealicense.com/pull/643#issuecomment-464380789>a while</a>" to pass before github actually does, though.)</p> 2306*cf5a6c84SAndroid Build Coastguard Worker 2307*cf5a6c84SAndroid Build Coastguard Worker<p>A new www/doc/mount.txt file describes how mount works under the covers.</p> 2308*cf5a6c84SAndroid Build Coastguard Worker 2309*cf5a6c84SAndroid Build Coastguard Worker<p>Rob consistently misspelled "canonical" and "millisecond", mountpoint 2310*cf5a6c84SAndroid Build Coastguard Workerhas a synopsis now, 2311*cf5a6c84SAndroid Build Coastguard WorkerKevin van der Kamp fixed a typo in netstat's help text, and Elliott 2312*cf5a6c84SAndroid Build Coastguard WorkerHughes fixed typos everywhere and made the tense, capitalization, and 2313*cf5a6c84SAndroid Build Coastguard Workerpunctuation of help text more consistent.</p> 2314*cf5a6c84SAndroid Build Coastguard Worker 2315*cf5a6c84SAndroid Build Coastguard Worker<p>New paragraph in the code style part of design.html explaining that 2316*cf5a6c84SAndroid Build Coastguard Worker"char* a, b;" is not how C works, and since you wind up with "char *a, b;" 2317*cf5a6c84SAndroid Build Coastguard Workeranyway you might as well say that.</p> 2318*cf5a6c84SAndroid Build Coastguard Worker 2319*cf5a6c84SAndroid Build Coastguard Worker<p>Given dreamhost's tendency to repeatedly delete the mailing list 2320*cf5a6c84SAndroid Build Coastguard Workerarchive, the nav bar on the left links to a backup web archive now too.</p> 2321*cf5a6c84SAndroid Build Coastguard Worker 2322*cf5a6c84SAndroid Build Coastguard Worker<p>The FAQ now says why we do time based releases.</p> 2323*cf5a6c84SAndroid Build Coastguard Worker 2324*cf5a6c84SAndroid Build Coastguard Worker<p><u>Testing</u>: Added VERBOSE=nopass to not show passing tests. 2325*cf5a6c84SAndroid Build Coastguard WorkerThe test suite now does an rm -rf on testdir between each command so 2326*cf5a6c84SAndroid Build Coastguard Workerdebris files don't accumulate. 2327*cf5a6c84SAndroid Build Coastguard WorkerNew skipnot function skips the next test if a command line fails, and 2328*cf5a6c84SAndroid Build Coastguard Workertoyonly function only runs command when we're testing the toybox version 2329*cf5a6c84SAndroid Build Coastguard Workerof command. (This isn't the same as TEST_HOST, the host version could be 2330*cf5a6c84SAndroid Build Coastguard Workertoybox.) 2331*cf5a6c84SAndroid Build Coastguard WorkerThe find -newer test calls "sleep .1" to avoid intermittently failing with an 2332*cf5a6c84SAndroid Build Coastguard Workeridentical timestamp. 2333*cf5a6c84SAndroid Build Coastguard WorkerElliott added the start of a file.test rogues gallery. 2334*cf5a6c84SAndroid Build Coastguard WorkerNo longer call lsattr in "make tests" because the behavior differs by 2335*cf5a6c84SAndroid Build Coastguard Workerfilesystem and it needs fixing somehow.</p> 2336*cf5a6c84SAndroid Build Coastguard Worker 2337*cf5a6c84SAndroid Build Coastguard Worker<a name="08-02-2019" /><a href="#08-02-2019"><hr><h2><b>February 8, 2019</b></h2></a> 2338*cf5a6c84SAndroid Build Coastguard Worker<blockquote> 2339*cf5a6c84SAndroid Build Coastguard Worker<p>"Most readers get as far as the Future Semiconditionally Modified 2340*cf5a6c84SAndroid Build Coastguard WorkerSubinverted Plagal Past Subjunctive Intentional before giving up; and 2341*cf5a6c84SAndroid Build Coastguard Workerin fact in later editions of the book all pages beyond this point have 2342*cf5a6c84SAndroid Build Coastguard Workerbeen left blank to save on printing costs."</p> 2343*cf5a6c84SAndroid Build Coastguard Worker<p>- The Hitchhiker's Guide to the Galaxy</p> 2344*cf5a6c84SAndroid Build Coastguard Worker</blockquote> 2345*cf5a6c84SAndroid Build Coastguard Worker 2346*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.8.0.tar.gz>Toybox 0.8.0</a> 2347*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.8.0>git commit</a>) 2348*cf5a6c84SAndroid Build Coastguard Workeris out.</p> 2349*cf5a6c84SAndroid Build Coastguard Worker 2350*cf5a6c84SAndroid Build Coastguard Worker<p>Toybox now builds on MacOS and FreeBSD, thanks to the efforts of Elliott 2351*cf5a6c84SAndroid Build Coastguard WorkerHughes and Ed Maste respectively. Use the "make macos_defconfig" and "make 2352*cf5a6c84SAndroid Build Coastguard Workerfreebsd_defconfig" targets to enable the set of commands that compile on 2353*cf5a6c84SAndroid Build Coastguard Workereach so far.</p> 2354*cf5a6c84SAndroid Build Coastguard Worker 2355*cf5a6c84SAndroid Build Coastguard Worker<p><u>New commands</u>: Added an <b>sntp</b> client/server (RFC 4330 Simple Network Time 2356*cf5a6c84SAndroid Build Coastguard WorkerProtocol, a compatible subset of ntp). The <b>test</b> command was rewritten 2357*cf5a6c84SAndroid Build Coastguard Workerand promoted out of pending.</p> 2358*cf5a6c84SAndroid Build Coastguard Worker 2359*cf5a6c84SAndroid Build Coastguard Worker<p><u>New options</u>: <b>grep</b> now has --color, supports embedded NUL bytes in its input, 2360*cf5a6c84SAndroid Build Coastguard Workerrecognizes binary files, and passes all of grep.test (in case you 2361*cf5a6c84SAndroid Build Coastguard Workerneeded the middle numerical field of -bB, etc). 2362*cf5a6c84SAndroid Build Coastguard WorkerJosh Gao added ipv6 and UDP support to <b>netcat</b>. 2363*cf5a6c84SAndroid Build Coastguard WorkerVolodymyr Medvid reported that install -d doesn't honor -o or -g. 2364*cf5a6c84SAndroid Build Coastguard WorkerElliott Hughes did a lot of work to support hermetic Android/AOSP builds: 2365*cf5a6c84SAndroid Build Coastguard Worker<b>mkdir</b> accepts both --parent and --parents as synonyms for -p, <b>touch</b> ignores -f, 2366*cf5a6c84SAndroid Build Coastguard Worker<b>basename</b> added -s to remove a trailing suffix, <b>dirname</b> now supports multiple 2367*cf5a6c84SAndroid Build Coastguard Workerarguments, <b>cmp</b> accepts --quiet and --silent as synonyms for -s, <b>hostname</b> 2368*cf5a6c84SAndroid Build Coastguard Workeradded -sfd, <b>head</b> added --bytes as a synonym for -c and --lines as a synonym 2369*cf5a6c84SAndroid Build Coastguard Workerfor -n, <b>mktemp</b> added -t and fixed -u, <b>sed</b> added -z and -iEXT to keep backup files, 2370*cf5a6c84SAndroid Build Coastguard Worker<b>md5sum</b> and sha1sum added --status and --check as synonyms -s and -c, 2371*cf5a6c84SAndroid Build Coastguard Worker<b>readlink</b> added --canonicalize as a synonym for -f, <b>sort</b> grew -V, 2372*cf5a6c84SAndroid Build Coastguard Worker<b>patch</b> added -s its synonym --quiet, <b>stat</b> added --format as 2373*cf5a6c84SAndroid Build Coastguard Workera synonym for -c, <b>xargs</b> added -p -t -r, 2374*cf5a6c84SAndroid Build Coastguard WorkerEduardas Meile asked 2375*cf5a6c84SAndroid Build Coastguard Workerthat <b>umount</b> ignore -c. Reverend Homer added a small optimization to file.c, 2376*cf5a6c84SAndroid Build Coastguard Workerand Elliott taught <b>file</b> to recognize riscv ELF binaries. Peter Collingbourne 2377*cf5a6c84SAndroid Build Coastguard Workertaught <b>ls</b> -t to use the nanoseconds field. 2378*cf5a6c84SAndroid Build Coastguard Worker<b>patch</b> has better support for patching a file with a tab in the name.</p> 2379*cf5a6c84SAndroid Build Coastguard Worker 2380*cf5a6c84SAndroid Build Coastguard Worker<p><u>Bugfixes</u>: 2381*cf5a6c84SAndroid Build Coastguard Worker<b>cp</b> --preserve was segfaulting when you didn't specify _what_ to 2382*cf5a6c84SAndroid Build Coastguard Workerpreserve (it now correctly defaults to "mot") and didn't get the permissions 2383*cf5a6c84SAndroid Build Coastguard Workerright when copying a symlink's contents as a regular file, 2384*cf5a6c84SAndroid Build Coastguard Worker<b>sort</b> -x didn't work when 2385*cf5a6c84SAndroid Build Coastguard Workerattached to a key, <b>host</b> didn't allocate a big enough buffer for worst 2386*cf5a6c84SAndroid Build Coastguard Workercase ipv6 address size, <b>sed</b> needed a ; between b and } when other 2387*cf5a6c84SAndroid Build Coastguard Workerimplementations don't (we're already well past what posix says but a script 2388*cf5a6c84SAndroid Build Coastguard Workerout in the field broke...), 2389*cf5a6c84SAndroid Build Coastguard Workerand several fixes to <b>hostname</b> in a container, <b>ps</b>/<b>top</b> were 2390*cf5a6c84SAndroid Build Coastguard Workermisreading the VIRT and SHM fields.</p> 2391*cf5a6c84SAndroid Build Coastguard Worker 2392*cf5a6c84SAndroid Build Coastguard Worker<p><u>Pending</u>: Gavin Howard updated <b>bc</b> and added more tests, 2393*cf5a6c84SAndroid Build Coastguard WorkerMarius Adaskevicius pointed out <b>mdev</b> -s should follow symlinks, 2394*cf5a6c84SAndroid Build Coastguard WorkerYangchun Fu reported a <b>dhcp</b> checksum bug, <b>modprobe</b> needed errno reset 2395*cf5a6c84SAndroid Build Coastguard Workerto avoid reporting spurious errors in verbose mode and no longer 2396*cf5a6c84SAndroid Build Coastguard Workerexits with status 1 if it can't find /etc/modprobe.conf, the <b>more</b> command 2397*cf5a6c84SAndroid Build Coastguard Workerwasn't always flushing stdout when it exited.</p> 2398*cf5a6c84SAndroid Build Coastguard Worker 2399*cf5a6c84SAndroid Build Coastguard Worker<p><u>Build</u>: 2400*cf5a6c84SAndroid Build Coastguard Worker<b>chrt</b> no longer #warns about the musl sched_get_priority_min() bug, but 2401*cf5a6c84SAndroid Build Coastguard Workerinstead works around it. 2402*cf5a6c84SAndroid Build Coastguard WorkerWe were mixing setjmp/siglongjmp (harmless in some contexts but it kind 2403*cf5a6c84SAndroid Build Coastguard Workerof annoyed FreeBSD), and 2404*cf5a6c84SAndroid Build Coastguard Workermake install_airlock now adds sha256sum (because the Linux 4.20 build now 2405*cf5a6c84SAndroid Build Coastguard Workerneeds that for the s390x target).</p> 2406*cf5a6c84SAndroid Build Coastguard Worker 2407*cf5a6c84SAndroid Build Coastguard Worker<p><u>Coding style</u>: 2408*cf5a6c84SAndroid Build Coastguard WorkerRob converted the rest of the option GLOBALS() to the new single letter 2409*cf5a6c84SAndroid Build Coastguard Workercoding style, and the new FLAG(x) macro is a slightly tidier way to say 2410*cf5a6c84SAndroid Build Coastguard Worker"toys.optflags&FLAG_x". 2411*cf5a6c84SAndroid Build Coastguard WorkerRemoved CFG_SORT_BIG (the sort command always 2412*cf5a6c84SAndroid Build Coastguard Workerhas the full functionality now. The general future direction or toybox 2413*cf5a6c84SAndroid Build Coastguard Workeris to either have a command or not have it; multiple versions of the 2414*cf5a6c84SAndroid Build Coastguard Workersame command aren't worth the complexity in testing, documentation, 2415*cf5a6c84SAndroid Build Coastguard Workeror system adminstration).</p> 2416*cf5a6c84SAndroid Build Coastguard Worker 2417*cf5a6c84SAndroid Build Coastguard Worker<p><u>Library code</u>: 2418*cf5a6c84SAndroid Build Coastguard WorkerThe mkflags plumbing can now support arbitrary punctuation as option 2419*cf5a6c84SAndroid Build Coastguard Workernames via an escape syntax (because mkfs.vfat specifies an offset with -@), 2420*cf5a6c84SAndroid Build Coastguard Workerand lib/args.c now only sets FLAGS_NODASH when the first argument 2421*cf5a6c84SAndroid Build Coastguard Workerdidn't have a dash (allowing "ps ax" and "ps -ax" to behave differently).</p> 2422*cf5a6c84SAndroid Build Coastguard Worker 2423*cf5a6c84SAndroid Build Coastguard Worker<p>Added an xrename() function, 2424*cf5a6c84SAndroid Build Coastguard Workerxchdir() has better error reporting, xconnect()/xbind() had their 2425*cf5a6c84SAndroid Build Coastguard Workerimplementations merged, xsendto() moved from ping to lib, xpoll() now 2426*cf5a6c84SAndroid Build Coastguard Workermeasures elapsed time and only waits for the remaining period when restarted, 2427*cf5a6c84SAndroid Build Coastguard Workerand Eduardas Meile converted several error_exit() to error_exit_raw() (because 2428*cf5a6c84SAndroid Build Coastguard Workeryocto 2.6 buils with -Werror=format-security by default).</p> 2429*cf5a6c84SAndroid Build Coastguard Worker 2430*cf5a6c84SAndroid Build Coastguard Worker<p>There's a scripts/portability.sh now which lets the build use gsed and gmake 2431*cf5a6c84SAndroid Build Coastguard Worker(when available) in more places to avoid broken host versions on MacOS and FreeBSD. 2432*cf5a6c84SAndroid Build Coastguard WorkerThe syntax of the "noreturn" attribute 2433*cf5a6c84SAndroid Build Coastguard Workerchanged slightly, some calls to strnstr() were replaced with strcasestr(), 2434*cf5a6c84SAndroid Build Coastguard Workerwe work around MacOS' lack of features.h, portability.h can now do Apple's 2435*cf5a6c84SAndroid Build Coastguard Workerendianness macros, and so on.</p> 2436*cf5a6c84SAndroid Build Coastguard Worker 2437*cf5a6c84SAndroid Build Coastguard Worker<p>Following the <a href=faq.html#support_horizon>seven year rule</a> 2438*cf5a6c84SAndroid Build Coastguard WorkerElliott removed support or glibc 2.10, and also 2439*cf5a6c84SAndroid Build Coastguard Workerreformatted a lot of --help text for consistency (removing trailing 2440*cf5a6c84SAndroid Build Coastguard Workerperiods and such).</p> 2441*cf5a6c84SAndroid Build Coastguard Worker 2442*cf5a6c84SAndroid Build Coastguard Worker<p><u>Test suite</u>: 2443*cf5a6c84SAndroid Build Coastguard WorkerThe test suite now has its own version of "pending", specifically "make tests" 2444*cf5a6c84SAndroid Build Coastguard Workerskips test files without the executable bit set (unless you export $TEST_ALL). 2445*cf5a6c84SAndroid Build Coastguard WorkerThis eliminates "expected failures" (I.E. files with unresolved todo items) 2446*cf5a6c84SAndroid Build Coastguard Workerfrom the global regression test. Additional tests can be added to the global 2447*cf5a6c84SAndroid Build Coastguard Workerregression test with chmod +x as the todo items they document get resolved.</p> 2448*cf5a6c84SAndroid Build Coastguard Worker 2449*cf5a6c84SAndroid Build Coastguard Worker<p>Several places the test suite got fluffed out, including guards to skip 2450*cf5a6c84SAndroid Build Coastguard Workerroot-only tests when run as a normal user. The testcmd function prints the 2451*cf5a6c84SAndroid Build Coastguard Workershort name instead of the full path to the command. 2452*cf5a6c84SAndroid Build Coastguard WorkerThe tests for the test command 2453*cf5a6c84SAndroid Build Coastguard Worker("test.test") no longer test the shell builtin but correctly test the 2454*cf5a6c84SAndroid Build Coastguard Workertoybox command. (Now say that ten times fast.)</p> 2455*cf5a6c84SAndroid Build Coastguard Worker 2456*cf5a6c84SAndroid Build Coastguard Worker<p>Bash version skew required replacing "continue" with "return" to stop 2457*cf5a6c84SAndroid Build Coastguard Workertests early in bash 4.4 (for VERBOSE=fail).</p> 2458*cf5a6c84SAndroid Build Coastguard Worker 2459*cf5a6c84SAndroid Build Coastguard Worker 2460*cf5a6c84SAndroid Build Coastguard Worker<a name="31-10-2018" /><a href="#31-10-2018"><hr><h2><b>October 31, 2018</b></h2></a> 2461*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p> 2462*cf5a6c84SAndroid Build Coastguard Worker"In the beginning the Universe was created. 2463*cf5a6c84SAndroid Build Coastguard WorkerThis has made a lot of people very angry and been widely regarded as a bad move."</p><p>- The Hitchhiker's Guide to the Galaxy 2464*cf5a6c84SAndroid Build Coastguard Worker</p> 2465*cf5a6c84SAndroid Build Coastguard Worker</blockquote> 2466*cf5a6c84SAndroid Build Coastguard Worker 2467*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.7.8.tar.gz>Toybox 0.7.8</a> 2468*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.7.8>git commit</a>) 2469*cf5a6c84SAndroid Build Coastguard Workeris out (a month late).</p> 2470*cf5a6c84SAndroid Build Coastguard Worker 2471*cf5a6c84SAndroid Build Coastguard Worker<p>Toybox <a href=http://lists.landley.net/pipermail/toybox-landley.net/2018-October/009769.html>now builds</a> with the Android NDK (r18 release), almost out of the box. 2472*cf5a6c84SAndroid Build Coastguard WorkerYou have to add an "llvm-cc" symlink to "clang", then use CROSS_COMPILE=llvm- 2473*cf5a6c84SAndroid Build Coastguard Workerwith the appropriate $PATH (or absolute path in CROSS_COMPILE) for the 2474*cf5a6c84SAndroid Build Coastguard Workertarget you want to build for. (To run it on a non-android host, you probably 2475*cf5a6c84SAndroid Build Coastguard Workerwant "LDFLAGS=--static" too.)</p> 2476*cf5a6c84SAndroid Build Coastguard Worker 2477*cf5a6c84SAndroid Build Coastguard Worker<p><u>New commands</u>: <b>i2cdetect</b>, <b>i2cdump</b>, <b>i2cget</b>, and <b>i2cset</b> 2478*cf5a6c84SAndroid Build Coastguard Workercourtesy of Elliott/Android. The <b>watch</b> command got a complete (tty-aware) 2479*cf5a6c84SAndroid Build Coastguard Workerrewrite, and was promoted out of pending. The <b>prlimit</b> command is back 2480*cf5a6c84SAndroid Build Coastguard Worker(a configuration bug was always disabling it), and <b>ascii</b> now defaults y 2481*cf5a6c84SAndroid Build Coastguard Workerin defconfig (an oversight).</p> 2482*cf5a6c84SAndroid Build Coastguard Worker 2483*cf5a6c84SAndroid Build Coastguard Worker<p><u>New options</u>: 2484*cf5a6c84SAndroid Build Coastguard WorkerThe <b>ifconfig</b> command added -S (short view) giving one line of 2485*cf5a6c84SAndroid Build Coastguard Workerinformation per interface, in "name ipv4/mask macaddr [ipv6/mask@type...]" 2486*cf5a6c84SAndroid Build Coastguard Workerformat. <b>grep</b> grew binary file detection, with -I and -a options to 2487*cf5a6c84SAndroid Build Coastguard Workerignore them or force treating them as ascii (really utf8). 2488*cf5a6c84SAndroid Build Coastguard WorkerZach Van Rijn asked for <b>find -empty</b>. 2489*cf5a6c84SAndroid Build Coastguard WorkerIn the <b>file</b> command, Elliott improved java 2490*cf5a6c84SAndroid Build Coastguard Worker.class support and added .wav, .bmp, and android .dex. 2491*cf5a6c84SAndroid Build Coastguard WorkerElliott also added "getconf -a" and a lot of missing getconf symbols the 2492*cf5a6c84SAndroid Build Coastguard WorkerAOSP build uses, including support for pathconf(3) symbols requiring two 2493*cf5a6c84SAndroid Build Coastguard Workerarguments. This means getconf's arguments work more like ubuntu's 2494*cf5a6c84SAndroid Build Coastguard Workernow (one or two arguments, not iterating through the supplied list and 2495*cf5a6c84SAndroid Build Coastguard Workerprocessing each like last release), and -l grew section identifiers (so 2496*cf5a6c84SAndroid Build Coastguard Workerthe "getconf -l" output is no longer a directly consumable list of symbols 2497*cf5a6c84SAndroid Build Coastguard Workerit takes). 2498*cf5a6c84SAndroid Build Coastguard WorkerCommand line options specifying durations (like top -d or ping -i) can 2499*cf5a6c84SAndroid Build Coastguard Workernow use fractions and units, like "1.5" and ".1m". See "toybox --help" for 2500*cf5a6c84SAndroid Build Coastguard Workerdetails. 2501*cf5a6c84SAndroid Build Coastguard WorkerToybox now dereferences one layer of symlinks if it doesn't recognize the 2502*cf5a6c84SAndroid Build Coastguard Workername it's called under (so if you "ln -s $(which sleep) blah" and then 2503*cf5a6c84SAndroid Build Coastguard Worker"./blah 30", it should figure out you mean sleep 30).</p> 2504*cf5a6c84SAndroid Build Coastguard Worker 2505*cf5a6c84SAndroid Build Coastguard Worker<p><u>Pending</u>: 2506*cf5a6c84SAndroid Build Coastguard WorkerGavin Howard contributed a large new <b>bc</b> implementation to pending, 2507*cf5a6c84SAndroid Build Coastguard Workerwhich covers everything the kernel build needs (and more) but is going to 2508*cf5a6c84SAndroid Build Coastguard Workertake a while to review. 2509*cf5a6c84SAndroid Build Coastguard WorkerIn <b>diff</b> the android guys added --color and timestamps on the 2510*cf5a6c84SAndroid Build Coastguard Worker+++/--- lines. In <b>mdev</b> Faustas Azuolas Bagdonas added support 2511*cf5a6c84SAndroid Build Coastguard Workerfor mdev.conf's fourth field. Reverend Homer suggested an error message 2512*cf5a6c84SAndroid Build Coastguard Workerimprovement in <b>wget</b>, Kevin Spiteri did a cleanup pass on test.c, 2513*cf5a6c84SAndroid Build Coastguard Workerand there was a cleanup pass on the passwd command.</p> 2514*cf5a6c84SAndroid Build Coastguard Worker 2515*cf5a6c84SAndroid Build Coastguard Worker<p><u>Bugfixes</u>: 2516*cf5a6c84SAndroid Build Coastguard WorkerElliott responded to a bug in <b>getconf</b>'s sed-based header generation by 2517*cf5a6c84SAndroid Build Coastguard Workerreplacing it with a more conventional array of #defined symbols, with #ifdefs 2518*cf5a6c84SAndroid Build Coastguard Workerfor missing symbols on the three libc implementations (glibc, bionic, musl) 2519*cf5a6c84SAndroid Build Coastguard Workerwe've tested so far. (This requires portability.h work to add new supported 2520*cf5a6c84SAndroid Build Coastguard Workerbuild environments, but at least it works on bionic now.) 2521*cf5a6c84SAndroid Build Coastguard WorkerThe <b>file</b> command now fails gracefully when reading pathologically 2522*cf5a6c84SAndroid Build Coastguard Workerbroken ELF files (the tests for integer overflow missed one), and 2523*cf5a6c84SAndroid Build Coastguard Worker<b>date</b> no longer shows a meaningless errno when it can't parse the 2524*cf5a6c84SAndroid Build Coastguard Workerdate format. 2525*cf5a6c84SAndroid Build Coastguard WorkerSeveral fixes in <b>ping</b> (-w and -W didn't work, -c kept sending packets 2526*cf5a6c84SAndroid Build Coastguard Workerwhile waiting for replies, and when no reply packets were received the summary 2527*cf5a6c84SAndroid Build Coastguard Workerdata was printed twice). 2528*cf5a6c84SAndroid Build Coastguard WorkerElliott fixed <b>wc</b> column widths (traditional reality doesn't match 2529*cf5a6c84SAndroid Build Coastguard Workerposix), fixed <b>modprobe</b>'s error handling (reported by Wen Xie), and 2530*cf5a6c84SAndroid Build Coastguard Workeralso fixed the units on blockdev --blkraget (reported by Martijn Coenen). 2531*cf5a6c84SAndroid Build Coastguard WorkerSeveral small fixes to the <b>stat</b> command's output (help text, quoting 2532*cf5a6c84SAndroid Build Coastguard Workerstyle, leading zeroes, switch -f from %t to %T), <b>oneit</b> no longer 2533*cf5a6c84SAndroid Build Coastguard Workerreboots the system when it's not called as PID 1. 2534*cf5a6c84SAndroid Build Coastguard WorkerLast release's commit letting $STRIP be redefined had a typo. 2535*cf5a6c84SAndroid Build Coastguard WorkerNick Kralevich added an istty() check before calling TIOCGWINSZ (which 2536*cf5a6c84SAndroid Build Coastguard Workertriggered Android's strict ioctl filtering on non-filesystem fifos). 2537*cf5a6c84SAndroid Build Coastguard WorkerAn unstripped build (where the "strip" command fails for a given 2538*cf5a6c84SAndroid Build Coastguard WorkerCROSS_COMPILE) will now overwrite the (read-only) output file instead of 2539*cf5a6c84SAndroid Build Coastguard Workerfailing a rebuild. The dirtree plumbing no longer prints a "No" on front 2540*cf5a6c84SAndroid Build Coastguard Workerof the filename in error messages (such as "permission denied").</p> 2541*cf5a6c84SAndroid Build Coastguard Worker 2542*cf5a6c84SAndroid Build Coastguard Worker<p><u>Docmentation</u> 2543*cf5a6c84SAndroid Build Coastguard WorkerElliott updated the roadmap with Android AOSP status, towards turning that 2544*cf5a6c84SAndroid Build Coastguard Workerinto a hermetic build (hopefully with an eventual self-hosting option, work 2545*cf5a6c84SAndroid Build Coastguard Workeris <a href=b33d37d6f735>already underway</a> on the airlock step). 2546*cf5a6c84SAndroid Build Coastguard WorkerRob added a little more context for LSB and described the move from Aboriginal 2547*cf5a6c84SAndroid Build Coastguard WorkerLinux to mkroot. 2548*cf5a6c84SAndroid Build Coastguard WorkerThe <b>ps</b> help text changed: now "ps -o help" shows the fields and the normal 2549*cf5a6c84SAndroid Build Coastguard Worker--help is much more manageable. Ifconfig's --help text also got tidied up. 2550*cf5a6c84SAndroid Build Coastguard WorkerOur LICENSE file has the SPDX identifier (0BSD) now, and the note about 2551*cf5a6c84SAndroid Build Coastguard Workerthe kconfig/ subdirectory still having (build only, non-shipping) GPL code 2552*cf5a6c84SAndroid Build Coastguard Workerin it moved into the kconfig subdirectory.</p> 2553*cf5a6c84SAndroid Build Coastguard Worker 2554*cf5a6c84SAndroid Build Coastguard Worker<p><u>Coding style change:</u> 2555*cf5a6c84SAndroid Build Coastguard WorkerGLOBALS() now uses the argument letter as the variable 2556*cf5a6c84SAndroid Build Coastguard Workername for variables automatically set by command line arguments via lib/args.c, 2557*cf5a6c84SAndroid Build Coastguard Workerand no longer requires they be one per line. 2558*cf5a6c84SAndroid Build Coastguard WorkerRemoved use of the gcc 2559*cf5a6c84SAndroid Build Coastguard Worker\e extension in string constants, replacing it with \033.</p> 2560*cf5a6c84SAndroid Build Coastguard Worker 2561*cf5a6c84SAndroid Build Coastguard Worker<p><u>Library code:</u> 2562*cf5a6c84SAndroid Build Coastguard Workerlib/interestingtimes.c was renamed to lib/tty.c. 2563*cf5a6c84SAndroid Build Coastguard WorkerThe deflate code from toys/pending/compress.c moved to lib/deflate.c, 2564*cf5a6c84SAndroid Build Coastguard Workerwhich gunzip.c now uses when it's not configured to use zlib. (This reduces 2565*cf5a6c84SAndroid Build Coastguard Workerthe bootstrap dependencies for the "airlock" step of a hermetic build.) 2566*cf5a6c84SAndroid Build Coastguard WorkerThe compression side remains a todo item. 2567*cf5a6c84SAndroid Build Coastguard WorkerAdded "%" to lib/args.c reading seconds (including fractions/units) into a 2568*cf5a6c84SAndroid Build Coastguard Workerlong milliseconds argument. Redid xparsetime() to not need floating point, 2569*cf5a6c84SAndroid Build Coastguard Workeradded xparsemillitime() for milliseconds common case, and 2570*cf5a6c84SAndroid Build Coastguard Workerparsetime() now treats leading garbage as an error instead of returning zero. 2571*cf5a6c84SAndroid Build Coastguard WorkerThe bufgetpwuid()/pufgetgrgid() functons can now handle more than 4k of group 2572*cf5a6c84SAndroid Build Coastguard Workerdata. The set_terminal() function can now set serial speed, and microcom.c 2573*cf5a6c84SAndroid Build Coastguard Workeruses it. Added xsignal_flags(), and more consistently use xsignal() (which wraps 2574*cf5a6c84SAndroid Build Coastguard Workersigaction()) instead of signal(). 2575*cf5a6c84SAndroid Build Coastguard WorkerA new xgetrandom() function calls the new getrandom() system call, falling 2576*cf5a6c84SAndroid Build Coastguard Workerback to /dev/urandom on older kernel/libc (made to actually _work_ by 2577*cf5a6c84SAndroid Build Coastguard WorkerPatrick Oppenlander).</p> 2578*cf5a6c84SAndroid Build Coastguard Worker 2579*cf5a6c84SAndroid Build Coastguard Worker<p><u>Build infrastructure:</u> 2580*cf5a6c84SAndroid Build Coastguard WorkerUpdated dependency detection so "make distclean defconfig toybox" now works 2581*cf5a6c84SAndroid Build Coastguard Workerall on the same command line. (This is nice when $CROSS_COMPILE changes). 2582*cf5a6c84SAndroid Build Coastguard Workerscripts/config2help.c no longer includes parts of lib/ and just copies what 2583*cf5a6c84SAndroid Build Coastguard Workerit needs into itself, improving build portability. 2584*cf5a6c84SAndroid Build Coastguard WorkerThe build now checks the specified cross compiler exists, hopefully providing 2585*cf5a6c84SAndroid Build Coastguard Workera more informative error message when it doesn't. Similarly, when .config is 2586*cf5a6c84SAndroid Build Coastguard Workermissing the error message suggests running make defconfig.</p> 2587*cf5a6c84SAndroid Build Coastguard Worker 2588*cf5a6c84SAndroid Build Coastguard Worker<a name="23-06-2018" /><a href="#23-06-2018"><hr><h2><b>June 23, 2018</b></h2></a> 2589*cf5a6c84SAndroid Build Coastguard Worker<blockquote> 2590*cf5a6c84SAndroid Build Coastguard Worker<p>There is a theory which states that if ever anyone discovers exactly what 2591*cf5a6c84SAndroid Build Coastguard Workerthe Universe is for and why it is here, it will instantly disappear and be 2592*cf5a6c84SAndroid Build Coastguard Workerreplaced by something even more bizarre and inexplicable. There is another 2593*cf5a6c84SAndroid Build Coastguard Workertheory which states that this has already happened.</p> 2594*cf5a6c84SAndroid Build Coastguard Worker<p> - The Hitchhiker's Guide to the Galaxy</p> 2595*cf5a6c84SAndroid Build Coastguard Worker</blockquote> 2596*cf5a6c84SAndroid Build Coastguard Worker 2597*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.7.7.tar.gz>Toybox 0.7.7</a> 2598*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.7.7>git commit</a>) 2599*cf5a6c84SAndroid Build Coastguard Workeris out.</p> 2600*cf5a6c84SAndroid Build Coastguard Worker 2601*cf5a6c84SAndroid Build Coastguard Worker<p><u>New commands</u>: Rob Landley added <b>getconf</b>, Elliott Hughes added 2602*cf5a6c84SAndroid Build Coastguard Worker<b>uuidgen</b>, and <b>ping</b> and <b>fmt</b> were promoted out of pending.</p> 2603*cf5a6c84SAndroid Build Coastguard Worker 2604*cf5a6c84SAndroid Build Coastguard Worker<p><u>New options</u>: The <b>cp</b> command added the --parents option, 2605*cf5a6c84SAndroid Build Coastguard Worker<b>readlink</b> now has -m to show where a missing path would be, 2606*cf5a6c84SAndroid Build Coastguard Worker<b>netstat</b> got some updates (better nommu support, it can use /etc/services 2607*cf5a6c84SAndroid Build Coastguard Workernames, more command line options are bounds checked), 2608*cf5a6c84SAndroid Build Coastguard WorkerNg Zhi An added --getra and --setra (get/set readahead) to <b>blockdev</b>, 2609*cf5a6c84SAndroid Build Coastguard WorkerElliott Hughes added <b>xxd</b> -o and made <b>top</b> -d understand fractional 2610*cf5a6c84SAndroid Build Coastguard Workersections (because the Linux Test Project uses that), and 2611*cf5a6c84SAndroid Build Coastguard WorkerMinghui Liu added <b>watch</b> -b.</p> 2612*cf5a6c84SAndroid Build Coastguard Worker 2613*cf5a6c84SAndroid Build Coastguard Worker<p><u>Bugfixes</u>: Several fixes to <b>vmstat</b>: Elliott Hughes made it work on a 2614*cf5a6c84SAndroid Build Coastguard Worker48-core machine 2615*cf5a6c84SAndroid Build Coastguard Workerand fixed a glitch with -n, Haroon Maqsood pointed out "vmstat 1 1" didn't 2616*cf5a6c84SAndroid Build Coastguard Workerstop and "vmstat -n" didn't print the first theader line. 2617*cf5a6c84SAndroid Build Coastguard WorkerMinghui Liu fixed a bug where <b>cp</b> -p didn't preserve 2618*cf5a6c84SAndroid Build Coastguard Workertimestamps, and pointed out the b, c, and d suffixes on numbers weren't 2619*cf5a6c84SAndroid Build Coastguard Workerworking. Ryan Pritchard pointed out that <b>du</b> -d0 should act like du -s. 2620*cf5a6c84SAndroid Build Coastguard WorkerFilip Perich made an RFC2347 OACK compliance fix to <b>tftp</b> in pending. 2621*cf5a6c84SAndroid Build Coastguard WorkerZach van Rijn fixed a bug in <b>xxd</b> causing incorrect translation of 2622*cf5a6c84SAndroid Build Coastguard Workeruppercase characters. 2623*cf5a6c84SAndroid Build Coastguard WorkerElliott fixed several things in <b>top</b> (removed spurious '\r' characters from -b 2624*cf5a6c84SAndroid Build Coastguard Workeroutput, removed interactive flicker, made running processes bold), and 2625*cf5a6c84SAndroid Build Coastguard Workerpushed Rob to make <b>file</b> work better recognizing things on stdin 2626*cf5a6c84SAndroid Build Coastguard Worker("cat /bin/ls | file -" still won't work but "file - < /bin/ls" should). 2627*cf5a6c84SAndroid Build Coastguard WorkerRob fixed a bug in <b>netstat</b> on 64 bit big endian systems, 2628*cf5a6c84SAndroid Build Coastguard Workerand fixed <b>cut</b> -DF 2629*cf5a6c84SAndroid Build Coastguard Worker(a posix compliance fix broke its ability to act as a decent awk replacment 2630*cf5a6c84SAndroid Build Coastguard Workerbecause outputting all delimiterless lines isn't what you want there, -D 2631*cf5a6c84SAndroid Build Coastguard Workernow disables that too).</p> 2632*cf5a6c84SAndroid Build Coastguard Worker</u></p> 2633*cf5a6c84SAndroid Build Coastguard Worker 2634*cf5a6c84SAndroid Build Coastguard Worker<p><u>Documentation</u>: Rob added a buildroot section to the roadmap with the 2635*cf5a6c84SAndroid Build Coastguard Workerprequisites that needs to run, and reformatted more of the ps --help text 2636*cf5a6c84SAndroid Build Coastguard Workerto two columns.</p> 2637*cf5a6c84SAndroid Build Coastguard Worker 2638*cf5a6c84SAndroid Build Coastguard Worker<p><u>Library</u>: 2639*cf5a6c84SAndroid Build Coastguard WorkerFLAGS_NODASH is now set in toys.optargs when an optstring starting 2640*cf5a6c84SAndroid Build Coastguard Workerwith & has no dash in its first argument. (This lets "ps -ax" and "ps ax" 2641*cf5a6c84SAndroid Build Coastguard Workerbehave differently.) Factored out xtestfile() into lib/. 2642*cf5a6c84SAndroid Build Coastguard WorkerThe comma-separated-list parsing infrastructure moved to lib/commas.c. 2643*cf5a6c84SAndroid Build Coastguard WorkerAdded mkpath() for the common case of mkpathat() and #defined MKPATHAT_* 2644*cf5a6c84SAndroid Build Coastguard Workerconstants for the uncommon cases. Elliott added better error checking 2645*cf5a6c84SAndroid Build Coastguard Workerto xparsetime() and fixed a bug in names_to_pid() (used in <b>pidof</b> 2646*cf5a6c84SAndroid Build Coastguard Workerand <b>killall</b> and such). 2647*cf5a6c84SAndroid Build Coastguard WorkerRob inlined the old toys/e2fs.h into pending's mke2fs, 2648*cf5a6c84SAndroid Build Coastguard Workerand removed a rogue semicolon from the WOULD_EXIT() macro that screwed 2649*cf5a6c84SAndroid Build Coastguard Workerup if() statement levels. The do_lines() semantics changed adding a 2650*cf5a6c84SAndroid Build Coastguard Workercallback(0,0) at the end of each file.</p> 2651*cf5a6c84SAndroid Build Coastguard Worker 2652*cf5a6c84SAndroid Build Coastguard Worker<p><u>Tests</u>: 2653*cf5a6c84SAndroid Build Coastguard WorkerThe test_* commands under toys/example were all renamed demo_* so 2654*cf5a6c84SAndroid Build Coastguard Workerthey don't share a namespace with running a standalone command 2655*cf5a6c84SAndroid Build Coastguard Workerthrough the test suite (ala "make test_sed"), then 2656*cf5a6c84SAndroid Build Coastguard Workerdemo_human_readable became demo_number so it can also test atolx() 2657*cf5a6c84SAndroid Build Coastguard Workersuffixes. The readlink.test was getting confused by a 2658*cf5a6c84SAndroid Build Coastguard Workerbehavior difference between toybox and ubuntu (Ubuntu's ln -sf wouldn't 2659*cf5a6c84SAndroid Build Coastguard Workerreplace a symlink that pointed to itself, toybox's would), now there's 2660*cf5a6c84SAndroid Build Coastguard Workeran explicit rm so it works on ubuntu too. The test suite plumbing's 2661*cf5a6c84SAndroid Build Coastguard Workererror message for a test with the wrong number of arguments now 2662*cf5a6c84SAndroid Build Coastguard Workercorrectly identifies which test it's complaining about, and it can now 2663*cf5a6c84SAndroid Build Coastguard Workerrun a test on a command name beginning with "-" (none yet but it 2664*cf5a6c84SAndroid Build Coastguard Workercomes up in toysh).</p> 2665*cf5a6c84SAndroid Build Coastguard Worker 2666*cf5a6c84SAndroid Build Coastguard Worker<p><u>Building</u>: You can now override strip with $STRIP. The set of 2667*cf5a6c84SAndroid Build Coastguard Worker"make install_airlock" commands got tweaked for the 4.17 kernel (which 2668*cf5a6c84SAndroid Build Coastguard Workerneeds bison and flex because the new kconfig plumbing doesn't have _shipped 2669*cf5a6c84SAndroid Build Coastguard Workerversions of those generated files like the old kconfig did), and for 2670*cf5a6c84SAndroid Build Coastguard Workerthe new release (remove ping, toybox provides it now). 2671*cf5a6c84SAndroid Build Coastguard Worker$LDFLAGS now applies to library probing (the android NDK provides 2672*cf5a6c84SAndroid Build Coastguard Workerdynamic libraries without corresponding --static versions). 2673*cf5a6c84SAndroid Build Coastguard WorkerElliott took a CFG_TOYBOX_DEBUG check out of an error_exit() to make 2674*cf5a6c84SAndroid Build Coastguard Workerclang stop complaining about an error that should never happen.</p> 2675*cf5a6c84SAndroid Build Coastguard Worker 2676*cf5a6c84SAndroid Build Coastguard Worker<a name="24-02-2018" /><a href="#24-02-2018"><hr><h2><b>February 24, 2018</b></h2></a> 2677*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p> 2678*cf5a6c84SAndroid Build Coastguard Worker"Arthur," said Ford.<br /> 2679*cf5a6c84SAndroid Build Coastguard Worker"Hello? Yes?" said Arthur.<br /> 2680*cf5a6c84SAndroid Build Coastguard Worker"Just believe everything I tell you, and it will all be very, very simple."<br /> 2681*cf5a6c84SAndroid Build Coastguard Worker"Ah, well, I'm not sure I believe that."<br /> 2682*cf5a6c84SAndroid Build Coastguard Worker</p> 2683*cf5a6c84SAndroid Build Coastguard Worker<p> - The Hitchhiker's Guide to the Galaxy</p> 2684*cf5a6c84SAndroid Build Coastguard Worker</blockquote> 2685*cf5a6c84SAndroid Build Coastguard Worker 2686*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.7.6.tar.gz>Toybox 0.7.6</a> 2687*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.7.6>git commit</a>) 2688*cf5a6c84SAndroid Build Coastguard Workeris out, a month and change late.</p> 2689*cf5a6c84SAndroid Build Coastguard Worker 2690*cf5a6c84SAndroid Build Coastguard Worker<p>This release adds a <b>crc32</b> command and 2691*cf5a6c84SAndroid Build Coastguard Workercleans up and promotes <b>iconv</b>, <b>logger</b>, and <b>setfattr</b>. 2692*cf5a6c84SAndroid Build Coastguard WorkerPending added <b>stty</b> and <b>fmt</b>, the other half of <b>ping</b>, 2693*cf5a6c84SAndroid Build Coastguard Workerand got a lot of cleanup on <b>gzip</b>/<b>gunzip</b>/<b>zcat</b>.</p> 2694*cf5a6c84SAndroid Build Coastguard Worker 2695*cf5a6c84SAndroid Build Coastguard Worker<p>The <b>cut</b> command got a complete rewrite adding support for multiple 2696*cf5a6c84SAndroid Build Coastguard Workerranges, utf8/unicode characters, and new -CDFO options. Use -C to measure 2697*cf5a6c84SAndroid Build Coastguard Workercolumns rather than characters (for double width chars), and "cut -DF 3-5" 2698*cf5a6c84SAndroid Build Coastguard Workerselects words (like "awk '{print $3 $4 $5}'").</p> 2699*cf5a6c84SAndroid Build Coastguard Worker 2700*cf5a6c84SAndroid Build Coastguard Worker<p>This release adds <b>top -m</b> and <b>iotop -H</b> (and fixed top width truncating for narrow terminal windows), 2701*cf5a6c84SAndroid Build Coastguard Workeradded <b>iconv -c</b>, fixed <b>ps -T 1234</b> to show threads belonging to 2702*cf5a6c84SAndroid Build Coastguard Workerthat PID, improved <b>file</b>'s executable identification (properly recognizing 2703*cf5a6c84SAndroid Build Coastguard Workerboth endiannesses and adding sh/frv fdpic, bpf, and new microblaze 2704*cf5a6c84SAndroid Build Coastguard Workeridentifiers), and <b>blkid</b> now only shows LABEL= when it isn't blank.</p> 2705*cf5a6c84SAndroid Build Coastguard Worker 2706*cf5a6c84SAndroid Build Coastguard Worker<p>Running ./configure now does "make defconfig", help_exit() now shows the 2707*cf5a6c84SAndroid Build Coastguard Worker"See %s --help" message on the same line, and several web pages 2708*cf5a6c84SAndroid Build Coastguard Worker(about, code, roadmap, cleanup) got updates.</p> 2709*cf5a6c84SAndroid Build Coastguard Worker 2710*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott and the Android devs added <b>df -i</b>, <b>uptime -p</b>, 2711*cf5a6c84SAndroid Build Coastguard Worker<b>time -v</b>, and <b>xxd -i -ri</b>, 2712*cf5a6c84SAndroid Build Coastguard Workerfixed <b>id -G</b> to only output the group IDs, fixed the <b>xargs -0 -n</b> 2713*cf5a6c84SAndroid Build Coastguard Workercombination, made <b>find -exec +</b> obey ARG_MAX (just like xargs), made 2714*cf5a6c84SAndroid Build Coastguard Worker<b>killall</b> kill scripts too, fixed an off by one error in <b>pidof</b> 2715*cf5a6c84SAndroid Build Coastguard Workerthat could cause false positive matches in 15 character names, added 2716*cf5a6c84SAndroid Build Coastguard Workergzip/gunzip/zcat tests, and taught <b>file</b> to identify more stuff 2717*cf5a6c84SAndroid Build Coastguard Worker(ogg, TrueType font, LLVM bitcode, PEM certs, and PE executables), and 2718*cf5a6c84SAndroid Build Coastguard Workerfor some reason needed TOYBOX_VENDOR in the version stuff. 2719*cf5a6c84SAndroid Build Coastguard WorkerAndroid <b>getprop</b>/<b>setprop</b> now allows ro. properties to have 2720*cf5a6c84SAndroid Build Coastguard Workerarbitrary lengths, <b>losetup</b> can now find loop devices under /dev/block (where android puts 2721*cf5a6c84SAndroid Build Coastguard Workerthem for historical reasons), and Andreas Gampe pointed out a thinko in 2722*cf5a6c84SAndroid Build Coastguard Worker<b>top</b> that triggered llvm's address sanitizer checks.</p> 2723*cf5a6c84SAndroid Build Coastguard Worker 2724*cf5a6c84SAndroid Build Coastguard Worker<p>Gael PORTAY asked for mdev to work when Linux has the 2725*cf5a6c84SAndroid Build Coastguard Workerblock layer configured out, Patrick Oppenlander pointed out a problem 2726*cf5a6c84SAndroid Build Coastguard Workerwith make bloatcheck's build dependencies, and 2727*cf5a6c84SAndroid Build Coastguard Workerxuphung on github fixed config2help building on MacOS X.</p> 2728*cf5a6c84SAndroid Build Coastguard Worker 2729*cf5a6c84SAndroid Build Coastguard Worker<p>Commands with locale support now setlocale(LC_TYPE, "C.UTF-8") for more 2730*cf5a6c84SAndroid Build Coastguard Workertargeted locale support (enable character parsing with 2731*cf5a6c84SAndroid Build Coastguard Workerutf8 support, use "C" semantics otherwise). The toys/example/test_*.c 2732*cf5a6c84SAndroid Build Coastguard Workercommands got renamed demo_*.c.</p> 2733*cf5a6c84SAndroid Build Coastguard Worker 2734*cf5a6c84SAndroid Build Coastguard Worker<p>In lib.c the millitime() function returns current unix time in milliseconds 2735*cf5a6c84SAndroid Build Coastguard Worker(which as a 64 bit number is good for + or - 292 million years from 2736*cf5a6c84SAndroid Build Coastguard Workermidnight Jan 1 1970), and the old xgetty() function became tty_fd() returning 2737*cf5a6c84SAndroid Build Coastguard Worker-1 instead of erroring out.</p> 2738*cf5a6c84SAndroid Build Coastguard Worker 2739*cf5a6c84SAndroid Build Coastguard Worker<p>The "make help" text moved from the Makefile to scripts/help.txt, 2740*cf5a6c84SAndroid Build Coastguard Workerls.c now lists some of its deviations from posix, and work is underway 2741*cf5a6c84SAndroid Build Coastguard Workerto make ps.c more intelligible (and figure out how to break it up into 2742*cf5a6c84SAndroid Build Coastguard Workermultiple files).</p> 2743*cf5a6c84SAndroid Build Coastguard Worker 2744*cf5a6c84SAndroid Build Coastguard Worker<a name="12-10-2017" /><a href="#12-10-2017"><hr><h2><b>October 12, 2017</b></h2></a> 2745*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>Would it save you a lot of time if I just gave up and went 2746*cf5a6c84SAndroid Build Coastguard Workermad now?</p> 2747*cf5a6c84SAndroid Build Coastguard Worker<p> - The Hitchhiker's Guide to the Galaxy</p> 2748*cf5a6c84SAndroid Build Coastguard Worker</blockquote> 2749*cf5a6c84SAndroid Build Coastguard Worker 2750*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.7.5.tar.gz>Toybox 0.7.5</a> 2751*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.7.5>git commit</a>) 2752*cf5a6c84SAndroid Build Coastguard Workeris out.</p> 2753*cf5a6c84SAndroid Build Coastguard Worker 2754*cf5a6c84SAndroid Build Coastguard Worker<p>This is another <b>mostly bugfix release</b>. I delayed it a bit trying to get some 2755*cf5a6c84SAndroid Build Coastguard Workerof the many half-finished projects (dd, ping, lsof, iconv, cut, sysconf, 2756*cf5a6c84SAndroid Build Coastguard Workerthe cp --parents option...) finished/promoted/tested, but decided adding big 2757*cf5a6c84SAndroid Build Coastguard Workerthings at the end of the dev cycle would be too destabilizing.</p> 2758*cf5a6c84SAndroid Build Coastguard Worker 2759*cf5a6c84SAndroid Build Coastguard Worker<p>A couple <b>new features</b> slipped in anyway. Ilya Kuzmich added head -c 2760*cf5a6c84SAndroid Build Coastguard Workerand strings -t (and corrected strings' output in a couple places). Elliott 2761*cf5a6c84SAndroid Build Coastguard WorkerHughes taught file to recognize Macintosh (Mach-O) binaries.</p> 2762*cf5a6c84SAndroid Build Coastguard Worker 2763*cf5a6c84SAndroid Build Coastguard Worker<p><b>NOTE</b>: the chrt command is broken when built against musl-libc 2764*cf5a6c84SAndroid Build Coastguard Workerbecause that project's maintainer decided he didn't like the system calls 2765*cf5a6c84SAndroid Build Coastguard Workerit depends on, so he 2766*cf5a6c84SAndroid Build Coastguard Worker<a href=https://git.musl-libc.org/cgit/musl/commit/?id=1e21e78bf7a5>removed 2767*cf5a6c84SAndroid Build Coastguard Workerthem from his libc</a>. The prebuilt binaries are built against musl, 2768*cf5a6c84SAndroid Build Coastguard Workerso the chrt command there will always say -ENOSYS. (It works fine built against 2769*cf5a6c84SAndroid Build Coastguard Workerglibc, and presumably bionic or uClibc.)</p> 2770*cf5a6c84SAndroid Build Coastguard Worker 2771*cf5a6c84SAndroid Build Coastguard Worker<p><b>Bugfixes</b>: Remounting (mount -o remount,rw) should work properly now, 2772*cf5a6c84SAndroid Build Coastguard Workerand we fixed another place ps was segfaulting when /proc 2773*cf5a6c84SAndroid Build Coastguard Workerentries vanished out from under us (a hard to hit race condition 2774*cf5a6c84SAndroid Build Coastguard Workermostly noticeable in long-running "top" exiting; error value was treated 2775*cf5a6c84SAndroid Build Coastguard Workeras a pointer). Elliott Hughes fixed a -Wformat warning in expr.c, 2776*cf5a6c84SAndroid Build Coastguard Workerand made xargs split the command 2777*cf5a6c84SAndroid Build Coastguard Workerline at ARG_MAX (which is 1/4 the stack size ulimit, which normal users 2778*cf5a6c84SAndroid Build Coastguard Workercan arbitrarily increase but execve() will complain if they don't). 2779*cf5a6c84SAndroid Build Coastguard WorkerJosh Gao made netcat -l exit after handling a request, and reported a 2780*cf5a6c84SAndroid Build Coastguard Workerseq bug (seq "1000000 10000001" output 1e+06, fixed now). Zach Riggle fixed a 2781*cf5a6c84SAndroid Build Coastguard Workerbroken URL in the README. Rob fixed env -0 checking the flag wrong so 2782*cf5a6c84SAndroid Build Coastguard Workerit didn't work in combination with other flags (typo).</p> 2783*cf5a6c84SAndroid Build Coastguard Worker 2784*cf5a6c84SAndroid Build Coastguard Worker<p><b>Plumbing</b>: 2785*cf5a6c84SAndroid Build Coastguard WorkerReplaced mbrtowc() with a new utf8towc() that doesn't have a context 2786*cf5a6c84SAndroid Build Coastguard Workerstruct or care about locale. A bugfix in comma_scan() (wasn't removing an entry at the end 2787*cf5a6c84SAndroid Build Coastguard Workerof the list) is why remount _sometimes_ worked (depending on argument 2788*cf5a6c84SAndroid Build Coastguard Workerorder), xgetaddrinfo() is now separate from xconnect(), 2789*cf5a6c84SAndroid Build Coastguard Workeratolx_range() learned the w (word=2) suffix, and b is now (block=512) instead 2790*cf5a6c84SAndroid Build Coastguard Workerof (byte=1).</p> 2791*cf5a6c84SAndroid Build Coastguard Worker 2792*cf5a6c84SAndroid Build Coastguard Worker<p><b>Build</b>: Patrick Oppenlander added a workaround for a bug in config2help.c 2793*cf5a6c84SAndroid Build Coastguard Workerthat resulted in segfaults on newer toolchains. (It was actually a use 2794*cf5a6c84SAndroid Build Coastguard Workerafter free error; the build infrastructure isn't nearly as heavily audited as 2795*cf5a6c84SAndroid Build Coastguard Workercode that gets installed on the target; oops.) A new GITHASH 2796*cf5a6c84SAndroid Build Coastguard Workerenvironment variable can force the build version from 2797*cf5a6c84SAndroid Build Coastguard Workerthe command line, and the build checks for .git in the top directory 2798*cf5a6c84SAndroid Build Coastguard Workerbefore asking git what our version is (so it isn't confused by ../../.git 2799*cf5a6c84SAndroid Build Coastguard Workerin an enclosing directory). Added a build #warning about musl intentionally 2800*cf5a6c84SAndroid Build Coastguard Workerbreaking chrt (as with nommu fork() musl now provides a broken 2801*cf5a6c84SAndroid Build Coastguard Workerstub function so compile-time probes for its existence think it's there, and 2802*cf5a6c84SAndroid Build Coastguard Workeryou can't run the result to test behavior when cross compiling).</p> 2803*cf5a6c84SAndroid Build Coastguard Worker 2804*cf5a6c84SAndroid Build Coastguard Worker<a name="19-06-2017" /><a href="#19-06-2017"><hr><h2><b>June 19, 2017</b></h2></a> 2805*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>It is a well-known fact that those people who most want to rule people are, ipso facto, those least suited to do it. 2806*cf5a6c84SAndroid Build Coastguard WorkerTo summarize the summary: anyone who is capable of getting themselves made President should on no account be allowed to do the job.</p> 2807*cf5a6c84SAndroid Build Coastguard Worker<p>- The Hitchhiker's Guide to the Galaxy</p> 2808*cf5a6c84SAndroid Build Coastguard Worker</blockquote> 2809*cf5a6c84SAndroid Build Coastguard Worker 2810*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.7.4.tar.gz>Toybox 0.7.4</a> 2811*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.7.4>git commit</a>) 2812*cf5a6c84SAndroid Build Coastguard Workeris out. No new commands this time, but 2813*cf5a6c84SAndroid Build Coastguard Worker<b>chrt</b> and <b>dmesg</b> got promoted out of pending.</p> 2814*cf5a6c84SAndroid Build Coastguard Worker 2815*cf5a6c84SAndroid Build Coastguard Worker<p><u>New features</u>: 2816*cf5a6c84SAndroid Build Coastguard WorkerRob rewrote paste, which should work much better now, and added grep 2817*cf5a6c84SAndroid Build Coastguard Worker-M and -S to match and skip wildcards respectively (useful with -r). 2818*cf5a6c84SAndroid Build Coastguard WorkerElliott's updated dmesg has -T and --color. The file 2819*cf5a6c84SAndroid Build Coastguard Workercommand can recognize gzip now, uptime grew -s, date grew %N, env knows - as a first argument 2820*cf5a6c84SAndroid Build Coastguard Workermeans -i (posix!) and grew -0, ls defaults to -b 2821*cf5a6c84SAndroid Build Coastguard Workerinstead of -q now when there's a tty, and ls has a new -ll option (with 2822*cf5a6c84SAndroid Build Coastguard Worker--full-time as a compatibility synonym) showing nanoseconds and (for some 2823*cf5a6c84SAndroid Build Coastguard Workerreason) timezone. (Why do individual files have timezones?) Elliott added 2824*cf5a6c84SAndroid Build Coastguard Worker"uudecode -o -" support. Illya Kuzmich taught head -v and -q. The cpio 2825*cf5a6c84SAndroid Build Coastguard Workercode no longer adds the "TRAILER!!!" entry by default (initramfs extractor 2826*cf5a6c84SAndroid Build Coastguard Workerdoesn't care) without which you can concatenate cpio archives with "cat". 2827*cf5a6c84SAndroid Build Coastguard Worker(Use the new --trailer option if you want the legacy behavior.) 2828*cf5a6c84SAndroid Build Coastguard WorkerIn pending, fdisk compiles now and tar understands bzip2.</p> 2829*cf5a6c84SAndroid Build Coastguard Worker 2830*cf5a6c84SAndroid Build Coastguard Worker<p><u>Build</u>: 2831*cf5a6c84SAndroid Build Coastguard WorkerThe "make install_airlock" target now symlinks bc from the host because 2832*cf5a6c84SAndroid Build Coastguard Workerthe kernel <a href=https://landley.net/notes-2013.html#28-03-2013>inexplicably</a> 2833*cf5a6c84SAndroid Build Coastguard Workerneeds that to build. This was motivated by 2834*cf5a6c84SAndroid Build Coastguard Worker<a href=https://github.com/landley/mkroot>mkroot</a>, which builds under 2835*cf5a6c84SAndroid Build Coastguard Workera toybox airlock directory.</p> 2836*cf5a6c84SAndroid Build Coastguard Worker 2837*cf5a6c84SAndroid Build Coastguard Worker<p>Lots of work on the test suite, mostly from the Android guys who are now 2838*cf5a6c84SAndroid Build Coastguard Workerrunning it under Android. This fixed several existing tests that didn't 2839*cf5a6c84SAndroid Build Coastguard Workerpass, made more tests run on a toybox-only system, and so on. The test suite 2840*cf5a6c84SAndroid Build Coastguard Workerinfrastructure now has a second testing function, 2841*cf5a6c84SAndroid Build Coastguard Worker"testcmd", which supplies the command name being tested (bypassing 2842*cf5a6c84SAndroid Build Coastguard Workershell builtins).</p> 2843*cf5a6c84SAndroid Build Coastguard Worker 2844*cf5a6c84SAndroid Build Coastguard Worker<p>Various android build and config fixes, getting closer to being able 2845*cf5a6c84SAndroid Build Coastguard Workerto let android someday use scripts/make.sh instead of generated/* snapshots. 2846*cf5a6c84SAndroid Build Coastguard WorkerAlso more work into building under android's NDK; not quite there yet 2847*cf5a6c84SAndroid Build Coastguard Workerbut much closer. 2848*cf5a6c84SAndroid Build Coastguard WorkerUse nproc in scripts/make.sh detect available processors (so you can control the SMP level with taskset). 2849*cf5a6c84SAndroid Build Coastguard WorkerRemoved the old uClibc compatibility glue, it's been 5 years since their 2850*cf5a6c84SAndroid Build Coastguard Worker<a href=http://lists.busybox.net/pipermail/buildroot/2016-December/180102.html>last release</a>.</p> 2851*cf5a6c84SAndroid Build Coastguard Worker 2852*cf5a6c84SAndroid Build Coastguard Worker<p>The new config option TOYBOX_PEDANTIC_ARGS checks arguments when there 2853*cf5a6c84SAndroid Build Coastguard Workerare no arguments, so things like "uptime" no longer silently ignore arguments 2854*cf5a6c84SAndroid Build Coastguard Workeryou pass but instead refuse to run.</p> 2855*cf5a6c84SAndroid Build Coastguard Worker 2856*cf5a6c84SAndroid Build Coastguard Worker<p><u>Docs</u>: 2857*cf5a6c84SAndroid Build Coastguard WorkerThe FAQ now has more than one entry. Commands no longer output the full 2858*cf5a6c84SAndroid Build Coastguard Workerhelp text for argument errors but instead just say "See %s --help" with the 2859*cf5a6c84SAndroid Build Coastguard Workercommand name (in addition to the actual error message). 2860*cf5a6c84SAndroid Build Coastguard WorkerElliott did a big period-ectomy on all the --help text, and 2861*cf5a6c84SAndroid Build Coastguard Workerwe cleaned up some tab/space inconsistency. The 2862*cf5a6c84SAndroid Build Coastguard Workernon-html help -a output now has separators with the command name. 2863*cf5a6c84SAndroid Build Coastguard WorkerThe top/iotop and pkill/pgrep help text now describe a lot more of what 2864*cf5a6c84SAndroid Build Coastguard Workerthe commands can do. Twitter's code of conduct page went down so we 2865*cf5a6c84SAndroid Build Coastguard Workermirrored the text locally.</p> 2866*cf5a6c84SAndroid Build Coastguard Worker 2867*cf5a6c84SAndroid Build Coastguard Worker<p><u>Bugfixes</u>: 2868*cf5a6c84SAndroid Build Coastguard WorkerFixed a race condition in ps/top where a process that exited right as we 2869*cf5a6c84SAndroid Build Coastguard Workerread its data returned a different error value than we were expecting (which 2870*cf5a6c84SAndroid Build Coastguard Workerwas causing long-running top instances to occasionally exit), 2871*cf5a6c84SAndroid Build Coastguard Workermount now gives an error if it can't autodetect the filesystem 2872*cf5a6c84SAndroid Build Coastguard Workertype, ps no longer queries the terminal size when output isn't to a tty 2873*cf5a6c84SAndroid Build Coastguard Worker(so "ps -A | cat" doesn't vary), date's chkmktime() was replaced with 2874*cf5a6c84SAndroid Build Coastguard Workersimple range checks for fields (to avoid false positives from things like 2875*cf5a6c84SAndroid Build Coastguard Workertimezones and daylight savings time), removed %s from date's help (we 2876*cf5a6c84SAndroid Build Coastguard Workerdidn't implement it, we have @seconds[.nanoseconds] instead), fixed 2877*cf5a6c84SAndroid Build Coastguard Workerzcat's buffer flush logic (which was always failing on files larger 2878*cf5a6c84SAndroid Build Coastguard Workerthan 32k), and factor now detects requests for numbers >64 bits and fails 2879*cf5a6c84SAndroid Build Coastguard Workerloudly instead of producing incorrect answers. 2880*cf5a6c84SAndroid Build Coastguard WorkerElliott fixed touch -a/-m (they were backwards), and allowed ':' in 2881*cf5a6c84SAndroid Build Coastguard Workersetprop's property names. Grep now exits with 2 for errors (so -q can 2882*cf5a6c84SAndroid Build Coastguard Workerdistinguish "didn't find" from "didn't work"), doesn't stop on symlinks 2883*cf5a6c84SAndroid Build Coastguard Workerthat point nowhere (there was an error_exit() that should just be a warning), 2884*cf5a6c84SAndroid Build Coastguard Workerand provides error messages for files we could open but not read.</p> 2885*cf5a6c84SAndroid Build Coastguard Worker 2886*cf5a6c84SAndroid Build Coastguard Worker<p><u>Library</u>: 2887*cf5a6c84SAndroid Build Coastguard WorkerNew library functions: strend() complements strstart(), minof()/maxof() 2888*cf5a6c84SAndroid Build Coastguard Workerare min/max macros that evalute arguments once and autodetect type (why 2889*cf5a6c84SAndroid Build Coastguard Workerisn't this in libc?), xmmap() checks MAP_FAILED (which is not NULL).</p> 2890*cf5a6c84SAndroid Build Coastguard Worker 2891*cf5a6c84SAndroid Build Coastguard Worker<a name="21-02-2017" /><a href="#21-02-2017"><hr><h2><b>February 21, 2017</b></h2></a> 2892*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>Only six people in the Galaxy knew that the job of the 2893*cf5a6c84SAndroid Build Coastguard WorkerGalactic President was not to wield power but to attract attention 2894*cf5a6c84SAndroid Build Coastguard Workeraway from it. Zaphod Beeblebrox was amazingly good at his job.</p> 2895*cf5a6c84SAndroid Build Coastguard Worker<p>- The Hitchhiker's Guide to the Galaxy</p></blockquote> 2896*cf5a6c84SAndroid Build Coastguard Worker 2897*cf5a6c84SAndroid Build Coastguard Worker<p>Despite everything, <a href=downloads/toybox-0.7.3.tar.gz>Toybox 0.7.3</a> 2898*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.7.3>git commit</a>) 2899*cf5a6c84SAndroid Build Coastguard Workeris out. The <u>new commands</u> this time are <b>ftpget</b>, <b>ftpput</b>, <b>microcom</b>, and <b>ascii</b>.<p> 2900*cf5a6c84SAndroid Build Coastguard Worker 2901*cf5a6c84SAndroid Build Coastguard Worker<p>We also had two command _demotions_ out of defconfig: 2902*cf5a6c84SAndroid Build Coastguard Worker<b>hostid</b> got moved to toys/example and 2903*cf5a6c84SAndroid Build Coastguard Workerswitched to "default n" because despite <a href=http://pubs.opengroup.org/onlinepubs/9699919799/functions/gethostid.html>still being in posix</a> 2904*cf5a6c84SAndroid Build Coastguard Workerthe concept of a unique 32 bit number identifying a system is something 2905*cf5a6c84SAndroid Build Coastguard WorkerLinux outgrew about the time Pauline Middelink wrote the first IP 2906*cf5a6c84SAndroid Build Coastguard WorkerMasquerading code. And Elliott did a complete rewrite of <b>dmesg</b> introducing 2907*cf5a6c84SAndroid Build Coastguard Workertwo codepaths that I didn't get a chance to unify and didn't want to 2908*cf5a6c84SAndroid Build Coastguard Workerhold up the release for, so that's back in pending.</p> 2909*cf5a6c84SAndroid Build Coastguard Worker 2910*cf5a6c84SAndroid Build Coastguard Worker<p><u>New features</u>: Rob added units to <b>find</b> -atime and friends 2911*cf5a6c84SAndroid Build Coastguard Worker(with the legacy -amin alias). Elliott added color and -w to dmesg, fallocate 2912*cf5a6c84SAndroid Build Coastguard Worker-o, and improved file's ELF parsing. Steve Muckle added -d and finit_module 2913*cf5a6c84SAndroid Build Coastguard Workersupport to modprobe. Rob and Elliott tweaked the 2914*cf5a6c84SAndroid Build Coastguard Workerps/top display format a bit more (extending the USER field from 8 to 18 chars 2915*cf5a6c84SAndroid Build Coastguard Workerand putting + at the end of string fields that got truncated). 2916*cf5a6c84SAndroid Build Coastguard Workerdf -a isn't entirely new, but wasn't documented and needed a bugfix.</p> 2917*cf5a6c84SAndroid Build Coastguard Worker 2918*cf5a6c84SAndroid Build Coastguard Worker<p><u>Bugfixes</u>: 2919*cf5a6c84SAndroid Build Coastguard WorkerLast release broke oneit because -c didn't get moved to xopen_stdio() (oops). 2920*cf5a6c84SAndroid Build Coastguard WorkerRob and Elliott simultaneously spotted ps padding each line to 99999 2921*cf5a6c84SAndroid Build Coastguard Workerchars when there's no tty (serial console or adb); now it pads to 80 in 2922*cf5a6c84SAndroid Build Coastguard Workerthat case but also switches on -w to avoid field truncation. The "tty" 2923*cf5a6c84SAndroid Build Coastguard Workerfield also sometimes had trailing debris (that's fixed now). And "top" was 2924*cf5a6c84SAndroid Build Coastguard Workerendlessly redrawing with out tty because receipt of the ANSI size probe 2925*cf5a6c84SAndroid Build Coastguard Workerresults would set SIGWINCH, and handling that sent another ansi probe. (Sigh.) 2926*cf5a6c84SAndroid Build Coastguard WorkerAnd while we're there, replace "ADDR" with "BIT" in ps -l so there are 2927*cf5a6c84SAndroid Build Coastguard Workermore than 4 chars left for the "CMD" field on 64 bit systems.</p> 2928*cf5a6c84SAndroid Build Coastguard Worker 2929*cf5a6c84SAndroid Build Coastguard Worker<p>Izabera pointed out that split -b and -l can't mix, and suggested seq should 2930*cf5a6c84SAndroid Build Coastguard Workermultiply to avoid accumulating rounding errors from repeated fractional 2931*cf5a6c84SAndroid Build Coastguard Workerincrements. Wang Xiao Jian fixed a bug in sort -k. 2932*cf5a6c84SAndroid Build Coastguard WorkerElliott let getprop use the @ character in property names, and 2933*cf5a6c84SAndroid Build Coastguard WorkerDimitry Ivanov removed the name length limit for system properties. 2934*cf5a6c84SAndroid Build Coastguard WorkerElliott also improved some error reporting and improved top -H's display 2935*cf5a6c84SAndroid Build Coastguard Workerof thread names. 2936*cf5a6c84SAndroid Build Coastguard Worker 2937*cf5a6c84SAndroid Build Coastguard Worker<p>Josh Gao pointed out that recursive operations on . and .. could be ignored 2938*cf5a6c84SAndroid Build Coastguard Workerin chmod -R (and the resulting generic fix to dirtree_notdotdot() fixed 2939*cf5a6c84SAndroid Build Coastguard Workerit in several other places).</p> 2940*cf5a6c84SAndroid Build Coastguard Worker 2941*cf5a6c84SAndroid Build Coastguard Worker<p>Justin Cormack caught tar producing a warning to stdout that screwed up 2942*cf5a6c84SAndroid Build Coastguard Worker"tar c" to stdout. 2943*cf5a6c84SAndroid Build Coastguard WorkerRob fixed an option parsing bug (where switching off a --longopt in menuconfig 2944*cf5a6c84SAndroid Build Coastguard Workerconfused the parser), and another one where an option excluding itself 2945*cf5a6c84SAndroid Build Coastguard Worker(ala "abc[-ab][!abc]" with "command -a -b") would segfault.</p> 2946*cf5a6c84SAndroid Build Coastguard Worker 2947*cf5a6c84SAndroid Build Coastguard Worker<p>There's some sort of gcc stack over-optimization bug where musl-libc's 2948*cf5a6c84SAndroid Build Coastguard Workerversion of vfork() doesn't get marked with attribute(returns_twice) so 2949*cf5a6c84SAndroid Build Coastguard Workerstack varabiles in the same function after that get semi-randomly overwritten 2950*cf5a6c84SAndroid Build Coastguard Workerwhen the optimizer decides to reclaim the space. So add the attribute 2951*cf5a6c84SAndroid Build Coastguard Workerto the function the XVFORK() wrapper macro calls. (It's a nommu thing.)</p> 2952*cf5a6c84SAndroid Build Coastguard Worker 2953*cf5a6c84SAndroid Build Coastguard Worker<p>Fixed a couple variable size mismatch bugs that were only tested on 64 bit 2954*cf5a6c84SAndroid Build Coastguard Worker(printf %x 64) or only tested on 32 bit (modprobe), removed some 2955*cf5a6c84SAndroid Build Coastguard Workerunnecessary casts in stat.</p> 2956*cf5a6c84SAndroid Build Coastguard Worker 2957*cf5a6c84SAndroid Build Coastguard Worker<p>Continuing attempts to build under Android NDK brought up that posix 2958*cf5a6c84SAndroid Build Coastguard Workerdefines the global 'stdout' as a macro, which older versions of bionic 2959*cf5a6c84SAndroid Build Coastguard Workerturned into an array member, but a function was using it as an argument 2960*cf5a6c84SAndroid Build Coastguard Workername. (This worked in the AOSP build because it only builds against current 2961*cf5a6c84SAndroid Build Coastguard Workerbionic, where there's a global 'stdout'.)</p> 2962*cf5a6c84SAndroid Build Coastguard Worker 2963*cf5a6c84SAndroid Build Coastguard Worker<p>Several commits argued with clang's warning generation, eventually 2964*cf5a6c84SAndroid Build Coastguard Workersettling on a variant of __attribute__((__shut_up__)).</p> 2965*cf5a6c84SAndroid Build Coastguard Worker 2966*cf5a6c84SAndroid Build Coastguard Worker<p>Android should no longer give spurious error messages 2967*cf5a6c84SAndroid Build Coastguard Workerwhen you "ps -A | head" about EPIPE on output. (Older versions of bionic 2968*cf5a6c84SAndroid Build Coastguard Workerset an error handler on SIGPIPE, but it shouldn't do that now. More recent 2969*cf5a6c84SAndroid Build Coastguard Workerversions of adb set the SIGPIPE handler to SIGIGN instead of SIGDFL, 2970*cf5a6c84SAndroid Build Coastguard Workerleading to write returning an error message instead of silently killing 2971*cf5a6c84SAndroid Build Coastguard Workerthe program. So we set it back to the default.)</p> 2972*cf5a6c84SAndroid Build Coastguard Worker 2973*cf5a6c84SAndroid Build Coastguard Worker<p><u>Docs</u>: 2974*cf5a6c84SAndroid Build Coastguard WorkerRemoved website link to the gmane archive (which didn't survive gmane's 2975*cf5a6c84SAndroid Build Coastguard Workerchange of ownership). The FAQ now answers a _second_ question. (Woo!) 2976*cf5a6c84SAndroid Build Coastguard WorkerSome roadmap updates.</p> 2977*cf5a6c84SAndroid Build Coastguard Worker 2978*cf5a6c84SAndroid Build Coastguard Worker<p><u>Build tweaks</u>: 2979*cf5a6c84SAndroid Build Coastguard WorkerUpgraded "make install_airlock" target to only warn about missing 2980*cf5a6c84SAndroid Build Coastguard Workercommands (unless $PEDANTIC is set) when it sets up the hermetic build 2981*cf5a6c84SAndroid Build Coastguard Workerpath. (The plan is still to implement everything but the toolchain 2982*cf5a6c84SAndroid Build Coastguard Workerbinaries in toybox, but in the meantime we're symlinking other stuff from 2983*cf5a6c84SAndroid Build Coastguard Workerthe $HOST that isn't ready yet. See 2984*cf5a6c84SAndroid Build Coastguard Worker<a href=https://github.com/landley/mkroot>mkroot</a> for an example using 2985*cf5a6c84SAndroid Build Coastguard Workerthis.)</p> 2986*cf5a6c84SAndroid Build Coastguard Worker 2987*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott and Rob continue to poke at building toybox with Android's NDK, 2988*cf5a6c84SAndroid Build Coastguard Workerbut it's a work in progress (<a href=http://lists.landley.net/pipermail/toybox-landley.net/2016-December/008767.html>thread</a>). Various changes 2989*cf5a6c84SAndroid Build Coastguard Workerremoving libcutils dependencies and adding an selinux dependency to getprop 2990*cf5a6c84SAndroid Build Coastguard Workerare fallout from this.</p> 2991*cf5a6c84SAndroid Build Coastguard Worker 2992*cf5a6c84SAndroid Build Coastguard Worker<p>Cross-compiling from Macs needs to use "gsed" instead of apple's 2993*cf5a6c84SAndroid Build Coastguard Workerversion, so teach the build to use that name if it exists in the $PATH. 2994*cf5a6c84SAndroid Build Coastguard WorkerIf you try to build without running config first, you should get better 2995*cf5a6c84SAndroid Build Coastguard Workererror reporting now. Added a workaround for Centos' broken "which" command 2996*cf5a6c84SAndroid Build Coastguard Workerproducing output when it _can't_ find a name in the $PATH.</p> 2997*cf5a6c84SAndroid Build Coastguard Worker 2998*cf5a6c84SAndroid Build Coastguard Worker<p><u>Library</u>: 2999*cf5a6c84SAndroid Build Coastguard WorkerThe new dirtree flag DIRTREE_PROC skips non-numeric entries so things 3000*cf5a6c84SAndroid Build Coastguard Workerlike ps and top can scan /proc more efficiently.</p> 3001*cf5a6c84SAndroid Build Coastguard Worker 3002*cf5a6c84SAndroid Build Coastguard Worker<a name="21-10-2016" /><a href="#21-10-2016"><hr><h2><b>October 21, 2016</b></h2></a> 3003*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>Probability factor of one to one. We have normality. I repeat, 3004*cf5a6c84SAndroid Build Coastguard Workerwe have normality. Anything you still can't cope with is therefore your 3005*cf5a6c84SAndroid Build Coastguard Workerown problem.</p><p> - The Hitchhiker's Guide to the Galaxy</p></blockquote> 3006*cf5a6c84SAndroid Build Coastguard Worker 3007*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.7.2.tar.gz>Toybox 0.7.2</a> 3008*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.7.2>git commit</a>) 3009*cf5a6c84SAndroid Build Coastguard Workeris out.</p> 3010*cf5a6c84SAndroid Build Coastguard Worker 3011*cf5a6c84SAndroid Build Coastguard Worker<p>During this development cycle, Elliott Hughes <a href=http://androidbackstage.blogspot.com/2016/07/episode-53-adb-on-adb.html>got interviewed 3012*cf5a6c84SAndroid Build Coastguard Workeron the ADB podcast</a> 3013*cf5a6c84SAndroid Build Coastguard Workerand Rob Landley <a href=http://linuxluddites.com/shows/episode-88/>got interviewed on Linux Luddites</a> (<a href=http://linuxluddites.com/shows/episode-11/>again</a>). 3014*cf5a6c84SAndroid Build Coastguard WorkerBoth talk about toybox and many other things. 3015*cf5a6c84SAndroid Build Coastguard WorkerThe web page also grew a new <a href=faq.html>FAQ page</a>, currently with 3016*cf5a6c84SAndroid Build Coastguard Workerjust the one.</p> 3017*cf5a6c84SAndroid Build Coastguard Worker 3018*cf5a6c84SAndroid Build Coastguard Worker<p>New comands added to defconfig are <b>tunctl</b>, 3019*cf5a6c84SAndroid Build Coastguard Worker<b>log</b>, <b>start</b>, <b>stop</b>, and <b>sendevent</b>. 3020*cf5a6c84SAndroid Build Coastguard WorkerThe commands <b>file</b> and <b>netstat</b> got promoted out of pending. 3021*cf5a6c84SAndroid Build Coastguard WorkerPending added <b>chrt</b>, <b>setfattr</b>, and <b>getfattr</b>, and saw 3022*cf5a6c84SAndroid Build Coastguard Workera lot of cleanups to diffstat and dd but not enough to promote them to 3023*cf5a6c84SAndroid Build Coastguard Workerdefconfig yet. A new toys/net directory was added, moving ifconfig, netcat, 3024*cf5a6c84SAndroid Build Coastguard Workernetstat, rfkill, and tunctl there so far.</p> 3025*cf5a6c84SAndroid Build Coastguard Worker 3026*cf5a6c84SAndroid Build Coastguard Worker<p><b>Upgrades</b>: All commands now parse --version when they understand 3027*cf5a6c84SAndroid Build Coastguard Worker--help, but "true" and "false" should now ignore their arguments entirely. 3028*cf5a6c84SAndroid Build Coastguard WorkerWe taught stat to handle "%12x" and "%.12x" printf-style escapes, which 3029*cf5a6c84SAndroid Build Coastguard Workerapparently other versions do. The ifconfig output now shows the interface's 3030*cf5a6c84SAndroid Build Coastguard Workerdevice driver. Added patch -d and --dry-run, wc can now do -cm together, 3031*cf5a6c84SAndroid Build Coastguard Workerfind has a NOP -noleaf so scripts that use that don't break, add -c to md5sum 3032*cf5a6c84SAndroid Build Coastguard Workerand sha1sum. Elliott taught ps to treat extra aguments as additional -p 3033*cf5a6c84SAndroid Build Coastguard Workerpids, implemented xxd -s, did a number of upgrades to file (added -HL, 3034*cf5a6c84SAndroid Build Coastguard Workersupport for ar files, improved ELF support to report android API level 3035*cf5a6c84SAndroid Build Coastguard Workerand stripped/not stripped and it no longer prints a guessed build ID type). 3036*cf5a6c84SAndroid Build Coastguard WorkerElliott also added optional build-time support for using openssl's 3037*cf5a6c84SAndroid Build Coastguard Workerassembly-optimized md5sum/sha1sum implementations (leading to a new 3038*cf5a6c84SAndroid Build Coastguard Worker<a href=design.html>design</a> policy on shared libraries).</p> 3039*cf5a6c84SAndroid Build Coastguard Worker 3040*cf5a6c84SAndroid Build Coastguard Worker<p><b>Bugfixes</b>: Too many fixes to "ps" and "touch" to list, from both 3041*cf5a6c84SAndroid Build Coastguard WorkerElliott and Rob. Rob taught sed to handle s/[[:space:]/]// type sequences 3042*cf5a6c84SAndroid Build Coastguard Workerproperly, switched grep to a better 3043*cf5a6c84SAndroid Build Coastguard Workerworkaround for <a href=https://sourceware.org/bugzilla/show_bug.cgi?id=17829>glibc bug 17829</a>, made sed -i preserve ownership when run as root, 3044*cf5a6c84SAndroid Build Coastguard Workermade du max out at 2 terabytes instead of 2 gigabytes on 32-bit systems 3045*cf5a6c84SAndroid Build Coastguard Worker(it was always designed to, but was missing a typecast), 3046*cf5a6c84SAndroid Build Coastguard Workerfixed the option parsing infrastructure (config options that remove command 3047*cf5a6c84SAndroid Build Coastguard Workerline options got the placeholders wrong), fix to printf for printing 3048*cf5a6c84SAndroid Build Coastguard Workeroctal digits and handling the (posix-mandated) difference between %b and 3049*cf5a6c84SAndroid Build Coastguard Workernon-%b octal output, reading from "-" no longer closes stdin when done, 3050*cf5a6c84SAndroid Build Coastguard Workernetcat -L works with nommu (although it may need more portability work), 3051*cf5a6c84SAndroid Build Coastguard Workerand you can now "make test_scankey" if you want to. Several commands 3052*cf5a6c84SAndroid Build Coastguard Worker(stat, makedeves, chgrp, cp, find) handled user name lookup failure badly 3053*cf5a6c84SAndroid Build Coastguard Worker(stat was segfaulting if you interrogated a file belonging to a nonexistent 3054*cf5a6c84SAndroid Build Coastguard Workeruser, "chown 12345 file" errored out if you didn't have that user 3055*cf5a6c84SAndroid Build Coastguard Workerin /etc/passwd... now they should all print/accept the number when 3056*cf5a6c84SAndroid Build Coastguard Workerappropriate). "LC_ALL=C ls -Cs --color" produces the same output 3057*cf5a6c84SAndroid Build Coastguard Workeras other versions (two spaces padding, -k hardwired on).<p> 3058*cf5a6c84SAndroid Build Coastguard Worker 3059*cf5a6c84SAndroid Build Coastguard Worker<p>Kyungsik Lee fixed a bug 3060*cf5a6c84SAndroid Build Coastguard Workerin cp (readlink() doesn't actually null terminate the string it reads in), 3061*cf5a6c84SAndroid Build Coastguard WorkerElliott Hughes made pgrep/pkill return success/failure, fixed trailing 3062*cf5a6c84SAndroid Build Coastguard Workerwhitespace in netstat, fixed a SMACK symbol conflict due to linux/xattr.h 3063*cf5a6c84SAndroid Build Coastguard Workerchanging, fixed ls -sh, and added a lot of 3064*cf5a6c84SAndroid Build Coastguard Workerstuff to the <a href=roadmap.html>roadmap page</a>. 3065*cf5a6c84SAndroid Build Coastguard WorkerIzabera pointed out cmp -l and -s can't be selected at the same time, 3066*cf5a6c84SAndroid Build Coastguard Workerthat timeout was never actually checking -v, that ls should default to -q 3067*cf5a6c84SAndroid Build Coastguard Workerwhen output is to a tty, and that "file -" would sometimes try to open "-" 3068*cf5a6c84SAndroid Build Coastguard Workerinstead of stdin. 3069*cf5a6c84SAndroid Build Coastguard WorkerUsischev Yury pointed out a use after free error, and that id shouldn't 3070*cf5a6c84SAndroid Build Coastguard Workercall exit() directly. Matthias Urhahn pointed out that stat(2) returns 3071*cf5a6c84SAndroid Build Coastguard Workerhardwired 512-byte units, so stat.c was wrong. David Hedges pointed out 3072*cf5a6c84SAndroid Build Coastguard Workerthat route could only handle 10 character interface names when the kernel 3073*cf5a6c84SAndroid Build Coastguard Workercan do 15 (it's still in pending for a reason, but fixed). Evgenii 3074*cf5a6c84SAndroid Build Coastguard WorkerStepanov found and helped diagnose one of the more subtle ps bugs fixed 3075*cf5a6c84SAndroid Build Coastguard Workerthis time around.</p> 3076*cf5a6c84SAndroid Build Coastguard Worker 3077*cf5a6c84SAndroid Build Coastguard Worker<p>Calling "make test_blah" no longer causes make to error out if the last 3078*cf5a6c84SAndroid Build Coastguard Workertest fails (and thus returns a nonzero error code). 3079*cf5a6c84SAndroid Build Coastguard WorkerBuilding single commands and the multiplexer used to require a "make clean" 3080*cf5a6c84SAndroid Build Coastguard Workerbetween them (because they had different config files both of which were older 3081*cf5a6c84SAndroid Build Coastguard Workerthan generated/config.h so it didn't get rebuilt; now it just always 3082*cf5a6c84SAndroid Build Coastguard Workerrebuilds it).</p> 3083*cf5a6c84SAndroid Build Coastguard Worker 3084*cf5a6c84SAndroid Build Coastguard Worker<p>The defconfig build is now slightly less broken on older centos versions 3085*cf5a6c84SAndroid Build Coastguard Worker(although <a href=http://lists.landley.net/pipermail/toybox-landley.net/2016-September/008664.html>the consensus</a> is that Centos is just generally broken).<p> 3086*cf5a6c84SAndroid Build Coastguard Worker 3087*cf5a6c84SAndroid Build Coastguard Worker<p>Several commands were over-using xprintf(), which flushes its output 3088*cf5a6c84SAndroid Build Coastguard Workerto check for error (something you only need to do maybe once per line, 3089*cf5a6c84SAndroid Build Coastguard Workerand even then maybe only in loops because xexit() flushes and checks 3090*cf5a6c84SAndroid Build Coastguard Workerferror() for you and adjusts the exit code if we wrote stuff to stdout 3091*cf5a6c84SAndroid Build Coastguard Workerthat couldn't be printed). Lots of little flushes are inefficient, 3092*cf5a6c84SAndroid Build Coastguard Workerso most things can use normal printf(). (Retransmission 3093*cf5a6c84SAndroid Build Coastguard Workerof short writes is presumably libc's problem since it's buffering the 3094*cf5a6c84SAndroid Build Coastguard Workeroutput and all.)</p> 3095*cf5a6c84SAndroid Build Coastguard Worker 3096*cf5a6c84SAndroid Build Coastguard Worker<p><b>Library:</b> 3097*cf5a6c84SAndroid Build Coastguard WorkerNew library functions readlink0() and readlinkat0() which properly null 3098*cf5a6c84SAndroid Build Coastguard Workerterminates the symlink value (which the stock libc function inexplicably 3099*cf5a6c84SAndroid Build Coastguard Workerdoesn't). 3100*cf5a6c84SAndroid Build Coastguard WorkerThe new do_lines() function interates reading lines from a filehandle 3101*cf5a6c84SAndroid Build Coastguard Workerand calling a function on each line. 3102*cf5a6c84SAndroid Build Coastguard WorkerNew function pollinate() factoring out netcat's poll() loop so things 3103*cf5a6c84SAndroid Build Coastguard Workerlike telnet can use it. 3104*cf5a6c84SAndroid Build Coastguard WorkerNew functions getusername() and getgroupname() return a 3105*cf5a6c84SAndroid Build Coastguard Workerchar * given a uid/gid (and return a string representation of the number 3106*cf5a6c84SAndroid Build Coastguard Workerif the lookup fails), and xgetpwnamid/xgetgrnamid were renamed to 3107*cf5a6c84SAndroid Build Coastguard Workerxgetuid/xgetgid and now return an integer instead of a struct (also helping 3108*cf5a6c84SAndroid Build Coastguard Workerhandle lookup failures, you can still return the uid/get for "12345").</p> 3109*cf5a6c84SAndroid Build Coastguard Worker 3110*cf5a6c84SAndroid Build Coastguard Worker<p>Switched atolx() to use long long internally. 3111*cf5a6c84SAndroid Build Coastguard WorkerRenamed xopen() to xopen_stdio() and made a new xopen() that never returns 3112*cf5a6c84SAndroid Build Coastguard Workerstdin, stdout, or stderr (duping /dev/null into the filehandles as necessary). 3113*cf5a6c84SAndroid Build Coastguard WorkerNew function xopenro() opens a file read only with one less argument, and 3114*cf5a6c84SAndroid Build Coastguard Workerunderstands that "-" means stdin. New flag WARN_ONLY tells these functions 3115*cf5a6c84SAndroid Build Coastguard Workerto just print a warning on failure, and return -1 instead of exiting. 3116*cf5a6c84SAndroid Build Coastguard WorkerMisc new functions like openro() which defaults to the WARN_ONLY behavior 3117*cf5a6c84SAndroid Build Coastguard Workerand notstdio() which dup()s a filehandle up beyond stdin/out/err backfilling 3118*cf5a6c84SAndroid Build Coastguard Workerwith /dev/null as necessary. The WARN_ONLY flag let us remove the failok 3119*cf5a6c84SAndroid Build Coastguard Workerargument from loopfiles().</p> 3120*cf5a6c84SAndroid Build Coastguard Worker 3121*cf5a6c84SAndroid Build Coastguard Worker<p>New TOYFLAG_NOHELP disables --help processing (which "true" and "false" 3122*cf5a6c84SAndroid Build Coastguard Workershould not do).</b> 3123*cf5a6c84SAndroid Build Coastguard Worker 3124*cf5a6c84SAndroid Build Coastguard Worker<p>The test suite now has NOSPACE=1 to ignore whitespace (using diff -b to 3125*cf5a6c84SAndroid Build Coastguard Workercheck results), which helps TEST_HOST pass the same tests as toybox. 3126*cf5a6c84SAndroid Build Coastguard WorkerFixes to chattr and date tests. It also has a new variable $C with the 3127*cf5a6c84SAndroid Build Coastguard Workerabsolute path to the command being tested (bypassing shell builtins), 3128*cf5a6c84SAndroid Build Coastguard Workerand a function testcmd() which is just like testing() except it prepends 3129*cf5a6c84SAndroid Build Coastguard Workerthe command name ($C) to the test command line as well as the test 3130*cf5a6c84SAndroid Build Coastguard Workerdescription.</p> 3131*cf5a6c84SAndroid Build Coastguard Worker 3132*cf5a6c84SAndroid Build Coastguard Worker<a name="02-06-2016" /><a href="#02-06-2016"><hr><h2><b>June 2, 2016</b></h2></a> 3133*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>When the 'Drink' button is pressed it makes an instant but 3134*cf5a6c84SAndroid Build Coastguard Workerhighly detailed examination of the subject's taste buds, a spectroscopic 3135*cf5a6c84SAndroid Build Coastguard Workeranalysis of the subject's metabolism, and then sends tiny experimental 3136*cf5a6c84SAndroid Build Coastguard Workersignals down the neural pathways to the taste centres of the subject's 3137*cf5a6c84SAndroid Build Coastguard Workerbrain to see what is likely to be well received. However, no-one knows 3138*cf5a6c84SAndroid Build Coastguard Workerquite why it does this because it then invariably delivers a cupful of 3139*cf5a6c84SAndroid Build Coastguard Workerliquid that is almost, but not quite, entirely unlike tea.</p> 3140*cf5a6c84SAndroid Build Coastguard Worker<p> - The Hitchhiker's Guide to the Galaxy</p></blockquote> 3141*cf5a6c84SAndroid Build Coastguard Worker 3142*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.7.1.tar.gz>Toybox 0.7.1</a> 3143*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.7.1>git commit</a>) 3144*cf5a6c84SAndroid Build Coastguard Workeris out. (Yes, I forgot to update the --version string, but I already 3145*cf5a6c84SAndroid Build Coastguard Workeruploaded the <a href=downloads/binaries/0.7.1>binaries</a>.)</p> 3146*cf5a6c84SAndroid Build Coastguard Worker 3147*cf5a6c84SAndroid Build Coastguard Worker<p>The website has https support now, you can "make cat ps ls" 3148*cf5a6c84SAndroid Build Coastguard Workerto get standalone commands (and "make list list_pending" to see what's 3149*cf5a6c84SAndroid Build Coastguard Workeravailable), and a whole lot of bugfixes and new options to existing 3150*cf5a6c84SAndroid Build Coastguard Workercommands.</p> 3151*cf5a6c84SAndroid Build Coastguard Worker 3152*cf5a6c84SAndroid Build Coastguard Worker<h2>New Commands</h2> 3153*cf5a6c84SAndroid Build Coastguard Worker<p>Rob implemented <b>ulimit</b>. In pending, Elliott Hughes implemented 3154*cf5a6c84SAndroid Build Coastguard Workerfile. and Lipi Lee implemented a simple wget. (Pending also had minor 3155*cf5a6c84SAndroid Build Coastguard Workercleanups to more and lsof, but no promotions this time around.)</p> 3156*cf5a6c84SAndroid Build Coastguard Worker 3157*cf5a6c84SAndroid Build Coastguard Worker<h2>New Options</h2> 3158*cf5a6c84SAndroid Build Coastguard Worker<p>Izabera implemented env -u, suggested adding seq -w, made factor 3159*cf5a6c84SAndroid Build Coastguard Workeruse full unsigned 64 bit math even on 32 bit platforms, pointed out base64 3160*cf5a6c84SAndroid Build Coastguard Worker-w0 should disable wrapping, and sped up wc -c. 3161*cf5a6c84SAndroid Build Coastguard WorkerElliott Hughes added mount -o relatime, xxd -p -r, and od -w. 3162*cf5a6c84SAndroid Build Coastguard WorkerSameer Pradhan (or possibly Bilal Qureshi) suggested adding stat -tL -c %m%t%T. 3163*cf5a6c84SAndroid Build Coastguard WorkerTom Cherry added getprop -Z. Paul Barker added hostname -b and -F. 3164*cf5a6c84SAndroid Build Coastguard WorkerRob added ls -b, made ls -q work with utf8, 3165*cf5a6c84SAndroid Build Coastguard Workermade sed -f - read from stdin, and added top -O (like ps -O).</p> 3166*cf5a6c84SAndroid Build Coastguard Worker 3167*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott and Rob <b>added Thread support to ps and top</b>, 3168*cf5a6c84SAndroid Build Coastguard Workerwith -o TID, TNAME. We also added -o PCY (android scheduling policy), 3169*cf5a6c84SAndroid Build Coastguard Worker-o BIT (process is 32 or 64 bit), and -o TNAME now shows the parent 3170*cf5a6c84SAndroid Build Coastguard Workercommand name for threads.</p> 3171*cf5a6c84SAndroid Build Coastguard Worker 3172*cf5a6c84SAndroid Build Coastguard Worker<h2>Documentation</h2> 3173*cf5a6c84SAndroid Build Coastguard Worker 3174*cf5a6c84SAndroid Build Coastguard Worker<p>Rob added the sed invocations to convert tabs/spaces and back to 3175*cf5a6c84SAndroid Build Coastguard Workerdesign.html. Isaac Dunham updated hexedit's help text. 3176*cf5a6c84SAndroid Build Coastguard WorkerJakob Flierl pointed out a broken URL in the README.</p> 3177*cf5a6c84SAndroid Build Coastguard Worker 3178*cf5a6c84SAndroid Build Coastguard Worker<p>Rob also redid the naming scheme of sed's pattern manipulation code to 3179*cf5a6c84SAndroid Build Coastguard Workerremove the gratuitous references to Roger Zelazny's "Amber" series, since it 3180*cf5a6c84SAndroid Build Coastguard Workerwas confusing people.</p> 3181*cf5a6c84SAndroid Build Coastguard Worker 3182*cf5a6c84SAndroid Build Coastguard Worker<h2>Bugfixes</h2> 3183*cf5a6c84SAndroid Build Coastguard Worker 3184*cf5a6c84SAndroid Build Coastguard Worker<p>Grep -H and -n should now work properly with -ABC. Andy Chu pointed out an 3185*cf5a6c84SAndroid Build Coastguard Workerout of bounds access for zero length lines in rev, fixed a buffer overflow 3186*cf5a6c84SAndroid Build Coastguard Workerin diff -r, and fixed operator precedence in expr (although Rob is rewriting 3187*cf5a6c84SAndroid Build Coastguard Workerchunks of expr so toysh can use its plumbing for $(( )) ). 3188*cf5a6c84SAndroid Build Coastguard WorkerPatrick Ohly fixed the too-aggressive suid permission dropping logic. 3189*cf5a6c84SAndroid Build Coastguard WorkerJosh Gao fixed a segfault when find -iname got no argument, and 3190*cf5a6c84SAndroid Build Coastguard Workermade tail -f work right with just one file argument. 3191*cf5a6c84SAndroid Build Coastguard WorkerTom Marshall cleaned up tar's long filename support and improved 3192*cf5a6c84SAndroid Build Coastguard Workerthe tar tests, and reported another find bug (with -iname -o -iname not 3193*cf5a6c84SAndroid Build Coastguard Workertracking copy lifetimes properly) that got fixed.</p> 3194*cf5a6c84SAndroid Build Coastguard Worker 3195*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott Hughes fixed wc -c to not trust zero length files to actually be 3196*cf5a6c84SAndroid Build Coastguard Workerzero length (/proc does that), fixed "mount -o rw,remount /system" on 3197*cf5a6c84SAndroid Build Coastguard WorkerAndroid, removed trailing spaces on ps -o cmdline, fixed pkill -9 and 3198*cf5a6c84SAndroid Build Coastguard Workerthe corresponding tests, made "insmod -" work, fixed top -b and tail -NUM, 3199*cf5a6c84SAndroid Build Coastguard Workerpointed out that ps shouldn't trim numeric fields for display size limits, 3200*cf5a6c84SAndroid Build Coastguard Workerand added some more 3201*cf5a6c84SAndroid Build Coastguard Workerexplicit "sort" calls to make pipelines so build tempfiles are easier to cache. 3202*cf5a6c84SAndroid Build Coastguard WorkerRob <a href=https://github.com/landley/toybox/commit/32b3587af261>fixed an insane sed thing</a> the perl 5.22 build was doing. 3203*cf5a6c84SAndroid Build Coastguard WorkerFixed mount -o to properly pass in leftover string data, and 3204*cf5a6c84SAndroid Build Coastguard Worker<a href=http://lists.landley.net/pipermail/toybox-landley.net/2016-March/004790.html>documented how to use toybox to mount nfs</a> (warning: kernel patch 3205*cf5a6c84SAndroid Build Coastguard Workerto fix some bitrot in the kernel NFS driver's string parsing attached 3206*cf5a6c84SAndroid Build Coastguard Workerto that message).</p> 3207*cf5a6c84SAndroid Build Coastguard Worker 3208*cf5a6c84SAndroid Build Coastguard Worker<p>George Burgess IV corrected some variable types in traceroute. 3209*cf5a6c84SAndroid Build Coastguard WorkerBase64 now wraps == properly. Fixed two bzcat segfaults reported by 3210*cf5a6c84SAndroid Build Coastguard WorkerJohn Regehr. Andy Chu found a segfault in "sed -e 'c\'" with no trailing 3211*cf5a6c84SAndroid Build Coastguard Workerline, and implemented mv -n and cp -n. The cyanogenmod guys pointed out that 3212*cf5a6c84SAndroid Build Coastguard Workercp -a shouldn't complain if a non-root user can't chown, and we added 3213*cf5a6c84SAndroid Build Coastguard Workerthe output path to cp -r error messages while we were there (before was just 3214*cf5a6c84SAndroid Build Coastguard Workerthe filename).</p> 3215*cf5a6c84SAndroid Build Coastguard Worker 3216*cf5a6c84SAndroid Build Coastguard Worker<p>Samuel Holland fixed blkid's handling of vfat labels, and 3217*cf5a6c84SAndroid Build Coastguard Workerfixed a segfault when basename was passed an empty string and an empty 3218*cf5a6c84SAndroid Build Coastguard Workersuffix. Davis Mosenkovs fixed touch -t seconds parsing. 3219*cf5a6c84SAndroid Build Coastguard WorkerRob fixed a bunzip bug reported by John Regehr (the bad CRC 3220*cf5a6c84SAndroid Build Coastguard Workererror message was printing a NUL argument).</p> 3221*cf5a6c84SAndroid Build Coastguard Worker 3222*cf5a6c84SAndroid Build Coastguard Worker<p>Not all of the commands build standalone, but more of them do now; 3223*cf5a6c84SAndroid Build Coastguard Workerscripts/single.sh can now build a "mv" that isn't actually "cp". 3224*cf5a6c84SAndroid Build Coastguard WorkerThe dependencies are more granualr, so "make top; make ps" no longer 3225*cf5a6c84SAndroid Build Coastguard Workerproduces a broken ps that ignores -A (because ps.o wasn't getting rebuilt 3226*cf5a6c84SAndroid Build Coastguard Workereven though top had the FLAG macros for -A zeroed).</p> 3227*cf5a6c84SAndroid Build Coastguard Worker 3228*cf5a6c84SAndroid Build Coastguard Worker<h2>Build</h2> 3229*cf5a6c84SAndroid Build Coastguard Worker<p>Rob added a <b>warning when building commands out of 3230*cf5a6c84SAndroid Build Coastguard Workerpending</b>. (The pending directory is full of code that hasn't been 3231*cf5a6c84SAndroid Build Coastguard Workerproperly vetted. Use at your own risk.)</p> 3232*cf5a6c84SAndroid Build Coastguard Worker 3233*cf5a6c84SAndroid Build Coastguard Worker<p><b>New build targets let you build individual commands by name</b>, ala 3234*cf5a6c84SAndroid Build Coastguard Worker"make ls cat ps", and you can run the test suite for each standalone 3235*cf5a6c84SAndroid Build Coastguard Workercommand with "make test_ls" and such. 3236*cf5a6c84SAndroid Build Coastguard Worker"make list" shows all such standalone commands in defconfig, and 3237*cf5a6c84SAndroid Build Coastguard Worker"make list_pending" shows unfinished commands from toys/pending 3238*cf5a6c84SAndroid Build Coastguard Worker("make list list_pending" shows both together). "make clean" now deletes 3239*cf5a6c84SAndroid Build Coastguard Workerthese filenames at the top level, and the corresponding unstripped files 3240*cf5a6c84SAndroid Build Coastguard Workerlive in the directory generated/unstripped.</p> 3241*cf5a6c84SAndroid Build Coastguard Worker 3242*cf5a6c84SAndroid Build Coastguard Worker<p>Nicholas Boichat suggested switching make.sh to use $! for process 3243*cf5a6c84SAndroid Build Coastguard Workerenumeration during parallel builds (which is both more efficient and more 3244*cf5a6c84SAndroid Build Coastguard Workerportable), and suggested shell builtin replacements for wc/awk/sed so the 3245*cf5a6c84SAndroid Build Coastguard Workerbuild loop has fewer forks now.</p> 3246*cf5a6c84SAndroid Build Coastguard Worker 3247*cf5a6c84SAndroid Build Coastguard Worker<p>Lots of work on the test suite, much of it due to Andy Chu. It now 3248*cf5a6c84SAndroid Build Coastguard Workerconsistently prints the name of the command being tested at the start of each 3249*cf5a6c84SAndroid Build Coastguard Workertest (and the common infrastructure does that, not each individual test), and 3250*cf5a6c84SAndroid Build Coastguard Worker"make tests" actually runs all the available tests now. 3251*cf5a6c84SAndroid Build Coastguard WorkerSeperated pgrep and pkill tests, split lsattr/chattr, added fstype and base64 3252*cf5a6c84SAndroid Build Coastguard Workertests. The "tests/files" directory now collects files for tests to 3253*cf5a6c84SAndroid Build Coastguard Workeruse, with blkid, bzcat, and utf8 subdirectories: the $FILES variable 3254*cf5a6c84SAndroid Build Coastguard Workergives a path to it, so "$FILES/blkid/ext2.bz2" and so on. 3255*cf5a6c84SAndroid Build Coastguard WorkerThe testsuite now has test files with 3 different types of "not utf8 output" 3256*cf5a6c84SAndroid Build Coastguard Workersequences that require escaping, plus some combining character torture 3257*cf5a6c84SAndroid Build Coastguard Workertests, direction reversals, and so on.</p> 3258*cf5a6c84SAndroid Build Coastguard Worker 3259*cf5a6c84SAndroid Build Coastguard Worker<p>Added dependencies on TOYBOX_FORK to various pending commands that need 3260*cf5a6c84SAndroid Build Coastguard Workernommu conversion (which should fix the allyesconfig build).</p> 3261*cf5a6c84SAndroid Build Coastguard Worker 3262*cf5a6c84SAndroid Build Coastguard Worker<p>Static builds with selinux should work again.</p> 3263*cf5a6c84SAndroid Build Coastguard Worker 3264*cf5a6c84SAndroid Build Coastguard Worker<h2>Library</h2> 3265*cf5a6c84SAndroid Build Coastguard Worker 3266*cf5a6c84SAndroid Build Coastguard Worker<p>New bufgetgrgid() and bufgetpwuid() functions cache previous lookup info 3267*cf5a6c84SAndroid Build Coastguard Workerrather than repeatedly traversing /etc/passwd and /etc/group (which is slow). 3268*cf5a6c84SAndroid Build Coastguard WorkerAdded xpipe() to lib to catch pipe creation failure. 3269*cf5a6c84SAndroid Build Coastguard WorkerThe HELP_ macros generated by config2help.c now use a capital prefix 3270*cf5a6c84SAndroid Build Coastguard Workerto avoid collicing with help_exit() and such.</p> 3271*cf5a6c84SAndroid Build Coastguard Worker 3272*cf5a6c84SAndroid Build Coastguard Worker<p>The dirtree infrastructure got a cleanup pass in preparation for adding 3273*cf5a6c84SAndroid Build Coastguard Workerinfinite recursion depth support (needed by rm -r), updated the 3274*cf5a6c84SAndroid Build Coastguard Worker<a href=code.html#ib_dirtree>documentation</a> to describe the new 3275*cf5a6c84SAndroid Build Coastguard Workersemantics (removing dirtree_start() and adding dirtree_flagread()). 3276*cf5a6c84SAndroid Build Coastguard WorkerNow dirtree_recurse() takes the new dirfd as an argument.</p> 3277*cf5a6c84SAndroid Build Coastguard Worker 3278*cf5a6c84SAndroid Build Coastguard Worker<p>Split out _xexit() from xexit() and let sigatexit() set multiple 3279*cf5a6c84SAndroid Build Coastguard Workercallbacks.</p> 3280*cf5a6c84SAndroid Build Coastguard Worker 3281*cf5a6c84SAndroid Build Coastguard Worker<p>For years the man pages have said to #include <sys/types.h> to get 3282*cf5a6c84SAndroid Build Coastguard Workermajor/minor/makedev but now that glibc 3283*cf5a6c84SAndroid Build Coastguard Worker<a href=https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html>has vowed 3284*cf5a6c84SAndroid Build Coastguard Workerto break existing programs</a> and replace it with another nonstandard header 3285*cf5a6c84SAndroid Build Coastguard Workernot in posix or lsb, we added our own functions to lib/ to do the transform 3286*cf5a6c84SAndroid Build Coastguard Workerourselves (based on what the kernel actually expects).</p> 3287*cf5a6c84SAndroid Build Coastguard Worker 3288*cf5a6c84SAndroid Build Coastguard Worker<h2>Portability</h2> 3289*cf5a6c84SAndroid Build Coastguard Worker 3290*cf5a6c84SAndroid Build Coastguard Worker<p>Debian unstable started needing an extra header #include for some reason, and 3291*cf5a6c84SAndroid Build Coastguard Workeralthough printf("%.*s", INT_MAX, s) worked fine on Ubuntu 12.04 it 3292*cf5a6c84SAndroid Build Coastguard Workerdidn't on 14.04, so added a workaround for that. Typecast a printf because 3293*cf5a6c84SAndroid Build Coastguard Workerwchar_t isn't a rigidly defined size. RLIMIT_RTTIME was 3294*cf5a6c84SAndroid Build Coastguard Workeradded to the kernel in 2008 but you can't expect uClibc to have noticed yet, 3295*cf5a6c84SAndroid Build Coastguard Workernor did it #define MS_RELATIME (added in 2006), or prlimit (2010)... 3296*cf5a6c84SAndroid Build Coastguard Worker(Given the improvements in musl and bionic, uClibc support may be dropped 3297*cf5a6c84SAndroid Build Coastguard Workerin a future release.) Given that the xattr functions were added during 3298*cf5a6c84SAndroid Build Coastguard Workerlinux 2.5, we can #include its header unconditionally.</p> 3299*cf5a6c84SAndroid Build Coastguard Worker 3300*cf5a6c84SAndroid Build Coastguard Worker<p>Renamed basename_r() to something else to avoid conflicting with freebsd's 3301*cf5a6c84SAndroid Build Coastguard Workerlibc, and both scripts/install.h and scripts/config2help.c no longer include 3302*cf5a6c84SAndroid Build Coastguard Workertoys.h (to make cross-compiling from systems we don't run on easier).</p> 3303*cf5a6c84SAndroid Build Coastguard Worker 3304*cf5a6c84SAndroid Build Coastguard Worker<p>Debian bug 635570 did something unspeakably nonportable, depending on 3305*cf5a6c84SAndroid Build Coastguard Worker"sed -e 'a\'" (with no next line of the pattern, so an unterminated 3306*cf5a6c84SAndroid Build Coastguard Workercontinuation) to add a newline to the last line of input if and only if 3307*cf5a6c84SAndroid Build Coastguard Workerthat last line of the input didn't have a newline, and to take no other 3308*cf5a6c84SAndroid Build Coastguard Workeraction. This is well into "depending on a bug" territory, but we implemented 3309*cf5a6c84SAndroid Build Coastguard Workerit because otherwise Debian's install broke. (Of course this behavior 3310*cf5a6c84SAndroid Build Coastguard Workeris undocumented, non-obvious, and doesn't really make logical sense.)</p> 3311*cf5a6c84SAndroid Build Coastguard Worker 3312*cf5a6c84SAndroid Build Coastguard Worker<p>CONFIG_TOYBOX_NORECURSE now disables the stack measuring logic (which 3313*cf5a6c84SAndroid Build Coastguard Workerwas giving some "security" code fits). Also we typecast pointers to (long) 3314*cf5a6c84SAndroid Build Coastguard Workerbefore comparing them to avoid spurious compiler "optimizations" that 3315*cf5a6c84SAndroid Build Coastguard Workerbreak the code.</p> 3316*cf5a6c84SAndroid Build Coastguard Worker 3317*cf5a6c84SAndroid Build Coastguard Worker<a name="02-02-2016" /><a href="#02-02-2016"><hr><h2><b>February 2, 2016</b></h2></a> 3318*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>"I checked it very thoroughly," said the computer, "and that 3319*cf5a6c84SAndroid Build Coastguard Workerquite definitely is the answer. I think the problem, to be quite honest with 3320*cf5a6c84SAndroid Build Coastguard Workeryou, is that you've never actually known what the question is." 3321*cf5a6c84SAndroid Build Coastguard Worker</p><p>- The Hitchhiker's Guide to the Galaxy</p></blockquote> 3322*cf5a6c84SAndroid Build Coastguard Worker 3323*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.7.0.tar.gz>Toybox 0.7.0</a> 3324*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.7.0>git commit</a>) 3325*cf5a6c84SAndroid Build Coastguard Workeris out.</p> 3326*cf5a6c84SAndroid Build Coastguard Worker 3327*cf5a6c84SAndroid Build Coastguard Worker<p>The new commands in defconfig are <b>iotop</b>, <b>top</b>, <b>pgrep</b>, 3328*cf5a6c84SAndroid Build Coastguard Workerand <b>pkill</b> 3329*cf5a6c84SAndroid Build Coastguard Worker(most replacing corresponding versions from pending). Added grep -ABC, 3330*cf5a6c84SAndroid Build Coastguard Workerswapon -d (discard), mkswap -L (label) and UUID support, and find -delete. 3331*cf5a6c84SAndroid Build Coastguard WorkerIzabera added free -h and unshare -f. Josh Gao implemented tail -f. 3332*cf5a6c84SAndroid Build Coastguard WorkerJose Bollo submitted cp --preserve=context,attr. Kylie McClain added 3333*cf5a6c84SAndroid Build Coastguard Workermktemp -u.</p> 3334*cf5a6c84SAndroid Build Coastguard Worker 3335*cf5a6c84SAndroid Build Coastguard Worker<p>In pending there's the start of a vi command, and Sameer Pradhan contributed 3336*cf5a6c84SAndroid Build Coastguard Workera new dhcp6. This cycle saw several rounds of route cleanup and a little dhcp 3337*cf5a6c84SAndroid Build Coastguard Workercleanup, but neither are complete yet. Lipi Lee did some cleanup to netstat.c 3338*cf5a6c84SAndroid Build Coastguard Workerand Elliott Hughes removed warnings from traceroute.</p> 3339*cf5a6c84SAndroid Build Coastguard Worker 3340*cf5a6c84SAndroid Build Coastguard Worker<p>Lots of updates to ps: several new -o options, -k (--sort) -O and -M, 3341*cf5a6c84SAndroid Build Coastguard Workerimproved compatibility with Android's historical behavior, and 3342*cf5a6c84SAndroid Build Coastguard Workerextensive internal code cleanup (including the removal of all 3343*cf5a6c84SAndroid Build Coastguard Workerthe magic constants).</p> 3344*cf5a6c84SAndroid Build Coastguard Worker 3345*cf5a6c84SAndroid Build Coastguard Worker<h3><b>Website</b></h3> 3346*cf5a6c84SAndroid Build Coastguard Worker 3347*cf5a6c84SAndroid Build Coastguard Worker<p>Dreamhost restored the <a href="#12-21-2015">missing 11 months</a> 3348*cf5a6c84SAndroid Build Coastguard Workerto the mailing list archive, in the process deleting the month after 3349*cf5a6c84SAndroid Build Coastguard Workerthat. Now they've asked if I have mbox files archiving the new 3350*cf5a6c84SAndroid Build Coastguard Workergap (between December 20, 2015 to January 21, 2016, and presumably they 3351*cf5a6c84SAndroid Build Coastguard Workercould also fill in the gap from December 14, 2014 to January 3, 2015 that's 3352*cf5a6c84SAndroid Build Coastguard Workerbeen there since the last time they did this), 3353*cf5a6c84SAndroid Build Coastguard Workerbut due to some gmail filtering I've 3354*cf5a6c84SAndroid Build Coastguard Worker<a href=http://landley.net/notes-2012.html#15-10-2012>never 3355*cf5a6c84SAndroid Build Coastguard Workerbeen able to disable</a>, my copy of those files is spread among 3 different 3356*cf5a6c84SAndroid Build Coastguard Workermbox files I'd have to sort/filter/collate. (It's on the todo list.)</p> 3357*cf5a6c84SAndroid Build Coastguard Worker 3358*cf5a6c84SAndroid Build Coastguard Worker<p>Added a code of conduct to the README (we're 3359*cf5a6c84SAndroid Build Coastguard Worker<a href=https://engineering.twitter.com/opensource/code-of-conduct>borrowing twitter's</a>) because somebody 3360*cf5a6c84SAndroid Build Coastguard Workermade it necessary.</p> 3361*cf5a6c84SAndroid Build Coastguard Worker 3362*cf5a6c84SAndroid Build Coastguard Worker<h3><b>Bugfixes</b></h3> 3363*cf5a6c84SAndroid Build Coastguard Worker<p>Fixed another sed bug where any ] right after [ was skipped (not just the 3364*cf5a6c84SAndroid Build Coastguard Workerfirst one in the range, so [[] didn't terminate). Fixed sort -f and added test cases. 3365*cf5a6c84SAndroid Build Coastguard WorkerAssume 80 columns in "ls -m | cat", ls -L is no longer backwards, 3366*cf5a6c84SAndroid Build Coastguard Workerand ls of files with no paths no longer uses an uninitialized (zero) dirfd. 3367*cf5a6c84SAndroid Build Coastguard WorkerSeveral bugfixes 3368*cf5a6c84SAndroid Build Coastguard Workerto find (Gilad Arnold fixed -perm, Daniel K. Levy fixed "find . -exec echo {}", 3369*cf5a6c84SAndroid Build Coastguard Workerand while we're there I fixed find --prune, made "find . -execdir 3370*cf5a6c84SAndroid Build Coastguard Workerecho {} + -execdir ls {} +" work, and ripped out the environment size 3371*cf5a6c84SAndroid Build Coastguard Workermeasuring code that checked for a 128k limit removed back in linux 2.6.22). 3372*cf5a6c84SAndroid Build Coastguard WorkerElliott Hughes fixed the date command's parsing of 4 digit 3373*cf5a6c84SAndroid Build Coastguard Workeryears and documented the %s escape, fixed hwclock -u, and pointed out 3374*cf5a6c84SAndroid Build Coastguard Workerthat runcon needs to exec to do its job (not recursively call another 3375*cf5a6c84SAndroid Build Coastguard Workercommand_main() in the same process). Tom Marshall reported that blkid was 3376*cf5a6c84SAndroid Build Coastguard Workerhandling ext2 wrong. Mike Moreton corrected cpio extraction's uid and gid 3377*cf5a6c84SAndroid Build Coastguard Workervalues, and added a --no-preserve-owner option. Fixed the SUID permission 3378*cf5a6c84SAndroid Build Coastguard Workerdropping logic (which was a bit over-zealous, preventing some commands from 3379*cf5a6c84SAndroid Build Coastguard Workerrunning at all).</p> 3380*cf5a6c84SAndroid Build Coastguard Worker 3381*cf5a6c84SAndroid Build Coastguard Worker<p>I'm told that debian-testing broke its libc so the nsenter build breaks, 3382*cf5a6c84SAndroid Build Coastguard Workerbut my attempts to install the debian-testing network cd image under 3383*cf5a6c84SAndroid Build Coastguard Workerqemu keep breaking. Maybe someday they'll fix it enough I can actually 3384*cf5a6c84SAndroid Build Coastguard Workerreproduce the problem. (Debootstrap under unbuntu builds an ubuntu-flavored 3385*cf5a6c84SAndroid Build Coastguard Workerchroot in which toybox builds fine.)</p> 3386*cf5a6c84SAndroid Build Coastguard Worker 3387*cf5a6c84SAndroid Build Coastguard Worker<h3><b>Documentation</b></h3> 3388*cf5a6c84SAndroid Build Coastguard Worker<p>Rewrite of the about.html page, tweaks to design.html, and a re-triage of 3389*cf5a6c84SAndroid Build Coastguard Workersbase in roadmap.html. Update to mkstatus.py to collate multiple span 3390*cf5a6c84SAndroid Build Coastguard Workertags with the same id, resulting in a larger status.html page (which 3391*cf5a6c84SAndroid Build Coastguard Workerwas previously ignoring some commands in the roadmap).</p> 3392*cf5a6c84SAndroid Build Coastguard Worker 3393*cf5a6c84SAndroid Build Coastguard Worker<p>Expanded the defconfig/allyesconfig/allnoconfighelp text in "make help" 3394*cf5a6c84SAndroid Build Coastguard Workerto explain what they're for.</p> 3395*cf5a6c84SAndroid Build Coastguard Worker 3396*cf5a6c84SAndroid Build Coastguard Worker<h3><b>infrastructure</b></h3> 3397*cf5a6c84SAndroid Build Coastguard Worker<ul> 3398*cf5a6c84SAndroid Build Coastguard Worker<li><p>Expanded toys.optargs to 64 bits so a command can have more than 32 options.</p></li> 3399*cf5a6c84SAndroid Build Coastguard Worker<li><p>Added NOEXIT() wrapper to turn xwrap() functions into warning versions 3400*cf5a6c84SAndroid Build Coastguard Workerusing the existing longjump(toys.rebound) infrastructure.</p></li> 3401*cf5a6c84SAndroid Build Coastguard Worker<li><p>Renamed dirtree->data to dirfd and stopped storing symlink length 3402*cf5a6c84SAndroid Build Coastguard Workerinto it (this fixed a bug where following symlinks to directories 3403*cf5a6c84SAndroid Build Coastguard Workerdidn't give a valid directory filehandle, noticeable with ls -Z).</p></li> 3404*cf5a6c84SAndroid Build Coastguard Worker<li><p>New TAGGED_ARRAY() infrastructure generates index and bitmask macros 3405*cf5a6c84SAndroid Build Coastguard Workerfor arrays of structures starting with a name string.</p></li> 3406*cf5a6c84SAndroid Build Coastguard Worker<li><p>New lib/linestack.c for utf8 fontmetrics (draw_str() and utf8len() 3407*cf5a6c84SAndroid Build Coastguard Workerand so on), and for tracking multiple lines of text 3408*cf5a6c84SAndroid Build Coastguard Worker(vi, less, shell history) that need wordwrapping and scrolling up/down.</p></li> 3409*cf5a6c84SAndroid Build Coastguard Worker<li><p>Upgrades to lib/interestingtimes.c: scan_key() now has a timeout 3410*cf5a6c84SAndroid Build Coastguard Workerin milliseconds and recognizes more sequences including ANSI 3411*cf5a6c84SAndroid Build Coastguard Workerwindow size probes. New utf8 test files in tests/files/utf8 including 3412*cf5a6c84SAndroid Build Coastguard Workersequence reversing, stacked combining chars, and all three types of 3413*cf5a6c84SAndroid Build Coastguard Workerunprintable sequences (low ascii <32 ala ^X, invalid utf8 sequences ala 3414*cf5a6c84SAndroid Build Coastguard Worker<AB><CD>, and invalid unicode code points ala U+1234).</p></li> 3415*cf5a6c84SAndroid Build Coastguard Worker<li><p>More comma handling code in lib.c: comma_args()</p></li> 3416*cf5a6c84SAndroid Build Coastguard Worker<li><p>Added error_msg_raw() to shut up fortify's endless static checking false 3417*cf5a6c84SAndroid Build Coastguard Workerpositives.</p></li> 3418*cf5a6c84SAndroid Build Coastguard Worker<li><p>readfileat() can now realloc() in a loop to read long files 3419*cf5a6c84SAndroid Build Coastguard Worker("zcat | insmod" needed it).</p></li> 3420*cf5a6c84SAndroid Build Coastguard Worker</ul> 3421*cf5a6c84SAndroid Build Coastguard Worker 3422*cf5a6c84SAndroid Build Coastguard Worker<h3><b>Roadmap</b></h3> 3423*cf5a6c84SAndroid Build Coastguard Worker<p>We're getting close to having a self-hosting development environment 3424*cf5a6c84SAndroid Build Coastguard Workerusing toybox for the command line. The remaining busybox commands in 3425*cf5a6c84SAndroid Build Coastguard Worker<a href=http://landley.net/aboriginal/about.html>Aboriginal Linux</a> are:</p> 3426*cf5a6c84SAndroid Build Coastguard Worker 3427*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p><b> 3428*cf5a6c84SAndroid Build Coastguard Workerawk bunzip2 bzcat bzip2 dd diff expr fdisk ftpd ftpget ftpput gunzip gzip 3429*cf5a6c84SAndroid Build Coastguard Workerless ping route sh sha512sum tar test tr unxz vi wget xzcat zcat 3430*cf5a6c84SAndroid Build Coastguard Worker</b></p></blockquote> 3431*cf5a6c84SAndroid Build Coastguard Worker 3432*cf5a6c84SAndroid Build Coastguard Worker<p>And the remaining non-busybox commands in Aboriginal Linux's build/host 3433*cf5a6c84SAndroid Build Coastguard Workerdirectory (from the distcc, genext2fs, e2fsprogs, zlib, and squashfs packagesi) 3434*cf5a6c84SAndroid Build Coastguard Workerare:</p> 3435*cf5a6c84SAndroid Build Coastguard Worker 3436*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p><b> 3437*cf5a6c84SAndroid Build Coastguard Workermke2fs fsck.ext2 resize2fs distcc genext2fs unsquashfs distccd mksquashfs tune2fs 3438*cf5a6c84SAndroid Build Coastguard Worker</b></p></blockquote> 3439*cf5a6c84SAndroid Build Coastguard Worker 3440*cf5a6c84SAndroid Build Coastguard Worker<p>Squashfs and distcc are probably out of scope for toybox, but mke2fs, 3441*cf5a6c84SAndroid Build Coastguard Workerfsck.ext2, resize2fs, genext2fs, and tune2fs should all be added to the 3442*cf5a6c84SAndroid Build Coastguard Workerabove "busybox" replacement list.</p> 3443*cf5a6c84SAndroid Build Coastguard Worker 3444*cf5a6c84SAndroid Build Coastguard Worker<p>Remind me to include this countdown in future releases. Once they've all 3445*cf5a6c84SAndroid Build Coastguard Workerbeen replaced, the next goal is <a href=http://landley.net/aboriginal/about.html#selfhost>building AOSP under itself</a>.</p> 3446*cf5a6c84SAndroid Build Coastguard Worker 3447*cf5a6c84SAndroid Build Coastguard Worker<p>See the full <a href=roadmap.html>roadmap</a> and <a href=status.html>status</a> 3448*cf5a6c84SAndroid Build Coastguard Workerpages for more details.</p> 3449*cf5a6c84SAndroid Build Coastguard Worker 3450*cf5a6c84SAndroid Build Coastguard Worker<a name="12-21-2015" /><a href="#12-21-2015"><hr><h2><b>December 21, 2015</b></h2></a> 3451*cf5a6c84SAndroid Build Coastguard Worker 3452*cf5a6c84SAndroid Build Coastguard Worker<p>Yes, 11 months have gone missing from the mailing list web archive.</p> 3453*cf5a6c84SAndroid Build Coastguard Worker 3454*cf5a6c84SAndroid Build Coastguard Worker<p>Yesterday evening Dreamhost's mailman server went down (timing out trying 3455*cf5a6c84SAndroid Build Coastguard Workerto connect). I poked them about it, they 3456*cf5a6c84SAndroid Build Coastguard Worker<a href=https://twitter.com/landley/status/678781271670149121>blamed 3457*cf5a6c84SAndroid Build Coastguard WorkerDNS</a>, I explained that the hang was _after_ the DNS lookup and 3458*cf5a6c84SAndroid Build Coastguard Workerentered the dig info into the trouble ticket showing the IPs the DNS 3459*cf5a6c84SAndroid Build Coastguard Workerqueries were returning, they reinstalled the server at that IP from what I 3460*cf5a6c84SAndroid Build Coastguard Workerassume was their most recent backup, and that's how 11 months of messages 3461*cf5a6c84SAndroid Build Coastguard Workervanished out of the archive.</p> 3462*cf5a6c84SAndroid Build Coastguard Worker 3463*cf5a6c84SAndroid Build Coastguard Worker<p>I've <a href=https://twitter.com/landley/status/679114451975467008>continued to poke them about it</a> but I honestly believe that's the best they 3464*cf5a6c84SAndroid Build Coastguard Workercan do. <a href=http://landley.net/dreamhost.txt>Last time</a> 3465*cf5a6c84SAndroid Build Coastguard Workerthis sort of thing <a href=http://landley.net/dreamhost2.txt>happened</a> 3466*cf5a6c84SAndroid Build Coastguard Workerwe went back and forth for months, so I added a link to a backup web 3467*cf5a6c84SAndroid Build Coastguard Workerarchive (in the nav bar on the left) that isn't controlled by dreamhost, 3468*cf5a6c84SAndroid Build Coastguard Workerand thus doesn't gratuitously lose data on a regular basis. (I note 3469*cf5a6c84SAndroid Build Coastguard Workerthe earlier hole in Dreamhost's archive was never fixed either. That 3470*cf5a6c84SAndroid Build Coastguard Workerwas data never getting archived, this is a year's worth of data that 3471*cf5a6c84SAndroid Build Coastguard Workerwas in the archive until yesterday vanishing after the fact.)</p> 3472*cf5a6c84SAndroid Build Coastguard Worker 3473*cf5a6c84SAndroid Build Coastguard Worker<p>If you're wondering why the <a href=http://lists.landley.net>top level</a> 3474*cf5a6c84SAndroid Build Coastguard Workerlist page has been "temporarily disabled" for multiple years now... you'd have 3475*cf5a6c84SAndroid Build Coastguard Workerto ask Dreamhost. I know I have. More than a dozen times.</p> 3476*cf5a6c84SAndroid Build Coastguard Worker 3477*cf5a6c84SAndroid Build Coastguard Worker<a name="03-11-2015" /><a href="#03-11-2015"><hr><h2><b>November 3, 2015</b></h2></a> 3478*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>"Alright," said Ford. "How would you react if I said that I'm 3479*cf5a6c84SAndroid Build Coastguard Workernot from Guildford after all, but from a small planet somewhere in the vicinity 3480*cf5a6c84SAndroid Build Coastguard Workerof Betelgeuse?" Arthur shrugged in a so-so sort of way. "I don't know," he 3481*cf5a6c84SAndroid Build Coastguard Workersaid, taking a pull of beer. "Why - do you think it's the sort of thing you're 3482*cf5a6c84SAndroid Build Coastguard Workerlikely to say?"</p><p>- The Hitchhiker's Guide to the Galaxy</p></blockquote> 3483*cf5a6c84SAndroid Build Coastguard Worker 3484*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.6.1.tar.gz>Toybox 0.6.1</a> 3485*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.6.1>git commit</a>) 3486*cf5a6c84SAndroid Build Coastguard Workeris out.</p> 3487*cf5a6c84SAndroid Build Coastguard Worker 3488*cf5a6c84SAndroid Build Coastguard Worker<p>We have a new <b>ps</b> command with all the -o fields posix wants (although 3489*cf5a6c84SAndroid Build Coastguard Workerit doesn't accept BSD non-dash option syntax yet), and <b>bunzip2</b> (not just 3490*cf5a6c84SAndroid Build Coastguard Workerbzcat but the proper extract-in-place command). 3491*cf5a6c84SAndroid Build Coastguard WorkerSameer Pradhan added <b>hostid</b> and <b>fsync</b>. 3492*cf5a6c84SAndroid Build Coastguard WorkerElliott Hughes added <b>flock</b>. 3493*cf5a6c84SAndroid Build Coastguard Worker 3494*cf5a6c84SAndroid Build Coastguard Worker<p>The people waiting for <b>human readable number support</b> (du -hH, ls -h, 3495*cf5a6c84SAndroid Build Coastguard Workerand so on) can thank Elliott Hughes for implementing it. (Our output doesn't 3496*cf5a6c84SAndroid Build Coastguard Workerexactly match others' because we our "binary" mode will say 1.0G instead of 3497*cf5a6c84SAndroid Build Coastguard Worker1024M, which is a bug in the other one we didn't emulate.)</p> 3498*cf5a6c84SAndroid Build Coastguard Worker 3499*cf5a6c84SAndroid Build Coastguard Worker<p>The other big news is <b>nommu support</b>, tested on the new 3500*cf5a6c84SAndroid Build Coastguard Worker<a href=http://nommu.org/jcore>jcore</a> processor but presumaby working 3501*cf5a6c84SAndroid Build Coastguard Workeron any nommu system. A few commands don't support nommu yet, but those 3502*cf5a6c84SAndroid Build Coastguard Workerare disabled by dependencies on TOYBOX_FORK in menuconfig when building 3503*cf5a6c84SAndroid Build Coastguard Workerfor nommu. The roadmap now has a large section analyzing the uClinux 3504*cf5a6c84SAndroid Build Coastguard Workerproject (note that <a href=http://nommu.org>nommu.org</a> is slowly replacing 3505*cf5a6c84SAndroid Build Coastguard Worker<a href=http://uclinux.org>uclinux.org</a> as the standard repository of 3506*cf5a6c84SAndroid Build Coastguard Workerall knowledge and wisdom about nommu. The old site <a href=#12-02-2012>contains 3507*cf5a6c84SAndroid Build Coastguard Workermuch that is apocryphal</a>, or at least wildly inaccurate, and the new one 3508*cf5a6c84SAndroid Build Coastguard Workeris trying to improve on that).</p> 3509*cf5a6c84SAndroid Build Coastguard Worker 3510*cf5a6c84SAndroid Build Coastguard Worker<p>Both "make change" and scripts/single.sh (for building standalone commands 3511*cf5a6c84SAndroid Build Coastguard Workerwithout the multiplexer logic) now use the top level .config 3512*cf5a6c84SAndroid Build Coastguard Workerfor toybox global settings such as Linux Security Blanket Module selection, 3513*cf5a6c84SAndroid Build Coastguard Worker(so make defconfig before change now).</p> 3514*cf5a6c84SAndroid Build Coastguard Worker 3515*cf5a6c84SAndroid Build Coastguard Worker<p>Documentation updates to the <a href=code.html>code</a> and 3516*cf5a6c84SAndroid Build Coastguard Worker<a href=roadmap.html>roadmap</a> pages.</p> 3517*cf5a6c84SAndroid Build Coastguard Worker 3518*cf5a6c84SAndroid Build Coastguard Worker<h3>pending</h3> 3519*cf5a6c84SAndroid Build Coastguard Worker 3520*cf5a6c84SAndroid Build Coastguard Worker<p>In the pending directory Sameer Pradhan added tftp, 3521*cf5a6c84SAndroid Build Coastguard Workerand Elliott Hughes sent lsof. Isaac Dunham upgraded mdev, 3522*cf5a6c84SAndroid Build Coastguard Workerreboot, init, login, and modprobe, and fixed a distro-specific build break in 3523*cf5a6c84SAndroid Build Coastguard Workerscripts/mkflags.h. Elliott Hughes and Lipi Lee made netstat -p handle 3524*cf5a6c84SAndroid Build Coastguard Workercommand lines longer than 21 characters, and Elliott fixed netstat -e and 3525*cf5a6c84SAndroid Build Coastguard Workersome build warnings. Yeongdeok Suh fixed a warning in dhcpd. 3526*cf5a6c84SAndroid Build Coastguard WorkerI started cleanup on pgrep/pkill.</p> 3527*cf5a6c84SAndroid Build Coastguard Worker 3528*cf5a6c84SAndroid Build Coastguard Worker<h3>Command updates, bugfixes, and infrastructure</h3> 3529*cf5a6c84SAndroid Build Coastguard Worker 3530*cf5a6c84SAndroid Build Coastguard Worker<p>The multiplexer's "command not found" error exit is now 127, so now you can't 3531*cf5a6c84SAndroid Build Coastguard Workerdistinguish between a command not being found in the multiplexer and 3532*cf5a6c84SAndroid Build Coastguard Workerthe multiplexer itself not being found by the shell, because people wanted 3533*cf5a6c84SAndroid Build Coastguard Workerthat for some reason.</p> 3534*cf5a6c84SAndroid Build Coastguard Worker 3535*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott Hughes made date reject invalid dates rather 3536*cf5a6c84SAndroid Build Coastguard Workerthan set the clock to something weird (setting the clock 100 years into the 3537*cf5a6c84SAndroid Build Coastguard Workerfuture makes most Linux desktops surprisingly unhappy, and ntpdate won't fix it 3538*cf5a6c84SAndroid Build Coastguard Workereither), fixed several ls -l display issues (user/group field ordering, 3539*cf5a6c84SAndroid Build Coastguard Workermake user/group/lsmcontext left aligned), did the aforementioned 3540*cf5a6c84SAndroid Build Coastguard Workerextensive work on human readable number output, fixed ionice's default 3541*cf5a6c84SAndroid Build Coastguard Workerclass, fixed a mv overwrite bug, made df's columns auto-size, added 3542*cf5a6c84SAndroid Build Coastguard Worker--ppid and -Z to ps, and teamed up with Daniel K. Levy to fix 3543*cf5a6c84SAndroid Build Coastguard Workera segfault in find's handling of -newer -group or -user.</p> 3544*cf5a6c84SAndroid Build Coastguard Worker 3545*cf5a6c84SAndroid Build Coastguard Worker<p>Hyejin Kim added stat -c %T support. Colin Cross worked 3546*cf5a6c84SAndroid Build Coastguard Workeron vmstat fixing 3547*cf5a6c84SAndroid Build Coastguard Workera header printing bug and calculating the bi and bo columns in the right 3548*cf5a6c84SAndroid Build Coastguard Workerunits. Isabella Parakiss reported that sed -e "/x/c\" -e "y" added an extra 3549*cf5a6c84SAndroid Build Coastguard Workernewline and that grep -w '\(x\)\1' didn't work, both now fixed. 3550*cf5a6c84SAndroid Build Coastguard WorkerAlistair Strachan fixed several problems with switch_root. Kylie McClain 3551*cf5a6c84SAndroid Build Coastguard Workerpointed out env should be able to clear variables via NAME= syntax. 3552*cf5a6c84SAndroid Build Coastguard WorkerDima Krasner added support for running blkid without a partition (so it shows 3553*cf5a6c84SAndroid Build Coastguard Workerall partitions). Hyejin Kim sent in a bunch of static analysis bug reports.</p> 3554*cf5a6c84SAndroid Build Coastguard Worker 3555*cf5a6c84SAndroid Build Coastguard Worker<p>Isabella Parakiss reported that sed -e "/x/c\" -e "y" added an extra 3556*cf5a6c84SAndroid Build Coastguard Workernewline and that grep -w '\(x\)\1' didn't work, both now fixed. 3557*cf5a6c84SAndroid Build Coastguard WorkerAlistair Strachan fixed several problems with switch_root. Kylie McClain 3558*cf5a6c84SAndroid Build Coastguard Workerpointed out env should be able to clear variables via NAME= syntax. 3559*cf5a6c84SAndroid Build Coastguard WorkerDima Krasner added support for running blkid without a partition (so it shows 3560*cf5a6c84SAndroid Build Coastguard Workerall partitions). Hyejin Kim sent in a bunch of static analysis bug reports.</p> 3561*cf5a6c84SAndroid Build Coastguard Worker 3562*cf5a6c84SAndroid Build Coastguard Worker<p>Two large thinko fixes in oneit: -3 was always enabled (which would 3563*cf5a6c84SAndroid Build Coastguard Workereventually block if the child never read the exiting PID numbers from its file 3564*cf5a6c84SAndroid Build Coastguard Workerdescriptor #3 until the pipe filled up), and the signal handlers weren't 3565*cf5a6c84SAndroid Build Coastguard Workerset up right (for requesting semi-graceful halt/poweroff/reboot). 3566*cf5a6c84SAndroid Build Coastguard WorkerCalling install without a mode is now 0755, and install -g 0 no longer clashes 3567*cf5a6c84SAndroid Build Coastguard Workerwith cp --preserve. Better error message for ls -r on unreadable 3568*cf5a6c84SAndroid Build Coastguard Workerdirectories, and ls -Z now uses O_PATH (with the /proc/self/fd/%d 3569*cf5a6c84SAndroid Build Coastguard Workerworkaround for kernel stupidity as necessary).</p> 3570*cf5a6c84SAndroid Build Coastguard Worker 3571*cf5a6c84SAndroid Build Coastguard Worker<p>Date now understands @unixtime[.fraction] and uses -D for 3572*cf5a6c84SAndroid Build Coastguard Workerthe set-side format (matching busybox's extension for this). The seq -f 3573*cf5a6c84SAndroid Build Coastguard Workerstring now checks that it's got exactly one %f escape with the correct 3574*cf5a6c84SAndroid Build Coastguard Workerattributes (and a whole bunch of test cases for it). Fixed a bug 3575*cf5a6c84SAndroid Build Coastguard Workerin od that screwed up the position indicator on arm and mips. 3576*cf5a6c84SAndroid Build Coastguard WorkerIn stat the d/h units moved from %d %D to the default string. 3577*cf5a6c84SAndroid Build Coastguard WorkerAnd patch can now correctly apply hunks with trailing context to the start of 3578*cf5a6c84SAndroid Build Coastguard Workerthe file.</p> 3579*cf5a6c84SAndroid Build Coastguard Worker 3580*cf5a6c84SAndroid Build Coastguard Worker<p>The prompt argument moved out of yesno() (the caller can print the prompt 3581*cf5a6c84SAndroid Build Coastguard Workerthemselves). Replaced toys.exithelp with help_exit(). Added new 3582*cf5a6c84SAndroid Build Coastguard WorkerXVFORK() macro, and xpopen_both() calls /proc/self/exe when passed 3583*cf5a6c84SAndroid Build Coastguard Workera NULL argv (see cpio -p for example usage). Replaced toys.recurse 3584*cf5a6c84SAndroid Build Coastguard Workerwith toys.stacktop so the recurse or re-exec decision is now based 3585*cf5a6c84SAndroid Build Coastguard Workeron bytes of stack space used. Marked a bunch of command-local functions 3586*cf5a6c84SAndroid Build Coastguard Workerstatic.</p> 3587*cf5a6c84SAndroid Build Coastguard Worker 3588*cf5a6c84SAndroid Build Coastguard Worker<p>New additions to lib/ include strlower(), xconnect(), and the 3589*cf5a6c84SAndroid Build Coastguard Workeraforementioned help_exit(). 3590*cf5a6c84SAndroid Build Coastguard WorkerThe testsuite now has some infrastructure tests based on "example" 3591*cf5a6c84SAndroid Build Coastguard Workercommands such as toys/examples/test_human_readable.c. 3592*cf5a6c84SAndroid Build Coastguard WorkerThe login command finally got a long-overdue cleanup (it's one of the 3593*cf5a6c84SAndroid Build Coastguard Workercommands that predate the "pending" directory but were part of the reason 3594*cf5a6c84SAndroid Build Coastguard Workerfor it). Hexedit had an 3595*cf5a6c84SAndroid Build Coastguard Workeruninitialized variable (of course gcc didn't spot it, it was too busy 3596*cf5a6c84SAndroid Build Coastguard Workerwarning about "may be used uninitialized but never actually is" variables).</p> 3597*cf5a6c84SAndroid Build Coastguard Worker 3598*cf5a6c84SAndroid Build Coastguard Worker<p>Tweaked makefile so 3599*cf5a6c84SAndroid Build Coastguard Worker"make CROSS_COMPILE=prefix-" (as well as "CROSS_COMPILE=prefix- make", 3600*cf5a6c84SAndroid Build Coastguard Workerwhich still works). Toybox is now installed chmod -w so broken installers 3601*cf5a6c84SAndroid Build Coastguard Worker(like the bunzip2 package's) that try to overwrite existing binaries won't 3602*cf5a6c84SAndroid Build Coastguard Workerknock out the whole of toybox. 3603*cf5a6c84SAndroid Build Coastguard WorkerGCC 5.2.0 stopped being able to compile Linux 2.6.12's kconfig, but 3604*cf5a6c84SAndroid Build Coastguard Workerwe added a workaround. You can now build uptime without utmpx.h. 3605*cf5a6c84SAndroid Build Coastguard WorkerAlejandro Joya pointed out that enabling smack required smack on the host 3606*cf5a6c84SAndroid Build Coastguard Workeras well as target when cross compiling, which is now fixed.</p> 3607*cf5a6c84SAndroid Build Coastguard Worker 3608*cf5a6c84SAndroid Build Coastguard Worker<p>Note: toybox can autodetect nommu support when building with a uClibc 3609*cf5a6c84SAndroid Build Coastguard Workertoolchain such as <a href=http://landley.net/aboriginal/downloads/binaries/old/1.4.3/cross-compiler-sh2eb.tar.gz>the one from Aboriginal Linux</a>, 3610*cf5a6c84SAndroid Build Coastguard Workerbut <a href=http://github.com/richfelker/musl-cross-make>with musl-libc</a> 3611*cf5a6c84SAndroid Build Coastguard Workeryou'll have to enable CONFIG_TOYBOX_MUSL_NOMMU_IS_BROKEN to work around the 3612*cf5a6c84SAndroid Build Coastguard Workerfact they provide a non-functional fork() implementation that always returns 3613*cf5a6c84SAndroid Build Coastguard Worker-ENOSYS, to prevent you from compile-time probing for nommu support when 3614*cf5a6c84SAndroid Build Coastguard Workercross-compiling. Unfortunately "preventing you from probing" seems to be 3615*cf5a6c84SAndroid Build Coastguard Workeran explicit policy with musl, they also don't provide an "#ifdef __MUSL__" 3616*cf5a6c84SAndroid Build Coastguard Workerbecause their library is perfect and you're only ever allowed to work around 3617*cf5a6c84SAndroid Build Coastguard Workerother people's bugs, not theirs. So we have to use menuconfig to manually 3618*cf5a6c84SAndroid Build Coastguard Workerenable musl-specific bug workarounds.</p> 3619*cf5a6c84SAndroid Build Coastguard Worker 3620*cf5a6c84SAndroid Build Coastguard Worker<a name="23-07-2015" /><a href="#23-07-2015"><hr><h2><b>July 23, 2015</b></h2></a> 3621*cf5a6c84SAndroid Build Coastguard Worker<p>I recreated the <a href=downloads/toybox-0.6.0.tar.gz>0.6.0 source tarball</a> 3622*cf5a6c84SAndroid Build Coastguard Worker(new sha1sum 08fb1c23f520c25a15f262a8a95ea5b676a98d54) 3623*cf5a6c84SAndroid Build Coastguard Workerbecause I forgot to add --prefix to the git archive command when I updated 3624*cf5a6c84SAndroid Build Coastguard Workermy release script from mercurial, so the files weren't in an enclosing 3625*cf5a6c84SAndroid Build Coastguard Workerdirectory. (Ooops.)</p> 3626*cf5a6c84SAndroid Build Coastguard Worker 3627*cf5a6c84SAndroid Build Coastguard Worker<a name="19-07-2015" /><a href="#19-07-2015"><hr><h2><b>July 19, 2015</b></h2></a> 3628*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p> 3629*cf5a6c84SAndroid Build Coastguard WorkerThe reason why it was published in the form of a micro sub meson electronic 3630*cf5a6c84SAndroid Build Coastguard Workercomponent is that if it were printed in normal book form, an interstellar 3631*cf5a6c84SAndroid Build Coastguard Workerhitchhiker would require several inconveniently large buildings to carry it 3632*cf5a6c84SAndroid Build Coastguard Workeraround in.</p><p>- The Hitchhiker's Guide to the Galaxy</p></blockquote> 3633*cf5a6c84SAndroid Build Coastguard Worker 3634*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.6.0.tar.gz>Toybox 0.6.0</a> 3635*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://github.com/landley/toybox/releases/tag/0.6.0>git commit</a>) 3636*cf5a6c84SAndroid Build Coastguard Workeris out. (Yes, git. See the <a href=#05-04-2015>previous news entry</a>.)</p> 3637*cf5a6c84SAndroid Build Coastguard Worker 3638*cf5a6c84SAndroid Build Coastguard Worker<p>Sorry for the unusually long gap between releases. Since last release Ye 3639*cf5a6c84SAndroid Build Coastguard WorkerOlde Project Maintainer traveled to japan twice and had two more "once 3640*cf5a6c84SAndroid Build Coastguard Workera century" floods at home. (Probably a coincidence.) Still catching up.</p> 3641*cf5a6c84SAndroid Build Coastguard Worker 3642*cf5a6c84SAndroid Build Coastguard Worker<h3><b>CELF/ELC talk and Wikipedia[citation needed] article</b></h3> 3643*cf5a6c84SAndroid Build Coastguard Worker 3644*cf5a6c84SAndroid Build Coastguard Worker<p>I gave another State Of The Toybox talk 3645*cf5a6c84SAndroid Build Coastguard Worker(<a href=https://www.youtube.com/watch?v=04XwAbtPmAg>video</a> 3646*cf5a6c84SAndroid Build Coastguard Worker<a href=http://landley.net/talks/celf-2015.txt>outline</a>), in which I 3647*cf5a6c84SAndroid Build Coastguard Workerrepeat my <a href=http://landley.net/notes-2013.html#07-11-2013>perennial</a> 3648*cf5a6c84SAndroid Build Coastguard Worker<a href=https://twitter.com/landley/status/557309224535851009>complaint</a> 3649*cf5a6c84SAndroid Build Coastguard Workerthat Wikipedia[citation needed] 3650*cf5a6c84SAndroid Build Coastguard Worker<a href=http://en.wikipedia.org/wiki/Toybox>still</a> 3651*cf5a6c84SAndroid Build Coastguard Worker<a href=https://en.wikipedia.org/wiki/BusyBox#Controversy_over_Toybox>says</a> 3652*cf5a6c84SAndroid Build Coastguard Workertoybox was relicensed before its hiatus, when relicensing was why 3653*cf5a6c84SAndroid Build Coastguard Workerthe hiatus ended.</p> 3654*cf5a6c84SAndroid Build Coastguard Worker 3655*cf5a6c84SAndroid Build Coastguard Worker<p>Since Wikipedia[citation needed] seems unable to do the 3656*cf5a6c84SAndroid Build Coastguard Worker<a href=#15-11-2011>most</a> 3657*cf5a6c84SAndroid Build Coastguard Worker<a href=http://landley.net/hg/toybox/log/tip/LICENSE>basic</a> 3658*cf5a6c84SAndroid Build Coastguard Worker<a href=http://landley.net/notes-2011.html#13-11-2011>research</a> on 3659*cf5a6c84SAndroid Build Coastguard Workerthis point, and has stuck to an incorrect sequence of events for years, 3660*cf5a6c84SAndroid Build Coastguard WorkerI've been gradually escalating my attempts to correct them. Toybox 3661*cf5a6c84SAndroid Build Coastguard Workercame out of mothballs in November 2011 <b>because</b> it could be 3662*cf5a6c84SAndroid Build Coastguard Workerrelicensed. That's what opened up a new niche busybox wasn't already 3663*cf5a6c84SAndroid Build Coastguard Workerfilling with a 10 year headstart.</p> 3664*cf5a6c84SAndroid Build Coastguard Worker 3665*cf5a6c84SAndroid Build Coastguard Worker<a name="asterisk_back" /> 3666*cf5a6c84SAndroid Build Coastguard Worker<p>The article has plenty of smaller issues<a href=#asterisk>*</a>, but 3667*cf5a6c84SAndroid Build Coastguard Workergiven that I gave an entire talk at Ohio LinuxFest in 2013 3668*cf5a6c84SAndroid Build Coastguard Worker(<a href=http://landley.net/talks/ohio-2013.txt>outline</a>, 3669*cf5a6c84SAndroid Build Coastguard Worker<a href=https://archive.org/download/OhioLinuxfest2013/24-Rob_Landley-The_Rise_and_Fall_of_Copyleft.mp3>audio</a>) on why I switched away from GPL for 3670*cf5a6c84SAndroid Build Coastguard Workermy projects, that one bugs me.</p> 3671*cf5a6c84SAndroid Build Coastguard Worker 3672*cf5a6c84SAndroid Build Coastguard Worker<h3><b>New stuff this release</b></h3> 3673*cf5a6c84SAndroid Build Coastguard Worker 3674*cf5a6c84SAndroid Build Coastguard Worker<p>There's a new android menu in menuconfig, and rather a lot of Linux 3675*cf5a6c84SAndroid Build Coastguard WorkerSecurity Module support (Smack for Tizen from Xavier Roche and José Bollo, 3676*cf5a6c84SAndroid Build Coastguard Workerand SELinux for Android from Elliott Hughes; see 3677*cf5a6c84SAndroid Build Coastguard Workerthe Security Blanket menu under global settings in menuconfig) has 3678*cf5a6c84SAndroid Build Coastguard Workertrickled in, although there's still more to come.</p> 3679*cf5a6c84SAndroid Build Coastguard Worker 3680*cf5a6c84SAndroid Build Coastguard Worker<p><b>New commands:</b> Added reset, nproc, ionice, and iorenice. 3681*cf5a6c84SAndroid Build Coastguard WorkerElliott Hughes contributed xxd, runcon, 3682*cf5a6c84SAndroid Build Coastguard Workerrestorecon, load_policy, getenforce, setenforce, getprop, and setprop. 3683*cf5a6c84SAndroid Build Coastguard WorkerPromoted shred, nsenter, and hwclock.</p> 3684*cf5a6c84SAndroid Build Coastguard Worker 3685*cf5a6c84SAndroid Build Coastguard Worker<p>You can once again build catv now the flag infrastructure's been updated to 3686*cf5a6c84SAndroid Build Coastguard Workerlet it coexist with cat -v. 3687*cf5a6c84SAndroid Build Coastguard WorkerAnd on a long plane flight I wrote 3688*cf5a6c84SAndroid Build Coastguard Workerhexedit, an interactive hex editor that implements the start of 3689*cf5a6c84SAndroid Build Coastguard Workercursor control infrastructure (for eventual use by less and vi and shell 3690*cf5a6c84SAndroid Build Coastguard Workercommand history and so on).</p> 3691*cf5a6c84SAndroid Build Coastguard Worker 3692*cf5a6c84SAndroid Build Coastguard Worker<p><b>New options:</b> Added sed -E as a BSD-compatible synonym for -r. 3693*cf5a6c84SAndroid Build Coastguard WorkerUpgraded oneit with -r (restart), -3 (send exiting PID values to child), 3694*cf5a6c84SAndroid Build Coastguard Workerand signal handling. Added -v option to timeout, -m to mknod, -u to shred, 3695*cf5a6c84SAndroid Build Coastguard Worker-t to dmesg, and -123 to head and tail. Added implicit "." to grep -r without 3696*cf5a6c84SAndroid Build Coastguard Workerany files to work on. Hyejin Kim requested prefix support for truncate -s. 3697*cf5a6c84SAndroid Build Coastguard WorkerGreg Hackman added -inum to find. 3698*cf5a6c84SAndroid Build Coastguard WorkerJan Cybulski added the smack side of ls -Z support. Various patches also 3699*cf5a6c84SAndroid Build Coastguard Workeradded -Z to mkdir, mknod, and mkfifo. 3700*cf5a6c84SAndroid Build Coastguard WorkerBasic cp --preserve support went in, but not yet the xattr/LSM parts.</p> 3701*cf5a6c84SAndroid Build Coastguard Worker 3702*cf5a6c84SAndroid Build Coastguard Worker<p>The toybox command now has a --version option, 3703*cf5a6c84SAndroid Build Coastguard Workerwhich uses "git describe" if available.</p> 3704*cf5a6c84SAndroid Build Coastguard Worker 3705*cf5a6c84SAndroid Build Coastguard Worker<p><b>Build infrastructure:</b> 3706*cf5a6c84SAndroid Build Coastguard WorkerThe "make change" target now saves the output of each failed standalone 3707*cf5a6c84SAndroid Build Coastguard Workercommand build in a .bad file, and "make defconfig" is quieter now.</p> 3708*cf5a6c84SAndroid Build Coastguard Worker 3709*cf5a6c84SAndroid Build Coastguard Worker<p>Paul Barker submitted a large patch changing command install paths so 3710*cf5a6c84SAndroid Build Coastguard Worker"toybox can be installed alongside busybox without confusing 3711*cf5a6c84SAndroid Build Coastguard Workerupdate-alternatives". (There's some argument over 3712*cf5a6c84SAndroid Build Coastguard Workerwhat the right paths should be, and I'm waiting for 3713*cf5a6c84SAndroid Build Coastguard Workerpeople to tell me what else needs fixing because I have no idea. I've 3714*cf5a6c84SAndroid Build Coastguard Workerbeen symlinking /bin to /usr/bin since 2002 3715*cf5a6c84SAndroid Build Coastguard Worker<a href=http://landley.net/writing/hackermonthly-issue022-pg33.pdf>for 3716*cf5a6c84SAndroid Build Coastguard Workerhistorical reasons</a>.)</p> 3717*cf5a6c84SAndroid Build Coastguard Worker 3718*cf5a6c84SAndroid Build Coastguard Worker<p><b>Docs:</b> The repository link now goes to github, with another link 3719*cf5a6c84SAndroid Build Coastguard Workerto the commit rss feed.</p> 3720*cf5a6c84SAndroid Build Coastguard Worker 3721*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott Hughes updated the Android section of the roadmap 3722*cf5a6c84SAndroid Build Coastguard Worker(and he would know). Redid bits of scripts/mkstatus.py to make updating 3723*cf5a6c84SAndroid Build Coastguard Workerstatus.html easier, and the README is larger.</p> 3724*cf5a6c84SAndroid Build Coastguard Worker 3725*cf5a6c84SAndroid Build Coastguard Worker<p>More description of option parsing in code.html, which now describes the 3726*cf5a6c84SAndroid Build Coastguard WorkerFLAG_x macros, switching flag macro sets with FOR_newcommand, how 3727*cf5a6c84SAndroid Build Coastguard Workerconfiguration zeroes flag macros and using FORCE_FLAGS to suppress the 3728*cf5a6c84SAndroid Build Coastguard Workerzeroing of options shared between commands. Also added description of ";" 3729*cf5a6c84SAndroid Build Coastguard Workerto make --longopts take an optional =value part, and more about TOYBOX_DEBUG 3730*cf5a6c84SAndroid Build Coastguard Workerto check NEWTOY() option strings (otherwise a bad option string makes 3731*cf5a6c84SAndroid Build Coastguard Workerlib/args.c obviously segfault, but doesn't explain why).</p> 3732*cf5a6c84SAndroid Build Coastguard Worker 3733*cf5a6c84SAndroid Build Coastguard Worker<p>Added a "Why 0BSD?" section to license.html when submitting zero clause bsd 3734*cf5a6c84SAndroid Build Coastguard Workerto SPDX (according to the pending license spreadsheet, it's been approved for 3735*cf5a6c84SAndroid Build Coastguard WorkerSPDX 2.2).</p> 3736*cf5a6c84SAndroid Build Coastguard Worker 3737*cf5a6c84SAndroid Build Coastguard Worker<p>The old list of commands needing cleanup but not in pending was 3738*cf5a6c84SAndroid Build Coastguard Workerremoved from toys/pending/README and instead the issues were added 3739*cf5a6c84SAndroid Build Coastguard Workeras TODO comments in the individual commands.</p> 3740*cf5a6c84SAndroid Build Coastguard Worker 3741*cf5a6c84SAndroid Build Coastguard Worker<p><b>Bugfixes:</b> 3742*cf5a6c84SAndroid Build Coastguard WorkerFixed mount -a segfaulting without -O (reported by Janus Troelsen), 3743*cf5a6c84SAndroid Build Coastguard Workerand made it try a "become rw" ioctl() on the block device before falling 3744*cf5a6c84SAndroid Build Coastguard Workerback to mounting read only (because Android expects that). 3745*cf5a6c84SAndroid Build Coastguard WorkerFixed printf -- and printf ---. Lots of tweaks to ls -l spacing with 3746*cf5a6c84SAndroid Build Coastguard Workerdifferent options. Make touch -d and -t actually set time when you don't 3747*cf5a6c84SAndroid Build Coastguard Workerspecify nanoseconds. 3748*cf5a6c84SAndroid Build Coastguard WorkerFixed a subtle bug where recursive calls (toybox commands that run other 3749*cf5a6c84SAndroid Build Coastguard Workertoybox commands) weren't resetting all their state. (This manifested as 3750*cf5a6c84SAndroid Build Coastguard Workera "no }" error from "find | xargs sed", but could cause other problems.) 3751*cf5a6c84SAndroid Build Coastguard WorkerAnd David Halls reported another sed bug trying to compile libiconv (which 3752*cf5a6c84SAndroid Build Coastguard Workerleft extra \ at the start of lines in a generated shell script, breaking 3753*cf5a6c84SAndroid Build Coastguard Workerthe build). Output an error message for "cat /mnt".</p> 3754*cf5a6c84SAndroid Build Coastguard Worker 3755*cf5a6c84SAndroid Build Coastguard Worker<p>Kylie McClain reported that mktemp broke when $TMPDIR was set to an empty 3756*cf5a6c84SAndroid Build Coastguard Workerstring (which is not the same as unset), that install/find didn't support 3757*cf5a6c84SAndroid Build Coastguard Workernumeric uid/gids, and that sort -z affects both input and output. 3758*cf5a6c84SAndroid Build Coastguard WorkerIsabella Parakiss fixed a printf.c bug. 3759*cf5a6c84SAndroid Build Coastguard WorkerDavid Halls fixed bugs in install -D and find -exec. Samuel Holland 3760*cf5a6c84SAndroid Build Coastguard Workerfixed unshare -r. Hyejin Kim fixed makedevs with a count of 1, fold -w 3761*cf5a6c84SAndroid Build Coastguard Workerrange checking, an error path in scripts/mkflags.c, added -i to dhcpd, 3762*cf5a6c84SAndroid Build Coastguard Workerand stopped su from prompting the root user for the new user's password. 3763*cf5a6c84SAndroid Build Coastguard WorkerJan Cybulski spotted wrong indentation when combining ls -s and -i with -C and 3764*cf5a6c84SAndroid Build Coastguard Worker-x. José Bollo fixed stat %G. Sameer Pradhan fixed a bug in mkfifo -Z.</p> 3765*cf5a6c84SAndroid Build Coastguard Worker 3766*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott Hughes asked for a default SIGPIPE handler to disable 3767*cf5a6c84SAndroid Build Coastguard Workerthe signal handler bionic's dynamic loader installs (yes really). Still not 3768*cf5a6c84SAndroid Build Coastguard Worker100% sure what the correct behavior is there. (Posix is 3769*cf5a6c84SAndroid Build Coastguard Worker(<a href=http://permalink.gmane.org/gmane.comp.standards.posix.austin.general/10915>actively unhelpful</a>, but at least they're taking 3770*cf5a6c84SAndroid Build Coastguard Worker<a href=http://austingroupbugs.net/view.php?id=789#c1976>years to 3771*cf5a6c84SAndroid Build Coastguard Workermake up their mind</a>. Elliott also sent patches to fix a typo in 3772*cf5a6c84SAndroid Build Coastguard Workeruseradd.test, add missing arguments to error_exit() calls and clean up 3773*cf5a6c84SAndroid Build Coastguard Workerprintf() format strings, fix an off by one error in human_readable(), 3774*cf5a6c84SAndroid Build Coastguard Workerfix dmesg -c error reporting, fix a segfault in comma_scan where the option 3775*cf5a6c84SAndroid Build Coastguard Workerwas the last item in optlist (triggered by mount -o ro,remount), fix 3776*cf5a6c84SAndroid Build Coastguard Workerhwclock -w, made ifconfig print lowercase MAC addresses (it was bothering 3777*cf5a6c84SAndroid Build Coastguard Workerhim), and make terminal_size() read the right environment variable 3778*cf5a6c84SAndroid Build Coastguard Worker(LINES, not ROWS). And he suggested the test suite notice high command exit 3779*cf5a6c84SAndroid Build Coastguard Workervalues (corresponding to segfault or other signals).</p> 3780*cf5a6c84SAndroid Build Coastguard Worker 3781*cf5a6c84SAndroid Build Coastguard Worker<p>People are apparently using toys/pending commands, despite the police tape 3782*cf5a6c84SAndroid Build Coastguard Workerand flashing lights, so added louder warnings to toys/pending/README. 3783*cf5a6c84SAndroid Build Coastguard WorkerElliott Hughes fixed various problems with tar, dd, more, and top. 3784*cf5a6c84SAndroid Build Coastguard WorkerHyejin Kim cleaned up syslogd and dumpleases. Isaac Dunham added hotplug 3785*cf5a6c84SAndroid Build Coastguard Workersupport to mdev. Yeongdeok Suh added RFC-3315 ipv6 support to dhcpd.</p> 3786*cf5a6c84SAndroid Build Coastguard Worker 3787*cf5a6c84SAndroid Build Coastguard Worker<p>I rewrote ps.c from scratch (in pending), but it's not ready for real use 3788*cf5a6c84SAndroid Build Coastguard Workeryet.</p> 3789*cf5a6c84SAndroid Build Coastguard Worker 3790*cf5a6c84SAndroid Build Coastguard Worker<p><b>Portability:</b> 3791*cf5a6c84SAndroid Build Coastguard WorkerOn the portability front Bernhard Rosenkranzer fixed a problem where the 3792*cf5a6c84SAndroid Build Coastguard Workermenuconfig code wouldn't compile in C99 mode. (This led to me documenting 3793*cf5a6c84SAndroid Build Coastguard Workerthe craptacular nature of kconfig in a README, and the plan to replace it 3794*cf5a6c84SAndroid Build Coastguard Workersometime before 1.0.) Some extra flags to shut up overzealous llvm warnings 3795*cf5a6c84SAndroid Build Coastguard Workerwere added (and have to be probed for because gcc complains about 3796*cf5a6c84SAndroid Build Coastguard Workerarguments it doesn't recognize even when they switch stuff _off_ using 3797*cf5a6c84SAndroid Build Coastguard Workera standard syntax). Don't depend on malloc(0) to return non-null in ls. 3798*cf5a6c84SAndroid Build Coastguard WorkerDavid Halls fixed some mac/ios portability issues, 3799*cf5a6c84SAndroid Build Coastguard Workerimplying somebody's built at least part of toybox on a mac.</p> 3800*cf5a6c84SAndroid Build Coastguard Worker 3801*cf5a6c84SAndroid Build Coastguard Worker<p>Added basename_r() to lib/lib.c because the posix semantics for basename() 3802*cf5a6c84SAndroid Build Coastguard Workerare stupid but what the gnu guys did to it was appalling. 3803*cf5a6c84SAndroid Build Coastguard WorkerTurns out bionic already had a basename_r(), but posix still doesn't. 3804*cf5a6c84SAndroid Build Coastguard WorkerFixed it up in portability.h, but this 3805*cf5a6c84SAndroid Build Coastguard Workercould break more stuff in future. (Correct fix is to lobby posix to add it, 3806*cf5a6c84SAndroid Build Coastguard Workerwhich would probably take about 15 years...)</p> 3807*cf5a6c84SAndroid Build Coastguard Worker 3808*cf5a6c84SAndroid Build Coastguard Worker<p><b>Infrastructure:</b> 3809*cf5a6c84SAndroid Build Coastguard WorkerThe build now checks $LDFLAGS for linker-only flags, and allows the strip 3810*cf5a6c84SAndroid Build Coastguard Workercommand to fail (binflt toolchains provide a strip that doesn't work). 3811*cf5a6c84SAndroid Build Coastguard WorkerSince time.c uses floating point, added TOYBOX_FLOAT dependency in config.</p> 3812*cf5a6c84SAndroid Build Coastguard Worker 3813*cf5a6c84SAndroid Build Coastguard Worker<p>There's a lib/lsm.h defining varous inline functions for linux 3814*cf5a6c84SAndroid Build Coastguard Workersecurity modules stuff, if (lsm_enabled()) should turn into a compile-time 3815*cf5a6c84SAndroid Build Coastguard Workerconstant 0 and let code drop out when TOYBOX_LSM_NONE selected, but 3816*cf5a6c84SAndroid Build Coastguard Workertesting against CFG_TOYBOX_LSM_NONE or derived symbols is still useful 3817*cf5a6c84SAndroid Build Coastguard Workerbecuase when it _is_ enabled the probe turns into a system call you 3818*cf5a6c84SAndroid Build Coastguard Workerdon't want to repeat too much.</p> 3819*cf5a6c84SAndroid Build Coastguard Worker 3820*cf5a6c84SAndroid Build Coastguard Worker<p>Switched a bunch of commands from signal() to xsignal(). Factored out 3821*cf5a6c84SAndroid Build Coastguard Workerxgetgrnamid() and xgetpwnamid() into xwrap.c. Make time.c depend on 3822*cf5a6c84SAndroid Build Coastguard WorkerTOYBOX_FLOAT (since it always uses float so shouldn't be available on 3823*cf5a6c84SAndroid Build Coastguard Workerbuild targets without even software float). Added readfileat() to lib/lib.c.</p> 3824*cf5a6c84SAndroid Build Coastguard Worker 3825*cf5a6c84SAndroid Build Coastguard Worker<p>The dirtree infrastructure now passes in full flags for the old symlink 3826*cf5a6c84SAndroid Build Coastguard Workerfield, and the new DIRTREE_SHUTUP flag disables warnings if a file vanishes 3827*cf5a6c84SAndroid Build Coastguard Workerout from under you during traverse. New dirtree_start() wrapper to 3828*cf5a6c84SAndroid Build Coastguard Workercreate dirtree root with only two arguments.</p> 3829*cf5a6c84SAndroid Build Coastguard Worker 3830*cf5a6c84SAndroid Build Coastguard Worker<p>The not-curses infrastructure introduced by hexedit mostly moved to 3831*cf5a6c84SAndroid Build Coastguard Workerlib/interestingtimes.c.</p> 3832*cf5a6c84SAndroid Build Coastguard Worker 3833*cf5a6c84SAndroid Build Coastguard Worker<a name="asterisk" /> 3834*cf5a6c84SAndroid Build Coastguard Worker<a href="#asterisk_back" />Asterisk:</a> such when 3835*cf5a6c84SAndroid Build Coastguard WorkerTim contacted me (my blog says a couple days before nov 13, 2011, I.E. 3836*cf5a6c84SAndroid Build Coastguard Worker11/11/11 not some specific day 2 months later) to ask if I wanted to work 3837*cf5a6c84SAndroid Build Coastguard Workeron a new project he was proposing called 3838*cf5a6c84SAndroid Build Coastguard Worker<a href=http://www.elinux.org/Busybox_replacement_project>BentoBox</a> 3839*cf5a6c84SAndroid Build Coastguard Worker(because I used to do busybox, he'd forgotten toybox existed 3840*cf5a6c84SAndroid Build Coastguard Workeruntil I brought it up). And don't ask me what "focuses not on compatibility 3841*cf5a6c84SAndroid Build Coastguard Workerwith its GNU counterparts" means when CP_MORE adds 7 non-posix options 3842*cf5a6c84SAndroid Build Coastguard Workerand toys/other has 84 commands in neither posix nor LSB. I think they're 3843*cf5a6c84SAndroid Build Coastguard Workerstruggling to explain the difference having dismissed "licensing" as being 3844*cf5a6c84SAndroid Build Coastguard Workerthe reason it started up again after a long hiatus? The reason I don't think 3845*cf5a6c84SAndroid Build Coastguard WorkerGNU is special is there are a half-dozen other independent 3846*cf5a6c84SAndroid Build Coastguard Workerimplementations of the same unix command tools out there (AT&T, 3847*cf5a6c84SAndroid Build Coastguard WorkerBSD, Coherent, Minix, plan 9, busybox, toybox, and several more analyzed in 3848*cf5a6c84SAndroid Build Coastguard Workerthe <a href=roadmap.html>roadmap</a>, and that's ignoring the implementations 3849*cf5a6c84SAndroid Build Coastguard Workerwritten for DOS or in assembly over the years). But I do care what 3850*cf5a6c84SAndroid Build Coastguard WorkerLinux From Scratch expects, and if it's 3851*cf5a6c84SAndroid Build Coastguard Worker<a href=http://archive.linuxfromscratch.org/lfs-museum/7.6/LFS-BOOK-7.6-NOCHUNKS.html#ch-tools-gcc-pass1>calling mv -v</a> 3852*cf5a6c84SAndroid Build Coastguard Workerthen I impelement mv -v 3853*cf5a6c84SAndroid Build Coastguard Workereven if <a href=http://landley.net/toybox/roadmap.html>posix hasn't got 3854*cf5a6c84SAndroid Build Coastguard Workerit</a>. And I don't know why "gnu counterparts" would describe this when 3855*cf5a6c84SAndroid Build Coastguard Workerutil-linux isn't a gnu package, nor are info-zip, e2fsprogs, kmod, less, 3856*cf5a6c84SAndroid Build Coastguard Workerprocps, shadow, sysklogd, vim, zlib, sudo, dhcpcd...</p> 3857*cf5a6c84SAndroid Build Coastguard Worker 3858*cf5a6c84SAndroid Build Coastguard Worker<a name="05-04-2015" /><a href="#05-04-2015"><hr><h2><b>April 5, 2015</b></h2></a> 3859*cf5a6c84SAndroid Build Coastguard Worker<p>Since <a href=https://android.googlesource.com/platform/external/toybox/>android</a> and 3860*cf5a6c84SAndroid Build Coastguard Worker<a href=https://git.tizen.org/cgit/platform/upstream/toybox.git>tizen</a> 3861*cf5a6c84SAndroid Build Coastguard Workerand <a href=https://github.com/kraj/meta-musl/tree/master/recipes-core/toybox>openembedded</a> 3862*cf5a6c84SAndroid Build Coastguard Workerand <a href=https://packages.gentoo.org/package/sys-apps/toybox>gentoo</a> 3863*cf5a6c84SAndroid Build Coastguard Workerand so on have all been using Georgi Chorbadzhiyski's git mirror rather 3864*cf5a6c84SAndroid Build Coastguard Workerthan the mercurial repository, I bit the bullet and switched the project's repo 3865*cf5a6c84SAndroid Build Coastguard Worker<a href=https://github.com/landley/toybox>to git</a>. Georgi's 3866*cf5a6c84SAndroid Build Coastguard Worker<a href=https://github.com/gfto/toybox>mirror</a> is now pulling from that.</p> 3867*cf5a6c84SAndroid Build Coastguard Worker 3868*cf5a6c84SAndroid Build Coastguard Worker<a name="25-02-2015" /><a href="#25-02-2015"><hr><h2><b>February 25, 2015</b></h2></a> 3869*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>"A common mistake that people make when trying to design 3870*cf5a6c84SAndroid Build Coastguard Workersomething completely foolproof is to underestimate the ingenuity of 3871*cf5a6c84SAndroid Build Coastguard Workercomplete fools."</p><p>- The Hitchhiker's Guide to the Galaxy</p></blockquote> 3872*cf5a6c84SAndroid Build Coastguard Worker 3873*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.5.2.tar.gz>Toybox 0.5.2</a> 3874*cf5a6c84SAndroid Build Coastguard Worker(<a href=/hg/toybox/shortlog/1702>commit 1702</a>) is out.</p> 3875*cf5a6c84SAndroid Build Coastguard Worker 3876*cf5a6c84SAndroid Build Coastguard Worker<p>New promoted commands: sed (finally fixed enough it builds Linux From 3877*cf5a6c84SAndroid Build Coastguard WorkerScratch), printf (cleaned up and promoted), shred and 3878*cf5a6c84SAndroid Build Coastguard Workerbase64 (the Tizen guys wanted them), getenforce, setenforce, and chcon (android), 3879*cf5a6c84SAndroid Build Coastguard Workermix (promoted with fixes from Isaac Dunham), nsenter (from 3880*cf5a6c84SAndroid Build Coastguard WorkerAndy Lutomirski, merged into unshare).</p> 3881*cf5a6c84SAndroid Build Coastguard Worker 3882*cf5a6c84SAndroid Build Coastguard Worker<p>Elliott Hughes submited a bunch of patches to support Android (to 3883*cf5a6c84SAndroid Build Coastguard Workerboth toybox and Bionic libc, which he maintains). On toybox's end this 3884*cf5a6c84SAndroid Build Coastguard Workerinvolved a lot of fixups to portability.[ch] and fixes to over a dozen 3885*cf5a6c84SAndroid Build Coastguard Workercommands, plus several new ones. Other portability fixes included working 3886*cf5a6c84SAndroid Build Coastguard Workerwith buildroot's uclibc fork and building for nommu targets.</p> 3887*cf5a6c84SAndroid Build Coastguard Worker 3888*cf5a6c84SAndroid Build Coastguard Worker<p>The new "make change" target builds each toybox command as a standalone 3889*cf5a6c84SAndroid Build Coastguard Workerbinary. Rather a lot of commands that didn't build by themselves (mv depending 3890*cf5a6c84SAndroid Build Coastguard Workeron cp and so on) were hit with a large rock until they built standalone. 3891*cf5a6c84SAndroid Build Coastguard WorkerThis involved rewriting bits of option parsing, more elaborate dependency 3892*cf5a6c84SAndroid Build Coastguard Workergeneration, making each command have its own config 3893*cf5a6c84SAndroid Build Coastguard Workersymbol and main() function (even when it's just a wrapper calling another 3894*cf5a6c84SAndroid Build Coastguard Workercommand's main()), and so on. Also, some commands can't be built standalone 3895*cf5a6c84SAndroid Build Coastguard Workerat a conceptual level: "help" describes other enabled commands and "sh" 3896*cf5a6c84SAndroid Build Coastguard Workerhas a number of bulitin commands (cd, exit, set) that require the 3897*cf5a6c84SAndroid Build Coastguard Workermultiplexer infrastructure, so "make change" filters them out.</p> 3898*cf5a6c84SAndroid Build Coastguard Worker 3899*cf5a6c84SAndroid Build Coastguard Worker<p>The mailing list's web archive is still screwed up. Dreamhost has 3900*cf5a6c84SAndroid Build Coastguard Workerbeen trying to fix it since approximately September. There are 3901*cf5a6c84SAndroid Build Coastguard Worker<a href=http://www.mail-archive.com/[email protected]/>two</a> 3902*cf5a6c84SAndroid Build Coastguard Worker<a href=http://news.gmane.org/gmane.linux.toybox>other</a> less broken 3903*cf5a6c84SAndroid Build Coastguard Workerarchives, but neither has quite the same UI as mailman.</p> 3904*cf5a6c84SAndroid Build Coastguard Worker 3905*cf5a6c84SAndroid Build Coastguard Worker<h3>Bugfixes and tweaks</h3> 3906*cf5a6c84SAndroid Build Coastguard Worker 3907*cf5a6c84SAndroid Build Coastguard Worker<p>Cynt Rynt sent in tests for ifconfig, 3908*cf5a6c84SAndroid Build Coastguard WorkerRobert Thompson taught factor to accept whitespace separated arguments, 3909*cf5a6c84SAndroid Build Coastguard WorkerHyejin Kim pointed out that some of mktemp's longopts were attached to 3910*cf5a6c84SAndroid Build Coastguard Workerthe wrong short options, 3911*cf5a6c84SAndroid Build Coastguard WorkerLuis Felipe Strano Moraes fixed a wrong free() call in bootchartd in pending. 3912*cf5a6c84SAndroid Build Coastguard WorkerPatches from Ashwini Sharma to make "df /dev/node" work, prevent du from 3913*cf5a6c84SAndroid Build Coastguard Workerlooping endlessly following symlinks, and to make expr.c 3914*cf5a6c84SAndroid Build Coastguard Worker(in pending) understand == and regex matches. (Speaking of expr, it gets 3915*cf5a6c84SAndroid Build Coastguard Workerpriority groupings wrong but the bug was actually in the posix spec's 3916*cf5a6c84SAndroid Build Coastguard WorkerHTML conversion. They fixed the posix spec upstream for us. Still need 3917*cf5a6c84SAndroid Build Coastguard Workerto fix the expr code, but it's in pending for a reason...)</p> 3918*cf5a6c84SAndroid Build Coastguard Worker 3919*cf5a6c84SAndroid Build Coastguard Worker<p>Some commands grew new option flags, such as cp --remove-destination 3920*cf5a6c84SAndroid Build Coastguard Workerand touch -h.</p> 3921*cf5a6c84SAndroid Build Coastguard Worker 3922*cf5a6c84SAndroid Build Coastguard Worker<p>The parallel build has better error reporting now. When toybox needs to 3923*cf5a6c84SAndroid Build Coastguard Workerre-exec itself to regain suid root permissions and hasn't got the suid bit, 3924*cf5a6c84SAndroid Build Coastguard Workerit now gives the right error message ("not root" instead of "no such command"). 3925*cf5a6c84SAndroid Build Coastguard Worker 3926*cf5a6c84SAndroid Build Coastguard Worker<p>Added a test to "mount" to not mount the same device/directory combination 3927*cf5a6c84SAndroid Build Coastguard Workerover itself (the OS catches this for block devices, but not for tmpfs). 3928*cf5a6c84SAndroid Build Coastguard WorkerMake blkid distinguish ext3 from ext4. Added catv back into cat (because 3929*cf5a6c84SAndroid Build Coastguard Workerthe Android guys wanted it, and they have historical usage on their side, 3930*cf5a6c84SAndroid Build Coastguard Workerso...). Handle nanoseconds in touch.</p> 3931*cf5a6c84SAndroid Build Coastguard Worker 3932*cf5a6c84SAndroid Build Coastguard Worker<p>Fixed a segfault when CP_MORE was disabled (the resulting option flag list 3933*cf5a6c84SAndroid Build Coastguard Workerno longer defined -d but still had it in option groups at the end). 3934*cf5a6c84SAndroid Build Coastguard WorkerWorkaround for glibc redefining dirname() and basename() to random non-posix 3935*cf5a6c84SAndroid Build Coastguard Workersemantics because gnu. (They could have created dirname_r() but didn't want 3936*cf5a6c84SAndroid Build Coastguard Workerto.)</p> 3937*cf5a6c84SAndroid Build Coastguard Worker 3938*cf5a6c84SAndroid Build Coastguard Worker<p>Fix an ifconfig test that was preventing assigning an ipv4 address to 3939*cf5a6c84SAndroid Build Coastguard Workerinterface aliases. Several cleanup passes on hwclock but not quite 3940*cf5a6c84SAndroid Build Coastguard Workerpromoted out of pending yet.<p> 3941*cf5a6c84SAndroid Build Coastguard Worker 3942*cf5a6c84SAndroid Build Coastguard Worker<p>Fixed a wrong error message in rm (if you had a chmod 000 directory and 3943*cf5a6c84SAndroid Build Coastguard Workerdid rm -r on it without -f, after the prompt it would complain it was a 3944*cf5a6c84SAndroid Build Coastguard Workerdirectory, which was not the problem).</p> 3945*cf5a6c84SAndroid Build Coastguard Worker 3946*cf5a6c84SAndroid Build Coastguard Worker<p>The gzip compression code now does "store only" output to stdout, for 3947*cf5a6c84SAndroid Build Coastguard Workerwhat that's worth.</p> 3948*cf5a6c84SAndroid Build Coastguard Worker 3949*cf5a6c84SAndroid Build Coastguard Worker<p>Cleanup mountpoint and expand, and remove them from toys/pending/README 3950*cf5a6c84SAndroid Build Coastguard Worker(a list of commands that predate the toys/pending directory but needed 3951*cf5a6c84SAndroid Build Coastguard Workeranother pass).</p> 3952*cf5a6c84SAndroid Build Coastguard Worker 3953*cf5a6c84SAndroid Build Coastguard Worker<h3>Library and infrastructure:</h3> 3954*cf5a6c84SAndroid Build Coastguard Worker 3955*cf5a6c84SAndroid Build Coastguard Worker<p>Reworked the option parsing infrastructure so more commands build 3956*cf5a6c84SAndroid Build Coastguard Workerstandalone (via scripts/single.sh or "make change"). The option flag bit 3957*cf5a6c84SAndroid Build Coastguard Workervalues are no longer packed, it leaves spaces where currently disabled 3958*cf5a6c84SAndroid Build Coastguard Workerflags go, and you can #define FORCE_FLAGS so disabled flags aren't zeroed. 3959*cf5a6c84SAndroid Build Coastguard WorkerThis allows multiple commands to more easily share infrastructure, even if 3960*cf5a6c84SAndroid Build Coastguard Workeryour current flag context is for a disabled command (switched off in config), 3961*cf5a6c84SAndroid Build Coastguard Workeryou can force them to stay on and as long as the flags read the same right 3962*cf5a6c84SAndroid Build Coastguard Workerto left they'll have the same values.</p> 3963*cf5a6c84SAndroid Build Coastguard Worker 3964*cf5a6c84SAndroid Build Coastguard Worker<p>We've started removing use of strncpy() because it's a hugely broken 3965*cf5a6c84SAndroid Build Coastguard Workerstandard C function: the length is the maximum length to _append_, not 3966*cf5a6c84SAndroid Build Coastguard Workerthe size of the destination buffer. It memsets the remaining space it didn't 3967*cf5a6c84SAndroid Build Coastguard Workercopy ala "memset(dest+strlen(dest), 0, len);" so 3968*cf5a6c84SAndroid Build Coastguard Workerif you think len is the size of dest you're guaranteed to stomp memory off the 3969*cf5a6c84SAndroid Build Coastguard Workerend). And if it runs out of space it won't null terminate because reasons. 3970*cf5a6c84SAndroid Build Coastguard Worker(Meanwhile sprintf("%*s", len, str) is counting wide characters in your current 3971*cf5a6c84SAndroid Build Coastguard Workerlocale, so if you set a locale other than "C" it will also go past your 3972*cf5a6c84SAndroid Build Coastguard Workerallocated buffer size. Whoever is maintining the C library standards is really 3973*cf5a6c84SAndroid Build Coastguard Workerbad at strings.) 3974*cf5a6c84SAndroid Build Coastguard WorkerInstead we have xstrncat() which will error_exit() if src+dest+1 doesn't 3975*cf5a6c84SAndroid Build Coastguard Workerfit in the buffer. (Because randomly truncating input data isn't necessarily 3976*cf5a6c84SAndroid Build Coastguard Workeran improvement.) And there's always xmprintf().</p> 3977*cf5a6c84SAndroid Build Coastguard Worker 3978*cf5a6c84SAndroid Build Coastguard Worker<p>Similarly, strtol() doesn't return an error indicator on overflow, 3979*cf5a6c84SAndroid Build Coastguard Workeryou have to clear and then check errno. So new xstrtol() that cares 3980*cf5a6c84SAndroid Build Coastguard Workerabout overflow.</p> 3981*cf5a6c84SAndroid Build Coastguard Worker 3982*cf5a6c84SAndroid Build Coastguard Worker<p>The bionic and musl guys agree faccessat(AT_SYMLINK_NOFOLLOW) is not 3983*cf5a6c84SAndroid Build Coastguard Workersupported, so stop using it.</p> 3984*cf5a6c84SAndroid Build Coastguard Worker 3985*cf5a6c84SAndroid Build Coastguard Worker<p>Fixed toy_exec() to detect when argc is in optargs, so we don't 3986*cf5a6c84SAndroid Build Coastguard Workerneed a separate xexec_optargs().</p> 3987*cf5a6c84SAndroid Build Coastguard Worker 3988*cf5a6c84SAndroid Build Coastguard Worker<a name="18-02-2015" /><a href="#18-02-2015"><hr><h2><b>February 18, 2015</b></h2></a> 3989*cf5a6c84SAndroid Build Coastguard Worker<p>Dreamhost continues to be unable to make mailing list archives work, so 3990*cf5a6c84SAndroid Build Coastguard Workerhere's <a href=http://www.mail-archive.com/[email protected]/>another 3991*cf5a6c84SAndroid Build Coastguard Workerlist archive</a> with a less awkward interface than gmane.</p> 3992*cf5a6c84SAndroid Build Coastguard Worker 3993*cf5a6c84SAndroid Build Coastguard Worker<p>(Neither gives you the convenient historical monthly views of mailman, 3994*cf5a6c84SAndroid Build Coastguard Workerbut I still have hopes dreamhost will someday figure out what they're doing 3995*cf5a6c84SAndroid Build Coastguard Workerwrong. They've only been trying since October. Last month they did a 3996*cf5a6c84SAndroid Build Coastguard Worker<a href=http://www.dreamhoststatus.com/2015/01/14/discussion-list-hardware-maintenance/>hardware upgrade to fix a software problem</a>, and the stale 3997*cf5a6c84SAndroid Build Coastguard Workerdata loads much faster now, so that's something.)</p> 3998*cf5a6c84SAndroid Build Coastguard Worker 3999*cf5a6c84SAndroid Build Coastguard Worker<p>Update (Feb 19): the archive started updating again, by discarding 4000*cf5a6c84SAndroid Build Coastguard Workerall the pending data. So there are now _two_ giant holes in Dreamhost's 4001*cf5a6c84SAndroid Build Coastguard Workerweb archive, from Dec 15-Jan 3, and then another hole from Jan 16-Feb 18. 4002*cf5a6c84SAndroid Build Coastguard WorkerThe relevant messages are in both of the other archives. Here's hoping 4003*cf5a6c84SAndroid Build Coastguard Workerthe chronic archive constipation problem won't happen a sixth time.</p> 4004*cf5a6c84SAndroid Build Coastguard Worker 4005*cf5a6c84SAndroid Build Coastguard Worker<a name="30-12-2014" /><a href="#30-12-2014"><hr><h2><b>December 30, 2014</b></h2></a> 4006*cf5a6c84SAndroid Build Coastguard Worker<p>Due to Dreamhost's <a href=http://landley.net/dreamhost.txt>ongoing</a> 4007*cf5a6c84SAndroid Build Coastguard Worker<a href=http://landley.net/dreamhost2.txt>inability</a> to make mailman 4008*cf5a6c84SAndroid Build Coastguard Workerwork reliably, I've added a link to a backup web archive at 4009*cf5a6c84SAndroid Build Coastguard Worker<a href=http://news.gmane.org/gmane.linux.toybox>gmane</a> to the nav bar 4010*cf5a6c84SAndroid Build Coastguard Workeron the left.</p> 4011*cf5a6c84SAndroid Build Coastguard Worker 4012*cf5a6c84SAndroid Build Coastguard Worker<p>You still subscribe to the list through 4013*cf5a6c84SAndroid Build Coastguard Worker<a href=http://lists.landley.net/listinfo.cgi/toybox-landley.net>the first link</a>.</p> 4014*cf5a6c84SAndroid Build Coastguard Worker 4015*cf5a6c84SAndroid Build Coastguard Worker<p>Update (January 27, 2015): they're <a href=https://twitter.com/landley/status/558428839462703104>still working on it</a>.</p> 4016*cf5a6c84SAndroid Build Coastguard Worker 4017*cf5a6c84SAndroid Build Coastguard Worker<a name="19-11-2014" /><a href="#19-11-2014"><hr><h2><b>November 19, 2014</b></h2></a> 4018*cf5a6c84SAndroid Build Coastguard Worker 4019*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>"This time it was right, it would work, and no one would have to get nailed to anything."</p><p>- The Hitchhiker's Guide to the Galaxy</p></blockquote> 4020*cf5a6c84SAndroid Build Coastguard Worker 4021*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.5.1.tar.bz2>Toybox 0.5.1</a> 4022*cf5a6c84SAndroid Build Coastguard Worker(<a href=/hg/toybox/shortlog/1566>commit 1566</a>) is out.</p> 4023*cf5a6c84SAndroid Build Coastguard Worker 4024*cf5a6c84SAndroid Build Coastguard Worker<p>It's an interim release, mostly bugfixes. There are several new commands, 4025*cf5a6c84SAndroid Build Coastguard Workerbut they're all in pending.</p> 4026*cf5a6c84SAndroid Build Coastguard Worker 4027*cf5a6c84SAndroid Build Coastguard Worker<h3>Development</h3> 4028*cf5a6c84SAndroid Build Coastguard Worker 4029*cf5a6c84SAndroid Build Coastguard Worker<p>Finally implemented sed, which is still in pending because although 4030*cf5a6c84SAndroid Build Coastguard Workerit's feature complete according to posix, and even passes the parts of 4031*cf5a6c84SAndroid Build Coastguard WorkerBusybox's sed test suite that aren't explicitly testing for gnu bugs we 4032*cf5a6c84SAndroid Build Coastguard Workerdon't want to copy, it's not yet good enough to build Linux From Scratch. 4033*cf5a6c84SAndroid Build Coastguard Worker(The ./configure stages use very long sed scripts. 20 commits worth of 4034*cf5a6c84SAndroid Build Coastguard Workerimplementation and debugging, just under 1000 lines of code, and there's 4035*cf5a6c84SAndroid Build Coastguard Workerstill more to do. We're definitely up to some of the "fiddly" commands now. 4036*cf5a6c84SAndroid Build Coastguard WorkerDid you know "echo hello | sed p - -" segfaults gnu sed in Ubuntu 12.04? 4037*cf5a6c84SAndroid Build Coastguard WorkerYeah...)</p> 4038*cf5a6c84SAndroid Build Coastguard Worker 4039*cf5a6c84SAndroid Build Coastguard Worker<p>Talked with the Tizen developers to follow up on their desire to 4040*cf5a6c84SAndroid Build Coastguard Workermake toybox a part of the base Tizen system, and got a list of commands 4041*cf5a6c84SAndroid Build Coastguard Workerto add to the roadmap. The tizen todo list is:</p> 4042*cf5a6c84SAndroid Build Coastguard Worker 4043*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p> 4044*cf5a6c84SAndroid Build Coastguard Workerwget, sha256*, gzip, gunzip, bunzip2, rsync, zdiff*, 4045*cf5a6c84SAndroid Build Coastguard Workerless, ar, arch, base64, csplit, dir, fmt, join, 4046*cf5a6c84SAndroid Build Coastguard Workernproc, shred, shuf, stdbuf, stty, test, tr, unexpand, 4047*cf5a6c84SAndroid Build Coastguard Workerusers, vdir, diff3, sdiff, dosfsck (fsck.vfat), awk, fdisk 4048*cf5a6c84SAndroid Build Coastguard Worker</p></blockquote> 4049*cf5a6c84SAndroid Build Coastguard Worker 4050*cf5a6c84SAndroid Build Coastguard Worker<p>(Most of which was already on the todo list, but it helps prioritize.)</p> 4051*cf5a6c84SAndroid Build Coastguard Worker 4052*cf5a6c84SAndroid Build Coastguard Worker<p>Fixed md5sum and sha1sum on big endian systems (reported by James McMechan). 4053*cf5a6c84SAndroid Build Coastguard WorkerAndy Lutomirski fixed unshare's help text and option parsing, 4054*cf5a6c84SAndroid Build Coastguard Workerand submitted nsenter (a tool to use setns(2)) to pending. 4055*cf5a6c84SAndroid Build Coastguard WorkerIsaac Dunham implemented acpi -ctV options, and spotted the bug that ls -d 4056*cf5a6c84SAndroid Build Coastguard Workerwas inappropraitely following command line symlinks without -H or -L (it 4057*cf5a6c84SAndroid Build Coastguard Workershould act like ls -l does), and ls -F handles symlinks wrong too. 4058*cf5a6c84SAndroid Build Coastguard WorkerLukasz Szpakowski sent in two bugfixes to tail.c. Cynt Rynt spotted an 4059*cf5a6c84SAndroid Build Coastguard Workerunnecessary assignment in lib/password.c.</p> 4060*cf5a6c84SAndroid Build Coastguard Worker 4061*cf5a6c84SAndroid Build Coastguard Worker<p>Ashwini Sharma's team was as busy as usual, submitting tr, crontab, and 4062*cf5a6c84SAndroid Build Coastguard Workeripcrm, and hwclock to pending, more features to the pending ip.c, and a 4063*cf5a6c84SAndroid Build Coastguard Workerpile of bugfixes (to chgrp, killall, ifconfig, insmod, 4064*cf5a6c84SAndroid Build Coastguard Workerlosetup, comm, cp, id, xwrap, netcat, modprobe, nohup...) mostly found by 4065*cf5a6c84SAndroid Build Coastguard Workerstatic analysis. (These fixes are mostly to seldom-used codepaths like the 4066*cf5a6c84SAndroid Build Coastguard WorkerTOYBOX_FREE config option, but test coverage is always appreciated.) Ashwini 4067*cf5a6c84SAndroid Build Coastguard Workeralso suggested upgrading ln -f to leave the original target alone if link 4068*cf5a6c84SAndroid Build Coastguard Workercreation fails, and reported that mv -f and -i weren't implemented (now fixed).</p> 4069*cf5a6c84SAndroid Build Coastguard Worker 4070*cf5a6c84SAndroid Build Coastguard Worker<p>New config option: TOYBOX_NORECURSE prevents xexec() from making internal 4071*cf5a6c84SAndroid Build Coastguard Workerfunction calls (for nommu systems with a finite stack).</p> 4072*cf5a6c84SAndroid Build Coastguard Worker 4073*cf5a6c84SAndroid Build Coastguard Worker<p>The "toybox" multiplexer command no longer adds a trailing space to each 4074*cf5a6c84SAndroid Build Coastguard Workerline of command names, so things like "./toybox | tr ' \n' '|'" to create 4075*cf5a6c84SAndroid Build Coastguard Workera grep pattern snippet are easier to do. (Why you'd want to is your business, 4076*cf5a6c84SAndroid Build Coastguard Workerbut the output is tidier now.)</p> 4077*cf5a6c84SAndroid Build Coastguard Worker 4078*cf5a6c84SAndroid Build Coastguard Worker<h3>Infrastructure</h3> 4079*cf5a6c84SAndroid Build Coastguard Worker 4080*cf5a6c84SAndroid Build Coastguard Worker<p>Isaac Dunham added Android support to portability.h, including compile 4081*cf5a6c84SAndroid Build Coastguard Workerprobes for functions missing from bionic-libc, and annotated the commands that 4082*cf5a6c84SAndroid Build Coastguard Workeruse those functions. We haven't really tested building against bionic, 4083*cf5a6c84SAndroid Build Coastguard Workerbut in theory it's possible now.</p> 4084*cf5a6c84SAndroid Build Coastguard Worker 4085*cf5a6c84SAndroid Build Coastguard Worker<p>Running the test suite now color codes the PASS/SKIP/FAIL notifications 4086*cf5a6c84SAndroid Build Coastguard Workerif output is to a tty. (And in case you missed it last time, VERBOSE=fail 4087*cf5a6c84SAndroid Build Coastguard Workerto stop at the first failure is really useful.)</p> 4088*cf5a6c84SAndroid Build Coastguard Worker 4089*cf5a6c84SAndroid Build Coastguard Worker<p>In loopfiles_rw() use O_CLOEXEC instead of O_RDONLY to request the loop 4090*cf5a6c84SAndroid Build Coastguard Workerfunction close filehandles for us. (Otherwise the callback function must 4091*cf5a6c84SAndroid Build Coastguard Workerclose each supplied filehandle itself.)</p> 4092*cf5a6c84SAndroid Build Coastguard Worker 4093*cf5a6c84SAndroid Build Coastguard Worker<p>The printf-style escape parsing ("\n" and friends) got factored out into 4094*cf5a6c84SAndroid Build Coastguard Workera new unescape() function.</p> 4095*cf5a6c84SAndroid Build Coastguard Worker 4096*cf5a6c84SAndroid Build Coastguard Worker<a name="02-10-2014" /><a href="#02-10-2014"><hr><h2><b>October 2, 2014</b></h2></a> 4097*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>"There is an art, it says, or rather, a knack to flying. 4098*cf5a6c84SAndroid Build Coastguard WorkerThe knack lies in learning how to throw yourself at the ground and miss... 4099*cf5a6c84SAndroid Build Coastguard WorkerClearly, it is this second part, the missing, which presents the 4100*cf5a6c84SAndroid Build Coastguard Workerdifficulties."</p><p>- The Hitchhiker's Guide to the Galaxy<p></blockquote> 4101*cf5a6c84SAndroid Build Coastguard Worker 4102*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.5.0.tar.bz2>Toybox 0.5.0</a> 4103*cf5a6c84SAndroid Build Coastguard Worker(<a href=/hg/toybox/shortlog/1512>commit 1512</a>) is out.</p> 4104*cf5a6c84SAndroid Build Coastguard Worker 4105*cf5a6c84SAndroid Build Coastguard Worker<h3>New commands</h3> 4106*cf5a6c84SAndroid Build Coastguard Worker 4107*cf5a6c84SAndroid Build Coastguard Worker<p>The new commands are find, install, factor, and mount. Promoted commands 4108*cf5a6c84SAndroid Build Coastguard Worker(cleaned up and moved out of "pending") are lspci, inotifyd, and blockdev.</p> 4109*cf5a6c84SAndroid Build Coastguard Worker 4110*cf5a6c84SAndroid Build Coastguard Worker<p>cp now implements -HL and -F to force delete of pending files, cpio now 4111*cf5a6c84SAndroid Build Coastguard Workerignores -m and implements -p, ls -C now has utf8 support (using wcwidth 4112*cf5a6c84SAndroid Build Coastguard Workerinstead of strlen), and umount got a number of upgrades involving 4113*cf5a6c84SAndroid Build Coastguard Workerlooking things up in /proc/mounts. Other minor cleanups happend to 4114*cf5a6c84SAndroid Build Coastguard Workercut, touch, free, and id.</p> 4115*cf5a6c84SAndroid Build Coastguard Worker 4116*cf5a6c84SAndroid Build Coastguard Worker<p>In pending: Bradley Controy submitted mix (adjusts OSS sound volume). Ashwini 4117*cf5a6c84SAndroid Build Coastguard WorkerSharma submitted diff, userdel, blockdev, ipcs, and crond, upgraded 4118*cf5a6c84SAndroid Build Coastguard Workerfdisk, fsck, and ftpget, and ran a static analyzer on a lot of other code. 4119*cf5a6c84SAndroid Build Coastguard WorkerPartial cleanup was done to useradd, userdel, groupadd, and groupdel.</p> 4120*cf5a6c84SAndroid Build Coastguard Worker 4121*cf5a6c84SAndroid Build Coastguard Worker<h3>Build infrastructure</h3> 4122*cf5a6c84SAndroid Build Coastguard Worker 4123*cf5a6c84SAndroid Build Coastguard Worker<p><b>Parallel builds</b></p> 4124*cf5a6c84SAndroid Build Coastguard Worker 4125*cf5a6c84SAndroid Build Coastguard Worker<p>The build now takes advantage of SMP, autodetecting the number of 4126*cf5a6c84SAndroid Build Coastguard Workerprocessors. (Export the environment variable CPUS to pick a specific number.) 4127*cf5a6c84SAndroid Build Coastguard WorkerOther build changes: split out $LDOPTIMIZE because old compilers complain 4128*cf5a6c84SAndroid Build Coastguard Workerabout linker options passed with -c, and the entire "generated" directory now 4129*cf5a6c84SAndroid Build Coastguard Workergets deleted by clean (the README that was in there got merged into code.html).</p> 4130*cf5a6c84SAndroid Build Coastguard Worker 4131*cf5a6c84SAndroid Build Coastguard Worker<p><b>Standalone builds</b></p> 4132*cf5a6c84SAndroid Build Coastguard Worker 4133*cf5a6c84SAndroid Build Coastguard Worker<p>The standalone build infrastructure (scripts/single.sh) got upgraded to 4134*cf5a6c84SAndroid Build Coastguard Workerbuild more commands as standalone executables. In make.sh the source file 4135*cf5a6c84SAndroid Build Coastguard Workerselection uses a regex to find the source files with the NEWTOY/OLDTOY macro 4136*cf5a6c84SAndroid Build Coastguard Workerfor the command. It enables each command's 4137*cf5a6c84SAndroid Build Coastguard Workersub-options (so CP has CP_MORE), enables I18N and FLOAT support to build 4138*cf5a6c84SAndroid Build Coastguard Workerfull-featured commands, and includes --help text (at least when 4139*cf5a6c84SAndroid Build Coastguard Workerthe command doesn't use another command's help). The OLDTOY() macro 4140*cf5a6c84SAndroid Build Coastguard Workernow produces (redundant) function prototypes so you can build an OLDTOY 4141*cf5a6c84SAndroid Build Coastguard Workerwithout the NEWTOY</p> 4142*cf5a6c84SAndroid Build Coastguard Worker 4143*cf5a6c84SAndroid Build Coastguard Worker<p>It doesn't quite have complete coverage yet, the defconfig entries that 4144*cf5a6c84SAndroid Build Coastguard Workeraren't building standalone yet are:</p> 4145*cf5a6c84SAndroid Build Coastguard Worker 4146*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>chown, egrep, fgrep, fstype, halt, mv, nc, poweroff, unix2dos, 4147*cf5a6c84SAndroid Build Coastguard Workerwhoami</p></blockquote> 4148*cf5a6c84SAndroid Build Coastguard Worker 4149*cf5a6c84SAndroid Build Coastguard Worker<p>The main reason for standalone build failures is NEWTOY() or OLDTOY() 4150*cf5a6c84SAndroid Build Coastguard Workerentries that don't have their own config symbol. Another problem is entries 4151*cf5a6c84SAndroid Build Coastguard Workerthat depend on another entry in kconfig, usually because common infrastructure 4152*cf5a6c84SAndroid Build Coastguard Workeris using one command's flags (which the other commands copy): if that command 4153*cf5a6c84SAndroid Build Coastguard Workeris disabled, the FLAG macros become 0 so dead code elimination can remove the 4154*cf5a6c84SAndroid Build Coastguard Workercode. It's <a href=http://landley.net/hg/toybox/rev/1503>possible 4155*cf5a6c84SAndroid Build Coastguard Workerto untangle</a> this, but a bit awkward. (It boils down to conflicting 4156*cf5a6c84SAndroid Build Coastguard Workerdesign goals in the two contexts.)</p> 4157*cf5a6c84SAndroid Build Coastguard Worker 4158*cf5a6c84SAndroid Build Coastguard Worker<p>Standalone builds are used by the test suite when testing individual 4159*cf5a6c84SAndroid Build Coastguard Workercommands. 4160*cf5a6c84SAndroid Build Coastguard Worker 4161*cf5a6c84SAndroid Build Coastguard Worker<p><b>Snapshot builds</b></p> 4162*cf5a6c84SAndroid Build Coastguard Worker 4163*cf5a6c84SAndroid Build Coastguard Worker<p>A new addition to the "generated" directory is generated/build.sh 4164*cf5a6c84SAndroid Build Coastguard Workercontaining a single compiler command line to build toybox in its current 4165*cf5a6c84SAndroid Build Coastguard Workerconfiguration. Combined with the generated/*.{h,sh} files from an 4166*cf5a6c84SAndroid Build Coastguard Workerexisiting build, this may let you build on a new system that hasn't quite 4167*cf5a6c84SAndroid Build Coastguard Workergot enough OS bits working to run a full configureand make.</p> 4168*cf5a6c84SAndroid Build Coastguard Worker 4169*cf5a6c84SAndroid Build Coastguard Worker<h3>Internals</h3> 4170*cf5a6c84SAndroid Build Coastguard Worker 4171*cf5a6c84SAndroid Build Coastguard Worker<p>Library code: xcreate/xopen now O_CLOEXEC by default to avoid leaking 4172*cf5a6c84SAndroid Build Coastguard Workerfilehandles to child processes. DIRTREE_COMEAGAIN's second callback is now 4173*cf5a6c84SAndroid Build Coastguard Workerdone with the directory filehandle still open (new dir->again variable added 4174*cf5a6c84SAndroid Build Coastguard Workerto distinguish first from second callback, and requesting DIRTREE_RECURSE now 4175*cf5a6c84SAndroid Build Coastguard Workerrequires passing in the specific macro value, not just a true/false). 4176*cf5a6c84SAndroid Build Coastguard WorkerUse daemon() out of libc instead of hand-rolled daemonize() in various 4177*cf5a6c84SAndroid Build Coastguard Workerpending commands. string_to_mode() now passes through type bits so you can 4178*cf5a6c84SAndroid Build Coastguard Workeruse it to more easily modify a file's existing mode. 4179*cf5a6c84SAndroid Build Coastguard WorkerSplit xpopen() into xpopen_both(), xopen(), and xrun() depending on whether 4180*cf5a6c84SAndroid Build Coastguard Workerwe want to redirect both, one, or neither of stdin/stdout.</p> 4181*cf5a6c84SAndroid Build Coastguard Worker 4182*cf5a6c84SAndroid Build Coastguard Worker<p>Bugfixes: Better error message when TOYBOX_SUID option can't drop priviliges 4183*cf5a6c84SAndroid Build Coastguard Worker(which happens when you suid something _other_ than root). 4184*cf5a6c84SAndroid Build Coastguard WorkerThe old pending version of nbd_client.c wasn't deleted when the 4185*cf5a6c84SAndroid Build Coastguard Workercommand was promoted (and the build would break if both were enabled), 4186*cf5a6c84SAndroid Build Coastguard Workertoy_exec() sometimes needs to re-exec from $PATH rather than recurse 4187*cf5a6c84SAndroid Build Coastguard Workerinternally (to gain dropped root permissions or limit stack depth), 4188*cf5a6c84SAndroid Build Coastguard Workeralways call setlocale() when I18N is enabled to switch it back _off_ when 4189*cf5a6c84SAndroid Build Coastguard Workerwe run commands that expect sscanf("%n") to return bytes, 4190*cf5a6c84SAndroid Build Coastguard Workerdirtree() had a memory leak in an error path, patch.c had some bugs in 4191*cf5a6c84SAndroid Build Coastguard Workererror paths (didn't report problem clearly). Ashwini Sharma spotted an 4192*cf5a6c84SAndroid Build Coastguard Workeroption parsing bug where [-abc] would forget _all_ command line arguments 4193*cf5a6c84SAndroid Build Coastguard Workersaved in the GLOBALS() block (not just the ones for options being switched 4194*cf5a6c84SAndroid Build Coastguard Workeroff), plus various minor fixes to nbd_client and cpio. 4195*cf5a6c84SAndroid Build Coastguard WorkerLukasz Szpakowski fixed rm -f on a broken symlink (failed), and killall 4196*cf5a6c84SAndroid Build Coastguard Workerwith no arguments (segfaulted).</p> 4197*cf5a6c84SAndroid Build Coastguard Worker 4198*cf5a6c84SAndroid Build Coastguard Worker<p><b>Portability</b></p> 4199*cf5a6c84SAndroid Build Coastguard Worker 4200*cf5a6c84SAndroid Build Coastguard Worker<p>A somewhat fiddly fix to rm -rf (which needs to chmod directories to u+rwx 4201*cf5a6c84SAndroid Build Coastguard Workerto descend into them) which hit a musl bug in faccessat() which the musl 4202*cf5a6c84SAndroid Build Coastguard Workermaintainer refuses to fix. (He literally wants the man page changed 4203*cf5a6c84SAndroid Build Coastguard Workerinstead, despite other libcs working.) Added an #ifdef __MUSL__ section 4204*cf5a6c84SAndroid Build Coastguard Workerto portability.h with a workaround, you may need CFLAGS=-D__MUSL__ in your 4205*cf5a6c84SAndroid Build Coastguard Workerbuild if your musl build's features.h doesn't #define that. (I may do 4206*cf5a6c84SAndroid Build Coastguard Workera different workaround in future, but sometimes you've just got to make 4207*cf5a6c84SAndroid Build Coastguard Workerit work so you can ship. Also, toybox grep with multiple patterns 4208*cf5a6c84SAndroid Build Coastguard Workerrequires <a href=http://landley.net/hg/aboriginal/rev/1692>a patch 4209*cf5a6c84SAndroid Build Coastguard Workerto musl's regex engine</a>, which applies to 1.1.4 but not to the current 4210*cf5a6c84SAndroid Build Coastguard Workermusl source control.)</p> 4211*cf5a6c84SAndroid Build Coastguard Worker 4212*cf5a6c84SAndroid Build Coastguard Worker<p>More portability.h fixes for uClibc too. (I don't expect that to ever have 4213*cf5a6c84SAndroid Build Coastguard Workeranother release, so locally patching around posix-2008 violations is silly).</p> 4214*cf5a6c84SAndroid Build Coastguard Worker 4215*cf5a6c84SAndroid Build Coastguard Worker<p><b>Change to username filtering</b></p> 4216*cf5a6c84SAndroid Build Coastguard Worker 4217*cf5a6c84SAndroid Build Coastguard Worker<p>Posix recommends the username creation logic filter usernames to a small 4218*cf5a6c84SAndroid Build Coastguard Workerallowed set of characters (which even Red Hat breaks by explicitly allowing 4219*cf5a6c84SAndroid Build Coastguard Worker"$" at the end), but this prevents UTF-8 usernames. Posix' stated logic 4220*cf5a6c84SAndroid Build Coastguard Workeris to allow filesystems to create the user's home directory, but Linux 4221*cf5a6c84SAndroid Build Coastguard Workerfilesystems can accept any character but NUL and "/". The only characters 4222*cf5a6c84SAndroid Build Coastguard Workerwe actually _need_ to filter out are ":" (field separator in passwd), 4223*cf5a6c84SAndroid Build Coastguard Workernewline (line separator in passwd), and "/" (directory separator in 4224*cf5a6c84SAndroid Build Coastguard Workerfilesystem).</p> 4225*cf5a6c84SAndroid Build Coastguard Worker 4226*cf5a6c84SAndroid Build Coastguard Worker<h3>Documentation</h3> 4227*cf5a6c84SAndroid Build Coastguard Worker 4228*cf5a6c84SAndroid Build Coastguard Worker<p>Web pages updated: cleanup.html documents more cleanup, code.html 4229*cf5a6c84SAndroid Build Coastguard Workerdocuments more code, and about.html now capitalizes "toybox" consistently 4230*cf5a6c84SAndroid Build Coastguard Worker(it's just a word, capitalize at start of sentence).</p> 4231*cf5a6c84SAndroid Build Coastguard Worker 4232*cf5a6c84SAndroid Build Coastguard Worker<p>The pending/README file now lists commands that needed review/cleanup 4233*cf5a6c84SAndroid Build Coastguard Workerbefore the pending directory was added.</p> 4234*cf5a6c84SAndroid Build Coastguard Worker 4235*cf5a6c84SAndroid Build Coastguard Worker<h3>Test Suite</h3> 4236*cf5a6c84SAndroid Build Coastguard Worker 4237*cf5a6c84SAndroid Build Coastguard Worker<p>Moved out of scripts/test into top level "tests" directory, and the 4238*cf5a6c84SAndroid Build Coastguard Workertesting.sh script is now in scripts rather than mixed into the *.test files.</p> 4239*cf5a6c84SAndroid Build Coastguard Worker 4240*cf5a6c84SAndroid Build Coastguard Worker<p>Johan Bergström requested VERBOSE=fail to make tests (telling it to 4241*cf5a6c84SAndroid Build Coastguard Workerstop at the first failure), and spotted a build bug where using gnu 4242*cf5a6c84SAndroid Build Coastguard Workersort on the host broke in non-C locales.</p> 4243*cf5a6c84SAndroid Build Coastguard Worker 4244*cf5a6c84SAndroid Build Coastguard Worker<p>Divya Kothari submitted tests for chmod, link, tar, bzcat, xzcat, zcat, 4245*cf5a6c84SAndroid Build Coastguard Workerand hostname. (And more, but that's all that's merged so far.)</p> 4246*cf5a6c84SAndroid Build Coastguard Worker 4247*cf5a6c84SAndroid Build Coastguard Worker<a name="07-07-2014" /><a href="#07-07-2014"><hr><h2><b>July 7, 2014</b></h2></a> 4248*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>"This planet has - or rather had - a problem, which was this: 4249*cf5a6c84SAndroid Build Coastguard Workermost of the people living on it were unhappy for pretty much of the time. Many 4250*cf5a6c84SAndroid Build Coastguard Workersolutions were suggested for this problem, but most of these were largely 4251*cf5a6c84SAndroid Build Coastguard Workerconcerned with the movement of small green pieces of paper, which was odd 4252*cf5a6c84SAndroid Build Coastguard Workerbecause on the whole it wasn't the small green pieces of paper that were 4253*cf5a6c84SAndroid Build Coastguard Workerunhappy."</p><p>- The Hitchhiker's Guide to the Galaxy</p></blockquote> 4254*cf5a6c84SAndroid Build Coastguard Worker 4255*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.4.9.tar.bz2>Toybox 0.4.9</a> (<a href=/hg/toybox/shortlog/1385>commit 1385</a>) is out.</p> 4256*cf5a6c84SAndroid Build Coastguard Worker 4257*cf5a6c84SAndroid Build Coastguard Worker<p><b>New commands</b> added to pending include: 4258*cf5a6c84SAndroid Build Coastguard Workerlsattr, chattr, inotifyd, rfkill, sulogin, strings, makedevs, 4259*cf5a6c84SAndroid Build Coastguard Workerkillall5, and tar from Ashwini Sharma, arp from Kyungwan Han, 4260*cf5a6c84SAndroid Build Coastguard Workersysctl by Bilal Qureshi, partprobe from Bertold Van den Bergh, 4261*cf5a6c84SAndroid Build Coastguard Workerhost from Rich felker, and I did nbd-client and the first 2/3 of mount.</p> 4262*cf5a6c84SAndroid Build Coastguard Worker 4263*cf5a6c84SAndroid Build Coastguard Worker<p>Finished cleanups (commands promoted out of pending): 4264*cf5a6c84SAndroid Build Coastguard Workersysctl, rfkill, strings, mkpasswd, makedevs, partprobe, killall5, 4265*cf5a6c84SAndroid Build Coastguard Workerfallocate, and nbd-client.</p> 4266*cf5a6c84SAndroid Build Coastguard Worker 4267*cf5a6c84SAndroid Build Coastguard Worker<p>(Along the way partial cleanups got made to: last, fold, lspci, ps, 4268*cf5a6c84SAndroid Build Coastguard Workerbootchartd, init, fsck, telnetd, telnet, vconfig, toysh, iconv, useradd, 4269*cf5a6c84SAndroid Build Coastguard Workerlogin, host, openvt, deallocvt, getty, tftpd, and modprobe. But there's 4270*cf5a6c84SAndroid Build Coastguard Workerstill more to do on all of those.)</p> 4271*cf5a6c84SAndroid Build Coastguard Worker 4272*cf5a6c84SAndroid Build Coastguard Worker<p>This time around the <a href=bin>static binaries</a> are linked against 4273*cf5a6c84SAndroid Build Coastguard Workermusl instead of uClibc. (That's why there's no sparc version, musl doesn't 4274*cf5a6c84SAndroid Build Coastguard Workersupport that target yet.)</p> 4275*cf5a6c84SAndroid Build Coastguard Worker 4276*cf5a6c84SAndroid Build Coastguard Worker<p><b>Documentation:</b></p> 4277*cf5a6c84SAndroid Build Coastguard Worker 4278*cf5a6c84SAndroid Build Coastguard Worker<p>The help text parser expects lower case "usage:" lines with 4279*cf5a6c84SAndroid Build Coastguard Workera blank line after them, so go through and regularize those. Expand the 4280*cf5a6c84SAndroid Build Coastguard Worker"coding style" section in the docs and move it to design.html. (Not a show 4281*cf5a6c84SAndroid Build Coastguard Workerstopper for incoming 4282*cf5a6c84SAndroid Build Coastguard Workercontributions, just an explanation of some of the things I'll do to them 4283*cf5a6c84SAndroid Build Coastguard Workerduring cleanup.) The help text for the "toybox" command now includes 4284*cf5a6c84SAndroid Build Coastguard Workerthe shell script snippet to install symlinks to the toybox binary.</p> 4285*cf5a6c84SAndroid Build Coastguard Worker 4286*cf5a6c84SAndroid Build Coastguard Worker<p>The <a href=cleanup.html>cleanup page</a> now has descriptions for the 4287*cf5a6c84SAndroid Build Coastguard Workerfull ifconfig cleanup series, among others.</p> 4288*cf5a6c84SAndroid Build Coastguard Worker 4289*cf5a6c84SAndroid Build Coastguard Worker<p>The new toys/examples directory contains hello.c and skeleton.c. The first is 4290*cf5a6c84SAndroid Build Coastguard Workera simple hello world program in toybox style, the second is a much more 4291*cf5a6c84SAndroid Build Coastguard Workerelaborate example program using showing how to use the command line option 4292*cf5a6c84SAndroid Build Coastguard Workerparsing and how to provide multiple commands in the same C file.</p> 4293*cf5a6c84SAndroid Build Coastguard Worker 4294*cf5a6c84SAndroid Build Coastguard Worker<p><b>Fixes</b>:</p> 4295*cf5a6c84SAndroid Build Coastguard Worker 4296*cf5a6c84SAndroid Build Coastguard Worker<p>Fix od bug reported by Samuel Holland ("od -v -b" was appending the default 4297*cf5a6c84SAndroid Build Coastguard Workeroutput type even though an output type was specified). Ashwini Sharma reported 4298*cf5a6c84SAndroid Build Coastguard Workerbugs where readfile() was incorrectly freeing its buffer, and where toy_init() 4299*cf5a6c84SAndroid Build Coastguard Workerwas zeroing the wrong data because the field it was using to measure (rebound) 4300*cf5a6c84SAndroid Build Coastguard Workerhad moved (when I moved it back I added a comment why the field needs to be 4301*cf5a6c84SAndroid Build Coastguard Workerthere), fixed a segfault in the dhcp client, and made a 0 length read at 4302*cf5a6c84SAndroid Build Coastguard Workerthe start of password entry count as EOF. Make the "we are not root" test 4303*cf5a6c84SAndroid Build Coastguard Workerin the init code show the help text. Posix implies that fflush() can return 4304*cf5a6c84SAndroid Build Coastguard Workersuccess even when the stream's error bit is set, so call both fflush() and 4305*cf5a6c84SAndroid Build Coastguard Workerferror() from xprintf().</p> 4306*cf5a6c84SAndroid Build Coastguard Worker 4307*cf5a6c84SAndroid Build Coastguard Worker<p>Isaac Dunham pointed out that bloatcheck couldn't deal with diff 4308*cf5a6c84SAndroid Build Coastguard Workerimplementations that only implement "unified diff" format, and that some 4309*cf5a6c84SAndroid Build Coastguard Workerdiff implementations can't handle nonseekable input (I.E. reading from 4310*cf5a6c84SAndroid Build Coastguard Workera pipe). Bugfix so "help -a" works again. Option parsing on nohup now stops 4311*cf5a6c84SAndroid Build Coastguard Workerat first nonoption argument. Fix segfault in "which" if PATH wasn't set, 4312*cf5a6c84SAndroid Build Coastguard Workerwhich was actually a bug in lib function find_in_path(). Made rm -rf of 4313*cf5a6c84SAndroid Build Coastguard Workerchmod 000 directories actually remove them.</p> 4314*cf5a6c84SAndroid Build Coastguard Worker 4315*cf5a6c84SAndroid Build Coastguard Worker<p>The build now passes the same $CFLAGS to the library probe as the final 4316*cf5a6c84SAndroid Build Coastguard Workerbuild, because arch linux is so broken it provides different sets of 4317*cf5a6c84SAndroid Build Coastguard Workerlibraries for static and dynamic linking.</p> 4318*cf5a6c84SAndroid Build Coastguard Worker 4319*cf5a6c84SAndroid Build Coastguard Worker<p>It turns out sprintf("%.123s", str) is counting characters, not bytes, 4320*cf5a6c84SAndroid Build Coastguard Workerso globally enabling locale support opens stack smashing vulnerabilities. 4321*cf5a6c84SAndroid Build Coastguard WorkerSo there's a new TOYFLAGS_LOCALE you set in toyflags when you want the 4322*cf5a6c84SAndroid Build Coastguard Workersetup code to setlocale().</p> 4323*cf5a6c84SAndroid Build Coastguard Worker 4324*cf5a6c84SAndroid Build Coastguard Worker<p><b>Upgrades:</b></p> 4325*cf5a6c84SAndroid Build Coastguard Worker 4326*cf5a6c84SAndroid Build Coastguard Worker<p>Isaac Dunham extended cpio to archive unreadable empty files, and I taught it 4327*cf5a6c84SAndroid Build Coastguard Workerto set uid/gid and timestamp when extracting archives. Isaac also 4328*cf5a6c84SAndroid Build Coastguard Workeradded tests for cpio, link, and du, added lspci -i, made the pci database 4329*cf5a6c84SAndroid Build Coastguard Workerparsing skip # comment lines, merged logname and whoami into id.</p> 4330*cf5a6c84SAndroid Build Coastguard Worker 4331*cf5a6c84SAndroid Build Coastguard Worker<p>Daniel Verkamp sped up md5sum about 30% with some loop unrolling, making 4332*cf5a6c84SAndroid Build Coastguard Workerit actually smaller in the process. I added -b flags to md5sum and sha1sum 4333*cf5a6c84SAndroid Build Coastguard Workerfor "brief" output that's just the hash with no filename. (I'm aware other 4334*cf5a6c84SAndroid Build Coastguard Workerimplementations use that for MSDOS "binary" mode, and don't care.)</p> 4335*cf5a6c84SAndroid Build Coastguard Worker 4336*cf5a6c84SAndroid Build Coastguard Worker<p>When building standalone commands (scripts/singleconfig.sh commandname), 4337*cf5a6c84SAndroid Build Coastguard Workerthe build now switches on all the sub-options of the command so we get 4338*cf5a6c84SAndroid Build Coastguard Workera standalone version with all the bells and whistles enabled.</p> 4339*cf5a6c84SAndroid Build Coastguard Worker 4340*cf5a6c84SAndroid Build Coastguard Worker<p>Add -ds flags to date and document +FORMAT escapes. Add the shell NOP 4341*cf5a6c84SAndroid Build Coastguard Workercommand ":" as an alias for true (for toysh).</p> 4342*cf5a6c84SAndroid Build Coastguard Worker 4343*cf5a6c84SAndroid Build Coastguard Worker<p>Add uClibc probe for iconv() and fallocate. (The fact it didn't always 4344*cf5a6c84SAndroid Build Coastguard Workerbuild against uClibc is why fallocate wasn't enabled in defconfig before.)</p> 4345*cf5a6c84SAndroid Build Coastguard Worker 4346*cf5a6c84SAndroid Build Coastguard Worker<p>The umount command now does an losetup -d on the device by default, so 4347*cf5a6c84SAndroid Build Coastguard Workerwe don't leak loopback devices. Bugfix to losetup so "losetup /dev/loop0 4348*cf5a6c84SAndroid Build Coastguard Workerfilename" actually works again.</p> 4349*cf5a6c84SAndroid Build Coastguard Worker 4350*cf5a6c84SAndroid Build Coastguard Worker<p>Divya Kothari sent in test suite entries for ls, ln, rm, mv, printf, dd, 4351*cf5a6c84SAndroid Build Coastguard Workerand renice. Then a second round for lsattr/chattr, mount, chmod, pgrep/pkill, 4352*cf5a6c84SAndroid Build Coastguard Workergroupadd, groupdel, and useradd. Several of these uncovered bugs, still 4353*cf5a6c84SAndroid Build Coastguard Workerworking to fix them.</p> 4354*cf5a6c84SAndroid Build Coastguard Worker 4355*cf5a6c84SAndroid Build Coastguard Worker<p>There are now free() functions for the predefined llist types and a 4356*cf5a6c84SAndroid Build Coastguard Workerdlist_terminate() function to break doubly linked lists. The new 4357*cf5a6c84SAndroid Build Coastguard Workergeneric_signal() handler either sets "toys.signal" or writes a byte 4358*cf5a6c84SAndroid Build Coastguard Workerto toys.signalfd with the signal number if signalfd isn't -1 (which it's 4359*cf5a6c84SAndroid Build Coastguard Workerinitialized to in toy_init).</p> 4360*cf5a6c84SAndroid Build Coastguard Worker 4361*cf5a6c84SAndroid Build Coastguard Worker<p>The option parsing logic can now detect when a double fits in a long and 4362*cf5a6c84SAndroid Build Coastguard Workeruse the more precise type for floating point arguments (the FLOAT macro 4363*cf5a6c84SAndroid Build Coastguard Workercontains the type used). The human_readable() function now just outputs 4364*cf5a6c84SAndroid Build Coastguard Workerdecimal kilo/mega/gigabytes (so when du -u says 5.0G it means 5.0 billion 4365*cf5a6c84SAndroid Build Coastguard Workerbytes). The build infrastructure now notices duplicate commands (so if you 4366*cf5a6c84SAndroid Build Coastguard Workercp toys/pending/command.c toys/other/command.c and forget to delete the 4367*cf5a6c84SAndroid Build Coastguard Workerfirst one, the build break is now more informative).</p> 4368*cf5a6c84SAndroid Build Coastguard Worker 4369*cf5a6c84SAndroid Build Coastguard Worker<a name="20-04-2014" /><a href="#20-04-2014"><hr><h2><b>April 20, 2014</b></h2></a> 4370*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>And to this end they built themselves a stupendous supercomputer 4371*cf5a6c84SAndroid Build Coastguard Workerwhich was so amazingly intelligent that even before the data banks 4372*cf5a6c84SAndroid Build Coastguard Workerhad been connected up it had started from "I think therefore I am" and got as 4373*cf5a6c84SAndroid Build Coastguard Workerfar as the existence of rice pudding and income tax before anyone managed to 4374*cf5a6c84SAndroid Build Coastguard Workerturn it off.</p><p>- The Hitchhiker's Guide to the Galaxy</p></blockquote> 4375*cf5a6c84SAndroid Build Coastguard Worker 4376*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.4.8.tar.bz2>Toybox 0.4.8</a> is based on 4377*cf5a6c84SAndroid Build Coastguard Worker<a href=http://landley.net/hg/toybox/shortlog/1262>commit 1262</a>. And 4378*cf5a6c84SAndroid Build Coastguard Workerabout time too.</p> 4379*cf5a6c84SAndroid Build Coastguard Worker 4380*cf5a6c84SAndroid Build Coastguard Worker<p>The big news is that the build no longer needs python to generate help.h, 4381*cf5a6c84SAndroid Build Coastguard Workerthat's now done in C. The help text generation is also collating help text 4382*cf5a6c84SAndroid Build Coastguard Workerfrom multiple options, merging command line option blocks and usage: lines. 4383*cf5a6c84SAndroid Build Coastguard WorkerThere's even a new <a href=help.html>help web page</a>.</p> 4384*cf5a6c84SAndroid Build Coastguard Worker 4385*cf5a6c84SAndroid Build Coastguard Worker<p><b>New commands:</b> Ifconfig, cpio, and su were cleaned up the rest of the 4386*cf5a6c84SAndroid Build Coastguard Workerway and promoted out of pending. That saga is mostly explained on the 4387*cf5a6c84SAndroid Build Coastguard Worker<a href=cleanup.html>cleanup page</a>. Vivek Bhagat's freeramdisk, 4388*cf5a6c84SAndroid Build Coastguard WorkerIsaac Dunham's fsfreeze, and Felix Janda's iconv are also new.</p> 4389*cf5a6c84SAndroid Build Coastguard Worker 4390*cf5a6c84SAndroid Build Coastguard Worker<p><b>In pending:</b> 4391*cf5a6c84SAndroid Build Coastguard WorkerAshwini Sharma's team submitted tcpsvd, udpsvd, telnet, telnetd, last, more, 4392*cf5a6c84SAndroid Build Coastguard Workergroupdel/delgroup, arping, brctl, ftpget, ftpput, printf, reset, and added 4393*cf5a6c84SAndroid Build Coastguard Workeripv6 support to traceroute. Kyungwan Han's team submitted modprobe and getty. 4394*cf5a6c84SAndroid Build Coastguard WorkerVivek Bhagat submitted openvt and deacllocvt. Samuel Holland submitted fold. 4395*cf5a6c84SAndroid Build Coastguard WorkerI wrote a new inflate (zip/zlib/gzip decompression) implementation in 4396*cf5a6c84SAndroid Build Coastguard Workercompress.c, and still need to do a corresponding deflate (compression-side) 4397*cf5a6c84SAndroid Build Coastguard Workerand plug them into gzip and zip and so on. (Right now it does zcat.)</p> 4398*cf5a6c84SAndroid Build Coastguard Worker 4399*cf5a6c84SAndroid Build Coastguard Worker<p>Several commands (vmstat, login, du, vconfig, mountpoint, free, chroot, 4400*cf5a6c84SAndroid Build Coastguard Workercut, touch, modinfo, expand) predate the "pending" directory, and are thus 4401*cf5a6c84SAndroid Build Coastguard Workerin other directories but still need cleanup. Of these, vmstat got some 4402*cf5a6c84SAndroid Build Coastguard Workerwork this time (which would be much easier other vmstat implementations 4403*cf5a6c84SAndroid Build Coastguard Workerdocumented what their output actually meant).</p> 4404*cf5a6c84SAndroid Build Coastguard Worker 4405*cf5a6c84SAndroid Build Coastguard Worker<p><b>Upgrades:</b> Ifconfig grew /prefix netmask support (ala 1.2.3.4/24). Grep now has -zZ to 4406*cf5a6c84SAndroid Build Coastguard Workerhandle null terminated data, cksum grew -H for hex output. Upgraded od so the 4407*cf5a6c84SAndroid Build Coastguard Workerfields align better when producing multiple output types. Help has -a and -h 4408*cf5a6c84SAndroid Build Coastguard Workeroptions (all commands, html output). 4409*cf5a6c84SAndroid Build Coastguard WorkerBugfix to blkid building for a 32 bit target. The date command can actually 4410*cf5a6c84SAndroid Build Coastguard Workerset dates now. The O_NOFOLLOW compile time probe didn't work with cross 4411*cf5a6c84SAndroid Build Coastguard Workercompiling, so it's back to an #ifdef test in portability.h. Nathan McSween 4412*cf5a6c84SAndroid Build Coastguard Workersent in a bugfix to od and a portability fix in the common library code. 4413*cf5a6c84SAndroid Build Coastguard WorkerAshwini Sharma spotted a bug in pidof -o, and added verbose (-v) options 4414*cf5a6c84SAndroid Build Coastguard Workerto mkdir and ln, and suggested killall should have an -s option and 4415*cf5a6c84SAndroid Build Coastguard Workerallow -l to take zero arguments. Ashwini Sharma and Felix Janda upgraded 4416*cf5a6c84SAndroid Build Coastguard Workertftpd. Fixed dumpleases still using toynet.h after 4417*cf5a6c84SAndroid Build Coastguard Workerthat was removed. Corrected killall return code and error reporting. 4418*cf5a6c84SAndroid Build Coastguard WorkerIsacc Dunham fixed bugs all over the tree, did cleanup on a bunch of 4419*cf5a6c84SAndroid Build Coastguard Workerpending commands (getty, ftpget, init, openvt, modprobe...), and clarified 4420*cf5a6c84SAndroid Build Coastguard Workerfind's help text. Tom Sparrow ran three different static analyzers on 4421*cf5a6c84SAndroid Build Coastguard Workerthe code, which resulted in a few cleanups. The peek()/poke() functions 4422*cf5a6c84SAndroid Build Coastguard Workernow use "volatile" to prevent broken compiler "optimizations" to do with 4423*cf5a6c84SAndroid Build Coastguard Workeraliasing.</p> 4424*cf5a6c84SAndroid Build Coastguard Worker 4425*cf5a6c84SAndroid Build Coastguard Worker<p><b>Build stuff:</b> Each FOR_xxxx macro now has a complementary CLEANUP_xxxx macro, so you 4426*cf5a6c84SAndroid Build Coastguard Workercan put multiple commands with different command line options in the same 4427*cf5a6c84SAndroid Build Coastguard Worker.c file, so they can share infrastructure outside of lib. (This let the 4428*cf5a6c84SAndroid Build Coastguard Workerbunzip logic move out of lib into bzcat.c.) See XXX for example. 4429*cf5a6c84SAndroid Build Coastguard Workeri 4430*cf5a6c84SAndroid Build Coastguard Worker<p>The headers #included in toys.h are now grouped by standard, and headers 4431*cf5a6c84SAndroid Build Coastguard Workernot listed in Posix or LSB were moved to portability.h. The old xregcomp.h 4432*cf5a6c84SAndroid Build Coastguard Workerwas folded into lib.h because it's posix (and supporting oddball uClibc 4433*cf5a6c84SAndroid Build Coastguard Workerconfigurations isn't as important as it once was).</p> 4434*cf5a6c84SAndroid Build Coastguard Worker 4435*cf5a6c84SAndroid Build Coastguard Worker<p>Regression tested against Ubuntu 8.04 to fix up bit-rot in defconfig 4436*cf5a6c84SAndroid Build Coastguard Workerbuild on older systems. (We depend on Posix-2008, but not necessarily 4437*cf5a6c84SAndroid Build Coastguard Workerthe absolute latest build environment.)</p> 4438*cf5a6c84SAndroid Build Coastguard Worker 4439*cf5a6c84SAndroid Build Coastguard Worker<p><b>In lib</b>: lib/xwrap.c added xgetpwnam(), xchroot(), and lib/lib.c now has names_to_pid(). 4440*cf5a6c84SAndroid Build Coastguard Workerxsetuid() was replaced with xsetuser() which takes a struct passwd 4441*cf5a6c84SAndroid Build Coastguard Workerand sets both gid and uid, mkpathat() got factored out into a library command, 4442*cf5a6c84SAndroid Build Coastguard Workerget_int_value() became atolx_range(), and 4443*cf5a6c84SAndroid Build Coastguard Workerxmsprintf() is now just xmprintf(). The bunzip2 logic moved from lib into 4444*cf5a6c84SAndroid Build Coastguard Workerbzcat.c.</p> 4445*cf5a6c84SAndroid Build Coastguard Worker 4446*cf5a6c84SAndroid Build Coastguard Worker<p><b>Documentation</b>: new <a href=help.html>help page</a> with the 4447*cf5a6c84SAndroid Build Coastguard Workerhelp text for all the defconfig commands, using the new help -ah output. 4448*cf5a6c84SAndroid Build Coastguard WorkerThe <a href=code.html>source code walkthrough</a> now says more about 4449*cf5a6c84SAndroid Build Coastguard Worker#including header files, and how the generated/* directory works. The 4450*cf5a6c84SAndroid Build Coastguard Worker<a href=design.html>design page</a> has some new paragraphs about trading 4451*cf5a6c84SAndroid Build Coastguard Workerof different kinds of simplicity, and why comments aren't a substitute for 4452*cf5a6c84SAndroid Build Coastguard Workergood code. The README no longer trails off into obvious unfinished confusion 4453*cf5a6c84SAndroid Build Coastguard Workerat the end. Each page on the website should now have its own title.</p> 4454*cf5a6c84SAndroid Build Coastguard Worker 4455*cf5a6c84SAndroid Build Coastguard Worker<a name="18-11-2013" /><a href="#18-11-2013"><hr><h2><b>November 18, 2013</b></h2></a> 4456*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>"Space," it says, "is big. Really big. You just won't believe how vastly, hugely, mindbogglingly big it is. I mean, you may think it's a long way down the street to the chemist's, but that's just peanuts to space."</p><p>- 4457*cf5a6c84SAndroid Build Coastguard WorkerThe Hitchhiker's Guide to the Galaxy</p></blockquote> 4458*cf5a6c84SAndroid Build Coastguard Worker 4459*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.4.7.tar.bz2>Toybox 0.4.7</a> is based on 4460*cf5a6c84SAndroid Build Coastguard Worker<a href=http://landley.net/hg/toybox/shortlog/1122>commit 1122</a>.</p> 4461*cf5a6c84SAndroid Build Coastguard Worker 4462*cf5a6c84SAndroid Build Coastguard Worker<p>New commands: Brad Conroy submitted blkid. Elie De Brauwer submitted 4463*cf5a6c84SAndroid Build Coastguard Workerreboot, halt, and poweroff. Strake's nl got cleaned up and promoted from 4464*cf5a6c84SAndroid Build Coastguard Workerpending to posix. In addition, the existing chvt and vconfig got some 4465*cf5a6c84SAndroid Build Coastguard Workercleanup.</p> 4466*cf5a6c84SAndroid Build Coastguard Worker 4467*cf5a6c84SAndroid Build Coastguard Worker<p>That said, I haven't nearly kept up with the flood of new commands going 4468*cf5a6c84SAndroid Build Coastguard Workerinto pending: Ashwini Sharma's team submitted 4469*cf5a6c84SAndroid Build Coastguard Workerdd, dumpleases, traceroute, top, useradd, groupadd, mkpasswd, tftpd, and 4470*cf5a6c84SAndroid Build Coastguard Workeran fsck wrapper (with no filesystem drivers yet). Isaac Dunham sent in cpio.</p> 4471*cf5a6c84SAndroid Build Coastguard Worker 4472*cf5a6c84SAndroid Build Coastguard Worker<p>Bugfixes: Jeroen van Rijn added a user count to uptime. Elie De Brauwer 4473*cf5a6c84SAndroid Build Coastguard Workeradded -e to watch, removed a memory leak, and fixed a terminal size problem. 4474*cf5a6c84SAndroid Build Coastguard WorkerWilliam Haddon made xargs call its command line once even with blank input 4475*cf5a6c84SAndroid Build Coastguard Worker(the standard is vague, but builds expect it), and fixed an off by one bug 4476*cf5a6c84SAndroid Build Coastguard Workerwhere grep didn't malloc enough space with -E (leading to a segfault). 4477*cf5a6c84SAndroid Build Coastguard WorkerI fixed a glitch in bunzip2 (same one as went into busybox since they're using 4478*cf5a6c84SAndroid Build Coastguard Workerthe code I wrote), in od to fix -t co, -J, and -c options. Add uname -o as a 4479*cf5a6c84SAndroid Build Coastguard Workersynonym for -s. Build fix to never use $CC without prefixing it with 4480*cf5a6c84SAndroid Build Coastguard Worker$CROSS_COMPILE (since $HOSTCC could be different). Anca Emanuel spotted 4481*cf5a6c84SAndroid Build Coastguard Workera typo in the web page.</p> 4482*cf5a6c84SAndroid Build Coastguard Worker 4483*cf5a6c84SAndroid Build Coastguard Worker<p>The compile-time command line option parsing got rewritten (ported from 4484*cf5a6c84SAndroid Build Coastguard Workerbash to C), which should speed up builds a bit and allow code controlled by 4485*cf5a6c84SAndroid Build Coastguard Worker--longopts to drop out properly when disabled in the configuration. Terminal 4486*cf5a6c84SAndroid Build Coastguard Workerquerying got refactored. Patch's -x option is now more informative (a 4487*cf5a6c84SAndroid Build Coastguard Workerdebug thing if you're trying to figure out why a patch didn't apply). 4488*cf5a6c84SAndroid Build Coastguard WorkerThe "toynet.h" file got folded into toys.h since musl supports it and 4489*cf5a6c84SAndroid Build Coastguard Workermicromanging uClibc options isn't very interesting anymore. The test suite 4490*cf5a6c84SAndroid Build Coastguard Workernow uses scripts/single.sh when testing a single command.</p> 4491*cf5a6c84SAndroid Build Coastguard Worker 4492*cf5a6c84SAndroid Build Coastguard Worker<a name="17-09-2013" /><a href="#17-09-2013"><hr><h2><b>September 17, 2013</b></h2></a> 4493*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>"Think of a number," said the computer, "any number." 4494*cf5a6c84SAndroid Build Coastguard WorkerArthur told the computer the telephone number of King's Cross railway 4495*cf5a6c84SAndroid Build Coastguard Workerstation passenger inquiries, on the grounds that it must have some function, 4496*cf5a6c84SAndroid Build Coastguard Workerand this might turn out to be it.</p><p>- The Hitchhiker's Guide to the Galaxy</p> 4497*cf5a6c84SAndroid Build Coastguard Worker</blockquote> 4498*cf5a6c84SAndroid Build Coastguard Worker 4499*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.4.6.tar.bz2>Toybox 0.4.6</a> is based on 4500*cf5a6c84SAndroid Build Coastguard Worker<a href=http://landley.net/hg/toybox/shortlog/1068>commit 1068</a>.</p> 4501*cf5a6c84SAndroid Build Coastguard Worker 4502*cf5a6c84SAndroid Build Coastguard Worker<p>This release adds 4503*cf5a6c84SAndroid Build Coastguard Workerseveral new commands: Felix Janda wrote paste and fallocate, Kyungwan Han 4504*cf5a6c84SAndroid Build Coastguard Workersubmitted eject, Strake contributed grep, Ashwini Sharma added pmap (and 4505*cf5a6c84SAndroid Build Coastguard Workera testsuite entry for grep), Lukasz Skalski sent pwdx, Isaac Dunham posted 4506*cf5a6c84SAndroid Build Coastguard Workeracpi, and I did timeout and umount.</p> 4507*cf5a6c84SAndroid Build Coastguard Worker 4508*cf5a6c84SAndroid Build Coastguard Worker<p>The ls command now has a --color=auto option (suggested by Rich Felker). 4509*cf5a6c84SAndroid Build Coastguard WorkerThe multiplexer now has a --help option so you can say "./toybox --help blah" 4510*cf5a6c84SAndroid Build Coastguard Workerinstead of using the built-in "help" command. (Which is a shell built-in. 4511*cf5a6c84SAndroid Build Coastguard WorkerTry it on your command line, it's like man for shell builtins. But a certain 4512*cf5a6c84SAndroid Build Coastguard Workerother project has conditioned people to expect --help, so...) I forget who 4513*cf5a6c84SAndroid Build Coastguard Workerheehooman at gmail is but they pointed out unshare needed PID and UID 4514*cf5a6c84SAndroid Build Coastguard Workernamespace support.</p> 4515*cf5a6c84SAndroid Build Coastguard Worker 4516*cf5a6c84SAndroid Build Coastguard Worker<h3>Pending</h3> 4517*cf5a6c84SAndroid Build Coastguard Worker 4518*cf5a6c84SAndroid Build Coastguard Worker<p>A lot of new commands in toys/pending, to the point the next release should 4519*cf5a6c84SAndroid Build Coastguard Workerprobably just focus on cleanup and review of this backlog. We've got klogd, 4520*cf5a6c84SAndroid Build Coastguard Workerdhcp, dhcpd, watch, route, and ps from 4521*cf5a6c84SAndroid Build Coastguard WorkerAshwini Sharma (and an fsck wrapper but no fsck.fstype engines yet), 4522*cf5a6c84SAndroid Build Coastguard Workersyslogd, pgrep, and pkill from Madhur Verma, netstat by Ranjan Kumar, 4523*cf5a6c84SAndroid Build Coastguard Workertest by Felix Janda, lspci by Isaac Dunham, nl, su, and renice by strake (I.E. 4524*cf5a6c84SAndroid Build Coastguard WorkerM. Farkas-Dyck), and sysvinit by Kyungwan Han.</p> 4525*cf5a6c84SAndroid Build Coastguard Worker 4526*cf5a6c84SAndroid Build Coastguard Worker<p>Some cleanup work on existing pending commands that aren't 4527*cf5a6c84SAndroid Build Coastguard Workerready to promote yet: I did a few more rounds on ifconfig 4528*cf5a6c84SAndroid Build Coastguard Workerand Isaac Dunham's did several cleanups to xzcat, Felix Janda cleaned up 4529*cf5a6c84SAndroid Build Coastguard Workerlogger and syslogd...</p> 4530*cf5a6c84SAndroid Build Coastguard Worker 4531*cf5a6c84SAndroid Build Coastguard Worker<p>Also some cleanup work on commands that predate the pending directory, 4532*cf5a6c84SAndroid Build Coastguard Workerbut weren't quite polished when they went in, most prominently du, 4533*cf5a6c84SAndroid Build Coastguard Workerexpand, and touch.</p> 4534*cf5a6c84SAndroid Build Coastguard Worker 4535*cf5a6c84SAndroid Build Coastguard Worker<h3>Infrastructure</h3> 4536*cf5a6c84SAndroid Build Coastguard Worker 4537*cf5a6c84SAndroid Build Coastguard Worker<p>The new scripts/single.sh builds a standalone command without the 4538*cf5a6c84SAndroid Build Coastguard Workermultiplexer, although not all commands can be built that way yet (NEWTOY yes, 4539*cf5a6c84SAndroid Build Coastguard WorkerOLDTOY no) and the space savings aren't anything to write home about. (If a 4540*cf5a6c84SAndroid Build Coastguard Workercommand needs the option parsing logic at all, it needs all of it.) If 4541*cf5a6c84SAndroid Build Coastguard Workeryou're curious, you can do:</p> 4542*cf5a6c84SAndroid Build Coastguard Worker 4543*cf5a6c84SAndroid Build Coastguard Worker<blockquote><pre> 4544*cf5a6c84SAndroid Build Coastguard Workermake defconfig 4545*cf5a6c84SAndroid Build Coastguard Workermake 4546*cf5a6c84SAndroid Build Coastguard Workermkdir singles 4547*cf5a6c84SAndroid Build Coastguard Workerfor i in $(./toybox) 4548*cf5a6c84SAndroid Build Coastguard Workerdo 4549*cf5a6c84SAndroid Build Coastguard Worker echo $i 4550*cf5a6c84SAndroid Build Coastguard Worker PREFIX=singles/ scripts/single.sh $i || break 4551*cf5a6c84SAndroid Build Coastguard Workerdone 4552*cf5a6c84SAndroid Build Coastguard Worker</pre> 4553*cf5a6c84SAndroid Build Coastguard Worker<p>(And then wait a long time and watch almost half the builds fail.)</p> 4554*cf5a6c84SAndroid Build Coastguard Worker</blockquote> 4555*cf5a6c84SAndroid Build Coastguard Worker 4556*cf5a6c84SAndroid Build Coastguard Worker<p>There is now libbuf analogous to toybuf, another global 4k buffer this 4557*cf5a6c84SAndroid Build Coastguard Workertime for use by lib/ code instead of command code.</p> 4558*cf5a6c84SAndroid Build Coastguard Worker 4559*cf5a6c84SAndroid Build Coastguard Worker<p>The lib directory got split up a bit, lib/pending.c contains functions 4560*cf5a6c84SAndroid Build Coastguard Workernot yet used by anything outside of toys/pending/*, and lib/xwrap.c contains 4561*cf5a6c84SAndroid Build Coastguard Workerfunctions that wrap other functions and handle failures (via error_exit). 4562*cf5a6c84SAndroid Build Coastguard WorkerThis leaves lib/lib.c containing actual new functions.</p> 4563*cf5a6c84SAndroid Build Coastguard Worker 4564*cf5a6c84SAndroid Build Coastguard Worker<p>General improvements and bug fixes to argument parsing. The [-abc] exclude 4565*cf5a6c84SAndroid Build Coastguard Workerlogic should now clear arguments slots when disabling options. Bare --longopts 4566*cf5a6c84SAndroid Build Coastguard Workershould work now and be able to report errors using their name, the new ; 4567*cf5a6c84SAndroid Build Coastguard Workeroption allows optional arguments to longopts only suppliable with = (I.E. 4568*cf5a6c84SAndroid Build Coastguard Worker--color and --color=auto but not --color auto).</p> 4569*cf5a6c84SAndroid Build Coastguard Worker 4570*cf5a6c84SAndroid Build Coastguard Worker<p>I'm gradually weaning the code off of itoa()/utoa() because sprintf 4571*cf5a6c84SAndroid Build Coastguard Workerdoes this already. In this case "simple" probably means "let libc do it 4572*cf5a6c84SAndroid Build Coastguard Workerfor us".</p> 4573*cf5a6c84SAndroid Build Coastguard Worker 4574*cf5a6c84SAndroid Build Coastguard Worker<p>Rewrote for_each_pid_with_name_in() and renamed it to just names_to_pid(). 4575*cf5a6c84SAndroid Build Coastguard WorkerIt shouldn't get confused trying to compare absolute and relative paths quite 4576*cf5a6c84SAndroid Build Coastguard Workerso much anymore.</p> 4577*cf5a6c84SAndroid Build Coastguard Worker 4578*cf5a6c84SAndroid Build Coastguard Worker<p>lib/llist.c grew a new dlist_pop() function for removing a doubly 4579*cf5a6c84SAndroid Build Coastguard Workerlinked list entry while maintaining a circular list; tail and patch are 4580*cf5a6c84SAndroid Build Coastguard Workerusing it now.</p> 4581*cf5a6c84SAndroid Build Coastguard Worker 4582*cf5a6c84SAndroid Build Coastguard Worker<p>The musl guys suggested a new optimization flag 4583*cf5a6c84SAndroid Build Coastguard Worker(-fno-asynchronous-unwind-tables) 4584*cf5a6c84SAndroid Build Coastguard Workerthat shaves about 10% off the binary size by removing a C++ism that crept 4585*cf5a6c84SAndroid Build Coastguard Workerinto gcc's idea of C. While I don't normally try to micromanage the compiler, 4586*cf5a6c84SAndroid Build Coastguard Worker"-fstop-being-stupid" is a thing you have to hit gcc with from time to time.</p> 4587*cf5a6c84SAndroid Build Coastguard Worker 4588*cf5a6c84SAndroid Build Coastguard Worker<h3>Bugfixes</h3> 4589*cf5a6c84SAndroid Build Coastguard Worker 4590*cf5a6c84SAndroid Build Coastguard Worker<p>Felix Janda and I did a largeish rewrite of tail to 4591*cf5a6c84SAndroid Build Coastguard Workerfinally make it work right (we think). Still need to implement tail -f 4592*cf5a6c84SAndroid Build Coastguard Workersomeday (the tricky bit is making -f follow multiple files at once). 4593*cf5a6c84SAndroid Build Coastguard WorkerFelix also reported a bug in xpidfile.</p> 4594*cf5a6c84SAndroid Build Coastguard Worker 4595*cf5a6c84SAndroid Build Coastguard Worker<p>Juhani Haverinen pointed out that 4596*cf5a6c84SAndroid Build Coastguard Workerpython 3 doesn't work with config2help.py, so the detection logic looks 4597*cf5a6c84SAndroid Build Coastguard Workerfor python2 (until I get around to rewriting that in C). Elie De Brauwer 4598*cf5a6c84SAndroid Build Coastguard Workerthen fixed our first attempt at this, and also fixed uname's help string.</p> 4599*cf5a6c84SAndroid Build Coastguard Worker 4600*cf5a6c84SAndroid Build Coastguard Worker<p>Ashwini Sharma 4601*cf5a6c84SAndroid Build Coastguard Workerpointed out the build was making a FLAG_ macro for " " which broke some 4602*cf5a6c84SAndroid Build Coastguard Workerconfigurations. (That's a control character, not a command line option.)</p> 4603*cf5a6c84SAndroid Build Coastguard Worker 4604*cf5a6c84SAndroid Build Coastguard Worker<p>Jacek Bukarewicz pointed out a bug in chdir permission handling, and 4605*cf5a6c84SAndroid Build Coastguard Workera way to make env segfault. Both should be fixed now.</p> 4606*cf5a6c84SAndroid Build Coastguard Worker 4607*cf5a6c84SAndroid Build Coastguard Worker<p>The new function xexec_optargs() 4608*cf5a6c84SAndroid Build Coastguard Workerreplaces calls to xexec(toys.optargs) to avoid freeing and reusing optargs 4609*cf5a6c84SAndroid Build Coastguard Workerduring option parsing screwing stuff up (such as netcat's exec mode).</p> 4610*cf5a6c84SAndroid Build Coastguard Worker 4611*cf5a6c84SAndroid Build Coastguard Worker<p>The stat command's %a output was padded with leading zeroes, which 4612*cf5a6c84SAndroid Build Coastguard Workerdidn't match anybody else's behavior and thus made the test suite hiccup 4613*cf5a6c84SAndroid Build Coastguard Workerbetween TEST_HOST and testing toybox. (If you go "TEST_HOST=1 scripts/test.sh 4614*cf5a6c84SAndroid Build Coastguard Workercommand" it sanity checks the tests against the host implementation.)</p> 4615*cf5a6c84SAndroid Build Coastguard Worker 4616*cf5a6c84SAndroid Build Coastguard Worker<p>Last release, "mkdir sub/sub && chmod 007 sub/sub && rm -rf sub" didn't 4617*cf5a6c84SAndroid Build Coastguard Workerdelete sub and didn't exit with an error either. Neither was correct, rm 4618*cf5a6c84SAndroid Build Coastguard Workershould now be fixed.</p> 4619*cf5a6c84SAndroid Build Coastguard Worker 4620*cf5a6c84SAndroid Build Coastguard Worker<p> 4621*cf5a6c84SAndroid Build Coastguard Worker<a name="26-07-2013" /><a href="#26-07-2013"><hr><h2><b>July 26, 2013</b></h2></a> 4622*cf5a6c84SAndroid Build Coastguard Worker<p>Georgi Chorbadzhiyski maintains a <a href=https://github.com/gfto/toybox>git 4623*cf5a6c84SAndroid Build Coastguard Workermirror</a> of the repository on github, automatically updated from the 4624*cf5a6c84SAndroid Build Coastguard Workermercurial every 6 hours. The mirror is read only, but you can generate patches 4625*cf5a6c84SAndroid Build Coastguard Workeragainst it and post them to the list.</p> 4626*cf5a6c84SAndroid Build Coastguard Worker 4627*cf5a6c84SAndroid Build Coastguard Worker<a name="02-07-2013" /><a href="#02-07-2013"><hr><h2><b>July 2, 2013</b></h2></a> 4628*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>"Time is an illusion. Lunchtime doubly so." "Very deep. You 4629*cf5a6c84SAndroid Build Coastguard Workershould send that in to the Reader's Digest. They've got a page for people 4630*cf5a6c84SAndroid Build Coastguard Workerlike you."</p><p>- The Hitchhiker's Guide to the Galaxy</p></blockquote> 4631*cf5a6c84SAndroid Build Coastguard Worker 4632*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.4.5.tar.bz2>Toybox 0.4.5</a> is based on 4633*cf5a6c84SAndroid Build Coastguard Worker<a href=http://landley.net/hg/toybox/shortlog/941>commit 941</a>. It adds 4634*cf5a6c84SAndroid Build Coastguard Workeruuencode and uudecode from Erich Plondke, and enables Luis Morales' "who" by 4635*cf5a6c84SAndroid Build Coastguard Workerdefault. Felix Janda and I cleaned up last year's "stat" submission and 4636*cf5a6c84SAndroid Build Coastguard Workerenabled it. Ivo van Poorten added "groups". 4637*cf5a6c84SAndroid Build Coastguard WorkerAndre Renaud added "lsusb". I implemented "split", "pivot_root", and "mv". 4638*cf5a6c84SAndroid Build Coastguard Worker</p> 4639*cf5a6c84SAndroid Build Coastguard Worker 4640*cf5a6c84SAndroid Build Coastguard Worker<p>The "help" command is implemented differently now (lib/help.c) and 4641*cf5a6c84SAndroid Build Coastguard Workereach command can now understand --help (including both "toybox --help" 4642*cf5a6c84SAndroid Build Coastguard Workerand "toybox --help command" in the multiplexer).</p> 4643*cf5a6c84SAndroid Build Coastguard Worker 4644*cf5a6c84SAndroid Build Coastguard Worker<p>The "pending" directory has several commands (find, xzcat, nbd-client, 4645*cf5a6c84SAndroid Build Coastguard Workerlogger, expr) which work but are not enabled by default pending further cleanup. 4646*cf5a6c84SAndroid Build Coastguard WorkerIfconfig is enabled, but still in pending because it's only 2/3 cleaned up. 4647*cf5a6c84SAndroid Build Coastguard Worker(It's an awkward halfway state but I'm not holding up the release for it.)</p> 4648*cf5a6c84SAndroid Build Coastguard Worker 4649*cf5a6c84SAndroid Build Coastguard Worker<p>I'm <a href=cleanup.html>documenting the cleanups</a> to teach 4650*cf5a6c84SAndroid Build Coastguard Workermore people to do it, but the writeups aren't caught up yet. The 4651*cf5a6c84SAndroid Build Coastguard Worker<a href=roadmap.html>roadmap</a> also got updated a bit with further analysis 4652*cf5a6c84SAndroid Build Coastguard Workerof other projects, and the README and about pages got updated.</p> 4653*cf5a6c84SAndroid Build Coastguard Worker 4654*cf5a6c84SAndroid Build Coastguard Worker<p>Fixed _another_ "ls -C" segfault when terminal size can't be detected, 4655*cf5a6c84SAndroid Build Coastguard Workercondensed the ls help text to fit on one page, implented --color, and taught 4656*cf5a6c84SAndroid Build Coastguard Worker-l to print the major, minor numbers when showing block/char devices. 4657*cf5a6c84SAndroid Build Coastguard WorkerArgument parsing now handles "--" properly (to end option checking), 4658*cf5a6c84SAndroid Build Coastguard Workerand the infrastructure can now handle bare --longopts that have no 4659*cf5a6c84SAndroid Build Coastguard Workercorresponding short option (both were implemented before but didn't work). 4660*cf5a6c84SAndroid Build Coastguard WorkerFixed an old bug in "patch", chmod grew -f, who grew -a. Isaac Dunham 4661*cf5a6c84SAndroid Build Coastguard Workerfixed "-" vs "_" handling in modinfo, added a "firmware" output 4662*cf5a6c84SAndroid Build Coastguard Workerfield, added -b and -k support, and taught it that the ".ko" extension means 4663*cf5a6c84SAndroid Build Coastguard Workerto look for the file at the specified path instead of under /lib. Felix Janda 4664*cf5a6c84SAndroid Build Coastguard Workermoved file permission display code to lib so ls and 4665*cf5a6c84SAndroid Build Coastguard Workerstat could share it. Ashwini Sharma spotted a bug in xabspath when the 4666*cf5a6c84SAndroid Build Coastguard Workerlast path component exists but we haven't got permissions to open it 4667*cf5a6c84SAndroid Build Coastguard Worker(ala readlink -f /dev/sda as a normal user). 4668*cf5a6c84SAndroid Build Coastguard Worker</p> 4669*cf5a6c84SAndroid Build Coastguard Worker 4670*cf5a6c84SAndroid Build Coastguard Worker<p>In the build infrastructure, scripts/findglobals.sh finds leaked global 4671*cf5a6c84SAndroid Build Coastguard Workervariables. (Leaked means they aren't part of the global union: Other than glibc 4672*cf5a6c84SAndroid Build Coastguard Workerdebris, toybox should define "this", "toy_list", "toybuf", and "toys", and 4673*cf5a6c84SAndroid Build Coastguard Workerthat's it; the rest add memory footprint to every command for the benefit of 4674*cf5a6c84SAndroid Build Coastguard Workerjust one command; use GLOBALS() to stick 'em in the union.) Static linking 4675*cf5a6c84SAndroid Build Coastguard Workeragainst libraries other than the host's libc now applies to feature probes 4676*cf5a6c84SAndroid Build Coastguard Workerfor unshare and such. Neuter stupid internationalization support that makes 4677*cf5a6c84SAndroid Build Coastguard Workervarious host "sort" commands put things in an order other than alphabetical 4678*cf5a6c84SAndroid Build Coastguard Worker(breaking the multiplexer's binary search on command names). 4679*cf5a6c84SAndroid Build Coastguard Worker 4680*cf5a6c84SAndroid Build Coastguard Worker<p>You should now be able to build from a source control snapshot on a build 4681*cf5a6c84SAndroid Build Coastguard Workersystem that hasn't got python: if you disable CONFIG_TOYBOX_HELP. (The 4682*cf5a6c84SAndroid Build Coastguard Workerrelease tarballs ship generated/help.h, but it's not in source control. 4683*cf5a6c84SAndroid Build Coastguard WorkerEventually I should rewrite that python script in C.)</p> 4684*cf5a6c84SAndroid Build Coastguard Worker</p> 4685*cf5a6c84SAndroid Build Coastguard Worker 4686*cf5a6c84SAndroid Build Coastguard Worker<p><b>LICENSE TWEAK</b>: After <a href=http://lists.landley.net/pipermail/toybox-landley.net/2013-March/000794.html>discussion</a> on the mailing list the "2 clause 4687*cf5a6c84SAndroid Build Coastguard WorkerBSD" <a href=license.html>license</a> got slightly simplified so the first 4688*cf5a6c84SAndroid Build Coastguard Workerparagraph now says:</p> 4689*cf5a6c84SAndroid Build Coastguard Worker 4690*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>Permission to use, copy, modify, and/or distribute this 4691*cf5a6c84SAndroid Build Coastguard Workersoftware for any purpose with or without fee is hereby granted.</p></blockquote> 4692*cf5a6c84SAndroid Build Coastguard Worker 4693*cf5a6c84SAndroid Build Coastguard Worker<p>It used to continue "provided that the above copyright notice and this 4694*cf5a6c84SAndroid Build Coastguard Workerpermission notice appear in all copies", but A) what's the point? B) does "all 4695*cf5a6c84SAndroid Build Coastguard Workercopies" mean binaries, or just source code, or what? C) lots of projects 4696*cf5a6c84SAndroid Build Coastguard Workerthat consider BSD and GPL compatible have <a href=https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/crypto/aes_generic.c>files with 4697*cf5a6c84SAndroid Build Coastguard Workerboth license notices</a> on them (sometimes at <a href=http://git.busybox.net/busybox/tree/shell/ash.c>opposite ends of the file</a> to make the conflict 4698*cf5a6c84SAndroid Build Coastguard Workerless obvious) because "all copies must include this function" would violate 4699*cf5a6c84SAndroid Build Coastguard Workerthe GPL but "all copies must include this magic text blob" somehow don't?</p> 4700*cf5a6c84SAndroid Build Coastguard Worker 4701*cf5a6c84SAndroid Build Coastguard Worker<p>I don't want to have to care about this anymore. The tweaked version is more 4702*cf5a6c84SAndroid Build Coastguard Workeror less public domain with a liability disclaimer, but we're still calling it 4703*cf5a6c84SAndroid Build Coastguard WorkerBSD (sometimes "0 clause BSD") to avoid explaining.</p> 4704*cf5a6c84SAndroid Build Coastguard Worker 4705*cf5a6c84SAndroid Build Coastguard Worker<a name="21-03-2013" /><a href="#21-03-2013"><hr><h2><b>March 21, 2013</b></h2></a> 4706*cf5a6c84SAndroid Build Coastguard Worker<p>Video of my ELC talk 4707*cf5a6c84SAndroid Build Coastguard Worker"<a href=http://youtu.be/SGmtP5Lg_t0>Why is Toybox?</a>" 4708*cf5a6c84SAndroid Build Coastguard Workeris up on youtube. Related materials include the 4709*cf5a6c84SAndroid Build Coastguard Worker<a href=http://landley.net/talks/celf-2013.txt>talk outline</a> and an 4710*cf5a6c84SAndroid Build Coastguard Worker<a href=/aboriginal/about.html#selfhost>android self-hosting writeup</a>.</p> 4711*cf5a6c84SAndroid Build Coastguard Worker 4712*cf5a6c84SAndroid Build Coastguard Worker<p>[Updated June 4] The following links jump to specific topics in the video. (Sorry about 4713*cf5a6c84SAndroid Build Coastguard Workerthe ads, it's The Linux Foundation.)</p> 4714*cf5a6c84SAndroid Build Coastguard Worker 4715*cf5a6c84SAndroid Build Coastguard Worker<ul> 4716*cf5a6c84SAndroid Build Coastguard Worker<li>0m29s <a href=http://www.youtube.com/watch?v=SGmtP5Lg_t0#t=0m29s>The smartphone is replacing the PC</a></li> 4717*cf5a6c84SAndroid Build Coastguard Worker <ul> 4718*cf5a6c84SAndroid Build Coastguard Worker <li>4m22s <a href=http://www.youtube.com/watch?v=SGmtP5Lg_t0#t=4m22s>Software needed to become self-hosting</a></li> 4719*cf5a6c84SAndroid Build Coastguard Worker <li>6m20s <a href=http://www.youtube.com/watch?v=SGmtP5Lg_t0#t=6m20s>Do we care if android or iphone wins?</a></li> 4720*cf5a6c84SAndroid Build Coastguard Worker </ul> 4721*cf5a6c84SAndroid Build Coastguard Worker<li>9m45s <a href=http://www.youtube.com/watch?v=SGmtP5Lg_t0#t=9m45s>Android not vanilla: oppose or accept?</a></li> 4722*cf5a6c84SAndroid Build Coastguard Worker <ul> 4723*cf5a6c84SAndroid Build Coastguard Worker <li>11m30s <a href=http://www.youtube.com/watch?v=SGmtP5Lg_t0#t=11m30s>Open source can't do User Interfaces</a></li> 4724*cf5a6c84SAndroid Build Coastguard Worker </ul> 4725*cf5a6c84SAndroid Build Coastguard Worker<li>15m09s <a href=http://www.youtube.com/watch?v=SGmtP5Lg_t0#t=15m09s>Android is not copyleft: oppose or accept?</a></li> 4726*cf5a6c84SAndroid Build Coastguard Worker<li>18m23s <a href=http://www.youtube.com/watch?v=SGmtP5Lg_t0#t=18m23s>Security issues</a></li> 4727*cf5a6c84SAndroid Build Coastguard Worker<li>21m15s <a href=http://www.youtube.com/watch?v=SGmtP5Lg_t0#t=21m15s>Solutions to the software problems</a></li> 4728*cf5a6c84SAndroid Build Coastguard Worker <ul> 4729*cf5a6c84SAndroid Build Coastguard Worker <li>22m55s <a href=http://www.youtube.com/watch?v=SGmtP5Lg_t0#t=22m55s>What toybox needs to be/do</a></li> 4730*cf5a6c84SAndroid Build Coastguard Worker <li>28m17s <a href=http://www.youtube.com/watch?v=SGmtP5Lg_t0#t=28m17s>What is toybox?</a></li> 4731*cf5a6c84SAndroid Build Coastguard Worker <ul> 4732*cf5a6c84SAndroid Build Coastguard Worker <li>28m58s <a href=http://www.youtube.com/watch?v=SGmtP5Lg_t0#t=28m58s>Why toybox started...</a></li> 4733*cf5a6c84SAndroid Build Coastguard Worker <li>37m50s <a href=http://www.youtube.com/watch?v=SGmtP5Lg_t0#t=37m50s>What does toybox actually implement?</a></li> 4734*cf5a6c84SAndroid Build Coastguard Worker </ul> 4735*cf5a6c84SAndroid Build Coastguard Worker </ul> 4736*cf5a6c84SAndroid Build Coastguard Worker</ul> 4737*cf5a6c84SAndroid Build Coastguard Worker</span> 4738*cf5a6c84SAndroid Build Coastguard Worker 4739*cf5a6c84SAndroid Build Coastguard Worker 4740*cf5a6c84SAndroid Build Coastguard Worker<a name="14-03-2013" /><a href="#14-03-2013"><hr><h2><b>March 14, 2013</b></h2></a> 4741*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>"Ford, you're turning into a penguin. Stop it." - 4742*cf5a6c84SAndroid Build Coastguard Worker</p><p>The Hitchhiker's Guide to the Galaxy</p></blockquote> 4743*cf5a6c84SAndroid Build Coastguard Worker 4744*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.4.4.tar.bz2>Toybox 0.4.4</a> is based on 4745*cf5a6c84SAndroid Build Coastguard Worker<a href=http://landley.net/hg/toybox/shortlog/813>commit 813</a>, adding 4746*cf5a6c84SAndroid Build Coastguard Workerthe "time" and "readahead" commands, plus some bugfixes.</p> 4747*cf5a6c84SAndroid Build Coastguard Worker 4748*cf5a6c84SAndroid Build Coastguard Worker<p>The "cp" command now implements the -s symlink option, plus bugfixes 4749*cf5a6c84SAndroid Build Coastguard Workergetting various corner cases right as used in actual package builds. 4750*cf5a6c84SAndroid Build Coastguard Worker"id -Gn root" should now print root's groups 4751*cf5a6c84SAndroid Build Coastguard Workerinstead of the current user's. Several build fixes so toybox builds under 4752*cf5a6c84SAndroid Build Coastguard WorkerUbuntu 8.04 again (which is about as old a build environment as you 4753*cf5a6c84SAndroid Build Coastguard Workercan expect to find posix-2008 features in).</p> 4754*cf5a6c84SAndroid Build Coastguard Worker 4755*cf5a6c84SAndroid Build Coastguard Worker<p>Unfinished commands have generally been moved to "toys/pending". 4756*cf5a6c84SAndroid Build Coastguard WorkerEverything else should "default y" to participate in make defconfig. 4757*cf5a6c84SAndroid Build Coastguard WorkerSeveral of those pending commands got some basic cleanup so allyesconfig 4758*cf5a6c84SAndroid Build Coastguard Workershould at least compile (although defconfig is still what's useful).</p> 4759*cf5a6c84SAndroid Build Coastguard Worker 4760*cf5a6c84SAndroid Build Coastguard Worker<p>Significant roadmap updates, checking several other multicall binaries 4761*cf5a6c84SAndroid Build Coastguard Worker(klibc, sash, sbase, s6...) to see what commands they include.</p> 4762*cf5a6c84SAndroid Build Coastguard Worker 4763*cf5a6c84SAndroid Build Coastguard Worker<a name="18-01-2013" /><a href="#18-01-2013"><hr><h2><b>January 18, 2013</b></h2></a> 4764*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>This must be Thursday. I never could get the hang of Thursdays.</p><p>- The Hitchhiker's Guide to the Galaxy</p></blockquote> 4765*cf5a6c84SAndroid Build Coastguard Worker 4766*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.4.3.tar.bz2>Toybox 0.4.3</a> is based on 4767*cf5a6c84SAndroid Build Coastguard Worker<a href=http://landley.net/hg/toybox/shortlog/793>commit 793</a>. There 4768*cf5a6c84SAndroid Build Coastguard Workerare now exactly 100 commands in defconfig (of a little over 220 on the 4769*cf5a6c84SAndroid Build Coastguard Worker<a href=roadmap.html>todo list</a>).</p> 4770*cf5a6c84SAndroid Build Coastguard Worker 4771*cf5a6c84SAndroid Build Coastguard Worker<p>Elie De Brauwer added the rev command, cleaned up tac, implemented the -s 4772*cf5a6c84SAndroid Build Coastguard Workerand -f flags for seq, added -v and -i to killall (and fixed killall not to 4773*cf5a6c84SAndroid Build Coastguard Workerkill itself before finishing its pid list), and added to the test suite. 4774*cf5a6c84SAndroid Build Coastguard WorkerFelix Janda added -m to mkdir, pwd -L and -P, and more test suite entries.</p> 4775*cf5a6c84SAndroid Build Coastguard Worker 4776*cf5a6c84SAndroid Build Coastguard Worker<p>Rob Landley added the losetup command, and fixed the existing ls, cp, and 4777*cf5a6c84SAndroid Build Coastguard Workerreadlink commands. The segfault in ls 4778*cf5a6c84SAndroid Build Coastguard Workerhappened when it couldn't determine the screen size (last release changed the 4779*cf5a6c84SAndroid Build Coastguard Workerdefault to -C and a screen size of 0 made column view unhappy), and cp got an 4780*cf5a6c84SAndroid Build Coastguard Workerextensive rewrite bringing it up to date with the dirtree changes and fixing 4781*cf5a6c84SAndroid Build Coastguard Workera number of things it never did right in the first place. The xabspath() 4782*cf5a6c84SAndroid Build Coastguard Workercode in the library now handles a symlink after ".." properly (and the test 4783*cf5a6c84SAndroid Build Coastguard Workersuite checks for it).</p> 4784*cf5a6c84SAndroid Build Coastguard Worker 4785*cf5a6c84SAndroid Build Coastguard Worker<p>Infrastructure-wise the code is better about automatically setting the 4786*cf5a6c84SAndroid Build Coastguard Workererror return code properly. Now error_msg() sets the exit code to 1 if it's 4787*cf5a6c84SAndroid Build Coastguard Workerstill defaulting to 0, and the global exit path does a fflush(NULL) with error 4788*cf5a6c84SAndroid Build Coastguard Workerbit check rather than trying to be quite so granular about flushing. (That 4789*cf5a6c84SAndroid Build Coastguard Workermeans if we use printf() instead of xprintf() it still exits with the right 4790*cf5a6c84SAndroid Build Coastguard Workererror code, it just doesn't end the program early on an output error.) 4791*cf5a6c84SAndroid Build Coastguard WorkerMinor bugfix so TOYBOX_DEBUG 4792*cf5a6c84SAndroid Build Coastguard Workerdoesn't always warn about the lack of suid bit when toybox is built with 4793*cf5a6c84SAndroid Build Coastguard Workerat least one STAYROOT command. Bugfix for the option [grouping] logic 4794*cf5a6c84SAndroid Build Coastguard Worker(and then further fixes to the error reporting pointed out by Ashwini Sharma). 4795*cf5a6c84SAndroid Build Coastguard Workerdirtree_handle_callback() now has a prefix like the rest of the dirtree 4796*cf5a6c84SAndroid Build Coastguard Workerfunctions. A lot of stuff doing manual path handling was switched to using 4797*cf5a6c84SAndroid Build Coastguard Workerlibc basename() (including, embarassingly, the basename command), which means 4798*cf5a6c84SAndroid Build Coastguard Workerit now correctly detects "/trailing/slash/" which the previous code didn't.</p> 4799*cf5a6c84SAndroid Build Coastguard Worker 4800*cf5a6c84SAndroid Build Coastguard Worker<p>Also, last release included some accidentally checked in debug code that 4801*cf5a6c84SAndroid Build Coastguard Workerdisabled compiler optimization, so the binary size bloated a bit. It's back 4802*cf5a6c84SAndroid Build Coastguard Workerto -Os by default now.</p> 4803*cf5a6c84SAndroid Build Coastguard Worker 4804*cf5a6c84SAndroid Build Coastguard Worker<a name="15-12-2012" /><a href="#15-12-2012"><hr><h2><b>December 15, 2012</b></h2></a> 4805*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>"The major difference between a thing that might go wrong and a 4806*cf5a6c84SAndroid Build Coastguard Workerthing that cannot possibly go wrong is that when a thing that cannot possibly 4807*cf5a6c84SAndroid Build Coastguard Workergo wrong goes wrong it usually turns out to be impossible to get at or repair." 4808*cf5a6c84SAndroid Build Coastguard Worker</p><p>- The Hitchhiker's Guide to the Galaxy</p></blockquote> 4809*cf5a6c84SAndroid Build Coastguard Worker 4810*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.4.2.tar.bz2>Toybox 0.4.2</a> is based on 4811*cf5a6c84SAndroid Build Coastguard Worker<a href=http://landley.net/hg/toybox/shortlog/749>commit 749</a> and is 4812*cf5a6c84SAndroid Build Coastguard Workerjust a resync. Linux 3.7 came out, meaning it's time to do an Aboriginal 4813*cf5a6c84SAndroid Build Coastguard WorkerLinux release, and that should use a stable version of toybox. So here's 4814*cf5a6c84SAndroid Build Coastguard Workera new stable version.</p> 4815*cf5a6c84SAndroid Build Coastguard Worker 4816*cf5a6c84SAndroid Build Coastguard Worker<p>The new commands are cut (from Jason Kyungwan Han), touch 4817*cf5a6c84SAndroid Build Coastguard Worker(from Choubey Ji), expand (from Jonathan Clairembault, and he fixed a 4818*cf5a6c84SAndroid Build Coastguard Workerbug in login), and rm (from Rob Landley). Felix Janda added UTF-8 4819*cf5a6c84SAndroid Build Coastguard Workersupport infrastructure (for non-ascii character sets) with a config option. 4820*cf5a6c84SAndroid Build Coastguard WorkerElie De Brauwer added tests for cat and sha1sum, and -so options to pidof. 4821*cf5a6c84SAndroid Build Coastguard WorkerThe "ls" command defaults to -C (column view) now, and "readlink" now supports 4822*cf5a6c84SAndroid Build Coastguard Worker-fenq.</p> 4823*cf5a6c84SAndroid Build Coastguard Worker 4824*cf5a6c84SAndroid Build Coastguard Worker<p>Portability work: toybox should now build against the musl C library, 4825*cf5a6c84SAndroid Build Coastguard Workerand against older glibc versions (circa 2008, much before that and kernel 4826*cf5a6c84SAndroid Build Coastguard Workerfeatures we depend on start to drop out).</p> 4827*cf5a6c84SAndroid Build Coastguard Worker 4828*cf5a6c84SAndroid Build Coastguard Worker<p>The whole codebase got reindented from "one tab" to "two spaces" per 4829*cf5a6c84SAndroid Build Coastguard Workerlevel. The option parsing logic now understands [groups] of commands (when more 4830*cf5a6c84SAndroid Build Coastguard Workerthan one in a group is selected it can switch the others off, or error out, 4831*cf5a6c84SAndroid Build Coastguard Workeror other things). The error_exit() infrastructure can now longjmp back to an 4832*cf5a6c84SAndroid Build Coastguard Workerearlier point instead of exiting. Each toys/* directory now has a README, 4833*cf5a6c84SAndroid Build Coastguard Workerthe first line of which is the fancy name menuconfig uses for the directory 4834*cf5a6c84SAndroid Build Coastguard Worker(so no more hardwired directory list in scripts/genconfig.sh).</p> 4835*cf5a6c84SAndroid Build Coastguard Worker 4836*cf5a6c84SAndroid Build Coastguard Worker<p>Fixed a filehandle leak in getmountlist(). 4837*cf5a6c84SAndroid Build Coastguard WorkerPass parent pointer to dirtree_add_node() so it can give error messages with 4838*cf5a6c84SAndroid Build Coastguard Workerfull path. The yesno() function now always reads from stdin and writes to 4839*cf5a6c84SAndroid Build Coastguard Workerstderr (we can retry tty checking complexity once we've got commands needing 4840*cf5a6c84SAndroid Build Coastguard Workerit).</p> 4841*cf5a6c84SAndroid Build Coastguard Worker 4842*cf5a6c84SAndroid Build Coastguard Worker<p>The open group broke their website so the 4843*cf5a6c84SAndroid Build Coastguard Worker<a href=http://opengroup.org/onlinepubs/9699919799>old links</a> to POSIX 2008 4844*cf5a6c84SAndroid Build Coastguard Workernow <a href=http://pubs.opengroup.org/onlinepubs/9699919799>need to start with 4845*cf5a6c84SAndroid Build Coastguard Workerpubs</a>. Some of the links in the tree have been updated, others haven't while 4846*cf5a6c84SAndroid Build Coastguard WorkerI wait to see if their webmaster notices and fixes it.</p> 4847*cf5a6c84SAndroid Build Coastguard Worker 4848*cf5a6c84SAndroid Build Coastguard Worker<p>(I note that the current rm implementation is not technically posix compliant 4849*cf5a6c84SAndroid Build Coastguard Workerbecause the standard requires infinite recursion depth and the current 4850*cf5a6c84SAndroid Build Coastguard Workerimplementation uses one filehandle per level. I can add a config option 4851*cf5a6c84SAndroid Build Coastguard Workerto do it Posix's way, which is more brittle and needs extra security checks, 4852*cf5a6c84SAndroid Build Coastguard Workerbut am waiting for somebody to complain first. The default "ulimit -n" is 1024 4853*cf5a6c84SAndroid Build Coastguard Workerfilehandles, so drilling down over 1000 nested subdirectories).</p> 4854*cf5a6c84SAndroid Build Coastguard Worker 4855*cf5a6c84SAndroid Build Coastguard Worker<a name="13-11-2012" /><a href="#13-11-2012"><hr><h2><b>November 13, 2012</b></h2></a> 4856*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>"Rule Six: The winning team shall be the first team that wins." 4857*cf5a6c84SAndroid Build Coastguard Worker</p><p>- The Hitchhiker's Guide to the Galaxy</p></blockquote> 4858*cf5a6c84SAndroid Build Coastguard Worker 4859*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.4.1.tar.bz2>Toybox 0.4.1</a> is based on 4860*cf5a6c84SAndroid Build Coastguard Worker<a href=http://landley.net/hg/toybox/shortlog/691>commit 691</a>.</p> 4861*cf5a6c84SAndroid Build Coastguard Worker 4862*cf5a6c84SAndroid Build Coastguard Worker<p>Elie De Brauwer contributed usleep, Ashwini Kumar contributed du, and 4863*cf5a6c84SAndroid Build Coastguard WorkerKyungwan Han contributed vconfig. Other new commands include switch_root and 4864*cf5a6c84SAndroid Build Coastguard Workermd5sum, and the remaining shell wrappers are now proper commands (dos2unix, 4865*cf5a6c84SAndroid Build Coastguard Workerunix2dos).</p> 4866*cf5a6c84SAndroid Build Coastguard Worker 4867*cf5a6c84SAndroid Build Coastguard Worker<p>The patch command now supports -l, and gethostname is now enabled by 4868*cf5a6c84SAndroid Build Coastguard Workerdefault. The df command follows symlinks to get the actual device name. 4869*cf5a6c84SAndroid Build Coastguard WorkerFelix Janda added -m support to wc (for utf8).</p> 4870*cf5a6c84SAndroid Build Coastguard Worker 4871*cf5a6c84SAndroid Build Coastguard Worker<p>On the infrastructure side, the commands have now been grouped into 4872*cf5a6c84SAndroid Build Coastguard Worker"posix", "lsb", and "other" subdirectories (for things required by Posix-2008, 4873*cf5a6c84SAndroid Build Coastguard Workerthe Linux Standard Base 4.1, and commands in neither). This affects menuconfig 4874*cf5a6c84SAndroid Build Coastguard Workerand the actual source layout (toys/cp.c is now toys/posix/cp.c, and so on). 4875*cf5a6c84SAndroid Build Coastguard WorkerAn android directory is planned (see the updated 4876*cf5a6c84SAndroid Build Coastguard Worker<a href=roadmap.html#android>android roadmap analysis</a>).</p> 4877*cf5a6c84SAndroid Build Coastguard Worker 4878*cf5a6c84SAndroid Build Coastguard Worker<p>The FLAG_ macros for command option parsing and TT alias for the command's 4879*cf5a6c84SAndroid Build Coastguard Workerglobal block are now automatically generated, commands should 4880*cf5a6c84SAndroid Build Coastguard Worker#define FOR_commandname before #including <toys.h> to get the macros for that 4881*cf5a6c84SAndroid Build Coastguard Workercommand.</p> 4882*cf5a6c84SAndroid Build Coastguard Worker 4883*cf5a6c84SAndroid Build Coastguard Worker<p>An upgrade to the build infrastructure now allows commands with _ and - 4884*cf5a6c84SAndroid Build Coastguard Workerin them, such as switch_root.</p> 4885*cf5a6c84SAndroid Build Coastguard Worker 4886*cf5a6c84SAndroid Build Coastguard Worker<p>Bugfixes: Avery Pennarun spotted a case where ls showed uid twice instead of 4887*cf5a6c84SAndroid Build Coastguard Workeruid and gid, and that nice was using the wrong range of numbers. 4888*cf5a6c84SAndroid Build Coastguard WorkerThe ls command also recursed inappropriately last time (not quite 4889*cf5a6c84SAndroid Build Coastguard Workerproperly converted for the dirtree changes last release), and now it's 4890*cf5a6c84SAndroid Build Coastguard Workerfixed. Roy Tam pointed out a glitch in sh, and fixed df's percentage 4891*cf5a6c84SAndroid Build Coastguard Workercalculation to match the POSIX spec. The kernel build didn't like our mktemp 4892*cf5a6c84SAndroid Build Coastguard Workerand it does now. The wc command wasn't quite posix compliant (trailing spaces 4893*cf5a6c84SAndroid Build Coastguard Workerbreak stuff). The ls command recursed inappropriately last time (not quite 4894*cf5a6c84SAndroid Build Coastguard Workerproperly converted for the dirtree changes last release), and now it's 4895*cf5a6c84SAndroid Build Coastguard Workerfixed. The catv command wasn't displaying byte 255 correctly. Some lib 4896*cf5a6c84SAndroid Build Coastguard Workerfixes (thinko in xpidfile). Fixed uname -m when running a 32 bit x86 binary 4897*cf5a6c84SAndroid Build Coastguard Workeron an x86-64 host (it lies and says the system is i686, i586, or i486 depending 4898*cf5a6c84SAndroid Build Coastguard Workeron what the toolchain that built the binary supported. This makes builds in 4899*cf5a6c84SAndroid Build Coastguard Workera 32 bit chroot on a 64 bit kernel break less.) The df command was checking 4900*cf5a6c84SAndroid Build Coastguard Workerpartitions in the wrong order (displaying undermounts instead of overmounts: 4901*cf5a6c84SAndroid Build Coastguard Workerthis used to work but some library code changed out from under it and it 4902*cf5a6c84SAndroid Build Coastguard Workerwasn't updated to match until now). Felix Janda filled out the test suite 4903*cf5a6c84SAndroid Build Coastguard Workersome more. The patch file creation logic got tweaked several times to 4904*cf5a6c84SAndroid Build Coastguard Workersuccessfully apply more patches. Support for older (pre 2.10) glibc 4905*cf5a6c84SAndroid Build Coastguard Workerversions was added to portability.h.</p> 4906*cf5a6c84SAndroid Build Coastguard Worker 4907*cf5a6c84SAndroid Build Coastguard Worker<p>Miscelaneous cleanups all around (mknod, sha1sum, logname), including a 4908*cf5a6c84SAndroid Build Coastguard Workerrewrite of taskset to be less dependent on libc getting the headers right. All 4909*cf5a6c84SAndroid Build Coastguard Workerthe command headers should now point to the current relevant standards 4910*cf5a6c84SAndroid Build Coastguard Workerdocument, where applicable.</p> 4911*cf5a6c84SAndroid Build Coastguard Worker 4912*cf5a6c84SAndroid Build Coastguard Worker<p>This news page had old news entries from before the relaunch moved into 4913*cf5a6c84SAndroid Build Coastguard Workera separate <a href=oldnews.html>oldnews</a> page.</p> 4914*cf5a6c84SAndroid Build Coastguard Worker 4915*cf5a6c84SAndroid Build Coastguard Worker<p>I forgot to create <a href=bin>static binaries</a> last time, but they're 4916*cf5a6c84SAndroid Build Coastguard Workerback now.</p> 4917*cf5a6c84SAndroid Build Coastguard Worker</span> 4918*cf5a6c84SAndroid Build Coastguard Worker 4919*cf5a6c84SAndroid Build Coastguard Worker<a name="23-07-2012" /><a href="#23-07-2012"><hr><h2><b>July 23, 2012</b></h2></a> 4920*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>"Ford", Arthur said. "There's an infinite number of monkeys 4921*cf5a6c84SAndroid Build Coastguard Workerout here who want to talk to us about this script for Hamlet they've worked 4922*cf5a6c84SAndroid Build Coastguard Workerout."</p><p>- The Hitchhiker's Guide to the Galaxy</p></blockquote> 4923*cf5a6c84SAndroid Build Coastguard Worker 4924*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.4.0.tar.bz2>Toybox 0.4.0</a> is based on 4925*cf5a6c84SAndroid Build Coastguard Worker<a href=http://landley.net/hg/toybox/shortlog/640>commit 640</a>.</p> 4926*cf5a6c84SAndroid Build Coastguard Worker 4927*cf5a6c84SAndroid Build Coastguard Worker<p>The new <a href=status.html>status page</a> is calculated from 4928*cf5a6c84SAndroid Build Coastguard Workerthe roadmap info, and should be easier to keep up to date in future.</p> 4929*cf5a6c84SAndroid Build Coastguard Worker 4930*cf5a6c84SAndroid Build Coastguard Worker<p>Andre Renaud contributed od and modinfo. Elie De Brauwer contributed 4931*cf5a6c84SAndroid Build Coastguard Workertaskset, bugfixes to cmp and tail, and tests for sort and tail. Kyungwan Han 4932*cf5a6c84SAndroid Build Coastguard Workercontributed passwd. Gaurang Shastri contributed w. Ashwini Sharma spotted a 4933*cf5a6c84SAndroid Build Coastguard Workercase where dirtree was adding extra slashes to a path.</p> 4934*cf5a6c84SAndroid Build Coastguard Worker 4935*cf5a6c84SAndroid Build Coastguard Worker<p>I rewrote od, cleaned up comm, documented the 4936*cf5a6c84SAndroid Build Coastguard Worker<a href=code.html#lib_llist>llist</a> and 4937*cf5a6c84SAndroid Build Coastguard Worker<a href=code.html#lib_dirtree>dirtree</a> infrastructure, added an -r option 4938*cf5a6c84SAndroid Build Coastguard Workerto date (and fixed a bug where -u wouldn't override /etc/localtime), 4939*cf5a6c84SAndroid Build Coastguard Workerfixed bugs in chmod +stw, fixed ls to show suid bits properly when the 4940*cf5a6c84SAndroid Build Coastguard Workercorresponding executable bit wasn't set, and worked around a longstanding 4941*cf5a6c84SAndroid Build Coastguard Workerglibc bug where static linking prevents stdout from automatically flushing 4942*cf5a6c84SAndroid Build Coastguard Workerpending output on exit.</p> 4943*cf5a6c84SAndroid Build Coastguard Worker 4944*cf5a6c84SAndroid Build Coastguard Worker<a name="25-06-2012" /><a href="#25-06-2012"><hr><h2><b>June 25, 2012</b></h2></a> 4945*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>"For a moment, nothing happened. Then, after a second or so, nothing continued to happen."</p><p>- The Hitchhiker's Guide to the Galaxy</p></blockquote> 4946*cf5a6c84SAndroid Build Coastguard Worker 4947*cf5a6c84SAndroid Build Coastguard Worker<p><a href=downloads/toybox-0.3.1.tar.bz2>Toybox 0.3.1</a> is based on commit 4948*cf5a6c84SAndroid Build Coastguard Worker<a href=http://landley.net/hg/toybox/shortlog/607>commit 607</a>. It's 4949*cf5a6c84SAndroid Build Coastguard Workermostly a bugfix release for ls -l (which was unhappy on targets other than 4950*cf5a6c84SAndroid Build Coastguard Workerx86-64), plus a new "date" from Andre Renaud and rewritten chgrp/chown which 4951*cf5a6c84SAndroid Build Coastguard Workernow support the full set of posix flags, plus a little work on the test 4952*cf5a6c84SAndroid Build Coastguard Workersuite and some more header tweaks towards eventual compatability with the 4953*cf5a6c84SAndroid Build Coastguard Workermusl libc.</p> 4954*cf5a6c84SAndroid Build Coastguard Worker 4955*cf5a6c84SAndroid Build Coastguard Worker<p>The todo list runneth over, but "release early, release often", so here 4956*cf5a6c84SAndroid Build Coastguard Workerit is. The roadmap and documentation are a bit behind, and I've got ~40 4957*cf5a6c84SAndroid Build Coastguard Workerpending submissions to review. I need to catch up...</p> 4958*cf5a6c84SAndroid Build Coastguard Worker</span> 4959*cf5a6c84SAndroid Build Coastguard Worker 4960*cf5a6c84SAndroid Build Coastguard Worker<a name="12-06-2012" /><a href="#12-06-2012"><hr><h2><b>June 12, 2012</b></h2></a> 4961*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>"For instance, on the planet Earth, man had always assumed that 4962*cf5a6c84SAndroid Build Coastguard Workerhe was more intelligent than dolphins because he had achieved so much - the 4963*cf5a6c84SAndroid Build Coastguard Workerwheel, New York, wars and so on - whilst all the dolphins had ever done was 4964*cf5a6c84SAndroid Build Coastguard Workermuck about in the water having a good time. But conversely, the dolphins had 4965*cf5a6c84SAndroid Build Coastguard Workeralways believed that they were far more intelligent than man - for precisely 4966*cf5a6c84SAndroid Build Coastguard Workerthe same reasons."</p><p>- The Hitchhiker's Guide to the Galaxy</p></blockquote> 4967*cf5a6c84SAndroid Build Coastguard Worker 4968*cf5a6c84SAndroid Build Coastguard Worker<p>It's well past time for <a href=downloads/toybox-0.3.0.tar.bz2>toybox 0.3.0</a>, 4969*cf5a6c84SAndroid Build Coastguard Workerso here it is, based 4970*cf5a6c84SAndroid Build Coastguard Workeron <a href=http://landley.net/hg/toybox/shortlog/595>commit 595</a>, and the 4971*cf5a6c84SAndroid Build Coastguard Workerstatically linked <a href=downloads/binaries>prebuilt binaries</a> should 4972*cf5a6c84SAndroid Build Coastguard Workeractually be statically linked this time (thanks Ashwini Sharma for spotting 4973*cf5a6c84SAndroid Build Coastguard Workerthat).</p> 4974*cf5a6c84SAndroid Build Coastguard Worker 4975*cf5a6c84SAndroid Build Coastguard Worker<p>It's hard to figure out where to cut a release, because development 4976*cf5a6c84SAndroid Build Coastguard Workerdoesn't stop. "Long before now" is the obviuos answer, of course. 4977*cf5a6c84SAndroid Build Coastguard WorkerThe project's maintainer also moved house during this development cycle, which 4978*cf5a6c84SAndroid Build Coastguard Workerthrew things off for a bit (so many boxes). Releases should hopefully be a bit 4979*cf5a6c84SAndroid Build Coastguard Workermore frequent from here on.</p> 4980*cf5a6c84SAndroid Build Coastguard Worker 4981*cf5a6c84SAndroid Build Coastguard Worker<p>The big things Rob worked on this time were the new dirtree (directory 4982*cf5a6c84SAndroid Build Coastguard Workertree traversal) infrastructure, and a complete rewrite of ls using that 4983*cf5a6c84SAndroid Build Coastguard Workerwhich should now implement all 26 posix options.</p> 4984*cf5a6c84SAndroid Build Coastguard Worker 4985*cf5a6c84SAndroid Build Coastguard Worker<p>Georgi Chorbadzhiyski added printenv, whoami, mkdir, mkfifo, chmod, chown, 4986*cf5a6c84SAndroid Build Coastguard Workerchgrp, and uniq. He also added fraction and extension support to sleep (so if 4987*cf5a6c84SAndroid Build Coastguard Workeryou need a quarter-second sleep, it can do that now), and fixed a build bug 4988*cf5a6c84SAndroid Build Coastguard Workeron slackware.</p> 4989*cf5a6c84SAndroid Build Coastguard Worker 4990*cf5a6c84SAndroid Build Coastguard Worker<p>Daniel Walter contributed a string to mode_t parser (in use by chmod and 4991*cf5a6c84SAndroid Build Coastguard Workermkdir -m). Ilya Kuzmich contributed comm. Elie De Brauwer added mountpoint, 4992*cf5a6c84SAndroid Build Coastguard Workervmstat, logname, login, and mktemp. Kevin Chase did some portability cleanups. 4993*cf5a6c84SAndroid Build Coastguard WorkerPere Orga fixed some documentation.</p> 4994*cf5a6c84SAndroid Build Coastguard Worker 4995*cf5a6c84SAndroid Build Coastguard Worker<p>The "tac" and "clear" commands are now normal commands instead of shell 4996*cf5a6c84SAndroid Build Coastguard Workerwrappers, and the header #includes have been cleaned up a bit to remove 4997*cf5a6c84SAndroid Build Coastguard Workerdeprecated functions and attempt to increase compatability with the bionic and 4998*cf5a6c84SAndroid Build Coastguard Workermusl C libraries, "tail" should now use lseek() for large files, and "id" got 4999*cf5a6c84SAndroid Build Coastguard Workersome cleanups and bugfixes.</p> 5000*cf5a6c84SAndroid Build Coastguard Worker 5001*cf5a6c84SAndroid Build Coastguard Worker<p>The new TOYBOX_FLOAT configuration option selects whether or not 5002*cf5a6c84SAndroid Build Coastguard Workerto include floating point support (for embedded targets where that's 5003*cf5a6c84SAndroid Build Coastguard Workerproblematic).</p> 5004*cf5a6c84SAndroid Build Coastguard Worker 5005*cf5a6c84SAndroid Build Coastguard Worker<p>Several random bugfixes: unshare() might actually build portably now, 5006*cf5a6c84SAndroid Build Coastguard Workeryes 'n' | cp -i should no longer bypass stdin and prompt via the tty, the 5007*cf5a6c84SAndroid Build Coastguard WorkerSUID support no longer drops permissions going through the toybox 5008*cf5a6c84SAndroid Build Coastguard Workermultiplexer command, and a bugfix to xargs -0 means it should no longer 5009*cf5a6c84SAndroid Build Coastguard Workersegfault. (I have a pending bug report about xargs not doing the full 5010*cf5a6c84SAndroid Build Coastguard Workerposix whitespace handling that -0 obsoleted, but I'll deal with that next 5011*cf5a6c84SAndroid Build Coastguard Workerrelease.)</p> 5012*cf5a6c84SAndroid Build Coastguard Worker 5013*cf5a6c84SAndroid Build Coastguard Worker<p>The build infrastructure is now automatically generating FLAG_ macros 5014*cf5a6c84SAndroid Build Coastguard Workerfor the options, but currently with the wrong names. Some more macro glue 5015*cf5a6c84SAndroid Build Coastguard Workeris necessary, which I haven't quite figured out how to do yet.</p> 5016*cf5a6c84SAndroid Build Coastguard Worker 5017*cf5a6c84SAndroid Build Coastguard Worker<p>A defconfig toybox at the start of the $PATH has successfully built 5018*cf5a6c84SAndroid Build Coastguard WorkerLinux From Scratch (in my Aboriginal Linux project). The commands that 5019*cf5a6c84SAndroid Build Coastguard Worker'default n' in the config are often still broken, cleanup is ongoing. 5020*cf5a6c84SAndroid Build Coastguard Worker(The new dirtree stuff broke several of them that haven't been converted 5021*cf5a6c84SAndroid Build Coastguard Workeryet, but if I wait until everything works we won't have a release before 5022*cf5a6c84SAndroid Build Coastguard Worker1.0, so here's a checkpoint.)</p> 5023*cf5a6c84SAndroid Build Coastguard Worker 5024*cf5a6c84SAndroid Build Coastguard Worker 5025*cf5a6c84SAndroid Build Coastguard Worker<a name="03-03-2012" /><a href="#03-03-2012"><hr><h2><b>March 3, 2012</b></h2></a> 5026*cf5a6c84SAndroid Build Coastguard Worker 5027*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p>"They went unnoticed at Goonhilly, passed over Cape Canaveral 5028*cf5a6c84SAndroid Build Coastguard Workerwithout a blip, and Woomera and Jodrell Bank looked straight through them. 5029*cf5a6c84SAndroid Build Coastguard WorkerWhich was a pity, because it was exactly the sort of thing they'd been looking 5030*cf5a6c84SAndroid Build Coastguard Workerfor all these years."</p><p>- The Hitchhiker's Guide to the Galaxy</p> 5031*cf5a6c84SAndroid Build Coastguard Worker</p></blockquote> 5032*cf5a6c84SAndroid Build Coastguard Worker 5033*cf5a6c84SAndroid Build Coastguard Worker<p>Here's <a href=downloads/toybox-0.2.1.tar.bz2>toybox 0.2.1</a> based 5034*cf5a6c84SAndroid Build Coastguard Workeron <a href=http://landley.net/hg/toybox/shortlog/512>commit 512</a>. This 5035*cf5a6c84SAndroid Build Coastguard Workertime around, there are statically linked <a href=downloads/binaries>prebuilt 5036*cf5a6c84SAndroid Build Coastguard Workerbinaries</a> for various embedded targets.</p> 5037*cf5a6c84SAndroid Build Coastguard Worker 5038*cf5a6c84SAndroid Build Coastguard Worker<p>It's been a busy few weeks, almost entirely due to new contributors. (I 5039*cf5a6c84SAndroid Build Coastguard Workerhave not quite been keeping up.)</p> 5040*cf5a6c84SAndroid Build Coastguard Worker 5041*cf5a6c84SAndroid Build Coastguard Worker<p>Elie De Brauwer contributed free, uptime, swapon, swapoff, lsmod, mknod, 5042*cf5a6c84SAndroid Build Coastguard Workerinsmod, rmmod, and fixed a bug in basename. Andre Renaud contributed ls, ln, 5043*cf5a6c84SAndroid Build Coastguard Workerrealpath, and hostname. Andres Heck contributed pidof and killall. Daniel 5044*cf5a6c84SAndroid Build Coastguard WorkerWalter wrote kill and extended id. Timothy Elliott contributed tail and tests 5045*cf5a6c84SAndroid Build Coastguard Workerfor cmp. Frank Bergmann sent a warning fix. Bryce Fricke added -i to cp. 5046*cf5a6c84SAndroid Build Coastguard WorkerNathan McSween pointed out an optimization. Georgi Chorbadzhiyski fixed 5047*cf5a6c84SAndroid Build Coastguard Workercross compiling to work more reliably.</p> 5048*cf5a6c84SAndroid Build Coastguard Worker 5049*cf5a6c84SAndroid Build Coastguard Worker<p>(My own contribution this time around was just tightening up other people's 5050*cf5a6c84SAndroid Build Coastguard Workercode, a build fix to unshare, some random bugfixes, and so on. My only new 5051*cf5a6c84SAndroid Build Coastguard Workercode this time around was writing a bash replacement for the existing python 5052*cf5a6c84SAndroid Build Coastguard Workerbloat-o-meter.)</p> 5053*cf5a6c84SAndroid Build Coastguard Worker 5054*cf5a6c84SAndroid Build Coastguard Worker<p>Last time (the 0.2.0 release) included the first pass at an id command from 5055*cf5a6c84SAndroid Build Coastguard WorkerTim Bird, env and basename from Tryn Mirell, cmp and head from Timothy Elliott, 5056*cf5a6c84SAndroid Build Coastguard Workermore bugfixes from Nathan McSween and Elie De Brauwer, and Luis Felipe Strano 5057*cf5a6c84SAndroid Build Coastguard WorkerMoraes did a first pass at the who command plus other bugfixes and 5058*cf5a6c84SAndroid Build Coastguard Workeroptimizations.</p> 5059*cf5a6c84SAndroid Build Coastguard Worker 5060*cf5a6c84SAndroid Build Coastguard Worker<p>(For that release I did xargs, cal, truncate, unlink, nohup, tty, wc, link, 5061*cf5a6c84SAndroid Build Coastguard Workerdirname, unshare, and various infrastructure tweaks, but it took me 3 months 5062*cf5a6c84SAndroid Build Coastguard Workerand those guys did their stuff in a week or so.)</p> 5063*cf5a6c84SAndroid Build Coastguard Worker 5064*cf5a6c84SAndroid Build Coastguard Worker 5065*cf5a6c84SAndroid Build Coastguard Worker<a name="12-02-2012" /><a href="#12-02-2012"><hr><h2><b>February 12, 2012</b></h2></a> 5066*cf5a6c84SAndroid Build Coastguard Worker<blockquote><p> 5067*cf5a6c84SAndroid Build Coastguard Worker"for though it has many omissions and contains much that is apocryphal, or at 5068*cf5a6c84SAndroid Build Coastguard Workerleast wildly inaccurate, it scores over the older, more pedestrian work in two 5069*cf5a6c84SAndroid Build Coastguard Workerimportant respects..."</p> 5070*cf5a6c84SAndroid Build Coastguard Worker<p> - The Hitchhiker's Guide to the Galaxy</p></blockquote> 5071*cf5a6c84SAndroid Build Coastguard Worker 5072*cf5a6c84SAndroid Build Coastguard Worker<p>Here's the first BSD licensed release, 5073*cf5a6c84SAndroid Build Coastguard Worker<a href=downloads/toybox-0.2.0.tar.bz2>toybox-0.2.0</a>, more a synchronization 5074*cf5a6c84SAndroid Build Coastguard Workerpoint than anything particularly useful. 47 commands in a reasonably 5075*cf5a6c84SAndroid Build Coastguard Workerready-to-use state (what "make defconfig" builds), another ten or so partially 5076*cf5a6c84SAndroid Build Coastguard Workerfinished stubs ("make allyesconfig"), and several 5077*cf5a6c84SAndroid Build Coastguard Workerpatches pending on the mailing list I need to review and merge.</p> 5078*cf5a6c84SAndroid Build Coastguard Worker 5079*cf5a6c84SAndroid Build Coastguard Worker<p>More to come...</p> 5080*cf5a6c84SAndroid Build Coastguard Worker 5081*cf5a6c84SAndroid Build Coastguard Worker<hr> 5082*cf5a6c84SAndroid Build Coastguard Worker<a name="15-11-2011" /><a href="#15-11-2011"><hr><h2><b>November 15, 2011</b></h2></a> 5083*cf5a6c84SAndroid Build Coastguard Worker- Back from the dead, Toybox is now under a 2 5084*cf5a6c84SAndroid Build Coastguard Workerclause BSD license, and aiming to become the default command line 5085*cf5a6c84SAndroid Build Coastguard Workerimplementation of Android systems everywhere.</p> 5086*cf5a6c84SAndroid Build Coastguard Worker 5087*cf5a6c84SAndroid Build Coastguard Worker<p>More to come...</p> 5088*cf5a6c84SAndroid Build Coastguard Worker 5089*cf5a6c84SAndroid Build Coastguard Worker<hr> 5090*cf5a6c84SAndroid Build Coastguard Worker 5091*cf5a6c84SAndroid Build Coastguard Worker<p><a href=oldnews.html>Old news</a> from before the relaunch.</p> 5092*cf5a6c84SAndroid Build Coastguard Worker 5093*cf5a6c84SAndroid Build Coastguard Worker<!--#include file="footer.html" --> 5094