3 * Fairly massive restructuring of umount.c to deal with remounting
4 busy devices read-only. Adds a -r option to control that; it is
5 optionally compiled in with BB_FEATURE_REMOUNT
6 * Added a bunch of functions to mtab.c to interact with the
7 {get,set,end}mntent interface; as it turns out, those functions do
8 not appear to be re-entrant, and that causes a lot of problems with
9 the way umount was originally written.
10 * Makes init send TERM and KILL (instead of HUP and KILL) on reboot
11 to be more consistent with sysvinit
12 * Changes to init.c to use the new -r option to umount. Also increased
13 the sleep time between the time the TERM and KILL signals are sent
18 * cp.c, mv.c: removed, replaced by cp_mv.c which has been
19 extensively rewritten from the original cp.c.
20 * Also added a warning message to the `mv' usage string saying that
21 this is not GNU mv, and it will break hard links. cp also breaks
23 * ln.c: implemented `-n' switch, no-deref symlinks.
24 * include<sys/param.h>: and use PATH_MAX everywhere.
25 * busybox: File name buffer overrun guards to prevent future crashes.
26 - Always check exit status.
27 - Purge all use of `creat()', replace with `open()'.
29 - recursiveAction was overriding the value of
30 followLinks thus ignoring it.
31 - isDirectory now takes a followLinks boolean, updated all callers
32 - copyFile had the followLinks logic reversed.
33 * messages.c: New file. Put common error message strings all in
34 one place in an attempt to shrink the binary a little.
39 * Made tar creation support in busybox tar optional.
40 * You no longer _have_ to put a "-" in front of tar options.
41 * Tar could inadvertently change permissions and ownership on
42 certain directories pointed to by symlinks.
43 * Made grep and grep -h do the right thing wrt printing
44 the file name (it failed to print files names in many cases).
45 * Fix a namespace aliasing problem wereby if du was built in, the
46 symlink for both du and dutmp would be installed, or then rm was
47 built in, the symlinks for both rm and rmmod would be installed.
48 * Added a closelog() to init.c after loging -- fix thanks to
49 Taketoshi Sano <kgh12351@nifty.ne.jp>
50 * Rewrote and simplified logger. Added the "-t" option, and made it
51 behave itself a bit better.
52 * Optional support contributed by Ben Collins <bcollins@debian.org>
53 for the kernel init chroot patch by Werner Almesberger, which
54 allows init to chroot to a new device, and umount the old one.
55 * Fixed bug that wouldn't let one chown a symlink -- it would
56 always dereference before. -beppu
57 * Fixed a bug where init could have reference already freed memory.
58 Found and fixed by Taketoshi Sano <kgh12351@nifty.ne.jp>
59 * Several contributions from Friedrich Vedder <fwv@myrtle.lahn.de>
60 * Added (and documented) "-n" option for head -
61 * Cleanup for a number of usage messages -- also
62 contributed Friedrich Vedder <fwv@myrtle.lahn.de>
63 * Cosmetic fix to busybox.c (Don't print a comma at the
64 end of line if there are no more application names).
65 * Fixed a stupid bug in "head" option handling ("head -n"
67 * Moved commonly used functions "xmalloc()" and "exit()"
68 to utility.c (with proper #ifdef's).
69 * Created a tiny tail implementation, removing -c, -q, -v, and making
70 tail -f work only with a single file. This reduced tail
71 from 6k to 2.4k. The bigger/more featured tail can still be
72 had by disabling BB_FEATURE_SIMPLE_TAIL in dusybox.defs.h
73 * Ping now falls back to doing the right thing if /etc/protocols
75 * Fixed mount and umount. Previously they could leak loop device
76 allocations, causing the system to quickly run out. Fix for umount
77 by Ben Collins <bcollins@debian.org>, and mount was fixed by me.
78 * ls formatting on eight charactor user names fixed by
79 Randolph Chung <tausq@debian.org>.
80 * cp could, when copying symlinks, change permissions of the
81 files pointed to by the symlinks.
82 * Several fixes from Pavel Roskin <pavel_roskin@geocities.com>:
83 - `chown' with 1 argument displayed the error incorrectly
84 - `fdflush', `length' and `printf' crashed when run without arguments
85 - `fdflush' tried to flush itself using *argv
86 - added "skip" and "seek" to dd.
87 * swapoff -a was not working. Now it is.
88 * init did not cleanly unmount filesystems on reboot. Now it does.
94 * New Apps: wc, hostid, logname, tty, whoami, yes -- all contributed
95 by Edward Betts <edward@debian.org>
96 * Fixed a bug in both cp and mv preventing 'cp foo/README bar'
97 type commands (file in a directory to another directory)
99 * Fixed a logger bug that caused garbage to be written to the syslog
100 (unless you used busybox syslog, which hid the bug). Thanks
101 to Alex Holden <alex@linuxhacker.org> for the fix.
102 * /bin/true and /bin/false were echoing a blank line when run. Now fixed.
103 * mkdir -p would print an error when asked to mkdir an existing dir
104 with no interveining subdirectories.
105 * Fixed "syslogd -O" so that it works.
106 * Added -o loop option for mount, and support in umount for loop
107 devices. Support is toggled by MOUNT_LOOP feature -- Ben Collins
108 <bcollins@debian.org>
109 * Several fixes from Marco Pantaleoni <panta@prosa.it>
110 * compile in fullWrite() not only if BB_TAR is defined, but also
111 if BB_CP or BB_MV are (fullWrite() is referenced by copyFile())
112 * add some compiler optimizations to further reduce executable size
113 (as a side note, on my machines the largest code is generated by
114 gcc 2.95.2 with -Os ! The smallest by plain gcc 2.7.2.3 with -O2
116 * Compile no longer fails if busybox.def.h defines BB_FEATURE_LINUXRC
117 but not BB_INIT. (init_main used to be referenced, but not compiled)
118 * Fixed a bug in setting TERM for serial console support. TERM now
119 defaults to "ansi" for serial consoles.
120 * Fixed a bug in handling the CONSOLE env. variable for serial consoles.
122 -Erik Andersen, Jan 15, 2000
125 * New Apps: sort, uniq. -beppu
126 * New Apps: lsmod, rmmod -erik
127 * New Apps: fbset contributed by Randolph Chung <tausq@debian.org>.
128 * New App:: loadacm contributed by Peter Novodvorsky <petya@logic.ru>
129 for loading application character maps for Unicode fonts.
130 * Major init re-work. init now supports inittab (slightly different
131 but similar to sysvinit), allowing me to get all the policy out
132 of init and into the conf file. It works just fine without inittab
133 being present, but if you dont like the defautl behavior you can
134 now do something about it. Init is much cleaner as a result.
135 * Fixed an bug in syslogd causing it to stop after 20 minutes. -erik
136 * Fixed an embarrasing segfault in head -beppu
137 * Fixed the embarrasing failure of 'logger -p'. -erik
138 * Added the -s option to du -beppu
139 * Re-worked the source tree a bit so it will compile under glibc 2.0.7
140 with the 2.0.x Linux kernel.
141 * Added 'grep -q' thanks to a patch from "Konstantin Boldyshev"
143 * Grep -i previously failed on UPPER CASE patterns due to a silly
144 regexp implementation bug that is now fixed.
145 * Fixed a bug where tar would set, and then clear SGID and SUID bits.
146 * Fixed a bug where tar would not set the user and group on device
148 * Fixed a bug where tar would not restore the time to files.
149 * Fixed a major security problem with tar -- it changed ownership
150 of any file pointed to by a symlink to 777 (like say libc....)
152 * cp and mv were very broken when moving directories. I have rewritten
153 them so they should now work as expected.
154 * sed now supports addresses (numeric or regexp, with negation) and
155 has an append command, thanks to Marco Pantaleoni <panta@prosa.it>
156 * Fixed dmesg. It wasn't parsing its options (-n or -s) properly.
157 * Some cosmetic fixes to ls output formatting to make it behave more
159 * Fixed a stupid segfault in kill.
160 * Several fixes from Friedrich Vedder <fwv@myrtle.lahn.de>:
161 - Added gunzip -t, removed gunzip.c dead code,
162 - fixed several typos
163 - Glibc 2.0.7 and libc5 compile fixes
164 * Fixed a bug where 'mknod --help' would segfault.
167 -Erik Andersen, Jan 07, 2000
170 * New Apps: ping, hostname, and mkfifo contributed by Randolph Chung
171 <tausq@debian.org>. 3 items off the TODO list!
172 * I wrote free (just calls "cat /proc/meminfo").
173 * Added tail, based on tail from GNU textutils-1.19, but adjusted
174 to suit my evil purposes. Costs 6k. I'll make it smaller sometime.
175 * on reboot, init called 'umount -a -n', which caused errors
176 when BB_MTAB was not enabled. Changed to 'umount -a',
177 which does the right thing.
178 * init will now try to run /sbin/getty if it is present (for easy
179 integration with the about-to-be-released tinylogin.)
180 * kill now behaves itself properly, added 'kill -l' to list signals
181 * 'ls -l' was failing on long directories, since my_getid was leaking
182 one file descriptor per file. Oops.
183 * Fixed rebooting from init. I'd accidently left some debugging code in
184 which blocked reboots.
185 * Fixed reboot, halt (and added poweroff) such that they handle it when
186 init is not at PID 1 (like when running in an initrd).
187 * Added a prelinary du implementation. Some parameter parsing
188 stuff still needs to be added. -beppu (John Beppu <beppu@lineo.com>)
189 * Implemented tee. -beppu
190 * Implemented head. -beppu
192 -Erik Andersen, Dec 10, 1999
195 * Fixed a segfault in 'umount -a' when a badly formed /etc/fstab
197 * df will not exit on error, but will stat all mounted filesystems.
198 * Fixed tar so uid/gid/permissions on extracted tarballs will be correct.
199 * Fixed find -name so it properly uses shell wildcard patterns
200 (i.e. `*', `?', and `[]') instead of regular expressions, which
201 was causing some confusing and unexpected behavior.
202 * Added klogd to syslogd, so now the log will contain both system and
204 * syslogd now creates the /dev/log socket to make sure it is there, and
205 is actually a socket with the right permissions.
206 * I've taken a first step to making busybox not need the /proc
207 filesystem. Most apps don't need it. Those that _require_ it,
208 will complain if you enable them when you disable
209 BB_FEATURE_USE_PROCFS.
211 -Erik Andersen, Dec 5, 1999
214 * Wrote a micro syslogd, and a logger util (to log things to the syslog
215 from the command line or scripts) With both compiled in, costs 4k.
216 * Fixed 'make install' so symlinks are installed in their proper locations.
217 * Changed the build system slightly so that features can now be enabled
218 or disabled from the busybox.defs.h header file, without trying to
219 compile in a source file named after that featue (unless that file exists).
220 * Several options are now moved into busybox.defs.h
221 * Now 'rm -R' and 'rm -r' both work.
222 * dd now properly handles input beyond 1 block from stdin.
223 * Fixed a bug where tar unpacked everything a directories. Moved some code
224 from createPath into mkdir where it belonged, thereby making tar work properly.
225 * Fixed an off-by-one bug in cat. Given a list of file it wouldn't cat out the
226 last file in the list.
227 * Fixed 'ls -ln' so numeric group/uid are presented properly, and fixed 'ls -l'
228 so when uid/gid is not in /etc/{passwd,group} the numeric group/uid are
233 -Erik Andersen, Nov 25, 1999
236 * fixed dd so it properly defaults to stdin and stdout when no
237 if= and of= are set (fix thanks to Eric Delaunay).
238 * Don't try to close the file descriptor of a pipein tar. (fix also from
240 * Made createPath be quiet (again thanks to Eric Delaunay).
241 * If BB_CONSOLE_CMD_IF_RC_SCRIPT_EXITS is defined, then whatever
242 command you define it as will be run if the init script exits.
243 * Updated install.sh to make it more robust (thanks to Adam Di Carlo)
244 * NFS support added to mount by Eric Delaunay. It costs 10k when compiled
245 in, but that is still a big win for those that use NFS.
246 * Made 'rm -f' be silent for non-existant files (thanks to Eric Delaunay).
247 * changed zcat.c to gunzip.c. It now obeys the principle of least surprise
248 and acts as god intended gunzip and zcat to act. They answer --help and
250 * Fixed a bug in mv which caused it to not move files when the destination
252 * Fixed a decimal-instead-of-octal bug causing mkdir to make directories
253 with very wrong permissions.
254 * chmod would overwrite file permissions instead of modifying them.
255 Now it properly modifies permissions.
256 * Init now sends warnings destined for the console to /dev/console to ensure
257 they show up on whatever the active console it. Otherwise important
258 messages (for example that the system is rebooting) were not seen when
259 switched to a different VT.
261 -Erik Andersen, Nov 17, 1999
264 * gzip now obeys the principle of least surprise and acts like god intended
265 (i.e. it accepts a file name, answers --help, and obeys the '-c' flag
266 and only then outputs to stdout).
267 * Fixed more.c to compile autowidth on sparc and set initial winsize
268 to 0,0 in case the TIOCGWINSZ ioctl fails. Fix thanks to Eric Delaunay.
269 * Fixed tar so it now works as expected (it had TRUE/FALSE backwards)
270 * tar now accepts --help
271 * chmod, chown, and chgrp usage now works
272 * General usage (i.e. --help) cleanups for most apps
273 * umount now parses options correctly
274 * tar can now unpack tarballs containing device special files,
275 sockets, and fifos (though it can't pack them up) thanks
276 to Matt Porter. Creating archives containing these is still
277 left to the interested student.
278 * fixed up the license in more.c to properly point to Bruce Perens.
280 -Erik Andersen, Nov 11, 1999
283 * ls -l now displays link names outside the current directory,
284 Patch thanks to Eric Delaunay
285 * init now properly handles sparc serial consoles and does a
286 better job of finding the real console device rather than using
287 /dev/console which doesn't support job control. Patch also
288 thanks to Eric Delaunay.
289 * more started to read from stdin after the last file was finished, and
290 options were not parsed correctly (fix thanks to Eric Delaunay).
291 * more will now use the terminal size if BB_FEATURE_AUTOWIDTH is on.
292 * rm wouldn't remove a symlink unless the symlink was valid. This was
293 a side effect of the busybox 0.32 recursiveAction() fix. Things
294 should now work correctly.
295 * grep wouldn't grep stdin. Now it does.
296 * sed wouldn't sed stdin. Now it does.
297 * sed was appending a \n to the end of lines with replacements.
298 Now it doesn't do that.
299 * ls -l now bypasses libc6 nss when displaying user/group names.
300 Now uses my_getpwuid and my_getgrgid.
302 -Erik Andersen, Nov 8, 1999
305 * Fixed a bug where init could hang instead of rebooting.
306 * Removed some debugging noise from init.c
307 * Fixed ln so it works now (it was very broken).
308 * Fixed df so it won't segfault when there is no /etc/fstab,
309 * If BB_MTAB is not defined, df and mount will whine if /etc/fstab
310 is not installed (since they cannot fixup "/dev/root" to
311 state the real root device name)
312 * merged some redundant code from mtab.c/df.c into utility.c
314 -Erik Andersen, Nov 5, 1999
317 * More changes -- many thanks to Lineo for paying me to work on
318 busybox. If you have any problems please let me know ASAP
319 at andersen@lineo.com or andersee@debian.org
320 * usage() now prints the BusyBox version. This will help folks
321 realize that they are not in Kansas anymore.
322 * Fixed mkdir -m option so that it works.
323 * kill segfaulted w/o any arguments. Now it doesn't do that.
324 * kill wasn't properly accepting signal names. It does now.
325 * Added new apps chvt and deallocvt (I should probably add open)
326 * Major rewrite of init.c. Code is now readable by mere mortals IMHO.
327 * Wrote sed -- weighs only 1.8k (5.8k with full regular expressions!).
328 * Fixed a stupid seg-fault in sync
329 * Fixed mount -- mount -a failed to parse and apply mount options
330 * Fixed umount -n (patch thanks to Matthew Grant <grantma@anathoth.gen.nz>)
331 * umount -a no longer umounts /proc
332 * Added BB_MTAB, allowing (at the cost of ~1.5k and the need for a rw /etc)
333 folks to use a real /etc/mtab file instead of a symlink to /proc/mounts.
334 mount, and umount will add/remove entries and df will now use /etc/mtab
335 if BB_MTAB is defined.
336 * Fixed a nice bug in recursiveAction() which caused it to infinitely
337 hunt through /proc/../fd/* creating new file descriptors if it
338 followed the /dev/fd link over to /proc. recursiveAction() now
339 lstat's the file when followLinks==FALSE so it won't follow links
340 as the name suggests. Fix thanks to Matt Porter <porter@debian.org>.
343 -Erik Andersen, Nov 4, 1999
346 * I added a changelog for version 0.30.
347 * adjusted find internals to make it smaller, and removed
349 * Fixed a segfault in ps when /etc/passwd or /etc/group
350 are absent. Now will warn you and carry on.
351 * Added in optional _real_ regular expression support (to be
352 the basis for a future sed utility). When compiled in
353 it adds 3.9k, but makes grep much more capable.
354 * Checked out using nftw(3) for recursive stuff, but unfortunatly
355 it wasn't supported before GNU libc 2.1, and some folks use
356 glibc 2.0.7 since it is much smaller than that latest and greatest.
358 -Erik Andersen, Oct 21, 1999
361 Major changes -- lots of stuff rewritten. Many thanks to Lineo for
362 paying me to make these updates. If you have any problems with busybox,
363 or notice any bugs -- please let me know so I can fix it. These
367 * busybox can now invoke apps in two ways: via symlinks to the
368 busybox binary, and as 'busybox [function] [arguments]...'
369 * When invoked as busybox, the list of currently compiled in
370 functions is printed out (no this is not bloat -- the list
371 has to be there anyway to map invocation name to function).
372 * busybox no longer parses command lines for apps or displays their
373 usage info. Each app gets to handle (or not handle) this for
375 * Eliminated monadic, dyadic, descend, block_device, and
376 postprocess. It was cumbersome to have so many programs
377 cobbled together in this way. Without them, the app is much
379 * All shared code now lives in utility.c, and is properly
380 ifdef'ed to be only included for those apps requiring it.
381 * Eliminated struct FileInfo (the basis of monadic, dyadic, etc)
382 so now each app has the function prototype of (da-dum):
383 extern int foo_main(int argc, char** argv);
384 which speeds integration of new apps.
385 * Adjusted the Makefile to make it easier to
386 {en|dis}able debugging.
387 * Changed default compiler optimization to -Os
388 (optimize for smaller binaries).
391 * To cope with the new app function prototype and the removal of
392 monadic, dyadic, etc, the following apps were re-written:
393 * cat - Works same as always.
394 * chgrp, chmod, chown - rewrite. Combined into a single
395 source file. Absorbed patches from Enrique Zanardi <ezanard@debian.org>
396 that removes the dependency on libc6 libnss* libraries.
397 * cp - Can now do 'cp -a' can can copy devices,
398 pipes, symlinks, as well as recursive or non-recursive dir copies.
399 * fdflush - adjusted to remove dependancy on struct FileInfo.
400 * find - Now includes some basic regexp matching
401 which will be the basic of a future mini-sed.
402 * ln - Same functionality.
403 * mkdir - Added -p flag to feature set.
405 * rm - Added -f flag to feature set.
406 * rmdir - Same functionality.
407 * swapon, swapoff - Combined into a single binary. No longer
408 uses /etc/swaps. swap{on|off} -a uses /etc/fstab instead.
409 * touch - Same functionality.
410 * date - adjusted with a patch from Matthew Grant <grantma@anathoth.gen.nz>
411 to accomodate glibc timezone support. I then ripped out GNU getopt.
412 * mkswap -- new version merged from util-linux. Can now make >128Meg swaps.
413 * Replaced the old and star, unstar, and tarcat with the tar
414 implementation from sash. Now tar behaves as god intended
415 it to (i.e. tar -xvf <file> and tar -cf <file> <dir> work).
416 * dd -- rewritten. Can with with files, stdin, stdout.
417 * Added the following new apps:
418 * loadfont -- added from debian boot floppies
419 * chroot -- added based on a patch from Paolo Molaro <lupus@lettere.unipd.it>
420 * grep -- I just wrote it. Only matches simple strings
421 * ps -- I just wrote it. Has _no_ options at all, but works.
422 * fsck_minix, mkfs_minix -- added from util-linux, but I ripped out
423 internationalization and such to make them smaller.
424 * sfdisk -- Added from util-linux (minus internationalization and such).
425 * Probably some other changes that I forgot to document...
427 -Erik Andersen, Oct 20, 1999
430 This version was a messy pre-alpha. stay away or it will bite you.
431 -Erik Andersen, Sep 24, 1999
434 mini-netcat (mnc) rewritten.
437 Mount now supports -a, and -t auto.
438 Mount now updates mtab correctly for 'ro'.
439 More checks screen rows size, outputs bytes percentage.
440 Printf added as module.
442 Touch now creates files. -c option for no create.