Skip to content

Commit c62d8a9

Browse files
committed
Release 0.8.9
1 parent e352f70 commit c62d8a9

File tree

2 files changed

+218
-1
lines changed

2 files changed

+218
-1
lines changed

toys.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,5 @@ extern char **environ, *toybox_version, toybuf[4096], libbuf[4096];
134134
#ifndef TOYBOX_VENDOR
135135
#define TOYBOX_VENDOR ""
136136
#endif
137-
#define TOYBOX_VERSION "0.8.8"TOYBOX_VENDOR
137+
#define TOYBOX_VERSION "0.8.9"TOYBOX_VENDOR
138138
#endif

www/news.html

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,223 @@
88

99
<h2>News</h2>
1010

11+
<a name="08-01-2023" /><a href="#08-01-2023"><hr><h2><b>January 8, 2023</b></h2></a>
12+
<blockquote>
13+
<p>"Why," Arthur said, "is there a sofa in that field?"</br>
14+
"I told you!" shouted Ford, leaping to his feet. "Eddies in the space-time
15+
continuum!"</br>
16+
"And this is his sofa, is it?"</p>
17+
<p>- The Hitchhiker's Guide to the Galaxy</p>
18+
</p></blockquote>
19+
20+
<p><a href=downloads/toybox-0.8.9.tar.gz>Toybox 0.8.9</a>
21+
(<a href=https://github.com/landley/toybox/releases/tag/0.8.9>git commit</a>)
22+
is out, with prebuilt <a href=downloads/binaries/0.8.9>static binaries</a> and
23+
<a href=downloads/binaries/mkroot/0.8.9>mkroot images</a>
24+
bootable under QEMU (built using a <a href=https://github.com/landley/linux/tree/mkroot-6.1>lightly patched</a> linux-6.1).</p>
25+
26+
<p>The new <b>nbd-server</b> command interoperates with nbd-client to serve
27+
network block devices (using the v1 protocol), and Moritz Weber contributed a read-only <b>git</b>
28+
implementation to pending.</p>
29+
30+
<p><u>Features</u>: New <b>grep</b> fast path for fixed or simple patterns that
31+
don't need the full regex engine (I.E. "^", ".", "$" but not "*" or "[]")
32+
most noticeable when searching for many patterns at once.
33+
Improved <b>tar --xform</b> support parsing flags= and trailing s/// scope
34+
flags (but using --xform now requires toybox sed in the $PATH).</p>
35+
36+
<p>Added <b>sort -C</b>, <b>lsusb -i</b>, <b>netcat -n</b>,
37+
<b>swapoff -a -v</b>, <b>httpd -v</b>, <b>nbd-client -b</b>,
38+
a <b>uname -p</b> stub to mollify package builds,
39+
<b>sleep</b> accepts multiple arguments,
40+
<b>sed</b> now parses interlaced -e and -f arguments in order,
41+
several new options in <b>readlink</b> and <b>realpath</b> (and better
42+
handling of relative paths), and UDP mode in netcat is more useful now:
43+
<b>netcat -u -s 127.0.0.1 -p 9876 -l</b> can type at <b>netcat -u 127.0.0.1 9876</b>
44+
in both directions. (Figuring out when the other side hangs up is an unsolved
45+
problem, but that's UDP for you.)
46+
Elliott added <b>ls -N</b>.</p>
47+
48+
<p><u>Bugfixes</u>: Fixed off by one error in <b>sort -c</b> output,
49+
fixed <b>sed -z</b> and other sed cases where Linux has never obeyed
50+
Posix (N at EOF does a default print, l escapes \n),
51+
<b>patch --dry-run</b> should no longer create or delete files,
52+
<b>gzip</b>/<b>zcat</b> couldn't handle concatenated archives,
53+
the ./configure of gmake 4.3 depends on <b>test</b> treating one argument -a as a synonym for -e,
54+
autodetectiong compression types in <b>tar</b> should be more reliable now
55+
and sanitize weird path corner cases (like .. past /) better,
56+
<b>scripts/make.sh</b> (and thus "make toybox") should no longer truncate log
57+
files stderr is redirected to,
58+
<b>httpd</b> now handles ? and # in URLs,
59+
<b>xxd</b> disables columns for -c 0 and groups for -g 0 (so you can get
60+
a long interrupted string of hex digits out of it), two fixes to
61+
<b>mountpoint</b> (the conversion to same_file() was inappropriate because
62+
the logic isn't quite the same, and -q should also quiet "not found" errors),
63+
fixed <b>httpd</b> not always displaying index.html files instead of directory
64+
contents, fixed <b>comm -</b> not recognizing it as stdin, and multiple fixes to
65+
<b>timeout</b> which now kills process group and thus child processes,
66+
isn't suspended by SIGTTIN, and recursive commands it calls don't
67+
inherit an inappropriate SIGCHLD handler.</p>
68+
69+
<p>Yi-Yo Chiang fixed loopback <b>mount</b> (the recent switch to xrunread()
70+
kept the newline from losetup's output) and added <b>tail +123</b>
71+
(old-style synonym for tail -n +123).
72+
Daniel Mentz added scmversion to the <b>modinfo</b> tag list (Android uses
73+
it for external modules). Alexander Holler fixed <b>su</b> to not require
74+
/etc/shadow when run as root, and nomas2000 reported an inverted test in
75+
<b>date</b>'s check for trailing rubbish. Daniel Mentz fixed an off by
76+
one in <b>grep -f</b> that discarded the last character of the pattern file's
77+
contents. Kelvin Zhang made <b>modinfo</b> better at handling symlinks.
78+
Antoni Villalonga fixed <b>fmt</b> on 64 bit big endian systems (like s390x and
79+
powerpc). Li Cheng fixed <b>mount</b>'s type detection not autodetecting
80+
the need to bind mount files when type "none" was specified in fstab.
81+
Tomasz Sterna reported that <b>modprobe</b> resolving dependencies shouldn't
82+
feed a NULL pointer to the syscall's options arguments (the kernel goes -EWTF),
83+
and Vincent Donnefort made modprobe work when /proc/modules isn't available.</p>
84+
85+
<p><u>Library</u>:
86+
The TOYFLAG_ARGFAIL() exit value is now the default <b>error_msg()</b> sets,
87+
<b>sendfile()</b> now falls back to the read/write loop for any error (not just
88+
EINVAL, the kernel sends ENOSYS and EXDEV and who knows what else),
89+
<b>xgetrandom()</b> can now return arbitrary amounts of data (looping internally
90+
as necessary),
91+
<b>xwaitpid()</b> returns status 127 for cases (like bad PID) which don't
92+
return a status for the PID,
93+
several fixes to <b>xabspath()</b> as part of the readlink/realpath work,
94+
new <b>octal_deslash()</b> to remove octal escapes common in kernel strings
95+
(ala /proc/mounts),
96+
the <b>FLAG_x</b> macros always use a 64 bit type now (so you don't have to
97+
worry about toys.optflags &= ~FLAG_x; blanking the top 32 bits),
98+
replaced memcmp() with new library function <b>smemcmp()</b> to placate ASAN
99+
when returning first difference in known differing arguments of unequal length.
100+
Elliott added three more filesystem types to <b>fs_type_name()</b> which is
101+
used by <b>stat -f</b> and friends.</p>
102+
103+
<p><u>Mkroot</u>:
104+
New <b>scripts/test_mkroot.sh</b> runs each target under qemu to confirm
105+
1) it boots, 2) the block device works, 3) networking works, and 4) the clock is set
106+
reasonably. It runs them in parallel, with an httpd instance on the host to
107+
fetch a file from, and a timeout to detect hangs.
108+
New <b>scripts/root/overlay</b> package copies $OVERLAY directory into
109+
target filesystem, ala <b>scripts/mkroot.sh overlay OVERLAY=$PWD/blah</b>
110+
The init script now mounts any /dev/?da on /mnt and when /mnt/init exists
111+
sets $HANDOFF to that instead of running a shell prompt, so you can provide
112+
automated control images that run code in the emulator automatically. (The
113+
emulator process still when whatever $HANDOFF called exits.)</p>
114+
115+
<p>Some kernel changes finally made it upstream so we can drop workarounds
116+
for them, such as kernel commit
117+
<a href=https://github.com/torvalds/linux/commit/f8f0d06438e5>f8f0d06438e5</a>
118+
fixing the <a href=https://landley.net/notes-2014.html#13-08-2014>longstanding</a>
119+
"allnoconfig has =y" issue so miniconfig doesn't need to add a magic #comment
120+
line forcing a symbol OFF anymore. The remaining kernel patches (including
121+
several maintained locally but hadn't merged into mkroot) moved to a
122+
<a href=https://github.com/landley/linux/tree/mkroot-6.1>seperate repository</a>
123+
so mkroot.sh doesn't have to call sed on the build snapshot. (They're are also
124+
included in the mkroot binary release directory, and were all submitted to lkml
125+
months if not years ago.)</p>
126+
127+
<p>The host airlock setup (creating the temporary restricted environment
128+
mkroot builds packages in both so they don't pick up strange dependencies from
129+
the host, and to prove the build can use the toybox commands)
130+
removed a bunch of commands (dd, diff, vi, xzcat, ar, nm) no longer
131+
needed by the linux-6.1 build. The kernel patches also remove the need
132+
for gcc (it can use the "cc" symlink all modern distros install, and
133+
autodetects whether that points to gcc or clang) and bc (which is just
134+
<a href=https://landley.net/notes-2013.html#18-05-2013>generally obsolete</a>).
135+
Left those two in for one more release, but NEXT time building a vanilla
136+
kernel 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>
137+
and <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>
138+
may require you to add <b>HOST_EXTRA="gcc bc"</b> to the mkroot command line
139+
for the airlock build to add extra symlinks to root/build/airlock.</p>
140+
141+
<p>Added a kernel build for powerpc64 big endian,
142+
m68k and powerpc now support "run-qemu.sh -hda file.img", and m68k only
143+
has one /dev/?db (disabled Apple Desktop Bus in the config).
144+
Added basic module support (the kernel build saves modules in modules.cpio.gz
145+
so it can extract them when you rebuild the root filesystem but not the kernel)
146+
and added <b>scripts/root/tests</b> which (among other things) builds two
147+
innocuous modules that depend on each other (fscache and cachefiles) for
148+
modprobe/insmod testing that hopefully won't break anything else. (If
149+
there was a scripts/root/pending/ tests would be in it: it does not actually
150+
run the test suite under mkroot yet, because toysh needs work.)</p>
151+
152+
<p><u>Pending</u>: Elliott made <b>strace</b> build on 32-bit x86.
153+
James Farrell added <b>diff -f</b>.
154+
Alexander Holler fixed two parameter substitution bugs in <b>toysh</b>.
155+
Rob fixed assignment suppression, &amp;&amp; and || parsing, math
156+
priority, a number of ASAN test failures, untangled and commented the
157+
brace expansion logic, and other ongoing shell work.</p>
158+
159+
<p>A large rewrite of diff happened but couldn't be checked in unfinished
160+
because if people are using stuff out of pending, how do you do a pending for
161+
pending? (Meta-pending?)</p>
162+
163+
<p><u>Cleanup</u>:
164+
<b>cksum</b>, <b>od</b>, <b>file</b>, <b>getopt</b>, <b>gpiod</b>,
165+
<b>nbd-client</b>, better output messages for <b>host</b>,
166+
and make <b>base64</b> use line buffering.
167+
Moved -Wno-string-plus-int into portability.sh and had it only apply to
168+
clang. Moved num_cache() out of lib into netstat (its only user).</p>
169+
170+
<p>In the test suite plumbing, $SKIPNEXT was replaced by <b>$SKIP</b> holding
171+
a count that counts down with each test (so you can easily skip a block of
172+
tests). Fixed <b>txpect</b> to actually listen to error code (oops) and to not
173+
complain about multiple X. The old dochroot() and mkchroot() shell functions were removed from
174+
scripts/runtest.sh because they required root access to use (which mkroot
175+
does not). More conversion to use <b>testcmd</b> in individual command.tests
176+
(both to remove workarounds for shell builtins, and to be more concise).
177+
Remove redundant cleanup from several tests (which run as proper child processes
178+
now, and the work directory is deleted and recreated between each, so
179+
individual tests need less cleanup).</p>
180+
181+
<p><u>Portability</u>: More tests now pass on MacOS and FreeBSD
182+
(weird filesystems, root vs wheel group name, dealing with headers that
183+
define stdin as a macro and don't define PATH_MAX, the ancient bash in MacOS
184+
doesn't understand &amp;&gt;&gt;, won't let normal users use "chmod +s",
185+
symlinks don't have all permission bits set, no O_PATH and the Linux definition
186+
is used for something else, and so on), at least half of which Elliott did.
187+
Not sure we've quite got Mac and BSD
188+
doing "gmake test_singlecommand" right yet, but it's a lot closer.
189+
Added all the commands to <b>make bsd_defconfig</b> that compile on FreeBSD 13
190+
(which is no guarantee they WORK).
191+
ASAN=1 should work in more places now, including <b>make_test_command</b>.
192+
The build uses $CC insted of cc in more places, and doesn't apply $ASAN
193+
for $HOSTCC (the legacy kconfig/ directory stands no chance).</p>
194+
195+
Fedora inexplicably sticks \x09 style hex escapes into the dmesg output and
196+
expects them to be parsed.
197+
Android is still running the test suite under mksh which doesn't
198+
understand bashisms like &lt;(command). LLVM insisted that "ptr - 1" could
199+
never be NULL (demonstrably untrue) and needed some (unsigned long) typecasts
200+
to force it to actually do the math.
201+
Khem Raj aliased timer_settime to timer_settime64 when the first isn't
202+
available. Antoni Villalonga debianized some install paths and added
203+
a bunch of --longopt synonyms for existing options that package builds
204+
use.</p>
205+
206+
<p><u>Documentation</u>: The <a href=help.html>help page</a>
207+
generation logic (toybox help -av) now filter out invisible aliases and
208+
outputs "See command" for visible aliases, plus fixes for broken corner
209+
cases like <b>nohup --help</b>.
210+
The <a href=https://landley.net/toybox/git>local git repo</a>
211+
now has a simple index.html generated by a
212+
<a href=https://github.com/landley/toybox/blob/0.8.9/scripts/git-static-index.sh>small shell script</a>,
213+
linking to the <b>git format-patch</b> files for
214+
each commit, applicable via <b>git am</b>.</p>
215+
216+
<p>There was a
217+
<a href=https://github.com/landley/toybox/pull/244>bug report</a> that specifying the cross compiler prefix twice
218+
includes the prefix twice (ala CROSS_COMPILE=prefix- CC=prefix-cc results in
219+
prefix-prefix-cc) which is what happens when you ask it to do that, yes. It's now
220+
<a href=faq.html#cross>better documented</a>. (See also
221+
<a href=https://lkml.iu.edu/hypermail/linux/kernel/2202.0/01505.html>this kernel patch</a>.)</p>
222+
223+
<p>Yi-Yo Chiang's losetup fix spawned an email thread where the
224+
android developers <a href=http://lists.landley.net/pipermail/toybox-landley.net/2022-August/029139.html>explained</a> why Android doesn't (and can't)
225+
use devtmpfs. Rob forwarded a link to linux weekly news to see if he could get
226+
any attention from the kernel guys, but they didn't reply.</p>
227+
11228
<a name="12-08-2022" /><a href="#12-08-2022"><hr><h2><b>August 12, 2022</b></h2></a>
12229
<blockquote><p>
13230
Huge as office blocks, silent as birds. They hung in the air exactly the same

0 commit comments

Comments
 (0)