Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
267b925bb4 | ||
|
|
aad0c53aa2 | ||
|
|
eb2a21f68d | ||
|
|
ce998051b4 | ||
|
|
2ecdbd9eb8 | ||
|
|
fe5bc552e6 | ||
|
|
d9ffc9caa6 | ||
|
|
62fda96120 | ||
|
|
75851b363b | ||
|
|
a97ef8eed4 | ||
|
|
41a82698c3 | ||
|
|
9019ed994f | ||
|
|
0eaef54878 | ||
|
|
f8d5b031c2 | ||
|
|
e5a1a23577 | ||
|
|
37ded2819b | ||
|
|
7f65e78f5c | ||
|
|
f295db8fbd | ||
|
|
9959ef4e2c | ||
|
|
cf969517dc | ||
|
|
64ef2d4cfa | ||
|
|
6a18de72c4 | ||
|
|
bf31a8c450 | ||
|
|
3f6bb561db | ||
|
|
2fd475509a | ||
|
|
93fc393486 | ||
|
|
6b4d645722 | ||
|
|
8ccef78172 | ||
|
|
018e9e8c0f | ||
|
|
9b2afe6dd6 | ||
|
|
3cba82678b | ||
|
|
b7090fda30 | ||
|
|
61a37e248d | ||
|
|
c960eda2eb | ||
|
|
c83f8e765d | ||
|
|
8fdaace1d9 | ||
|
|
43a6ed1171 | ||
|
|
170e4a7395 | ||
|
|
c4174b1b30 | ||
|
|
3b8b434e53 | ||
|
|
27656e1868 | ||
|
|
df73587122 | ||
|
|
59feb4b9bb | ||
|
|
b3d5dd7220 | ||
|
|
82c22aa311 | ||
|
|
afe07daf34 | ||
|
|
435680426e | ||
|
|
686a24b2f5 | ||
|
|
d85117bb85 | ||
|
|
6c8c51a470 | ||
|
|
4a5360b97e |
No files matched your search
@@ -1,5 +1,4 @@
|
||||
busybox
|
||||
busybox.links
|
||||
_install
|
||||
.config
|
||||
.menuconfig.log
|
||||
applet_source_list
|
||||
@@ -15,7 +15,7 @@ Erik Andersen <andersen@codepoet.org>, <andersee@debian.org>
|
||||
Edward Betts <edward@debian.org>
|
||||
expr, hostid, logname, tty, wc, whoami, yes
|
||||
|
||||
John Beppu <beppu@lineo.com>
|
||||
John Beppu <beppu@codepoet.org>
|
||||
du, head, nslookup, sort, tee, uniq
|
||||
|
||||
Brian Candler <B.Candler@pobox.com>
|
||||
@@ -79,7 +79,7 @@ Gyepi Sam <gyepi@praxis-sw.com>
|
||||
Linus Torvalds <torvalds@transmeta.com>
|
||||
mkswap, fsck.minix, mkfs.minix
|
||||
|
||||
Mark Whitley <markw@lineo.com> <markw@codepoet.org>
|
||||
Mark Whitley <markw@codepoet.org>
|
||||
grep, sed, cut, xargs, style-guide, new-applet-HOWTO, bug fixes, etc.
|
||||
|
||||
Charles P. Wright <cpwright@villagenet.com>
|
||||
|
||||
@@ -1,39 +1,222 @@
|
||||
0.61.pre
|
||||
0.60.5
|
||||
|
||||
Development Version
|
||||
Stable Release
|
||||
|
||||
Bugfixes:
|
||||
* Fixed a race that could cause init to hang
|
||||
* Fixed init orphan process reaping
|
||||
* Fixed init to always attempt to provide a controlling tty.
|
||||
This should fix most cases where ash would print
|
||||
"job control disabled" -- the other cases are user error.
|
||||
* Fixed 'gunzip -c' to not delete the source source file
|
||||
* Fixed a silly math problem in the time applet
|
||||
* Fixed 'cp -a' so it will once again copy symlinks properly
|
||||
* Fixed a long standing problem in tftp with freeing memory
|
||||
* Fixed Makefile largefile settings
|
||||
* Fixed a buffer overflow in vi
|
||||
* Cosmetic cleanups in lsmod, lash, init, swapon/off, and hostname
|
||||
* Set the close-on-exec flag on files opened by init
|
||||
* The updated top applet was backported from unstable
|
||||
* Several ash bugfixes were backported from unstable
|
||||
* Several warnings in ash, md5sum, and ifconfig
|
||||
|
||||
-Erik Andersen, 26 October 2002
|
||||
|
||||
|
||||
|
||||
New Applets:
|
||||
* Erik Andersen -- Merged several applets from tinylogin,
|
||||
namely adduser, addgroup, deluser, delgroup, getty.
|
||||
0.60.4
|
||||
|
||||
Stable Release
|
||||
|
||||
New Applets & New Features:
|
||||
* Added new a 'top' applet (by special request)
|
||||
* Lots of small uClinux adjustments
|
||||
|
||||
Bugfixes:
|
||||
* This release has _lots_ of bugfixes. See Changelog.full
|
||||
for the complete list of what was changed.
|
||||
|
||||
-Erik Andersen, 18 September 2002
|
||||
|
||||
|
||||
Other Changes:
|
||||
|
||||
* Vladimir Oleynik, Manuel Novoa III, Aaron Lehmann
|
||||
-- a whole bunch of ash size optimizations
|
||||
-- Fix for ash leading redirections (i.e. '2>/dev/null ls rubbish')
|
||||
* Rodney Brown <RDBrown@mira.net>
|
||||
-- Optimized gzip.c, shrinking it be ~1.5k
|
||||
0.60.3
|
||||
|
||||
Stable Release
|
||||
|
||||
New Applets & New Features:
|
||||
* Added new a 'time' applet (by special request)
|
||||
* Added new a 'losetup' applet
|
||||
* The tftp has been fixed to work
|
||||
* Default shell is now ash.
|
||||
* msh shell should work properly on mmu-less systems again
|
||||
* ls can now do color
|
||||
|
||||
Bugfixes:
|
||||
* Erik Andersen
|
||||
-- Hacked together a new time applet
|
||||
-- Fixed dangling comma in init.c (s390 arch only)
|
||||
-- Fixed more so when it is run on files in the procfs that
|
||||
claim 0 length, it will not do weird things i.e. more /proc/pci
|
||||
-- Copyright message cleanups. Fixed sash attributions.
|
||||
-- Backporting of fixes and general maintenance.
|
||||
-- Fixed several cases where reboot, halt, and poweroff would fail
|
||||
to function properly when Linux is booted into an initrd.
|
||||
-- Fixed a silly compile bug in cpio
|
||||
-- nslookup now works properly with uClibc, remove old workaround
|
||||
-- Added conv=noerror support to dd
|
||||
-- Fixed ash and msh cmdedit to properly account for the current
|
||||
PATH setting
|
||||
-- Document netcat options and add -e support
|
||||
-- Fixed insanely broken insmod endianness handling
|
||||
-- Update init.c for better syle conformance, properly detach from
|
||||
terminal when necessary, better code reuse, FIFO inittab file
|
||||
reading/executing, allow init to be halted and restarted, etc.
|
||||
-- Allow gunzip to work on multiple archives, add -v option
|
||||
-- Updated x86 optimizations to save over 10k.
|
||||
* Edward Betts
|
||||
-- added -x switch to du.c
|
||||
* Cliff L. Biffle
|
||||
-- Added memory usage to the ps listings
|
||||
* Przemyslaw Czerpak
|
||||
-- Made telnet 8-bit clean, handle screen size, and is now RFC
|
||||
compliant. Works nicely now.
|
||||
* Wolfgang Denk
|
||||
-- hush now supports shell loops (for, while, until) and control
|
||||
operators (||, &&)
|
||||
* Russ Dill
|
||||
-- Added an 'restart' inittab action, allowing init to re-exec
|
||||
itself (or call a script which calls pivot_root then exec...)
|
||||
* Larry Doolittle
|
||||
-- Made syslogd not give up when errno is EINTR
|
||||
* Geoffrey Espin
|
||||
-- support find -newer <file>
|
||||
* Robert Griebl
|
||||
-- Reworked modprobe so it now reads and uses modules.dep
|
||||
* Karl M. Hegbloom
|
||||
-- Fixed a silly bug where CONTEXT and EGREP_ALIAS were coupled.
|
||||
* Kevin Hilman
|
||||
-- Fixed memory corruption from long pathnames in /etc/fstab
|
||||
* J.W.Janssen
|
||||
-- color ls support!
|
||||
* Matt Kraai
|
||||
-- Fix sed s/[/]// handling (closes: #1208).
|
||||
-- Fix `-/bin/sh' invocation (closes: #1209).
|
||||
-- Fix ash exec (noted by Arne Bernin).
|
||||
-- Fix tar segfault when include list is empty and exclude list is
|
||||
not.
|
||||
-- Fix sed s/$/@/ handling (noted by Joshua Hudson).
|
||||
-- Fix opt type in dpkg (closes: #118975).
|
||||
* Magick
|
||||
-- made init run inittab command's in the order they show up
|
||||
in the inittab file (FIFO instead of LIFO).
|
||||
-- Fixed get_line_from_file() so that NULL is treated as end of
|
||||
line, thereby fixing cut, grep, sed, etc. when working on binary
|
||||
files or anything that might contain a NULL.
|
||||
-- Fixed wget to do DNS initial DNS lookups, and do that only once
|
||||
to avoid skipping to a different server when round-robin DNS is
|
||||
in use (bug found by Mike Coleman <mkc@mathdogs.com>)
|
||||
-- Several sed fixes
|
||||
-- Added new losetup applet
|
||||
* Ben Low
|
||||
-- allow tftp to work with stdin as well as stdout.
|
||||
* Frank P. MacLachlan <fpm-plutus@tgs.indyme.com> avoid a potential
|
||||
NULL pointer problem in mount.
|
||||
* Glenn McGrath
|
||||
-- gunzip was incorrectly reporting a failed crc and length
|
||||
(Discovered by Change, Shu-Hao). The problem was the bitbuffer
|
||||
needs to be unwound after decompression as it was eating into the
|
||||
crc/size field.
|
||||
-- Reworked wc.c to fix severe efficiency problems and make it
|
||||
smaller. When just counting file chars, simply stat the file
|
||||
instead of reading the whole thing. (Fixes Debian bug #103302)
|
||||
-- Updated dmalloc options
|
||||
* Manuel Novoa III
|
||||
-- rewrote get_last_path_component() so it would not be so
|
||||
horrible, and would behave correctly in several important corner
|
||||
cases.
|
||||
* Vladimir Oleynik
|
||||
-- reverse resolve network name and cache in route and ifconfig
|
||||
applets, fix print nslookup server name if compile without
|
||||
uClibc, fix route crashe 'route add', fix warnings compile
|
||||
networking and pwd_grp applets
|
||||
-- Fixed ash problem where ^C could be blocked
|
||||
-- Several command line editing updates (cmdedit now supports
|
||||
CTRL-K and CTRL-L, fixed a segfault, etc)
|
||||
-- Fixed ash problem where ^C could be blocked
|
||||
-- Several size optimizations for various applets
|
||||
* Tim Riker
|
||||
-- make ash prompt the same as other shells if cmdedit and
|
||||
fancyprompt are enabled.
|
||||
* Jeff Studer
|
||||
-- tftp now generates default values for localfilename and
|
||||
remotefilename based on provided file names when possible.
|
||||
* Stefan Soucek and Miles Bader
|
||||
-- Re-add mmu-less support to msh
|
||||
* Jim Treadway
|
||||
-- Fixed a buffer overflow in the local group handling code.
|
||||
-- Fixed a missing "\" in usage.h
|
||||
-- Made pidof not add trailing spaces
|
||||
-- Fixed msh bugs so things like "A = 1; B = `eval $A`; echo $B"
|
||||
can now work.
|
||||
* Mike Voytovich
|
||||
-- insmod big endian ARM support
|
||||
|
||||
|
||||
-Erik Andersen, 27 April 2002
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
0.60.2
|
||||
|
||||
Stable Release
|
||||
|
||||
* Please support busybox and help us buy busybox.net. See the
|
||||
(current) busybox webpage for details.
|
||||
|
||||
New Applets & New Features:
|
||||
* msh was reworked by Vladimir Oleynik's so it can handle things like
|
||||
for i in `ls *.c` ; do echo $i ; done
|
||||
unfortunately, this also means that msh is no-longer uClinux safe,
|
||||
and will require some surgery to make it use vfork() again.
|
||||
* Charles Steinkuehler <charles@steinkuehler.net> -- reworked hostname
|
||||
so it behaves as expected (backport from busybox unstable)
|
||||
|
||||
Known Problems
|
||||
none. :)
|
||||
|
||||
Bugfixes:
|
||||
* Erik Andersen
|
||||
-- Fixed grep -E and egrep so they actually behave as expected
|
||||
-- init cleanups and (theoretical) uClinux support
|
||||
-- Fixed large file (>2Gig) support (enable in the Makefile)
|
||||
-- Always enable test when a shell is enabled (least surprise)
|
||||
-- Made 'mount -a' use proc to avoid a static noauto list
|
||||
-- lots of source tree cleanups
|
||||
* Laurence Anderson
|
||||
-- Removed some traces of no-longer existant rpmunpack (which
|
||||
has been obsoleted by the rpm2cpio applet).
|
||||
-- Fixed unarchive.c to use the correct buffer when calling
|
||||
dirname, improve an error message, and plug some memory leaks.
|
||||
-- Fixed rpm2cpio.c mkfs_minix.c fsck_minix.c fbset.c to use
|
||||
standard types (s/u16/u_int16_t/g s/u32/u_int32_t/g etc)
|
||||
* ASA <llb@udm.net.ru> -- fixed ash handling of command line args
|
||||
when sourcing ('.') commands.
|
||||
* Ethan Benson <erbenson@alaska.net>
|
||||
-- Fix mount's noauto option to not automount as "usbdevfs"
|
||||
* David Kimdon <dwhedon@instant802.com> -- fixed md5sum binary sums
|
||||
* Matt Kraai
|
||||
-- Fix sed s/[/]// handling (noted by Dumas Patrice).
|
||||
-- Fix dirname(3) improper consts, allow libc version to override.
|
||||
-- Fixed invoking applets when their names contain a leading dash
|
||||
and a full pathname.
|
||||
-- Fix ash exec
|
||||
-- Fixed basename to be SUSv2 compliant (which specifies that the
|
||||
extension should stay if it is identical to the basename.
|
||||
-- Fixed rmdir, since SuS2 says rmdir must provide -p
|
||||
-- Fixed sed empty line substitutions (noted by Joshua Hudson).
|
||||
* Steve Merrifield <steve@labyrinth.net.au> -- make vi use xmalloc
|
||||
* Glenn McGrath
|
||||
-- dpkg cleanups, various bugfixes
|
||||
* Vladimir Oleynik
|
||||
-- Add support for `busybox --help APPLET'
|
||||
-- Fixed route so it properly displays all route entries
|
||||
-- Fix for ash leading redirections (i.e. '2>/dev/null ls rubbish')
|
||||
* Andrew Tipton <andrew@cadre5.com> -- enable vi cursor keys when in
|
||||
edit mode as vim does.
|
||||
|
||||
|
||||
-Erik Andersen, 20 November 2001
|
||||
|
||||
|
||||
-Erik Andersen, --not yet released--
|
||||
|
||||
|
||||
|
||||
@@ -57,8 +240,8 @@
|
||||
-- Fixed msh to support underscores in variable names.
|
||||
-- Fixed a sed problem with unsatisfied backrefs (the problem was
|
||||
noted by Martin Bene).
|
||||
-- Removed CONFIG_SH define entirely. Now one simply picks the shell
|
||||
or shells they want as CONFIG_<foo> in Config.h
|
||||
-- Removed BB_SH define entirely. Now one simply picks the shell
|
||||
or shells they want as BB_<foo> in Config.h
|
||||
-- Fixed head to use ferror(3) to check for errors, not errno.
|
||||
* Shu-Hao Chang <shuhao_chang@trend.com.tw>
|
||||
-- Fixed sed handling of multiple -e commands
|
||||
@@ -67,10 +250,10 @@
|
||||
* Jaspreet Singh <jsingh@somanetworks.com>
|
||||
-- Fixed both a segfault and cosmetic bug in route
|
||||
* Erik Andersen
|
||||
-- Made the insmod options CONFIG_FEATURE_NEW_MODULE_INTERFACE and
|
||||
CONFIG_FEATURE_OLD_MODULE_INTERFACE mutually exclusive
|
||||
-- Made the insmod options BB_FEATURE_NEW_MODULE_INTERFACE and
|
||||
BB_FEATURE_OLD_MODULE_INTERFACE mutually exclusive
|
||||
-- xgetcwd.c now includes sys/param.h to ensure PATH_MAX is defined
|
||||
-- Fixed a potential segfault with lash + CONFIG_FEATURE_CLEAN_UP
|
||||
-- Fixed a potential segfault with lash + BB_FEATURE_CLEAN_UP
|
||||
-- Removed uint64_t from dos2unix, avoiding C lib compat. problems.
|
||||
* Glenn McGrath
|
||||
-- Rewrite of tftp (commands match atftp, accepts -b, can use
|
||||
@@ -88,6 +271,8 @@
|
||||
-Erik Andersen, 23 August 2001
|
||||
|
||||
|
||||
|
||||
|
||||
0.60.0
|
||||
|
||||
Note:
|
||||
@@ -141,7 +326,7 @@
|
||||
* Matt Kraai
|
||||
-- Made tar read 20 512byte blocks at a time (like GNU tar)
|
||||
-- Allow msh.c assignments with the export and readonly commands.
|
||||
-- Added CONFIG_FEATURE_DEVFS to enable devfs device names.
|
||||
-- Added BB_FEATURE_DEVFS to enable devfs device names.
|
||||
-- Better devfs support
|
||||
-- Don't save/restore vi readonly flag if vi is compiled read-only.
|
||||
-- Reworked rdate option handling (is now smaller).
|
||||
@@ -322,7 +507,7 @@
|
||||
* Magnus Damm -- added a tftp applet
|
||||
* Magnus Damm -- powerpc support for busybox insmod.
|
||||
* David Douthitt -- fixed a build error in df.c when
|
||||
CONFIG_FEATURE_HUMAN_READABLE was disabled
|
||||
BB_FEATURE_HUMAN_READABLE was disabled
|
||||
* John Beppu -- wrote autodocifier.pl, which will be used to auto-
|
||||
generate the documentation from the source code, making life
|
||||
much simpler for all.
|
||||
@@ -429,7 +614,7 @@
|
||||
* Mark Whitley -- Updates to style guide
|
||||
* Mark Whitley -- Big cleanup in utility.c: style guide compliance,
|
||||
de-macro-ifying some variables and functions
|
||||
* Erik Andersen -- ls now honors CONFIG_FEATURE_AUTOWIDTH so it can find
|
||||
* Erik Andersen -- ls now honors BB_FEATURE_AUTOWIDTH so it can find
|
||||
the width and height of the console.
|
||||
* Erik Andersen -- insmod now ignores -L and accepts the -o option.
|
||||
* Erik Andersen -- updates so you can now select from the Makefile
|
||||
@@ -445,7 +630,7 @@
|
||||
0.48
|
||||
|
||||
* Glenn McGrath -- tar now supports uncompressing tar files,
|
||||
define CONFIG_FEATURE_TAR_GZIP to use the -z option.
|
||||
define BB_FEATURE_TAR_GZIP to use the -z option.
|
||||
* Matt Kraai -- fix all usage of TRUE and FALSE so all apps now
|
||||
return EXIT_SUCCESS or EXIT_FAILURE to the system.
|
||||
Now TRUE and FALSE are set to the C standard where TRUE=1.
|
||||
@@ -477,7 +662,7 @@
|
||||
GNU-date compatible
|
||||
* me -- Progress meter (optional) in wget
|
||||
* Doolittle/me -- programs invoked by full path name take
|
||||
precedence over applets unless CONFIG_FEATURE_SH_BUILTINS_ALWAYS_WIN
|
||||
precedence over applets unless BB_FEATURE_SH_BUILTINS_ALWAYS_WIN
|
||||
* Gaute B Strokkenes <gs234@cam.ac.uk> -- applets found using a
|
||||
binary search instead of linear search. Much faster!
|
||||
* new applets: cmp readlink
|
||||
@@ -599,7 +784,7 @@
|
||||
Arne Bernin <arne@matrix.loopback.org>
|
||||
* Fixed NFS so it supports 2.4.x kernels and NFSv3.
|
||||
* Brand, new versions of grep and sed which use libc regex routines,
|
||||
thanks to Mark Whitley <markw@lineo.com>. The hand-tooled
|
||||
thanks to Mark Whitley <markw@codepoet.org>. The hand-tooled
|
||||
"regexp.[ch]" files have been removed. Much help on these from
|
||||
Matt Kraai as well.
|
||||
|
||||
@@ -610,7 +795,7 @@
|
||||
0.45
|
||||
* Now compiles vs libc5 (which can save lots of space for
|
||||
embedded systems).
|
||||
* Added CONFIG_FEATURE_TRIVIAL_HELP which compiles out most all of the
|
||||
* Added BB_FEATURE_TRIVIAL_HELP which compiles out most all of the
|
||||
help messages (i.e --help). Saves 17k over a full compile.
|
||||
* Added cut and tr from minix, since due to the license change,
|
||||
we can now use minix code. Minix tr saves 4k.
|
||||
@@ -622,7 +807,7 @@
|
||||
* Added a mini ar archive utility, especially written for BusyBox by
|
||||
Glenn McGrath <bug1@netconnect.com.au>
|
||||
* Added mktemp, contributed by Daniel Jacobowitz <dan@debian.org>
|
||||
* Added setkeycodes, for those that have wierd keyboard buttons.
|
||||
* Added setkeycodes, for those that have weird keyboard buttons.
|
||||
* Added md5sum, uuencode and uudecode -- thanks to Alfred M. Szmidt
|
||||
<ams@trillian.itslinux.org> for contributing these.
|
||||
* Added 'grep -v' option (inverted search) and updated
|
||||
@@ -631,7 +816,7 @@
|
||||
* Replaced the telnet implementation with one written by
|
||||
Tomi Ollila <too@iki.fi> It works great and costs 3k.
|
||||
* BusyBox sh (lash) now supports being used as a standalone shell. When
|
||||
CONFIG_FEATURE_SH_STANDALONE_SHELL is defined, all the busybox commands may
|
||||
BB_FEATURE_SH_STANDALONE_SHELL is defined, all the busybox commands may
|
||||
be invoked as shell internals. Best used when compiling staticly
|
||||
(i.e. DOSTATIC=true)
|
||||
* BusyBox sh (lash) internals now behave as expected wrt pipes
|
||||
@@ -683,7 +868,7 @@
|
||||
* Fixed exit status for killall - Pavel Roskin
|
||||
* Fixed 'swapon -a' and 'swapoff -a', which were broken.
|
||||
* Fixed 'mount -a' so it works as expected.
|
||||
* Implemented 'ls -R' (enabled by enabling CONFIG_FEATURE_LS_RECURSIVE)
|
||||
* Implemented 'ls -R' (enabled by enabling BB_FEATURE_LS_RECURSIVE)
|
||||
* Implemented "ping -s", fixed error messages and argument parsing -
|
||||
Pavel Roskin
|
||||
* Syslogd will not go to background if "-n" is given. Better help
|
||||
@@ -721,7 +906,7 @@
|
||||
saving a bunch of memory (kernel /proc support is not thin). This
|
||||
is done by making use of some nice kernel patches I wrote up to
|
||||
support the features that busybox requires and that /proc usually
|
||||
provides. To enable this, turn on CONFIG_FEATURE_USE_DEVPS_PATCH and
|
||||
provides. To enable this, turn on BB_FEATURE_USE_DEVPS_PATCH and
|
||||
patch your kernel with the devps patch in the kernel-patches/
|
||||
directory.
|
||||
* Wrote basename, dirname, killall, and uptime.
|
||||
@@ -766,7 +951,7 @@
|
||||
* An initial telnet implementation was added by
|
||||
Randolph Chung <tausq@debian.org>.
|
||||
* Fixed a bug where "sed 's/foo/bar/g'" (i.e. a script w/o a "-e")
|
||||
* ps now supports CONFIG_FEATURE_AUTOWIDTH, and can adjust its width
|
||||
* ps now supports BB_FEATURE_AUTOWIDTH, and can adjust its width
|
||||
to match the terminal (defaults to width=79 when this is off).
|
||||
* ps now accepts (and ignores) all options except for "--help" (which
|
||||
as would be expected displays help).
|
||||
@@ -789,7 +974,7 @@
|
||||
|
||||
* Fairly massive restructuring of umount.c to deal with remounting
|
||||
busy devices read-only. Adds a -r option to control that; it is
|
||||
optionally compiled in with CONFIG_FEATURE_REMOUNT
|
||||
optionally compiled in with BB_FEATURE_REMOUNT
|
||||
* Added a bunch of functions to mtab.c to interact with the
|
||||
{get,set,end}mntent interface; as it turns out, those functions do
|
||||
not appear to be re-entrant, and that causes a lot of problems with
|
||||
@@ -860,7 +1045,7 @@
|
||||
* Created a tiny tail implementation, removing -c, -q, -v, and making
|
||||
tail -f work only with a single file. This reduced tail from 6k to
|
||||
2.4k. The bigger/more featured tail can still be had by disabling
|
||||
CONFIG_FEATURE_SIMPLE_TAIL in busybox.defs.h
|
||||
BB_FEATURE_SIMPLE_TAIL in busybox.defs.h
|
||||
* Ping now falls back to doing the right thing if /etc/protocols
|
||||
turns up missing.
|
||||
* Fixed mount and umount. Previously they could leak loop device
|
||||
@@ -912,14 +1097,14 @@
|
||||
devices. Support is toggled by MOUNT_LOOP feature -- Ben Collins
|
||||
<bcollins@debian.org>
|
||||
* Several fixes from Marco Pantaleoni <panta@prosa.it> compile in
|
||||
* fullWrite() not only if CONFIG_TAR is defined, but also
|
||||
if CONFIG_CP or CONFIG_MV are (fullWrite() is referenced by copyFile())
|
||||
* fullWrite() not only if BB_TAR is defined, but also
|
||||
if BB_CP or BB_MV are (fullWrite() is referenced by copyFile())
|
||||
* add some compiler optimizations to further reduce executable size
|
||||
(as a side note, on my machines the largest code is generated
|
||||
by gcc 2.95.2 with -Os ! The smallest by plain gcc 2.7.2.3 with
|
||||
-O2 -m386 ...)
|
||||
* Compile now won't fail if busybox.def.h defines
|
||||
CONFIG_FEATURE_INITRD but not CONFIG_INIT. (init_main used to be
|
||||
BB_FEATURE_LINUXRC but not BB_INIT. (init_main used to be
|
||||
referenced, but not compiled)
|
||||
* Fixed a bug in setting TERM for serial console support. TERM now
|
||||
defaults to "ansi" for serial consoles.
|
||||
@@ -979,7 +1164,7 @@
|
||||
to suit my evil purposes. Costs 6k. I'll make it smaller
|
||||
sometime.
|
||||
* on reboot, init called 'umount -a -n', which caused errors
|
||||
when CONFIG_MTAB was not enabled. Changed to 'umount -a', which does
|
||||
when BB_MTAB was not enabled. Changed to 'umount -a', which does
|
||||
the right thing.
|
||||
* init will now try to run /sbin/getty if it is present (for easy
|
||||
integration with the about-to-be-released tinylogin.)
|
||||
@@ -993,7 +1178,7 @@
|
||||
init is not at PID 1 (like when running in an initrd).
|
||||
* Added a prelinary du implementation. Some parameter parsing
|
||||
stuff still needs to be added. -beppu (John Beppu
|
||||
<beppu@lineo.com>)
|
||||
<beppu@codepoet.org>)
|
||||
* Implemented tee. -beppu Implemented head. -beppu
|
||||
|
||||
-Erik Andersen, Dec 10, 1999
|
||||
@@ -1014,7 +1199,7 @@
|
||||
* I've taken a first step to making busybox not need the /proc
|
||||
filesystem. Most apps don't need it. Those that _require_ it,
|
||||
will complain if you enable them when you disable
|
||||
CONFIG_FEATURE_USE_PROCFS.
|
||||
BB_FEATURE_USE_PROCFS.
|
||||
|
||||
-Erik Andersen, Dec 5, 1999
|
||||
|
||||
@@ -1052,7 +1237,7 @@
|
||||
* from
|
||||
Eric Delaunay).
|
||||
* Made createPath be quiet (again thanks to Eric Delaunay). If
|
||||
* CONFIG_CONSOLE_CMD_IF_RC_SCRIPT_EXITS is defined, then whatever
|
||||
* BB_CONSOLE_CMD_IF_RC_SCRIPT_EXITS is defined, then whatever
|
||||
command you define it as will be run if the init script exits.
|
||||
* Updated install.sh to make it more robust (thanks to Adam Di Carlo)
|
||||
* NFS support added to mount by Eric Delaunay. It costs 10k when
|
||||
@@ -1108,7 +1293,7 @@
|
||||
to Eric Delaunay.
|
||||
* more started to read from stdin after the last file was finished, and
|
||||
options were not parsed correctly (fix thanks to Eric Delaunay).
|
||||
* more will now use the terminal size if CONFIG_FEATURE_AUTOWIDTH is on.
|
||||
* more will now use the terminal size if BB_FEATURE_AUTOWIDTH is on.
|
||||
* rm wouldn't remove a symlink unless the symlink was valid. This was
|
||||
a side effect of the busybox 0.32 recursiveAction() fix. Things
|
||||
should now work correctly.
|
||||
@@ -1126,7 +1311,7 @@
|
||||
* Removed some debugging noise from init.c
|
||||
* Fixed ln so it works now (it was very broken).
|
||||
* Fixed df so it won't segfault when there is no /etc/fstab,
|
||||
* If CONFIG_MTAB is not defined, df and mount will whine if /etc/fstab
|
||||
* If BB_MTAB is not defined, df and mount will whine if /etc/fstab
|
||||
is not installed (since they cannot fixup "/dev/root" to
|
||||
state the real root device name)
|
||||
* merged some redundant code from mtab.c/df.c into utility.c
|
||||
@@ -1134,7 +1319,8 @@
|
||||
-Erik Andersen, Nov 5, 1999
|
||||
|
||||
0.32
|
||||
* More changes -- If you have any problems please let me know ASAP at
|
||||
* More changes -- many thanks to Lineo for paying me to work on
|
||||
busybox. If you have any problems please let me know ASAP at
|
||||
andersee@debian.org
|
||||
* usage() now prints the BusyBox version. This will help folks
|
||||
realize that they are not in Kansas anymore.
|
||||
@@ -1146,11 +1332,11 @@
|
||||
* with full regular expressions!). Fixed a stupid seg-fault in sync
|
||||
* Fixed mount -- mount -a failed to parse and apply mount options Fixed
|
||||
* umount -n (patch thanks to Matthew Grant <grantma@anathoth.gen.nz>)
|
||||
* umount -a no longer umounts /proc Added CONFIG_MTAB, allowing (at the
|
||||
* umount -a no longer umounts /proc Added BB_MTAB, allowing (at the
|
||||
* cost of ~1.5k and the need for a rw /etc)
|
||||
folks to use a real /etc/mtab file instead of a symlink to
|
||||
/proc/mounts. mount, and umount will add/remove entries and df
|
||||
will now use /etc/mtab if CONFIG_MTAB is defined.
|
||||
will now use /etc/mtab if BB_MTAB is defined.
|
||||
* Fixed a nice bug in recursiveAction() which caused it to infinitely
|
||||
hunt through /proc/../fd/* creating new file descriptors if it
|
||||
followed the /dev/fd link over to /proc. recursiveAction() now
|
||||
@@ -1177,9 +1363,10 @@
|
||||
-Erik Andersen, Oct 21, 1999
|
||||
|
||||
0.30
|
||||
Major changes -- lots of stuff rewritten. If you have any problems
|
||||
with busybox, or notice any bugs -- please let me know so I can fix
|
||||
it. These changes include:
|
||||
Major changes -- lots of stuff rewritten. Many thanks to Lineo for
|
||||
paying me to make these updates. If you have any problems with busybox,
|
||||
or notice any bugs -- please let me know so I can fix it. These
|
||||
changes include:
|
||||
|
||||
Core Changes:
|
||||
* busybox can now invoke apps in two ways: via symlinks to the
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
2002-10-27 Erik Andersen <andersen@dillweed>
|
||||
|
||||
* Makefile: Increment version number
|
||||
|
||||
* debian/control, debian/changelog: Update packaging info
|
||||
|
||||
2002-10-26 Erik Andersen <andersen@dillweed>
|
||||
|
||||
* debian/Config.h-udeb:
|
||||
Don't support init being run as /linux in the debian installer
|
||||
-Erik
|
||||
|
||||
* swaponoff.c: last_patch64 from vodz:
|
||||
|
||||
The following usage from original user:
|
||||
$ ./busybox swapon -a
|
||||
Have typo problem:
|
||||
swapon: swapon: Operation not permitted
|
||||
|
||||
But regular version:
|
||||
swapon: /dev/hda5: Operation not permitted
|
||||
|
||||
Patch attached, reduced 9 bytes and advanced
|
||||
exit code also.
|
||||
|
||||
* vi.c:
|
||||
A patch from Jouni Malinen to avoid some buffer overflows in vi,
|
||||
closing bug #1270
|
||||
|
||||
* Makefile: Ivan Popov noticed that handling of PREFIX was bad.
|
||||
-Erik
|
||||
|
||||
2002-10-25 Erik Andersen <andersen@dillweed>
|
||||
|
||||
* tftp.c: This patch from Magnus Damm fixed a long standing problem
|
||||
with freeing memory.
|
||||
|
||||
2002-10-23 Erik Andersen <andersen@dillweed>
|
||||
|
||||
* top.c: Backport vodz' reworked top applet from unstable
|
||||
|
||||
2002-10-22 Erik Andersen <andersen@dillweed>
|
||||
|
||||
* ash.c, ifconfig.c: Fix warnings
|
||||
|
||||
* md5sum.c: Fix undefined operation (temp = temp = <stuff>) and remove
|
||||
double definition.
|
||||
-Erik
|
||||
|
||||
* init.c: I committed the fflush in the wrong spot. I should go to bed
|
||||
earlier so I don't screw up such easy stuff.
|
||||
-Erik
|
||||
|
||||
* ash.c: Apply last_patch51_3 from vodz
|
||||
|
||||
* init.c: Be absurdly careful about flushing stdout.
|
||||
|
||||
2002-10-18 Erik Andersen <andersen@dillweed>
|
||||
|
||||
* tests/sh.testcases: Missed a spot
|
||||
|
||||
* tests/sh.testcases: disambiguate a test
|
||||
|
||||
* lsmod.c: Fixup some needless formatting differences vs modutils
|
||||
|
||||
* hostname.c:
|
||||
Fixup slight difference in 'hostname -d' behavior vs GNU hostname
|
||||
|
||||
2002-10-12 Erik Andersen <andersen@dillweed>
|
||||
|
||||
* init.c:
|
||||
After thinking about it, I think this patch from Matt Kraai is probably the
|
||||
best way to go. Sysvinit does not provide a controlling tty since it doesn't
|
||||
even try to open ttys for apps. We do. We we should _try_ to provide a
|
||||
controlling tty if possible, but we needn't freak out if it doesn't work. So
|
||||
we won't need to use openvt or similar, we'll just have init do the Right
|
||||
Thing(tm).
|
||||
|
||||
2002-10-08 Erik Andersen <andersen@dillweed>
|
||||
|
||||
* docs/.cvsignore: oops
|
||||
|
||||
* docs/.cvsignore, Makefile: Remove docs/busybox.pod on 'make clean'
|
||||
|
||||
* init.c:
|
||||
Patch from Ben Gamsa <ben@somanetworks.com> to handle it when orphaned
|
||||
processes are created faster than busybox init reaps them.
|
||||
|
||||
* lsmod.c: Fix missing \n noticed by Robert Schwebel
|
||||
|
||||
* debian/Config.h-udeb: Enable pidof
|
||||
|
||||
* libbb/copy_file.c:
|
||||
Doh! It turns out I broke 'cp -a' symlink handling. Oops. This fix, from
|
||||
Tollef Fog Heen <tollef@add.no> fixes my stupid thinko so that 'cp -a' once
|
||||
again copies symlinks properly.
|
||||
|
||||
2002-09-30 Erik Andersen <andersen@dillweed>
|
||||
|
||||
* usage.h: Fix docs
|
||||
|
||||
* lash.c:
|
||||
Use %m, not strerror (changing since strerror(err) was broken anyways)
|
||||
|
||||
* init.c: Set the close-on-exec flag, just to be safe
|
||||
|
||||
* time.c: Doh. We divide microseconds by 60?
|
||||
|
||||
2002-09-27 Erik Andersen <andersen@dillweed>
|
||||
|
||||
* time.c: Bug fix from Nitin Gupta <gupta@equator.com>
|
||||
|
||||
2002-09-26 Erik Andersen <andersen@dillweed>
|
||||
|
||||
* lash.c: Avoid calling exit() from within fork/vfork'ed processes.
|
||||
-Erik
|
||||
|
||||
2002-09-25 Erik Andersen <andersen@dillweed>
|
||||
|
||||
* init.c:
|
||||
Ignoring SIGCHLD causes a race leading to the occasional hang of init
|
||||
when init will wait() on itself in waitfor() when the child exits before
|
||||
init is scheduled to run. Letting init hang is very seriously bad.
|
||||
-Erik
|
||||
|
||||
2002-09-22 Erik Andersen <andersen@dillweed>
|
||||
|
||||
* Makefile: Fixup largefile settings.
|
||||
-Erik
|
||||
|
||||
2002-09-20 Erik Andersen <andersen@dillweed>
|
||||
|
||||
* gunzip.c: Doh! As noted by K.-P. Kirchdörfer" <kapeka@epost.de>,
|
||||
gunzip -c deletes the source source file! This fixes it.
|
||||
-Erik
|
||||
|
||||
* top.c: Don't leak FILEs
|
||||
|
||||
@@ -0,0 +1,494 @@
|
||||
/* vi: set sw=4 ts=4: */
|
||||
// This file defines the feature set to be compiled into busybox.
|
||||
// When you turn things off here, they won't be compiled in at all.
|
||||
//
|
||||
//// This file is parsed by sed. You MUST use single line comments.
|
||||
// i.e., //#define BB_BLAH
|
||||
//
|
||||
//
|
||||
// BusyBox Applications
|
||||
//#define BB_ADJTIMEX
|
||||
//#define BB_AR
|
||||
#define BB_ASH
|
||||
#define BB_BASENAME
|
||||
#define BB_CAT
|
||||
#define BB_CHGRP
|
||||
#define BB_CHMOD
|
||||
#define BB_CHOWN
|
||||
#define BB_CHROOT
|
||||
#define BB_CHVT
|
||||
#define BB_CLEAR
|
||||
//#define BB_CMP
|
||||
#define BB_CP
|
||||
//#define BB_CPIO
|
||||
#define BB_CUT
|
||||
#define BB_DATE
|
||||
//#define BB_DC
|
||||
#define BB_DD
|
||||
//#define BB_DEALLOCVT
|
||||
#define BB_DF
|
||||
#define BB_DIRNAME
|
||||
#define BB_DMESG
|
||||
//#define BB_DOS2UNIX
|
||||
//#define BB_DPKG
|
||||
//#define BB_DPKG_DEB
|
||||
//#define BB_DUTMP
|
||||
#define BB_DU
|
||||
//#define BB_DUMPKMAP
|
||||
#define BB_ECHO
|
||||
#define BB_ENV
|
||||
//#define BB_EXPR
|
||||
//#define BB_FBSET
|
||||
//#define BB_FDFLUSH
|
||||
#define BB_FIND
|
||||
#define BB_FREE
|
||||
//#define BB_FREERAMDISK
|
||||
//#define BB_FSCK_MINIX
|
||||
//#define BB_GETOPT
|
||||
#define BB_GREP
|
||||
#define BB_GUNZIP
|
||||
#define BB_GZIP
|
||||
#define BB_HALT
|
||||
#define BB_HEAD
|
||||
//#define BB_HOSTID
|
||||
//#define BB_HOSTNAME
|
||||
//#define BB_HUSH
|
||||
#define BB_ID
|
||||
//#define BB_IFCONFIG
|
||||
#define BB_INIT
|
||||
//#define BB_INSMOD
|
||||
#define BB_KILL
|
||||
#define BB_KILLALL
|
||||
#define BB_KLOGD
|
||||
//#define BB_LASH
|
||||
//#define BB_LENGTH
|
||||
#define BB_LN
|
||||
//#define BB_LOADACM
|
||||
//#define BB_LOADFONT
|
||||
//#define BB_LOADKMAP
|
||||
#define BB_LOGGER
|
||||
//#define BB_LOGNAME
|
||||
//#define BB_LOSETUP
|
||||
#define BB_LS
|
||||
#define BB_LSMOD
|
||||
//#define BB_MAKEDEVS
|
||||
//#define BB_MD5SUM
|
||||
#define BB_MKDIR
|
||||
//#define BB_MKFIFO
|
||||
//#define BB_MKFS_MINIX
|
||||
#define BB_MKNOD
|
||||
#define BB_MKSWAP
|
||||
//#define BB_MKTEMP
|
||||
#define BB_MODPROBE
|
||||
#define BB_MORE
|
||||
#define BB_MOUNT
|
||||
//#define BB_MSH
|
||||
//#define BB_MT
|
||||
#define BB_MV
|
||||
//#define BB_NC
|
||||
//#define BB_NSLOOKUP
|
||||
#define BB_PIDOF
|
||||
//#define BB_PING
|
||||
//#define BB_PIVOT_ROOT
|
||||
#define BB_POWEROFF
|
||||
//#define BB_PRINTF
|
||||
#define BB_PS
|
||||
#define BB_PWD
|
||||
//#define BB_RDATE
|
||||
//#define BB_READLINK
|
||||
#define BB_REBOOT
|
||||
//#define BB_RENICE
|
||||
#define BB_RESET
|
||||
#define BB_RM
|
||||
#define BB_RMDIR
|
||||
//#define BB_RMMOD
|
||||
//#define BB_ROUTE
|
||||
//#define BB_RPM2CPIO
|
||||
#define BB_SED
|
||||
//#define BB_SETKEYCODES
|
||||
#define BB_SLEEP
|
||||
#define BB_SORT
|
||||
//#define BB_STTY
|
||||
#define BB_SWAPONOFF
|
||||
#define BB_SYNC
|
||||
#define BB_SYSLOGD
|
||||
#define BB_TAIL
|
||||
#define BB_TAR
|
||||
//#define BB_TEE
|
||||
//#define BB_TEST
|
||||
//#define BB_TELNET
|
||||
//#define BB_TFTP
|
||||
//#define BB_TIME
|
||||
//#define BB_TOP
|
||||
#define BB_TOUCH
|
||||
//#define BB_TR
|
||||
//#define BB_TRACEROUTE
|
||||
#define BB_TRUE_FALSE
|
||||
#define BB_TTY
|
||||
//#define BB_UNIX2DOS
|
||||
//#define BB_UUENCODE
|
||||
//#define BB_UUDECODE
|
||||
#define BB_UMOUNT
|
||||
#define BB_UNIQ
|
||||
#define BB_UNAME
|
||||
//#define BB_UPDATE
|
||||
#define BB_UPTIME
|
||||
//#define BB_USLEEP
|
||||
//#define BB_VI
|
||||
//#define BB_WATCHDOG
|
||||
#define BB_WC
|
||||
//#define BB_WGET
|
||||
#define BB_WHICH
|
||||
#define BB_WHOAMI
|
||||
#define BB_XARGS
|
||||
#define BB_YES
|
||||
// End of Applications List
|
||||
//
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------
|
||||
// This is where feature definitions go. Generally speaking,
|
||||
// turning this stuff off makes things a bit smaller (and less
|
||||
// pretty/useful).
|
||||
//
|
||||
//
|
||||
// If you enabled one or more of the shells, you may select which one
|
||||
// should be run when sh is invoked:
|
||||
#define BB_FEATURE_SH_IS_ASH
|
||||
//#define BB_FEATURE_SH_IS_HUSH
|
||||
//#define BB_FEATURE_SH_IS_LASH
|
||||
//#define BB_FEATURE_SH_IS_MSH
|
||||
//
|
||||
// BusyBox will, by default, malloc space for its buffers. This costs code
|
||||
// size for the call to xmalloc. You can use the following feature to have
|
||||
// them put on the stack. For some very small machines with limited stack
|
||||
// space, this can be deadly. For most folks, this works just fine...
|
||||
//#define BB_FEATURE_BUFFERS_GO_ON_STACK
|
||||
// The third alternative for buffer allocation is to use BSS. This works
|
||||
// beautifully for computers with a real MMU (and OS support), but wastes
|
||||
// runtime RAM for uCLinux. This behavior was the only one available for
|
||||
// BusyBox versions 0.48 and earlier.
|
||||
//#define BB_FEATURE_BUFFERS_GO_IN_BSS
|
||||
//
|
||||
// Turn this on to use Erik's very cool devps, and devmtab kernel drivers,
|
||||
// thereby eliminating the need for the /proc filesystem and thereby saving
|
||||
// lots and lots memory for more important things. NOTE: If you enable this
|
||||
// feature, you _must_ have patched the kernel to include the devps patch that
|
||||
// is included in the busybox/kernel-patches directory. You will also need to
|
||||
// create some device special files in /dev on your embedded system:
|
||||
// mknod /dev/mtab c 10 22
|
||||
// mknod /dev/ps c 10 21
|
||||
// I emailed Linus and this patch will not be going into the stock kernel.
|
||||
//#define BB_FEATURE_USE_DEVPS_PATCH
|
||||
//
|
||||
// show verbose usage messages
|
||||
#define BB_FEATURE_VERBOSE_USAGE
|
||||
//
|
||||
// Use termios to manipulate the screen ('more' is prettier with this on)
|
||||
//#define BB_FEATURE_USE_TERMIOS
|
||||
//
|
||||
// calculate terminal & column widths (for more, ls, and telnet)
|
||||
#define BB_FEATURE_AUTOWIDTH
|
||||
//
|
||||
// show username/groupnames for ls
|
||||
#define BB_FEATURE_LS_USERNAME
|
||||
//
|
||||
// show file timestamps in ls
|
||||
#define BB_FEATURE_LS_TIMESTAMPS
|
||||
//
|
||||
// enable ls -p and -F
|
||||
#define BB_FEATURE_LS_FILETYPES
|
||||
//
|
||||
// sort the file names
|
||||
#define BB_FEATURE_LS_SORTFILES
|
||||
//
|
||||
// enable ls -R
|
||||
#define BB_FEATURE_LS_RECURSIVE
|
||||
//
|
||||
// enable ls -L
|
||||
#define BB_FEATURE_LS_FOLLOWLINKS
|
||||
//
|
||||
// Use color to identify different file types
|
||||
#define BB_FEATURE_LS_COLOR
|
||||
//
|
||||
// Disable for a smaller (but less functional) ping
|
||||
#define BB_FEATURE_FANCY_PING
|
||||
//
|
||||
// Make init use a simplified /etc/inittab file (recommended).
|
||||
#define BB_FEATURE_USE_INITTAB
|
||||
//
|
||||
//Enable init being called as /linuxrc
|
||||
#define BB_FEATURE_LINUXRC
|
||||
//
|
||||
//Have init enable core dumping for child processes (for debugging only)
|
||||
//#define BB_FEATURE_INIT_COREDUMPS
|
||||
//
|
||||
//Make sure nothing is printed to the console on boot
|
||||
//#define BB_FEATURE_EXTRA_QUIET
|
||||
//
|
||||
// enable syslogd -R remotehost
|
||||
#define BB_FEATURE_REMOTE_LOG
|
||||
//
|
||||
// enable syslogd -C
|
||||
//#define BB_FEATURE_IPC_SYSLOG
|
||||
//
|
||||
//Disable for a simple tail implementation (2.34k vs 3k for the full one).
|
||||
//Both provide 'tail -f', but this cuts out -c, -q, -s, and -v.
|
||||
#define BB_FEATURE_FANCY_TAIL
|
||||
//
|
||||
// Enable support for loop devices in mount
|
||||
#define BB_FEATURE_MOUNT_LOOP
|
||||
//
|
||||
// Enable support for a real /etc/mtab file instead of /proc/mounts
|
||||
//#define BB_FEATURE_MTAB_SUPPORT
|
||||
//
|
||||
// Enable support for mounting remote NFS volumes.
|
||||
// You may need to mount with "-o nolock" if you are
|
||||
// not running a local portmapper daemon...
|
||||
//
|
||||
// If you are using uClibc, be sure that you've already compiled
|
||||
// uClibc with INCLUDE_RPC=true (contained in the Config file)
|
||||
//#define BB_FEATURE_NFSMOUNT
|
||||
//
|
||||
// Enable support forced filesystem unmounting
|
||||
// (i.e., in case of an unreachable NFS system).
|
||||
#define BB_FEATURE_MOUNT_FORCE
|
||||
//
|
||||
// Enable support for creation of tar files.
|
||||
#define BB_FEATURE_TAR_CREATE
|
||||
//
|
||||
// Enable support for "--exclude" and "-X" for excluding files
|
||||
#define BB_FEATURE_TAR_EXCLUDE
|
||||
//
|
||||
// Enable support for tar -z option (currently only works for inflating)
|
||||
#define BB_FEATURE_TAR_GZIP
|
||||
//
|
||||
// Enable reverse sort
|
||||
#define BB_FEATURE_SORT_REVERSE
|
||||
//
|
||||
// Enable uniqe sort
|
||||
#define BB_FEATURE_SORT_UNIQUE
|
||||
//
|
||||
// Enable command line editing in the shell.
|
||||
// Only relevant if a shell is enabled. On by default.
|
||||
#define BB_FEATURE_COMMAND_EDITING
|
||||
//
|
||||
// Enable tab completion in the shell. This is now working quite nicely.
|
||||
// This feature adds a bit over 4k. Only relevant if a shell is enabled.
|
||||
#define BB_FEATURE_COMMAND_TAB_COMPLETION
|
||||
//
|
||||
// Attempts to match usernames in a ~-prefixed path
|
||||
//#define BB_FEATURE_COMMAND_USERNAME_COMPLETION
|
||||
//
|
||||
//Allow the shell to invoke all the compiled in BusyBox applets as if they
|
||||
//were shell builtins. Nice for staticly linking an emergency rescue shell,
|
||||
//among other things. Off by default.
|
||||
// Only relevant if a shell is enabled.
|
||||
//#define BB_FEATURE_SH_STANDALONE_SHELL
|
||||
//
|
||||
//When this is enabled, busybox shell applets can be called using full path
|
||||
//names. This causes applets (i.e., most busybox commands) to override
|
||||
//real commands on the filesystem. For example, if you run run /bin/cat, it
|
||||
//will use BusyBox cat even if /bin/cat exists on the filesystem and is _not_
|
||||
//busybox. Some systems want this, others do not. Choose wisely. :-) This
|
||||
//only has meaning when BB_FEATURE_SH_STANDALONE_SHELL is enabled.
|
||||
// Only relevant if a shell is enabled. Off by default.
|
||||
//#define BB_FEATURE_SH_APPLETS_ALWAYS_WIN
|
||||
//
|
||||
// Uncomment this option for a fancy shell prompt that includes the
|
||||
// current username and hostname. On systems that don't have usernames
|
||||
// or hostnames, this can look hideous.
|
||||
// Only relevant if a shell is enabled.
|
||||
//#define BB_FEATURE_SH_FANCY_PROMPT
|
||||
//
|
||||
// Uncomment this option to disable job control. Job control lets you
|
||||
// run jobs in the background (which completely useless for is all you
|
||||
// are doing is running scripts). Disabing this is bad for interactive
|
||||
// use, since when you hit ^C in an application, it will also kill the
|
||||
// shell. This adds about 2.5k on an x86 system.
|
||||
#define BB_FEATURE_ASH_JOB_CONTROL
|
||||
//
|
||||
//Turn on extra fbset options
|
||||
//#define BB_FEATURE_FBSET_FANCY
|
||||
//
|
||||
//Turn on fbset readmode support
|
||||
//#define BB_FEATURE_FBSET_READMODE
|
||||
//
|
||||
// Support insmod/lsmod/rmmod for post 2.1 kernels
|
||||
#define BB_FEATURE_NEW_MODULE_INTERFACE
|
||||
//
|
||||
// Support insmod/lsmod/rmmod for pre 2.1 kernels
|
||||
//#define BB_FEATURE_OLD_MODULE_INTERFACE
|
||||
//
|
||||
// Support module version checking
|
||||
//#define BB_FEATURE_INSMOD_VERSION_CHECKING
|
||||
//
|
||||
// Support for uClinux memory usage optimization, which will load the image
|
||||
// directly into the kernel memory. This divides memory requrements by three.
|
||||
// If you are not running uClinux (i.e., your CPU has an MMU) leave this
|
||||
// disabled...
|
||||
//#define BB_FEATURE_INSMOD_LOADINKMEM
|
||||
//
|
||||
// Support for Minix filesystem, version 2
|
||||
//#define BB_FEATURE_MINIX2
|
||||
//
|
||||
// Enable ifconfig status reporting output -- this feature adds 7k.
|
||||
//#define BB_FEATURE_IFCONFIG_STATUS
|
||||
//
|
||||
// Enable ifconfig slip-specific options "keepalive" and "outfill"
|
||||
//#define BB_FEATURE_IFCONFIG_SLIP
|
||||
//
|
||||
// Enable ifconfig options "mem_start", "io_addr", and "irq".
|
||||
//#define BB_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ
|
||||
//
|
||||
// Enable ifconfig option "hw". Currently works for only with "ether".
|
||||
//#define BB_FEATURE_IFCONFIG_HW
|
||||
//
|
||||
// Allows "broadcast +" to set broadcast automatically based on hostaddr
|
||||
// and netmask, at a cost of about 100 bytes of code (i386).
|
||||
//#define BB_FEATURE_IFCONFIG_BROADCAST_PLUS
|
||||
//
|
||||
// Enable busybox --install [-s]
|
||||
// to create links (or symlinks) for all the commands that are
|
||||
// compiled into the binary. (needs /proc filesystem)
|
||||
//#define BB_FEATURE_INSTALLER
|
||||
//
|
||||
// Enable a nifty progress meter in wget (adds just under 2k)
|
||||
#define BB_FEATURE_WGET_STATUSBAR
|
||||
//
|
||||
// Enable HTTP authentication in wget
|
||||
#define BB_FEATURE_WGET_AUTHENTICATION
|
||||
//
|
||||
// Clean up all memory before exiting -- usually not needed
|
||||
// as the OS can clean up... Don't enable this unless you
|
||||
// have a really good reason for cleaning things up manually.
|
||||
//#define BB_FEATURE_CLEAN_UP
|
||||
//
|
||||
// Support for human readable output by ls, du, etc.(example 13k, 23M, 235G)
|
||||
#define BB_FEATURE_HUMAN_READABLE
|
||||
//
|
||||
// Support for the find -type option.
|
||||
#define BB_FEATURE_FIND_TYPE
|
||||
//
|
||||
// Support for the find -perm option.
|
||||
#define BB_FEATURE_FIND_PERM
|
||||
//
|
||||
// Support for the find -mtime option.
|
||||
#define BB_FEATURE_FIND_MTIME
|
||||
//
|
||||
//// Support for the find -newer option.
|
||||
#define BB_FEATURE_FIND_NEWER
|
||||
//
|
||||
// Support for the -A -B and -C context flags in grep
|
||||
//#define BB_FEATURE_GREP_CONTEXT
|
||||
//
|
||||
// Support for the EGREP applet (alias to the grep applet)
|
||||
//#define BB_FEATURE_GREP_EGREP_ALIAS
|
||||
//
|
||||
// Tell tftp what commands that should be supported.
|
||||
#define BB_FEATURE_TFTP_PUT
|
||||
#define BB_FEATURE_TFTP_GET
|
||||
//
|
||||
// features for vi
|
||||
#define BB_FEATURE_VI_COLON // ":" colon commands, no "ex" mode
|
||||
#define BB_FEATURE_VI_YANKMARK // Yank/Put commands and Mark cmds
|
||||
#define BB_FEATURE_VI_SEARCH // search and replace cmds
|
||||
#define BB_FEATURE_VI_USE_SIGNALS // catch signals
|
||||
#define BB_FEATURE_VI_DOT_CMD // remember previous cmd and "." cmd
|
||||
#define BB_FEATURE_VI_READONLY // vi -R and "view" mode
|
||||
#define BB_FEATURE_VI_SETOPTS // set-able options, ai ic showmatch
|
||||
#define BB_FEATURE_VI_SET // :set
|
||||
#define BB_FEATURE_VI_WIN_RESIZE // handle window resize
|
||||
//
|
||||
// Enable a if you system have setuped locale
|
||||
//#define BB_LOCALE_SUPPORT
|
||||
//
|
||||
// Support for TELNET to pass TERM type to remote host. Adds 384 bytes.
|
||||
#define BB_FEATURE_TELNET_TTYPE
|
||||
//
|
||||
// Support for devfs.
|
||||
//#define BB_FEATURE_DEVFS
|
||||
//
|
||||
// End of Features List
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------
|
||||
// Nothing beyond this point should ever be touched by
|
||||
// mere mortals so leave this stuff alone.
|
||||
//
|
||||
#include <features.h>
|
||||
#if defined(__uClinux__)
|
||||
#undef BB_ASH /* Not even a chance it will work */
|
||||
#undef BB_RPM2CPIO /* Uses gz_open(), which uses fork() */
|
||||
#undef BB_DPKG_DEB /* Uses gz_open(), which uses fork() */
|
||||
#undef BB_FEATURE_TAR_GZIP /* Uses fork() */
|
||||
#undef BB_UPDATE /* Uses daemon() */
|
||||
#endif
|
||||
#if defined BB_ASH || defined BB_HUSH || defined BB_LASH || defined BB_MSH
|
||||
#if defined BB_FEATURE_COMMAND_EDITING
|
||||
#define BB_CMDEDIT
|
||||
#else
|
||||
#undef BB_FEATURE_COMMAND_EDITING
|
||||
#undef BB_FEATURE_COMMAND_TAB_COMPLETION
|
||||
#undef BB_FEATURE_COMMAND_USERNAME_COMPLETION
|
||||
#undef BB_FEATURE_SH_FANCY_PROMPT
|
||||
#endif
|
||||
#else
|
||||
#undef BB_FEATURE_SH_APPLETS_ALWAYS_WIN
|
||||
#undef BB_FEATURE_SH_STANDALONE_SHELL
|
||||
#undef BB_FEATURE_SH_FANCY_PROMPT
|
||||
#endif
|
||||
//
|
||||
#if (defined BB_ASH || defined BB_HUSH || defined BB_MSH) && ! defined BB_TEST
|
||||
#define BB_TEST
|
||||
#endif
|
||||
//
|
||||
#ifdef BB_KILLALL
|
||||
#ifndef BB_KILL
|
||||
#define BB_KILL
|
||||
#endif
|
||||
#endif
|
||||
//
|
||||
#ifndef BB_INIT
|
||||
#undef BB_FEATURE_LINUXRC
|
||||
#endif
|
||||
//
|
||||
#if defined BB_MOUNT && defined BB_FEATURE_NFSMOUNT
|
||||
#define BB_NFSMOUNT
|
||||
#endif
|
||||
//
|
||||
#if defined BB_FEATURE_AUTOWIDTH
|
||||
#ifndef BB_FEATURE_USE_TERMIOS
|
||||
#define BB_FEATURE_USE_TERMIOS
|
||||
#endif
|
||||
#endif
|
||||
//
|
||||
#if defined BB_INSMOD || defined BB_LSMOD
|
||||
#if ! defined BB_FEATURE_NEW_MODULE_INTERFACE && ! defined BB_FEATURE_OLD_MODULE_INTERFACE
|
||||
#define BB_FEATURE_NEW_MODULE_INTERFACE
|
||||
#endif
|
||||
#endif
|
||||
//
|
||||
#ifdef BB_UNIX2DOS
|
||||
#define BB_DOS2UNIX
|
||||
#endif
|
||||
//
|
||||
#ifdef BB_SYSLOGD
|
||||
#if defined BB_FEATURE_IPC_SYSLOG
|
||||
#define BB_LOGREAD
|
||||
#endif
|
||||
#endif
|
||||
//
|
||||
#if defined BB_ASH && defined BB_FEATURE_SH_IS_ASH
|
||||
# define shell_main ash_main
|
||||
#elif defined BB_HUSH && defined BB_FEATURE_SH_IS_HUSH
|
||||
# define shell_main hush_main
|
||||
#elif defined BB_LASH && defined BB_FEATURE_SH_IS_LASH
|
||||
# define shell_main lash_main
|
||||
#elif defined BB_MSH && defined BB_FEATURE_SH_IS_MSH
|
||||
# define shell_main msh_main
|
||||
#endif
|
||||
@@ -1,13 +1,8 @@
|
||||
1) Run 'make config' or 'make menuconfig' and select the
|
||||
functionality that you wish to enable.
|
||||
1) Check Config.h and adjust if you need a different functionality than
|
||||
defined by default.
|
||||
|
||||
2) make dep
|
||||
2) Check the Makefile
|
||||
|
||||
3) Check the Makefile for any Makefile setting you wish
|
||||
to adjust for your system (things like like setting
|
||||
your cross compiler, adjusting optimizations, etc)
|
||||
3) make
|
||||
|
||||
4) make
|
||||
|
||||
5) Run 'make install' or 'make PREFIX=/target install' to
|
||||
install busybox and all the needed links.
|
||||
4) make install
|
||||
@@ -1,6 +1,6 @@
|
||||
# Makefile for busybox
|
||||
#
|
||||
# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
|
||||
# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -18,21 +18,14 @@
|
||||
#
|
||||
|
||||
PROG := busybox
|
||||
VERSION := 0.61.pre
|
||||
VERSION := 0.60.5
|
||||
BUILDTIME := $(shell TZ=UTC date -u "+%Y.%m.%d-%H:%M%z")
|
||||
TOPDIR := ${shell /bin/pwd}
|
||||
HOSTCC := gcc
|
||||
HOSTCFLAGS:= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
|
||||
|
||||
|
||||
# What OS are you compiling busybox for? This allows you to include
|
||||
# OS specific things, syscall overrides, etc.
|
||||
TARGET_OS := linux
|
||||
export VERSION
|
||||
|
||||
# With a modern GNU make(1) (highly recommended, that's what all the
|
||||
# developers use), all of the following configuration values can be
|
||||
# overridden at the command line. For example:
|
||||
# make CROSS=powerpc-linux- CONFIG_SRC_DIR=$HOME/busybox PREFIX=/mnt/app
|
||||
# make CROSS=powerpc-linux- BB_SRC_DIR=$HOME/busybox PREFIX=/mnt/app
|
||||
|
||||
# If you want to add some simple compiler switches (like -march=i686),
|
||||
# especially from the command line, use this instead of CFLAGS directly.
|
||||
@@ -46,11 +39,31 @@ DOSTATIC = false
|
||||
# Leave this set to `false' for production use.
|
||||
DODEBUG = false
|
||||
|
||||
# If you enable this option, busybox will use the system's password
|
||||
# and group functions. And if you are using the GNU C library
|
||||
# (glibc), you will then need to install the /etc/nsswitch.conf
|
||||
# configuration file and the required /lib/libnss_* libraries in
|
||||
# order for the password and group functions to work. This generally
|
||||
# makes your embedded system quite a bit larger.
|
||||
# Disabling this option will cause busybox to directly access the
|
||||
# system's /etc/password, /etc/group files (and your system will be
|
||||
# smaller, and I will get fewer emails asking about how glibc NSS
|
||||
# works). When this option is disabled, you will not be able to use
|
||||
# PAM to access remote LDAP password servers and whatnot. And if you
|
||||
# want hostname resolution to work with glibc, you still need the
|
||||
# /lib/libnss_* libraries.
|
||||
# If you disable this option, it will add about 1.5k to busybox.
|
||||
USE_SYSTEM_PWD_GRP = true
|
||||
|
||||
# This enables compiling with dmalloc ( http://dmalloc.com/ )
|
||||
# which is an excellent public domain mem leak and malloc problem
|
||||
# detector. To enable dmalloc, before running busybox you will
|
||||
# want to first set up your environment.
|
||||
# eg: `export DMALLOC_OPTIONS=debug=0x14f47d83,inter=100,log=logfile`
|
||||
# eg: `export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile`
|
||||
# The debug= value is generated using the following command
|
||||
# dmalloc -p log-stats -p log-non-free -p log-bad-space -p log-elapsed-time \
|
||||
# -p check-fence -p check-heap -p check-lists -p check-blank \
|
||||
# -p check-funcs -p realloc-copy -p allow-free-null
|
||||
# Do not enable this for production builds...
|
||||
DODMALLOC = false
|
||||
|
||||
@@ -67,28 +80,21 @@ DOEFENCE = false
|
||||
# larger than 2GB!
|
||||
DOLFS = false
|
||||
|
||||
# If you have a "pristine" source directory, point CONFIG_SRC_DIR to it.
|
||||
# If you have a "pristine" source directory, point BB_SRC_DIR to it.
|
||||
# Experimental and incomplete; tell the mailing list
|
||||
# <busybox@opensource.lineo.com> if you do or don't like it so far.
|
||||
CONFIG_SRC_DIR =
|
||||
# <busybox@busybox.net> if you do or don't like it so far.
|
||||
BB_SRC_DIR =
|
||||
|
||||
# If you are running a cross compiler, you may want to set CROSS
|
||||
# to something more interesting, like "arm-linux-".
|
||||
# If you are running a cross compiler, you may want to set this
|
||||
# to something more interesting, like "powerpc-linux-".
|
||||
CROSS =
|
||||
CC = $(CROSS)gcc
|
||||
AR = $(CROSS)ar
|
||||
AS = $(CROSS)as
|
||||
LD = $(CROSS)ld
|
||||
NM = $(CROSS)nm
|
||||
STRIP = $(CROSS)strip
|
||||
CPP = $(CC) -E
|
||||
MAKEFILES = $(TOPDIR)/.config
|
||||
export VERSION BUILDTIME TOPDIR HOSTCC HOSTCFLAGS CROSS CC AR AS LD NM STRIP CPP
|
||||
|
||||
CC = $(CROSS)gcc
|
||||
AR = $(CROSS)ar
|
||||
STRIP = $(CROSS)strip
|
||||
|
||||
# To compile vs uClibc, just use the compiler wrapper built by uClibc...
|
||||
# Everything should compile and work as expected these days...
|
||||
#CC = /usr/i386-linux-uclibc/usr/bin/i386-uclibc-gcc
|
||||
#CC=/usr/i386-linux-uclibc/bin/i386-uclibc-gcc
|
||||
|
||||
# To compile vs some other alternative libc, you may need to use/adjust
|
||||
# the following lines to meet your needs...
|
||||
@@ -108,17 +114,48 @@ export VERSION BUILDTIME TOPDIR HOSTCC HOSTCFLAGS CROSS CC AR AS LD NM STRIP CPP
|
||||
#CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR)
|
||||
#GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
|
||||
|
||||
# use '-Os' optimization if available, else use -O2
|
||||
OPTIMIZATION := ${shell if $(CC) -Os -S -o /dev/null -xc /dev/null \
|
||||
>/dev/null 2>&1; then echo "-Os"; else echo "-O2" ; fi}
|
||||
GCC_STACK_BOUNDRY := ${shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null -xc /dev/null \
|
||||
>/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2"; else echo "" ; fi}
|
||||
OPTIMIZATIONS=$(OPTIMIZATION) -fomit-frame-pointer $(GCC_STACK_BOUNDRY)
|
||||
WARNINGS=-Wall -Wstrict-prototypes -Wshadow
|
||||
CFLAGS = -I$(TOPDIR)/include
|
||||
WARNINGS = -Wall -Wshadow
|
||||
|
||||
ARFLAGS = -r
|
||||
|
||||
#
|
||||
|
||||
TARGET_ARCH:=${shell $(CC) -dumpmachine | sed -e s'/-.*//' \
|
||||
-e 's/i.86/i386/' \
|
||||
-e 's/sparc.*/sparc/' \
|
||||
-e 's/arm.*/arm/g' \
|
||||
-e 's/m68k.*/m68k/' \
|
||||
-e 's/ppc/powerpc/g' \
|
||||
-e 's/v850.*/v850/g' \
|
||||
-e 's/sh[234]/sh/' \
|
||||
-e 's/mips.*/mips/' \
|
||||
}
|
||||
|
||||
#--------------------------------------------------------
|
||||
# Arch specific compiler optimization stuff should go here.
|
||||
# Unless you want to override the defaults, do not set anything
|
||||
# for OPTIMIZATION...
|
||||
|
||||
# use '-Os' optimization if available, else use -O2
|
||||
OPTIMIZATION := ${shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
|
||||
then echo "-Os"; else echo "-O2" ; fi}
|
||||
|
||||
# Some nice architecture specific optimizations
|
||||
ifeq ($(strip $(TARGET_ARCH)),arm)
|
||||
OPTIMIZATION+=-fstrict-aliasing
|
||||
endif
|
||||
ifeq ($(strip $(TARGET_ARCH)),i386)
|
||||
OPTIMIZATION+=-march=i386
|
||||
OPTIMIZATION+=${shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null -xc \
|
||||
/dev/null >/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2"; fi}
|
||||
OPTIMIZATION+=${shell if $(CC) -falign-functions=1 -falign-jumps=0 -falign-loops=0 \
|
||||
-S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo \
|
||||
"-falign-functions=1 -falign-jumps=0 -falign-loops=0"; else \
|
||||
if $(CC) -malign-functions=0 -malign-jumps=0 -S -o /dev/null -xc \
|
||||
/dev/null >/dev/null 2>&1; then echo "-malign-functions=0 -malign-jumps=0"; fi; fi}
|
||||
endif
|
||||
OPTIMIZATIONS:=$(OPTIMIZATION) -fomit-frame-pointer
|
||||
|
||||
|
||||
#--------------------------------------------------------
|
||||
# If you're going to do a lot of builds with a non-vanilla configuration,
|
||||
# it makes sense to adjust parameters above, so you can type "make"
|
||||
@@ -126,10 +163,9 @@ ARFLAGS = -r
|
||||
# every time. The stuff below, on the other hand, is probably less
|
||||
# prone to casual user adjustment.
|
||||
#
|
||||
|
||||
ifeq ($(strip $(DOLFS)),true)
|
||||
# For large file summit support
|
||||
CFLAGS+=-D_FILE_OFFSET_BITS=64 -D__USE_FILE_OFFSET64
|
||||
# For large file support
|
||||
CFLAGS+=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
|
||||
endif
|
||||
ifeq ($(strip $(DODMALLOC)),true)
|
||||
# For testing mem leaks with dmalloc
|
||||
@@ -147,94 +183,152 @@ endif
|
||||
ifeq ($(strip $(DODEBUG)),true)
|
||||
CFLAGS += $(WARNINGS) -g -D_GNU_SOURCE
|
||||
LDFLAGS += -Wl,-warn-common
|
||||
STRIPCMD =
|
||||
STRIPCMD = /bin/true -Since_we_are_debugging
|
||||
else
|
||||
CFLAGS += $(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE
|
||||
LDFLAGS += -s -Wl,-warn-common
|
||||
STRIPCMD = $(STRIP) --remove-section=.note --remove-section=.comment $(PROG)
|
||||
STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
|
||||
endif
|
||||
ifeq ($(strip $(DOSTATIC)),true)
|
||||
LDFLAGS += --static
|
||||
#
|
||||
#use '-ffunction-sections -fdata-sections' and '--gc-sections' (if they
|
||||
# work) to try and strip out any unused junk. Doesn't do much for me,
|
||||
# but you may want to give it a shot...
|
||||
#
|
||||
#ifeq ($(shell $(CC) -ffunction-sections -fdata-sections -S \
|
||||
# -o /dev/null -xc /dev/null 2>/dev/null && $(LD) \
|
||||
# --gc-sections -v >/dev/null && echo 1),1)
|
||||
# CFLAGS += -ffunction-sections -fdata-sections
|
||||
# LDFLAGS += --gc-sections
|
||||
#endif
|
||||
endif
|
||||
|
||||
ifndef $(PREFIX)
|
||||
ifeq ($(strip $(PREFIX)),)
|
||||
PREFIX = `pwd`/_install
|
||||
endif
|
||||
|
||||
# Additional complications due to support for pristine source dir.
|
||||
# Include files in the build directory should take precedence over
|
||||
# the copy in CONFIG_SRC_DIR, both during the compilation phase and the
|
||||
# the copy in BB_SRC_DIR, both during the compilation phase and the
|
||||
# shell script that finds the list of object files.
|
||||
# Work in progress by <ldoolitt@recycle.lbl.gov>.
|
||||
#
|
||||
ifneq ($(strip $(CONFIG_SRC_DIR)),)
|
||||
VPATH = $(CONFIG_SRC_DIR)
|
||||
ifneq ($(strip $(BB_SRC_DIR)),)
|
||||
VPATH = $(BB_SRC_DIR)
|
||||
endif
|
||||
#ifneq ($(strip $(VPATH)),)
|
||||
# CFLAGS += -I- -I. $(patsubst %,-I%,$(subst :, ,$(VPATH)))
|
||||
#endif
|
||||
|
||||
# We need to set APPLET_SOURCES to something like
|
||||
# $(shell busybox.sh Config.h)
|
||||
# but in a manner that works with VPATH and BB_SRC_DIR.
|
||||
# Possible ways to approach this:
|
||||
#
|
||||
# 1. Explicitly search through .:$(VPATH) for busybox.sh and config.h,
|
||||
# then $(shell $(BUSYBOX_SH) $(CONFIG_H) $(BB_SRC_DIR))
|
||||
#
|
||||
# 2. Explicity search through .:$(VPATH) for slist.mk,
|
||||
# then $(shell $(MAKE) -f $(SLIST_MK) VPATH=$(VPATH) BB_SRC_DIR=$(BB_SRC_DIR))
|
||||
#
|
||||
# 3. Create slist.mk in this directory, with commands embedded in
|
||||
# a $(shell ...) command, and $(MAKE) it immediately.
|
||||
#
|
||||
# 4. Use a real rule within this makefile to create a file that sets
|
||||
# APPLET_SOURCE_LIST, then include that file. Has complications
|
||||
# with the first trip through the makefile (before processing the
|
||||
# include) trying to do too much, and a spurious warning the first
|
||||
# time make is run.
|
||||
#
|
||||
# This is option 3:
|
||||
#
|
||||
#APPLET_SOURCES = $(shell \
|
||||
# echo -e 'all: busybox.sh Config.h\n\t@ $$(SHELL) $$^ $$(BB_SRC_DIR)' >slist.mk; \
|
||||
# make -f slist.mk VPATH=$(VPATH) BB_SRC_DIR=$(BB_SRC_DIR) \
|
||||
#)
|
||||
# And option 4:
|
||||
-include applet_source_list
|
||||
|
||||
OBJECTS = $(APPLET_SOURCES:.c=.o) busybox.o usage.o applets.o
|
||||
CFLAGS += $(CROSS_CFLAGS)
|
||||
ifdef CONFIG_INIT_SCRIPT
|
||||
CFLAGS += -DINIT_SCRIPT='"$(CONFIG_INIT_SCRIPT)"'
|
||||
CFLAGS += -DBB_VER='"$(VERSION)"'
|
||||
CFLAGS += -DBB_BT='"$(BUILDTIME)"'
|
||||
ifdef BB_INIT_SCRIPT
|
||||
CFLAGS += -DINIT_SCRIPT='"$(BB_INIT_SCRIPT)"'
|
||||
endif
|
||||
|
||||
ifneq ($(strip $(USE_SYSTEM_PWD_GRP)),true)
|
||||
PWD_GRP = pwd_grp
|
||||
PWD_GRP_DIR = $(BB_SRC_DIR:=/)$(PWD_GRP)
|
||||
PWD_LIB = libpwd.a
|
||||
PWD_CSRC=__getpwent.c pwent.c getpwnam.c getpwuid.c putpwent.c getpw.c \
|
||||
fgetpwent.c __getgrent.c grent.c getgrnam.c getgrgid.c fgetgrent.c \
|
||||
initgroups.c setgroups.c
|
||||
PWD_OBJS=$(patsubst %.c,$(PWD_GRP)/%.o, $(PWD_CSRC))
|
||||
ifneq ($(strip $(BB_SRC_DIR)),)
|
||||
PWD_CFLAGS = -I- -I.
|
||||
endif
|
||||
PWD_CFLAGS += -I$(PWD_GRP_DIR)
|
||||
else
|
||||
CFLAGS += -DUSE_SYSTEM_PWD_GRP
|
||||
endif
|
||||
|
||||
LIBBB = libbb
|
||||
LIBBB_LIB = libbb.a
|
||||
LIBBB_CSRC= ask_confirmation.c chomp.c concat_path_file.c copy_file.c \
|
||||
copy_file_chunk.c libc5.c device_open.c error_msg.c inode_hash.c \
|
||||
error_msg_and_die.c fgets_str.c find_mount_point.c find_pid_by_name.c \
|
||||
find_root_device.c full_read.c full_write.c get_console.c \
|
||||
get_last_path_component.c get_line_from_file.c gz_open.c human_readable.c \
|
||||
isdirectory.c kernel_version.c loop.c mode_string.c module_syscalls.c mtab.c \
|
||||
mtab_file.c my_getgrnam.c my_getgrgid.c my_getpwnam.c my_getpwnamegid.c \
|
||||
my_getpwuid.c parse_mode.c parse_number.c perror_msg.c perror_msg_and_die.c \
|
||||
print_file.c process_escape_sequence.c read_package_field.c recursive_action.c \
|
||||
safe_read.c safe_write.c safe_strncpy.c syscalls.c syslog_msg_with_name.c time_string.c \
|
||||
trim.c unzip.c vdprintf.c verror_msg.c vperror_msg.c wfopen.c xfuncs.c \
|
||||
xgetcwd.c xreadlink.c xregcomp.c interface.c remove_file.c last_char_is.c \
|
||||
copyfd.c vherror_msg.c herror_msg.c herror_msg_and_die.c xgethostbyname.c \
|
||||
dirname.c make_directory.c create_icmp_socket.c u_signal_names.c arith.c \
|
||||
simplify_path.c
|
||||
LIBBB_OBJS=$(patsubst %.c,$(LIBBB)/%.o, $(LIBBB_CSRC))
|
||||
ifeq ($(strip $(BB_SRC_DIR)),)
|
||||
LIBBB_CFLAGS += -I$(LIBBB)
|
||||
else
|
||||
LIBBB_CFLAGS = -I- -I. -I./$(LIBBB) -I$(BB_SRC_DIR)/$(LIBBB) -I$(BB_SRC_DIR)
|
||||
endif
|
||||
|
||||
LIBBB_MSRC=libbb/messages.c
|
||||
LIBBB_MESSAGES= full_version name_too_long omitting_directory not_a_directory \
|
||||
memory_exhausted invalid_date invalid_option io_error dash_dash_help \
|
||||
write_error too_few_args name_longer_than_foo unknown can_not_create_raw_socket
|
||||
LIBBB_MOBJ=$(patsubst %,$(LIBBB)/%.o, $(LIBBB_MESSAGES))
|
||||
|
||||
LIBBB_ARCSRC=libbb/unarchive.c
|
||||
LIBBB_ARCOBJ= archive_offset seek_sub_file extract_archive unarchive \
|
||||
get_header_ar get_header_cpio get_header_tar deb_extract
|
||||
LIBBB_AROBJS=$(patsubst %,$(LIBBB)/%.o, $(LIBBB_ARCOBJ))
|
||||
|
||||
|
||||
# Put user-supplied flags at the end, where they
|
||||
# have a chance of winning.
|
||||
CFLAGS += $(CFLAGS_EXTRA)
|
||||
|
||||
.EXPORT_ALL_VARIABLES:
|
||||
|
||||
all: do-it-all
|
||||
all: applet_source_list busybox busybox.links doc
|
||||
|
||||
#
|
||||
# Make "config" the default target if there is no configuration file or
|
||||
# "depend" the target if there is no top-level dependency information.
|
||||
ifeq (.config,$(wildcard .config))
|
||||
include .config
|
||||
ifeq (.depend,$(wildcard .depend))
|
||||
include .depend
|
||||
do-it-all: busybox busybox.links doc
|
||||
else
|
||||
CONFIGURATION = depend
|
||||
do-it-all: depend
|
||||
endif
|
||||
else
|
||||
CONFIGURATION = menuconfig
|
||||
do-it-all: menuconfig
|
||||
endif
|
||||
applet_source_list: busybox.sh Config.h
|
||||
(echo -n "APPLET_SOURCES := "; CC="$(CC)" BB_SRC_DIR="$(BB_SRC_DIR)" $(SHELL) $^) > $@
|
||||
|
||||
|
||||
SUBDIRS =applets archival archival/libunarchive console-tools editors \
|
||||
fileutils findutils init miscutils modutils networking procps \
|
||||
pwd_grp shell shellutils sysklogd textutils util-linux libbb
|
||||
|
||||
bbsubdirs: $(patsubst %, _dir_%, $(SUBDIRS))
|
||||
|
||||
$(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/config/MARKER
|
||||
$(MAKE) CFLAGS="$(CFLAGS)" -C $(patsubst _dir_%, %, $@)
|
||||
|
||||
busybox: config.h dep-files bbsubdirs
|
||||
$(CC) $(LDFLAGS) -o $@ applets/busybox.o $(shell find $(SUBDIRS) -name \*.a) $(LIBCONFIG_LIB) $(LIBRARIES)
|
||||
$(STRIPCMD)
|
||||
|
||||
busybox.links: applets/busybox.mkll
|
||||
- $(SHELL) $^ >$@
|
||||
|
||||
install: applets/install.sh busybox busybox.links
|
||||
$(SHELL) $< $(PREFIX)
|
||||
|
||||
install-hardlinks: applets/install.sh busybox busybox.links
|
||||
$(SHELL) $< $(PREFIX) --hardlinks
|
||||
|
||||
|
||||
# Documentation Targets
|
||||
doc: olddoc
|
||||
|
||||
# Old Docs...
|
||||
olddoc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
|
||||
|
||||
docs/busybox.pod : docs/busybox_header.pod include/usage.h docs/busybox_footer.pod
|
||||
docs/busybox.pod : docs/busybox_header.pod usage.h docs/busybox_footer.pod
|
||||
- ( cat docs/busybox_header.pod; \
|
||||
docs/autodocifier.pl include/usage.h; \
|
||||
docs/autodocifier.pl usage.h; \
|
||||
cat docs/busybox_footer.pod ) > docs/busybox.pod
|
||||
|
||||
docs/BusyBox.txt: docs/busybox.pod
|
||||
@@ -249,15 +343,9 @@ docs/BusyBox.1: docs/busybox.pod
|
||||
- pod2man --center=BusyBox --release="version $(VERSION)" \
|
||||
$< > $@
|
||||
|
||||
docs/BusyBox.html: docs/busybox.lineo.com/BusyBox.html
|
||||
- mkdir -p docs
|
||||
-@ rm -f docs/BusyBox.html
|
||||
-@ ln -s busybox.lineo.com/BusyBox.html docs/BusyBox.html
|
||||
|
||||
docs/busybox.lineo.com/BusyBox.html: docs/busybox.pod
|
||||
-@ mkdir -p docs/busybox.lineo.com
|
||||
- pod2html --noindex $< > \
|
||||
docs/busybox.lineo.com/BusyBox.html
|
||||
docs/BusyBox.html: docs/busybox.pod
|
||||
-@ mkdir -p docs
|
||||
- pod2html --noindex $< > docs/BusyBox.html
|
||||
-@ rm -f pod2htm*
|
||||
|
||||
|
||||
@@ -285,104 +373,97 @@ docs/busybox.pdf: docs/busybox.ps
|
||||
|
||||
docs/busybox/busyboxdocumentation.html: docs/busybox.sgml
|
||||
- mkdir -p docs
|
||||
(cd docs/busybox.lineo.com; sgmltools -b html ../busybox.sgml)
|
||||
|
||||
# The nifty new buildsystem stuff
|
||||
scripts/mkdep: scripts/mkdep.c
|
||||
$(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
|
||||
|
||||
scripts/split-include: scripts/split-include.c
|
||||
$(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c
|
||||
|
||||
dep-files: scripts/mkdep
|
||||
@if [ ! -f .depend ] ; then \
|
||||
rm -f .depend .hdepend; \
|
||||
mkdir -p $(TOPDIR)/include/config; \
|
||||
scripts/mkdep -I $(TOPDIR)/include -- \
|
||||
`find $(TOPDIR) -name \*.c -print` >> .depend; \
|
||||
scripts/mkdep -I $(TOPDIR)/include -- \
|
||||
`find $(TOPDIR) -name \*.h -print` >> .hdepend; \
|
||||
$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)" ; \
|
||||
fi;
|
||||
(cd docs; sgmltools -b html ../busybox.sgml)
|
||||
|
||||
|
||||
depend dep: config.h dep-files
|
||||
@ echo -e "\n\nNow run 'make' to build BusyBox\n\n"
|
||||
busybox: $(PWD_LIB) $(LIBBB_LIB) $(OBJECTS)
|
||||
$(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBBB_LIB) $(PWD_LIB) $(LIBRARIES)
|
||||
$(STRIPCMD) $(PROG)
|
||||
|
||||
CONFIG_SHELL := ${shell if [ -x "$$BASH" ]; then echo $$BASH; \
|
||||
else if [ -x /bin/bash ]; then echo /bin/bash; \
|
||||
else echo sh; fi ; fi}
|
||||
|
||||
include/config/MARKER: scripts/split-include include/config.h
|
||||
scripts/split-include include/config.h include/config
|
||||
@ touch include/config/MARKER
|
||||
|
||||
config.h:
|
||||
@if [ ! -f include/config.h ] ; then \
|
||||
make oldconfig; \
|
||||
fi;
|
||||
|
||||
menuconfig:
|
||||
mkdir -p $(TOPDIR)/include/config
|
||||
$(MAKE) -C scripts/lxdialog all
|
||||
$(CONFIG_SHELL) scripts/Menuconfig sysdeps/$(TARGET_OS)/config.in
|
||||
|
||||
config:
|
||||
mkdir -p $(TOPDIR)/include/config
|
||||
$(CONFIG_SHELL) scripts/Configure sysdeps/$(TARGET_OS)/config.in
|
||||
|
||||
oldconfig:
|
||||
mkdir -p $(TOPDIR)/include/config
|
||||
$(CONFIG_SHELL) scripts/Configure -d sysdeps/$(TARGET_OS)/config.in
|
||||
|
||||
|
||||
ifdef CONFIGURATION
|
||||
..$(CONFIGURATION):
|
||||
@echo
|
||||
@echo "You have a bad or nonexistent" .$(CONFIGURATION) ": running 'make" $(CONFIGURATION)"'"
|
||||
@echo
|
||||
$(MAKE) $(CONFIGURATION)
|
||||
@echo
|
||||
@echo "Successful. Try re-making (ignore the error that follows)"
|
||||
@echo
|
||||
exit 1
|
||||
|
||||
dummy:
|
||||
# Without VPATH, rule expands to "/bin/sh busybox.mkll Config.h applets.h"
|
||||
# but with VPATH, some or all of those file names are resolved to the
|
||||
# directories in which they live.
|
||||
busybox.links: busybox.mkll Config.h applets.h
|
||||
- $(SHELL) $^ >$@
|
||||
|
||||
nfsmount.o cmdedit.o: %.o: %.h
|
||||
ash.o hush.o lash.o msh.o: cmdedit.h
|
||||
$(OBJECTS): %.o: %.c Config.h busybox.h applets.h Makefile
|
||||
ifeq ($(strip $(BB_SRC_DIR)),)
|
||||
$(CC) $(CFLAGS) -I. $(patsubst %,-I%,$(subst :, ,$(BB_SRC_DIR))) -c $< -o $*.o
|
||||
else
|
||||
|
||||
dummy:
|
||||
|
||||
$(CC) $(CFLAGS) -I- -I. $(patsubst %,-I%,$(subst :, ,$(BB_SRC_DIR))) -c $< -o $*.o
|
||||
endif
|
||||
|
||||
include Rules.mak
|
||||
$(PWD_OBJS): %.o: %.c Config.h busybox.h applets.h Makefile
|
||||
ifneq ($(strip $(BB_SRC_DIR)),)
|
||||
-mkdir -p $(PWD_GRP)
|
||||
endif
|
||||
$(CC) $(CFLAGS) $(PWD_CFLAGS) -c $< -o $*.o
|
||||
|
||||
$(LIBBB_OBJS): %.o: %.c Config.h busybox.h applets.h Makefile libbb/libbb.h
|
||||
ifneq ($(strip $(BB_SRC_DIR)),)
|
||||
-mkdir -p $(LIBBB)
|
||||
endif
|
||||
$(CC) $(CFLAGS) $(LIBBB_CFLAGS) -c $< -o $*.o
|
||||
|
||||
$(LIBBB_MOBJ): $(LIBBB_MSRC)
|
||||
ifneq ($(strip $(BB_SRC_DIR)),)
|
||||
-mkdir -p $(LIBBB)
|
||||
endif
|
||||
$(CC) $(CFLAGS) $(LIBBB_CFLAGS) -DL_$(patsubst libbb/%,%,$*) -c $< -o $*.o
|
||||
|
||||
$(LIBBB_AROBJS): $(LIBBB_ARCSRC)
|
||||
ifneq ($(strip $(BB_SRC_DIR)),)
|
||||
-mkdir -p $(LIBBB)
|
||||
endif
|
||||
$(CC) $(CFLAGS) $(LIBBB_CFLAGS) -DL_$(patsubst libbb/%,%,$*) -c $< -o $*.o
|
||||
|
||||
libpwd.a: $(PWD_OBJS)
|
||||
$(AR) $(ARFLAGS) $@ $^
|
||||
|
||||
libbb.a: $(LIBBB_MOBJ) $(LIBBB_AROBJS) $(LIBBB_OBJS)
|
||||
$(AR) $(ARFLAGS) $@ $^
|
||||
|
||||
usage.o: usage.h
|
||||
|
||||
libbb/loop.o: libbb/loop.h
|
||||
|
||||
libbb/loop.h: mk_loop_h.sh
|
||||
@ $(SHELL) $< > $@
|
||||
|
||||
# Testing...
|
||||
test tests:
|
||||
# old way of doing it
|
||||
#cd tests && $(MAKE) all
|
||||
# new way of doing it
|
||||
cd tests && ./tester.sh
|
||||
|
||||
# Cleanup
|
||||
clean:
|
||||
- $(MAKE) -C tests clean
|
||||
- $(MAKE) -C scripts/lxdialog clean
|
||||
- rm -f docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html \
|
||||
docs/busybox.lineo.com/BusyBox.html
|
||||
- cd tests && $(MAKE) clean
|
||||
- rm -f docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html docs/BusyBox.html
|
||||
- rm -f docs/busybox.txt docs/busybox.dvi docs/busybox.ps \
|
||||
docs/busybox.pdf docs/busybox.lineo.com/busybox.html \
|
||||
docs/busybox _install pod2htm* *.gdb *.elf *~ core
|
||||
- rm -f busybox.links libbb/loop.h .config.old .hdepend
|
||||
- rm -f scripts/split-include scripts/mkdep .*config.log
|
||||
- rm -rf include/config include/config.h
|
||||
- find -name .\*.flags -o -name .depend -exec rm -f {} \;
|
||||
- find -name \*.o -exec rm -f {} \;
|
||||
- find -name \*.a -exec rm -f {} \;
|
||||
docs/busybox.pdf docs/busybox.html docs/busybox.pod
|
||||
- rm -f multibuild.log Config.h.orig *.gdb *.elf
|
||||
- rm -rf docs/busybox _install libpwd.a libbb.a pod2htm*
|
||||
- rm -f busybox busybox.links libbb/loop.h *~ slist.mk core applet_source_list
|
||||
- find . -name \*.o -exec rm -f {} \;
|
||||
|
||||
distclean: clean
|
||||
- rm -f busybox
|
||||
- cd tests && $(MAKE) distclean
|
||||
- rm -f busybox applet_source_list
|
||||
|
||||
install: install.sh busybox busybox.links
|
||||
$(SHELL) $< $(PREFIX)
|
||||
|
||||
uninstall: busybox busybox.links
|
||||
for i in `cat busybox.links` ; do rm -f $$PREFIX$$i; done
|
||||
|
||||
install-hardlinks: install.sh busybox busybox.links
|
||||
$(SHELL) $< $(PREFIX) --hardlinks
|
||||
|
||||
debug_pristine:
|
||||
@ echo VPATH=\"$(VPATH)\"
|
||||
@ echo OBJECTS=\"$(OBJECTS)\"
|
||||
|
||||
dist release: distclean doc
|
||||
cd ..; \
|
||||
@@ -401,11 +482,6 @@ dist release: distclean doc
|
||||
\
|
||||
tar -cvzf busybox-$(VERSION).tar.gz busybox-$(VERSION)/;
|
||||
|
||||
|
||||
|
||||
.PHONY: tags check
|
||||
.PHONY: tags
|
||||
tags:
|
||||
ctags -R .
|
||||
|
||||
check: busybox
|
||||
cd testsuite && ./runtest
|
||||
@@ -83,7 +83,7 @@ top of ash.c as well, so check those out if you want to tweak things.
|
||||
Getting help:
|
||||
|
||||
When you find you need help, you can check out the BusyBox mailing list
|
||||
archives at http://oss.lineo.com/lists/busybox/ or even join
|
||||
archives at http://busybox.net/lists/busybox/ or even join
|
||||
the mailing list if you are interested.
|
||||
|
||||
----------------
|
||||
@@ -91,12 +91,12 @@ the mailing list if you are interested.
|
||||
Bugs:
|
||||
|
||||
If you find bugs, please submit a bug report. Full instructions on how to
|
||||
report a bug are found at http://bugs.lineo.com/Reporting.html.
|
||||
report a bug are found at http://bugs.busybox.net/Reporting.html.
|
||||
|
||||
For the impatient: To submit a bug, simply send an email describing the problem
|
||||
to submit@bugs.lineo.com. Bug reports should look something like this:
|
||||
to submit@bugs.busybox.net. Bug reports should look something like this:
|
||||
|
||||
To: submit@bugs.lineo.com
|
||||
To: submit@bugs.busybox.net
|
||||
From: diligent@testing.linux.org
|
||||
Subject: /bin/true doesn't work
|
||||
|
||||
@@ -124,20 +124,20 @@ understanding.
|
||||
FTP:
|
||||
|
||||
Source for the latest released version can always be downloaded from
|
||||
ftp://ftp.lineo.com/pub/busybox.
|
||||
http://busybox.net/downloads/
|
||||
|
||||
----------------
|
||||
|
||||
CVS:
|
||||
|
||||
BusyBox now has its own publicly browsable CVS tree at:
|
||||
http://oss.lineo.com/cgi-bin/cvsweb/busybox/
|
||||
http://busybox.net/cgi-bin/cvsweb/busybox/
|
||||
|
||||
Anonymous CVS access is available. For instructions, check out:
|
||||
http://oss.lineo.com/cvs_anon.html
|
||||
http://busybox.net/cvs_anon.html
|
||||
|
||||
For those that are actively contributing there is even CVS write access:
|
||||
http://oss.lineo.com/cvs_write.html
|
||||
http://busybox.net/cvs_write.html
|
||||
|
||||
----------------
|
||||
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
#
|
||||
# This file contains rules which are shared between multiple Makefiles.
|
||||
#
|
||||
|
||||
#
|
||||
# False targets.
|
||||
#
|
||||
.PHONY: dummy
|
||||
|
||||
#
|
||||
# Special variables which should not be exported
|
||||
#
|
||||
unexport EXTRA_AFLAGS
|
||||
unexport EXTRA_CFLAGS
|
||||
unexport EXTRA_LDFLAGS
|
||||
unexport EXTRA_ARFLAGS
|
||||
unexport SUBDIRS
|
||||
unexport SUB_DIRS
|
||||
unexport ALL_SUB_DIRS
|
||||
unexport O_TARGET
|
||||
|
||||
unexport obj-y
|
||||
unexport obj-n
|
||||
unexport obj-
|
||||
unexport export-objs
|
||||
unexport subdir-y
|
||||
unexport subdir-n
|
||||
unexport subdir-
|
||||
|
||||
#
|
||||
# Get things started.
|
||||
#
|
||||
first_rule: sub_dirs
|
||||
$(MAKE) all_targets
|
||||
|
||||
SUB_DIRS := $(subdir-y)
|
||||
ALL_SUB_DIRS := $(sort $(subdir-y) $(subdir-n) $(subdir-))
|
||||
|
||||
|
||||
#
|
||||
# Common rules
|
||||
#
|
||||
|
||||
%.s: %.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -S $< -o $@
|
||||
|
||||
%.i: %.c
|
||||
$(CPP) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) $< > $@
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -c -o $@ $<
|
||||
@ ( \
|
||||
echo 'ifeq ($(strip $(subst $(comma),:,$(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@))),$$(strip $$(subst $$(comma),:,$$(CFLAGS) $$(EXTRA_CFLAGS) $$(CFLAGS_$@))))' ; \
|
||||
echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
|
||||
echo 'endif' \
|
||||
) > $(dir $@)/.$(notdir $@).flags
|
||||
|
||||
%.o: %.s
|
||||
$(AS) $(AFLAGS) $(EXTRA_CFLAGS) -o $@ $<
|
||||
|
||||
# Old makefiles define their own rules for compiling .S files,
|
||||
# but these standard rules are available for any Makefile that
|
||||
# wants to use them. Our plan is to incrementally convert all
|
||||
# the Makefiles to these standard rules. -- rmk, mec
|
||||
ifdef USE_STANDARD_AS_RULE
|
||||
|
||||
%.s: %.S
|
||||
$(CPP) $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$@) $< > $@
|
||||
|
||||
%.o: %.S
|
||||
$(CC) $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$@) -c -o $@ $<
|
||||
|
||||
endif
|
||||
|
||||
%.lst: %.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -g -c -o $*.o $<
|
||||
$(TOPDIR)/scripts/makelst $* $(TOPDIR) $(OBJDUMP)
|
||||
#
|
||||
#
|
||||
#
|
||||
all_targets: $(O_TARGET) $(L_TARGET)
|
||||
|
||||
#
|
||||
# Rule to compile a set of .o files into one .o file
|
||||
#
|
||||
ifdef O_TARGET
|
||||
$(O_TARGET): $(obj-y)
|
||||
rm -f $@
|
||||
ifneq "$(strip $(obj-y))" ""
|
||||
$(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(obj-y), $^)
|
||||
else
|
||||
$(AR) rcs $@
|
||||
endif
|
||||
@ ( \
|
||||
echo 'ifeq ($(strip $(subst $(comma),:,$(EXTRA_LDFLAGS) $(obj-y))),$$(strip $$(subst $$(comma),:,$$(EXTRA_LDFLAGS) $$(obj-y))))' ; \
|
||||
echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
|
||||
echo 'endif' \
|
||||
) > $(dir $@)/.$(notdir $@).flags
|
||||
endif # O_TARGET
|
||||
|
||||
#
|
||||
# Rule to compile a set of .o files into one .a file
|
||||
#
|
||||
ifdef L_TARGET
|
||||
$(L_TARGET): $(obj-y)
|
||||
rm -f $@
|
||||
$(AR) $(EXTRA_ARFLAGS) rcs $@ $(obj-y)
|
||||
@ ( \
|
||||
echo 'ifeq ($(strip $(subst $(comma),:,$(EXTRA_ARFLAGS) $(obj-y))),$$(strip $$(subst $$(comma),:,$$(EXTRA_ARFLAGS) $$(obj-y))))' ; \
|
||||
echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
|
||||
echo 'endif' \
|
||||
) > $(dir $@)/.$(notdir $@).flags
|
||||
endif
|
||||
|
||||
|
||||
#
|
||||
# This make dependencies quickly
|
||||
#
|
||||
fastdep: dummy
|
||||
$(TOPDIR)/scripts/mkdep $(CFLAGS) $(EXTRA_CFLAGS) -- $(wildcard *.[chS]) > .depend
|
||||
ifdef ALL_SUB_DIRS
|
||||
$(MAKE) $(patsubst %,_sfdep_%,$(ALL_SUB_DIRS)) _FASTDEP_ALL_SUB_DIRS="$(ALL_SUB_DIRS)"
|
||||
endif
|
||||
|
||||
ifdef _FASTDEP_ALL_SUB_DIRS
|
||||
$(patsubst %,_sfdep_%,$(_FASTDEP_ALL_SUB_DIRS)):
|
||||
$(MAKE) -C $(patsubst _sfdep_%,%,$@) fastdep
|
||||
endif
|
||||
|
||||
|
||||
#
|
||||
# A rule to make subdirectories
|
||||
#
|
||||
subdir-list = $(sort $(patsubst %,_subdir_%,$(SUB_DIRS)))
|
||||
sub_dirs: dummy $(subdir-list)
|
||||
|
||||
ifdef SUB_DIRS
|
||||
$(subdir-list) : dummy
|
||||
$(MAKE) -C $(patsubst _subdir_%,%,$@)
|
||||
endif
|
||||
|
||||
#
|
||||
# A rule to do nothing
|
||||
#
|
||||
dummy:
|
||||
|
||||
#
|
||||
# This is useful for testing
|
||||
#
|
||||
script:
|
||||
$(SCRIPT)
|
||||
|
||||
#
|
||||
# include dependency files if they exist
|
||||
#
|
||||
ifneq ($(wildcard .depend),)
|
||||
include .depend
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard $(TOPDIR)/.hdepend),)
|
||||
include $(TOPDIR)/.hdepend
|
||||
endif
|
||||
|
||||
#
|
||||
# Find files whose flags have changed and force recompilation.
|
||||
# For safety, this works in the converse direction:
|
||||
# every file is forced, except those whose flags are positively up-to-date.
|
||||
#
|
||||
FILES_FLAGS_UP_TO_DATE :=
|
||||
|
||||
# For use in expunging commas from flags, which mung our checking.
|
||||
comma = ,
|
||||
|
||||
FILES_FLAGS_EXIST := $(wildcard .*.flags)
|
||||
ifneq ($(FILES_FLAGS_EXIST),)
|
||||
include $(FILES_FLAGS_EXIST)
|
||||
endif
|
||||
|
||||
FILES_FLAGS_CHANGED := $(strip \
|
||||
$(filter-out $(FILES_FLAGS_UP_TO_DATE), \
|
||||
$(O_TARGET) $(L_TARGET) $(active-objs) \
|
||||
))
|
||||
|
||||
# A kludge: .S files don't get flag dependencies (yet),
|
||||
# because that will involve changing a lot of Makefiles. Also
|
||||
# suppress object files explicitly listed in $(IGNORE_FLAGS_OBJS).
|
||||
# This allows handling of assembly files that get translated into
|
||||
# multiple object files (see arch/ia64/lib/idiv.S, for example).
|
||||
FILES_FLAGS_CHANGED := $(strip \
|
||||
$(filter-out $(patsubst %.S, %.o, $(wildcard *.S) $(IGNORE_FLAGS_OBJS)), \
|
||||
$(FILES_FLAGS_CHANGED)))
|
||||
|
||||
ifneq ($(FILES_FLAGS_CHANGED),)
|
||||
$(FILES_FLAGS_CHANGED): dummy
|
||||
endif
|
||||
@@ -19,8 +19,6 @@ Possible apps to include some time:
|
||||
|
||||
* hwclock
|
||||
* group/commonize strings, remove dups (for i18n, l10n)
|
||||
* login/sulogin/passwd/etc are part of tinylogin. These are
|
||||
being merged into busybox as time allows.
|
||||
|
||||
-----------
|
||||
|
||||
@@ -47,10 +45,6 @@ libraries such as uClibc.
|
||||
Compile with debugging on, run 'nm --size-sort ./busybox'
|
||||
and then start with the biggest things and make them smaller...
|
||||
|
||||
-----------------------
|
||||
|
||||
du.c probably ought to have an -x switch like GNU du does...
|
||||
|
||||
-----------------------
|
||||
|
||||
xargs could use a -l option
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#define APPLET_ODDNAME(a,b,c,d) extern int b(int argc, char **argv);
|
||||
extern const char usage_messages[];
|
||||
#elif defined(MAKE_USAGE)
|
||||
#ifdef CONFIG_FEATURE_VERBOSE_USAGE
|
||||
#ifdef BB_FEATURE_VERBOSE_USAGE
|
||||
#define APPLET(a,b,c) a##_trivial_usage "\n\n" a##_full_usage "\0"
|
||||
#define APPLET_NOUSAGE(a,b,c) "\0"
|
||||
#define APPLET_ODDNAME(a,b,c,d) d##_trivial_usage "\n\n" d##_full_usage "\0"
|
||||
@@ -43,467 +43,440 @@
|
||||
|
||||
|
||||
|
||||
#ifdef CONFIG_TEST
|
||||
#ifdef BB_TEST
|
||||
APPLET_NOUSAGE("[", test_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_ADDGROUP
|
||||
APPLET(addgroup, addgroup_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_ADDUSER
|
||||
APPLET(adduser, adduser_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_ADJTIMEX
|
||||
#ifdef BB_ADJTIMEX
|
||||
APPLET(adjtimex, adjtimex_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_AR
|
||||
#ifdef BB_AR
|
||||
APPLET(ar, ar_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_ASH
|
||||
#ifdef BB_ASH
|
||||
APPLET_NOUSAGE("ash", ash_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_BASENAME
|
||||
#ifdef BB_BASENAME
|
||||
APPLET(basename, basename_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_BUNZIP2
|
||||
APPLET(bunzip2, bunzip2_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
APPLET_NOUSAGE("busybox", busybox_main, _BB_DIR_BIN)
|
||||
#ifdef CONFIG_BUNZIP2
|
||||
APPLET(bzcat, bunzip2_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_CAT
|
||||
#ifdef BB_CAT
|
||||
APPLET(cat, cat_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_CHGRP
|
||||
#ifdef BB_CHGRP
|
||||
APPLET(chgrp, chgrp_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_CHMOD
|
||||
#ifdef BB_CHMOD
|
||||
APPLET(chmod, chmod_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_CHOWN
|
||||
#ifdef BB_CHOWN
|
||||
APPLET(chown, chown_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_CHROOT
|
||||
#ifdef BB_CHROOT
|
||||
APPLET(chroot, chroot_main, _BB_DIR_USR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_CHVT
|
||||
#ifdef BB_CHVT
|
||||
APPLET(chvt, chvt_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_CLEAR
|
||||
#ifdef BB_CLEAR
|
||||
APPLET(clear, clear_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_CMP
|
||||
#ifdef BB_CMP
|
||||
APPLET(cmp, cmp_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_CP
|
||||
#ifdef BB_CP
|
||||
APPLET(cp, cp_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_CPIO
|
||||
#ifdef BB_CPIO
|
||||
APPLET(cpio, cpio_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_CUT
|
||||
#ifdef BB_CUT
|
||||
APPLET(cut, cut_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_DATE
|
||||
#ifdef BB_DATE
|
||||
APPLET(date, date_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_DC
|
||||
#ifdef BB_DC
|
||||
APPLET(dc, dc_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_DD
|
||||
#ifdef BB_DD
|
||||
APPLET(dd, dd_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_DEALLOCVT
|
||||
#ifdef BB_DEALLOCVT
|
||||
APPLET(deallocvt, deallocvt_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_DELGROUP
|
||||
APPLET(delgroup, delgroup_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_DELUSER
|
||||
APPLET(deluser, deluser_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_DF
|
||||
#ifdef BB_DF
|
||||
APPLET(df, df_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_DIRNAME
|
||||
#ifdef BB_DIRNAME
|
||||
APPLET(dirname, dirname_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_DMESG
|
||||
#ifdef BB_DMESG
|
||||
APPLET(dmesg, dmesg_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_DOS2UNIX
|
||||
#ifdef BB_DOS2UNIX
|
||||
APPLET(dos2unix, dos2unix_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_DPKG
|
||||
#ifdef BB_DPKG
|
||||
APPLET(dpkg, dpkg_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_DPKG_DEB
|
||||
#ifdef BB_DPKG_DEB
|
||||
APPLET_ODDNAME("dpkg-deb", dpkg_deb_main, _BB_DIR_USR_BIN, dpkg_deb)
|
||||
#endif
|
||||
#ifdef CONFIG_DU
|
||||
#ifdef BB_DU
|
||||
APPLET(du, du_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_DUMPKMAP
|
||||
#ifdef BB_DUMPKMAP
|
||||
APPLET(dumpkmap, dumpkmap_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_DUTMP
|
||||
#ifdef BB_DUTMP
|
||||
APPLET(dutmp, dutmp_main, _BB_DIR_USR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_ECHO
|
||||
#ifdef BB_ECHO
|
||||
APPLET(echo, echo_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#if defined(CONFIG_FEATURE_GREP_EGREP_ALIAS)
|
||||
#if defined(BB_FEATURE_GREP_EGREP_ALIAS) && defined(BB_GREP)
|
||||
APPLET_NOUSAGE("egrep", grep_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_ENV
|
||||
#ifdef BB_ENV
|
||||
APPLET(env, env_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_EXPR
|
||||
#ifdef BB_EXPR
|
||||
APPLET(expr, expr_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_FALSE
|
||||
#ifdef BB_TRUE_FALSE
|
||||
APPLET(false, false_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_FBSET
|
||||
#ifdef BB_FBSET
|
||||
APPLET(fbset, fbset_main, _BB_DIR_USR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_FDFLUSH
|
||||
#ifdef BB_FDFLUSH
|
||||
APPLET(fdflush, fdflush_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_FIND
|
||||
#ifdef BB_FIND
|
||||
APPLET(find, find_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_FREE
|
||||
#ifdef BB_FREE
|
||||
APPLET(free, free_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_FREERAMDISK
|
||||
#ifdef BB_FREERAMDISK
|
||||
APPLET(freeramdisk, freeramdisk_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_FSCK_MINIX
|
||||
#ifdef BB_FSCK_MINIX
|
||||
APPLET_ODDNAME("fsck.minix", fsck_minix_main, _BB_DIR_SBIN, fsck_minix)
|
||||
#endif
|
||||
#ifdef CONFIG_GETOPT
|
||||
#ifdef BB_GETOPT
|
||||
APPLET(getopt, getopt_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_GETTY
|
||||
APPLET(getty, getty_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_GREP
|
||||
#ifdef BB_GREP
|
||||
APPLET(grep, grep_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_GUNZIP
|
||||
#ifdef BB_GUNZIP
|
||||
APPLET(gunzip, gunzip_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_GZIP
|
||||
#ifdef BB_GZIP
|
||||
APPLET(gzip, gzip_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_HALT
|
||||
#ifdef BB_HALT
|
||||
APPLET(halt, halt_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_HEAD
|
||||
#ifdef BB_HEAD
|
||||
APPLET(head, head_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_HEXDUMP
|
||||
APPLET(hexdump, hexdump_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_HOSTID
|
||||
#ifdef BB_HOSTID
|
||||
APPLET(hostid, hostid_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_HOSTNAME
|
||||
#ifdef BB_HOSTNAME
|
||||
APPLET(hostname, hostname_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_HUSH
|
||||
#ifdef BB_HUSH
|
||||
APPLET_NOUSAGE("hush", hush_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_ID
|
||||
#ifdef BB_ID
|
||||
APPLET(id, id_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_IFCONFIG
|
||||
#ifdef BB_IFCONFIG
|
||||
APPLET(ifconfig, ifconfig_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_INIT
|
||||
#ifdef BB_INIT
|
||||
APPLET(init, init_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_INSMOD
|
||||
#ifdef BB_INSMOD
|
||||
APPLET(insmod, insmod_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_KILL
|
||||
#ifdef BB_KILL
|
||||
APPLET(kill, kill_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_KILLALL
|
||||
#ifdef BB_KILLALL
|
||||
APPLET(killall, kill_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_KLOGD
|
||||
#ifdef BB_KLOGD
|
||||
APPLET(klogd, klogd_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_LASH
|
||||
#ifdef BB_LASH
|
||||
APPLET(lash, lash_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_LENGTH
|
||||
#ifdef BB_LENGTH
|
||||
APPLET(length, length_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_INITRD
|
||||
#ifdef BB_FEATURE_LINUXRC
|
||||
APPLET_NOUSAGE("linuxrc", init_main, _BB_DIR_ROOT)
|
||||
#endif
|
||||
#ifdef CONFIG_LN
|
||||
#ifdef BB_LN
|
||||
APPLET(ln, ln_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_LOADACM
|
||||
#ifdef BB_LOADACM
|
||||
APPLET(loadacm, loadacm_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_LOADFONT
|
||||
#ifdef BB_LOADFONT
|
||||
APPLET(loadfont, loadfont_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_LOADKMAP
|
||||
#ifdef BB_LOADKMAP
|
||||
APPLET(loadkmap, loadkmap_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_LOGGER
|
||||
#ifdef BB_LOGGER
|
||||
APPLET(logger, logger_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_LOGNAME
|
||||
#ifdef BB_LOGNAME
|
||||
APPLET(logname, logname_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_LOGREAD
|
||||
#ifdef BB_LOGREAD
|
||||
APPLET(logread, logread_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_LS
|
||||
#ifdef BB_LOSETUP
|
||||
APPLET(losetup, losetup_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef BB_LS
|
||||
APPLET(ls, ls_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_LSMOD
|
||||
#ifdef BB_LSMOD
|
||||
APPLET(lsmod, lsmod_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_MAKEDEVS
|
||||
#ifdef BB_MAKEDEVS
|
||||
APPLET(makedevs, makedevs_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_MD5SUM
|
||||
#ifdef BB_MD5SUM
|
||||
APPLET(md5sum, md5sum_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_MKDIR
|
||||
#ifdef BB_MKDIR
|
||||
APPLET(mkdir, mkdir_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_MKFIFO
|
||||
#ifdef BB_MKFIFO
|
||||
APPLET(mkfifo, mkfifo_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_MKFS_MINIX
|
||||
#ifdef BB_MKFS_MINIX
|
||||
APPLET_ODDNAME("mkfs.minix", mkfs_minix_main, _BB_DIR_SBIN, mkfs_minix)
|
||||
#endif
|
||||
#ifdef CONFIG_MKNOD
|
||||
#ifdef BB_MKNOD
|
||||
APPLET(mknod, mknod_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_MKSWAP
|
||||
#ifdef BB_MKSWAP
|
||||
APPLET(mkswap, mkswap_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_MKTEMP
|
||||
#ifdef BB_MKTEMP
|
||||
APPLET(mktemp, mktemp_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_MODPROBE
|
||||
#ifdef BB_MODPROBE
|
||||
APPLET(modprobe, modprobe_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_MORE
|
||||
#ifdef BB_MORE
|
||||
APPLET(more, more_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_MOUNT
|
||||
#ifdef BB_MOUNT
|
||||
APPLET(mount, mount_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_MSH
|
||||
#ifdef BB_MSH
|
||||
APPLET_NOUSAGE("msh", msh_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_MT
|
||||
#ifdef BB_MT
|
||||
APPLET(mt, mt_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_MV
|
||||
#ifdef BB_MV
|
||||
APPLET(mv, mv_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_NC
|
||||
#ifdef BB_NC
|
||||
APPLET(nc, nc_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_NETSTAT
|
||||
APPLET(netstat, netstat_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_NSLOOKUP
|
||||
#ifdef BB_NSLOOKUP
|
||||
APPLET(nslookup, nslookup_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_OD
|
||||
APPLET(od, od_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_PIDOF
|
||||
#ifdef BB_PIDOF
|
||||
APPLET(pidof, pidof_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_PING
|
||||
#ifdef BB_PING
|
||||
APPLET(ping, ping_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_PIVOT_ROOT
|
||||
#ifdef BB_PIVOT_ROOT
|
||||
APPLET(pivot_root, pivot_root_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_POWEROFF
|
||||
#ifdef BB_POWEROFF
|
||||
APPLET(poweroff, poweroff_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_PRINTF
|
||||
#ifdef BB_PRINTF
|
||||
APPLET(printf, printf_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_PS
|
||||
#ifdef BB_PS
|
||||
APPLET(ps, ps_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_PWD
|
||||
#ifdef BB_PWD
|
||||
APPLET(pwd, pwd_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_RDATE
|
||||
#ifdef BB_RDATE
|
||||
APPLET(rdate, rdate_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_READLINK
|
||||
#ifdef BB_READLINK
|
||||
APPLET(readlink, readlink_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_REBOOT
|
||||
#ifdef BB_REBOOT
|
||||
APPLET(reboot, reboot_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_RENICE
|
||||
#ifdef BB_RENICE
|
||||
APPLET(renice, renice_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_RESET
|
||||
#ifdef BB_RESET
|
||||
APPLET(reset, reset_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_RM
|
||||
#ifdef BB_RM
|
||||
APPLET(rm, rm_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_RMDIR
|
||||
#ifdef BB_RMDIR
|
||||
APPLET(rmdir, rmdir_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_RMMOD
|
||||
#ifdef BB_RMMOD
|
||||
APPLET(rmmod, rmmod_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_ROUTE
|
||||
#ifdef BB_ROUTE
|
||||
APPLET(route, route_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_RPM2CPIO
|
||||
#ifdef BB_RPM2CPIO
|
||||
APPLET(rpm2cpio, rpm2cpio_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_RUN_PARTS
|
||||
APPLET_ODDNAME("run-parts", run_parts_main, _BB_DIR_BIN, run_parts)
|
||||
#endif
|
||||
#ifdef CONFIG_SED
|
||||
#ifdef BB_SED
|
||||
APPLET(sed, sed_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_SETKEYCODES
|
||||
#ifdef BB_SETKEYCODES
|
||||
APPLET(setkeycodes, setkeycodes_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#if defined(CONFIG_FEATURE_SH_IS_ASH) && defined(CONFIG_ASH)
|
||||
#if defined(BB_FEATURE_SH_IS_ASH) && defined(BB_ASH)
|
||||
APPLET_NOUSAGE("sh", ash_main, _BB_DIR_BIN)
|
||||
#elif defined(CONFIG_FEATURE_SH_IS_HUSH) && defined(CONFIG_HUSH)
|
||||
#elif defined(BB_FEATURE_SH_IS_HUSH) && defined(BB_HUSH)
|
||||
APPLET_NOUSAGE("sh", hush_main, _BB_DIR_BIN)
|
||||
#elif defined(CONFIG_FEATURE_SH_IS_LASH) && defined(CONFIG_LASH)
|
||||
#elif defined(BB_FEATURE_SH_IS_LASH) && defined(BB_LASH)
|
||||
APPLET_NOUSAGE("sh", lash_main, _BB_DIR_BIN)
|
||||
#elif defined(CONFIG_FEATURE_SH_IS_MSH) && defined(CONFIG_MSH)
|
||||
#elif defined(BB_FEATURE_SH_IS_MSH) && defined(BB_MSH)
|
||||
APPLET_NOUSAGE("sh", msh_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_SLEEP
|
||||
#ifdef BB_SLEEP
|
||||
APPLET(sleep, sleep_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_SORT
|
||||
#ifdef BB_SORT
|
||||
APPLET(sort, sort_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_START_STOP_DAEMON
|
||||
APPLET_ODDNAME("start-stop-daemon", start_stop_daemon_main, _BB_DIR_SBIN, start_stop_daemon)
|
||||
#endif
|
||||
#ifdef CONFIG_STTY
|
||||
#ifdef BB_STTY
|
||||
APPLET(stty, stty_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_SWAPONOFF
|
||||
#ifdef BB_SWAPONOFF
|
||||
APPLET(swapoff, swap_on_off_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_SWAPONOFF
|
||||
#ifdef BB_SWAPONOFF
|
||||
APPLET(swapon, swap_on_off_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_SYNC
|
||||
#ifdef BB_SYNC
|
||||
APPLET(sync, sync_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_SYSLOGD
|
||||
#ifdef BB_SYSLOGD
|
||||
APPLET(syslogd, syslogd_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_TAIL
|
||||
#ifdef BB_TAIL
|
||||
APPLET(tail, tail_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_TAR
|
||||
#ifdef BB_TAR
|
||||
APPLET(tar, tar_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_TEE
|
||||
#ifdef BB_TEE
|
||||
APPLET(tee, tee_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_TELNET
|
||||
#ifdef BB_TELNET
|
||||
APPLET(telnet, telnet_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_TEST
|
||||
#ifdef BB_TEST
|
||||
APPLET(test, test_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_TFTP
|
||||
#ifdef BB_TFTP
|
||||
APPLET(tftp, tftp_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_TOUCH
|
||||
#ifdef BB_TIME
|
||||
APPLET(time, time_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef BB_TOP
|
||||
APPLET(top, top_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef BB_TOUCH
|
||||
APPLET(touch, touch_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_TR
|
||||
#ifdef BB_TR
|
||||
APPLET(tr, tr_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_TRACEROUTE
|
||||
#ifdef BB_TRACEROUTE
|
||||
APPLET(traceroute, traceroute_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_TRUE
|
||||
#ifdef BB_TRUE_FALSE
|
||||
APPLET(true, true_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_TTY
|
||||
#ifdef BB_TTY
|
||||
APPLET(tty, tty_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_UMOUNT
|
||||
#ifdef BB_UMOUNT
|
||||
APPLET(umount, umount_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_UNAME
|
||||
#ifdef BB_UNAME
|
||||
APPLET(uname, uname_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_UNIQ
|
||||
#ifdef BB_UNIQ
|
||||
APPLET(uniq, uniq_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_UNIX2DOS
|
||||
#ifdef BB_UNIX2DOS
|
||||
APPLET(unix2dos, dos2unix_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_UPDATE
|
||||
#ifdef BB_UPDATE
|
||||
APPLET(update, update_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_UPTIME
|
||||
#ifdef BB_UPTIME
|
||||
APPLET(uptime, uptime_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_USLEEP
|
||||
#ifdef BB_USLEEP
|
||||
APPLET(usleep, usleep_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_UUDECODE
|
||||
#ifdef BB_UUDECODE
|
||||
APPLET(uudecode, uudecode_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_UUENCODE
|
||||
#ifdef BB_UUENCODE
|
||||
APPLET(uuencode, uuencode_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_VI
|
||||
#ifdef BB_VI
|
||||
APPLET(vi, vi_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_WATCHDOG
|
||||
#ifdef BB_WATCHDOG
|
||||
APPLET(watchdog, watchdog_main, _BB_DIR_SBIN)
|
||||
#endif
|
||||
#ifdef CONFIG_WC
|
||||
#ifdef BB_WC
|
||||
APPLET(wc, wc_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_WGET
|
||||
#ifdef BB_WGET
|
||||
APPLET(wget, wget_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_WHICH
|
||||
#ifdef BB_WHICH
|
||||
APPLET(which, which_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_WHOAMI
|
||||
#ifdef BB_WHOAMI
|
||||
APPLET(whoami, whoami_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_XARGS
|
||||
#ifdef BB_XARGS
|
||||
APPLET(xargs, xargs_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_YES
|
||||
#ifdef BB_YES
|
||||
APPLET(yes, yes_main, _BB_DIR_USR_BIN)
|
||||
#endif
|
||||
#ifdef CONFIG_GUNZIP
|
||||
#ifdef BB_GUNZIP
|
||||
APPLET(zcat, gunzip_main, _BB_DIR_BIN)
|
||||
#endif
|
||||
|
||||
@@ -512,4 +485,3 @@
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
# Makefile for busybox
|
||||
#
|
||||
# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
TOPDIR :=..
|
||||
L_TARGET := applets.a
|
||||
|
||||
obj-y :=
|
||||
obj-n :=
|
||||
obj- :=
|
||||
|
||||
obj-y += applets.o busybox.o usage.o
|
||||
|
||||
# Hand off to toplevel Rules.mak
|
||||
include $(TOPDIR)/Rules.mak
|
||||
|
||||
clean:
|
||||
rm -f $(L_TARGET) *.o core
|
||||
|
||||
@@ -23,11 +23,10 @@
|
||||
*
|
||||
*/
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <getopt.h>
|
||||
#include "unarchive.h"
|
||||
#include <unistd.h>
|
||||
#include "busybox.h"
|
||||
|
||||
extern int ar_main(int argc, char **argv)
|
||||
@@ -85,6 +84,6 @@ extern int ar_main(int argc, char **argv)
|
||||
optind++;
|
||||
}
|
||||
|
||||
unarchive(src_stream, stdout, &get_header_ar, extract_function, "./", extract_names, NULL);
|
||||
unarchive(src_stream, stdout, &get_header_ar, extract_function, "./", extract_names);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
# Makefile for busybox
|
||||
#
|
||||
# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
TOPDIR :=..
|
||||
L_TARGET := archival.a
|
||||
|
||||
obj-y :=
|
||||
obj-n :=
|
||||
obj- :=
|
||||
subdir-y := libunarchive
|
||||
|
||||
obj-$(CONFIG_AR) += ar.o
|
||||
obj-$(CONFIG_BUNZIP2) += bunzip2.o
|
||||
obj-$(CONFIG_CPIO) += cpio.o
|
||||
obj-$(CONFIG_DPKG) += dpkg.o
|
||||
obj-$(CONFIG_DPKG_DEB) += dpkg_deb.o
|
||||
obj-$(CONFIG_GUNZIP) += gunzip.o
|
||||
obj-$(CONFIG_GZIP) += gzip.o
|
||||
obj-$(CONFIG_RPM2CPIO) += rpm2cpio.o
|
||||
obj-$(CONFIG_TAR) += tar.o
|
||||
|
||||
|
||||
# Hand off to toplevel Rules.mak
|
||||
include $(TOPDIR)/Rules.mak
|
||||
|
||||
clean:
|
||||
rm -f $(L_TARGET) *.o core
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#
|
||||
# For a description of the syntax of this configuration file,
|
||||
# see scripts/kbuild/config-language.txt.
|
||||
#
|
||||
|
||||
mainmenu_option next_comment
|
||||
comment 'Archival Utilities'
|
||||
|
||||
bool 'ar' CONFIG_AR
|
||||
bool 'bunzip2' CONFIG_BUNZIP2
|
||||
bool 'cpio' CONFIG_CPIO
|
||||
bool 'dpkg' CONFIG_DPKG
|
||||
bool 'dpkg_deb' CONFIG_DPKG_DEB
|
||||
bool 'gunzip' CONFIG_GUNZIP
|
||||
bool 'gzip' CONFIG_GZIP
|
||||
bool 'rpm2cpio' CONFIG_RPM2CPIO
|
||||
bool 'tar' CONFIG_TAR
|
||||
if [ "$CONFIG_TAR" = "y" ] ; then
|
||||
bool ' Enable archive creation' CONFIG_FEATURE_TAR_CREATE
|
||||
bool ' Enable -X and --exclude options (exclude files)' CONFIG_FEATURE_TAR_EXCLUDE
|
||||
bool ' Enable -z option (currently only for extracting)' CONFIG_FEATURE_TAR_GZIP
|
||||
fi
|
||||
endmenu
|
||||
@@ -1,57 +0,0 @@
|
||||
# Makefile for busybox
|
||||
#
|
||||
# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
TOPDIR :=../..
|
||||
L_TARGET := libunarchive.a
|
||||
|
||||
obj-y := unarchive.o seek_sub_file.o
|
||||
obj-n :=
|
||||
obj- :=
|
||||
|
||||
ifeq ($(CONFIG_DPKG),y)
|
||||
obj-y += deb_extract.o get_header_ar.o get_header_tar.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DPKG_DEB),y)
|
||||
obj-y += deb_extract.o get_header_ar.o get_header_tar.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_AR),y)
|
||||
obj-y += get_header_ar.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CPIO),y)
|
||||
obj-y += get_header_cpio.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_RPM2CPIO),y)
|
||||
obj-y += get_header_cpio.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TAR),y)
|
||||
obj-y += get_header_tar.o
|
||||
endif
|
||||
|
||||
|
||||
# Hand off to toplevel Rules.mak
|
||||
include $(TOPDIR)/Rules.mak
|
||||
|
||||
clean:
|
||||
rm -f $(L_TARGET) *.o core
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "unarchive.h"
|
||||
#include "libbb.h"
|
||||
|
||||
char *deb_extract(const char *package_filename, FILE *out_stream,
|
||||
const int extract_function, const char *prefix, const char *filename)
|
||||
{
|
||||
FILE *deb_stream;
|
||||
FILE *uncompressed_stream = NULL;
|
||||
file_header_t *ar_header = NULL;
|
||||
char **file_list = NULL;
|
||||
char *output_buffer = NULL;
|
||||
char *ared_file = NULL;
|
||||
char ar_magic[8];
|
||||
int gunzip_pid;
|
||||
|
||||
if (filename != NULL) {
|
||||
file_list = xmalloc(sizeof(char *) * 2);
|
||||
file_list[0] = xstrdup(filename);
|
||||
file_list[1] = NULL;
|
||||
}
|
||||
|
||||
if (extract_function & extract_control_tar_gz) {
|
||||
ared_file = xstrdup("control.tar.gz");
|
||||
}
|
||||
else if (extract_function & extract_data_tar_gz) {
|
||||
ared_file = xstrdup("data.tar.gz");
|
||||
}
|
||||
|
||||
/* open the debian package to be worked on */
|
||||
deb_stream = wfopen(package_filename, "r");
|
||||
if (deb_stream == NULL) {
|
||||
return(NULL);
|
||||
}
|
||||
/* set the buffer size */
|
||||
setvbuf(deb_stream, NULL, _IOFBF, 0x8000);
|
||||
|
||||
/* check ar magic */
|
||||
fread(ar_magic, 1, 8, deb_stream);
|
||||
if (strncmp(ar_magic,"!<arch>",7) != 0) {
|
||||
error_msg_and_die("invalid magic");
|
||||
}
|
||||
archive_offset = 8;
|
||||
|
||||
while ((ar_header = get_header_ar(deb_stream)) != NULL) {
|
||||
if (strcmp(ared_file, ar_header->name) == 0) {
|
||||
/* open a stream of decompressed data */
|
||||
uncompressed_stream = gz_open(deb_stream, &gunzip_pid);
|
||||
archive_offset = 0;
|
||||
output_buffer = unarchive(uncompressed_stream, out_stream, get_header_tar, extract_function, prefix, file_list, NULL);
|
||||
}
|
||||
seek_sub_file(deb_stream, ar_header->size);
|
||||
free(ar_header->name);
|
||||
free(ar_header);
|
||||
}
|
||||
gz_close(gunzip_pid);
|
||||
fclose(deb_stream);
|
||||
fclose(uncompressed_stream);
|
||||
free(ared_file);
|
||||
if (filename != NULL) {
|
||||
free(file_list[0]);
|
||||
free(file_list);
|
||||
}
|
||||
return(output_buffer);
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "unarchive.h"
|
||||
#include "libbb.h"
|
||||
|
||||
file_header_t *get_header_ar(FILE *src_stream)
|
||||
{
|
||||
file_header_t *typed;
|
||||
union {
|
||||
char raw[60];
|
||||
struct {
|
||||
char name[16];
|
||||
char date[12];
|
||||
char uid[6];
|
||||
char gid[6];
|
||||
char mode[8];
|
||||
char size[10];
|
||||
char magic[2];
|
||||
} formated;
|
||||
} ar;
|
||||
static char *ar_long_names;
|
||||
|
||||
if (fread(ar.raw, 1, 60, src_stream) != 60) {
|
||||
return(NULL);
|
||||
}
|
||||
archive_offset += 60;
|
||||
/* align the headers based on the header magic */
|
||||
if ((ar.formated.magic[0] != '`') || (ar.formated.magic[1] != '\n')) {
|
||||
/* some version of ar, have an extra '\n' after each data entry,
|
||||
* this puts the next header out by 1 */
|
||||
if (ar.formated.magic[1] != '`') {
|
||||
error_msg("Invalid magic");
|
||||
return(NULL);
|
||||
}
|
||||
/* read the next char out of what would be the data section,
|
||||
* if its a '\n' then it is a valid header offset by 1*/
|
||||
archive_offset++;
|
||||
if (fgetc(src_stream) != '\n') {
|
||||
error_msg("Invalid magic");
|
||||
return(NULL);
|
||||
}
|
||||
/* fix up the header, we started reading 1 byte too early */
|
||||
/* raw_header[60] wont be '\n' as it should, but it doesnt matter */
|
||||
memmove(ar.raw, &ar.raw[1], 59);
|
||||
}
|
||||
|
||||
typed = (file_header_t *) xcalloc(1, sizeof(file_header_t));
|
||||
|
||||
typed->size = (size_t) atoi(ar.formated.size);
|
||||
/* long filenames have '/' as the first character */
|
||||
if (ar.formated.name[0] == '/') {
|
||||
if (ar.formated.name[1] == '/') {
|
||||
/* If the second char is a '/' then this entries data section
|
||||
* stores long filename for multiple entries, they are stored
|
||||
* in static variable long_names for use in future entries */
|
||||
ar_long_names = (char *) xrealloc(ar_long_names, typed->size);
|
||||
fread(ar_long_names, 1, typed->size, src_stream);
|
||||
archive_offset += typed->size;
|
||||
/* This ar entries data section only contained filenames for other records
|
||||
* they are stored in the static ar_long_names for future reference */
|
||||
return (get_header_ar(src_stream)); /* Return next header */
|
||||
} else if (ar.formated.name[1] == ' ') {
|
||||
/* This is the index of symbols in the file for compilers */
|
||||
seek_sub_file(src_stream, typed->size);
|
||||
return (get_header_ar(src_stream)); /* Return next header */
|
||||
} else {
|
||||
/* The number after the '/' indicates the offset in the ar data section
|
||||
(saved in variable long_name) that conatains the real filename */
|
||||
if (!ar_long_names) {
|
||||
error_msg("Cannot resolve long file name");
|
||||
return (NULL);
|
||||
}
|
||||
typed->name = xstrdup(ar_long_names + atoi(&ar.formated.name[1]));
|
||||
}
|
||||
} else {
|
||||
/* short filenames */
|
||||
typed->name = xcalloc(1, 16);
|
||||
strncpy(typed->name, ar.formated.name, 16);
|
||||
}
|
||||
typed->name[strcspn(typed->name, " /")]='\0';
|
||||
|
||||
/* convert the rest of the now valid char header to its typed struct */
|
||||
parse_mode(ar.formated.mode, &typed->mode);
|
||||
typed->mtime = atoi(ar.formated.date);
|
||||
typed->uid = atoi(ar.formated.uid);
|
||||
typed->gid = atoi(ar.formated.gid);
|
||||
|
||||
return(typed);
|
||||
}
|
||||
@@ -1,136 +0,0 @@
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "unarchive.h"
|
||||
#include "libbb.h"
|
||||
|
||||
struct hardlinks {
|
||||
file_header_t *entry;
|
||||
int inode;
|
||||
struct hardlinks *next;
|
||||
};
|
||||
|
||||
file_header_t *get_header_cpio(FILE *src_stream)
|
||||
{
|
||||
file_header_t *cpio_entry = NULL;
|
||||
char cpio_header[110];
|
||||
int namesize;
|
||||
char dummy[16];
|
||||
int major, minor, nlink, inode;
|
||||
static struct hardlinks *saved_hardlinks = NULL;
|
||||
static int pending_hardlinks = 0;
|
||||
|
||||
if (pending_hardlinks) { /* Deal with any pending hardlinks */
|
||||
struct hardlinks *tmp = saved_hardlinks, *oldtmp = NULL;
|
||||
while (tmp) {
|
||||
if (tmp->entry->link_name) { /* Found a hardlink ready to be extracted */
|
||||
cpio_entry = tmp->entry;
|
||||
if (oldtmp) oldtmp->next = tmp->next; /* Remove item from linked list */
|
||||
else saved_hardlinks = tmp->next;
|
||||
free(tmp);
|
||||
return (cpio_entry);
|
||||
}
|
||||
oldtmp = tmp;
|
||||
tmp = tmp->next;
|
||||
}
|
||||
pending_hardlinks = 0; /* No more pending hardlinks, read next file entry */
|
||||
}
|
||||
|
||||
/* There can be padding before archive header */
|
||||
seek_sub_file(src_stream, (4 - (archive_offset % 4)) % 4);
|
||||
if (fread(cpio_header, 1, 110, src_stream) == 110) {
|
||||
archive_offset += 110;
|
||||
if (strncmp(cpio_header, "07070", 5) != 0) {
|
||||
error_msg("Unsupported format or invalid magic");
|
||||
return(NULL);
|
||||
}
|
||||
switch (cpio_header[5]) {
|
||||
case '2': /* "crc" header format */
|
||||
/* Doesnt do the crc check yet */
|
||||
case '1': /* "newc" header format */
|
||||
cpio_entry = (file_header_t *) xcalloc(1, sizeof(file_header_t));
|
||||
sscanf(cpio_header, "%6c%8x%8x%8x%8x%8x%8lx%8lx%16c%8x%8x%8x%8c",
|
||||
dummy, &inode, (unsigned int*)&cpio_entry->mode,
|
||||
(unsigned int*)&cpio_entry->uid, (unsigned int*)&cpio_entry->gid,
|
||||
&nlink, &cpio_entry->mtime, &cpio_entry->size,
|
||||
dummy, &major, &minor, &namesize, dummy);
|
||||
|
||||
cpio_entry->name = (char *) xcalloc(1, namesize);
|
||||
fread(cpio_entry->name, 1, namesize, src_stream); /* Read in filename */
|
||||
archive_offset += namesize;
|
||||
/* Skip padding before file contents */
|
||||
seek_sub_file(src_stream, (4 - (archive_offset % 4)) % 4);
|
||||
if (strcmp(cpio_entry->name, "TRAILER!!!") == 0) {
|
||||
printf("%d blocks\n", (int) (archive_offset % 512 ? (archive_offset / 512) + 1 : archive_offset / 512)); /* Always round up */
|
||||
if (saved_hardlinks) { /* Bummer - we still have unresolved hardlinks */
|
||||
struct hardlinks *tmp = saved_hardlinks, *oldtmp = NULL;
|
||||
while (tmp) {
|
||||
error_msg("%s not created: cannot resolve hardlink", tmp->entry->name);
|
||||
oldtmp = tmp;
|
||||
tmp = tmp->next;
|
||||
free (oldtmp->entry->name);
|
||||
free (oldtmp->entry);
|
||||
free (oldtmp);
|
||||
}
|
||||
saved_hardlinks = NULL;
|
||||
pending_hardlinks = 0;
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
if (S_ISLNK(cpio_entry->mode)) {
|
||||
cpio_entry->link_name = (char *) xcalloc(1, cpio_entry->size + 1);
|
||||
fread(cpio_entry->link_name, 1, cpio_entry->size, src_stream);
|
||||
archive_offset += cpio_entry->size;
|
||||
cpio_entry->size = 0; /* Stop possiable seeks in future */
|
||||
}
|
||||
if (nlink > 1 && !S_ISDIR(cpio_entry->mode)) {
|
||||
if (cpio_entry->size == 0) { /* Put file on a linked list for later */
|
||||
struct hardlinks *new = xmalloc(sizeof(struct hardlinks));
|
||||
new->next = saved_hardlinks;
|
||||
new->inode = inode;
|
||||
new->entry = cpio_entry;
|
||||
saved_hardlinks = new;
|
||||
return(get_header_cpio(src_stream)); /* Recurse to next file */
|
||||
} else { /* Found the file with data in */
|
||||
struct hardlinks *tmp = saved_hardlinks;
|
||||
pending_hardlinks = 1;
|
||||
while (tmp) {
|
||||
if (tmp->inode == inode) {
|
||||
tmp->entry->link_name = xstrdup(cpio_entry->name);
|
||||
nlink--;
|
||||
}
|
||||
tmp = tmp->next;
|
||||
}
|
||||
if (nlink > 1) error_msg("error resolving hardlink: did you create the archive with GNU cpio 2.0-2.2?");
|
||||
}
|
||||
}
|
||||
cpio_entry->device = (major << 8) | minor;
|
||||
break;
|
||||
default:
|
||||
error_msg("Unsupported format");
|
||||
return(NULL);
|
||||
}
|
||||
if (ferror(src_stream) || feof(src_stream)) {
|
||||
perror_msg("Stream error");
|
||||
return(NULL);
|
||||
}
|
||||
}
|
||||
return(cpio_entry);
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "unarchive.h"
|
||||
#include "libbb.h"
|
||||
|
||||
file_header_t *get_header_tar(FILE *tar_stream)
|
||||
{
|
||||
union {
|
||||
unsigned char raw[512];
|
||||
struct {
|
||||
char name[100]; /* 0-99 */
|
||||
char mode[8]; /* 100-107 */
|
||||
char uid[8]; /* 108-115 */
|
||||
char gid[8]; /* 116-123 */
|
||||
char size[12]; /* 124-135 */
|
||||
char mtime[12]; /* 136-147 */
|
||||
char chksum[8]; /* 148-155 */
|
||||
char typeflag; /* 156-156 */
|
||||
char linkname[100]; /* 157-256 */
|
||||
char magic[6]; /* 257-262 */
|
||||
char version[2]; /* 263-264 */
|
||||
char uname[32]; /* 265-296 */
|
||||
char gname[32]; /* 297-328 */
|
||||
char devmajor[8]; /* 329-336 */
|
||||
char devminor[8]; /* 337-344 */
|
||||
char prefix[155]; /* 345-499 */
|
||||
char padding[12]; /* 500-512 */
|
||||
} formated;
|
||||
} tar;
|
||||
file_header_t *tar_entry = NULL;
|
||||
long sum = 0;
|
||||
long i;
|
||||
|
||||
if (archive_offset % 512 != 0) {
|
||||
seek_sub_file(tar_stream, 512 - (archive_offset % 512));
|
||||
}
|
||||
|
||||
if (fread(tar.raw, 1, 512, tar_stream) != 512) {
|
||||
/* Unfortunatly its common for tar files to have all sorts of
|
||||
* trailing garbage, fail silently */
|
||||
// error_msg("Couldnt read header");
|
||||
return(NULL);
|
||||
}
|
||||
archive_offset += 512;
|
||||
|
||||
/* Check header has valid magic, unfortunately some tar files
|
||||
* have empty (0'ed) tar entries at the end, which will
|
||||
* cause this to fail, so fail silently for now
|
||||
*/
|
||||
if (strncmp(tar.formated.magic, "ustar", 5) != 0) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/* Do checksum on headers */
|
||||
for (i = 0; i < 148 ; i++) {
|
||||
sum += tar.raw[i];
|
||||
}
|
||||
sum += ' ' * 8;
|
||||
for (i = 156; i < 512 ; i++) {
|
||||
sum += tar.raw[i];
|
||||
}
|
||||
if (sum != strtol(tar.formated.chksum, NULL, 8)) {
|
||||
error_msg("Invalid tar header checksum");
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/* convert to type'ed variables */
|
||||
tar_entry = xcalloc(1, sizeof(file_header_t));
|
||||
tar_entry->name = xstrdup(tar.formated.name);
|
||||
|
||||
parse_mode(tar.formated.mode, &tar_entry->mode);
|
||||
tar_entry->uid = strtol(tar.formated.uid, NULL, 8);
|
||||
tar_entry->gid = strtol(tar.formated.gid, NULL, 8);
|
||||
tar_entry->size = strtol(tar.formated.size, NULL, 8);
|
||||
tar_entry->mtime = strtol(tar.formated.mtime, NULL, 8);
|
||||
tar_entry->link_name = strlen(tar.formated.linkname) ?
|
||||
xstrdup(tar.formated.linkname) : NULL;
|
||||
tar_entry->device = (strtol(tar.formated.devmajor, NULL, 8) << 8) +
|
||||
strtol(tar.formated.devminor, NULL, 8);
|
||||
|
||||
return(tar_entry);
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
off_t archive_offset;
|
||||
|
||||
void seek_sub_file(FILE *src_stream, const int count)
|
||||
{
|
||||
/* Try to fseek as faster */
|
||||
archive_offset += count;
|
||||
if (fseek(src_stream, count, SEEK_CUR) != 0 && errno == ESPIPE) {
|
||||
int i;
|
||||
for (i = 0; i < count; i++) {
|
||||
fgetc(src_stream);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1,241 +0,0 @@
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <fnmatch.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <utime.h>
|
||||
#include "unarchive.h"
|
||||
#include "libbb.h"
|
||||
|
||||
/* Extract the data postioned at src_stream to either filesystem, stdout or
|
||||
* buffer depending on the value of 'function' which is defined in libbb.h
|
||||
*
|
||||
* prefix doesnt have to be just a directory, it may prefix the filename as well.
|
||||
*
|
||||
* e.g. '/var/lib/dpkg/info/dpkg.' will extract all files to the base bath
|
||||
* '/var/lib/dpkg/info/' and all files/dirs created in that dir will have
|
||||
* 'dpkg.' as their prefix
|
||||
*
|
||||
* For this reason if prefix does point to a dir then it must end with a
|
||||
* trailing '/' or else the last dir will be assumed to be the file prefix
|
||||
*/
|
||||
char *extract_archive(FILE *src_stream, FILE *out_stream, const file_header_t *file_entry,
|
||||
const int function, const char *prefix)
|
||||
{
|
||||
FILE *dst_stream = NULL;
|
||||
char *full_name = NULL;
|
||||
char *buffer = NULL;
|
||||
struct utimbuf t;
|
||||
|
||||
/* prefix doesnt have to be a proper path it may prepend
|
||||
* the filename as well */
|
||||
if (prefix != NULL) {
|
||||
/* strip leading '/' in filename to extract as prefix may not be dir */
|
||||
/* Cant use concat_path_file here as prefix might not be a directory */
|
||||
char *path = file_entry->name;
|
||||
if (strncmp("./", path, 2) == 0) {
|
||||
path += 2;
|
||||
if (strlen(path) == 0) {
|
||||
return(NULL);
|
||||
}
|
||||
}
|
||||
full_name = xmalloc(strlen(prefix) + strlen(path) + 1);
|
||||
strcpy(full_name, prefix);
|
||||
strcat(full_name, path);
|
||||
} else {
|
||||
full_name = file_entry->name;
|
||||
}
|
||||
if (function & extract_to_stdout) {
|
||||
if (S_ISREG(file_entry->mode)) {
|
||||
copy_file_chunk(src_stream, out_stream, file_entry->size);
|
||||
archive_offset += file_entry->size;
|
||||
}
|
||||
}
|
||||
else if (function & extract_one_to_buffer) {
|
||||
if (S_ISREG(file_entry->mode)) {
|
||||
buffer = (char *) xmalloc(file_entry->size + 1);
|
||||
fread(buffer, 1, file_entry->size, src_stream);
|
||||
buffer[file_entry->size] = '\0';
|
||||
archive_offset += file_entry->size;
|
||||
return(buffer);
|
||||
}
|
||||
}
|
||||
else if (function & extract_all_to_fs) {
|
||||
struct stat oldfile;
|
||||
int stat_res;
|
||||
stat_res = lstat (full_name, &oldfile);
|
||||
if (stat_res == 0) { /* The file already exists */
|
||||
if ((function & extract_unconditional) || (oldfile.st_mtime < file_entry->mtime)) {
|
||||
if (!S_ISDIR(oldfile.st_mode)) {
|
||||
unlink(full_name); /* Directories might not be empty etc */
|
||||
}
|
||||
} else {
|
||||
if ((function & extract_quiet) != extract_quiet) {
|
||||
error_msg("%s not created: newer or same age file exists", file_entry->name);
|
||||
}
|
||||
seek_sub_file(src_stream, file_entry->size);
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
if (function & extract_create_leading_dirs) { /* Create leading directories with default umask */
|
||||
char *buf, *parent;
|
||||
buf = xstrdup(full_name);
|
||||
parent = dirname(buf);
|
||||
if (make_directory (parent, -1, FILEUTILS_RECUR) != 0) {
|
||||
if ((function & extract_quiet) != extract_quiet) {
|
||||
error_msg("couldn't create leading directories");
|
||||
}
|
||||
}
|
||||
free (buf);
|
||||
}
|
||||
switch(file_entry->mode & S_IFMT) {
|
||||
case S_IFREG:
|
||||
if (file_entry->link_name) { /* Found a cpio hard link */
|
||||
if (link(file_entry->link_name, full_name) != 0) {
|
||||
if ((function & extract_quiet) != extract_quiet) {
|
||||
perror_msg("Cannot link from %s to '%s'",
|
||||
file_entry->name, file_entry->link_name);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ((dst_stream = wfopen(full_name, "w")) == NULL) {
|
||||
seek_sub_file(src_stream, file_entry->size);
|
||||
return NULL;
|
||||
}
|
||||
archive_offset += file_entry->size;
|
||||
copy_file_chunk(src_stream, dst_stream, file_entry->size);
|
||||
fclose(dst_stream);
|
||||
}
|
||||
break;
|
||||
case S_IFDIR:
|
||||
if (stat_res != 0) {
|
||||
if (mkdir(full_name, file_entry->mode) < 0) {
|
||||
if ((function & extract_quiet) != extract_quiet) {
|
||||
perror_msg("extract_archive: %s", full_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case S_IFLNK:
|
||||
if (symlink(file_entry->link_name, full_name) < 0) {
|
||||
if ((function & extract_quiet) != extract_quiet) {
|
||||
perror_msg("Cannot create symlink from %s to '%s'", file_entry->name, file_entry->link_name);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
case S_IFSOCK:
|
||||
case S_IFBLK:
|
||||
case S_IFCHR:
|
||||
case S_IFIFO:
|
||||
if (mknod(full_name, file_entry->mode, file_entry->device) == -1) {
|
||||
if ((function & extract_quiet) != extract_quiet) {
|
||||
perror_msg("Cannot create node %s", file_entry->name);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* Changing a symlink's properties normally changes the properties of the
|
||||
* file pointed to, so dont try and change the date or mode, lchown does
|
||||
* does the right thing, but isnt available in older versions of libc */
|
||||
if (S_ISLNK(file_entry->mode)) {
|
||||
#if (__GLIBC__ > 2) && (__GLIBC_MINOR__ > 1)
|
||||
lchown(full_name, file_entry->uid, file_entry->gid);
|
||||
#endif
|
||||
} else {
|
||||
if (function & extract_preserve_date) {
|
||||
t.actime = file_entry->mtime;
|
||||
t.modtime = file_entry->mtime;
|
||||
utime(full_name, &t);
|
||||
}
|
||||
chmod(full_name, file_entry->mode);
|
||||
chown(full_name, file_entry->uid, file_entry->gid);
|
||||
}
|
||||
} else {
|
||||
/* If we arent extracting data we have to skip it,
|
||||
* if data size is 0 then then just do it anyway
|
||||
* (saves testing for it) */
|
||||
seek_sub_file(src_stream, file_entry->size);
|
||||
}
|
||||
|
||||
/* extract_list and extract_verbose_list can be used in conjunction
|
||||
* with one of the above four extraction functions, so do this seperately */
|
||||
if (function & extract_verbose_list) {
|
||||
fprintf(out_stream, "%s %d/%d %8d %s ", mode_string(file_entry->mode),
|
||||
file_entry->uid, file_entry->gid,
|
||||
(int) file_entry->size, time_string(file_entry->mtime));
|
||||
}
|
||||
if ((function & extract_list) || (function & extract_verbose_list)){
|
||||
/* fputs doesnt add a trailing \n, so use fprintf */
|
||||
fprintf(out_stream, "%s\n", full_name);
|
||||
}
|
||||
|
||||
free(full_name);
|
||||
|
||||
return(NULL); /* Maybe we should say if failed */
|
||||
}
|
||||
|
||||
char *unarchive(FILE *src_stream, FILE *out_stream, file_header_t *(*get_headers)(FILE *),
|
||||
const int extract_function, const char *prefix, char **include_name, char **exclude_name)
|
||||
{
|
||||
file_header_t *file_entry;
|
||||
int extract_flag = TRUE;
|
||||
int i;
|
||||
char *buffer = NULL;
|
||||
|
||||
archive_offset = 0;
|
||||
while ((file_entry = get_headers(src_stream)) != NULL) {
|
||||
|
||||
if (include_name != NULL) {
|
||||
extract_flag = FALSE;
|
||||
for(i = 0; include_name[i] != 0; i++) {
|
||||
if (fnmatch(include_name[i], file_entry->name, FNM_LEADING_DIR) == 0) {
|
||||
extract_flag = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
extract_flag = TRUE;
|
||||
}
|
||||
|
||||
/* If the file entry is in the exclude list dont extract it */
|
||||
if (exclude_name != NULL) {
|
||||
for(i = 0; exclude_name[i] != 0; i++) {
|
||||
if (fnmatch(exclude_name[i], file_entry->name, FNM_LEADING_DIR) == 0) {
|
||||
extract_flag = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (extract_flag == TRUE) {
|
||||
buffer = extract_archive(src_stream, out_stream, file_entry, extract_function, prefix);
|
||||
} else {
|
||||
/* seek past the data entry */
|
||||
seek_sub_file(src_stream, file_entry->size);
|
||||
}
|
||||
free(file_entry->name);
|
||||
free(file_entry->link_name);
|
||||
free(file_entry);
|
||||
}
|
||||
return(buffer);
|
||||
}
|
||||
@@ -1,752 +0,0 @@
|
||||
/* vi: set sw=4 ts=4: */
|
||||
/*
|
||||
* Mini tar implementation for busybox
|
||||
*
|
||||
* Modifed to use common extraction code used by ar, cpio, dpkg-deb, dpkg
|
||||
* Glenn McGrath <bug1@optushome.com.au>
|
||||
*
|
||||
* Note, that as of BusyBox-0.43, tar has been completely rewritten from the
|
||||
* ground up. It still has remnents of the old code lying about, but it is
|
||||
* very different now (i.e., cleaner, less global variables, etc.)
|
||||
*
|
||||
* Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
|
||||
* Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
|
||||
*
|
||||
* Based in part in the tar implementation in sash
|
||||
* Copyright (c) 1999 by David I. Bell
|
||||
* Permission is granted to use, distribute, or modify this source,
|
||||
* provided that this copyright notice remains intact.
|
||||
* Permission to distribute sash derived code under the GPL has been granted.
|
||||
*
|
||||
* Based in part on the tar implementation from busybox-0.28
|
||||
* Copyright (C) 1995 Bruce Perens
|
||||
* This is free software under the GNU General Public License.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
#include <search.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <fnmatch.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include "unarchive.h"
|
||||
#include "busybox.h"
|
||||
|
||||
#ifdef CONFIG_FEATURE_TAR_CREATE
|
||||
|
||||
/* Tar file constants */
|
||||
# define TAR_MAGIC "ustar" /* ustar and a null */
|
||||
# define TAR_VERSION " " /* Be compatable with GNU tar format */
|
||||
|
||||
# ifndef MAJOR
|
||||
# define MAJOR(dev) (((dev)>>8)&0xff)
|
||||
# define MINOR(dev) ((dev)&0xff)
|
||||
# endif
|
||||
|
||||
static const int TAR_BLOCK_SIZE = 512;
|
||||
static const int TAR_MAGIC_LEN = 6;
|
||||
static const int TAR_VERSION_LEN = 2;
|
||||
|
||||
/* POSIX tar Header Block, from POSIX 1003.1-1990 */
|
||||
enum { NAME_SIZE = 100 }; /* because gcc won't let me use 'static const int' */
|
||||
struct TarHeader
|
||||
{ /* byte offset */
|
||||
char name[NAME_SIZE]; /* 0-99 */
|
||||
char mode[8]; /* 100-107 */
|
||||
char uid[8]; /* 108-115 */
|
||||
char gid[8]; /* 116-123 */
|
||||
char size[12]; /* 124-135 */
|
||||
char mtime[12]; /* 136-147 */
|
||||
char chksum[8]; /* 148-155 */
|
||||
char typeflag; /* 156-156 */
|
||||
char linkname[NAME_SIZE]; /* 157-256 */
|
||||
char magic[6]; /* 257-262 */
|
||||
char version[2]; /* 263-264 */
|
||||
char uname[32]; /* 265-296 */
|
||||
char gname[32]; /* 297-328 */
|
||||
char devmajor[8]; /* 329-336 */
|
||||
char devminor[8]; /* 337-344 */
|
||||
char prefix[155]; /* 345-499 */
|
||||
char padding[12]; /* 500-512 (pad to exactly the TAR_BLOCK_SIZE) */
|
||||
};
|
||||
typedef struct TarHeader TarHeader;
|
||||
|
||||
/*
|
||||
** writeTarFile(), writeFileToTarball(), and writeTarHeader() are
|
||||
** the only functions that deal with the HardLinkInfo structure.
|
||||
** Even these functions use the xxxHardLinkInfo() functions.
|
||||
*/
|
||||
typedef struct HardLinkInfo HardLinkInfo;
|
||||
struct HardLinkInfo
|
||||
{
|
||||
HardLinkInfo *next; /* Next entry in list */
|
||||
dev_t dev; /* Device number */
|
||||
ino_t ino; /* Inode number */
|
||||
short linkCount; /* (Hard) Link Count */
|
||||
char name[1]; /* Start of filename (must be last) */
|
||||
};
|
||||
|
||||
/* Some info to be carried along when creating a new tarball */
|
||||
struct TarBallInfo
|
||||
{
|
||||
char* fileName; /* File name of the tarball */
|
||||
int tarFd; /* Open-for-write file descriptor
|
||||
for the tarball */
|
||||
struct stat statBuf; /* Stat info for the tarball, letting
|
||||
us know the inode and device that the
|
||||
tarball lives, so we can avoid trying
|
||||
to include the tarball into itself */
|
||||
int verboseFlag; /* Whether to print extra stuff or not */
|
||||
char** excludeList; /* List of files to not include */
|
||||
HardLinkInfo *hlInfoHead; /* Hard Link Tracking Information */
|
||||
HardLinkInfo *hlInfo; /* Hard Link Info for the current file */
|
||||
};
|
||||
typedef struct TarBallInfo TarBallInfo;
|
||||
|
||||
/* A nice enum with all the possible tar file content types */
|
||||
enum TarFileType
|
||||
{
|
||||
REGTYPE = '0', /* regular file */
|
||||
REGTYPE0 = '\0', /* regular file (ancient bug compat)*/
|
||||
LNKTYPE = '1', /* hard link */
|
||||
SYMTYPE = '2', /* symbolic link */
|
||||
CHRTYPE = '3', /* character special */
|
||||
BLKTYPE = '4', /* block special */
|
||||
DIRTYPE = '5', /* directory */
|
||||
FIFOTYPE = '6', /* FIFO special */
|
||||
CONTTYPE = '7', /* reserved */
|
||||
GNULONGLINK = 'K', /* GNU long (>100 chars) link name */
|
||||
GNULONGNAME = 'L', /* GNU long (>100 chars) file name */
|
||||
};
|
||||
typedef enum TarFileType TarFileType;
|
||||
|
||||
/* Might be faster (and bigger) if the dev/ino were stored in numeric order;) */
|
||||
static void
|
||||
addHardLinkInfo (HardLinkInfo **hlInfoHeadPtr, dev_t dev, ino_t ino,
|
||||
short linkCount, const char *name)
|
||||
{
|
||||
/* Note: hlInfoHeadPtr can never be NULL! */
|
||||
HardLinkInfo *hlInfo;
|
||||
|
||||
hlInfo = (HardLinkInfo *)xmalloc(sizeof(HardLinkInfo)+strlen(name)+1);
|
||||
if (hlInfo) {
|
||||
hlInfo->next = *hlInfoHeadPtr;
|
||||
*hlInfoHeadPtr = hlInfo;
|
||||
hlInfo->dev = dev;
|
||||
hlInfo->ino = ino;
|
||||
hlInfo->linkCount = linkCount;
|
||||
strcpy(hlInfo->name, name);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
freeHardLinkInfo (HardLinkInfo **hlInfoHeadPtr)
|
||||
{
|
||||
HardLinkInfo *hlInfo = NULL;
|
||||
HardLinkInfo *hlInfoNext = NULL;
|
||||
|
||||
if (hlInfoHeadPtr) {
|
||||
hlInfo = *hlInfoHeadPtr;
|
||||
while (hlInfo) {
|
||||
hlInfoNext = hlInfo->next;
|
||||
free(hlInfo);
|
||||
hlInfo = hlInfoNext;
|
||||
}
|
||||
*hlInfoHeadPtr = NULL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* Might be faster (and bigger) if the dev/ino were stored in numeric order;) */
|
||||
static HardLinkInfo *
|
||||
findHardLinkInfo (HardLinkInfo *hlInfo, dev_t dev, ino_t ino)
|
||||
{
|
||||
while(hlInfo) {
|
||||
if ((ino == hlInfo->ino) && (dev == hlInfo->dev))
|
||||
break;
|
||||
hlInfo = hlInfo->next;
|
||||
}
|
||||
return(hlInfo);
|
||||
}
|
||||
|
||||
/* Put an octal string into the specified buffer.
|
||||
* The number is zero and space padded and possibly null padded.
|
||||
* Returns TRUE if successful. */
|
||||
static int putOctal (char *cp, int len, long value)
|
||||
{
|
||||
int tempLength;
|
||||
char tempBuffer[32];
|
||||
char *tempString = tempBuffer;
|
||||
|
||||
/* Create a string of the specified length with an initial space,
|
||||
* leading zeroes and the octal number, and a trailing null. */
|
||||
sprintf (tempString, "%0*lo", len - 1, value);
|
||||
|
||||
/* If the string is too large, suppress the leading space. */
|
||||
tempLength = strlen (tempString) + 1;
|
||||
if (tempLength > len) {
|
||||
tempLength--;
|
||||
tempString++;
|
||||
}
|
||||
|
||||
/* If the string is still too large, suppress the trailing null. */
|
||||
if (tempLength > len)
|
||||
tempLength--;
|
||||
|
||||
/* If the string is still too large, fail. */
|
||||
if (tempLength > len)
|
||||
return FALSE;
|
||||
|
||||
/* Copy the string to the field. */
|
||||
memcpy (cp, tempString, len);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Write out a tar header for the specified file/directory/whatever */
|
||||
static int
|
||||
writeTarHeader(struct TarBallInfo *tbInfo, const char *header_name,
|
||||
const char *real_name, struct stat *statbuf)
|
||||
{
|
||||
long chksum=0;
|
||||
struct TarHeader header;
|
||||
const unsigned char *cp = (const unsigned char *) &header;
|
||||
ssize_t size = sizeof(struct TarHeader);
|
||||
|
||||
memset( &header, 0, size);
|
||||
|
||||
strncpy(header.name, header_name, sizeof(header.name));
|
||||
|
||||
putOctal(header.mode, sizeof(header.mode), statbuf->st_mode);
|
||||
putOctal(header.uid, sizeof(header.uid), statbuf->st_uid);
|
||||
putOctal(header.gid, sizeof(header.gid), statbuf->st_gid);
|
||||
putOctal(header.size, sizeof(header.size), 0); /* Regular file size is handled later */
|
||||
putOctal(header.mtime, sizeof(header.mtime), statbuf->st_mtime);
|
||||
strncpy(header.magic, TAR_MAGIC TAR_VERSION,
|
||||
TAR_MAGIC_LEN + TAR_VERSION_LEN );
|
||||
|
||||
/* Enter the user and group names (default to root if it fails) */
|
||||
my_getpwuid(header.uname, statbuf->st_uid);
|
||||
if (! *header.uname)
|
||||
strcpy(header.uname, "root");
|
||||
my_getgrgid(header.gname, statbuf->st_gid);
|
||||
if (! *header.uname)
|
||||
strcpy(header.uname, "root");
|
||||
|
||||
if (tbInfo->hlInfo) {
|
||||
/* This is a hard link */
|
||||
header.typeflag = LNKTYPE;
|
||||
strncpy(header.linkname, tbInfo->hlInfo->name, sizeof(header.linkname));
|
||||
} else if (S_ISLNK(statbuf->st_mode)) {
|
||||
char *lpath = xreadlink(real_name);
|
||||
if (!lpath) /* Already printed err msg inside xreadlink() */
|
||||
return ( FALSE);
|
||||
header.typeflag = SYMTYPE;
|
||||
strncpy(header.linkname, lpath, sizeof(header.linkname));
|
||||
free(lpath);
|
||||
} else if (S_ISDIR(statbuf->st_mode)) {
|
||||
header.typeflag = DIRTYPE;
|
||||
strncat(header.name, "/", sizeof(header.name));
|
||||
} else if (S_ISCHR(statbuf->st_mode)) {
|
||||
header.typeflag = CHRTYPE;
|
||||
putOctal(header.devmajor, sizeof(header.devmajor), MAJOR(statbuf->st_rdev));
|
||||
putOctal(header.devminor, sizeof(header.devminor), MINOR(statbuf->st_rdev));
|
||||
} else if (S_ISBLK(statbuf->st_mode)) {
|
||||
header.typeflag = BLKTYPE;
|
||||
putOctal(header.devmajor, sizeof(header.devmajor), MAJOR(statbuf->st_rdev));
|
||||
putOctal(header.devminor, sizeof(header.devminor), MINOR(statbuf->st_rdev));
|
||||
} else if (S_ISFIFO(statbuf->st_mode)) {
|
||||
header.typeflag = FIFOTYPE;
|
||||
} else if (S_ISREG(statbuf->st_mode)) {
|
||||
header.typeflag = REGTYPE;
|
||||
putOctal(header.size, sizeof(header.size), statbuf->st_size);
|
||||
} else {
|
||||
error_msg("%s: Unknown file type", real_name);
|
||||
return ( FALSE);
|
||||
}
|
||||
|
||||
/* Calculate and store the checksum (i.e., the sum of all of the bytes of
|
||||
* the header). The checksum field must be filled with blanks for the
|
||||
* calculation. The checksum field is formatted differently from the
|
||||
* other fields: it has [6] digits, a null, then a space -- rather than
|
||||
* digits, followed by a null like the other fields... */
|
||||
memset(header.chksum, ' ', sizeof(header.chksum));
|
||||
cp = (const unsigned char *) &header;
|
||||
while (size-- > 0)
|
||||
chksum += *cp++;
|
||||
putOctal(header.chksum, 7, chksum);
|
||||
|
||||
/* Now write the header out to disk */
|
||||
if ((size=full_write(tbInfo->tarFd, (char*)&header, sizeof(struct TarHeader))) < 0) {
|
||||
error_msg(io_error, real_name, strerror(errno));
|
||||
return ( FALSE);
|
||||
}
|
||||
/* Pad the header up to the tar block size */
|
||||
for (; size<TAR_BLOCK_SIZE; size++) {
|
||||
write(tbInfo->tarFd, "\0", 1);
|
||||
}
|
||||
/* Now do the verbose thing (or not) */
|
||||
if (tbInfo->verboseFlag==TRUE) {
|
||||
FILE *vbFd = stdout;
|
||||
if (tbInfo->tarFd == fileno(stdout)) // If the archive goes to stdout, verbose to stderr
|
||||
vbFd = stderr;
|
||||
fprintf(vbFd, "%s\n", header.name);
|
||||
}
|
||||
|
||||
return ( TRUE);
|
||||
}
|
||||
|
||||
# if defined CONFIG_FEATURE_TAR_EXCLUDE
|
||||
static int exclude_file(char **excluded_files, const char *file)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (excluded_files == NULL)
|
||||
return 0;
|
||||
|
||||
for (i = 0; excluded_files[i] != NULL; i++) {
|
||||
if (excluded_files[i][0] == '/') {
|
||||
if (fnmatch(excluded_files[i], file,
|
||||
FNM_PATHNAME | FNM_LEADING_DIR) == 0)
|
||||
return 1;
|
||||
} else {
|
||||
const char *p;
|
||||
|
||||
for (p = file; p[0] != '\0'; p++) {
|
||||
if ((p == file || p[-1] == '/') && p[0] != '/' &&
|
||||
fnmatch(excluded_files[i], p,
|
||||
FNM_PATHNAME | FNM_LEADING_DIR) == 0)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int writeFileToTarball(const char *fileName, struct stat *statbuf, void* userData)
|
||||
{
|
||||
struct TarBallInfo *tbInfo = (struct TarBallInfo *)userData;
|
||||
const char *header_name;
|
||||
|
||||
/*
|
||||
** Check to see if we are dealing with a hard link.
|
||||
** If so -
|
||||
** Treat the first occurance of a given dev/inode as a file while
|
||||
** treating any additional occurances as hard links. This is done
|
||||
** by adding the file information to the HardLinkInfo linked list.
|
||||
*/
|
||||
tbInfo->hlInfo = NULL;
|
||||
if (statbuf->st_nlink > 1) {
|
||||
tbInfo->hlInfo = findHardLinkInfo(tbInfo->hlInfoHead, statbuf->st_dev,
|
||||
statbuf->st_ino);
|
||||
if (tbInfo->hlInfo == NULL)
|
||||
addHardLinkInfo (&tbInfo->hlInfoHead, statbuf->st_dev,
|
||||
statbuf->st_ino, statbuf->st_nlink, fileName);
|
||||
}
|
||||
|
||||
/* It is against the rules to archive a socket */
|
||||
if (S_ISSOCK(statbuf->st_mode)) {
|
||||
error_msg("%s: socket ignored", fileName);
|
||||
return( TRUE);
|
||||
}
|
||||
|
||||
/* It is a bad idea to store the archive we are in the process of creating,
|
||||
* so check the device and inode to be sure that this particular file isn't
|
||||
* the new tarball */
|
||||
if (tbInfo->statBuf.st_dev == statbuf->st_dev &&
|
||||
tbInfo->statBuf.st_ino == statbuf->st_ino) {
|
||||
error_msg("%s: file is the archive; skipping", fileName);
|
||||
return( TRUE);
|
||||
}
|
||||
|
||||
header_name = fileName;
|
||||
while (header_name[0] == '/') {
|
||||
static int alreadyWarned=FALSE;
|
||||
if (alreadyWarned==FALSE) {
|
||||
error_msg("Removing leading '/' from member names");
|
||||
alreadyWarned=TRUE;
|
||||
}
|
||||
header_name++;
|
||||
}
|
||||
|
||||
if (strlen(fileName) >= NAME_SIZE) {
|
||||
error_msg(name_longer_than_foo, NAME_SIZE);
|
||||
return ( TRUE);
|
||||
}
|
||||
|
||||
if (header_name[0] == '\0')
|
||||
return TRUE;
|
||||
|
||||
# if defined CONFIG_FEATURE_TAR_EXCLUDE
|
||||
if (exclude_file(tbInfo->excludeList, header_name)) {
|
||||
return SKIP;
|
||||
}
|
||||
# endif //CONFIG_FEATURE_TAR_EXCLUDE
|
||||
|
||||
if (writeTarHeader(tbInfo, header_name, fileName, statbuf)==FALSE) {
|
||||
return( FALSE);
|
||||
}
|
||||
|
||||
/* Now, if the file is a regular file, copy it out to the tarball */
|
||||
if ((tbInfo->hlInfo == NULL)
|
||||
&& (S_ISREG(statbuf->st_mode))) {
|
||||
int inputFileFd;
|
||||
char buffer[BUFSIZ];
|
||||
ssize_t size=0, readSize=0;
|
||||
|
||||
/* open the file we want to archive, and make sure all is well */
|
||||
if ((inputFileFd = open(fileName, O_RDONLY)) < 0) {
|
||||
error_msg("%s: Cannot open: %s", fileName, strerror(errno));
|
||||
return( FALSE);
|
||||
}
|
||||
|
||||
/* write the file to the archive */
|
||||
while ( (size = full_read(inputFileFd, buffer, sizeof(buffer))) > 0 ) {
|
||||
if (full_write(tbInfo->tarFd, buffer, size) != size ) {
|
||||
/* Output file seems to have a problem */
|
||||
error_msg(io_error, fileName, strerror(errno));
|
||||
return( FALSE);
|
||||
}
|
||||
readSize+=size;
|
||||
}
|
||||
if (size == -1) {
|
||||
error_msg(io_error, fileName, strerror(errno));
|
||||
return( FALSE);
|
||||
}
|
||||
/* Pad the file up to the tar block size */
|
||||
for (; (readSize%TAR_BLOCK_SIZE) != 0; readSize++) {
|
||||
write(tbInfo->tarFd, "\0", 1);
|
||||
}
|
||||
close( inputFileFd);
|
||||
}
|
||||
|
||||
return( TRUE);
|
||||
}
|
||||
|
||||
static int writeTarFile(const char* tarName, int verboseFlag, char **argv,
|
||||
char** excludeList)
|
||||
{
|
||||
int tarFd=-1;
|
||||
int errorFlag=FALSE;
|
||||
ssize_t size;
|
||||
struct TarBallInfo tbInfo;
|
||||
tbInfo.verboseFlag = verboseFlag;
|
||||
tbInfo.hlInfoHead = NULL;
|
||||
|
||||
/* Make sure there is at least one file to tar up. */
|
||||
if (*argv == NULL)
|
||||
error_msg_and_die("Cowardly refusing to create an empty archive");
|
||||
|
||||
/* Open the tar file for writing. */
|
||||
if (!strcmp(tarName, "-"))
|
||||
tbInfo.tarFd = fileno(stdout);
|
||||
else
|
||||
tbInfo.tarFd = open (tarName, O_WRONLY | O_CREAT | O_TRUNC, 0644);
|
||||
if (tbInfo.tarFd < 0) {
|
||||
perror_msg( "Error opening '%s'", tarName);
|
||||
freeHardLinkInfo(&tbInfo.hlInfoHead);
|
||||
return ( FALSE);
|
||||
}
|
||||
tbInfo.excludeList=excludeList;
|
||||
/* Store the stat info for the tarball's file, so
|
||||
* can avoid including the tarball into itself.... */
|
||||
if (fstat(tbInfo.tarFd, &tbInfo.statBuf) < 0)
|
||||
error_msg_and_die(io_error, tarName, strerror(errno));
|
||||
|
||||
/* Read the directory/files and iterate over them one at a time */
|
||||
while (*argv != NULL) {
|
||||
if (recursive_action(*argv++, TRUE, FALSE, FALSE,
|
||||
writeFileToTarball, writeFileToTarball,
|
||||
(void*) &tbInfo) == FALSE) {
|
||||
errorFlag = TRUE;
|
||||
}
|
||||
}
|
||||
/* Write two empty blocks to the end of the archive */
|
||||
for (size=0; size<(2*TAR_BLOCK_SIZE); size++) {
|
||||
write(tbInfo.tarFd, "\0", 1);
|
||||
}
|
||||
|
||||
/* To be pedantically correct, we would check if the tarball
|
||||
* is smaller than 20 tar blocks, and pad it if it was smaller,
|
||||
* but that isn't necessary for GNU tar interoperability, and
|
||||
* so is considered a waste of space */
|
||||
|
||||
/* Hang up the tools, close up shop, head home */
|
||||
close(tarFd);
|
||||
if (errorFlag == TRUE) {
|
||||
error_msg("Error exit delayed from previous errors");
|
||||
freeHardLinkInfo(&tbInfo.hlInfoHead);
|
||||
return(FALSE);
|
||||
}
|
||||
freeHardLinkInfo(&tbInfo.hlInfoHead);
|
||||
return( TRUE);
|
||||
}
|
||||
#endif //tar_create
|
||||
|
||||
void append_file_to_list(const char *new_name, char ***list, int *list_count)
|
||||
{
|
||||
*list = realloc(*list, sizeof(char *) * (*list_count + 2));
|
||||
(*list)[*list_count] = xstrdup(new_name);
|
||||
(*list_count)++;
|
||||
(*list)[*list_count] = NULL;
|
||||
}
|
||||
|
||||
void append_file_list_to_list(char *filename, char ***name_list, int *num_of_entries)
|
||||
{
|
||||
FILE *src_stream;
|
||||
char *line;
|
||||
char *line_ptr;
|
||||
|
||||
src_stream = xfopen(filename, "r");
|
||||
while ((line = get_line_from_file(src_stream)) != NULL) {
|
||||
line_ptr = last_char_is(line, '\n');
|
||||
if (line_ptr) {
|
||||
*line_ptr = '\0';
|
||||
}
|
||||
append_file_to_list(line, name_list, num_of_entries);
|
||||
free(line);
|
||||
}
|
||||
fclose(src_stream);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FEATURE_TAR_EXCLUDE
|
||||
/*
|
||||
* Create a list of names that are in the include list AND NOT in the exclude lists
|
||||
*/
|
||||
char **list_and_not_list(char **include_list, char **exclude_list)
|
||||
{
|
||||
char **new_include_list = NULL;
|
||||
int new_include_count = 0;
|
||||
int include_count = 0;
|
||||
int exclude_count;
|
||||
|
||||
if (include_list == NULL) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
while (include_list[include_count] != NULL) {
|
||||
int found = FALSE;
|
||||
exclude_count = 0;
|
||||
while (exclude_list[exclude_count] != NULL) {
|
||||
if (strcmp(include_list[include_count], exclude_list[exclude_count]) == 0) {
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
exclude_count++;
|
||||
}
|
||||
|
||||
if (found == FALSE) {
|
||||
new_include_list = realloc(new_include_list, sizeof(char *) * (include_count + 2));
|
||||
new_include_list[new_include_count] = include_list[include_count];
|
||||
new_include_count++;
|
||||
} else {
|
||||
free(include_list[include_count]);
|
||||
}
|
||||
include_count++;
|
||||
}
|
||||
new_include_list[new_include_count] = NULL;
|
||||
return(new_include_list);
|
||||
}
|
||||
#endif
|
||||
|
||||
int tar_main(int argc, char **argv)
|
||||
{
|
||||
enum untar_funct_e {
|
||||
/* These are optional */
|
||||
untar_from_file = 1,
|
||||
untar_from_stdin = 2,
|
||||
untar_unzip = 4,
|
||||
/* Require one and only one of these */
|
||||
untar_list = 8,
|
||||
untar_create = 16,
|
||||
untar_extract = 32
|
||||
};
|
||||
|
||||
FILE *src_stream = NULL;
|
||||
FILE *uncompressed_stream = NULL;
|
||||
char **include_list = NULL;
|
||||
char **exclude_list = NULL;
|
||||
char *src_filename = NULL;
|
||||
char *dst_prefix = NULL;
|
||||
char *file_list_name = NULL;
|
||||
int opt;
|
||||
unsigned short untar_funct = 0;
|
||||
unsigned short untar_funct_required = 0;
|
||||
unsigned short extract_function = 0;
|
||||
int include_list_count = 0;
|
||||
#ifdef CONFIG_FEATURE_TAR_EXCLUDE
|
||||
int exclude_list_count = 0;
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_TAR_GZIP
|
||||
int gunzip_pid;
|
||||
int gz_fd = 0;
|
||||
#endif
|
||||
|
||||
if (argc < 2) {
|
||||
show_usage();
|
||||
}
|
||||
|
||||
/* Prepend '-' to the first argument if required */
|
||||
if (argv[1][0] != '-') {
|
||||
char *tmp = xmalloc(strlen(argv[1]) + 2);
|
||||
tmp[0] = '-';
|
||||
strcpy(tmp + 1, argv[1]);
|
||||
argv[1] = tmp;
|
||||
}
|
||||
|
||||
while ((opt = getopt(argc, argv, "ctxT:X:C:f:Opvz")) != -1) {
|
||||
switch (opt) {
|
||||
|
||||
/* One and only one of these is required */
|
||||
case 'c':
|
||||
untar_funct_required |= untar_create;
|
||||
break;
|
||||
case 't':
|
||||
untar_funct_required |= untar_list;
|
||||
extract_function |= extract_list |extract_unconditional;
|
||||
break;
|
||||
case 'x':
|
||||
untar_funct_required |= untar_extract;
|
||||
extract_function |= (extract_all_to_fs | extract_unconditional | extract_create_leading_dirs);
|
||||
break;
|
||||
|
||||
/* These are optional */
|
||||
/* Exclude or Include files listed in <filename>*/
|
||||
#ifdef CONFIG_FEATURE_TAR_EXCLUDE
|
||||
case 'X':
|
||||
append_file_list_to_list(optarg, &exclude_list, &exclude_list_count);
|
||||
break;
|
||||
#endif
|
||||
case 'T':
|
||||
// by default a list is an include list
|
||||
append_file_list_to_list(optarg, &include_list, &include_list_count);
|
||||
break;
|
||||
|
||||
case 'C': // Change to dir <optarg>
|
||||
/* Make sure dst_prefix ends in a '/' */
|
||||
dst_prefix = concat_path_file(optarg, "/");
|
||||
break;
|
||||
case 'f': // archive filename
|
||||
if (strcmp(optarg, "-") == 0) {
|
||||
// Untar from stdin to stdout
|
||||
untar_funct |= untar_from_stdin;
|
||||
} else {
|
||||
untar_funct |= untar_from_file;
|
||||
src_filename = xstrdup(optarg);
|
||||
}
|
||||
break;
|
||||
case 'O':
|
||||
extract_function |= extract_to_stdout;
|
||||
break;
|
||||
case 'p':
|
||||
break;
|
||||
case 'v':
|
||||
if (extract_function & extract_list) {
|
||||
extract_function |= extract_verbose_list;
|
||||
}
|
||||
extract_function |= extract_list;
|
||||
break;
|
||||
#ifdef CONFIG_FEATURE_TAR_GZIP
|
||||
case 'z':
|
||||
untar_funct |= untar_unzip;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
show_usage();
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure the valid arguments were passed */
|
||||
if (untar_funct_required == 0) {
|
||||
error_msg_and_die("You must specify one of the `-ctx' options");
|
||||
}
|
||||
if ((untar_funct_required != untar_create) &&
|
||||
(untar_funct_required != untar_extract) &&
|
||||
(untar_funct_required != untar_list)) {
|
||||
error_msg_and_die("You may not specify more than one `ctx' option.");
|
||||
}
|
||||
untar_funct |= untar_funct_required;
|
||||
|
||||
/* Setup an array of filenames to work with */
|
||||
while (optind < argc) {
|
||||
append_file_to_list(argv[optind], &include_list, &include_list_count);
|
||||
optind++;
|
||||
}
|
||||
|
||||
if (extract_function & (extract_list | extract_all_to_fs)) {
|
||||
if (dst_prefix == NULL) {
|
||||
dst_prefix = xstrdup("./");
|
||||
}
|
||||
|
||||
/* Setup the source of the tar data */
|
||||
if (untar_funct & untar_from_file) {
|
||||
src_stream = xfopen(src_filename, "r");
|
||||
} else {
|
||||
src_stream = stdin;
|
||||
}
|
||||
#ifdef CONFIG_FEATURE_TAR_GZIP
|
||||
/* Get a binary tree of all the tar file headers */
|
||||
if (untar_funct & untar_unzip) {
|
||||
uncompressed_stream = gz_open(src_stream, &gunzip_pid);
|
||||
} else
|
||||
#endif // CONFIG_FEATURE_TAR_GZIP
|
||||
uncompressed_stream = src_stream;
|
||||
|
||||
/* extract or list archive */
|
||||
unarchive(uncompressed_stream, stdout, &get_header_tar, extract_function, dst_prefix, include_list, exclude_list);
|
||||
fclose(uncompressed_stream);
|
||||
}
|
||||
#ifdef CONFIG_FEATURE_TAR_CREATE
|
||||
/* create an archive */
|
||||
else if (untar_funct & untar_create) {
|
||||
int verboseFlag = FALSE;
|
||||
|
||||
#ifdef CONFIG_FEATURE_TAR_GZIP
|
||||
if (untar_funct && untar_unzip) {
|
||||
error_msg_and_die("Creation of compressed tarfile not internally support by tar, pipe to busybox gunzip");
|
||||
}
|
||||
#endif // CONFIG_FEATURE_TAR_GZIP
|
||||
if (extract_function & extract_verbose_list) {
|
||||
verboseFlag = TRUE;
|
||||
}
|
||||
writeTarFile(src_filename, verboseFlag, &argv[argc - 1], include_list);
|
||||
}
|
||||
#endif // CONFIG_FEATURE_TAR_CREATE
|
||||
|
||||
/* Cleanups */
|
||||
#ifdef CONFIG_FEATURE_TAR_GZIP
|
||||
if (untar_funct & untar_unzip) {
|
||||
fclose(src_stream);
|
||||
close(gz_fd);
|
||||
gz_close(gunzip_pid);
|
||||
}
|
||||
#endif // CONFIG_FEATURE_TAR_GZIP
|
||||
if (src_filename) {
|
||||
free(src_filename);
|
||||
}
|
||||
if (file_list_name) {
|
||||
free(file_list_name);
|
||||
}
|
||||
return(EXIT_SUCCESS);
|
||||
}
|
||||
@@ -5,41 +5,32 @@
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include "busybox.h"
|
||||
#ifdef CONFIG_LOCALE_SUPPORT
|
||||
#ifdef BB_LOCALE_SUPPORT
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
int been_there_done_that = 0; /* Also used in applets.c */
|
||||
const char *applet_name;
|
||||
|
||||
#ifdef CONFIG_FEATURE_INSTALLER
|
||||
#ifdef BB_FEATURE_INSTALLER
|
||||
/*
|
||||
* directory table
|
||||
* this should be consistent w/ the enum, busybox.h::Location,
|
||||
* or else...
|
||||
*/
|
||||
static char* install_dir[] = {
|
||||
"/",
|
||||
"/bin",
|
||||
"/sbin",
|
||||
"/usr/bin",
|
||||
"/usr/sbin",
|
||||
};
|
||||
static const char usr_bin [] ="/usr/bin";
|
||||
static const char usr_sbin[] ="/usr/sbin";
|
||||
static const char* const install_dir[] = {
|
||||
&usr_bin [8], /* "", equivalent to "/" for concat_path_file() */
|
||||
&usr_bin [4], /* "/bin" */
|
||||
&usr_sbin[4], /* "/sbin" */
|
||||
usr_bin,
|
||||
usr_sbin
|
||||
};
|
||||
|
||||
/* abstract link() */
|
||||
typedef int (*__link_f)(const char *, const char *);
|
||||
|
||||
/*
|
||||
* Where in the filesystem is this busybox?
|
||||
* [return]
|
||||
* malloc'd string w/ full pathname of busybox's location
|
||||
* NULL on failure
|
||||
*/
|
||||
static char *busybox_fullpath()
|
||||
{
|
||||
return xreadlink("/proc/self/exe");
|
||||
}
|
||||
|
||||
/* create (sym)links for each applet */
|
||||
static void install_links(const char *busybox, int use_symbolic_links)
|
||||
{
|
||||
@@ -63,7 +54,7 @@ static void install_links(const char *busybox, int use_symbolic_links)
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CONFIG_FEATURE_INSTALLER */
|
||||
#endif /* BB_FEATURE_INSTALLER */
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
@@ -79,8 +70,8 @@ int main(int argc, char **argv)
|
||||
applet_name = s;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LOCALE_SUPPORT
|
||||
#ifdef CONFIG_INIT
|
||||
#ifdef BB_LOCALE_SUPPORT
|
||||
#ifdef BB_INIT
|
||||
if(getpid()!=1) /* Do not set locale for `init' */
|
||||
#endif
|
||||
{
|
||||
@@ -97,7 +88,7 @@ int busybox_main(int argc, char **argv)
|
||||
{
|
||||
int col = 0, len, i;
|
||||
|
||||
#ifdef CONFIG_FEATURE_INSTALLER
|
||||
#ifdef BB_FEATURE_INSTALLER
|
||||
/*
|
||||
* This style of argument parsing doesn't scale well
|
||||
* in the event that busybox starts wanting more --options.
|
||||
@@ -116,7 +107,7 @@ int busybox_main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* link */
|
||||
busybox = busybox_fullpath();
|
||||
busybox = xreadlink("/proc/self/exe");
|
||||
if (busybox) {
|
||||
install_links(busybox, use_symbolic_links);
|
||||
free(busybox);
|
||||
@@ -125,7 +116,7 @@ int busybox_main(int argc, char **argv)
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
#endif /* CONFIG_FEATURE_INSTALLER */
|
||||
#endif /* BB_FEATURE_INSTALLER */
|
||||
|
||||
argc--;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#ifndef _BB_INTERNAL_H_
|
||||
#define _BB_INTERNAL_H_ 1
|
||||
|
||||
#include "config.h"
|
||||
#include "Config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
@@ -34,7 +34,7 @@
|
||||
#define BB_BANNER "BusyBox v" BB_VER " (" BB_BT ")"
|
||||
|
||||
#ifdef DMALLOC
|
||||
#include <dmalloc.h>
|
||||
#include "dmalloc.h"
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
@@ -66,19 +66,19 @@ extern const struct BB_applet applets[];
|
||||
#include "applets.h"
|
||||
#undef PROTOTYPES
|
||||
|
||||
#ifdef CONFIG_FEATURE_BUFFERS_GO_ON_STACK
|
||||
#define RESERVE_CONFIG_BUFFER(buffer,len) char buffer[len]
|
||||
#define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char buffer[len]
|
||||
#define RELEASE_CONFIG_BUFFER(buffer) ((void)0)
|
||||
#ifdef BB_FEATURE_BUFFERS_GO_ON_STACK
|
||||
#define RESERVE_BB_BUFFER(buffer,len) char buffer[len]
|
||||
#define RESERVE_BB_UBUFFER(buffer,len) unsigned char buffer[len]
|
||||
#define RELEASE_BB_BUFFER(buffer) ((void)0)
|
||||
#else
|
||||
#ifdef CONFIG_FEATURE_BUFFERS_GO_IN_BSS
|
||||
#define RESERVE_CONFIG_BUFFER(buffer,len) static char buffer[len]
|
||||
#define RESERVE_CONFIG_UBUFFER(buffer,len) static unsigned char buffer[len]
|
||||
#define RELEASE_CONFIG_BUFFER(buffer) ((void)0)
|
||||
#ifdef BB_FEATURE_BUFFERS_GO_IN_BSS
|
||||
#define RESERVE_BB_BUFFER(buffer,len) static char buffer[len]
|
||||
#define RESERVE_BB_UBUFFER(buffer,len) static unsigned char buffer[len]
|
||||
#define RELEASE_BB_BUFFER(buffer) ((void)0)
|
||||
#else
|
||||
#define RESERVE_CONFIG_BUFFER(buffer,len) char *buffer=xmalloc(len)
|
||||
#define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len)
|
||||
#define RELEASE_CONFIG_BUFFER(buffer) free (buffer)
|
||||
#define RESERVE_BB_BUFFER(buffer,len) char *buffer=xmalloc(len)
|
||||
#define RESERVE_BB_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len)
|
||||
#define RELEASE_BB_BUFFER(buffer) free (buffer)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -99,8 +99,14 @@ extern const struct BB_applet applets[];
|
||||
|
||||
|
||||
/* Pull in the utility routines from libbb */
|
||||
#include "libbb.h"
|
||||
|
||||
#include "libbb/libbb.h"
|
||||
|
||||
/* Try to pull in PATH_MAX */
|
||||
#include <limits.h>
|
||||
/* for PATH_MAX on systems that don't have it in limits.h */
|
||||
#include <sys/param.h>
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 256
|
||||
#endif
|
||||
|
||||
#endif /* _BB_INTERNAL_H_ */
|
||||
@@ -10,8 +10,8 @@
|
||||
export LC_ALL=POSIX
|
||||
export LC_CTYPE=POSIX
|
||||
|
||||
CONFIG_H=${1:-include/config.h}
|
||||
APPLETS_H=${2:-include/applets.h}
|
||||
CONFIG_H=${1:-Config.h}
|
||||
APPLETS_H=${2:-applets.h}
|
||||
gcc -E -DMAKE_LINKS -include $CONFIG_H $APPLETS_H |
|
||||
awk '/^[ \t]*LINK/{
|
||||
dir=substr($2,8)
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
export LC_ALL=POSIX
|
||||
export LC_CTYPE=POSIX
|
||||
|
||||
RAW=` \
|
||||
$CC -E -dM ${1:-Config.h} | \
|
||||
sed -n -e '/^.*BB_FEATURE.*$/d;s/^#define.*\<BB_\(.*\)\>/\1.c/gp;' \
|
||||
| tr A-Z a-z | sort
|
||||
`
|
||||
test "${RAW}" != "" || exit
|
||||
if [ -d "$BB_SRC_DIR" ]; then cd $BB_SRC_DIR; fi
|
||||
# By running $RAW through "ls", we avoid listing
|
||||
# source files that don't exist.
|
||||
ls $RAW 2>/dev/null | tr '\n' ' '
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%define name busybox
|
||||
%define epoch 0
|
||||
%define version 0.61.pre
|
||||
%define version 0.60.3
|
||||
%define release %(date -I | sed -e 's/-/_/g')
|
||||
%define serial 1
|
||||
|
||||
@@ -12,8 +12,8 @@ Serial: %{serial}
|
||||
Copyright: GPL
|
||||
Group: System/Utilities
|
||||
Summary: BusyBox is a tiny suite of Unix utilities in a multi-call binary.
|
||||
URL: http://busybox.lineo.com/
|
||||
Source: ftp://oss.lineo.com/busybox/%{name}-%{version}.tar.gz
|
||||
URL: http://busybox.net/
|
||||
Source: ftp://busybox.net/busybox/%{name}-%{version}.tar.gz
|
||||
Buildroot: /var/tmp/%{name}-%{version}
|
||||
Packager : Erik Andersen <andersen@codepoet.org>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* vi: set sw=4 ts=4: */
|
||||
/*
|
||||
* Mini chgrp implementation for busybox
|
||||
* Mini chown/chmod/chgrp implementation for busybox
|
||||
*
|
||||
*
|
||||
* Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
|
||||
* Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
|
||||
@@ -1,6 +1,7 @@
|
||||
/* vi: set sw=4 ts=4: */
|
||||
/*
|
||||
* Mini chmod implementation for busybox
|
||||
* Mini chown/chmod/chgrp implementation for busybox
|
||||
*
|
||||
*
|
||||
* Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
|
||||
* Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
|
||||
@@ -43,18 +44,30 @@ int chmod_main(int argc, char **argv)
|
||||
int i;
|
||||
int opt;
|
||||
int recursiveFlag = FALSE;
|
||||
int opt_eq_modeFlag = FALSE;
|
||||
|
||||
/* do normal option parsing */
|
||||
while ((opt = getopt(argc, argv, "R")) > 0) {
|
||||
while ((opt = getopt(argc, argv, "Rrwxst")) > 0) {
|
||||
switch (opt) {
|
||||
case 'R':
|
||||
recursiveFlag = TRUE;
|
||||
break;
|
||||
case 'r':
|
||||
case 'w':
|
||||
case 'x':
|
||||
case 's':
|
||||
case 't':
|
||||
opt_eq_modeFlag = TRUE;
|
||||
break;
|
||||
default:
|
||||
show_usage();
|
||||
}
|
||||
}
|
||||
|
||||
if (opt_eq_modeFlag == TRUE) {
|
||||
optind--;
|
||||
}
|
||||
|
||||
if (argc > optind && argc > 2 && argv[optind]) {
|
||||
/* Parse the specified mode */
|
||||
mode_t mode;
|
||||
@@ -1,6 +1,7 @@
|
||||
/* vi: set sw=4 ts=4: */
|
||||
/*
|
||||
* Mini chown implementation for busybox
|
||||
* Mini chown/chmod/chgrp implementation for busybox
|
||||
*
|
||||
*
|
||||
* Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
|
||||
* Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
|
||||
@@ -2,6 +2,7 @@
|
||||
/*
|
||||
* Mini chroot implementation for busybox
|
||||
*
|
||||
*
|
||||
* Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
|
||||
* Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
|
||||
*
|
||||
@@ -47,7 +48,7 @@ int chroot_main(int argc, char **argv)
|
||||
prog = *argv;
|
||||
execvp(*argv, argv);
|
||||
} else {
|
||||
#if defined shell_main && defined CONFIG_FEATURE_SH_STANDALONE_SHELL
|
||||
#if defined shell_main && defined BB_FEATURE_SH_STANDALONE_SHELL
|
||||
char shell[] = "/bin/sh";
|
||||
char *shell_argv[2] = { shell, NULL };
|
||||
applet_name = shell;
|
||||
@@ -24,7 +24,7 @@ int chvt_main(int argc, char **argv)
|
||||
|
||||
if ((argc != 2) || (**(argv + 1) == '-'))
|
||||
show_usage();
|
||||
fd = get_console_fd("/dev/console");
|
||||
fd = get_console_fd();
|
||||
num = atoi(argv[1]);
|
||||
if (ioctl(fd, VT_ACTIVATE, num))
|
||||
perror_msg_and_die("VT_ACTIVATE");
|
||||
@@ -2,6 +2,7 @@
|
||||
/*
|
||||
* Mini clear implementation for busybox
|
||||
*
|
||||
*
|
||||
* Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
|
||||
* Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
|
||||
*
|
||||
@@ -0,0 +1,11 @@
|
||||
#ifndef CMDEDIT_H
|
||||
#define CMDEDIT_H
|
||||
|
||||
int cmdedit_read_input(char* promptStr, char* command);
|
||||
|
||||
#ifdef CONFIG_FEATURE_COMMAND_SAVEHISTORY
|
||||
void load_history ( const char *fromfile );
|
||||
void save_history ( const char *tofile );
|
||||
#endif
|
||||
|
||||
#endif /* CMDEDIT_H */
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
* Mini cmp implementation for busybox
|
||||
*
|
||||
* Copyright (C) 2000,2001 by Matt Kraai <kraai@alumni.carnegiemellon.edu>
|
||||
* Copyright (C) 1999,2000,2001 by Matt Kraai <kraai@alumni.carnegiemellon.edu>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -1,43 +0,0 @@
|
||||
# Makefile for busybox
|
||||
#
|
||||
# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
TOPDIR :=..
|
||||
L_TARGET := console-tools.a
|
||||
|
||||
obj-y :=
|
||||
obj-n :=
|
||||
obj- :=
|
||||
|
||||
obj-$(CONFIG_CHVT) += chvt.o
|
||||
obj-$(CONFIG_CLEAR) += clear.o
|
||||
obj-$(CONFIG_DEALLOCVT) += deallocvt.o
|
||||
obj-$(CONFIG_DUMPKMAP) += dumpkmap.o
|
||||
obj-$(CONFIG_LOADACM) += loadacm.o
|
||||
obj-$(CONFIG_LOADFONT) += loadfont.o
|
||||
obj-$(CONFIG_LOADKMAP) += loadkmap.o
|
||||
obj-$(CONFIG_RESET) += reset.o
|
||||
obj-$(CONFIG_SETKEYCODES) += setkeycodes.o
|
||||
|
||||
|
||||
# Hand off to toplevel Rules.mak
|
||||
include $(TOPDIR)/Rules.mak
|
||||
|
||||
clean:
|
||||
rm -f $(L_TARGET) *.o core
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#
|
||||
# For a description of the syntax of this configuration file,
|
||||
# see scripts/kbuild/config-language.txt.
|
||||
#
|
||||
|
||||
mainmenu_option next_comment
|
||||
comment 'Console Utilities'
|
||||
bool 'chvt' CONFIG_CHVT
|
||||
bool 'clear' CONFIG_CLEAR
|
||||
bool 'deallocvt' CONFIG_DEALLOCVT
|
||||
bool 'dumpkmap' CONFIG_DUMPKMAP
|
||||
bool 'loadacm' CONFIG_LOADACM
|
||||
bool 'loadfont' CONFIG_LOADFONT
|
||||
bool 'loadkmap' CONFIG_LOADKMAP
|
||||
bool 'reset' CONFIG_RESET
|
||||
bool 'setkeycodes' CONFIG_SETKEYCODES
|
||||
|
||||
endmenu
|
||||
@@ -1,270 +0,0 @@
|
||||
/*
|
||||
* od implementation for busybox
|
||||
* Based on code from util-linux v 2.11l
|
||||
*
|
||||
* Copyright (c) 1990
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Original copyright notice is retained at the end of this file.
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <getopt.h>
|
||||
#include <stdlib.h>
|
||||
#include "dump.h"
|
||||
#include "busybox.h"
|
||||
|
||||
extern FS *fshead; /* head of format strings */
|
||||
extern int blocksize; /* data block size */
|
||||
extern int length; /* max bytes to read */
|
||||
|
||||
#define ishexdigit(c) \
|
||||
((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'))
|
||||
|
||||
static void
|
||||
odoffset(int argc, char ***argvp)
|
||||
{
|
||||
extern off_t skip;
|
||||
register char *num, *p;
|
||||
int base;
|
||||
char *end;
|
||||
|
||||
/*
|
||||
* The offset syntax of od(1) was genuinely bizarre. First, if
|
||||
* it started with a plus it had to be an offset. Otherwise, if
|
||||
* there were at least two arguments, a number or lower-case 'x'
|
||||
* followed by a number makes it an offset. By default it was
|
||||
* octal; if it started with 'x' or '0x' it was hex. If it ended
|
||||
* in a '.', it was decimal. If a 'b' or 'B' was appended, it
|
||||
* multiplied the number by 512 or 1024 byte units. There was
|
||||
* no way to assign a block count to a hex offset.
|
||||
*
|
||||
* We assumes it's a file if the offset is bad.
|
||||
*/
|
||||
p = **argvp;
|
||||
if (*p != '+' && (argc < 2 ||
|
||||
(!isdigit(p[0]) && (p[0] != 'x' || !ishexdigit(p[1])))))
|
||||
return;
|
||||
|
||||
base = 0;
|
||||
/*
|
||||
* skip over leading '+', 'x[0-9a-fA-f]' or '0x', and
|
||||
* set base.
|
||||
*/
|
||||
if (p[0] == '+')
|
||||
++p;
|
||||
if (p[0] == 'x' && ishexdigit(p[1])) {
|
||||
++p;
|
||||
base = 16;
|
||||
} else if (p[0] == '0' && p[1] == 'x') {
|
||||
p += 2;
|
||||
base = 16;
|
||||
}
|
||||
|
||||
/* skip over the number */
|
||||
if (base == 16)
|
||||
for (num = p; ishexdigit(*p); ++p);
|
||||
else
|
||||
for (num = p; isdigit(*p); ++p);
|
||||
|
||||
/* check for no number */
|
||||
if (num == p)
|
||||
return;
|
||||
|
||||
/* if terminates with a '.', base is decimal */
|
||||
if (*p == '.') {
|
||||
if (base)
|
||||
return;
|
||||
base = 10;
|
||||
}
|
||||
|
||||
skip = strtol(num, &end, base ? base : 8);
|
||||
|
||||
/* if end isn't the same as p, we got a non-octal digit */
|
||||
if (end != p)
|
||||
skip = 0;
|
||||
else {
|
||||
if (*p) {
|
||||
if (*p == 'b')
|
||||
skip *= 512;
|
||||
else if (*p == 'B')
|
||||
skip *= 1024;
|
||||
++p;
|
||||
}
|
||||
if (*p)
|
||||
skip = 0;
|
||||
else {
|
||||
++*argvp;
|
||||
/*
|
||||
* If the offset uses a non-octal base, the base of
|
||||
* the offset is changed as well. This isn't pretty,
|
||||
* but it's easy.
|
||||
*/
|
||||
#define TYPE_OFFSET 7
|
||||
if (base == 16) {
|
||||
fshead->nextfu->fmt[TYPE_OFFSET] = 'x';
|
||||
fshead->nextfs->nextfu->fmt[TYPE_OFFSET] = 'x';
|
||||
} else if (base == 10) {
|
||||
fshead->nextfu->fmt[TYPE_OFFSET] = 'd';
|
||||
fshead->nextfs->nextfu->fmt[TYPE_OFFSET] = 'd';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void odprecede(void)
|
||||
{
|
||||
static int first = 1;
|
||||
|
||||
if (first) {
|
||||
first = 0;
|
||||
add("\"%07.7_Ao\n\"");
|
||||
add("\"%07.7_ao \"");
|
||||
} else
|
||||
add("\" \"");
|
||||
}
|
||||
|
||||
int od_main(int argc, char **argv)
|
||||
{
|
||||
int ch;
|
||||
extern enum _vflag vflag;
|
||||
vflag = FIRST;
|
||||
length = -1;
|
||||
|
||||
while ((ch = getopt(argc, argv, "aBbcDdeFfHhIiLlOoPpswvXx")) != EOF)
|
||||
switch (ch) {
|
||||
case 'a':
|
||||
odprecede();
|
||||
add("16/1 \"%3_u \" \"\\n\"");
|
||||
break;
|
||||
case 'B':
|
||||
case 'o':
|
||||
odprecede();
|
||||
add("8/2 \" %06o \" \"\\n\"");
|
||||
break;
|
||||
case 'b':
|
||||
odprecede();
|
||||
add("16/1 \"%03o \" \"\\n\"");
|
||||
break;
|
||||
case 'c':
|
||||
odprecede();
|
||||
add("16/1 \"%3_c \" \"\\n\"");
|
||||
break;
|
||||
case 'd':
|
||||
odprecede();
|
||||
add("8/2 \" %05u \" \"\\n\"");
|
||||
break;
|
||||
case 'D':
|
||||
odprecede();
|
||||
add("4/4 \" %010u \" \"\\n\"");
|
||||
break;
|
||||
case 'e': /* undocumented in od */
|
||||
case 'F':
|
||||
odprecede();
|
||||
add("2/8 \" %21.14e \" \"\\n\"");
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
odprecede();
|
||||
add("4/4 \" %14.7e \" \"\\n\"");
|
||||
break;
|
||||
case 'H':
|
||||
case 'X':
|
||||
odprecede();
|
||||
add("4/4 \" %08x \" \"\\n\"");
|
||||
break;
|
||||
case 'h':
|
||||
case 'x':
|
||||
odprecede();
|
||||
add("8/2 \" %04x \" \"\\n\"");
|
||||
break;
|
||||
case 'I':
|
||||
case 'L':
|
||||
case 'l':
|
||||
odprecede();
|
||||
add("4/4 \" %11d \" \"\\n\"");
|
||||
break;
|
||||
case 'i':
|
||||
odprecede();
|
||||
add("8/2 \" %6d \" \"\\n\"");
|
||||
break;
|
||||
case 'O':
|
||||
odprecede();
|
||||
add("4/4 \" %011o \" \"\\n\"");
|
||||
break;
|
||||
case 'v':
|
||||
vflag = ALL;
|
||||
break;
|
||||
case 'P':
|
||||
case 'p':
|
||||
case 's':
|
||||
case 'w':
|
||||
case '?':
|
||||
default:
|
||||
error_msg("od: od(1) has been deprecated for hexdump(1).\n");
|
||||
if (ch != '?') {
|
||||
error_msg("od: hexdump(1) compatibility doesn't support the -%c option%s\n",
|
||||
ch, ch == 's' ? "; see strings(1)." : ".");
|
||||
}
|
||||
show_usage();
|
||||
}
|
||||
|
||||
if (!fshead) {
|
||||
add("\"%07.7_Ao\n\"");
|
||||
add("\"%07.7_ao \" 8/2 \"%06o \" \"\\n\"");
|
||||
}
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
odoffset(argc, &argv);
|
||||
|
||||
return(dump(argv));
|
||||
}
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
@@ -36,16 +36,16 @@ extern int cp_main(int argc, char **argv)
|
||||
{
|
||||
int status = 0;
|
||||
int opt;
|
||||
int flags = FILEUTILS_DEREFERENCE;
|
||||
int flags = 0;
|
||||
int i;
|
||||
|
||||
while ((opt = getopt(argc, argv, "adfipR")) != -1)
|
||||
while ((opt = getopt(argc, argv, "adfipRr")) != -1)
|
||||
switch (opt) {
|
||||
case 'a':
|
||||
flags |= FILEUTILS_PRESERVE_STATUS | FILEUTILS_RECUR;
|
||||
/* fallthrough */
|
||||
case 'd':
|
||||
flags &= ~FILEUTILS_DEREFERENCE;
|
||||
flags |= FILEUTILS_PRESERVE_SYMLINKS;
|
||||
break;
|
||||
case 'f':
|
||||
flags |= FILEUTILS_FORCE;
|
||||
@@ -57,6 +57,9 @@ extern int cp_main(int argc, char **argv)
|
||||
flags |= FILEUTILS_PRESERVE_STATUS;
|
||||
break;
|
||||
case 'R':
|
||||
flags |= FILEUTILS_RECUR | FILEUTILS_PRESERVE_STATUS;
|
||||
break;
|
||||
case 'r':
|
||||
flags |= FILEUTILS_RECUR;
|
||||
break;
|
||||
default:
|
||||
@@ -73,9 +76,9 @@ extern int cp_main(int argc, char **argv)
|
||||
int source_exists = 1;
|
||||
int dest_exists = 1;
|
||||
|
||||
if ((!(flags & FILEUTILS_DEREFERENCE) &&
|
||||
if (((flags & FILEUTILS_PRESERVE_SYMLINKS) &&
|
||||
lstat(argv[optind], &source_stat) < 0) ||
|
||||
((flags & FILEUTILS_DEREFERENCE) &&
|
||||
(!(flags & FILEUTILS_PRESERVE_SYMLINKS) &&
|
||||
stat(argv[optind], &source_stat))) {
|
||||
if (errno != ENOENT)
|
||||
perror_msg_and_die("unable to stat `%s'", argv[optind]);
|
||||
@@ -28,7 +28,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include "unarchive.h"
|
||||
#include "busybox.h"
|
||||
|
||||
extern int cpio_main(int argc, char **argv)
|
||||
@@ -87,7 +86,7 @@ extern int cpio_main(int argc, char **argv)
|
||||
optind++;
|
||||
}
|
||||
|
||||
unarchive(src_stream, stdout, &get_header_cpio, extract_function, "./", extract_names, NULL);
|
||||
unarchive(src_stream, stdout, &get_header_cpio, extract_function, "./", extract_names);
|
||||
if (oldmask) {
|
||||
umask(oldmask); /* Restore umask if we changed it */
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* cut.c - minimalist version of cut
|
||||
*
|
||||
* Copyright (C) 1999,2000,2001 by Lineo, inc.
|
||||
* Written by Mark Whitley <markw@lineo.com>, <markw@codepoet.org>
|
||||
* Copyright (C) 1999,2000 by Lineo, inc. and Mark Whitley
|
||||
* Copyright (C) 1999,2000,2001 by Mark Whitley <markw@codepoet.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -222,8 +222,8 @@ int date_main(int argc, char **argv)
|
||||
if (date_fmt == NULL) {
|
||||
date_fmt = (rfc822
|
||||
? (utc
|
||||
? "%a, %_d %b %Y %H:%M:%S GMT"
|
||||
: "%a, %_d %b %Y %H:%M:%S %z")
|
||||
? "%a, %e %b %Y %H:%M:%S GMT"
|
||||
: "%a, %e %b %Y %H:%M:%S %z")
|
||||
: "%a %b %e %H:%M:%S %Z %Y");
|
||||
|
||||
} else if (*date_fmt == '\0') {
|
||||
@@ -45,7 +45,7 @@ static const struct suffix_mult dd_suffixes[] = {
|
||||
|
||||
int dd_main(int argc, char **argv)
|
||||
{
|
||||
int i, ifd, ofd, oflag, sync_flag = FALSE, trunc = TRUE;
|
||||
int i, ifd, ofd, oflag, sync_flag = FALSE, trunc = TRUE, noerror = FALSE;
|
||||
size_t in_full = 0, in_part = 0, out_full = 0, out_part = 0;
|
||||
size_t bs = 512, count = -1;
|
||||
ssize_t n;
|
||||
@@ -74,6 +74,9 @@ int dd_main(int argc, char **argv)
|
||||
} else if (strncmp("sync", buf, 4) == 0) {
|
||||
sync_flag = TRUE;
|
||||
buf += 4;
|
||||
} else if (strncmp("noerror", buf, 7) == 0) {
|
||||
noerror = TRUE;
|
||||
buf += 7;
|
||||
} else {
|
||||
error_msg_and_die("invalid conversion `%s'", argv[i]+5);
|
||||
}
|
||||
@@ -106,8 +109,12 @@ int dd_main(int argc, char **argv)
|
||||
perror_msg_and_die("%s", outfile);
|
||||
|
||||
if (seek && trunc) {
|
||||
if (ftruncate(ofd, seek * bs) < 0)
|
||||
perror_msg_and_die("%s", outfile);
|
||||
if (ftruncate(ofd, seek * bs) < 0) {
|
||||
struct stat st;
|
||||
if (fstat (ofd, &st) < 0 || S_ISREG (st.st_mode) ||
|
||||
S_ISDIR (st.st_mode))
|
||||
perror_msg_and_die("%s", outfile);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ofd = STDOUT_FILENO;
|
||||
@@ -125,9 +132,19 @@ int dd_main(int argc, char **argv)
|
||||
}
|
||||
|
||||
while (in_full + in_part != count) {
|
||||
if (noerror) {
|
||||
/* Pre-zero the buffer when doing the noerror thing */
|
||||
memset(buf, '\0', bs);
|
||||
}
|
||||
n = safe_read(ifd, buf, bs);
|
||||
if (n < 0)
|
||||
perror_msg_and_die("%s", infile);
|
||||
if (n < 0) {
|
||||
if (noerror) {
|
||||
n = bs;
|
||||
perror_msg("%s", infile);
|
||||
} else {
|
||||
perror_msg_and_die("%s", infile);
|
||||
}
|
||||
}
|
||||
if (n == 0)
|
||||
break;
|
||||
if (n == bs)
|
||||
@@ -21,7 +21,7 @@ int deallocvt_main(int argc, char *argv[])
|
||||
if (argc > 2)
|
||||
show_usage();
|
||||
|
||||
fd = get_console_fd("/dev/console");
|
||||
fd = get_console_fd();
|
||||
|
||||
if (argc == 1) {
|
||||
/* deallocate all unused consoles */
|
||||
@@ -3,142 +3,145 @@
|
||||
// When you turn things off here, they won't be compiled in at all.
|
||||
//
|
||||
//// This file is parsed by sed. You MUST use single line comments.
|
||||
// i.e., //#define CONFIG_BLAH
|
||||
// i.e., //#define BB_BLAH
|
||||
//
|
||||
//
|
||||
// BusyBox Applications
|
||||
//#define CONFIG_ADJTIMEX
|
||||
#define CONFIG_AR
|
||||
//#define CONFIG_ASH
|
||||
#define CONFIG_BASENAME
|
||||
#define CONFIG_CAT
|
||||
#define CONFIG_CHGRP
|
||||
#define CONFIG_CHMOD
|
||||
#define CONFIG_CHOWN
|
||||
#define CONFIG_CHROOT
|
||||
#define CONFIG_CHVT
|
||||
#define CONFIG_CLEAR
|
||||
//#define CONFIG_CMP
|
||||
#define CONFIG_CP
|
||||
//#define CONFIG_CPIO
|
||||
#define CONFIG_CUT
|
||||
#define CONFIG_DATE
|
||||
//#define CONFIG_DC
|
||||
#define CONFIG_DD
|
||||
//#define CONFIG_DEALLOCVT
|
||||
#define CONFIG_DF
|
||||
#define CONFIG_DIRNAME
|
||||
#define CONFIG_DMESG
|
||||
//#define CONFIG_DOS2UNIX
|
||||
//#define CONFIG_DPKG
|
||||
//#define CONFIG_DPKG_DEB
|
||||
//#define CONFIG_DUTMP
|
||||
#define CONFIG_DU
|
||||
//#define CONFIG_DUMPKMAP
|
||||
#define CONFIG_ECHO
|
||||
#define CONFIG_ENV
|
||||
#define CONFIG_EXPR
|
||||
//#define CONFIG_FBSET
|
||||
//#define CONFIG_FDFLUSH
|
||||
#define CONFIG_FIND
|
||||
#define CONFIG_FREE
|
||||
//#define CONFIG_FREERAMDISK
|
||||
//#define CONFIG_FSCK_MINIX
|
||||
//#define CONFIG_GETOPT
|
||||
#define CONFIG_GREP
|
||||
#define CONFIG_GUNZIP
|
||||
#define CONFIG_GZIP
|
||||
#define CONFIG_HALT
|
||||
#define CONFIG_HEAD
|
||||
//#define CONFIG_HOSTID
|
||||
//#define CONFIG_HOSTNAME
|
||||
//#define CONFIG_HUSH
|
||||
#define CONFIG_ID
|
||||
//#define CONFIG_IFCONFIG
|
||||
#define CONFIG_INIT
|
||||
//#define CONFIG_INSMOD
|
||||
#define CONFIG_KILL
|
||||
#define CONFIG_KILLALL
|
||||
#define CONFIG_KLOGD
|
||||
//#define CONFIG_LASH
|
||||
//#define CONFIG_LENGTH
|
||||
#define CONFIG_LN
|
||||
//#define CONFIG_LOADACM
|
||||
//#define CONFIG_LOADFONT
|
||||
#define CONFIG_LOADKMAP
|
||||
#define CONFIG_LOGGER
|
||||
//#define CONFIG_LOGNAME
|
||||
#define CONFIG_LS
|
||||
#define CONFIG_LSMOD
|
||||
//#define CONFIG_MAKEDEVS
|
||||
#define CONFIG_MD5SUM
|
||||
#define CONFIG_MKDIR
|
||||
//#define CONFIG_MKFIFO
|
||||
//#define CONFIG_MKFS_MINIX
|
||||
#define CONFIG_MKNOD
|
||||
#define CONFIG_MKSWAP
|
||||
//#define CONFIG_MKTEMP
|
||||
//#define CONFIG_MODPROBE
|
||||
#define CONFIG_MORE
|
||||
#define CONFIG_MOUNT
|
||||
//#define CONFIG_MSH
|
||||
//#define CONFIG_MT
|
||||
#define CONFIG_MV
|
||||
//#define CONFIG_NC
|
||||
//#define CONFIG_NSLOOKUP
|
||||
//#define CONFIG_PIDOF
|
||||
#define CONFIG_PING
|
||||
//#define CONFIG_PIVOT_ROOT
|
||||
#define CONFIG_POWEROFF
|
||||
//#define CONFIG_PRINTF
|
||||
#define CONFIG_PS
|
||||
#define CONFIG_PWD
|
||||
//#define CONFIG_RDATE
|
||||
//#define CONFIG_READLINK
|
||||
#define CONFIG_REBOOT
|
||||
//#define CONFIG_RENICE
|
||||
#define CONFIG_RESET
|
||||
#define CONFIG_RM
|
||||
#define CONFIG_RMDIR
|
||||
//#define CONFIG_RMMOD
|
||||
//#define CONFIG_ROUTE
|
||||
//#define CONFIG_RPM2CPIO
|
||||
#define CONFIG_SED
|
||||
//#define CONFIG_SETKEYCODES
|
||||
#define CONFIG_SLEEP
|
||||
#define CONFIG_SORT
|
||||
//#define CONFIG_STTY
|
||||
#define CONFIG_SWAPONOFF
|
||||
#define CONFIG_SYNC
|
||||
#define CONFIG_SYSLOGD
|
||||
#define CONFIG_TAIL
|
||||
#define CONFIG_TAR
|
||||
//#define CONFIG_TEE
|
||||
//#define CONFIG_TEST
|
||||
#define CONFIG_TELNET
|
||||
//#define CONFIG_TFTP
|
||||
#define CONFIG_TOUCH
|
||||
#define CONFIG_TR
|
||||
//#define CONFIG_TRACEROUTE
|
||||
#define CONFIG_TRUE_FALSE
|
||||
#define CONFIG_TTY
|
||||
//#define CONFIG_UNIX2DOS
|
||||
//#define CONFIG_UUENCODE
|
||||
//#define CONFIG_UUDECODE
|
||||
#define CONFIG_UMOUNT
|
||||
#define CONFIG_UNIQ
|
||||
#define CONFIG_UNAME
|
||||
//#define CONFIG_UPDATE
|
||||
#define CONFIG_UPTIME
|
||||
//#define CONFIG_USLEEP
|
||||
#define CONFIG_VI
|
||||
//#define CONFIG_WATCHDOG
|
||||
#define CONFIG_WC
|
||||
#define CONFIG_WGET
|
||||
#define CONFIG_WHICH
|
||||
#define CONFIG_WHOAMI
|
||||
#define CONFIG_XARGS
|
||||
#define CONFIG_YES
|
||||
//#define BB_ADJTIMEX
|
||||
#define BB_AR
|
||||
//#define BB_ASH
|
||||
//#define BB_BASENAME
|
||||
#define BB_CAT
|
||||
#define BB_CHGRP
|
||||
#define BB_CHMOD
|
||||
#define BB_CHOWN
|
||||
#define BB_CHROOT
|
||||
//#define BB_CHVT
|
||||
#define BB_CLEAR
|
||||
//#define BB_CMP
|
||||
#define BB_CP
|
||||
//#define BB_CPIO
|
||||
#define BB_CUT
|
||||
//#define BB_DATE
|
||||
//#define BB_DC
|
||||
//#define BB_DD
|
||||
//#define BB_DEALLOCVT
|
||||
#define BB_DF
|
||||
#define BB_DIRNAME
|
||||
#define BB_DMESG
|
||||
//#define BB_DOS2UNIX
|
||||
//#define BB_DPKG
|
||||
//#define BB_DPKG_DEB
|
||||
//#define BB_DUTMP
|
||||
//#define BB_DU
|
||||
//#define BB_DUMPKMAP
|
||||
#define BB_ECHO
|
||||
//#define BB_ENV
|
||||
#define BB_EXPR
|
||||
//#define BB_FBSET
|
||||
//#define BB_FDFLUSH
|
||||
#define BB_FIND
|
||||
#define BB_FREE
|
||||
//#define BB_FREERAMDISK
|
||||
//#define BB_FSCK_MINIX
|
||||
//#define BB_GETOPT
|
||||
#define BB_GREP
|
||||
#define BB_GUNZIP
|
||||
#define BB_GZIP
|
||||
#define BB_HALT
|
||||
#define BB_HEAD
|
||||
//#define BB_HOSTID
|
||||
#define BB_HOSTNAME
|
||||
//#define BB_HUSH
|
||||
#define BB_ID
|
||||
#define BB_IFCONFIG
|
||||
#define BB_INIT
|
||||
//#define BB_INSMOD
|
||||
#define BB_KILL
|
||||
#define BB_KILLALL
|
||||
#define BB_KLOGD
|
||||
//#define BB_LASH
|
||||
//#define BB_LENGTH
|
||||
#define BB_LN
|
||||
//#define BB_LOADACM
|
||||
//#define BB_LOADFONT
|
||||
#define BB_LOADKMAP
|
||||
#define BB_LOGGER
|
||||
//#define BB_LOGNAME
|
||||
#define BB_LOSETUP
|
||||
#define BB_LS
|
||||
//#define BB_LSMOD
|
||||
//#define BB_MAKEDEVS
|
||||
#define BB_MD5SUM
|
||||
#define BB_MKDIR
|
||||
//#define BB_MKFIFO
|
||||
//#define BB_MKFS_MINIX
|
||||
#define BB_MKNOD
|
||||
#define BB_MKSWAP
|
||||
//#define BB_MKTEMP
|
||||
//#define BB_MODPROBE
|
||||
#define BB_MORE
|
||||
#define BB_MOUNT
|
||||
//#define BB_MSH
|
||||
//#define BB_MT
|
||||
#define BB_MV
|
||||
//#define BB_NC
|
||||
//#define BB_NSLOOKUP
|
||||
//#define BB_PIDOF
|
||||
#define BB_PING
|
||||
//#define BB_PIVOT_ROOT
|
||||
#define BB_POWEROFF
|
||||
//#define BB_PRINTF
|
||||
#define BB_PS
|
||||
#define BB_PWD
|
||||
//#define BB_RDATE
|
||||
//#define BB_READLINK
|
||||
#define BB_REBOOT
|
||||
//#define BB_RENICE
|
||||
#define BB_RESET
|
||||
#define BB_RM
|
||||
#define BB_RMDIR
|
||||
//#define BB_RMMOD
|
||||
#define BB_ROUTE
|
||||
//#define BB_RPM2CPIO
|
||||
#define BB_SED
|
||||
//#define BB_SETKEYCODES
|
||||
#define BB_SLEEP
|
||||
#define BB_SORT
|
||||
//#define BB_STTY
|
||||
#define BB_SWAPONOFF
|
||||
#define BB_SYNC
|
||||
#define BB_SYSLOGD
|
||||
#define BB_TAIL
|
||||
#define BB_TAR
|
||||
//#define BB_TEE
|
||||
#define BB_TEST
|
||||
//#define BB_TELNET
|
||||
//#define BB_TFTP
|
||||
//#define BB_TIME
|
||||
//#define BB_TOP
|
||||
#define BB_TOUCH
|
||||
#define BB_TR
|
||||
//#define BB_TRACEROUTE
|
||||
#define BB_TRUE_FALSE
|
||||
#define BB_TTY
|
||||
//#define BB_UNIX2DOS
|
||||
//#define BB_UUENCODE
|
||||
//#define BB_UUDECODE
|
||||
#define BB_UMOUNT
|
||||
#define BB_UNIQ
|
||||
#define BB_UNAME
|
||||
//#define BB_UPDATE
|
||||
#define BB_UPTIME
|
||||
//#define BB_USLEEP
|
||||
//#define BB_VI
|
||||
//#define BB_WATCHDOG
|
||||
#define BB_WC
|
||||
#define BB_WGET
|
||||
#define BB_WHICH
|
||||
#define BB_WHOAMI
|
||||
//#define BB_XARGS
|
||||
//#define BB_YES
|
||||
// End of Applications List
|
||||
//
|
||||
//
|
||||
@@ -151,21 +154,21 @@
|
||||
//
|
||||
// If you enabled one or more of the shells, you may select which one
|
||||
// should be run when sh is invoked:
|
||||
//#define CONFIG_FEATURE_SH_IS_ASH
|
||||
//#define CONFIG_FEATURE_SH_IS_HUSH
|
||||
//#define CONFIG_FEATURE_SH_IS_LASH
|
||||
#define CONFIG_FEATURE_SH_IS_MSH
|
||||
//#define BB_FEATURE_SH_IS_ASH
|
||||
//#define BB_FEATURE_SH_IS_HUSH
|
||||
//#define BB_FEATURE_SH_IS_LASH
|
||||
//#define BB_FEATURE_SH_IS_MSH
|
||||
//
|
||||
// BusyBox will, by default, malloc space for its buffers. This costs code
|
||||
// size for the call to xmalloc. You can use the following feature to have
|
||||
// them put on the stack. For some very small machines with limited stack
|
||||
// space, this can be deadly. For most folks, this works just fine...
|
||||
//#define CONFIG_FEATURE_BUFFERS_GO_ON_STACK
|
||||
//#define BB_FEATURE_BUFFERS_GO_ON_STACK
|
||||
// The third alternative for buffer allocation is to use BSS. This works
|
||||
// beautifully for computers with a real MMU (and OS support), but wastes
|
||||
// runtime RAM for uCLinux. This behavior was the only one available for
|
||||
// BusyBox versions 0.48 and earlier.
|
||||
//#define CONFIG_FEATURE_BUFFERS_GO_IN_BSS
|
||||
//#define BB_FEATURE_BUFFERS_GO_IN_BSS
|
||||
//
|
||||
// Turn this on to use Erik's very cool devps, and devmtab kernel drivers,
|
||||
// thereby eliminating the need for the /proc filesystem and thereby saving
|
||||
@@ -176,212 +179,235 @@
|
||||
// mknod /dev/mtab c 10 22
|
||||
// mknod /dev/ps c 10 21
|
||||
// I emailed Linus and this patch will not be going into the stock kernel.
|
||||
//#define CONFIG_FEATURE_USE_DEVPS_PATCH
|
||||
//#define BB_FEATURE_USE_DEVPS_PATCH
|
||||
//
|
||||
// show verbose usage messages
|
||||
//#define CONFIG_FEATURE_VERBOSE_USAGE
|
||||
//#define BB_FEATURE_VERBOSE_USAGE
|
||||
//
|
||||
// Use termios to manipulate the screen ('more' is prettier with this on)
|
||||
#define CONFIG_FEATURE_USE_TERMIOS
|
||||
#define BB_FEATURE_USE_TERMIOS
|
||||
//
|
||||
// calculate terminal & column widths (for more and ls)
|
||||
#define CONFIG_FEATURE_AUTOWIDTH
|
||||
// calculate terminal & column widths (for more, ls, and telnet)
|
||||
#define BB_FEATURE_AUTOWIDTH
|
||||
//
|
||||
// show username/groupnames for ls
|
||||
#define CONFIG_FEATURE_LS_USERNAME
|
||||
#define BB_FEATURE_LS_USERNAME
|
||||
//
|
||||
// show file timestamps in ls
|
||||
#define CONFIG_FEATURE_LS_TIMESTAMPS
|
||||
#define BB_FEATURE_LS_TIMESTAMPS
|
||||
//
|
||||
// enable ls -p and -F
|
||||
#define CONFIG_FEATURE_LS_FILETYPES
|
||||
#define BB_FEATURE_LS_FILETYPES
|
||||
//
|
||||
// sort the file names
|
||||
#define CONFIG_FEATURE_LS_SORTFILES
|
||||
#define BB_FEATURE_LS_SORTFILES
|
||||
//
|
||||
// enable ls -R
|
||||
#define CONFIG_FEATURE_LS_RECURSIVE
|
||||
#define BB_FEATURE_LS_RECURSIVE
|
||||
//
|
||||
// enable ls -L
|
||||
#define CONFIG_FEATURE_LS_FOLLOWLINKS
|
||||
#define BB_FEATURE_LS_FOLLOWLINKS
|
||||
//
|
||||
// Use color to identify different file types
|
||||
#define BB_FEATURE_LS_COLOR
|
||||
//
|
||||
// Disable for a smaller (but less functional) ping
|
||||
#define CONFIG_FEATURE_FANCY_PING
|
||||
#define BB_FEATURE_FANCY_PING
|
||||
//
|
||||
// Make init use a simplified /etc/inittab file (recommended).
|
||||
#define CONFIG_FEATURE_USE_INITTAB
|
||||
#define BB_FEATURE_USE_INITTAB
|
||||
//
|
||||
//Enable init being called as /linuxrc
|
||||
#define CONFIG_FEATURE_INITRD
|
||||
#define BB_FEATURE_LINUXRC
|
||||
//
|
||||
//Have init enable core dumping for child processes (for debugging only)
|
||||
//#define CONFIG_FEATURE_INIT_COREDUMPS
|
||||
//#define BB_FEATURE_INIT_COREDUMPS
|
||||
//
|
||||
//Make sure nothing is printed to the console on boot
|
||||
//#define CONFIG_FEATURE_EXTRA_QUIET
|
||||
//#define BB_FEATURE_EXTRA_QUIET
|
||||
//
|
||||
// enable syslogd -R remotehost
|
||||
#define CONFIG_FEATURE_REMOTE_LOG
|
||||
//#define BB_FEATURE_REMOTE_LOG
|
||||
//
|
||||
// enable syslogd -C
|
||||
//#define CONFIG_FEATURE_IPC_SYSLOG
|
||||
//#define BB_FEATURE_IPC_SYSLOG
|
||||
//
|
||||
//Disable for a simple tail implementation (2.34k vs 3k for the full one).
|
||||
//Both provide 'tail -f', but this cuts out -c, -q, -s, and -v.
|
||||
#define CONFIG_FEATURE_FANCY_TAIL
|
||||
#define BB_FEATURE_FANCY_TAIL
|
||||
//
|
||||
// Enable support for loop devices in mount
|
||||
#define CONFIG_FEATURE_MOUNT_LOOP
|
||||
#define BB_FEATURE_MOUNT_LOOP
|
||||
//
|
||||
// Enable support for a real /etc/mtab file instead of /proc/mounts
|
||||
//#define CONFIG_FEATURE_MTAB_SUPPORT
|
||||
//#define BB_FEATURE_MTAB_SUPPORT
|
||||
//
|
||||
// Enable support for mounting remote NFS volumes.
|
||||
// You may need to mount with "-o nolock" if you are
|
||||
// not running a local portmapper daemon...
|
||||
#define CONFIG_FEATURE_NFSMOUNT
|
||||
//
|
||||
// If you are using uClibc, be sure that you've already compiled
|
||||
// uClibc with INCLUDE_RPC=true (contained in the Config file)
|
||||
#define BB_FEATURE_NFSMOUNT
|
||||
//
|
||||
// Enable support forced filesystem unmounting
|
||||
// (i.e., in case of an unreachable NFS system).
|
||||
#define CONFIG_FEATURE_MOUNT_FORCE
|
||||
#define BB_FEATURE_MOUNT_FORCE
|
||||
//
|
||||
// Enable support for creation of tar files.
|
||||
#define CONFIG_FEATURE_TAR_CREATE
|
||||
#define BB_FEATURE_TAR_CREATE
|
||||
//
|
||||
// Enable support for "--exclude" and "-X" for excluding files
|
||||
#define CONFIG_FEATURE_TAR_EXCLUDE
|
||||
//#define BB_FEATURE_TAR_EXCLUDE
|
||||
//
|
||||
// Enable support for tar -z option (currently only works for inflating)
|
||||
#define CONFIG_FEATURE_TAR_GZIP
|
||||
#define BB_FEATURE_TAR_GZIP
|
||||
//
|
||||
// Enable reverse sort
|
||||
#define CONFIG_FEATURE_SORT_REVERSE
|
||||
//#define BB_FEATURE_SORT_REVERSE
|
||||
//
|
||||
// Enable uniqe sort
|
||||
#define CONFIG_FEATURE_SORT_UNIQUE
|
||||
//#define BB_FEATURE_SORT_UNIQUE
|
||||
//
|
||||
// Enable command line editing in the shell.
|
||||
// Only relevant if a shell is enabled. On by default.
|
||||
#define CONFIG_FEATURE_COMMAND_EDITING
|
||||
//#define BB_FEATURE_COMMAND_EDITING
|
||||
//
|
||||
// Enable tab completion in the shell. This is now working quite nicely.
|
||||
// This feature adds a bit over 4k. Only relevant if a shell is enabled.
|
||||
#define CONFIG_FEATURE_COMMAND_TAB_COMPLETION
|
||||
//#define BB_FEATURE_COMMAND_TAB_COMPLETION
|
||||
//
|
||||
// Attempts to match usernames in a ~-prefixed path
|
||||
//#define CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION
|
||||
//#define BB_FEATURE_COMMAND_USERNAME_COMPLETION
|
||||
//
|
||||
//Allow the shell to invoke all the compiled in BusyBox applets as if they
|
||||
//were shell builtins. Nice for staticly linking an emergency rescue shell,
|
||||
//among other things. Off by default.
|
||||
// Only relevant if a shell is enabled.
|
||||
//#define CONFIG_FEATURE_SH_STANDALONE_SHELL
|
||||
//#define BB_FEATURE_SH_STANDALONE_SHELL
|
||||
//
|
||||
//When this is enabled, busybox shell applets can be called using full path
|
||||
//names. This causes applets (i.e., most busybox commands) to override
|
||||
//real commands on the filesystem. For example, if you run run /bin/cat, it
|
||||
//will use BusyBox cat even if /bin/cat exists on the filesystem and is _not_
|
||||
//busybox. Some systems want this, others do not. Choose wisely. :-) This
|
||||
//only has meaning when CONFIG_FEATURE_SH_STANDALONE_SHELL is enabled.
|
||||
//only has meaning when BB_FEATURE_SH_STANDALONE_SHELL is enabled.
|
||||
// Only relevant if a shell is enabled. Off by default.
|
||||
//#define CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN
|
||||
//#define BB_FEATURE_SH_APPLETS_ALWAYS_WIN
|
||||
//
|
||||
// Uncomment this option for a fancy shell prompt that includes the
|
||||
// current username and hostname. On systems that don't have usernames
|
||||
// or hostnames, this can look hideous.
|
||||
// Only relevant if a shell is enabled.
|
||||
//#define CONFIG_FEATURE_SH_FANCY_PROMPT
|
||||
//#define BB_FEATURE_SH_FANCY_PROMPT
|
||||
//
|
||||
// Uncomment this option to disable job control. Job control lets you
|
||||
// run jobs in the background (which completely useless for is all you
|
||||
// are doing is running scripts). Disabing this is bad for interactive
|
||||
// use, since when you hit ^C in an application, it will also kill the
|
||||
// shell. This adds about 2.5k on an x86 system.
|
||||
//#define BB_FEATURE_ASH_JOB_CONTROL
|
||||
//
|
||||
//Turn on extra fbset options
|
||||
//#define CONFIG_FEATURE_FBSET_FANCY
|
||||
//#define BB_FEATURE_FBSET_FANCY
|
||||
//
|
||||
//Turn on fbset readmode support
|
||||
//#define CONFIG_FEATURE_FBSET_READMODE
|
||||
//#define BB_FEATURE_FBSET_READMODE
|
||||
//
|
||||
// Support insmod/lsmod/rmmod for post 2.1 kernels
|
||||
//#define CONFIG_FEATURE_NEW_MODULE_INTERFACE
|
||||
//#define BB_FEATURE_NEW_MODULE_INTERFACE
|
||||
//
|
||||
// Support insmod/lsmod/rmmod for pre 2.1 kernels
|
||||
//#define CONFIG_FEATURE_OLD_MODULE_INTERFACE
|
||||
//#define BB_FEATURE_OLD_MODULE_INTERFACE
|
||||
//
|
||||
// Support module version checking
|
||||
//#define CONFIG_FEATURE_INSMOD_VERSION_CHECKING
|
||||
//#define BB_FEATURE_INSMOD_VERSION_CHECKING
|
||||
//
|
||||
// Support for uClinux memory usage optimization, which will load the image
|
||||
// directly into the kernel memory. This divides memory requrements by three.
|
||||
// If you are not running uClinux (i.e., your CPU has an MMU) leave this
|
||||
// disabled...
|
||||
//#define CONFIG_FEATURE_INSMOD_LOADINKMEM
|
||||
//#define BB_FEATURE_INSMOD_LOADINKMEM
|
||||
//
|
||||
// Support for Minix filesystem, version 2
|
||||
//#define CONFIG_FEATURE_MINIX2
|
||||
//#define BB_FEATURE_MINIX2
|
||||
//
|
||||
// Enable ifconfig status reporting output -- this feature adds 12k.
|
||||
#define CONFIG_FEATURE_IFCONFIG_STATUS
|
||||
// Enable ifconfig status reporting output -- this feature adds 7k.
|
||||
#define BB_FEATURE_IFCONFIG_STATUS
|
||||
//
|
||||
// Enable ifconfig slip-specific options "keepalive" and "outfill"
|
||||
//#define CONFIG_FEATURE_IFCONFIG_SLIP
|
||||
//#define BB_FEATURE_IFCONFIG_SLIP
|
||||
//
|
||||
// Enable ifconfig options "mem_start", "io_addr", and "irq".
|
||||
//#define CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ
|
||||
#define BB_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ
|
||||
//
|
||||
// Enable ifconfig option "hw". Currently works for only with "ether".
|
||||
#define CONFIG_FEATURE_IFCONFIG_HW
|
||||
#define BB_FEATURE_IFCONFIG_HW
|
||||
//
|
||||
// Allows "broadcast +" to set broadcast automatically based on hostaddr
|
||||
// and netmask, at a cost of about 100 bytes of code (i386).
|
||||
//#define BB_FEATURE_IFCONFIG_BROADCAST_PLUS
|
||||
//
|
||||
// Enable busybox --install [-s]
|
||||
// to create links (or symlinks) for all the commands that are
|
||||
// compiled into the binary. (needs /proc filesystem)
|
||||
#define CONFIG_FEATURE_INSTALLER
|
||||
#define BB_FEATURE_INSTALLER
|
||||
//
|
||||
// Enable a nifty progress meter in wget (adds just under 2k)
|
||||
#define CONFIG_FEATURE_WGET_STATUSBAR
|
||||
#define BB_FEATURE_WGET_STATUSBAR
|
||||
//
|
||||
// Enable HTTP authentication in wget
|
||||
#define CONFIG_FEATURE_WGET_AUTHENTICATION
|
||||
#define BB_FEATURE_WGET_AUTHENTICATION
|
||||
//
|
||||
// Clean up all memory before exiting -- usually not needed
|
||||
// as the OS can clean up... Don't enable this unless you
|
||||
// have a really good reason for cleaning things up manually.
|
||||
//#define CONFIG_FEATURE_CLEAN_UP
|
||||
//#define BB_FEATURE_CLEAN_UP
|
||||
//
|
||||
// Support for human readable output by ls, du, etc.(example 13k, 23M, 235G)
|
||||
#define CONFIG_FEATURE_HUMAN_READABLE
|
||||
#define BB_FEATURE_HUMAN_READABLE
|
||||
//
|
||||
// Support for the find -type option.
|
||||
#define CONFIG_FEATURE_FIND_TYPE
|
||||
#define BB_FEATURE_FIND_TYPE
|
||||
//
|
||||
// Support for the find -perm option.
|
||||
#define CONFIG_FEATURE_FIND_PERM
|
||||
#define BB_FEATURE_FIND_PERM
|
||||
//
|
||||
// Support for the find -mtine option.
|
||||
#define CONFIG_FEATURE_FIND_MTIME
|
||||
// Support for the find -mtime option.
|
||||
#define BB_FEATURE_FIND_MTIME
|
||||
//
|
||||
//// Support for the find -newer option.
|
||||
#define BB_FEATURE_FIND_NEWER
|
||||
//
|
||||
// Support for the -A -B and -C context flags in grep
|
||||
//#define CONFIG_FEATURE_GREP_CONTEXT
|
||||
//#define BB_FEATURE_GREP_CONTEXT
|
||||
//
|
||||
// Support for the EGREP applet (alias to the grep applet)
|
||||
//#define CONFIG_FEATURE_GREP_EGREP_ALIAS
|
||||
//#define BB_FEATURE_GREP_EGREP_ALIAS
|
||||
//
|
||||
// Tell tftp what commands that should be supported.
|
||||
#define CONFIG_FEATURE_TFTP_PUT
|
||||
#define CONFIG_FEATURE_TFTP_GET
|
||||
#define BB_FEATURE_TFTP_PUT
|
||||
#define BB_FEATURE_TFTP_GET
|
||||
//
|
||||
// features for vi
|
||||
#define CONFIG_FEATURE_VI_COLON // ":" colon commands, no "ex" mode
|
||||
#define CONFIG_FEATURE_VI_YANKMARK // Yank/Put commands and Mark cmds
|
||||
#define CONFIG_FEATURE_VI_SEARCH // search and replace cmds
|
||||
#define CONFIG_FEATURE_VI_USE_SIGNALS // catch signals
|
||||
#define CONFIG_FEATURE_VI_DOT_CMD // remember previous cmd and "." cmd
|
||||
#define CONFIG_FEATURE_VI_READONLY // vi -R and "view" mode
|
||||
#define CONFIG_FEATURE_VI_SETOPTS // set-able options, ai ic showmatch
|
||||
#define CONFIG_FEATURE_VI_SET // :set
|
||||
#define CONFIG_FEATURE_VI_WIN_RESIZE // handle window resize
|
||||
//#define BB_FEATURE_VI_COLON // ":" colon commands, no "ex" mode
|
||||
//#define BB_FEATURE_VI_YANKMARK // Yank/Put commands and Mark cmds
|
||||
//#define BB_FEATURE_VI_SEARCH // search and replace cmds
|
||||
//#define BB_FEATURE_VI_USE_SIGNALS // catch signals
|
||||
//#define BB_FEATURE_VI_DOT_CMD // remember previous cmd and "." cmd
|
||||
//#define BB_FEATURE_VI_READONLY // vi -R and "view" mode
|
||||
//#define BB_FEATURE_VI_SETOPTS // set-able options, ai ic showmatch
|
||||
//#define BB_FEATURE_VI_SET // :set
|
||||
//#define BB_FEATURE_VI_WIN_RESIZE // handle window resize
|
||||
//
|
||||
// Enable a if you system have setuped locale
|
||||
//#define CONFIG_LOCALE_SUPPORT
|
||||
//#define BB_LOCALE_SUPPORT
|
||||
//
|
||||
// Support for TELNET to pass TERM type to remote host. Adds 384 bytes.
|
||||
#define CONFIG_FEATURE_TELNET_TTYPE
|
||||
#define BB_FEATURE_TELNET_TTYPE
|
||||
//
|
||||
// Support for devfs.
|
||||
//#define BB_FEATURE_DEVFS
|
||||
//
|
||||
// End of Features List
|
||||
//
|
||||
@@ -395,75 +421,73 @@
|
||||
// mere mortals so leave this stuff alone.
|
||||
//
|
||||
#include <features.h>
|
||||
#if defined __UCLIBC__ && ! defined __UCLIBC_HAS_MMU__
|
||||
#undef CONFIG_RPM2CPIO /* Uses gz_open(), which uses fork() */
|
||||
#undef CONFIG_DPKG_DEB /* Uses gz_open(), which uses fork() */
|
||||
#undef CONFIG_ASH /* Uses fork() */
|
||||
#undef CONFIG_HUSH /* Uses fork() */
|
||||
#undef CONFIG_LASH /* Uses fork() */
|
||||
#undef CONFIG_INIT /* Uses fork() */
|
||||
#undef CONFIG_FEATURE_TAR_GZIP /* Uses fork() */
|
||||
#undef CONFIG_SYSLOGD /* Uses daemon() */
|
||||
#undef CONFIG_KLOGD /* Uses daemon() */
|
||||
#undef CONFIG_UPDATE /* Uses daemon() */
|
||||
#if defined(__uClinux__)
|
||||
#undef BB_RPM2CPIO /* Uses gz_open(), which uses fork() */
|
||||
#undef BB_DPKG_DEB /* Uses gz_open(), which uses fork() */
|
||||
#undef BB_FEATURE_TAR_GZIP /* Uses fork() */
|
||||
#undef BB_UPDATE /* Uses daemon() */
|
||||
#endif
|
||||
#if defined CONFIG_ASH || defined CONFIG_HUSH || defined CONFIG_LASH || defined CONFIG_MSH
|
||||
#if defined CONFIG_FEATURE_COMMAND_EDITING
|
||||
#define CONFIG_CMDEDIT
|
||||
#if defined BB_ASH || defined BB_HUSH || defined BB_LASH || defined BB_MSH
|
||||
#if defined BB_FEATURE_COMMAND_EDITING
|
||||
#define BB_CMDEDIT
|
||||
#else
|
||||
#undef CONFIG_FEATURE_COMMAND_EDITING
|
||||
#undef CONFIG_FEATURE_COMMAND_TAB_COMPLETION
|
||||
#undef CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION
|
||||
#undef CONFIG_FEATURE_SH_FANCY_PROMPT
|
||||
#undef BB_FEATURE_COMMAND_EDITING
|
||||
#undef BB_FEATURE_COMMAND_TAB_COMPLETION
|
||||
#undef BB_FEATURE_COMMAND_USERNAME_COMPLETION
|
||||
#undef BB_FEATURE_SH_FANCY_PROMPT
|
||||
#endif
|
||||
#else
|
||||
#undef CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN
|
||||
#undef CONFIG_FEATURE_SH_STANDALONE_SHELL
|
||||
#undef CONFIG_FEATURE_SH_FANCY_PROMPT
|
||||
#undef BB_FEATURE_SH_APPLETS_ALWAYS_WIN
|
||||
#undef BB_FEATURE_SH_STANDALONE_SHELL
|
||||
#undef BB_FEATURE_SH_FANCY_PROMPT
|
||||
#endif
|
||||
//
|
||||
#ifdef CONFIG_KILLALL
|
||||
#ifndef CONFIG_KILL
|
||||
#define CONFIG_KILL
|
||||
#if (defined BB_ASH || defined BB_HUSH || defined BB_MSH) && ! defined BB_TEST
|
||||
#define BB_TEST
|
||||
#endif
|
||||
//
|
||||
#ifdef BB_KILLALL
|
||||
#ifndef BB_KILL
|
||||
#define BB_KILL
|
||||
#endif
|
||||
#endif
|
||||
//
|
||||
#ifndef CONFIG_INIT
|
||||
#undef CONFIG_FEATURE_INITRD
|
||||
#ifndef BB_INIT
|
||||
#undef BB_FEATURE_LINUXRC
|
||||
#endif
|
||||
//
|
||||
#if defined CONFIG_MOUNT && defined CONFIG_FEATURE_NFSMOUNT
|
||||
#define CONFIG_NFSMOUNT
|
||||
#if defined BB_MOUNT && defined BB_FEATURE_NFSMOUNT
|
||||
#define BB_NFSMOUNT
|
||||
#endif
|
||||
//
|
||||
#if defined CONFIG_FEATURE_AUTOWIDTH
|
||||
#ifndef CONFIG_FEATURE_USE_TERMIOS
|
||||
#define CONFIG_FEATURE_USE_TERMIOS
|
||||
#if defined BB_FEATURE_AUTOWIDTH
|
||||
#ifndef BB_FEATURE_USE_TERMIOS
|
||||
#define BB_FEATURE_USE_TERMIOS
|
||||
#endif
|
||||
#endif
|
||||
//
|
||||
#if defined CONFIG_INSMOD || defined CONFIG_LSMOD
|
||||
#if ! defined CONFIG_FEATURE_NEW_MODULE_INTERFACE && ! defined CONFIG_FEATURE_OLD_MODULE_INTERFACE
|
||||
#define CONFIG_FEATURE_NEW_MODULE_INTERFACE
|
||||
#if defined BB_INSMOD || defined BB_LSMOD
|
||||
#if ! defined BB_FEATURE_NEW_MODULE_INTERFACE && ! defined BB_FEATURE_OLD_MODULE_INTERFACE
|
||||
#define BB_FEATURE_NEW_MODULE_INTERFACE
|
||||
#endif
|
||||
#endif
|
||||
//
|
||||
#ifdef CONFIG_UNIX2DOS
|
||||
#define CONFIG_DOS2UNIX
|
||||
#ifdef BB_UNIX2DOS
|
||||
#define BB_DOS2UNIX
|
||||
#endif
|
||||
//
|
||||
#ifdef CONFIG_SYSLOGD
|
||||
#if defined CONFIG_FEATURE_IPC_SYSLOG
|
||||
#define CONFIG_LOGREAD
|
||||
#ifdef BB_SYSLOGD
|
||||
#if defined BB_FEATURE_IPC_SYSLOG
|
||||
#define BB_LOGREAD
|
||||
#endif
|
||||
#endif
|
||||
//
|
||||
#if defined CONFIG_ASH && defined CONFIG_FEATURE_SH_IS_ASH
|
||||
#if defined BB_ASH && defined BB_FEATURE_SH_IS_ASH
|
||||
# define shell_main ash_main
|
||||
#elif defined CONFIG_HUSH && defined CONFIG_FEATURE_SH_IS_HUSH
|
||||
#elif defined BB_HUSH && defined BB_FEATURE_SH_IS_HUSH
|
||||
# define shell_main hush_main
|
||||
#elif defined CONFIG_LASH && defined CONFIG_FEATURE_SH_IS_LASH
|
||||
#elif defined BB_LASH && defined BB_FEATURE_SH_IS_LASH
|
||||
# define shell_main lash_main
|
||||
#elif defined CONFIG_MSH && defined CONFIG_FEATURE_SH_IS_MSH
|
||||
#elif defined BB_MSH && defined BB_FEATURE_SH_IS_MSH
|
||||
# define shell_main msh_main
|
||||
#endif
|
||||
@@ -3,142 +3,145 @@
|
||||
// When you turn things off here, they won't be compiled in at all.
|
||||
//
|
||||
//// This file is parsed by sed. You MUST use single line comments.
|
||||
// i.e., //#define CONFIG_BLAH
|
||||
// i.e., //#define BB_BLAH
|
||||
//
|
||||
//
|
||||
// BusyBox Applications
|
||||
//#define CONFIG_ADJTIMEX
|
||||
#define CONFIG_AR
|
||||
#define CONFIG_ASH
|
||||
#define CONFIG_BASENAME
|
||||
#define CONFIG_CAT
|
||||
#define CONFIG_CHGRP
|
||||
#define CONFIG_CHMOD
|
||||
#define CONFIG_CHOWN
|
||||
#define CONFIG_CHROOT
|
||||
#define CONFIG_CHVT
|
||||
#define CONFIG_CLEAR
|
||||
#define CONFIG_CMP
|
||||
#define CONFIG_CP
|
||||
#define CONFIG_CPIO
|
||||
#define CONFIG_CUT
|
||||
#define CONFIG_DATE
|
||||
#define CONFIG_DC
|
||||
#define CONFIG_DD
|
||||
#define CONFIG_DEALLOCVT
|
||||
#define CONFIG_DF
|
||||
#define CONFIG_DIRNAME
|
||||
#define CONFIG_DMESG
|
||||
#define CONFIG_DOS2UNIX
|
||||
#define CONFIG_DPKG
|
||||
#define CONFIG_DPKG_DEB
|
||||
#define CONFIG_DUTMP
|
||||
#define CONFIG_DU
|
||||
#define CONFIG_DUMPKMAP
|
||||
#define CONFIG_ECHO
|
||||
#define CONFIG_ENV
|
||||
#define CONFIG_EXPR
|
||||
#define CONFIG_FBSET
|
||||
#define CONFIG_FDFLUSH
|
||||
#define CONFIG_FIND
|
||||
#define CONFIG_FREE
|
||||
#define CONFIG_FREERAMDISK
|
||||
#define CONFIG_FSCK_MINIX
|
||||
#define CONFIG_GETOPT
|
||||
#define CONFIG_GREP
|
||||
#define CONFIG_GUNZIP
|
||||
#define CONFIG_GZIP
|
||||
#define CONFIG_HALT
|
||||
#define CONFIG_HEAD
|
||||
#define CONFIG_HOSTID
|
||||
#define CONFIG_HOSTNAME
|
||||
//#define CONFIG_HUSH
|
||||
#define CONFIG_ID
|
||||
#define CONFIG_IFCONFIG
|
||||
#define CONFIG_INIT
|
||||
//#define CONFIG_INSMOD
|
||||
#define CONFIG_KILL
|
||||
#define CONFIG_KILLALL
|
||||
#define CONFIG_KLOGD
|
||||
//#define CONFIG_LASH
|
||||
#define CONFIG_LENGTH
|
||||
#define CONFIG_LN
|
||||
#define CONFIG_LOADACM
|
||||
#define CONFIG_LOADFONT
|
||||
#define CONFIG_LOADKMAP
|
||||
#define CONFIG_LOGGER
|
||||
#define CONFIG_LOGNAME
|
||||
#define CONFIG_LS
|
||||
#define CONFIG_LSMOD
|
||||
#define CONFIG_MAKEDEVS
|
||||
#define CONFIG_MD5SUM
|
||||
#define CONFIG_MKDIR
|
||||
#define CONFIG_MKFIFO
|
||||
#define CONFIG_MKFS_MINIX
|
||||
#define CONFIG_MKNOD
|
||||
#define CONFIG_MKSWAP
|
||||
#define CONFIG_MKTEMP
|
||||
//#define CONFIG_MODPROBE
|
||||
#define CONFIG_MORE
|
||||
#define CONFIG_MOUNT
|
||||
//#define CONFIG_MSH
|
||||
#define CONFIG_MT
|
||||
#define CONFIG_MV
|
||||
#define CONFIG_NC
|
||||
#define CONFIG_NSLOOKUP
|
||||
#define CONFIG_PIDOF
|
||||
#define CONFIG_PING
|
||||
#define CONFIG_PIVOT_ROOT
|
||||
#define CONFIG_POWEROFF
|
||||
#define CONFIG_PRINTF
|
||||
#define CONFIG_PS
|
||||
#define CONFIG_PWD
|
||||
#define CONFIG_RDATE
|
||||
#define CONFIG_READLINK
|
||||
#define CONFIG_REBOOT
|
||||
#define CONFIG_RENICE
|
||||
#define CONFIG_RESET
|
||||
#define CONFIG_RM
|
||||
#define CONFIG_RMDIR
|
||||
#define CONFIG_RMMOD
|
||||
#define CONFIG_ROUTE
|
||||
#define CONFIG_RPM2CPIO
|
||||
#define CONFIG_SED
|
||||
#define CONFIG_SETKEYCODES
|
||||
#define CONFIG_SLEEP
|
||||
#define CONFIG_SORT
|
||||
#define CONFIG_STTY
|
||||
#define CONFIG_SWAPONOFF
|
||||
#define CONFIG_SYNC
|
||||
#define CONFIG_SYSLOGD
|
||||
#define CONFIG_TAIL
|
||||
#define CONFIG_TAR
|
||||
#define CONFIG_TEE
|
||||
#define CONFIG_TEST
|
||||
#define CONFIG_TELNET
|
||||
#define CONFIG_TFTP
|
||||
#define CONFIG_TOUCH
|
||||
#define CONFIG_TR
|
||||
#define CONFIG_TRACEROUTE
|
||||
#define CONFIG_TRUE_FALSE
|
||||
#define CONFIG_TTY
|
||||
#define CONFIG_UNIX2DOS
|
||||
#define CONFIG_UUENCODE
|
||||
#define CONFIG_UUDECODE
|
||||
#define CONFIG_UMOUNT
|
||||
#define CONFIG_UNIQ
|
||||
#define CONFIG_UNAME
|
||||
#define CONFIG_UPDATE
|
||||
#define CONFIG_UPTIME
|
||||
#define CONFIG_USLEEP
|
||||
#define CONFIG_VI
|
||||
#define CONFIG_WATCHDOG
|
||||
#define CONFIG_WC
|
||||
#define CONFIG_WGET
|
||||
#define CONFIG_WHICH
|
||||
#define CONFIG_WHOAMI
|
||||
#define CONFIG_XARGS
|
||||
#define CONFIG_YES
|
||||
//#define BB_ADJTIMEX
|
||||
#define BB_AR
|
||||
#define BB_ASH
|
||||
#define BB_BASENAME
|
||||
#define BB_CAT
|
||||
#define BB_CHGRP
|
||||
#define BB_CHMOD
|
||||
#define BB_CHOWN
|
||||
#define BB_CHROOT
|
||||
#define BB_CHVT
|
||||
#define BB_CLEAR
|
||||
#define BB_CMP
|
||||
#define BB_CP
|
||||
#define BB_CPIO
|
||||
#define BB_CUT
|
||||
#define BB_DATE
|
||||
#define BB_DC
|
||||
#define BB_DD
|
||||
#define BB_DEALLOCVT
|
||||
#define BB_DF
|
||||
#define BB_DIRNAME
|
||||
#define BB_DMESG
|
||||
#define BB_DOS2UNIX
|
||||
#define BB_DPKG
|
||||
#define BB_DPKG_DEB
|
||||
#define BB_DUTMP
|
||||
#define BB_DU
|
||||
#define BB_DUMPKMAP
|
||||
#define BB_ECHO
|
||||
#define BB_ENV
|
||||
#define BB_EXPR
|
||||
#define BB_FBSET
|
||||
#define BB_FDFLUSH
|
||||
#define BB_FIND
|
||||
#define BB_FREE
|
||||
#define BB_FREERAMDISK
|
||||
#define BB_FSCK_MINIX
|
||||
#define BB_GETOPT
|
||||
#define BB_GREP
|
||||
#define BB_GUNZIP
|
||||
#define BB_GZIP
|
||||
#define BB_HALT
|
||||
#define BB_HEAD
|
||||
#define BB_HOSTID
|
||||
#define BB_HOSTNAME
|
||||
//#define BB_HUSH
|
||||
#define BB_ID
|
||||
#define BB_IFCONFIG
|
||||
#define BB_INIT
|
||||
//#define BB_INSMOD
|
||||
#define BB_KILL
|
||||
#define BB_KILLALL
|
||||
#define BB_KLOGD
|
||||
//#define BB_LASH
|
||||
#define BB_LENGTH
|
||||
#define BB_LN
|
||||
#define BB_LOADACM
|
||||
#define BB_LOADFONT
|
||||
#define BB_LOADKMAP
|
||||
#define BB_LOGGER
|
||||
#define BB_LOGNAME
|
||||
#define BB_LOSETUP
|
||||
#define BB_LS
|
||||
#define BB_LSMOD
|
||||
#define BB_MAKEDEVS
|
||||
#define BB_MD5SUM
|
||||
#define BB_MKDIR
|
||||
#define BB_MKFIFO
|
||||
#define BB_MKFS_MINIX
|
||||
#define BB_MKNOD
|
||||
#define BB_MKSWAP
|
||||
#define BB_MKTEMP
|
||||
#define BB_MODPROBE
|
||||
#define BB_MORE
|
||||
#define BB_MOUNT
|
||||
//#define BB_MSH
|
||||
#define BB_MT
|
||||
#define BB_MV
|
||||
#define BB_NC
|
||||
#define BB_NSLOOKUP
|
||||
#define BB_PIDOF
|
||||
#define BB_PING
|
||||
#define BB_PIVOT_ROOT
|
||||
#define BB_POWEROFF
|
||||
#define BB_PRINTF
|
||||
#define BB_PS
|
||||
#define BB_PWD
|
||||
#define BB_RDATE
|
||||
#define BB_READLINK
|
||||
#define BB_REBOOT
|
||||
#define BB_RENICE
|
||||
#define BB_RESET
|
||||
#define BB_RM
|
||||
#define BB_RMDIR
|
||||
#define BB_RMMOD
|
||||
#define BB_ROUTE
|
||||
#define BB_RPM2CPIO
|
||||
#define BB_SED
|
||||
#define BB_SETKEYCODES
|
||||
#define BB_SLEEP
|
||||
#define BB_SORT
|
||||
#define BB_STTY
|
||||
#define BB_SWAPONOFF
|
||||
#define BB_SYNC
|
||||
#define BB_SYSLOGD
|
||||
#define BB_TAIL
|
||||
#define BB_TAR
|
||||
#define BB_TEE
|
||||
#define BB_TEST
|
||||
#define BB_TELNET
|
||||
#define BB_TFTP
|
||||
#define BB_TIME
|
||||
#define BB_TOP
|
||||
#define BB_TOUCH
|
||||
#define BB_TR
|
||||
#define BB_TRACEROUTE
|
||||
#define BB_TRUE_FALSE
|
||||
#define BB_TTY
|
||||
#define BB_UNIX2DOS
|
||||
#define BB_UUENCODE
|
||||
#define BB_UUDECODE
|
||||
#define BB_UMOUNT
|
||||
#define BB_UNIQ
|
||||
#define BB_UNAME
|
||||
#define BB_UPDATE
|
||||
#define BB_UPTIME
|
||||
#define BB_USLEEP
|
||||
#define BB_VI
|
||||
#define BB_WATCHDOG
|
||||
#define BB_WC
|
||||
#define BB_WGET
|
||||
#define BB_WHICH
|
||||
#define BB_WHOAMI
|
||||
#define BB_XARGS
|
||||
#define BB_YES
|
||||
// End of Applications List
|
||||
//
|
||||
//
|
||||
@@ -151,21 +154,21 @@
|
||||
//
|
||||
// If you enabled one or more of the shells, you may select which one
|
||||
// should be run when sh is invoked:
|
||||
#define CONFIG_FEATURE_SH_IS_ASH
|
||||
//#define CONFIG_FEATURE_SH_IS_HUSH
|
||||
//#define CONFIG_FEATURE_SH_IS_LASH
|
||||
//#define CONFIG_FEATURE_SH_IS_MSH
|
||||
#define BB_FEATURE_SH_IS_ASH
|
||||
//#define BB_FEATURE_SH_IS_HUSH
|
||||
//#define BB_FEATURE_SH_IS_LASH
|
||||
//#define BB_FEATURE_SH_IS_MSH
|
||||
//
|
||||
// BusyBox will, by default, malloc space for its buffers. This costs code
|
||||
// size for the call to xmalloc. You can use the following feature to have
|
||||
// them put on the stack. For some very small machines with limited stack
|
||||
// space, this can be deadly. For most folks, this works just fine...
|
||||
//#define CONFIG_FEATURE_BUFFERS_GO_ON_STACK
|
||||
//#define BB_FEATURE_BUFFERS_GO_ON_STACK
|
||||
// The third alternative for buffer allocation is to use BSS. This works
|
||||
// beautifully for computers with a real MMU (and OS support), but wastes
|
||||
// runtime RAM for uCLinux. This behavior was the only one available for
|
||||
// BusyBox versions 0.48 and earlier.
|
||||
//#define CONFIG_FEATURE_BUFFERS_GO_IN_BSS
|
||||
//#define BB_FEATURE_BUFFERS_GO_IN_BSS
|
||||
//
|
||||
// Turn this on to use Erik's very cool devps, and devmtab kernel drivers,
|
||||
// thereby eliminating the need for the /proc filesystem and thereby saving
|
||||
@@ -176,212 +179,235 @@
|
||||
// mknod /dev/mtab c 10 22
|
||||
// mknod /dev/ps c 10 21
|
||||
// I emailed Linus and this patch will not be going into the stock kernel.
|
||||
//#define CONFIG_FEATURE_USE_DEVPS_PATCH
|
||||
//#define BB_FEATURE_USE_DEVPS_PATCH
|
||||
//
|
||||
// show verbose usage messages
|
||||
#define CONFIG_FEATURE_VERBOSE_USAGE
|
||||
#define BB_FEATURE_VERBOSE_USAGE
|
||||
//
|
||||
// Use termios to manipulate the screen ('more' is prettier with this on)
|
||||
#define CONFIG_FEATURE_USE_TERMIOS
|
||||
#define BB_FEATURE_USE_TERMIOS
|
||||
//
|
||||
// calculate terminal & column widths (for more and ls)
|
||||
#define CONFIG_FEATURE_AUTOWIDTH
|
||||
// calculate terminal & column widths (for more, ls, and telnet)
|
||||
#define BB_FEATURE_AUTOWIDTH
|
||||
//
|
||||
// show username/groupnames for ls
|
||||
#define CONFIG_FEATURE_LS_USERNAME
|
||||
#define BB_FEATURE_LS_USERNAME
|
||||
//
|
||||
// show file timestamps in ls
|
||||
#define CONFIG_FEATURE_LS_TIMESTAMPS
|
||||
#define BB_FEATURE_LS_TIMESTAMPS
|
||||
//
|
||||
// enable ls -p and -F
|
||||
#define CONFIG_FEATURE_LS_FILETYPES
|
||||
#define BB_FEATURE_LS_FILETYPES
|
||||
//
|
||||
// sort the file names
|
||||
#define CONFIG_FEATURE_LS_SORTFILES
|
||||
#define BB_FEATURE_LS_SORTFILES
|
||||
//
|
||||
// enable ls -R
|
||||
#define CONFIG_FEATURE_LS_RECURSIVE
|
||||
#define BB_FEATURE_LS_RECURSIVE
|
||||
//
|
||||
// enable ls -L
|
||||
#define CONFIG_FEATURE_LS_FOLLOWLINKS
|
||||
#define BB_FEATURE_LS_FOLLOWLINKS
|
||||
//
|
||||
// Use color to identify different file types
|
||||
#define BB_FEATURE_LS_COLOR
|
||||
//
|
||||
// Disable for a smaller (but less functional) ping
|
||||
#define CONFIG_FEATURE_FANCY_PING
|
||||
#define BB_FEATURE_FANCY_PING
|
||||
//
|
||||
// Make init use a simplified /etc/inittab file (recommended).
|
||||
#define CONFIG_FEATURE_USE_INITTAB
|
||||
#define BB_FEATURE_USE_INITTAB
|
||||
//
|
||||
//Enable init being called as /linuxrc
|
||||
#define CONFIG_FEATURE_INITRD
|
||||
#define BB_FEATURE_LINUXRC
|
||||
//
|
||||
//Have init enable core dumping for child processes (for debugging only)
|
||||
//#define CONFIG_FEATURE_INIT_COREDUMPS
|
||||
//#define BB_FEATURE_INIT_COREDUMPS
|
||||
//
|
||||
//Make sure nothing is printed to the console on boot
|
||||
//#define CONFIG_FEATURE_EXTRA_QUIET
|
||||
//#define BB_FEATURE_EXTRA_QUIET
|
||||
//
|
||||
// enable syslogd -R remotehost
|
||||
#define CONFIG_FEATURE_REMOTE_LOG
|
||||
#define BB_FEATURE_REMOTE_LOG
|
||||
//
|
||||
// enable syslogd -C
|
||||
//#define CONFIG_FEATURE_IPC_SYSLOG
|
||||
//#define BB_FEATURE_IPC_SYSLOG
|
||||
//
|
||||
//Disable for a simple tail implementation (2.34k vs 3k for the full one).
|
||||
//Both provide 'tail -f', but this cuts out -c, -q, -s, and -v.
|
||||
#define CONFIG_FEATURE_FANCY_TAIL
|
||||
#define BB_FEATURE_FANCY_TAIL
|
||||
//
|
||||
// Enable support for loop devices in mount
|
||||
#define CONFIG_FEATURE_MOUNT_LOOP
|
||||
#define BB_FEATURE_MOUNT_LOOP
|
||||
//
|
||||
// Enable support for a real /etc/mtab file instead of /proc/mounts
|
||||
//#define CONFIG_FEATURE_MTAB_SUPPORT
|
||||
//#define BB_FEATURE_MTAB_SUPPORT
|
||||
//
|
||||
// Enable support for mounting remote NFS volumes.
|
||||
// You may need to mount with "-o nolock" if you are
|
||||
// not running a local portmapper daemon...
|
||||
#define CONFIG_FEATURE_NFSMOUNT
|
||||
//
|
||||
// If you are using uClibc, be sure that you've already compiled
|
||||
// uClibc with INCLUDE_RPC=true (contained in the Config file)
|
||||
#define BB_FEATURE_NFSMOUNT
|
||||
//
|
||||
// Enable support forced filesystem unmounting
|
||||
// (i.e., in case of an unreachable NFS system).
|
||||
#define CONFIG_FEATURE_MOUNT_FORCE
|
||||
#define BB_FEATURE_MOUNT_FORCE
|
||||
//
|
||||
// Enable support for creation of tar files.
|
||||
#define CONFIG_FEATURE_TAR_CREATE
|
||||
#define BB_FEATURE_TAR_CREATE
|
||||
//
|
||||
// Enable support for "--exclude" and "-X" for excluding files
|
||||
#define CONFIG_FEATURE_TAR_EXCLUDE
|
||||
#define BB_FEATURE_TAR_EXCLUDE
|
||||
//
|
||||
// Enable support for tar -z option (currently only works for inflating)
|
||||
#define CONFIG_FEATURE_TAR_GZIP
|
||||
#define BB_FEATURE_TAR_GZIP
|
||||
//
|
||||
// Enable reverse sort
|
||||
#define CONFIG_FEATURE_SORT_REVERSE
|
||||
#define BB_FEATURE_SORT_REVERSE
|
||||
//
|
||||
// Enable uniqe sort
|
||||
#define CONFIG_FEATURE_SORT_UNIQUE
|
||||
#define BB_FEATURE_SORT_UNIQUE
|
||||
//
|
||||
// Enable command line editing in the shell.
|
||||
// Only relevant if a shell is enabled. On by default.
|
||||
#define CONFIG_FEATURE_COMMAND_EDITING
|
||||
#define BB_FEATURE_COMMAND_EDITING
|
||||
//
|
||||
// Enable tab completion in the shell. This is now working quite nicely.
|
||||
// This feature adds a bit over 4k. Only relevant if a shell is enabled.
|
||||
#define CONFIG_FEATURE_COMMAND_TAB_COMPLETION
|
||||
#define BB_FEATURE_COMMAND_TAB_COMPLETION
|
||||
//
|
||||
// Attempts to match usernames in a ~-prefixed path
|
||||
//#define CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION
|
||||
#define BB_FEATURE_COMMAND_USERNAME_COMPLETION
|
||||
//
|
||||
//Allow the shell to invoke all the compiled in BusyBox applets as if they
|
||||
//were shell builtins. Nice for staticly linking an emergency rescue shell,
|
||||
//among other things. Off by default.
|
||||
// Only relevant if a shell is enabled.
|
||||
#define CONFIG_FEATURE_SH_STANDALONE_SHELL
|
||||
#define BB_FEATURE_SH_STANDALONE_SHELL
|
||||
//
|
||||
//When this is enabled, busybox shell applets can be called using full path
|
||||
//names. This causes applets (i.e., most busybox commands) to override
|
||||
//real commands on the filesystem. For example, if you run run /bin/cat, it
|
||||
//will use BusyBox cat even if /bin/cat exists on the filesystem and is _not_
|
||||
//busybox. Some systems want this, others do not. Choose wisely. :-) This
|
||||
//only has meaning when CONFIG_FEATURE_SH_STANDALONE_SHELL is enabled.
|
||||
//only has meaning when BB_FEATURE_SH_STANDALONE_SHELL is enabled.
|
||||
// Only relevant if a shell is enabled. Off by default.
|
||||
#define CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN
|
||||
#define BB_FEATURE_SH_APPLETS_ALWAYS_WIN
|
||||
//
|
||||
// Uncomment this option for a fancy shell prompt that includes the
|
||||
// current username and hostname. On systems that don't have usernames
|
||||
// or hostnames, this can look hideous.
|
||||
// Only relevant if a shell is enabled.
|
||||
#define CONFIG_FEATURE_SH_FANCY_PROMPT
|
||||
#define BB_FEATURE_SH_FANCY_PROMPT
|
||||
//
|
||||
// Uncomment this option to disable job control. Job control lets you
|
||||
// run jobs in the background (which completely useless for is all you
|
||||
// are doing is running scripts). Disabing this is bad for interactive
|
||||
// use, since when you hit ^C in an application, it will also kill the
|
||||
// shell. This adds about 2.5k on an x86 system.
|
||||
#define BB_FEATURE_ASH_JOB_CONTROL
|
||||
//
|
||||
//Turn on extra fbset options
|
||||
//#define CONFIG_FEATURE_FBSET_FANCY
|
||||
//#define BB_FEATURE_FBSET_FANCY
|
||||
//
|
||||
//Turn on fbset readmode support
|
||||
//#define CONFIG_FEATURE_FBSET_READMODE
|
||||
#define BB_FEATURE_FBSET_READMODE
|
||||
//
|
||||
// Support insmod/lsmod/rmmod for post 2.1 kernels
|
||||
#define CONFIG_FEATURE_NEW_MODULE_INTERFACE
|
||||
#define BB_FEATURE_NEW_MODULE_INTERFACE
|
||||
//
|
||||
// Support insmod/lsmod/rmmod for pre 2.1 kernels
|
||||
//#define CONFIG_FEATURE_OLD_MODULE_INTERFACE
|
||||
//#define BB_FEATURE_OLD_MODULE_INTERFACE
|
||||
//
|
||||
// Support module version checking
|
||||
//#define CONFIG_FEATURE_INSMOD_VERSION_CHECKING
|
||||
//#define BB_FEATURE_INSMOD_VERSION_CHECKING
|
||||
//
|
||||
// Support for uClinux memory usage optimization, which will load the image
|
||||
// directly into the kernel memory. This divides memory requrements by three.
|
||||
// If you are not running uClinux (i.e., your CPU has an MMU) leave this
|
||||
// disabled...
|
||||
//#define CONFIG_FEATURE_INSMOD_LOADINKMEM
|
||||
//#define BB_FEATURE_INSMOD_LOADINKMEM
|
||||
//
|
||||
// Support for Minix filesystem, version 2
|
||||
//#define CONFIG_FEATURE_MINIX2
|
||||
#define BB_FEATURE_MINIX2
|
||||
//
|
||||
// Enable ifconfig status reporting output -- this feature adds 12k.
|
||||
#define CONFIG_FEATURE_IFCONFIG_STATUS
|
||||
// Enable ifconfig status reporting output -- this feature adds 7k.
|
||||
#define BB_FEATURE_IFCONFIG_STATUS
|
||||
//
|
||||
// Enable ifconfig slip-specific options "keepalive" and "outfill"
|
||||
//#define CONFIG_FEATURE_IFCONFIG_SLIP
|
||||
#define BB_FEATURE_IFCONFIG_SLIP
|
||||
//
|
||||
// Enable ifconfig options "mem_start", "io_addr", and "irq".
|
||||
//#define CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ
|
||||
#define BB_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ
|
||||
//
|
||||
// Enable ifconfig option "hw". Currently works for only with "ether".
|
||||
#define CONFIG_FEATURE_IFCONFIG_HW
|
||||
#define BB_FEATURE_IFCONFIG_HW
|
||||
//
|
||||
// Allows "broadcast +" to set broadcast automatically based on hostaddr
|
||||
// and netmask, at a cost of about 100 bytes of code (i386).
|
||||
#define BB_FEATURE_IFCONFIG_BROADCAST_PLUS
|
||||
//
|
||||
// Enable busybox --install [-s]
|
||||
// to create links (or symlinks) for all the commands that are
|
||||
// compiled into the binary. (needs /proc filesystem)
|
||||
#define CONFIG_FEATURE_INSTALLER
|
||||
//#define BB_FEATURE_INSTALLER
|
||||
//
|
||||
// Enable a nifty progress meter in wget (adds just under 2k)
|
||||
#define CONFIG_FEATURE_WGET_STATUSBAR
|
||||
#define BB_FEATURE_WGET_STATUSBAR
|
||||
//
|
||||
// Enable HTTP authentication in wget
|
||||
#define CONFIG_FEATURE_WGET_AUTHENTICATION
|
||||
#define BB_FEATURE_WGET_AUTHENTICATION
|
||||
//
|
||||
// Clean up all memory before exiting -- usually not needed
|
||||
// as the OS can clean up... Don't enable this unless you
|
||||
// have a really good reason for cleaning things up manually.
|
||||
//#define CONFIG_FEATURE_CLEAN_UP
|
||||
//#define BB_FEATURE_CLEAN_UP
|
||||
//
|
||||
// Support for human readable output by ls, du, etc.(example 13k, 23M, 235G)
|
||||
#define CONFIG_FEATURE_HUMAN_READABLE
|
||||
#define BB_FEATURE_HUMAN_READABLE
|
||||
//
|
||||
// Support for the find -type option.
|
||||
#define CONFIG_FEATURE_FIND_TYPE
|
||||
#define BB_FEATURE_FIND_TYPE
|
||||
//
|
||||
// Support for the find -perm option.
|
||||
#define CONFIG_FEATURE_FIND_PERM
|
||||
#define BB_FEATURE_FIND_PERM
|
||||
//
|
||||
// Support for the find -mtine option.
|
||||
#define CONFIG_FEATURE_FIND_MTIME
|
||||
// Support for the find -mtime option.
|
||||
#define BB_FEATURE_FIND_MTIME
|
||||
//
|
||||
//// Support for the find -newer option.
|
||||
#define BB_FEATURE_FIND_NEWER
|
||||
//
|
||||
// Support for the -A -B and -C context flags in grep
|
||||
//#define CONFIG_FEATURE_GREP_CONTEXT
|
||||
#define BB_FEATURE_GREP_CONTEXT
|
||||
//
|
||||
// Support for the EGREP applet (alias to the grep applet)
|
||||
//#define CONFIG_FEATURE_GREP_EGREP_ALIAS
|
||||
#define BB_FEATURE_GREP_EGREP_ALIAS
|
||||
//
|
||||
// Tell tftp what commands that should be supported.
|
||||
#define CONFIG_FEATURE_TFTP_PUT
|
||||
#define CONFIG_FEATURE_TFTP_GET
|
||||
#define BB_FEATURE_TFTP_PUT
|
||||
#define BB_FEATURE_TFTP_GET
|
||||
//
|
||||
// features for vi
|
||||
#define CONFIG_FEATURE_VI_COLON // ":" colon commands, no "ex" mode
|
||||
#define CONFIG_FEATURE_VI_YANKMARK // Yank/Put commands and Mark cmds
|
||||
#define CONFIG_FEATURE_VI_SEARCH // search and replace cmds
|
||||
#define CONFIG_FEATURE_VI_USE_SIGNALS // catch signals
|
||||
#define CONFIG_FEATURE_VI_DOT_CMD // remember previous cmd and "." cmd
|
||||
#define CONFIG_FEATURE_VI_READONLY // vi -R and "view" mode
|
||||
#define CONFIG_FEATURE_VI_SETOPTS // set-able options, ai ic showmatch
|
||||
#define CONFIG_FEATURE_VI_SET // :set
|
||||
#define CONFIG_FEATURE_VI_WIN_RESIZE // handle window resize
|
||||
#define BB_FEATURE_VI_COLON // ":" colon commands, no "ex" mode
|
||||
#define BB_FEATURE_VI_YANKMARK // Yank/Put commands and Mark cmds
|
||||
#define BB_FEATURE_VI_SEARCH // search and replace cmds
|
||||
#define BB_FEATURE_VI_USE_SIGNALS // catch signals
|
||||
#define BB_FEATURE_VI_DOT_CMD // remember previous cmd and "." cmd
|
||||
#define BB_FEATURE_VI_READONLY // vi -R and "view" mode
|
||||
#define BB_FEATURE_VI_SETOPTS // set-able options, ai ic showmatch
|
||||
#define BB_FEATURE_VI_SET // :set
|
||||
#define BB_FEATURE_VI_WIN_RESIZE // handle window resize
|
||||
//
|
||||
// Enable a if you system have setuped locale
|
||||
//#define CONFIG_LOCALE_SUPPORT
|
||||
//#define BB_LOCALE_SUPPORT
|
||||
//
|
||||
// Support for TELNET to pass TERM type to remote host. Adds 384 bytes.
|
||||
#define CONFIG_FEATURE_TELNET_TTYPE
|
||||
#define BB_FEATURE_TELNET_TTYPE
|
||||
//
|
||||
// Support for devfs.
|
||||
//#define BB_FEATURE_DEVFS
|
||||
//
|
||||
// End of Features List
|
||||
//
|
||||
@@ -395,75 +421,73 @@
|
||||
// mere mortals so leave this stuff alone.
|
||||
//
|
||||
#include <features.h>
|
||||
#if defined __UCLIBC__ && ! defined __UCLIBC_HAS_MMU__
|
||||
#undef CONFIG_RPM2CPIO /* Uses gz_open(), which uses fork() */
|
||||
#undef CONFIG_DPKG_DEB /* Uses gz_open(), which uses fork() */
|
||||
#undef CONFIG_ASH /* Uses fork() */
|
||||
#undef CONFIG_HUSH /* Uses fork() */
|
||||
#undef CONFIG_LASH /* Uses fork() */
|
||||
#undef CONFIG_INIT /* Uses fork() */
|
||||
#undef CONFIG_FEATURE_TAR_GZIP /* Uses fork() */
|
||||
#undef CONFIG_SYSLOGD /* Uses daemon() */
|
||||
#undef CONFIG_KLOGD /* Uses daemon() */
|
||||
#undef CONFIG_UPDATE /* Uses daemon() */
|
||||
#if defined(__uClinux__)
|
||||
#undef BB_RPM2CPIO /* Uses gz_open(), which uses fork() */
|
||||
#undef BB_DPKG_DEB /* Uses gz_open(), which uses fork() */
|
||||
#undef BB_FEATURE_TAR_GZIP /* Uses fork() */
|
||||
#undef BB_UPDATE /* Uses daemon() */
|
||||
#endif
|
||||
#if defined CONFIG_ASH || defined CONFIG_HUSH || defined CONFIG_LASH || defined CONFIG_MSH
|
||||
#if defined CONFIG_FEATURE_COMMAND_EDITING
|
||||
#define CONFIG_CMDEDIT
|
||||
#if defined BB_ASH || defined BB_HUSH || defined BB_LASH || defined BB_MSH
|
||||
#if defined BB_FEATURE_COMMAND_EDITING
|
||||
#define BB_CMDEDIT
|
||||
#else
|
||||
#undef CONFIG_FEATURE_COMMAND_EDITING
|
||||
#undef CONFIG_FEATURE_COMMAND_TAB_COMPLETION
|
||||
#undef CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION
|
||||
#undef CONFIG_FEATURE_SH_FANCY_PROMPT
|
||||
#undef BB_FEATURE_COMMAND_EDITING
|
||||
#undef BB_FEATURE_COMMAND_TAB_COMPLETION
|
||||
#undef BB_FEATURE_COMMAND_USERNAME_COMPLETION
|
||||
#undef BB_FEATURE_SH_FANCY_PROMPT
|
||||
#endif
|
||||
#else
|
||||
#undef CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN
|
||||
#undef CONFIG_FEATURE_SH_STANDALONE_SHELL
|
||||
#undef CONFIG_FEATURE_SH_FANCY_PROMPT
|
||||
#undef BB_FEATURE_SH_APPLETS_ALWAYS_WIN
|
||||
#undef BB_FEATURE_SH_STANDALONE_SHELL
|
||||
#undef BB_FEATURE_SH_FANCY_PROMPT
|
||||
#endif
|
||||
//
|
||||
#ifdef CONFIG_KILLALL
|
||||
#ifndef CONFIG_KILL
|
||||
#define CONFIG_KILL
|
||||
#if (defined BB_ASH || defined BB_HUSH || defined BB_MSH) && ! defined BB_TEST
|
||||
#define BB_TEST
|
||||
#endif
|
||||
//
|
||||
#ifdef BB_KILLALL
|
||||
#ifndef BB_KILL
|
||||
#define BB_KILL
|
||||
#endif
|
||||
#endif
|
||||
//
|
||||
#ifndef CONFIG_INIT
|
||||
#undef CONFIG_FEATURE_INITRD
|
||||
#ifndef BB_INIT
|
||||
#undef BB_FEATURE_LINUXRC
|
||||
#endif
|
||||
//
|
||||
#if defined CONFIG_MOUNT && defined CONFIG_FEATURE_NFSMOUNT
|
||||
#define CONFIG_NFSMOUNT
|
||||
#if defined BB_MOUNT && defined BB_FEATURE_NFSMOUNT
|
||||
#define BB_NFSMOUNT
|
||||
#endif
|
||||
//
|
||||
#if defined CONFIG_FEATURE_AUTOWIDTH
|
||||
#ifndef CONFIG_FEATURE_USE_TERMIOS
|
||||
#define CONFIG_FEATURE_USE_TERMIOS
|
||||
#if defined BB_FEATURE_AUTOWIDTH
|
||||
#ifndef BB_FEATURE_USE_TERMIOS
|
||||
#define BB_FEATURE_USE_TERMIOS
|
||||
#endif
|
||||
#endif
|
||||
//
|
||||
#if defined CONFIG_INSMOD || defined CONFIG_LSMOD
|
||||
#if ! defined CONFIG_FEATURE_NEW_MODULE_INTERFACE && ! defined CONFIG_FEATURE_OLD_MODULE_INTERFACE
|
||||
#define CONFIG_FEATURE_NEW_MODULE_INTERFACE
|
||||
#if defined BB_INSMOD || defined BB_LSMOD
|
||||
#if ! defined BB_FEATURE_NEW_MODULE_INTERFACE && ! defined BB_FEATURE_OLD_MODULE_INTERFACE
|
||||
#define BB_FEATURE_NEW_MODULE_INTERFACE
|
||||
#endif
|
||||
#endif
|
||||
//
|
||||
#ifdef CONFIG_UNIX2DOS
|
||||
#define CONFIG_DOS2UNIX
|
||||
#ifdef BB_UNIX2DOS
|
||||
#define BB_DOS2UNIX
|
||||
#endif
|
||||
//
|
||||
#ifdef CONFIG_SYSLOGD
|
||||
#if defined CONFIG_FEATURE_IPC_SYSLOG
|
||||
#define CONFIG_LOGREAD
|
||||
#ifdef BB_SYSLOGD
|
||||
#if defined BB_FEATURE_IPC_SYSLOG
|
||||
#define BB_LOGREAD
|
||||
#endif
|
||||
#endif
|
||||
//
|
||||
#if defined CONFIG_ASH && defined CONFIG_FEATURE_SH_IS_ASH
|
||||
#if defined BB_ASH && defined BB_FEATURE_SH_IS_ASH
|
||||
# define shell_main ash_main
|
||||
#elif defined CONFIG_HUSH && defined CONFIG_FEATURE_SH_IS_HUSH
|
||||
#elif defined BB_HUSH && defined BB_FEATURE_SH_IS_HUSH
|
||||
# define shell_main hush_main
|
||||
#elif defined CONFIG_LASH && defined CONFIG_FEATURE_SH_IS_LASH
|
||||
#elif defined BB_LASH && defined BB_FEATURE_SH_IS_LASH
|
||||
# define shell_main lash_main
|
||||
#elif defined CONFIG_MSH && defined CONFIG_FEATURE_SH_IS_MSH
|
||||
#elif defined BB_MSH && defined BB_FEATURE_SH_IS_MSH
|
||||
# define shell_main msh_main
|
||||
#endif
|
||||
@@ -3,142 +3,145 @@
|
||||
// When you turn things off here, they won't be compiled in at all.
|
||||
//
|
||||
//// This file is parsed by sed. You MUST use single line comments.
|
||||
// i.e., //#define CONFIG_BLAH
|
||||
// i.e., //#define BB_BLAH
|
||||
//
|
||||
//
|
||||
// BusyBox Applications
|
||||
//#define CONFIG_ADJTIMEX
|
||||
//#define CONFIG_AR
|
||||
//#define CONFIG_ASH
|
||||
#define CONFIG_BASENAME
|
||||
#define CONFIG_CAT
|
||||
#define CONFIG_CHGRP
|
||||
#define CONFIG_CHMOD
|
||||
#define CONFIG_CHOWN
|
||||
#define CONFIG_CHROOT
|
||||
#define CONFIG_CHVT
|
||||
#define CONFIG_CLEAR
|
||||
//#define CONFIG_CMP
|
||||
#define CONFIG_CP
|
||||
//#define CONFIG_CPIO
|
||||
#define CONFIG_CUT
|
||||
#define CONFIG_DATE
|
||||
//#define CONFIG_DC
|
||||
#define CONFIG_DD
|
||||
//#define CONFIG_DEALLOCVT
|
||||
#define CONFIG_DF
|
||||
#define CONFIG_DIRNAME
|
||||
#define CONFIG_DMESG
|
||||
//#define CONFIG_DOS2UNIX
|
||||
//#define CONFIG_DPKG
|
||||
//#define CONFIG_DPKG_DEB
|
||||
//#define CONFIG_DUTMP
|
||||
#define CONFIG_DU
|
||||
//#define CONFIG_DUMPKMAP
|
||||
#define CONFIG_ECHO
|
||||
#define CONFIG_ENV
|
||||
#define CONFIG_EXPR
|
||||
//#define CONFIG_FBSET
|
||||
//#define CONFIG_FDFLUSH
|
||||
#define CONFIG_FIND
|
||||
#define CONFIG_FREE
|
||||
#define CONFIG_FREERAMDISK
|
||||
//#define CONFIG_FSCK_MINIX
|
||||
//#define CONFIG_GETOPT
|
||||
#define CONFIG_GREP
|
||||
#define CONFIG_GUNZIP
|
||||
#define CONFIG_GZIP
|
||||
#define CONFIG_HALT
|
||||
#define CONFIG_HEAD
|
||||
//#define CONFIG_HOSTID
|
||||
//#define CONFIG_HOSTNAME
|
||||
//#define CONFIG_HUSH
|
||||
#define CONFIG_ID
|
||||
//#define CONFIG_IFCONFIG
|
||||
#define CONFIG_INIT
|
||||
//#define CONFIG_INSMOD
|
||||
#define CONFIG_KILL
|
||||
#define CONFIG_KILLALL
|
||||
#define CONFIG_KLOGD
|
||||
//#define CONFIG_LASH
|
||||
//#define CONFIG_LENGTH
|
||||
#define CONFIG_LN
|
||||
//#define CONFIG_LOADACM
|
||||
//#define CONFIG_LOADFONT
|
||||
#define CONFIG_LOADKMAP
|
||||
#define CONFIG_LOGGER
|
||||
//#define CONFIG_LOGNAME
|
||||
#define CONFIG_LS
|
||||
#define CONFIG_LSMOD
|
||||
//#define CONFIG_MAKEDEVS
|
||||
#define CONFIG_MD5SUM
|
||||
#define CONFIG_MKDIR
|
||||
//#define CONFIG_MKFIFO
|
||||
//#define CONFIG_MKFS_MINIX
|
||||
#define CONFIG_MKNOD
|
||||
#define CONFIG_MKSWAP
|
||||
//#define CONFIG_MKTEMP
|
||||
//#define CONFIG_MODPROBE
|
||||
#define CONFIG_MORE
|
||||
#define CONFIG_MOUNT
|
||||
//#define CONFIG_MSH
|
||||
//#define CONFIG_MT
|
||||
#define CONFIG_MV
|
||||
//#define CONFIG_NC
|
||||
//#define CONFIG_NSLOOKUP
|
||||
//#define CONFIG_PIDOF
|
||||
#define CONFIG_PING
|
||||
#define CONFIG_PIVOT_ROOT
|
||||
#define CONFIG_POWEROFF
|
||||
//#define CONFIG_PRINTF
|
||||
#define CONFIG_PS
|
||||
#define CONFIG_PWD
|
||||
//#define CONFIG_RDATE
|
||||
//#define CONFIG_READLINK
|
||||
#define CONFIG_REBOOT
|
||||
//#define CONFIG_RENICE
|
||||
#define CONFIG_RESET
|
||||
#define CONFIG_RM
|
||||
#define CONFIG_RMDIR
|
||||
//#define CONFIG_RMMOD
|
||||
//#define CONFIG_ROUTE
|
||||
//#define CONFIG_RPM2CPIO
|
||||
#define CONFIG_SED
|
||||
//#define CONFIG_SETKEYCODES
|
||||
#define CONFIG_SLEEP
|
||||
#define CONFIG_SORT
|
||||
//#define CONFIG_STTY
|
||||
#define CONFIG_SWAPONOFF
|
||||
#define CONFIG_SYNC
|
||||
#define CONFIG_SYSLOGD
|
||||
#define CONFIG_TAIL
|
||||
#define CONFIG_TAR
|
||||
//#define CONFIG_TEE
|
||||
//#define CONFIG_TEST
|
||||
#define CONFIG_TELNET
|
||||
//#define CONFIG_TFTP
|
||||
#define CONFIG_TOUCH
|
||||
#define CONFIG_TR
|
||||
//#define CONFIG_TRACEROUTE
|
||||
#define CONFIG_TRUE_FALSE
|
||||
#define CONFIG_TTY
|
||||
//#define CONFIG_UNIX2DOS
|
||||
//#define CONFIG_UUENCODE
|
||||
//#define CONFIG_UUDECODE
|
||||
#define CONFIG_UMOUNT
|
||||
#define CONFIG_UNIQ
|
||||
#define CONFIG_UNAME
|
||||
//#define CONFIG_UPDATE
|
||||
#define CONFIG_UPTIME
|
||||
//#define CONFIG_USLEEP
|
||||
#define CONFIG_VI
|
||||
//#define CONFIG_WATCHDOG
|
||||
#define CONFIG_WC
|
||||
#define CONFIG_WGET
|
||||
#define CONFIG_WHICH
|
||||
#define CONFIG_WHOAMI
|
||||
#define CONFIG_XARGS
|
||||
#define CONFIG_YES
|
||||
//#define BB_ADJTIMEX
|
||||
#define BB_AR
|
||||
//#define BB_ASH
|
||||
#define BB_BASENAME
|
||||
#define BB_CAT
|
||||
//#define BB_CHGRP
|
||||
#define BB_CHMOD
|
||||
#define BB_CHOWN
|
||||
#define BB_CHROOT
|
||||
#define BB_CHVT
|
||||
//#define BB_CLEAR
|
||||
//#define BB_CMP
|
||||
#define BB_CP
|
||||
//#define BB_CPIO
|
||||
#define BB_CUT
|
||||
//#define BB_DATE
|
||||
//#define BB_DC
|
||||
//#define BB_DD
|
||||
//#define BB_DEALLOCVT
|
||||
#define BB_DF
|
||||
#define BB_DIRNAME
|
||||
#define BB_DMESG
|
||||
//#define BB_DOS2UNIX
|
||||
//#define BB_DPKG
|
||||
//#define BB_DPKG_DEB
|
||||
//#define BB_DUTMP
|
||||
//#define BB_DU
|
||||
//#define BB_DUMPKMAP
|
||||
#define BB_ECHO
|
||||
#define BB_ENV
|
||||
#define BB_EXPR
|
||||
//#define BB_FBSET
|
||||
//#define BB_FDFLUSH
|
||||
#define BB_FIND
|
||||
#define BB_FREE
|
||||
#define BB_FREERAMDISK
|
||||
//#define BB_FSCK_MINIX
|
||||
//#define BB_GETOPT
|
||||
#define BB_GREP
|
||||
#define BB_GUNZIP
|
||||
//#define BB_GZIP
|
||||
//#define BB_HALT
|
||||
#define BB_HEAD
|
||||
//#define BB_HOSTID
|
||||
//#define BB_HOSTNAME
|
||||
//#define BB_HUSH
|
||||
#define BB_ID
|
||||
#define BB_IFCONFIG
|
||||
#define BB_INIT
|
||||
//#define BB_INSMOD
|
||||
#define BB_KILL
|
||||
//#define BB_KILLALL
|
||||
#define BB_KLOGD
|
||||
//#define BB_LASH
|
||||
//#define BB_LENGTH
|
||||
#define BB_LN
|
||||
//#define BB_LOADACM
|
||||
//#define BB_LOADFONT
|
||||
//#define BB_LOADKMAP
|
||||
//#define BB_LOGGER
|
||||
//#define BB_LOGNAME
|
||||
//#define BB_LOSETUP
|
||||
#define BB_LS
|
||||
#define BB_LSMOD
|
||||
//#define BB_MAKEDEVS
|
||||
#define BB_MD5SUM
|
||||
#define BB_MKDIR
|
||||
//#define BB_MKFIFO
|
||||
//#define BB_MKFS_MINIX
|
||||
#define BB_MKNOD
|
||||
//#define BB_MKSWAP
|
||||
//#define BB_MKTEMP
|
||||
//#define BB_MODPROBE
|
||||
//#define BB_MORE
|
||||
#define BB_MOUNT
|
||||
//#define BB_MSH
|
||||
//#define BB_MT
|
||||
#define BB_MV
|
||||
//#define BB_NC
|
||||
//#define BB_NSLOOKUP
|
||||
#define BB_PIDOF
|
||||
#define BB_PING
|
||||
#define BB_PIVOT_ROOT
|
||||
//#define BB_POWEROFF
|
||||
//#define BB_PRINTF
|
||||
#define BB_PS
|
||||
#define BB_PWD
|
||||
//#define BB_RDATE
|
||||
//#define BB_READLINK
|
||||
#define BB_REBOOT
|
||||
//#define BB_RENICE
|
||||
//#define BB_RESET
|
||||
#define BB_RM
|
||||
#define BB_RMDIR
|
||||
//#define BB_RMMOD
|
||||
#define BB_ROUTE
|
||||
//#define BB_RPM2CPIO
|
||||
#define BB_SED
|
||||
//#define BB_SETKEYCODES
|
||||
//#define BB_SLEEP
|
||||
#define BB_SORT
|
||||
//#define BB_STTY
|
||||
//#define BB_SWAPONOFF
|
||||
#define BB_SYNC
|
||||
#define BB_SYSLOGD
|
||||
#define BB_TAIL
|
||||
#define BB_TAR
|
||||
//#define BB_TEE
|
||||
//#define BB_TEST
|
||||
#define BB_TELNET
|
||||
//#define BB_TFTP
|
||||
//#define BB_TIME
|
||||
//#define BB_TOP
|
||||
#define BB_TOUCH
|
||||
#define BB_TR
|
||||
//#define BB_TRACEROUTE
|
||||
#define BB_TRUE_FALSE
|
||||
//#define BB_TTY
|
||||
//#define BB_UNIX2DOS
|
||||
//#define BB_UUENCODE
|
||||
//#define BB_UUDECODE
|
||||
#define BB_UMOUNT
|
||||
//#define BB_UNIQ
|
||||
#define BB_UNAME
|
||||
//#define BB_UPDATE
|
||||
//#define BB_UPTIME
|
||||
//#define BB_USLEEP
|
||||
//#define BB_VI
|
||||
//#define BB_WATCHDOG
|
||||
#define BB_WC
|
||||
#define BB_WGET
|
||||
//#define BB_WHICH
|
||||
//#define BB_WHOAMI
|
||||
//#define BB_XARGS
|
||||
//#define BB_YES
|
||||
// End of Applications List
|
||||
//
|
||||
//
|
||||
@@ -151,21 +154,21 @@
|
||||
//
|
||||
// If you enabled one or more of the shells, you may select which one
|
||||
// should be run when sh is invoked:
|
||||
//#define CONFIG_FEATURE_SH_IS_ASH
|
||||
//#define CONFIG_FEATURE_SH_IS_HUSH
|
||||
//#define CONFIG_FEATURE_SH_IS_LASH
|
||||
#define CONFIG_FEATURE_SH_IS_MSH
|
||||
//#define BB_FEATURE_SH_IS_ASH
|
||||
//#define BB_FEATURE_SH_IS_HUSH
|
||||
//#define BB_FEATURE_SH_IS_LASH
|
||||
#define BB_FEATURE_SH_IS_MSH
|
||||
//
|
||||
// BusyBox will, by default, malloc space for its buffers. This costs code
|
||||
// size for the call to xmalloc. You can use the following feature to have
|
||||
// them put on the stack. For some very small machines with limited stack
|
||||
// space, this can be deadly. For most folks, this works just fine...
|
||||
//#define CONFIG_FEATURE_BUFFERS_GO_ON_STACK
|
||||
//#define BB_FEATURE_BUFFERS_GO_ON_STACK
|
||||
// The third alternative for buffer allocation is to use BSS. This works
|
||||
// beautifully for computers with a real MMU (and OS support), but wastes
|
||||
// runtime RAM for uCLinux. This behavior was the only one available for
|
||||
// BusyBox versions 0.48 and earlier.
|
||||
//#define CONFIG_FEATURE_BUFFERS_GO_IN_BSS
|
||||
//#define BB_FEATURE_BUFFERS_GO_IN_BSS
|
||||
//
|
||||
// Turn this on to use Erik's very cool devps, and devmtab kernel drivers,
|
||||
// thereby eliminating the need for the /proc filesystem and thereby saving
|
||||
@@ -176,212 +179,235 @@
|
||||
// mknod /dev/mtab c 10 22
|
||||
// mknod /dev/ps c 10 21
|
||||
// I emailed Linus and this patch will not be going into the stock kernel.
|
||||
//#define CONFIG_FEATURE_USE_DEVPS_PATCH
|
||||
//#define BB_FEATURE_USE_DEVPS_PATCH
|
||||
//
|
||||
// show verbose usage messages
|
||||
//#define CONFIG_FEATURE_VERBOSE_USAGE
|
||||
//#define BB_FEATURE_VERBOSE_USAGE
|
||||
//
|
||||
// Use termios to manipulate the screen ('more' is prettier with this on)
|
||||
#define CONFIG_FEATURE_USE_TERMIOS
|
||||
#define BB_FEATURE_USE_TERMIOS
|
||||
//
|
||||
// calculate terminal & column widths (for more and ls)
|
||||
#define CONFIG_FEATURE_AUTOWIDTH
|
||||
// calculate terminal & column widths (for more, ls, and telnet)
|
||||
#define BB_FEATURE_AUTOWIDTH
|
||||
//
|
||||
// show username/groupnames for ls
|
||||
#define CONFIG_FEATURE_LS_USERNAME
|
||||
#define BB_FEATURE_LS_USERNAME
|
||||
//
|
||||
// show file timestamps in ls
|
||||
#define CONFIG_FEATURE_LS_TIMESTAMPS
|
||||
#define BB_FEATURE_LS_TIMESTAMPS
|
||||
//
|
||||
// enable ls -p and -F
|
||||
#define CONFIG_FEATURE_LS_FILETYPES
|
||||
//#define BB_FEATURE_LS_FILETYPES
|
||||
//
|
||||
// sort the file names
|
||||
#define CONFIG_FEATURE_LS_SORTFILES
|
||||
#define BB_FEATURE_LS_SORTFILES
|
||||
//
|
||||
// enable ls -R
|
||||
#define CONFIG_FEATURE_LS_RECURSIVE
|
||||
//#define BB_FEATURE_LS_RECURSIVE
|
||||
//
|
||||
// enable ls -L
|
||||
#define CONFIG_FEATURE_LS_FOLLOWLINKS
|
||||
#define BB_FEATURE_LS_FOLLOWLINKS
|
||||
//
|
||||
// Use color to identify different file types
|
||||
#define BB_FEATURE_LS_COLOR
|
||||
//
|
||||
// Disable for a smaller (but less functional) ping
|
||||
#define CONFIG_FEATURE_FANCY_PING
|
||||
#define BB_FEATURE_FANCY_PING
|
||||
//
|
||||
// Make init use a simplified /etc/inittab file (recommended).
|
||||
#define CONFIG_FEATURE_USE_INITTAB
|
||||
#define BB_FEATURE_USE_INITTAB
|
||||
//
|
||||
//Enable init being called as /linuxrc
|
||||
#define CONFIG_FEATURE_INITRD
|
||||
#define BB_FEATURE_LINUXRC
|
||||
//
|
||||
//Have init enable core dumping for child processes (for debugging only)
|
||||
//#define CONFIG_FEATURE_INIT_COREDUMPS
|
||||
//#define BB_FEATURE_INIT_COREDUMPS
|
||||
//
|
||||
//Make sure nothing is printed to the console on boot
|
||||
//#define CONFIG_FEATURE_EXTRA_QUIET
|
||||
//#define BB_FEATURE_EXTRA_QUIET
|
||||
//
|
||||
// enable syslogd -R remotehost
|
||||
#define CONFIG_FEATURE_REMOTE_LOG
|
||||
//#define BB_FEATURE_REMOTE_LOG
|
||||
//
|
||||
// enable syslogd -C
|
||||
//#define CONFIG_FEATURE_IPC_SYSLOG
|
||||
//#define BB_FEATURE_IPC_SYSLOG
|
||||
//
|
||||
//Disable for a simple tail implementation (2.34k vs 3k for the full one).
|
||||
//Both provide 'tail -f', but this cuts out -c, -q, -s, and -v.
|
||||
#define CONFIG_FEATURE_FANCY_TAIL
|
||||
//#define BB_FEATURE_FANCY_TAIL
|
||||
//
|
||||
// Enable support for loop devices in mount
|
||||
#define CONFIG_FEATURE_MOUNT_LOOP
|
||||
#define BB_FEATURE_MOUNT_LOOP
|
||||
//
|
||||
// Enable support for a real /etc/mtab file instead of /proc/mounts
|
||||
//#define CONFIG_FEATURE_MTAB_SUPPORT
|
||||
//#define BB_FEATURE_MTAB_SUPPORT
|
||||
//
|
||||
// Enable support for mounting remote NFS volumes.
|
||||
// You may need to mount with "-o nolock" if you are
|
||||
// not running a local portmapper daemon...
|
||||
#define CONFIG_FEATURE_NFSMOUNT
|
||||
//
|
||||
// If you are using uClibc, be sure that you've already compiled
|
||||
// uClibc with INCLUDE_RPC=true (contained in the Config file)
|
||||
#define BB_FEATURE_NFSMOUNT
|
||||
//
|
||||
// Enable support forced filesystem unmounting
|
||||
// (i.e., in case of an unreachable NFS system).
|
||||
#define CONFIG_FEATURE_MOUNT_FORCE
|
||||
#define BB_FEATURE_MOUNT_FORCE
|
||||
//
|
||||
// Enable support for creation of tar files.
|
||||
#define CONFIG_FEATURE_TAR_CREATE
|
||||
//#define BB_FEATURE_TAR_CREATE
|
||||
//
|
||||
// Enable support for "--exclude" and "-X" for excluding files
|
||||
#define CONFIG_FEATURE_TAR_EXCLUDE
|
||||
//#define BB_FEATURE_TAR_EXCLUDE
|
||||
//
|
||||
// Enable support for tar -z option (currently only works for inflating)
|
||||
#define CONFIG_FEATURE_TAR_GZIP
|
||||
#define BB_FEATURE_TAR_GZIP
|
||||
//
|
||||
// Enable reverse sort
|
||||
#define CONFIG_FEATURE_SORT_REVERSE
|
||||
//#define BB_FEATURE_SORT_REVERSE
|
||||
//
|
||||
// Enable uniqe sort
|
||||
#define CONFIG_FEATURE_SORT_UNIQUE
|
||||
//#define BB_FEATURE_SORT_UNIQUE
|
||||
//
|
||||
// Enable command line editing in the shell.
|
||||
// Only relevant if a shell is enabled. On by default.
|
||||
#define CONFIG_FEATURE_COMMAND_EDITING
|
||||
#define BB_FEATURE_COMMAND_EDITING
|
||||
//
|
||||
// Enable tab completion in the shell. This is now working quite nicely.
|
||||
// This feature adds a bit over 4k. Only relevant if a shell is enabled.
|
||||
#define CONFIG_FEATURE_COMMAND_TAB_COMPLETION
|
||||
#define BB_FEATURE_COMMAND_TAB_COMPLETION
|
||||
//
|
||||
// Attempts to match usernames in a ~-prefixed path
|
||||
//#define CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION
|
||||
//#define BB_FEATURE_COMMAND_USERNAME_COMPLETION
|
||||
//
|
||||
//Allow the shell to invoke all the compiled in BusyBox applets as if they
|
||||
//were shell builtins. Nice for staticly linking an emergency rescue shell,
|
||||
//among other things. Off by default.
|
||||
// Only relevant if a shell is enabled.
|
||||
//#define CONFIG_FEATURE_SH_STANDALONE_SHELL
|
||||
//#define BB_FEATURE_SH_STANDALONE_SHELL
|
||||
//
|
||||
//When this is enabled, busybox shell applets can be called using full path
|
||||
//names. This causes applets (i.e., most busybox commands) to override
|
||||
//real commands on the filesystem. For example, if you run run /bin/cat, it
|
||||
//will use BusyBox cat even if /bin/cat exists on the filesystem and is _not_
|
||||
//busybox. Some systems want this, others do not. Choose wisely. :-) This
|
||||
//only has meaning when CONFIG_FEATURE_SH_STANDALONE_SHELL is enabled.
|
||||
//only has meaning when BB_FEATURE_SH_STANDALONE_SHELL is enabled.
|
||||
// Only relevant if a shell is enabled. Off by default.
|
||||
//#define CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN
|
||||
//#define BB_FEATURE_SH_APPLETS_ALWAYS_WIN
|
||||
//
|
||||
// Uncomment this option for a fancy shell prompt that includes the
|
||||
// current username and hostname. On systems that don't have usernames
|
||||
// or hostnames, this can look hideous.
|
||||
// Only relevant if a shell is enabled.
|
||||
//#define CONFIG_FEATURE_SH_FANCY_PROMPT
|
||||
//#define BB_FEATURE_SH_FANCY_PROMPT
|
||||
//
|
||||
// Uncomment this option to disable job control. Job control lets you
|
||||
// run jobs in the background (which completely useless for is all you
|
||||
// are doing is running scripts). Disabing this is bad for interactive
|
||||
// use, since when you hit ^C in an application, it will also kill the
|
||||
// shell. This adds about 2.5k on an x86 system.
|
||||
#define BB_FEATURE_ASH_JOB_CONTROL
|
||||
//
|
||||
//Turn on extra fbset options
|
||||
//#define CONFIG_FEATURE_FBSET_FANCY
|
||||
//#define BB_FEATURE_FBSET_FANCY
|
||||
//
|
||||
//Turn on fbset readmode support
|
||||
//#define CONFIG_FEATURE_FBSET_READMODE
|
||||
//#define BB_FEATURE_FBSET_READMODE
|
||||
//
|
||||
// Support insmod/lsmod/rmmod for post 2.1 kernels
|
||||
//#define CONFIG_FEATURE_NEW_MODULE_INTERFACE
|
||||
//#define BB_FEATURE_NEW_MODULE_INTERFACE
|
||||
//
|
||||
// Support insmod/lsmod/rmmod for pre 2.1 kernels
|
||||
//#define CONFIG_FEATURE_OLD_MODULE_INTERFACE
|
||||
//#define BB_FEATURE_OLD_MODULE_INTERFACE
|
||||
//
|
||||
// Support module version checking
|
||||
//#define CONFIG_FEATURE_INSMOD_VERSION_CHECKING
|
||||
//#define BB_FEATURE_INSMOD_VERSION_CHECKING
|
||||
//
|
||||
// Support for uClinux memory usage optimization, which will load the image
|
||||
// directly into the kernel memory. This divides memory requrements by three.
|
||||
// If you are not running uClinux (i.e., your CPU has an MMU) leave this
|
||||
// disabled...
|
||||
//#define CONFIG_FEATURE_INSMOD_LOADINKMEM
|
||||
//#define BB_FEATURE_INSMOD_LOADINKMEM
|
||||
//
|
||||
// Support for Minix filesystem, version 2
|
||||
//#define CONFIG_FEATURE_MINIX2
|
||||
//#define BB_FEATURE_MINIX2
|
||||
//
|
||||
// Enable ifconfig status reporting output -- this feature adds 12k.
|
||||
#define CONFIG_FEATURE_IFCONFIG_STATUS
|
||||
// Enable ifconfig status reporting output -- this feature adds 7k.
|
||||
#define BB_FEATURE_IFCONFIG_STATUS
|
||||
//
|
||||
// Enable ifconfig slip-specific options "keepalive" and "outfill"
|
||||
//#define CONFIG_FEATURE_IFCONFIG_SLIP
|
||||
//#define BB_FEATURE_IFCONFIG_SLIP
|
||||
//
|
||||
// Enable ifconfig options "mem_start", "io_addr", and "irq".
|
||||
//#define CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ
|
||||
#define BB_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ
|
||||
//
|
||||
// Enable ifconfig option "hw". Currently works for only with "ether".
|
||||
#define CONFIG_FEATURE_IFCONFIG_HW
|
||||
#define BB_FEATURE_IFCONFIG_HW
|
||||
//
|
||||
// Allows "broadcast +" to set broadcast automatically based on hostaddr
|
||||
// and netmask, at a cost of about 100 bytes of code (i386).
|
||||
//#define BB_FEATURE_IFCONFIG_BROADCAST_PLUS
|
||||
//
|
||||
// Enable busybox --install [-s]
|
||||
// to create links (or symlinks) for all the commands that are
|
||||
// compiled into the binary. (needs /proc filesystem)
|
||||
#define CONFIG_FEATURE_INSTALLER
|
||||
//#define BB_FEATURE_INSTALLER
|
||||
//
|
||||
// Enable a nifty progress meter in wget (adds just under 2k)
|
||||
#define CONFIG_FEATURE_WGET_STATUSBAR
|
||||
#define BB_FEATURE_WGET_STATUSBAR
|
||||
//
|
||||
// Enable HTTP authentication in wget
|
||||
#define CONFIG_FEATURE_WGET_AUTHENTICATION
|
||||
//#define BB_FEATURE_WGET_AUTHENTICATION
|
||||
//
|
||||
// Clean up all memory before exiting -- usually not needed
|
||||
// as the OS can clean up... Don't enable this unless you
|
||||
// have a really good reason for cleaning things up manually.
|
||||
//#define CONFIG_FEATURE_CLEAN_UP
|
||||
//#define BB_FEATURE_CLEAN_UP
|
||||
//
|
||||
// Support for human readable output by ls, du, etc.(example 13k, 23M, 235G)
|
||||
#define CONFIG_FEATURE_HUMAN_READABLE
|
||||
#define BB_FEATURE_HUMAN_READABLE
|
||||
//
|
||||
// Support for the find -type option.
|
||||
#define CONFIG_FEATURE_FIND_TYPE
|
||||
#define BB_FEATURE_FIND_TYPE
|
||||
//
|
||||
// Support for the find -perm option.
|
||||
#define CONFIG_FEATURE_FIND_PERM
|
||||
#define BB_FEATURE_FIND_PERM
|
||||
//
|
||||
// Support for the find -mtine option.
|
||||
#define CONFIG_FEATURE_FIND_MTIME
|
||||
// Support for the find -mtime option.
|
||||
#define BB_FEATURE_FIND_MTIME
|
||||
//
|
||||
//// Support for the find -newer option.
|
||||
#define BB_FEATURE_FIND_NEWER
|
||||
//
|
||||
// Support for the -A -B and -C context flags in grep
|
||||
//#define CONFIG_FEATURE_GREP_CONTEXT
|
||||
//#define BB_FEATURE_GREP_CONTEXT
|
||||
//
|
||||
// Support for the EGREP applet (alias to the grep applet)
|
||||
//#define CONFIG_FEATURE_GREP_EGREP_ALIAS
|
||||
//#define BB_FEATURE_GREP_EGREP_ALIAS
|
||||
//
|
||||
// Tell tftp what commands that should be supported.
|
||||
#define CONFIG_FEATURE_TFTP_PUT
|
||||
#define CONFIG_FEATURE_TFTP_GET
|
||||
#define BB_FEATURE_TFTP_PUT
|
||||
#define BB_FEATURE_TFTP_GET
|
||||
//
|
||||
// features for vi
|
||||
#define CONFIG_FEATURE_VI_COLON // ":" colon commands, no "ex" mode
|
||||
#define CONFIG_FEATURE_VI_YANKMARK // Yank/Put commands and Mark cmds
|
||||
#define CONFIG_FEATURE_VI_SEARCH // search and replace cmds
|
||||
#define CONFIG_FEATURE_VI_USE_SIGNALS // catch signals
|
||||
#define CONFIG_FEATURE_VI_DOT_CMD // remember previous cmd and "." cmd
|
||||
#define CONFIG_FEATURE_VI_READONLY // vi -R and "view" mode
|
||||
#define CONFIG_FEATURE_VI_SETOPTS // set-able options, ai ic showmatch
|
||||
#define CONFIG_FEATURE_VI_SET // :set
|
||||
#define CONFIG_FEATURE_VI_WIN_RESIZE // handle window resize
|
||||
#define BB_FEATURE_VI_COLON // ":" colon commands, no "ex" mode
|
||||
#define BB_FEATURE_VI_YANKMARK // Yank/Put commands and Mark cmds
|
||||
#define BB_FEATURE_VI_SEARCH // search and replace cmds
|
||||
#define BB_FEATURE_VI_USE_SIGNALS // catch signals
|
||||
#define BB_FEATURE_VI_DOT_CMD // remember previous cmd and "." cmd
|
||||
#define BB_FEATURE_VI_READONLY // vi -R and "view" mode
|
||||
#define BB_FEATURE_VI_SETOPTS // set-able options, ai ic showmatch
|
||||
#define BB_FEATURE_VI_SET // :set
|
||||
#define BB_FEATURE_VI_WIN_RESIZE // handle window resize
|
||||
//
|
||||
// Enable a if you system have setuped locale
|
||||
//#define CONFIG_LOCALE_SUPPORT
|
||||
//#define BB_LOCALE_SUPPORT
|
||||
//
|
||||
// Support for TELNET to pass TERM type to remote host. Adds 384 bytes.
|
||||
#define CONFIG_FEATURE_TELNET_TTYPE
|
||||
#define BB_FEATURE_TELNET_TTYPE
|
||||
//
|
||||
// Support for devfs.
|
||||
//#define BB_FEATURE_DEVFS
|
||||
//
|
||||
// End of Features List
|
||||
//
|
||||
@@ -395,75 +421,73 @@
|
||||
// mere mortals so leave this stuff alone.
|
||||
//
|
||||
#include <features.h>
|
||||
#if defined __UCLIBC__ && ! defined __UCLIBC_HAS_MMU__
|
||||
#undef CONFIG_RPM2CPIO /* Uses gz_open(), which uses fork() */
|
||||
#undef CONFIG_DPKG_DEB /* Uses gz_open(), which uses fork() */
|
||||
#undef CONFIG_ASH /* Uses fork() */
|
||||
#undef CONFIG_HUSH /* Uses fork() */
|
||||
#undef CONFIG_LASH /* Uses fork() */
|
||||
#undef CONFIG_INIT /* Uses fork() */
|
||||
#undef CONFIG_FEATURE_TAR_GZIP /* Uses fork() */
|
||||
#undef CONFIG_SYSLOGD /* Uses daemon() */
|
||||
#undef CONFIG_KLOGD /* Uses daemon() */
|
||||
#undef CONFIG_UPDATE /* Uses daemon() */
|
||||
#if defined(__uClinux__)
|
||||
#undef BB_RPM2CPIO /* Uses gz_open(), which uses fork() */
|
||||
#undef BB_DPKG_DEB /* Uses gz_open(), which uses fork() */
|
||||
#undef BB_FEATURE_TAR_GZIP /* Uses fork() */
|
||||
#undef BB_UPDATE /* Uses daemon() */
|
||||
#endif
|
||||
#if defined CONFIG_ASH || defined CONFIG_HUSH || defined CONFIG_LASH || defined CONFIG_MSH
|
||||
#if defined CONFIG_FEATURE_COMMAND_EDITING
|
||||
#define CONFIG_CMDEDIT
|
||||
#if defined BB_ASH || defined BB_HUSH || defined BB_LASH || defined BB_MSH
|
||||
#if defined BB_FEATURE_COMMAND_EDITING
|
||||
#define BB_CMDEDIT
|
||||
#else
|
||||
#undef CONFIG_FEATURE_COMMAND_EDITING
|
||||
#undef CONFIG_FEATURE_COMMAND_TAB_COMPLETION
|
||||
#undef CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION
|
||||
#undef CONFIG_FEATURE_SH_FANCY_PROMPT
|
||||
#undef BB_FEATURE_COMMAND_EDITING
|
||||
#undef BB_FEATURE_COMMAND_TAB_COMPLETION
|
||||
#undef BB_FEATURE_COMMAND_USERNAME_COMPLETION
|
||||
#undef BB_FEATURE_SH_FANCY_PROMPT
|
||||
#endif
|
||||
#else
|
||||
#undef CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN
|
||||
#undef CONFIG_FEATURE_SH_STANDALONE_SHELL
|
||||
#undef CONFIG_FEATURE_SH_FANCY_PROMPT
|
||||
#undef BB_FEATURE_SH_APPLETS_ALWAYS_WIN
|
||||
#undef BB_FEATURE_SH_STANDALONE_SHELL
|
||||
#undef BB_FEATURE_SH_FANCY_PROMPT
|
||||
#endif
|
||||
//
|
||||
#ifdef CONFIG_KILLALL
|
||||
#ifndef CONFIG_KILL
|
||||
#define CONFIG_KILL
|
||||
#if (defined BB_ASH || defined BB_HUSH || defined BB_MSH) && ! defined BB_TEST
|
||||
#define BB_TEST
|
||||
#endif
|
||||
//
|
||||
#ifdef BB_KILLALL
|
||||
#ifndef BB_KILL
|
||||
#define BB_KILL
|
||||
#endif
|
||||
#endif
|
||||
//
|
||||
#ifndef CONFIG_INIT
|
||||
#undef CONFIG_FEATURE_INITRD
|
||||
#ifndef BB_INIT
|
||||
#undef BB_FEATURE_LINUXRC
|
||||
#endif
|
||||
//
|
||||
#if defined CONFIG_MOUNT && defined CONFIG_FEATURE_NFSMOUNT
|
||||
#define CONFIG_NFSMOUNT
|
||||
#if defined BB_MOUNT && defined BB_FEATURE_NFSMOUNT
|
||||
#define BB_NFSMOUNT
|
||||
#endif
|
||||
//
|
||||
#if defined CONFIG_FEATURE_AUTOWIDTH
|
||||
#ifndef CONFIG_FEATURE_USE_TERMIOS
|
||||
#define CONFIG_FEATURE_USE_TERMIOS
|
||||
#if defined BB_FEATURE_AUTOWIDTH
|
||||
#ifndef BB_FEATURE_USE_TERMIOS
|
||||
#define BB_FEATURE_USE_TERMIOS
|
||||
#endif
|
||||
#endif
|
||||
//
|
||||
#if defined CONFIG_INSMOD || defined CONFIG_LSMOD
|
||||
#if ! defined CONFIG_FEATURE_NEW_MODULE_INTERFACE && ! defined CONFIG_FEATURE_OLD_MODULE_INTERFACE
|
||||
#define CONFIG_FEATURE_NEW_MODULE_INTERFACE
|
||||
#if defined BB_INSMOD || defined BB_LSMOD
|
||||
#if ! defined BB_FEATURE_NEW_MODULE_INTERFACE && ! defined BB_FEATURE_OLD_MODULE_INTERFACE
|
||||
#define BB_FEATURE_NEW_MODULE_INTERFACE
|
||||
#endif
|
||||
#endif
|
||||
//
|
||||
#ifdef CONFIG_UNIX2DOS
|
||||
#define CONFIG_DOS2UNIX
|
||||
#ifdef BB_UNIX2DOS
|
||||
#define BB_DOS2UNIX
|
||||
#endif
|
||||
//
|
||||
#ifdef CONFIG_SYSLOGD
|
||||
#if defined CONFIG_FEATURE_IPC_SYSLOG
|
||||
#define CONFIG_LOGREAD
|
||||
#ifdef BB_SYSLOGD
|
||||
#if defined BB_FEATURE_IPC_SYSLOG
|
||||
#define BB_LOGREAD
|
||||
#endif
|
||||
#endif
|
||||
//
|
||||
#if defined CONFIG_ASH && defined CONFIG_FEATURE_SH_IS_ASH
|
||||
#if defined BB_ASH && defined BB_FEATURE_SH_IS_ASH
|
||||
# define shell_main ash_main
|
||||
#elif defined CONFIG_HUSH && defined CONFIG_FEATURE_SH_IS_HUSH
|
||||
#elif defined BB_HUSH && defined BB_FEATURE_SH_IS_HUSH
|
||||
# define shell_main hush_main
|
||||
#elif defined CONFIG_LASH && defined CONFIG_FEATURE_SH_IS_LASH
|
||||
#elif defined BB_LASH && defined BB_FEATURE_SH_IS_LASH
|
||||
# define shell_main lash_main
|
||||
#elif defined CONFIG_MSH && defined CONFIG_FEATURE_SH_IS_MSH
|
||||
#elif defined BB_MSH && defined BB_FEATURE_SH_IS_MSH
|
||||
# define shell_main msh_main
|
||||
#endif
|
||||
@@ -5,6 +5,6 @@ BusyBox is being developed and maintained by Erik Andersen
|
||||
<andersee@debian.org>.
|
||||
|
||||
If you have a problem with BusyBox, send email to the Debian bug tracking
|
||||
system that lives at <submit@bugs.lineo.com>
|
||||
system that lives at <submit@bugs.busybox.net>
|
||||
|
||||
Erik Andersen <andersee@debian.org>, Sun, 18 Jun 2000 21:52:00 -0600
|
||||
@@ -1,6 +1,149 @@
|
||||
busybox (1:0.60.5-2) unstable; urgency=low
|
||||
|
||||
* It turns out that for the .udeb, we don't want to disable
|
||||
BB_FEATURE_LINUXRC, we just want to kill the /linuxrc link.
|
||||
Thanks to Matt Kraai for tracking this one down. (closes: #161611)
|
||||
|
||||
-- Erik Andersen <andersee@debian.org> Thu, 31 Oct 2002 02:25:01 -0700
|
||||
|
||||
busybox (1:0.60.5-1) unstable; urgency=low
|
||||
|
||||
* New version released. See Changelog for non-Debian specific details.
|
||||
* zcat no longer tries to delete source files (closes: #164968)
|
||||
* Eliminate /linuxrc from the .udeb (closes: #163890)
|
||||
* Fix description of the --install option (closes: #164178)
|
||||
|
||||
-- Erik Andersen <andersee@debian.org> Sat, 26 Oct 2002 06:23:51 -0600
|
||||
|
||||
busybox (1:0.60.4-1.1) unstable; urgency=low
|
||||
|
||||
* NMU
|
||||
* Fix cp -a so it handles symlinks properly (closes: #163501)
|
||||
|
||||
-- Tollef Fog Heen <tfheen@debian.org> Sun, 6 Oct 2002 16:08:45 +0200
|
||||
|
||||
busybox (1:0.60.4-1) unstable; urgency=low
|
||||
|
||||
* New version released. See Changelog for non-Debian specific details.
|
||||
* enable uname for the debian-installer (closes: #158706)
|
||||
* enable losetup for the boot floppies (closes: #138060)
|
||||
* init behaves itself better consoles go missing (closes: #129626)
|
||||
* In 'free', buffers change as buffered data increases (closes: #148396)
|
||||
* Functions for debootstrap added to the .udeb (closes: #124388)
|
||||
* This bug is not reproducable (closes: #127522)
|
||||
|
||||
-- Erik Andersen <andersee@debian.org> Wed, 18 Sep 2002 14:13:05 -0600
|
||||
|
||||
busybox (1:0.60.3-1) unstable; urgency=low
|
||||
|
||||
* New version released. See Changelog for non-Debian specific details.
|
||||
* makedevs no longer segfaults (closes: #123921)
|
||||
* wget no longer crashes (closes: #138943)
|
||||
* wget now checks the safe_fwrite return code (closes: #143179)
|
||||
|
||||
-- Erik Andersen <andersee@debian.org> Sat, 27 Apr 2002 01:33:34 -0600
|
||||
|
||||
busybox (1:0.60.2-3) testing unstable; urgency=low
|
||||
|
||||
* Fix wc stdin handling (closes: #123387).
|
||||
* Fix wget to do just one DNS lookup (closes: #124068)
|
||||
|
||||
-- Erik Andersen <andersee@debian.org> Sun, 16 Dec 2001 22:51:03 -0700
|
||||
|
||||
busybox (1:0.60.2-2) unstable; urgency=low
|
||||
|
||||
* Several small bugfixes (closes: #120353, #120369, #122638,
|
||||
* Reworked wc.c to fix the severe efficiency problems and make it
|
||||
smaller. This one is mainly for the boot-floppies (closes: #120441)
|
||||
* Enable hostname (closes: #120511)
|
||||
|
||||
-- Erik Andersen <andersee@debian.org> Thu, 6 Dec 2001 00:06:33 -0700
|
||||
|
||||
busybox (1:0.60.2-1) unstable; urgency=low
|
||||
|
||||
* New version released. See Changelog for non-Debian specific details.
|
||||
* dpkg.c now uses an int for getopt (closes: #118975)
|
||||
* s390 console reboot msg is now appropriate (closes: #118859)
|
||||
* the manpage is no longer empty (closes: #117013)
|
||||
* no more .o files in the source tarball (closes: #112046)
|
||||
* the .udeb contents are exactly as Joey wants them (closes: #105352)
|
||||
* busybox ash is the default shell for the -static package,
|
||||
so it can cope with /etc/profile just fine (closes: #95745)
|
||||
|
||||
-- Erik Andersen <andersee@debian.org> Tue, 20 Nov 2001 03:41:29 -0700
|
||||
|
||||
busybox (1:0.60.1-8) unstable; urgency=low
|
||||
|
||||
* Adjusted some apps for the debian installer's .udeb package.
|
||||
Enabled ifconfig, route.
|
||||
Disabled chgrp, clear, date, dd, du, gzip, halt, head, killall,
|
||||
loadkmap, logger, mkswap, more, poweroff, reset, sleep, sort,
|
||||
swapon, swapoff, touch, tty, uniq, uname, uptime, vi, wc, which,
|
||||
whoami, xargs, and yes.
|
||||
|
||||
-- Erik Andersen <andersee@debian.org> Thu, 18 Oct 2001 22:59:06 -0600
|
||||
|
||||
busybox (1:0.60.1-7) unstable; urgency=low
|
||||
|
||||
* Re-enable wget's status bar for today's dbootstrap change. (closes: #115717)
|
||||
* Enable initrd support (even if they are a bad idea). (closes: #114727)
|
||||
|
||||
-- Erik Andersen <andersee@debian.org> Mon, 15 Oct 2001 20:45:57 -0600
|
||||
|
||||
busybox (1:0.60.1-6) unstable; urgency=low
|
||||
|
||||
* Re-enable wc, gzip, tty, and expr. (closes: #114906)
|
||||
|
||||
-- Erik Andersen <andersee@debian.org> Wed, 10 Oct 2001 02:47:50 -0600
|
||||
|
||||
busybox (1:0.60.1-5) unstable; urgency=low
|
||||
|
||||
* Time to make this official. This enables several applets, such
|
||||
as ifconfig and route, and disables several others.
|
||||
* Revert ash to the version in the busybox stable branch. For the
|
||||
-3 non-release, I tried the one from busybox unstable (which lived
|
||||
up to its name). (closes: #112503)
|
||||
* Enable id, disable ash (closes: #114260, #113698)
|
||||
* Backport several bugfixes from unstable
|
||||
|
||||
-- Erik Andersen <andersee@debian.org> Fri, 5 Oct 2001 23:03:15 -0600
|
||||
|
||||
busybox (1:0.60.1-4) unstable; urgency=low
|
||||
|
||||
* Doh! With busybox ash, we need test and echo enabled...
|
||||
|
||||
-- Erik Andersen <andersee@debian.org> Wed, 26 Sep 2001 00:05:04 -0600
|
||||
|
||||
busybox (1:0.60.1-3) unstable; urgency=low
|
||||
|
||||
* This upload is to test whether disabling several applets, and
|
||||
enabling several others will help. Enabled is ifconfig, route,
|
||||
and ash. Disabled is basename, date, echo, env, expr, gzip,
|
||||
lsmod, and wc.
|
||||
|
||||
-- Erik Andersen <andersee@debian.org> Tue, 25 Sep 2001 17:45:16 -0600
|
||||
|
||||
busybox (1:0.60.1-2) unstable; urgency=low
|
||||
|
||||
* Disabled several applets to make busybox be a bit thinner, since the
|
||||
powerpc boot floppies are _very_ tight on space (closes: #112503)
|
||||
* Teach 'mount' about usbdevfs (closes: #111055)
|
||||
* Busybox supports full online help, but due to space constraints on
|
||||
the boot floppies, it will not be enabled. People can read the
|
||||
busybox documentation if they need full details. (closes: #111350)
|
||||
|
||||
-- Erik Andersen <andersee@debian.org> Sun, 23 Sep 2001 23:32:15 -0600
|
||||
|
||||
busybox (1:0.60.1-1) unstable; urgency=low
|
||||
|
||||
* New stable version released. See changelog for details.
|
||||
* Enabled 'ar' for the udeb
|
||||
|
||||
-- Erik Andersen <andersee@debian.org> Thu, 23 Aug 2001 15:44:14 -0600
|
||||
|
||||
busybox (1:0.60.0-1) unstable; urgency=low
|
||||
|
||||
* New version released. See changelog for details.
|
||||
* New stable version released. See changelog for details.
|
||||
|
||||
-- Erik Andersen <andersee@debian.org> Thu, 2 Aug 2001 12:12:37 -0600
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ Description: Tiny utilities for small and embedded systems.
|
||||
.
|
||||
This package installs the BusyBox binary but does not install symlinks
|
||||
for any of the supported utilities. You can use /bin/busybox --install
|
||||
to install BusyBox to the current directory (you do not want to do this
|
||||
in / on your Debian system!).
|
||||
to install BusyBox to the root directory (you do not want to do this
|
||||
to your your Debian system, except in dire emergencies!).
|
||||
|
||||
Package: busybox-static
|
||||
Architecture: any
|
||||
@@ -30,6 +30,7 @@ Depends: ${shlibs:Depends}
|
||||
Conflicts: busybox
|
||||
Replaces: busybox
|
||||
Section: shells
|
||||
Priority: extra
|
||||
Description: Standalone rescue shell with tons of builtin utilities.
|
||||
BusyBox combines tiny versions of many common UNIX utilities into a single
|
||||
small executable. It provides minimalist replacements for the most common
|
||||
|
||||
@@ -28,8 +28,8 @@ debian/build-stamp-busybox:
|
||||
mkdir -p $(bbbd)
|
||||
cp Makefile $(bbbd)
|
||||
cp debian/Config.h-deb $(bbbd)/Config.h
|
||||
-(cd $(bbbd); $(MAKE) "CONFIG_SRC_DIR=../../" applet_source_list)
|
||||
(cd $(bbbd); $(MAKE) USE_SYSTEM_PWD_GRP=false "CONFIG_SRC_DIR=../../")
|
||||
-(cd $(bbbd); $(MAKE) "BB_SRC_DIR=../../" applet_source_list)
|
||||
(cd $(bbbd); $(MAKE) USE_SYSTEM_PWD_GRP=false "BB_SRC_DIR=../../")
|
||||
touch debian/build-stamp-busybox
|
||||
|
||||
install: build
|
||||
@@ -39,11 +39,11 @@ install: build
|
||||
dh_installdirs
|
||||
# Do not run 'make install', since we do not want all the symlinks.
|
||||
# This just installes the busybox binary...
|
||||
#(cd $(bbbd); $(MAKE) "CONFIG_SRC_DIR=../../" "PREFIX=../../$(bb)" install)
|
||||
#(cd $(bbbd); $(MAKE) "BB_SRC_DIR=../../" "PREFIX=../../$(bb)" install)
|
||||
mkdir -p $(bb)/bin/
|
||||
cp $(bbbd)/busybox $(bb)/bin/busybox
|
||||
mkdir -p $(bb)/usr/share/doc/busybox/busybox.lineo.com
|
||||
cp $(bbbd)/docs/busybox.lineo.com/BusyBox.html $(bb)/usr/share/doc/busybox/busybox.lineo.com/
|
||||
mkdir -p $(bb)/usr/share/doc/busybox
|
||||
cp $(bbbd)/docs/BusyBox.html $(bb)/usr/share/doc/busybox/
|
||||
mkdir -p $(bb)/usr/share/man/man1
|
||||
cp $(bbbd)/docs/BusyBox.1 $(bb)/usr/share/man/man1/busybox.1
|
||||
|
||||
@@ -54,7 +54,7 @@ debian/build-stamp-busybox-static:
|
||||
mkdir -p $(bbsbd)
|
||||
cp Makefile $(bbsbd)
|
||||
cp debian/Config.h-static $(bbsbd)/Config.h
|
||||
(cd $(bbsbd); $(MAKE) DOSTATIC=true USE_SYSTEM_PWD_GRP=false "CONFIG_SRC_DIR=../../")
|
||||
(cd $(bbsbd); $(MAKE) DOSTATIC=true USE_SYSTEM_PWD_GRP=false "BB_SRC_DIR=../../")
|
||||
touch debian/build-stamp-busybox-static
|
||||
|
||||
install-static: build
|
||||
@@ -64,11 +64,11 @@ install-static: build
|
||||
dh_installdirs
|
||||
# Do not run 'make install', since we do not want all the symlinks.
|
||||
# This just installes the busybox binary...
|
||||
#(cd $(bbsbd); $(MAKE) "CONFIG_SRC_DIR=../../" "PREFIX=../../$(bbs)" install)
|
||||
#(cd $(bbsbd); $(MAKE) "BB_SRC_DIR=../../" "PREFIX=../../$(bbs)" install)
|
||||
mkdir -p $(bbs)/bin/
|
||||
cp $(bbsbd)/busybox $(bbs)/bin/busybox
|
||||
mkdir -p $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com
|
||||
cp $(bbsbd)/docs/busybox.lineo.com/BusyBox.html $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com/
|
||||
mkdir -p $(bbs)/usr/share/doc/busybox-static
|
||||
cp $(bbsbd)/docs/BusyBox.html $(bbs)/usr/share/doc/busybox-static/
|
||||
mkdir -p $(bbs)/usr/share/man/man1/
|
||||
cp $(bbsbd)/docs/BusyBox.1 $(bbs)/usr/share/man/man1/busybox.1
|
||||
|
||||
@@ -94,7 +94,7 @@ debian/build-stamp-busybox-udeb:
|
||||
mkdir -p $(bbubd)
|
||||
cp Makefile $(bbubd)
|
||||
cp debian/Config.h-udeb $(bbubd)/Config.h
|
||||
(cd $(bbubd); $(MAKE) USE_SYSTEM_PWD_GRP=false "CONFIG_SRC_DIR=../../")
|
||||
(cd $(bbubd); $(MAKE) USE_SYSTEM_PWD_GRP=false "BB_SRC_DIR=../../")
|
||||
touch debian/build-stamp-busybox-udeb
|
||||
|
||||
install-udeb: build
|
||||
@@ -102,7 +102,8 @@ install-udeb: build
|
||||
dh_testroot
|
||||
dh_clean -k
|
||||
dh_installdirs
|
||||
(cd $(bbubd); $(MAKE) "CONFIG_SRC_DIR=../../" "PREFIX=../../$(bbu)" install)
|
||||
(cd $(bbubd); $(MAKE) "BB_SRC_DIR=../../" "PREFIX=../../$(bbu)" install)
|
||||
rm -f $(bbu)/linuxrc
|
||||
mkdir -p $(bbu)/usr/share/man/man1/
|
||||
cp $(bbubd)/docs/BusyBox.1 $(bbu)/usr/share/man/man1/busybox.1
|
||||
|
||||
@@ -130,7 +131,7 @@ busybox: install
|
||||
dh_installdirs
|
||||
dh_installdocs -p$@ $(bbbd)/docs/BusyBox.txt \
|
||||
$(bbbd)/docs/BusyBox.html docs/style-guide.txt \
|
||||
docs/busybox.lineo.com AUTHORS README TODO
|
||||
AUTHORS README TODO
|
||||
rm -rf `find $(bb) -name CVS`
|
||||
rm -f `find $(bb) -name .cvsignore`
|
||||
dh_installchangelogs -p$@ Changelog
|
||||
@@ -152,7 +153,7 @@ busybox-static: do_static
|
||||
dh_installdirs
|
||||
dh_installdocs -p$@ $(bbsbd)/docs/BusyBox.txt \
|
||||
$(bbsbd)/docs/BusyBox.html docs/style-guide.txt \
|
||||
docs/busybox.lineo.com AUTHORS README TODO
|
||||
AUTHORS README TODO
|
||||
rm -rf `find $(bbs) -name CVS`
|
||||
rm -f `find $(bbs) -name .cvsignore`
|
||||
dh_installchangelogs -p$@ Changelog
|
||||
|
||||
@@ -1,261 +0,0 @@
|
||||
/* vi: set sw=4 ts=4: */
|
||||
/*
|
||||
* Mini start-stop-daemon implementation(s) for busybox
|
||||
*
|
||||
* Written by Marek Michalkiewicz <marekm@i17linuxb.ists.pwr.wroc.pl>,
|
||||
* public domain.
|
||||
* Adapted for busybox David Kimdon <dwhedon@gordian.com>
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
#include "pwd.h"
|
||||
|
||||
#include "busybox.h"
|
||||
|
||||
static int start = 0;
|
||||
static int stop = 0;
|
||||
static int signal_nr = 15;
|
||||
static int user_id = -1;
|
||||
static const char *userspec = NULL;
|
||||
static const char *cmdname = NULL;
|
||||
static char *execname = NULL;
|
||||
static char *startas = NULL;
|
||||
|
||||
typedef struct pid_list {
|
||||
struct pid_list *next;
|
||||
int pid;
|
||||
} pid_list;
|
||||
|
||||
static pid_list *found = NULL;
|
||||
|
||||
static inline void
|
||||
push(int pid)
|
||||
{
|
||||
pid_list *p;
|
||||
|
||||
p = xmalloc(sizeof(*p));
|
||||
p->next = found;
|
||||
p->pid = pid;
|
||||
found = p;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
parse_options(int argc, char * const *argv)
|
||||
{
|
||||
|
||||
int c;
|
||||
|
||||
for (;;) {
|
||||
c = getopt (argc, argv, "a:n:s:u:x:KS");
|
||||
if (c == EOF)
|
||||
break;
|
||||
switch (c) {
|
||||
case 'K':
|
||||
stop = 1;
|
||||
break;
|
||||
case 'S':
|
||||
start = 1;
|
||||
break;
|
||||
case 'a':
|
||||
startas = optarg;
|
||||
break;
|
||||
case 'n':
|
||||
cmdname = optarg;
|
||||
break;
|
||||
case 's':
|
||||
if (sscanf(optarg, "%d", &signal_nr) != 1)
|
||||
error_msg_and_die ("-s takes a numeric argument");
|
||||
break;
|
||||
case 'u':
|
||||
userspec = optarg;
|
||||
break;
|
||||
case 'x':
|
||||
execname = optarg;
|
||||
break;
|
||||
default:
|
||||
show_usage();
|
||||
}
|
||||
}
|
||||
|
||||
if (start == stop)
|
||||
error_msg_and_die ("need one of -S or -K");
|
||||
|
||||
if (!execname && !userspec)
|
||||
error_msg_and_die ("need at least one of -x or -u");
|
||||
|
||||
if (!startas)
|
||||
startas = execname;
|
||||
|
||||
if (start && !startas)
|
||||
error_msg_and_die ("-S needs -x or -a");
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
pid_is_exec(int pid, const char *exec)
|
||||
{
|
||||
char buf[PATH_MAX];
|
||||
FILE *fp;
|
||||
|
||||
sprintf(buf, "/proc/%d/cmdline", pid);
|
||||
fp = fopen(buf, "r");
|
||||
if (fp && fgets (buf, sizeof (buf), fp) ) {
|
||||
if (strncmp (buf, exec, strlen(exec)) == 0)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
pid_is_user(int pid, int uid)
|
||||
{
|
||||
struct stat sb;
|
||||
char buf[32];
|
||||
|
||||
sprintf(buf, "/proc/%d", pid);
|
||||
if (stat(buf, &sb) != 0)
|
||||
return 0;
|
||||
return (sb.st_uid == uid);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
pid_is_cmd(int pid, const char *name)
|
||||
{
|
||||
char buf[32];
|
||||
FILE *f;
|
||||
int c;
|
||||
|
||||
sprintf(buf, "/proc/%d/stat", pid);
|
||||
f = fopen(buf, "r");
|
||||
if (!f)
|
||||
return 0;
|
||||
while ((c = getc(f)) != EOF && c != '(')
|
||||
;
|
||||
if (c != '(') {
|
||||
fclose(f);
|
||||
return 0;
|
||||
}
|
||||
/* this hopefully handles command names containing ')' */
|
||||
while ((c = getc(f)) != EOF && c == *name)
|
||||
name++;
|
||||
fclose(f);
|
||||
return (c == ')' && *name == '\0');
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
check(int pid)
|
||||
{
|
||||
if (execname && !pid_is_exec(pid, execname)) {
|
||||
return;
|
||||
}
|
||||
if (userspec && !pid_is_user(pid, user_id)) {
|
||||
return;
|
||||
}
|
||||
if (cmdname && !pid_is_cmd(pid, cmdname)) {
|
||||
return;
|
||||
}
|
||||
push(pid);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
do_procfs(void)
|
||||
{
|
||||
DIR *procdir;
|
||||
struct dirent *entry;
|
||||
int foundany, pid;
|
||||
|
||||
procdir = opendir("/proc");
|
||||
if (!procdir)
|
||||
perror_msg_and_die ("opendir /proc");
|
||||
|
||||
foundany = 0;
|
||||
while ((entry = readdir(procdir)) != NULL) {
|
||||
if (sscanf(entry->d_name, "%d", &pid) != 1)
|
||||
continue;
|
||||
foundany++;
|
||||
check(pid);
|
||||
}
|
||||
closedir(procdir);
|
||||
if (!foundany)
|
||||
error_msg_and_die ("nothing in /proc - not mounted?");
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
do_stop(void)
|
||||
{
|
||||
char what[1024];
|
||||
pid_list *p;
|
||||
int killed = 0;
|
||||
|
||||
if (cmdname)
|
||||
strcpy(what, cmdname);
|
||||
else if (execname)
|
||||
strcpy(what, execname);
|
||||
else if (userspec)
|
||||
sprintf(what, "process(es) owned by `%s'", userspec);
|
||||
else
|
||||
error_msg_and_die ("internal error, please report");
|
||||
|
||||
if (!found) {
|
||||
printf("no %s found; none killed.\n", what);
|
||||
return;
|
||||
}
|
||||
for (p = found; p; p = p->next) {
|
||||
if (kill(p->pid, signal_nr) == 0) {
|
||||
p->pid = -p->pid;
|
||||
killed++;
|
||||
} else {
|
||||
perror_msg("warning: failed to kill %d:", p->pid);
|
||||
}
|
||||
}
|
||||
if (killed) {
|
||||
printf("stopped %s (pid", what);
|
||||
for (p = found; p; p = p->next)
|
||||
if(p->pid < 0)
|
||||
printf(" %d", -p->pid);
|
||||
printf(").\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
start_stop_daemon_main(int argc, char **argv)
|
||||
{
|
||||
parse_options(argc, argv);
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (userspec && sscanf(userspec, "%d", &user_id) != 1)
|
||||
user_id = my_getpwnam(userspec);
|
||||
|
||||
do_procfs();
|
||||
|
||||
if (stop) {
|
||||
do_stop();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
if (found) {
|
||||
printf("%s already running.\n%d\n", execname ,found->pid);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
*--argv = startas;
|
||||
execv(startas, argv);
|
||||
perror_msg_and_die ("unable to start %s", startas);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "busybox.h"
|
||||
|
||||
extern const char mtab_file[]; /* Defined in utility.c */
|
||||
#ifdef CONFIG_FEATURE_HUMAN_READABLE
|
||||
#ifdef BB_FEATURE_HUMAN_READABLE
|
||||
static unsigned long df_disp_hr = KILOBYTE;
|
||||
#endif
|
||||
|
||||
@@ -61,7 +61,7 @@ static int do_df(char *device, const char *mount_point)
|
||||
if(device==NULL)
|
||||
return FALSE;
|
||||
}
|
||||
#ifdef CONFIG_FEATURE_HUMAN_READABLE
|
||||
#ifdef BB_FEATURE_HUMAN_READABLE
|
||||
printf("%-20s %9s ", device,
|
||||
make_human_readable_str(s.f_blocks, s.f_bsize, df_disp_hr));
|
||||
|
||||
@@ -92,13 +92,13 @@ extern int df_main(int argc, char **argv)
|
||||
char disp_units_hdr[80] = "1k-blocks"; /* default display is kilobytes */
|
||||
|
||||
while ((opt = getopt(argc, argv, "k"
|
||||
#ifdef CONFIG_FEATURE_HUMAN_READABLE
|
||||
#ifdef BB_FEATURE_HUMAN_READABLE
|
||||
"hm"
|
||||
#endif
|
||||
)) > 0)
|
||||
{
|
||||
switch (opt) {
|
||||
#ifdef CONFIG_FEATURE_HUMAN_READABLE
|
||||
#ifdef BB_FEATURE_HUMAN_READABLE
|
||||
case 'h':
|
||||
df_disp_hr = 0;
|
||||
strcpy(disp_units_hdr, " Size");
|
||||
@@ -1,125 +0,0 @@
|
||||
# BusyBox configuration option Help File
|
||||
#
|
||||
# Format of this file: description<nl>variable<nl>help text<nl><nl>.
|
||||
# The help texts may contain empty lines, but every non-empty line must
|
||||
# be indented two positions. Order of the help texts does not matter,
|
||||
# however, no variable should be documented twice: if it is, only the
|
||||
# first occurrence will be used. We try to keep the help texts of related
|
||||
# variables close together. Lines starting with `#' are ignored. To be
|
||||
# nice to menuconfig, limit your line length to 70 characters.
|
||||
#
|
||||
# Comments of the form "# Choice:" followed by a menu name are used
|
||||
# internally by the maintainers' consistency-checking tools.
|
||||
#
|
||||
# If you add a help text to this file, please try to be as gentle as
|
||||
# possible. Don't use unexplained acronyms and generally write for the
|
||||
# hypothetical ignorant but intelligent user who has just bought a PC,
|
||||
# removed Windows, installed Linux and is now compiling up BusyBox
|
||||
# for the first time. Tell them what to do if they're unsure.
|
||||
#
|
||||
# Mention all the relevant READMEs and HOWTOs in the help text.
|
||||
# Make them file URLs relative to the top level of the source tree so
|
||||
# that help browsers can turn them into hotlinks. All URLs ahould be
|
||||
# surrounded by <>.
|
||||
#
|
||||
# Repetitions are fine since the help texts are not meant to be read
|
||||
# in sequence. It is good style to include URLs pointing to more
|
||||
# detailed technical information, pictures of the hardware, etc.
|
||||
#
|
||||
# The most important thing to include in a help entry is *motivation*.
|
||||
# Explain why someone configuring BusyBox might want to select your
|
||||
# option.
|
||||
#
|
||||
|
||||
Show verbose applets usage message
|
||||
CONFIG_FEATURE_VERBOSE_USAGE
|
||||
All BusyBox applets will show more verbose help messages when
|
||||
busybox is invoked with --help. This will add lots of text to the
|
||||
busybox binary. In the default configuration, this will add about
|
||||
13k, but it can add much more depending on your configuration.
|
||||
|
||||
Enable automatic symlink creation for BusyBox built-in applets
|
||||
CONFIG_FEATURE_INSTALLER
|
||||
Enable 'busybox --install [-s]' support. This will allow you to use
|
||||
busybox at runtime to create hard links or symlinks for all the
|
||||
applets that are compiled into busybox. This feature requires the
|
||||
/proc filesystem.
|
||||
|
||||
Locale support
|
||||
CONFIG_LOCALE_SUPPORT
|
||||
Enable this if your system has locale support, and you would like
|
||||
busybox to support locale settings.
|
||||
|
||||
Enable devfs support
|
||||
CONFIG_FEATURE_DEVFS
|
||||
Enable if you want BusyBox to work with devfs.
|
||||
|
||||
Clean up all memory before exiting
|
||||
CONFIG_FEATURE_CLEAN_UP
|
||||
As a size optimization, busybox by default does not cleanup memory
|
||||
that is dynamically allocated or close files before exiting. This
|
||||
saves space and is usually not needed since the OS will clean up for
|
||||
us. Don't enable this unless you have a really good reason to clean
|
||||
things up manually.
|
||||
|
||||
Buffers allocation policy
|
||||
CONFIG_FEATURE_BUFFERS_USE_MALLOC
|
||||
There are 3 ways BusyBox can handle buffer allocations:
|
||||
- Use malloc. This costs code size for the call to xmalloc.
|
||||
- Put them on stack. For some very small machines with limited stack
|
||||
space, this can be deadly. For most folks, this works just fine.
|
||||
- Put them in BSS. This works beautifully for computers with a real
|
||||
MMU (and OS support), but wastes runtime RAM for uCLinux. This
|
||||
behavior was the only one available for BusyBox versions 0.48 and
|
||||
earlier.
|
||||
|
||||
Enable the ar applet
|
||||
CONFIG_AR
|
||||
ar is an archival utility program used to create, modify, and
|
||||
extract contents from archives. An archive is a single file holding
|
||||
a collection of other files in a structure that makes it possible to
|
||||
retrieve the original individual files (called archive members).
|
||||
The original files' contents, mode (permissions), timestamp, owner,
|
||||
and group are preserved in the archive, and can be restored on
|
||||
extraction.
|
||||
On an x86 system, the ar applet adds about XXX bytes.
|
||||
|
||||
Unless you have a specific application which requires ar, you should
|
||||
probably say N here.
|
||||
|
||||
Enable the bunzip2 applet
|
||||
CONFIG_BUNZIP2
|
||||
bunzip2 is an compression utility using the Burrows-Wheeler block
|
||||
sorting text compression algorithm, and Huffman coding. Compression
|
||||
is generally considerably better than that achieved by more
|
||||
conventional LZ77/LZ78-based compressors, and approaches the
|
||||
performance of the PPM family of statistical compressors.
|
||||
|
||||
The BusyBox bunzip2 applet is limited to de-compression only. On an
|
||||
x86 system, this applet adds about XXX bytes.
|
||||
|
||||
Unless you have a specific application which requires bunzip2, you
|
||||
should probably say N here.
|
||||
|
||||
# FIXME -- document the rest of the BusyBox config options....
|
||||
|
||||
Enable the run-parts applet
|
||||
CONFIG_RUN_PARTS
|
||||
run-parts is an utility designed to run all the scripts in a directory.
|
||||
|
||||
It is useful to set up a directory like cron.daily, where you need to
|
||||
execute all the scripts in that directory.
|
||||
|
||||
This implementation of run-parts doesn't accept long options, and
|
||||
some features (like report mode) aren't implemented.
|
||||
|
||||
Unless you know that run-parts is used in some of your scripts
|
||||
you can safely say N here.
|
||||
|
||||
# The following sets edit modes for GNU EMACS
|
||||
# Local Variables:
|
||||
# case-fold-search:nil
|
||||
# fill-prefix:" "
|
||||
# adaptive-fill:nil
|
||||
# fill-column:70
|
||||
# End:
|
||||
@@ -189,16 +189,12 @@ Example:
|
||||
|
||||
The purpose of this script is to automagically generate documentation
|
||||
for busybox using its usage.h as the original source for content.
|
||||
It used to be that same content has to be duplicated in 3 places in
|
||||
Currently, the same content has to be duplicated in 3 places in
|
||||
slightly different formats -- F<usage.h>, F<docs/busybox.pod>, and
|
||||
F<docs/busybox.sgml>. This was tedious and error-prone, so it was
|
||||
decided that F<usage.h> would contain all the text in a
|
||||
machine-readable form, and scripts could be used to transform this
|
||||
text into other forms if necessary.
|
||||
F<docs/busybox.sgml>. This is tedious, so Perl has come to the rescue.
|
||||
|
||||
F<autodocifier.pl> is one such script.
|
||||
It was based on a script by Erik Andersen <andersen@lineo.com>
|
||||
which was in turn based on a script by Mark Whitley <markw@lineo.com>
|
||||
This script was based on a script by Erik Andersen <andersee@debian.org>
|
||||
which was in turn based on a script by Mark Whitley <markw@codepoet.org>
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
@@ -255,20 +251,20 @@ a command. I<REQUIRED>
|
||||
=item B<full>
|
||||
|
||||
This should contain descriptions of each option. This will also
|
||||
be displayed along with the trivial help if CONFIG_FEATURE_TRIVIAL_HELP
|
||||
be displayed along with the trivial help if BB_FEATURE_TRIVIAL_HELP
|
||||
is disabled. I<REQUIRED>
|
||||
|
||||
=item B<notes>
|
||||
|
||||
This is documentation that is intended to go in the POD or SGML, but
|
||||
not be printed when a B<-h> is given to a command. To see an example
|
||||
of notes being used, see init_notes_usage in F<usage.h>. I<OPTIONAL>
|
||||
of notes being used, see init_notes_usage. I<OPTIONAL>
|
||||
|
||||
=item B<example>
|
||||
|
||||
This should be an example of how the command is actually used.
|
||||
This should be an example of how the command is acutally used.
|
||||
This will not be printed when a B<-h> is given to a command -- it
|
||||
will only be included in the POD or SGML documentation. I<OPTIONAL>
|
||||
is inteded only for the POD or SGML documentation. I<OPTIONAL>
|
||||
|
||||
=back
|
||||
|
||||
@@ -284,8 +280,8 @@ terms as Perl itself.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
John BEPPU <b@ax9.org>
|
||||
John BEPPU <beppu@codepoet.org>
|
||||
|
||||
=cut
|
||||
|
||||
# $Id: autodocifier.pl,v 1.23 2001/10/31 04:29:18 beppu Exp $
|
||||
# $Id: autodocifier.pl,v 1.22 2001/11/19 23:57:54 andersen Exp $
|
||||
@@ -1 +0,0 @@
|
||||
BusyBox.html
|
||||
@@ -1,404 +0,0 @@
|
||||
%!PS-Adobe-2.0
|
||||
%%Title: busybox-growth.ps
|
||||
%%Creator: gnuplot 3.5 (pre 3.6) patchlevel beta 347
|
||||
%%CreationDate: Tue Apr 10 14:03:36 2001
|
||||
%%DocumentFonts: (atend)
|
||||
%%BoundingBox: 50 40 554 770
|
||||
%%Orientation: Landscape
|
||||
%%Pages: (atend)
|
||||
%%EndComments
|
||||
/gnudict 120 dict def
|
||||
gnudict begin
|
||||
/Color true def
|
||||
/Solid true def
|
||||
/gnulinewidth 5.000 def
|
||||
/userlinewidth gnulinewidth def
|
||||
/vshift -46 def
|
||||
/dl {10 mul} def
|
||||
/hpt_ 31.5 def
|
||||
/vpt_ 31.5 def
|
||||
/hpt hpt_ def
|
||||
/vpt vpt_ def
|
||||
/M {moveto} bind def
|
||||
/L {lineto} bind def
|
||||
/R {rmoveto} bind def
|
||||
/V {rlineto} bind def
|
||||
/vpt2 vpt 2 mul def
|
||||
/hpt2 hpt 2 mul def
|
||||
/Lshow { currentpoint stroke M
|
||||
0 vshift R show } def
|
||||
/Rshow { currentpoint stroke M
|
||||
dup stringwidth pop neg vshift R show } def
|
||||
/Cshow { currentpoint stroke M
|
||||
dup stringwidth pop -2 div vshift R show } def
|
||||
/UP { dup vpt_ mul /vpt exch def hpt_ mul /hpt exch def
|
||||
/hpt2 hpt 2 mul def /vpt2 vpt 2 mul def } def
|
||||
/DL { Color {setrgbcolor Solid {pop []} if 0 setdash }
|
||||
{pop pop pop Solid {pop []} if 0 setdash} ifelse } def
|
||||
/BL { stroke gnulinewidth 2 mul setlinewidth } def
|
||||
/AL { stroke gnulinewidth 2 div setlinewidth } def
|
||||
/UL { gnulinewidth mul /userlinewidth exch def } def
|
||||
/PL { stroke userlinewidth setlinewidth } def
|
||||
/LTb { BL [] 0 0 0 DL } def
|
||||
/LTa { AL [1 dl 2 dl] 0 setdash 0 0 0 setrgbcolor } def
|
||||
/LT0 { PL [] 1 0 0 DL } def
|
||||
/LT1 { PL [4 dl 2 dl] 0 1 0 DL } def
|
||||
/LT2 { PL [2 dl 3 dl] 0 0 1 DL } def
|
||||
/LT3 { PL [1 dl 1.5 dl] 1 0 1 DL } def
|
||||
/LT4 { PL [5 dl 2 dl 1 dl 2 dl] 0 1 1 DL } def
|
||||
/LT5 { PL [4 dl 3 dl 1 dl 3 dl] 1 1 0 DL } def
|
||||
/LT6 { PL [2 dl 2 dl 2 dl 4 dl] 0 0 0 DL } def
|
||||
/LT7 { PL [2 dl 2 dl 2 dl 2 dl 2 dl 4 dl] 1 0.3 0 DL } def
|
||||
/LT8 { PL [2 dl 2 dl 2 dl 2 dl 2 dl 2 dl 2 dl 4 dl] 0.5 0.5 0.5 DL } def
|
||||
/Pnt { stroke [] 0 setdash
|
||||
gsave 1 setlinecap M 0 0 V stroke grestore } def
|
||||
/Dia { stroke [] 0 setdash 2 copy vpt add M
|
||||
hpt neg vpt neg V hpt vpt neg V
|
||||
hpt vpt V hpt neg vpt V closepath stroke
|
||||
Pnt } def
|
||||
/Pls { stroke [] 0 setdash vpt sub M 0 vpt2 V
|
||||
currentpoint stroke M
|
||||
hpt neg vpt neg R hpt2 0 V stroke
|
||||
} def
|
||||
/Box { stroke [] 0 setdash 2 copy exch hpt sub exch vpt add M
|
||||
0 vpt2 neg V hpt2 0 V 0 vpt2 V
|
||||
hpt2 neg 0 V closepath stroke
|
||||
Pnt } def
|
||||
/Crs { stroke [] 0 setdash exch hpt sub exch vpt add M
|
||||
hpt2 vpt2 neg V currentpoint stroke M
|
||||
hpt2 neg 0 R hpt2 vpt2 V stroke } def
|
||||
/TriU { stroke [] 0 setdash 2 copy vpt 1.12 mul add M
|
||||
hpt neg vpt -1.62 mul V
|
||||
hpt 2 mul 0 V
|
||||
hpt neg vpt 1.62 mul V closepath stroke
|
||||
Pnt } def
|
||||
/Star { 2 copy Pls Crs } def
|
||||
/BoxF { stroke [] 0 setdash exch hpt sub exch vpt add M
|
||||
0 vpt2 neg V hpt2 0 V 0 vpt2 V
|
||||
hpt2 neg 0 V closepath fill } def
|
||||
/TriUF { stroke [] 0 setdash vpt 1.12 mul add M
|
||||
hpt neg vpt -1.62 mul V
|
||||
hpt 2 mul 0 V
|
||||
hpt neg vpt 1.62 mul V closepath fill } def
|
||||
/TriD { stroke [] 0 setdash 2 copy vpt 1.12 mul sub M
|
||||
hpt neg vpt 1.62 mul V
|
||||
hpt 2 mul 0 V
|
||||
hpt neg vpt -1.62 mul V closepath stroke
|
||||
Pnt } def
|
||||
/TriDF { stroke [] 0 setdash vpt 1.12 mul sub M
|
||||
hpt neg vpt 1.62 mul V
|
||||
hpt 2 mul 0 V
|
||||
hpt neg vpt -1.62 mul V closepath fill} def
|
||||
/DiaF { stroke [] 0 setdash vpt add M
|
||||
hpt neg vpt neg V hpt vpt neg V
|
||||
hpt vpt V hpt neg vpt V closepath fill } def
|
||||
/Pent { stroke [] 0 setdash 2 copy gsave
|
||||
translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
|
||||
closepath stroke grestore Pnt } def
|
||||
/PentF { stroke [] 0 setdash gsave
|
||||
translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
|
||||
closepath fill grestore } def
|
||||
/Circle { stroke [] 0 setdash 2 copy
|
||||
hpt 0 360 arc stroke Pnt } def
|
||||
/CircleF { stroke [] 0 setdash hpt 0 360 arc fill } def
|
||||
/C0 { BL [] 0 setdash 2 copy moveto vpt 90 450 arc } bind def
|
||||
/C1 { BL [] 0 setdash 2 copy moveto
|
||||
2 copy vpt 0 90 arc closepath fill
|
||||
vpt 0 360 arc closepath } bind def
|
||||
/C2 { BL [] 0 setdash 2 copy moveto
|
||||
2 copy vpt 90 180 arc closepath fill
|
||||
vpt 0 360 arc closepath } bind def
|
||||
/C3 { BL [] 0 setdash 2 copy moveto
|
||||
2 copy vpt 0 180 arc closepath fill
|
||||
vpt 0 360 arc closepath } bind def
|
||||
/C4 { BL [] 0 setdash 2 copy moveto
|
||||
2 copy vpt 180 270 arc closepath fill
|
||||
vpt 0 360 arc closepath } bind def
|
||||
/C5 { BL [] 0 setdash 2 copy moveto
|
||||
2 copy vpt 0 90 arc
|
||||
2 copy moveto
|
||||
2 copy vpt 180 270 arc closepath fill
|
||||
vpt 0 360 arc } bind def
|
||||
/C6 { BL [] 0 setdash 2 copy moveto
|
||||
2 copy vpt 90 270 arc closepath fill
|
||||
vpt 0 360 arc closepath } bind def
|
||||
/C7 { BL [] 0 setdash 2 copy moveto
|
||||
2 copy vpt 0 270 arc closepath fill
|
||||
vpt 0 360 arc closepath } bind def
|
||||
/C8 { BL [] 0 setdash 2 copy moveto
|
||||
2 copy vpt 270 360 arc closepath fill
|
||||
vpt 0 360 arc closepath } bind def
|
||||
/C9 { BL [] 0 setdash 2 copy moveto
|
||||
2 copy vpt 270 450 arc closepath fill
|
||||
vpt 0 360 arc closepath } bind def
|
||||
/C10 { BL [] 0 setdash 2 copy 2 copy moveto vpt 270 360 arc closepath fill
|
||||
2 copy moveto
|
||||
2 copy vpt 90 180 arc closepath fill
|
||||
vpt 0 360 arc closepath } bind def
|
||||
/C11 { BL [] 0 setdash 2 copy moveto
|
||||
2 copy vpt 0 180 arc closepath fill
|
||||
2 copy moveto
|
||||
2 copy vpt 270 360 arc closepath fill
|
||||
vpt 0 360 arc closepath } bind def
|
||||
/C12 { BL [] 0 setdash 2 copy moveto
|
||||
2 copy vpt 180 360 arc closepath fill
|
||||
vpt 0 360 arc closepath } bind def
|
||||
/C13 { BL [] 0 setdash 2 copy moveto
|
||||
2 copy vpt 0 90 arc closepath fill
|
||||
2 copy moveto
|
||||
2 copy vpt 180 360 arc closepath fill
|
||||
vpt 0 360 arc closepath } bind def
|
||||
/C14 { BL [] 0 setdash 2 copy moveto
|
||||
2 copy vpt 90 360 arc closepath fill
|
||||
vpt 0 360 arc } bind def
|
||||
/C15 { BL [] 0 setdash 2 copy vpt 0 360 arc closepath fill
|
||||
vpt 0 360 arc closepath } bind def
|
||||
/Rec { newpath 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto
|
||||
neg 0 rlineto closepath } bind def
|
||||
/Square { dup Rec } bind def
|
||||
/Bsquare { vpt sub exch vpt sub exch vpt2 Square } bind def
|
||||
/S0 { BL [] 0 setdash 2 copy moveto 0 vpt rlineto BL Bsquare } bind def
|
||||
/S1 { BL [] 0 setdash 2 copy vpt Square fill Bsquare } bind def
|
||||
/S2 { BL [] 0 setdash 2 copy exch vpt sub exch vpt Square fill Bsquare } bind def
|
||||
/S3 { BL [] 0 setdash 2 copy exch vpt sub exch vpt2 vpt Rec fill Bsquare } bind def
|
||||
/S4 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt Square fill Bsquare } bind def
|
||||
/S5 { BL [] 0 setdash 2 copy 2 copy vpt Square fill
|
||||
exch vpt sub exch vpt sub vpt Square fill Bsquare } bind def
|
||||
/S6 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill Bsquare } bind def
|
||||
/S7 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill
|
||||
2 copy vpt Square fill
|
||||
Bsquare } bind def
|
||||
/S8 { BL [] 0 setdash 2 copy vpt sub vpt Square fill Bsquare } bind def
|
||||
/S9 { BL [] 0 setdash 2 copy vpt sub vpt vpt2 Rec fill Bsquare } bind def
|
||||
/S10 { BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt Square fill
|
||||
Bsquare } bind def
|
||||
/S11 { BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt2 vpt Rec fill
|
||||
Bsquare } bind def
|
||||
/S12 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill Bsquare } bind def
|
||||
/S13 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill
|
||||
2 copy vpt Square fill Bsquare } bind def
|
||||
/S14 { BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill
|
||||
2 copy exch vpt sub exch vpt Square fill Bsquare } bind def
|
||||
/S15 { BL [] 0 setdash 2 copy Bsquare fill Bsquare } bind def
|
||||
/D0 { gsave translate 45 rotate 0 0 S0 stroke grestore } bind def
|
||||
/D1 { gsave translate 45 rotate 0 0 S1 stroke grestore } bind def
|
||||
/D2 { gsave translate 45 rotate 0 0 S2 stroke grestore } bind def
|
||||
/D3 { gsave translate 45 rotate 0 0 S3 stroke grestore } bind def
|
||||
/D4 { gsave translate 45 rotate 0 0 S4 stroke grestore } bind def
|
||||
/D5 { gsave translate 45 rotate 0 0 S5 stroke grestore } bind def
|
||||
/D6 { gsave translate 45 rotate 0 0 S6 stroke grestore } bind def
|
||||
/D7 { gsave translate 45 rotate 0 0 S7 stroke grestore } bind def
|
||||
/D8 { gsave translate 45 rotate 0 0 S8 stroke grestore } bind def
|
||||
/D9 { gsave translate 45 rotate 0 0 S9 stroke grestore } bind def
|
||||
/D10 { gsave translate 45 rotate 0 0 S10 stroke grestore } bind def
|
||||
/D11 { gsave translate 45 rotate 0 0 S11 stroke grestore } bind def
|
||||
/D12 { gsave translate 45 rotate 0 0 S12 stroke grestore } bind def
|
||||
/D13 { gsave translate 45 rotate 0 0 S13 stroke grestore } bind def
|
||||
/D14 { gsave translate 45 rotate 0 0 S14 stroke grestore } bind def
|
||||
/D15 { gsave translate 45 rotate 0 0 S15 stroke grestore } bind def
|
||||
/DiaE { stroke [] 0 setdash vpt add M
|
||||
hpt neg vpt neg V hpt vpt neg V
|
||||
hpt vpt V hpt neg vpt V closepath stroke } def
|
||||
/BoxE { stroke [] 0 setdash exch hpt sub exch vpt add M
|
||||
0 vpt2 neg V hpt2 0 V 0 vpt2 V
|
||||
hpt2 neg 0 V closepath stroke } def
|
||||
/TriUE { stroke [] 0 setdash vpt 1.12 mul add M
|
||||
hpt neg vpt -1.62 mul V
|
||||
hpt 2 mul 0 V
|
||||
hpt neg vpt 1.62 mul V closepath stroke } def
|
||||
/TriDE { stroke [] 0 setdash vpt 1.12 mul sub M
|
||||
hpt neg vpt 1.62 mul V
|
||||
hpt 2 mul 0 V
|
||||
hpt neg vpt -1.62 mul V closepath stroke } def
|
||||
/PentE { stroke [] 0 setdash gsave
|
||||
translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
|
||||
closepath stroke grestore } def
|
||||
/CircE { stroke [] 0 setdash
|
||||
hpt 0 360 arc stroke } def
|
||||
/Opaque { gsave closepath 1 setgray fill grestore 0 setgray closepath } def
|
||||
/DiaW { stroke [] 0 setdash vpt add M
|
||||
hpt neg vpt neg V hpt vpt neg V
|
||||
hpt vpt V hpt neg vpt V Opaque stroke } def
|
||||
/BoxW { stroke [] 0 setdash exch hpt sub exch vpt add M
|
||||
0 vpt2 neg V hpt2 0 V 0 vpt2 V
|
||||
hpt2 neg 0 V Opaque stroke } def
|
||||
/TriUW { stroke [] 0 setdash vpt 1.12 mul add M
|
||||
hpt neg vpt -1.62 mul V
|
||||
hpt 2 mul 0 V
|
||||
hpt neg vpt 1.62 mul V Opaque stroke } def
|
||||
/TriDW { stroke [] 0 setdash vpt 1.12 mul sub M
|
||||
hpt neg vpt 1.62 mul V
|
||||
hpt 2 mul 0 V
|
||||
hpt neg vpt -1.62 mul V Opaque stroke } def
|
||||
/PentW { stroke [] 0 setdash gsave
|
||||
translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
|
||||
Opaque stroke grestore } def
|
||||
/CircW { stroke [] 0 setdash
|
||||
hpt 0 360 arc Opaque stroke } def
|
||||
/BoxFill { gsave Rec 1 setgray fill grestore } def
|
||||
end
|
||||
%%EndProlog
|
||||
%%Page: 1 1
|
||||
gnudict begin
|
||||
gsave
|
||||
50 50 translate
|
||||
0.100 0.100 scale
|
||||
90 rotate
|
||||
0 -5040 translate
|
||||
0 setgray
|
||||
newpath
|
||||
(Helvetica) findfont 140 scalefont setfont
|
||||
1.000 UL
|
||||
LTb
|
||||
560 420 M
|
||||
63 0 V
|
||||
6409 0 R
|
||||
-63 0 V
|
||||
476 420 M
|
||||
(0) Rshow
|
||||
560 1056 M
|
||||
63 0 V
|
||||
6409 0 R
|
||||
-63 0 V
|
||||
-6493 0 R
|
||||
(100) Rshow
|
||||
560 1692 M
|
||||
63 0 V
|
||||
6409 0 R
|
||||
-63 0 V
|
||||
-6493 0 R
|
||||
(200) Rshow
|
||||
560 2328 M
|
||||
63 0 V
|
||||
6409 0 R
|
||||
-63 0 V
|
||||
-6493 0 R
|
||||
(300) Rshow
|
||||
560 2964 M
|
||||
63 0 V
|
||||
6409 0 R
|
||||
-63 0 V
|
||||
-6493 0 R
|
||||
(400) Rshow
|
||||
560 3600 M
|
||||
63 0 V
|
||||
6409 0 R
|
||||
-63 0 V
|
||||
-6493 0 R
|
||||
(500) Rshow
|
||||
560 4236 M
|
||||
63 0 V
|
||||
6409 0 R
|
||||
-63 0 V
|
||||
-6493 0 R
|
||||
(600) Rshow
|
||||
560 4872 M
|
||||
63 0 V
|
||||
6409 0 R
|
||||
-63 0 V
|
||||
-6493 0 R
|
||||
(700) Rshow
|
||||
1531 420 M
|
||||
0 63 V
|
||||
0 4389 R
|
||||
0 -63 V
|
||||
0 -4529 R
|
||||
(400) Cshow
|
||||
2825 420 M
|
||||
0 63 V
|
||||
0 4389 R
|
||||
0 -63 V
|
||||
0 -4529 R
|
||||
(600) Cshow
|
||||
4120 420 M
|
||||
0 63 V
|
||||
0 4389 R
|
||||
0 -63 V
|
||||
0 -4529 R
|
||||
(800) Cshow
|
||||
5414 420 M
|
||||
0 63 V
|
||||
0 4389 R
|
||||
0 -63 V
|
||||
0 -4529 R
|
||||
(1000) Cshow
|
||||
6708 420 M
|
||||
0 63 V
|
||||
0 4389 R
|
||||
0 -63 V
|
||||
0 -4529 R
|
||||
(1200) Cshow
|
||||
1.000 UL
|
||||
LTb
|
||||
560 420 M
|
||||
6472 0 V
|
||||
0 4452 V
|
||||
-6472 0 V
|
||||
560 420 L
|
||||
0 2646 M
|
||||
currentpoint gsave translate 90 rotate 0 0 M
|
||||
(tar.gz size \(Kb\)) Cshow
|
||||
grestore
|
||||
3796 140 M
|
||||
(time \(days since Jan 1, 1998\)) Cshow
|
||||
1.000 UL
|
||||
LT0
|
||||
696 420 M
|
||||
0 593 V
|
||||
1255 0 V
|
||||
0 15 V
|
||||
214 0 V
|
||||
0 6 V
|
||||
958 0 V
|
||||
0 1 V
|
||||
-84 0 V
|
||||
0 37 V
|
||||
168 0 V
|
||||
0 262 V
|
||||
13 0 V
|
||||
0 56 V
|
||||
91 0 V
|
||||
0 33 V
|
||||
6 0 V
|
||||
0 1 V
|
||||
19 0 V
|
||||
0 11 V
|
||||
20 0 V
|
||||
0 13 V
|
||||
32 0 V
|
||||
0 104 V
|
||||
52 0 V
|
||||
0 27 V
|
||||
65 0 V
|
||||
0 15 V
|
||||
39 0 V
|
||||
0 126 V
|
||||
174 0 V
|
||||
0 103 V
|
||||
52 0 V
|
||||
0 49 V
|
||||
175 0 V
|
||||
0 56 V
|
||||
433 0 V
|
||||
0 661 V
|
||||
415 0 V
|
||||
0 857 V
|
||||
123 0 V
|
||||
0 -291 V
|
||||
498 0 V
|
||||
0 208 V
|
||||
505 0 V
|
||||
0 66 V
|
||||
291 0 V
|
||||
0 115 V
|
||||
311 0 V
|
||||
0 449 V
|
||||
162 0 V
|
||||
0 309 V
|
||||
stroke
|
||||
grestore
|
||||
end
|
||||
showpage
|
||||
%%Trailer
|
||||
%%DocumentFonts: Helvetica
|
||||
%%Pages: 1
|
||||
|
Before Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
@@ -1,439 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>BusyBox</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<body text="#000000" alink="#660000" link="#660000" bgcolor="#dee2de" vlink="#660000">
|
||||
|
||||
<basefont face="lucida, helvetica, arial" size="3">
|
||||
|
||||
|
||||
<CENTER>
|
||||
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2>
|
||||
<TR>
|
||||
<td bgcolor="#000000">
|
||||
<FONT FACE="lucida, helvetica" COLOR="#ccccc0">
|
||||
<B>B u s y B o x</B>
|
||||
</FONT>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<a href="/"><IMG SRC="images/busybox2.jpg" alt="BusyBox" border="0" width="360" height="230"></a><BR>
|
||||
|
||||
|
||||
<!-- Begin Introduction section -->
|
||||
|
||||
|
||||
<TABLE WIDTH="95%" CELLSPACING=1 CELLPADDING=4 BORDER=1>
|
||||
<TR><TD BGCOLOR="#ccccc0" ALIGN=center>
|
||||
<A NAME="intro"> <BIG><B>
|
||||
The Swiss Army Knife of Embedded Linux
|
||||
</B></BIG></A>
|
||||
</TD></TR>
|
||||
<TR><TD BGCOLOR="#eeeee0">
|
||||
|
||||
BusyBox combines tiny versions of many common UNIX utilities into a single
|
||||
small executable. It provides minimalist replacements for most of the utilities
|
||||
you usually find in fileutils, shellutils, findutils, textutils, grep, gzip,
|
||||
tar, etc. BusyBox provides a fairly complete POSIX environment for any small or
|
||||
embedded system. The utilities in BusyBox generally have fewer options than
|
||||
their full featured GNU cousins; however, the options that are included provide
|
||||
the expected functionality and behave very much like their GNU counterparts.
|
||||
<p>
|
||||
BusyBox has been written with size-optimization and limited resources in mind.
|
||||
It is also extremely modular so you can easily include or exclude commands (or
|
||||
features) at compile time. This makes it easy to customize your embedded
|
||||
systems. To create a working system, just add /dev, /etc, and a kernel.
|
||||
<p>
|
||||
|
||||
BusyBox is maintained by
|
||||
<a href="http://codepoet.org/andersen/erik/erik.html">
|
||||
Erik Andersen</a>, and licensed under the
|
||||
<a href="http://www.gnu.org/copyleft/gpl.html">GNU GENERAL PUBLIC LICENSE</a>.
|
||||
<p>
|
||||
|
||||
|
||||
<h3> Screenshot </h3>
|
||||
|
||||
<p> Because everybody loves screenshots, a screenshot of BusyBox
|
||||
is now available <a href="screenshot.html">right here</a>.
|
||||
|
||||
|
||||
<H3>Mailing List Information</h3>
|
||||
BusyBox now has a <a href="http://opensource.lineo.com/lists/busybox/">mailing list</a>!
|
||||
To subscribe, go and visit <a href="http://opensource.lineo.com/mailman/listinfo/busybox">this page</a>.
|
||||
|
||||
<!-- Begin Latest News section -->
|
||||
|
||||
<TR><TD BGCOLOR="#ccccc0" ALIGN=center>
|
||||
<A NAME="news">
|
||||
<BIG><B>
|
||||
Latest News
|
||||
</B></BIG>
|
||||
</A>
|
||||
</TD></TR>
|
||||
<TR><TD BGCOLOR="#eeeee0">
|
||||
|
||||
<ul>
|
||||
|
||||
<li> <b>18 November 2001 -- Help us buy busybox.net!</b>
|
||||
|
||||
<!-- Begin PayPal Logo -->
|
||||
<center>
|
||||
Click here to help buy busybox.net!
|
||||
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
||||
<input type="hidden" name="cmd" value="_xclick">
|
||||
<input type="hidden" name="business" value="andersen@codepoet.org">
|
||||
<input type="hidden" name="item_name" value="Support Busybox/Buy busybox.net">
|
||||
<input type="hidden" name="image_url" value="https://https://busybox.lineo.com/images/busybox2.jpg">
|
||||
<input type="hidden" name="no_shipping" value="1">
|
||||
<input type="image" src="http://images.paypal.com/images/x-click-butcc-donate.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
|
||||
</form>
|
||||
</center>
|
||||
<!-- End PayPal Logo -->
|
||||
|
||||
I've contacted the current owner of busybox.net and he is willing
|
||||
to sell the domain name -- for $250. He also owns busybox.org
|
||||
but will not part with it... I will then need to pay the
|
||||
registry fee, so this will initially cost about $300. I would
|
||||
also like to host busybox.net on my home machine (codepoet.org)
|
||||
so I have full control over the system, but I would need to
|
||||
increase the level of bandwidth I am paying for (there have been
|
||||
over 1 Gigabyte of busybox source downloads for the month of
|
||||
November alone -- other months have had more).
|
||||
<p>
|
||||
|
||||
I was going to pay it all myself, but my wife didn't like that
|
||||
idea at all (big surprise). It turns out, she has better ideas
|
||||
about what we should spend our money on that don't involve
|
||||
busybox. She suggested I should ask for contributions on the
|
||||
mailing list and web page. So...
|
||||
<p>
|
||||
|
||||
I am hoping that if everyone could contribute a bit we could pick
|
||||
up the busybox.net domain name, and cover the bandwidth costs. I
|
||||
know that busybox is being used by a lot of companies as well as
|
||||
individuals -- hopefully companies willing to contribute back a
|
||||
bit. So if everyone could please help out, that would be
|
||||
wonderful!
|
||||
<p>
|
||||
|
||||
p.s. I plan on updating the Changelog later this evening, and
|
||||
releasing busybox 0.60.2 later tonight. I will probably just merge
|
||||
in vodz' msh since it fixes known problems, and since I haven't had
|
||||
time to make it uClinux safe. Changelog entries for busybox.stable
|
||||
are welcome.
|
||||
|
||||
<p>
|
||||
<li> <b>23 August 2001 -- BusyBox 0.60.1 released</b>
|
||||
<br>
|
||||
|
||||
This is a relatively minor bug fixing release that fixes
|
||||
up the bugs that have shown up in the stable release in
|
||||
the last few weeks. Fortunately, nothing <em>too</em>
|
||||
serious has shown up. This release only fixes bugs -- no
|
||||
new features, no new applets. So without further ado,
|
||||
here it is. Come and get it.
|
||||
<p>
|
||||
The
|
||||
<a href="ftp://oss.lineo.com/busybox/Changelog">changelog</a> has all
|
||||
the details. As usual BusyBox 0.60.1 can be downloaded from
|
||||
<a href="ftp://oss.lineo.com/busybox">ftp://oss.lineo.com/busybox</a>.
|
||||
<p>Have Fun!
|
||||
<p>
|
||||
|
||||
|
||||
<li> <b>2 August 2001 -- BusyBox 0.60.0 released</b>
|
||||
<br>
|
||||
I am very pleased to announce the immediate availability of
|
||||
BusyBox 0.60.0. I have personally tested this release with libc5, glibc,
|
||||
and <a href="http://cvs.uclinux.org/uClibc.html">uClibc</a> on
|
||||
x86, ARM, and powerpc using linux 2.2 and 2.4, and I know a number
|
||||
of people using it on everything from ia64 to m68k with great success.
|
||||
Everything seems to be working very nicely now, so getting a nice
|
||||
stable bug-free(tm) release out seems to be in order. This releases fixes
|
||||
a memory leak in syslogd, a number of bugs in the ash and msh shells, and
|
||||
cleans up a number of things.
|
||||
|
||||
<p>
|
||||
|
||||
Those wanting an easy way to test the 0.60.0 release with uClibc can
|
||||
use <a href="http://user-mode-linux.sourceforge.net/">User-Mode Linux</a>
|
||||
to give it a try by downloading and compiling
|
||||
<a href="ftp://oss.lineo.com/buildroot.tar.gz">buildroot.tar.gz</a>.
|
||||
You don't have to be root or reboot your machine to run test this way.
|
||||
Preconfigured User-Mode Linux kernel source is also on oss.lineo.com.
|
||||
<p>
|
||||
Another cool thing is the nifty <a href="ftp://oss.lineo.com/busybox/tutorial/index.html">
|
||||
BusyBox Tutorial</a> contributed by K Computing. This requires
|
||||
a ShockWave plugin (or standalone viewer), so you may want to grab the
|
||||
the GPLed shockwave viewer from <a href="http://www.swift-tools.com/Flash/flash-0.4.10.tgz">here</a>
|
||||
to view the tutorial.
|
||||
<p>
|
||||
|
||||
Finally, In case you didn't notice anything odd about the
|
||||
version number of this release, let me point out that this release
|
||||
is <em>not</em> 0.53, because I bumped the version number up a
|
||||
bit. This reflects the fact that this release is intended to form
|
||||
a new stable BusyBox release series. If you need to rely on a
|
||||
stable version of BusyBox, you should plan on using the stable
|
||||
0.60.x series. If bugs show up then I will release 0.60.1, then
|
||||
0.60.2, etc... This is also intended to deal with the fact that
|
||||
the BusyBox build system will be getting a major overhaul for the
|
||||
next release and I don't want that to break products that people
|
||||
are shipping. To avoid that, the new build system will be
|
||||
released as part of a new BusyBox development series that will
|
||||
have some not-yet-decided-on odd version number. Once things
|
||||
stabilize and the new build system is working for everyone, then
|
||||
I will release that as a new stable release series.
|
||||
|
||||
<p>
|
||||
The
|
||||
<a href="ftp://oss.lineo.com/busybox/Changelog">changelog</a> has all
|
||||
the details. As usual BusyBox 0.60.0 can be downloaded from
|
||||
<a href="ftp://oss.lineo.com/busybox">ftp://oss.lineo.com/busybox</a>.
|
||||
<p>Have Fun!
|
||||
<p>
|
||||
|
||||
|
||||
<li> <b>7 July 2001 -- BusyBox 0.52 released</b>
|
||||
<br>
|
||||
|
||||
I am very pleased to announce the immediate availability of
|
||||
BusyBox 0.52 (the "new-and-improved rock-solid release"). This
|
||||
release is the result of <em>many</em> hours of work and has tons
|
||||
of bugfixes, optimizations, and cleanups. This release adds
|
||||
several new applets, including several new shells (such as hush, msh,
|
||||
and ash).
|
||||
|
||||
<p>
|
||||
The
|
||||
<a href="ftp://oss.lineo.com/busybox/Changelog">changelog</a> covers
|
||||
some of the more obvious details, but there are many many things that
|
||||
are not mentioned, but have been improved in subtle ways. As usual,
|
||||
BusyBox 0.52 can be downloaded from
|
||||
<a href="ftp://oss.lineo.com/busybox">ftp://oss.lineo.com/busybox</a>.
|
||||
<p>Have Fun!
|
||||
<p>
|
||||
|
||||
|
||||
<li> <b>10 April 2001 - Graph of Busybox Growth </b>
|
||||
<br>
|
||||
The illustrious Larry Doolittle has made a PostScript chart of the growth
|
||||
of the Busybox tarball size over time. It is available for downloading /
|
||||
viewing <a href= "busybox-growth.ps"> right here</a>.
|
||||
|
||||
<p> (Note that while the number of applets in Busybox has increased, you
|
||||
can still configure Busybox to be as small as you want by selectively
|
||||
turning off whichever applets you don't need.)
|
||||
<p>
|
||||
|
||||
|
||||
|
||||
<li> <b>Old News</b>
|
||||
<br>
|
||||
For the old news, visit <a href="http://busybox.lineo.com/oldnews.html">the old news page</a>.
|
||||
</ul>
|
||||
|
||||
|
||||
<!-- Begin Download section -->
|
||||
|
||||
<TR><TD BGCOLOR="#ccccc0" ALIGN=center>
|
||||
<A NAME="download"><BIG><B>
|
||||
Download
|
||||
</B></BIG></A>
|
||||
</TD></TR>
|
||||
<TR><TD BGCOLOR="#eeeee0">
|
||||
<ul>
|
||||
|
||||
<li> Source for the latest release can always be downloaded from
|
||||
<a href="ftp://oss.lineo.com/busybox">ftp://oss.lineo.com/busybox</a>.
|
||||
|
||||
<li> A new snapshot of the source is made daily and is available as a GNU
|
||||
gzipped tarball <a href="busybox.tar.gz"> right here</a>.
|
||||
|
||||
<li> BusyBox now has its own publically browsable
|
||||
<a href="http://opensource.lineo.com/cgi-bin/cvsweb/busybox/">CVS tree</a>,
|
||||
anonymous
|
||||
<a href="http://opensource.lineo.com/cvs_anon.html">CVS access</a>, and
|
||||
for those that are actively contributing there is even
|
||||
<a href="http://opensource.lineo.com/cvs_write.html">CVS write access</a>.
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<!-- Begin Docs section -->
|
||||
|
||||
<TR><TD BGCOLOR="#ccccc0" ALIGN=center>
|
||||
<A NAME="docs"><BIG><B>
|
||||
Documentation
|
||||
</B></BIG></A>
|
||||
</TD></TR>
|
||||
<TR><TD BGCOLOR="#eeeee0">
|
||||
Current documentation for BusyBox includes:
|
||||
<ul>
|
||||
<li> <a href="ftp://oss.lineo.com/busybox/BusyBox.html">BusyBox.html</a>.
|
||||
This is a list of the all the available commands in BusyBox with
|
||||
complete usage information and examples of how to use each app. I
|
||||
have spent a <em>lot</em> of time updating these docs and trying to
|
||||
make them fairly comprehensive. If you find any errors (factual,
|
||||
grammatical, whatever) please let me know.
|
||||
<li> <a href="ftp://oss.lineo.com/busybox/README">README</a>.
|
||||
This is the README file included in the busybox source release.
|
||||
<li> <a href="http://bugs.lineo.com/db/pa/lbusybox.html">BusyBox Bugs</a>.
|
||||
Need to report a bug? Need to check if a bug has been filed?
|
||||
<li> If you need more help, the BusyBox
|
||||
<a href="http://opensource.lineo.com/lists/busybox/">mailing list</a> is
|
||||
a good place to start.
|
||||
</ul>
|
||||
|
||||
|
||||
<!-- Begin Links section -->
|
||||
|
||||
<TR><TD BGCOLOR="#ccccc0" ALIGN=center>
|
||||
<A NAME="links">
|
||||
<BIG><B>
|
||||
Important Links
|
||||
</B></BIG>
|
||||
</A>
|
||||
</TD></TR>
|
||||
<TR><TD BGCOLOR="#eeeee0">
|
||||
|
||||
<ul>
|
||||
|
||||
<li> <A HREF="http://perens.com/FreeSoftware/">
|
||||
Free Software from Bruce Perens</A><br>
|
||||
The original idea for BusyBox, and all versions up to 0.26 were written
|
||||
by <A HREF="mailto:bruce@perens.com">Bruce Perens</a>. This is his BusyBox website.
|
||||
<p>
|
||||
|
||||
<li> <A HREF="http://freshmeat.net/projects/busybox/">
|
||||
Freshmeat AppIndex record for BusyBox</A>
|
||||
<p>
|
||||
<li><a href="http://tinylogin.lineo.com/">TinyLogin</a>
|
||||
is a nice embedded tool for handling authentication, changing passwords,
|
||||
and similar tasks which nicely complements BusyBox.
|
||||
<p>
|
||||
|
||||
<li><a href="http://cvs.uclinux.org/uClibc.html">uClibc</a>
|
||||
is a C library for embedded systems. You can actually statically link
|
||||
a "Hello World" application under x86 that only takes 4k (as opposed to
|
||||
200k under GNU libc). It can do dynamic linking too and works nicely with
|
||||
BusyBox to create very small embedded systems.
|
||||
<p>
|
||||
|
||||
<li> <a href="http://opensource.lineo.com/software.html">Other cool embedded software</a>.
|
||||
<p>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<!-- Begin Projects section -->
|
||||
|
||||
<TR><TD BGCOLOR="#ccccc0" ALIGN=center>
|
||||
<A NAME="projects"><BIG><B>
|
||||
Products/Projects Using BusyBox
|
||||
</B></BIG></A>
|
||||
</TD></TR>
|
||||
<TR><TD BGCOLOR="#eeeee0">
|
||||
|
||||
<p> I know of the following products and/or projects that use BusyBox --
|
||||
listed in the order I happen to add them to the web page:
|
||||
|
||||
<ul>
|
||||
<li> <a href="http://cvs.debian.org/boot-floppies/">Debian installer (boot floppies) project</a>
|
||||
<li> <a href="http://redhat.com/">Red Hat 7.2 installer</a>
|
||||
<li> <a
|
||||
href="http://distro.ibiblio.org/pub/Linux/distributions/slackware/source/rootdsks/">Slackware Installer</a>
|
||||
<li> <a href="http://www.linuxrouter.org/">Linux Router Project </a>
|
||||
<li> <a href="http://linux-embedded.org/">LEM</a>
|
||||
<li> <a href="http://www.toms.net/rb/">tomsrtbt</a>
|
||||
<li> <a href="http://www.stormix.com/">Stormix Installer</a>
|
||||
<li> <a href="http://www.emacinc.com/linux2_sbc.htm">EMAC Linux 2.0 SBC</a>
|
||||
<li> <a href="http://www.trinux.org/">Trinux</a>
|
||||
<li> <a href="http://oddas.sourceforge.net/">ODDAS project</a>
|
||||
<li> <a href="http://www.kerbango.com/">The Kerbango Internet Radio</a>
|
||||
<li> <a href="http://www.linuxmagic.com/vpn/">LinuxMagic VPN Firewall</a>
|
||||
<li> <a href="http://byld.sourceforge.net/">Build Your Linux Disk</a>
|
||||
<li> <a href="http://homepages.ihug.co.nz/~ichi/baslinux.html">BasicLinux</a>
|
||||
<li> <a href="http://ibiblio.org/pub/Linux/system/recovery">Zdisk</a>
|
||||
<li> <a href="http://www.adtran.com">AdTran - VPN/firewall VPN Linux Distribution</a>
|
||||
<li> <a href="http://mkcdrec.ota.be/">mkCDrec - make CD-ROM recovery</a>
|
||||
<li> <a href="http://recycle.lbl.gov/~ldoolitt/bse/">Linux on nanoEngine</a>
|
||||
<li> <a href="http://www.zelow.no/floppyfw/"> Floppyfw</a>
|
||||
|
||||
<li> <a href="http://midori.transmeta.com/"> Midori Linux</a> - <a href=
|
||||
"http://www.wired.com/news/technology/0,1282,42399,00.html"> Article on
|
||||
Midori Linux</a> on <a href= "http://www.wired.com"> Wired</a>. Quote from
|
||||
Erik at the top of <a href=
|
||||
"http://www.wired.com/news/technology/0,1282,42399-2,00.html"> this
|
||||
page</a>
|
||||
|
||||
<li> <a href="http://www.ltsp.org/">Linux Terminal Server Project</a>
|
||||
<li> <a href="http://www.devil-linux.org/">Devil-Linux</a>
|
||||
<li> <a href="http://dutnux.sourceforge.net/">DutNux</a>
|
||||
<li> <a href="http://www.cachier.com/">Cachier</a>
|
||||
<li> <a href="http://www.microwerks.net/~hugo/mindi/">Mindi</a>
|
||||
|
||||
</ul>
|
||||
|
||||
<p> Do you use BusyBox? I'd love to know about it and I'd be happy to link to
|
||||
you.
|
||||
|
||||
|
||||
|
||||
<!-- End of Table -->
|
||||
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
|
||||
|
||||
<!-- Footer -->
|
||||
<HR>
|
||||
<TABLE WIDTH="100%">
|
||||
<TR>
|
||||
<TD>
|
||||
<font size="-1" face="arial, helvetica, sans-serif">
|
||||
Mail all comments, insults, suggestions and bribes to
|
||||
<a href="mailto:andersen@codepoet.org">Erik Andersen</a><BR>
|
||||
The Busybox logo is copyright 1999,2000,2001, Erik Andersen.
|
||||
</font>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<a href="http://www.vim.org"><img border=0 width=90 height=36
|
||||
src="images/written.in.vi.png"
|
||||
alt="This site created with the vi editor"></a>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<a href="http://www.gimp.org/"><img border=0 width=90 height=36
|
||||
src="images/gfx_by_gimp.png" alt="Graphics by GIMP"></a>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<a href="http://www.linuxtoday.com"><img width=90 height=36
|
||||
src="images/ltbutton2.png" alt="Linux Today"></a>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<p><a href="http://slashdot.org"><img width=90 height=36
|
||||
src="images/sdsmall.png" alt="Slashdot"></a>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<a href="http://freshmeat.net"><img width=90 height=36
|
||||
src="images/fm.mini.png" alt="Freshmeat"></a>
|
||||
</TD>
|
||||
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
|
||||
</CENTER>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -1,462 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>BusyBox</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<body text="#000000" alink="#660000" link="#660000" bgcolor="#dee2de" vlink="#660000">
|
||||
|
||||
<basefont face="lucida, helvetica, arial" size="3">
|
||||
|
||||
|
||||
<CENTER>
|
||||
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2>
|
||||
<TR>
|
||||
<td bgcolor="#000000">
|
||||
<FONT FACE="lucida, helvetica" COLOR="#ccccc0">
|
||||
<B>B u s y B o x</B>
|
||||
</FONT>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<a href="/"><IMG SRC="images/busybox2.jpg" alt="BusyBox" border="0" width="360" height="230"</a><BR>
|
||||
|
||||
|
||||
<TABLE WIDTH=95% CELLSPACING=1 CELLPADDING=4 BORDER=1>
|
||||
|
||||
<!-- Begin Older News section -->
|
||||
|
||||
<TR><TD BGCOLOR="#ccccc0" ALIGN=center>
|
||||
<A NAME="news">
|
||||
<BIG><B>
|
||||
Older BusyBox News</A>
|
||||
</B></BIG>
|
||||
</A>
|
||||
</TD></TR>
|
||||
<TR><TD BGCOLOR="#eeeee0">
|
||||
|
||||
<ul>
|
||||
|
||||
<p> <li> <b>Take me back to the <a href="http://busybox.lineo.com/">BusyBox</a> web site.</b>
|
||||
<hr>
|
||||
|
||||
<li> <b>10 April 2001 -- BusyBox 0.51 released</b>
|
||||
<br>
|
||||
|
||||
BusyBox 0.51 (the "rock-solid release") is now out there. This
|
||||
release adds only 2 new applets: env and vi. The vi applet,
|
||||
contributed by Sterling Huxley, is very functional, and is only
|
||||
22k. This release fixes 3 critical bugs in the 0.50 release.
|
||||
There were 2 potential segfaults in lash (the busybox shell) in
|
||||
the 0.50 release which are now fixed. Another critical bug in
|
||||
0.50 which is now fixed: syslogd from 0.50 could potentially
|
||||
deadlock the init process and thereby break your entire system.
|
||||
<p>
|
||||
|
||||
There are a number of improvements in this release as well. For
|
||||
one thing, the wget applet is greatly improved. Dmitry Zakharov
|
||||
added FTP support, and Laurence Anderson make wget fully RFC
|
||||
compliant for HTTP 1.1. The mechanism for including utility
|
||||
functions in previous releases was clumsy and error prone. Now
|
||||
all utility functions are part of a new libbb library, which makes
|
||||
maintaining utility functions much simpler. And BusyBox now
|
||||
compiles on itanium systems (thanks to the Debian itanium porters
|
||||
for letting me use their system!).
|
||||
<p>
|
||||
You can read the
|
||||
<a href="ftp://oss.lineo.com/busybox/Changelog">changelog</a> for
|
||||
complete details. BusyBox 0.51 can be downloaded from
|
||||
<a href="ftp://oss.lineo.com/busybox">ftp://oss.lineo.com/busybox</a>.
|
||||
<p>Have Fun!
|
||||
<p>
|
||||
|
||||
<li> <b>Busybox Boot-Floppy Image</b>
|
||||
|
||||
<p>Because you asked for it, we have made available a <a href=
|
||||
"ftp://oss.lineo.com/busybox/busybox.floppy.img"> Busybox boot floppy
|
||||
image</a>. Here's how you use it:
|
||||
|
||||
<ol>
|
||||
|
||||
<li> <a href= "ftp://oss.lineo.com/busybox/busybox.floppy.img">
|
||||
Download the image</a>
|
||||
|
||||
<li> dd it onto a floppy like so: <tt> dd if=busybox.floppy.img
|
||||
of=/dev/fd0 ; sync </tt>
|
||||
|
||||
<li> Pop it in a machine and boot up.
|
||||
|
||||
</ol>
|
||||
|
||||
<p> If you want to look at the contents of the initrd image, do this:
|
||||
|
||||
<pre>
|
||||
mount ./busybox.floppy.img /mnt -o loop -t msdos
|
||||
cp /mnt/initrd.gz /tmp
|
||||
umount /mnt
|
||||
gunzip /tmp/initrd.gz
|
||||
mount /tmp/initrd /mnt -o loop -t minix
|
||||
</pre>
|
||||
|
||||
|
||||
<li> <b>15 March 2001 -- BusyBox 0.50 released</b>
|
||||
<br>
|
||||
|
||||
This release adds several new applets including ifconfig, route, pivot_root, stty,
|
||||
and tftp, and also fixes tons of bugs. Tab completion in the
|
||||
shell is now working very well, and the shell's environment variable
|
||||
expansion was fixed. Tons of other things were fixed or made
|
||||
smaller. For a fairly complete overview, see the
|
||||
<a href="ftp://oss.lineo.com/busybox/Changelog">changelog</a>.
|
||||
<p>
|
||||
lash (the busybox shell) is still with us, fixed up a bit so it
|
||||
now behaves itself quite nicely. It really is quite usable as
|
||||
long as you don't expect it to provide Bourne shell grammer.
|
||||
Standard things like pipes, redirects, command line editing, and
|
||||
environment variable expansion work great. But we have found that
|
||||
this shell, while very usable, does not provide an extensible
|
||||
framework for adding in full Bourne shell behavior. So the first order of
|
||||
business as we begin working on the next BusyBox release will be to merge in the new shell
|
||||
currently in progress at
|
||||
<a href="http://doolittle.faludi.com/~larry/parser.html">Larry Doolittle's website</a>.
|
||||
<p>
|
||||
|
||||
|
||||
<li> <b>27 January 2001 -- BusyBox 0.49 released</b>
|
||||
<br>
|
||||
|
||||
Several new applets, lots of bug fixes, cleanups, and many smaller
|
||||
things made nicer. Several cleanups and improvements to the shell.
|
||||
For a list of the most interesting changes
|
||||
you might want to look at the <a href="ftp://oss.lineo.com/busybox/Changelog">changelog</a>.
|
||||
<p>
|
||||
Special thanks go out to Matt Kraai and Larry Doolittle for all their
|
||||
work on this release, and for keeping on top of things while I've been
|
||||
out of town.
|
||||
<p>
|
||||
<em>Special Note</em><br>
|
||||
|
||||
BusyBox 0.49 was supposed to have replaced lash, the BusyBox
|
||||
shell, with a new shell that understands full Bourne shell/Posix shell grammer.
|
||||
Well, that simply didn't happen in time for this release. A new
|
||||
shell that will eventually replace lash is already under
|
||||
construction. This new shell is being developed by Larry
|
||||
Doolittle, and could use all of our help. Please see the work in
|
||||
progress on <a href="http://doolittle.faludi.com/~larry/parser.html">Larry's website</a>
|
||||
and help out if you can. This shell will be included in the next
|
||||
release of BusyBox.
|
||||
<p>
|
||||
|
||||
<li> <b>13 December 2000 -- BusyBox 0.48 released</b>
|
||||
<br>
|
||||
|
||||
This release fixes lots and lots of bugs. This has had some very
|
||||
rigorous testing, and looks very, very clean. The usual tar
|
||||
update of course: tar no longer breaks hardlinks, tar -xzf is
|
||||
optionally supported, and the LRP folks will be pleased to know
|
||||
that 'tar -X' and 'tar --exclude' are both now in. Applets are
|
||||
now looked up using a binary search making lash (the busybox
|
||||
shell) much faster. For the new debian-installer (for Debian
|
||||
woody) a .udeb can now be generated.
|
||||
<p>
|
||||
The curious can get a list of some of the more interesting changes by reading
|
||||
the <a href="ftp://oss.lineo.com/busybox/Changelog">changelog</a>.
|
||||
<p>
|
||||
Many thanks go out to the many many people that have contributed to
|
||||
this release, especially Matt Kraai, Larry Doolittle, and Kent Robotti.
|
||||
<p>
|
||||
<p> <li> <b>26 September 2000 -- BusyBox 0.47 released</b>
|
||||
<br>
|
||||
|
||||
This release fixes lots of bugs (including an ugly bug in 0.46
|
||||
syslogd that could fork-bomb your system). Added several new
|
||||
apps: rdate, wget, getopt, dos2unix, unix2dos, reset, unrpm,
|
||||
renice, xargs, and expr. syslogd now supports network logging.
|
||||
There are the usual tar updates. Most apps now use getopt for
|
||||
more correct option parsing.
|
||||
See the <a href="ftp://oss.lineo.com/busybox/Changelog">changelog</a>
|
||||
for complete details.
|
||||
|
||||
|
||||
<p> <li> <b>11 July 2000 -- BusyBox 0.46 released</b>
|
||||
<br>
|
||||
|
||||
This release fixes several bugs (including a ugly bug in tar,
|
||||
and fixes for NFSv3 mount support). Added a dumpkmap to allow
|
||||
people to dump a binary keymaps for use with 'loadkmap', and a
|
||||
completely reworked 'grep' and 'sed' which should behave better.
|
||||
BusyBox shell can now also be used as a login shell.
|
||||
See the <a href="ftp://oss.lineo.com/busybox/Changelog">changelog</a>
|
||||
for complete details.
|
||||
|
||||
|
||||
<p> <li> <b>21 June 2000 -- BusyBox 0.45 released</b>
|
||||
<br>
|
||||
|
||||
This release has been slow in coming, but is very solid at this
|
||||
point. BusyBox now supports libc5 as well as GNU libc. This
|
||||
release provides the following new apps: cut, tr, insmod, ar,
|
||||
mktemp, setkeycodes, md5sum, uuencode, uudecode, which, and
|
||||
telnet. There are bug fixes for just about every app as well (see
|
||||
the <a href="ftp://oss.lineo.com/busybox/Changelog">changelog</a> for
|
||||
details).
|
||||
<p>
|
||||
Also, some exciting infrastructure news! Busybox now has its own
|
||||
<a href="http://oss.lineo.com/lists/busybox/">mailing list</a>,
|
||||
publically browsable
|
||||
<a href="http://oss.lineo.com/cgi-bin/cvsweb/busybox/">CVS tree</a>,
|
||||
anonymous
|
||||
<a href="http://oss.lineo.com/cvs_anon.html">CVS access</a>, and
|
||||
for those that are actively contributing there is even
|
||||
<a href="http://oss.lineo.com/cvs_write.html">CVS write access</a>.
|
||||
I think this will be a huge help to the ongoing development of BusyBox.
|
||||
<p>
|
||||
Also, for the curious, there is no 0.44 release. Somehow 0.44 got announced
|
||||
a few weeks ago prior to its actually being released. To avoid any confusion
|
||||
we are just skipping 0.44.
|
||||
<p>
|
||||
Many thanks go out to the many people that have contributed to this release
|
||||
of BusyBox (esp. Pavel Roskin)!
|
||||
|
||||
|
||||
<p> <li> <b>19 April 2000 -- syslogd bugfix</b>
|
||||
<br>
|
||||
Turns out that there was still a bug in busybox syslogd.
|
||||
For example, with the following test app:
|
||||
<pre>
|
||||
#include <syslog.h>
|
||||
|
||||
int do_log(char* msg, int delay)
|
||||
{
|
||||
openlog("testlog", LOG_PID, LOG_DAEMON);
|
||||
while(1) {
|
||||
syslog(LOG_ERR, "%s: testing one, two, three\n", msg);
|
||||
sleep(delay);
|
||||
}
|
||||
closelog();
|
||||
return(0);
|
||||
};
|
||||
|
||||
int main(void)
|
||||
{
|
||||
if (fork()==0)
|
||||
do_log("A", 2);
|
||||
do_log("B", 3);
|
||||
}
|
||||
</pre>
|
||||
it should be logging stuff from both "A" and "B". As released in 0.43 only stuff
|
||||
from "A" would have been logged. This means that if init tries to log something
|
||||
while say ppp has the syslog open, init would block (which is bad, bad, bad).
|
||||
<p>
|
||||
Karl M. Hegbloom has created a
|
||||
<a href="ftp://ftp.lineo.com/pub/busybox/busybox-0.43-syslog_patch">fix for the problem</a>.
|
||||
Thanks Karl!
|
||||
|
||||
|
||||
<p> <li> <b>18 April 2000 -- BusyBox 0.43 released (finally!)</b>
|
||||
<br>
|
||||
I have finally gotten everything into a state where I feel pretty
|
||||
good about things. This is definitely the most stable, solid release
|
||||
so far. A lot of bugs have been fixed, and the following new apps
|
||||
have been added: sh, basename, dirname, killall, uptime,
|
||||
freeramdisk, tr, echo, test, and usleep. Tar has been completely
|
||||
rewritten from scratch. Bss size has also been greatly reduced.
|
||||
More details are available in the
|
||||
<a href="ftp://ftp.lineo.com/pub/busybox/Changelog">changelog</a>.
|
||||
Oh, and as a special bonus, I wrote some fairly comprehensive
|
||||
<em>documentation</em>, complete with examples and full usage information.
|
||||
|
||||
<p>
|
||||
Many thanks go out to the fine people that have helped by submitting patches
|
||||
and bug reports; particularly instrumental in helping for this release were
|
||||
Karl Hegbloom, Pavel Roskin, Friedrich Vedder, Emanuele Caratti,
|
||||
Bob Tinsley, Nicolas Pitre, Avery Pennarun, Arne Bernin, John Beppu, and Jim Gleason.
|
||||
There were others so if I somehow forgot to mention you, I'm very sorry.
|
||||
<p>
|
||||
|
||||
You can grab BusyBox 0.43 tarballs <a href="ftp://ftp.lineo.com/pub/busybox/">here</a>.
|
||||
|
||||
<p> <li> <b>9 April 2000 -- BusyBox 0.43 pre release</b>
|
||||
<br>
|
||||
Unfortunately, I have not yet finished all the things I want to
|
||||
do for BusyBox 0.43, so I am posting this pre-release for people
|
||||
to poke at. This contains my complete rewrite of tar, which now weighs in at
|
||||
5k (7k with all options turned on) and works for reading and writing
|
||||
tarballs (which it does correctly for everything I have been able to throw
|
||||
at it). Tar also (optionally) supports the "--exclude" option (mainly because
|
||||
the Linux Router Project folks asked for it). This also has a pre-release
|
||||
of the micro shell I have been writing. This pre-release should be stable
|
||||
enough for production use -- it just isn't a release since I have some structural
|
||||
changes I still want to make.
|
||||
<p>
|
||||
The pre-release can be found <a href="ftp://ftp.lineo.com/pub/busybox/">here</a>.
|
||||
Please let me know ASAP if you find <em>any</em> bugs.
|
||||
|
||||
<p> <li> <b>28 March 2000 -- Andersen Baby Boy release</b>
|
||||
<br>
|
||||
I am pleased to announce that on Tuesday March 28th at 5:48pm, weighing in at 7
|
||||
lbs. 12 oz, Micah Erik Andersen was born at LDS Hospital here in Salt Lake City.
|
||||
He was born in the emergency room less then 5 minutes after we arrived -- and
|
||||
it was such a relief that we even made it to the hospital at all. Despite the
|
||||
fact that I was driving at an amazingly unlawful speed and honking at everybody
|
||||
and thinking decidedly unkind thoughts about the people in our way, my wife
|
||||
(inconsiderate of my feelings and complete lack of medical training) was lying
|
||||
down in the back seat saying things like "I think I need to start pushing now"
|
||||
(which she then proceeded to do despite my best encouraging statements to the
|
||||
contrary).
|
||||
<p>
|
||||
Anyway, I'm glad to note that despite the much-faster-than-we-were-expecting
|
||||
labor, both Shaunalei and our new baby boy are doing wonderfully.
|
||||
<p>
|
||||
So now that I am done with my excuse for the slow release cycle...
|
||||
Progress on the next release of BusyBox has been slow but steady. I expect
|
||||
to have a release sometime during the first week of April. This release will
|
||||
include a number of important changes, including the addition of a shell, a
|
||||
re-write of tar (to accommodate the Linux Router Project), and syslogd can now
|
||||
accept multiple concurrent connections, fixing lots of unexpected blocking
|
||||
problems.
|
||||
|
||||
|
||||
<p> <li> <b>11 February 2000 -- BusyBox 0.42 released</b>
|
||||
<br>
|
||||
|
||||
This is the most solid BusyBox release so far. Many, many
|
||||
bugs have been fixed. See the
|
||||
<a href="ftp://ftp.lineo.com/pub/busybox/Changelog">changelog</a> for details.
|
||||
|
||||
Of particular interest, init will now cleanly unmount
|
||||
filesystems on reboot, cp and mv have been rewritten and
|
||||
behave much better, and mount and umount no longer leak
|
||||
loop devices. Many thanks go out to Randolph Chung,
|
||||
Karl M. Hegbloom, Taketoshi Sano, and Pavel Roskin for
|
||||
their hard work on this release of BusyBox. Please pound
|
||||
on it and let me know if you find any bugs.
|
||||
|
||||
<p> <li> <b>19 January 2000 -- BusyBox 0.41 released</b>
|
||||
<br>
|
||||
|
||||
This release includes bugfixes to cp, mv, logger, true, false,
|
||||
mkdir, syslogd, and init. New apps include wc, hostid,
|
||||
logname, tty, whoami, and yes. New features include loop device
|
||||
support in mount and umount, and better TERM handling by init.
|
||||
The changelog can be found <a href="ftp://ftp.lineo.com/pub/busybox/Changelog">here</a>.
|
||||
|
||||
<p> <li> <b>7 January 2000 -- BusyBox 0.40 released</b>
|
||||
<br>
|
||||
|
||||
This release includes bugfixes to init (now includes inittab support),
|
||||
syslogd, head, logger, du, grep, cp, mv, sed, dmesg, ls, kill, gunzip, and mknod.
|
||||
New apps include sort, uniq, lsmod, rmmod, fbset, and loadacm.
|
||||
In particular, this release fixes an important bug in tar which
|
||||
in some cases produced serious security problems.
|
||||
As always, the changelog can be found <a href="ftp://ftp.lineo.com/pub/busybox/Changelog">here</a>.
|
||||
|
||||
<p> <li> <b>11 December 1999 -- BusyBox Website</b>
|
||||
<br>
|
||||
I have received permission from Bruce Perens (the original author of BusyBox)
|
||||
to set up this site as the new primary website for BusyBox. This website
|
||||
will always contain pointers to the latest and greatest, and will also
|
||||
contain the latest documentation on how to use BusyBox, what it can do,
|
||||
what arguments its apps support, etc.
|
||||
|
||||
<p> <li> <b>10 December 1999 -- BusyBox 0.39 released</b>
|
||||
<br>
|
||||
This release includes fixes to init, reboot, halt, kill, and ls, and contains
|
||||
the new apps ping, hostname, mkfifo, free, tail, du, tee, and head. A full
|
||||
changelog can be found <a href="ftp://ftp.lineo.com/pub/busybox/Changelog">here</a>.
|
||||
<p> <li> <b>5 December 1999 -- BusyBox 0.38 released</b>
|
||||
<br>
|
||||
This release includes fixes to tar, cat, ls, dd, rm, umount, find, df,
|
||||
and make install, and includes new apps syslogd/klogd and logger.
|
||||
</ul>
|
||||
|
||||
|
||||
<!-- Begin Links section -->
|
||||
|
||||
<TR><TD BGCOLOR="#ccccc0" ALIGN=center>
|
||||
<A NAME="links">
|
||||
<BIG><B>
|
||||
Important Links</A>
|
||||
</B></BIG>
|
||||
</A>
|
||||
</TD></TR>
|
||||
<TR><TD BGCOLOR="#eeeee0">
|
||||
|
||||
<ul>
|
||||
|
||||
<li> <a href="http://busybox.lineo.com/">Take me back to http://busybox.lineo.com/</a>.
|
||||
<p>
|
||||
|
||||
<li> <A HREF="http://perens.com/FreeSoftware/">
|
||||
Free Software from Bruce Perens</A><br>
|
||||
The original idea for BusyBox, and all versions up to 0.26 were written
|
||||
by <A HREF="mailto:bruce@perens.com">Bruce Perens</a>. This is his BusyBox website.
|
||||
<p>
|
||||
|
||||
<li> <A HREF="http://freshmeat.net/appindex/1999/04/11/923859921.html">
|
||||
Freshmeat AppIndex record for BusyBox</A>
|
||||
<p>
|
||||
|
||||
<li> <a href="http://oss.lineo.com/software.html">Cool embedded software</a>.
|
||||
<p>
|
||||
|
||||
<li> <a href="http://oss.lineo.com/">oss.lineo.com</a>.
|
||||
<p>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<!-- End of Table -->
|
||||
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
</P>
|
||||
|
||||
|
||||
|
||||
<!-- Footer -->
|
||||
<HR>
|
||||
<TABLE WIDTH="100%">
|
||||
<TR>
|
||||
<TD>
|
||||
<font size="-1" face="arial, helvetica, sans-serif">
|
||||
Mail all comments, insults, suggestions and bribes to
|
||||
<a href="mailto:andersen@codepoet.org">Erik Andersen</a><BR>
|
||||
The Busybox logo is copyright 1999,2000,2001 Erik Andersen.
|
||||
</font>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<a href="http://www.vim.org"><img border=0 width=88 height=32
|
||||
src="images/anim.written.in.vi.gif"
|
||||
alt="This site created with the vi editor"></a>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<a href="http://www.gimp.org/"><img border=0 width=88 height=38
|
||||
src="images/gfx_by_gimp.gif" alt="Graphics by GIMP"></a>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<a href="http://www.linuxtoday.com"><img width=90 height=36
|
||||
src="images/ltbutton2.jpg" alt="Linux Today"></a>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<p><a href="http://slashdot.org"><img width=90 height=36
|
||||
src="images/sdsmall.gif" alt="Slashdot"></a>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<a href="http://freshmeat.net"><img width=90 height=36
|
||||
src="images/fm.mini.jpg" alt="Freshmeat"></a>
|
||||
</TD>
|
||||
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
<title> Busybox Screenshot! </title>
|
||||
|
||||
<meta name="Author" content="Mark Whitley">
|
||||
<meta name="Description" content="A screenshot of Busybox">
|
||||
|
||||
</head>
|
||||
|
||||
<body text="#000000" alink="#660000" link="#660000" bgcolor="#dee2de" vlink="#660000">
|
||||
|
||||
<h1> Busybox Screenshot! </h1>
|
||||
|
||||
<TABLE WIDTH="80%" CELLSPACING=1 CELLPADDING=4 BORDER=1>
|
||||
<TR><TD BGCOLOR="#000000">
|
||||
|
||||
|
||||
<pre style="background-color: black; color: lightgreen; padding: 5px;
|
||||
font-family: monospace; font-size: smaller;" width="80%">
|
||||
|
||||
|
||||
$ ./busybox
|
||||
BusyBox v0.49 (2001.01.30-17:35+0000) multi-call binary -- GPL2
|
||||
|
||||
Usage: busybox [function] [arguments]...
|
||||
or: [function] [arguments]...
|
||||
|
||||
BusyBox is a multi-call binary that combines many common Unix
|
||||
utilities into a single executable. Most people will create a
|
||||
link to busybox for each function they wish to use, and BusyBox
|
||||
will act like whatever it was invoked as.
|
||||
|
||||
Currently defined functions:
|
||||
basename, busybox, cat, chgrp, chmod, chown, chroot, chvt, clear,
|
||||
cp, cut, date, dd, df, dirname, dmesg, du, echo, false, find,
|
||||
free, grep, gunzip, gzip, halt, head, id, init, kill, killall,
|
||||
ln, logger, ls, lsmod, mkdir, mknod, mkswap, more, mount, mv,
|
||||
poweroff, ps, pwd, reboot, reset, rm, rmdir, sed, sh, sleep, sort,
|
||||
swapoff, swapon, sync, syslogd, tail, tar, touch, true, tty, umount,
|
||||
uname, uniq, uptime, wc, which, whoami, xargs, yes, zcat
|
||||
|
||||
$ <blink>_</blink>
|
||||
|
||||
</pre>
|
||||
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
loadacm, loadfont, loadkmap, logger, logname, ls, lsmod,
|
||||
makedevs, mkdir, mkfifo, mkfs.minix, mknod, mkswap, mktemp,
|
||||
more, mount, mt, mv, nc, nslookup, ping, poweroff, printf, ps,
|
||||
pwd, reboot, renice, reset, rm, rmdir, rmmod, run-parts, sed, setkeycodes, sh, sleep,
|
||||
pwd, reboot, renice, reset, rm, rmdir, rmmod, sed, setkeycodes, sh, sleep,
|
||||
sort, swapoff, swapon, sync, syslogd, tail, tar, tee, telnet,
|
||||
test, touch, tr, true, tty, umount, uname, uniq, update,
|
||||
uptime, usleep, uudecode, uuencode, wc, which, whoami, yes,
|
||||
@@ -2799,33 +2799,6 @@
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="run-parts">
|
||||
<title>run-parts</title>
|
||||
|
||||
<para>
|
||||
Usage: run-parts [-t] [-a ARG] [-u MASK] DIRECTORY
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Run a bunch of scripts in a directory.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Options:
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<screen>
|
||||
-t Test only. It only print the file to be executed,
|
||||
without execute them.
|
||||
-a ARG Pass ARG as an a argument to the programs executed.
|
||||
-u MASK Set the umask to MASK before executing the programs.
|
||||
</screen>
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
|
||||
|
||||
<sect1 id="sed">
|
||||
<title>sed</title>
|
||||
|
||||
@@ -3908,7 +3881,7 @@
|
||||
<title>MAINTAINER</title>
|
||||
|
||||
<para>
|
||||
Erik Andersen <andersee@debian.org> <andersen@lineo.com>
|
||||
Erik Andersen <andersee@debian.org> <andersen@codepoet.org>
|
||||
</para>
|
||||
</chapter>
|
||||
|
||||
@@ -3929,7 +3902,7 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
John Beppu <beppu@lineo.com>
|
||||
John Beppu <beppu@codepoet.org>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -3985,7 +3958,7 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Mark Whitley <markw@lineo.com>
|
||||
Mark Whitley <markw@codepoet.org>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
||||
@@ -20,7 +20,7 @@ textutils(1), shellutils(1), etc...
|
||||
|
||||
=head1 MAINTAINER
|
||||
|
||||
Erik Andersen <andersee@debian.org> <andersen@lineo.com>
|
||||
Erik Andersen <andersee@debian.org> <andersen@codepoet.org>
|
||||
|
||||
=head1 AUTHORS
|
||||
|
||||
@@ -30,14 +30,14 @@ they know it or not.
|
||||
|
||||
=for html <br>
|
||||
|
||||
Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
|
||||
Erik Andersen <andersee@debian.org> <andersen@codepoet.org>
|
||||
|
||||
Tons of new stuff, major rewrite of most of the
|
||||
core apps, tons of new apps as noted in header files.
|
||||
|
||||
=for html <br>
|
||||
|
||||
John Beppu <beppu@lineo.com>
|
||||
John Beppu <beppu@codepoet.org>
|
||||
|
||||
du, head, nslookup, sort, tee, uniq (so Kraai could rewrite them ;-),
|
||||
documentation
|
||||
@@ -148,7 +148,7 @@ Linus Torvalds <torvalds@transmeta.com>
|
||||
|
||||
=for html <br>
|
||||
|
||||
Mark Whitley <markw@lineo.com>
|
||||
Mark Whitley <markw@codepoet.org>
|
||||
|
||||
sed remix, bug fixes, style-guide, etc.
|
||||
|
||||
@@ -166,4 +166,4 @@ Enrique Zanardi <ezanardi@ull.es>
|
||||
|
||||
=cut
|
||||
|
||||
# $Id: busybox_footer.pod,v 1.4 2001/04/17 17:09:34 beppu Exp $
|
||||
# $Id: busybox_footer.pod,v 1.5 2001/11/19 23:57:54 andersen Exp $
|
||||
@@ -43,7 +43,7 @@ know.
|
||||
|
||||
Archives can be found here:
|
||||
|
||||
http://opensource.lineo.com/lists/busybox/
|
||||
http://oss.lineo.com/lists/busybox/
|
||||
|
||||
If you have a serious interest in Busybox, i.e., you are using it day-to-day or
|
||||
as part of an embedded project, it would be a good idea to join the mailing
|
||||
@@ -51,7 +51,7 @@ list.
|
||||
|
||||
A web-based sign-up form can be found here:
|
||||
|
||||
http://opensource.lineo.com/mailman/listinfo/busybox
|
||||
http://oss.lineo.com/mailman/listinfo/busybox
|
||||
|
||||
|
||||
Coordinate with the Applet Maintainer
|
||||
|
||||
@@ -109,7 +109,7 @@ order, or else it will break the binary-search lookup algorithm in busybox.c
|
||||
and the Gods of BusyBox smite you. Yea, verily:
|
||||
|
||||
/* all programs above here are alphabetically "less than" 'mu' */
|
||||
#ifdef CONFIG_MU
|
||||
#ifdef BB_MU
|
||||
APPLET("mu", mu_main, _BB_DIR_USR_BIN, mu_usage)
|
||||
#endif
|
||||
/* all programs below here are alphabetically "greater than" 'mu' */
|
||||
@@ -117,7 +117,7 @@ and the Gods of BusyBox smite you. Yea, verily:
|
||||
|
||||
Finally, add a define for your applet to Config.h:
|
||||
|
||||
#define CONFIG_MU
|
||||
#define BB_MU
|
||||
|
||||
|
||||
Documentation
|
||||
@@ -132,7 +132,7 @@ The Grand Announcement
|
||||
|
||||
Then create a diff -urN of the files you added (<applet>.c, usage.c,
|
||||
applets.h, Config.h) and send it to the mailing list:
|
||||
busybox@opensource.lineo.com. Sending patches as attachments is preferred, but
|
||||
busybox@oss.lineo.com. Sending patches as attachments is preferred, but
|
||||
not required.
|
||||
|
||||
|
||||
@@ -252,7 +252,7 @@ files, you can do the following in the busybox directory:
|
||||
If you want to convert all the non-K&R vars in your file all at once, follow
|
||||
these steps:
|
||||
|
||||
- In the busybox directory type 'examples/mk2knr.pl files-to-convert'. This
|
||||
- In the busybox directory type 'scripts/mk2knr.pl files-to-convert'. This
|
||||
does not do the actual conversion, rather, it generates a script called
|
||||
'convertme.pl' that shows what will be converted, giving you a chance to
|
||||
review the changes beforehand.
|
||||
@@ -269,7 +269,7 @@ these steps:
|
||||
|
||||
Please be aware of changes that have cascading effects into other files. For
|
||||
example, if you're changing the name of something in, say utility.c, you
|
||||
should probably run 'examples/mk2knr.pl utility.c' at first, but when you run
|
||||
should probably run 'scripts/mk2knr.pl utility.c' at first, but when you run
|
||||
the 'convertme.pl' script you should run it on _all_ files like so:
|
||||
'./convertme.pl *.[ch]'.
|
||||
|
||||
@@ -343,7 +343,7 @@ used in the code.
|
||||
ret = my_func(bar, baz);
|
||||
if (!ret)
|
||||
return -1;
|
||||
#ifdef CONFIG_FEATURE_FUNKY
|
||||
#ifdef BB_FEATURE_FUNKY
|
||||
maybe_do_funky_stuff(bar, baz);
|
||||
#endif
|
||||
|
||||
@@ -351,7 +351,7 @@ used in the code.
|
||||
|
||||
(in .h header file)
|
||||
|
||||
#ifdef CONFIG_FEATURE_FUNKY
|
||||
#ifdef BB_FEATURE_FUNKY
|
||||
static inline void maybe_do_funky_stuff (int bar, int baz)
|
||||
{
|
||||
/* lotsa code in here */
|
||||
@@ -487,7 +487,7 @@ very limited stack space (e.g., uCLinux).
|
||||
A macro is declared in busybox.h that implements compile-time selection
|
||||
between xmalloc() and stack creation, so you can code the line in question as
|
||||
|
||||
RESERVE_CONFIG_BUFFER(buffer, BUFSIZ);
|
||||
RESERVE_BB_BUFFER(buffer, BUFSIZ);
|
||||
|
||||
and the right thing will happen, based on your configuration.
|
||||
|
||||
|
||||
@@ -30,11 +30,14 @@
|
||||
#include <string.h>
|
||||
#include <getopt.h>
|
||||
#include <unistd.h>
|
||||
#if (__GNU_LIBRARY__ > 5)
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#include <sys/time.h>
|
||||
#include "busybox.h"
|
||||
|
||||
|
||||
/* We are making a lame pseudo-random string generator here. in
|
||||
* convert(), each pass through the while loop will add more and more
|
||||
* stuff into value, which is _supposed_ to wrap. We don't care about
|
||||
@@ -58,7 +61,7 @@ static int convert(char *fn, int ConvType)
|
||||
if ((in = wfopen(fn, "rw")) == NULL) {
|
||||
return -1;
|
||||
}
|
||||
strcpy(tempFn, fn);
|
||||
safe_strncpy(tempFn, fn, sizeof(tempFn));
|
||||
c = strlen(tempFn);
|
||||
tempFn[c] = '.';
|
||||
while(1) {
|
||||
@@ -2,7 +2,6 @@
|
||||
* Mini dpkg implementation for busybox.
|
||||
* This is not meant as a replacemnt for dpkg
|
||||
*
|
||||
* Written By Glenn McGrath with the help of others
|
||||
* Copyright (C) 2001 by Glenn McGrath
|
||||
*
|
||||
* Started life as a busybox implementation of udpkg
|
||||
@@ -42,7 +41,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include "unarchive.h"
|
||||
#include "busybox.h"
|
||||
|
||||
/* NOTE: If you vary HASH_PRIME sizes be aware,
|
||||
@@ -219,7 +217,7 @@ int version_compare_part(const char *version1, const char *version2)
|
||||
if (version1 == NULL) {
|
||||
version1 = xstrdup("");
|
||||
}
|
||||
if (version2 == NULL) {
|
||||
if (version2 != NULL) {
|
||||
version2 = xstrdup("");
|
||||
}
|
||||
upstream_len1 = strlen(version1);
|
||||
@@ -507,59 +505,60 @@ unsigned int fill_package_struct(char *control_buffer)
|
||||
{
|
||||
common_node_t *new_node = (common_node_t *) xcalloc(1, sizeof(common_node_t));
|
||||
|
||||
char *field_name;
|
||||
char *field_value;
|
||||
char **field_name = xmalloc(sizeof(char *));
|
||||
char **field_value = xmalloc(sizeof(char *));
|
||||
int field_start = 0;
|
||||
int num = -1;
|
||||
int buffer_length = strlen(control_buffer);
|
||||
|
||||
new_node->version = search_name_hashtable("unknown");
|
||||
while (field_start < buffer_length) {
|
||||
field_start += read_package_field(&control_buffer[field_start],
|
||||
&field_name, &field_value);
|
||||
field_start += read_package_field(&control_buffer[field_start], field_name, field_value);
|
||||
|
||||
if (field_name == NULL) {
|
||||
if (*field_name == NULL) {
|
||||
goto fill_package_struct_cleanup; // Oh no, the dreaded goto statement !!
|
||||
}
|
||||
|
||||
if (strcmp(field_name, "Package") == 0) {
|
||||
new_node->name = search_name_hashtable(field_value);
|
||||
if (strcmp(*field_name, "Package") == 0) {
|
||||
new_node->name = search_name_hashtable(*field_value);
|
||||
}
|
||||
else if (strcmp(field_name, "Version") == 0) {
|
||||
new_node->version = search_name_hashtable(field_value);
|
||||
else if (strcmp(*field_name, "Version") == 0) {
|
||||
new_node->version = search_name_hashtable(*field_value);
|
||||
}
|
||||
else if (strcmp(field_name, "Pre-Depends") == 0) {
|
||||
add_split_dependencies(new_node, field_value, EDGE_PRE_DEPENDS);
|
||||
else if (strcmp(*field_name, "Pre-Depends") == 0) {
|
||||
add_split_dependencies(new_node, *field_value, EDGE_PRE_DEPENDS);
|
||||
}
|
||||
else if (strcmp(field_name, "Depends") == 0) {
|
||||
add_split_dependencies(new_node, field_value, EDGE_DEPENDS);
|
||||
else if (strcmp(*field_name, "Depends") == 0) {
|
||||
add_split_dependencies(new_node, *field_value, EDGE_DEPENDS);
|
||||
}
|
||||
else if (strcmp(field_name, "Replaces") == 0) {
|
||||
add_split_dependencies(new_node, field_value, EDGE_REPLACES);
|
||||
else if (strcmp(*field_name, "Replaces") == 0) {
|
||||
add_split_dependencies(new_node, *field_value, EDGE_REPLACES);
|
||||
}
|
||||
else if (strcmp(field_name, "Provides") == 0) {
|
||||
add_split_dependencies(new_node, field_value, EDGE_PROVIDES);
|
||||
else if (strcmp(*field_name, "Provides") == 0) {
|
||||
add_split_dependencies(new_node, *field_value, EDGE_PROVIDES);
|
||||
}
|
||||
else if (strcmp(field_name, "Conflicts") == 0) {
|
||||
add_split_dependencies(new_node, field_value, EDGE_CONFLICTS);
|
||||
else if (strcmp(*field_name, "Conflicts") == 0) {
|
||||
add_split_dependencies(new_node, *field_value, EDGE_CONFLICTS);
|
||||
}
|
||||
else if (strcmp(field_name, "Suggests") == 0) {
|
||||
add_split_dependencies(new_node, field_value, EDGE_SUGGESTS);
|
||||
else if (strcmp(*field_name, "Suggests") == 0) {
|
||||
add_split_dependencies(new_node, *field_value, EDGE_SUGGESTS);
|
||||
}
|
||||
else if (strcmp(field_name, "Recommends") == 0) {
|
||||
add_split_dependencies(new_node, field_value, EDGE_RECOMMENDS);
|
||||
else if (strcmp(*field_name, "Recommends") == 0) {
|
||||
add_split_dependencies(new_node, *field_value, EDGE_RECOMMENDS);
|
||||
}
|
||||
else if (strcmp(field_name, "Enhances") == 0) {
|
||||
add_split_dependencies(new_node, field_value, EDGE_ENHANCES);
|
||||
else if (strcmp(*field_name, "Enhances") == 0) {
|
||||
add_split_dependencies(new_node, *field_value, EDGE_ENHANCES);
|
||||
}
|
||||
fill_package_struct_cleanup:
|
||||
if (field_name) {
|
||||
free(field_name);
|
||||
if (*field_name) {
|
||||
free(*field_name);
|
||||
}
|
||||
if (field_value) {
|
||||
free(field_value);
|
||||
if (*field_value) {
|
||||
free(*field_value);
|
||||
}
|
||||
}
|
||||
free(field_name);
|
||||
free(field_value);
|
||||
|
||||
if (new_node->version == search_name_hashtable("unknown")) {
|
||||
free_package(new_node);
|
||||
@@ -770,11 +769,7 @@ void write_status_file(deb_file_t **deb_file)
|
||||
|
||||
/* Update previously known packages */
|
||||
while ((control_buffer = fgets_str(old_status_file, "\n\n")) != NULL) {
|
||||
if ((tmp_string = strstr(control_buffer, "Package:")) == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
tmp_string += 8;
|
||||
tmp_string = strstr(control_buffer, "Package:") + 8;
|
||||
tmp_string += strspn(tmp_string, " \n\t");
|
||||
package_name = xstrndup(tmp_string, strcspn(tmp_string, "\n\0"));
|
||||
write_flag = FALSE;
|
||||
@@ -1041,17 +1036,17 @@ char **create_list(const char *filename)
|
||||
return(file_list);
|
||||
}
|
||||
while (getline(&line, &length, list_stream) != -1) {
|
||||
/* +2 as we need to include space for the terminating NULL pointer */
|
||||
file_list = xrealloc(file_list, sizeof(char *) * (length + 2));
|
||||
file_list = xrealloc(file_list, sizeof(char *) * (length + 1));
|
||||
last_char = last_char_is(line, '\n');
|
||||
if (last_char) {
|
||||
*last_char = '\0';
|
||||
}
|
||||
file_list[count] = xstrdup(line);
|
||||
free(line);
|
||||
count++;
|
||||
length = 0;
|
||||
}
|
||||
fclose(list_stream);
|
||||
free(line);
|
||||
|
||||
if (count == 0) {
|
||||
return(NULL);
|
||||
@@ -1104,19 +1099,18 @@ int run_package_script(const char *package_name, const char *script_type)
|
||||
{
|
||||
struct stat path_stat;
|
||||
char *script_path;
|
||||
int result;
|
||||
|
||||
script_path = xmalloc(strlen(package_name) + strlen(script_type) + 21);
|
||||
sprintf(script_path, "/var/lib/dpkg/info/%s.%s", package_name, script_type);
|
||||
|
||||
/* If the file doesnt exist is isnt a fatal */
|
||||
if (lstat(script_path, &path_stat) < 0) {
|
||||
result = EXIT_SUCCESS;
|
||||
free(script_path);
|
||||
return(EXIT_SUCCESS);
|
||||
} else {
|
||||
result = system(script_path);
|
||||
free(script_path);
|
||||
return(system(script_path));
|
||||
}
|
||||
free(script_path);
|
||||
return(result);
|
||||
}
|
||||
|
||||
void all_control_list(char **remove_files, const char *package_name)
|
||||
@@ -1133,48 +1127,6 @@ void all_control_list(char **remove_files, const char *package_name)
|
||||
remove_files[10] = NULL;
|
||||
}
|
||||
|
||||
|
||||
/* This function lists information on the installed packages. It loops through
|
||||
* the status_hashtable to retrieve the info. This results in smaller code than
|
||||
* scanning the status file. The resulting list, however, is unsorted.
|
||||
*/
|
||||
void list_packages(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
printf(" Name Version\n");
|
||||
printf("+++-==============-==============\n");
|
||||
|
||||
/* go through status hash, dereference package hash and finally strings */
|
||||
for (i=0; i<STATUS_HASH_PRIME+1; i++) {
|
||||
|
||||
if (status_hashtable[i]) {
|
||||
const char *stat_str; /* status string */
|
||||
const char *name_str; /* package name */
|
||||
const char *vers_str; /* version */
|
||||
char s1, s2; /* status abbreviations */
|
||||
int spccnt; /* space count */
|
||||
int j;
|
||||
|
||||
stat_str = name_hashtable[status_hashtable[i]->status];
|
||||
name_str = name_hashtable[package_hashtable[status_hashtable[i]->package]->name];
|
||||
vers_str = name_hashtable[package_hashtable[status_hashtable[i]->package]->version];
|
||||
|
||||
/* get abbreviation for status field 1 */
|
||||
s1 = stat_str[0] == 'i' ? 'i' : 'r';
|
||||
|
||||
/* get abbreviation for status field 2 */
|
||||
for (j=0, spccnt=0; stat_str[j] && spccnt<2; j++) {
|
||||
if (stat_str[j] == ' ') spccnt++;
|
||||
}
|
||||
s2 = stat_str[j];
|
||||
|
||||
/* print out the line formatted like Debian dpkg */
|
||||
printf("%c%c %-14s %s\n", s1, s2, name_str, vers_str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void remove_package(const unsigned int package_num)
|
||||
{
|
||||
const char *package_name = name_hashtable[package_hashtable[package_num]->name];
|
||||
@@ -1234,7 +1186,7 @@ void purge_package(const unsigned int package_num)
|
||||
char list_name[strlen(package_name) + 25];
|
||||
|
||||
/* run prerm script */
|
||||
if (run_package_script(package_name, "prerm") != 0) {
|
||||
if (run_package_script(package_name, "prerm") == -1) {
|
||||
error_msg_and_die("script failed, prerm failure");
|
||||
}
|
||||
|
||||
@@ -1267,7 +1219,7 @@ void unpack_package(deb_file_t *deb_file)
|
||||
{
|
||||
const char *package_name = name_hashtable[package_hashtable[deb_file->package]->name];
|
||||
const unsigned int status_num = search_status_hashtable(package_name);
|
||||
const unsigned int status_package_num = status_hashtable[status_num]->package;
|
||||
const unsigned int status_package_num = status_hashtable[status_num]->status;
|
||||
|
||||
FILE *out_stream;
|
||||
char *info_prefix;
|
||||
@@ -1286,21 +1238,15 @@ void unpack_package(deb_file_t *deb_file)
|
||||
/* Extract control.tar.gz to /var/lib/dpkg/info/<package>.filename */
|
||||
info_prefix = (char *) xmalloc(sizeof(package_name) + 20 + 4 + 1);
|
||||
sprintf(info_prefix, "/var/lib/dpkg/info/%s.", package_name);
|
||||
deb_extract(deb_file->filename, stdout, (extract_quiet | extract_control_tar_gz | extract_all_to_fs | extract_unconditional), info_prefix, NULL);
|
||||
|
||||
/* Run the preinst prior to extracting */
|
||||
if (run_package_script(package_name, "preinst") != 0) {
|
||||
/* when preinst returns exit code != 0 then quit installation process */
|
||||
error_msg_and_die("subprocess pre-installation script returned error.");
|
||||
}
|
||||
deb_extract(deb_file->filename, stdout, (extract_quiet | extract_control_tar_gz | extract_all_to_fs), info_prefix, NULL);
|
||||
|
||||
/* Extract data.tar.gz to the root directory */
|
||||
deb_extract(deb_file->filename, stdout, (extract_quiet | extract_data_tar_gz | extract_all_to_fs | extract_unconditional), "/", NULL);
|
||||
deb_extract(deb_file->filename, stdout, (extract_quiet | extract_data_tar_gz | extract_all_to_fs), "/", NULL);
|
||||
|
||||
/* Create the list file */
|
||||
strcat(info_prefix, "list");
|
||||
out_stream = xfopen(info_prefix, "w");
|
||||
deb_extract(deb_file->filename, out_stream, (extract_quiet | extract_data_tar_gz | extract_list), "/", NULL);
|
||||
deb_extract(deb_file->filename, out_stream, (extract_quiet | extract_data_tar_gz | extract_list), NULL, NULL);
|
||||
fclose(out_stream);
|
||||
|
||||
/* change status */
|
||||
@@ -1315,11 +1261,13 @@ void configure_package(deb_file_t *deb_file)
|
||||
const char *package_name = name_hashtable[package_hashtable[deb_file->package]->name];
|
||||
const char *package_version = name_hashtable[package_hashtable[deb_file->package]->version];
|
||||
const int status_num = search_status_hashtable(package_name);
|
||||
int return_value;
|
||||
|
||||
printf("Setting up %s (%s)\n", package_name, package_version);
|
||||
|
||||
/* Run the postinst script */
|
||||
if (run_package_script(package_name, "postinst") != 0) {
|
||||
/* Run the preinst prior to extracting */
|
||||
return_value = run_package_script(package_name, "postinst");
|
||||
if (return_value == -1) {
|
||||
/* TODO: handle failure gracefully */
|
||||
error_msg_and_die("postrm failure.. set status to what?");
|
||||
}
|
||||
@@ -1332,7 +1280,7 @@ extern int dpkg_main(int argc, char **argv)
|
||||
{
|
||||
deb_file_t **deb_file = NULL;
|
||||
status_node_t *status_node;
|
||||
int opt;
|
||||
int opt = 0;
|
||||
int package_num;
|
||||
int dpkg_opt = 0;
|
||||
int deb_count = 0;
|
||||
@@ -1356,7 +1304,6 @@ extern int dpkg_main(int argc, char **argv)
|
||||
break;
|
||||
case 'l':
|
||||
dpkg_opt |= dpkg_opt_list_installed;
|
||||
break;
|
||||
case 'P':
|
||||
dpkg_opt |= dpkg_opt_purge;
|
||||
dpkg_opt |= dpkg_opt_package_name;
|
||||
@@ -1373,20 +1320,14 @@ extern int dpkg_main(int argc, char **argv)
|
||||
show_usage();
|
||||
}
|
||||
}
|
||||
/* check for non-otion argument if expected */
|
||||
if ((dpkg_opt == 0) || ((argc == optind) && !(dpkg_opt && dpkg_opt_list_installed))) {
|
||||
show_usage();
|
||||
}
|
||||
|
||||
/* puts("(Reading database ... xxxxx files and directories installed.)"); */
|
||||
if ((argc == optind) || (dpkg_opt == 0)) {
|
||||
show_usage();
|
||||
}
|
||||
|
||||
puts("(Reading database ... xxxxx files and directories installed.)");
|
||||
index_status_file("/var/lib/dpkg/status");
|
||||
|
||||
/* if the list action was given print the installed packages and exit */
|
||||
if (dpkg_opt & dpkg_opt_list_installed) {
|
||||
list_packages();
|
||||
return(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/* Read arguments and store relevant info in structs */
|
||||
deb_file = xmalloc(sizeof(deb_file_t));
|
||||
while (optind < argc) {
|
||||
@@ -1408,19 +1349,12 @@ extern int dpkg_main(int argc, char **argv)
|
||||
if ((dpkg_opt & dpkg_opt_unpack) || (dpkg_opt & dpkg_opt_install)) {
|
||||
status_node = (status_node_t *) xmalloc(sizeof(status_node_t));
|
||||
status_node->package = deb_file[deb_count]->package;
|
||||
/* use reinstreq isnt changed to "ok" until the package control info
|
||||
* is written to the status file*/
|
||||
status_node->status = search_name_hashtable("install reinstreq not-installed");
|
||||
|
||||
/* Try and find a currently installed version of this package */
|
||||
status_num = search_status_hashtable(name_hashtable[package_hashtable[deb_file[deb_count]->package]->name]);
|
||||
/* If no previous entry was found initialise a new entry */
|
||||
if ((status_hashtable[status_num] == NULL) ||
|
||||
(status_hashtable[status_num]->status == 0)) {
|
||||
/* reinstreq isnt changed to "ok" until the package control info
|
||||
* is written to the status file*/
|
||||
status_node->status = search_name_hashtable("install reinstreq not-installed");
|
||||
status_hashtable[status_num] = status_node;
|
||||
} else {
|
||||
status_hashtable[status_num]->status = search_name_hashtable("install reinstreq installed");
|
||||
}
|
||||
status_hashtable[status_num] = status_node;
|
||||
}
|
||||
}
|
||||
else if (dpkg_opt & dpkg_opt_package_name) {
|
||||
@@ -1506,6 +1440,6 @@ extern int dpkg_main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
return(EXIT_SUCCESS);
|
||||
return(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <getopt.h>
|
||||
#include "unarchive.h"
|
||||
#include "busybox.h"
|
||||
|
||||
extern int dpkg_deb_main(int argc, char **argv)
|
||||
@@ -2,8 +2,9 @@
|
||||
/*
|
||||
* Mini du implementation for busybox
|
||||
*
|
||||
* Copyright (C) 1999,2000,2001 by Lineo, inc. and John Beppu
|
||||
* Copyright (C) 1999,2000 by Lineo, inc. and John Beppu
|
||||
* Copyright (C) 1999,2000,2001 by John Beppu <beppu@codepoet.org>
|
||||
* Copyright (C) 2002 Edward Betts <edward@debian.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -32,7 +33,7 @@
|
||||
#include "busybox.h"
|
||||
|
||||
|
||||
#ifdef CONFIG_FEATURE_HUMAN_READABLE
|
||||
#ifdef BB_FEATURE_HUMAN_READABLE
|
||||
static unsigned long disp_hr = KILOBYTE;
|
||||
#endif
|
||||
|
||||
@@ -40,12 +41,14 @@ typedef void (Display) (long, char *);
|
||||
|
||||
static int du_depth = 0;
|
||||
static int count_hardlinks = 0;
|
||||
static int one_file_system = 0;
|
||||
static dev_t dir_dev = 0;
|
||||
|
||||
static Display *print;
|
||||
|
||||
static void print_normal(long size, char *filename)
|
||||
{
|
||||
#ifdef CONFIG_FEATURE_HUMAN_READABLE
|
||||
#ifdef BB_FEATURE_HUMAN_READABLE
|
||||
printf("%s\t%s\n", make_human_readable_str(size<<10, 1, disp_hr), filename);
|
||||
#else
|
||||
printf("%ld\t%s\n", size, filename);
|
||||
@@ -59,78 +62,6 @@ static void print_summary(long size, char *filename)
|
||||
}
|
||||
}
|
||||
|
||||
#define HASH_SIZE 311 /* Should be prime */
|
||||
#define hash_inode(i) ((i) % HASH_SIZE)
|
||||
|
||||
typedef struct ino_dev_hash_bucket_struct {
|
||||
struct ino_dev_hash_bucket_struct *next;
|
||||
ino_t ino;
|
||||
dev_t dev;
|
||||
char name[1];
|
||||
} ino_dev_hashtable_bucket_t;
|
||||
|
||||
static ino_dev_hashtable_bucket_t *ino_dev_hashtable[HASH_SIZE];
|
||||
|
||||
/*
|
||||
* Return 1 if statbuf->st_ino && statbuf->st_dev are recorded in
|
||||
* `ino_dev_hashtable', else return 0
|
||||
*
|
||||
* If NAME is a non-NULL pointer to a character pointer, and there is
|
||||
* a match, then set *NAME to the value of the name slot in that
|
||||
* bucket.
|
||||
*/
|
||||
static int is_in_ino_dev_hashtable(const struct stat *statbuf, char **name)
|
||||
{
|
||||
ino_dev_hashtable_bucket_t *bucket;
|
||||
|
||||
bucket = ino_dev_hashtable[hash_inode(statbuf->st_ino)];
|
||||
while (bucket != NULL) {
|
||||
if ((bucket->ino == statbuf->st_ino) &&
|
||||
(bucket->dev == statbuf->st_dev))
|
||||
{
|
||||
if (name) *name = bucket->name;
|
||||
return 1;
|
||||
}
|
||||
bucket = bucket->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Add statbuf to statbuf hash table */
|
||||
static void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name)
|
||||
{
|
||||
int i;
|
||||
size_t s;
|
||||
ino_dev_hashtable_bucket_t *bucket;
|
||||
|
||||
i = hash_inode(statbuf->st_ino);
|
||||
s = name ? strlen(name) : 0;
|
||||
bucket = xmalloc(sizeof(ino_dev_hashtable_bucket_t) + s);
|
||||
bucket->ino = statbuf->st_ino;
|
||||
bucket->dev = statbuf->st_dev;
|
||||
if (name)
|
||||
strcpy(bucket->name, name);
|
||||
else
|
||||
bucket->name[0] = '\0';
|
||||
bucket->next = ino_dev_hashtable[i];
|
||||
ino_dev_hashtable[i] = bucket;
|
||||
}
|
||||
|
||||
/* Clear statbuf hash table */
|
||||
static void reset_ino_dev_hashtable(void)
|
||||
{
|
||||
int i;
|
||||
ino_dev_hashtable_bucket_t *bucket;
|
||||
|
||||
for (i = 0; i < HASH_SIZE; i++) {
|
||||
while (ino_dev_hashtable[i] != NULL) {
|
||||
bucket = ino_dev_hashtable[i]->next;
|
||||
free(ino_dev_hashtable[i]);
|
||||
ino_dev_hashtable[i] = bucket;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* tiny recursive du */
|
||||
static long du(char *filename)
|
||||
{
|
||||
@@ -141,6 +72,10 @@ static long du(char *filename)
|
||||
perror_msg("%s", filename);
|
||||
return 0;
|
||||
}
|
||||
if (du_depth == 0)
|
||||
dir_dev = statbuf.st_dev;
|
||||
else if (one_file_system && dir_dev != statbuf.st_dev)
|
||||
return 0;
|
||||
|
||||
du_depth++;
|
||||
sum = (statbuf.st_blocks >> 1);
|
||||
@@ -205,8 +140,8 @@ int du_main(int argc, char **argv)
|
||||
print = print_normal;
|
||||
|
||||
/* parse argv[] */
|
||||
while ((c = getopt(argc, argv, "sl"
|
||||
#ifdef CONFIG_FEATURE_HUMAN_READABLE
|
||||
while ((c = getopt(argc, argv, "slx"
|
||||
#ifdef BB_FEATURE_HUMAN_READABLE
|
||||
"hm"
|
||||
#endif
|
||||
"k")) != EOF) {
|
||||
@@ -217,7 +152,10 @@ int du_main(int argc, char **argv)
|
||||
case 'l':
|
||||
count_hardlinks = 1;
|
||||
break;
|
||||
#ifdef CONFIG_FEATURE_HUMAN_READABLE
|
||||
case 'x':
|
||||
one_file_system = 1;
|
||||
break;
|
||||
#ifdef BB_FEATURE_HUMAN_READABLE
|
||||
case 'h': disp_hr = 0; break;
|
||||
case 'm': disp_hr = MEGABYTE; break;
|
||||
#endif
|
||||
@@ -246,7 +184,7 @@ int du_main(int argc, char **argv)
|
||||
return status;
|
||||
}
|
||||
|
||||
/* $Id: du.c,v 1.51 2001/10/24 04:59:27 andersen Exp $ */
|
||||
/* $Id: du.c,v 1.53 2002/09/18 19:21:06 andersen Exp $ */
|
||||
/*
|
||||
Local Variables:
|
||||
c-file-style: "linux"
|
||||
@@ -9,7 +9,7 @@
|
||||
* little endian on x86.
|
||||
*
|
||||
* Modified to support all sorts of libcs by
|
||||
* Erik Andersen <andersen@lineo.com>
|
||||
* Erik Andersen <andersen@codepoet.org>
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -39,7 +39,7 @@ extern int dutmp_main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* Kludge around the fact that the binary format for utmp has changed. */
|
||||
#if __GNU_LIBRARY__ < 5 || defined __UCLIBC__
|
||||
#if __GNU_LIBRARY__ < 5
|
||||
/* Linux libc5 */
|
||||
while (read(file, (void*)&ut, sizeof(struct utmp))) {
|
||||
printf("%d|%d|%s|%s|%s|%s|%s|%lx\n",
|
||||
@@ -1,36 +0,0 @@
|
||||
# Makefile for busybox
|
||||
#
|
||||
# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
TOPDIR :=..
|
||||
L_TARGET := editors.a
|
||||
|
||||
obj-y :=
|
||||
obj-n :=
|
||||
obj- :=
|
||||
|
||||
obj-$(CONFIG_SED) += sed.o
|
||||
obj-$(CONFIG_VI) += vi.o
|
||||
|
||||
|
||||
# Hand off to toplevel Rules.mak
|
||||
include $(TOPDIR)/Rules.mak
|
||||
|
||||
clean:
|
||||
rm -f $(L_TARGET) *.o core
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
#
|
||||
# For a description of the syntax of this configuration file,
|
||||
# see scripts/kbuild/config-language.txt.
|
||||
#
|
||||
|
||||
mainmenu_option next_comment
|
||||
comment 'Editors'
|
||||
|
||||
bool 'sed' CONFIG_SED
|
||||
bool 'vi' CONFIG_VI
|
||||
if [ "$CONFIG_VI" = "y" ]; then
|
||||
bool ' Enable ":" colon commands (no "ex" mode)' CONFIG_FEATURE_VI_COLON
|
||||
bool ' Enable yank/put commands and mark cmds' CONFIG_FEATURE_VI_YANKMARK
|
||||
bool ' Enable search and replace cmds' CONFIG_FEATURE_VI_SEARCH
|
||||
bool ' Catch signals' CONFIG_FEATURE_VI_USE_SIGNALS
|
||||
bool ' Remember previous cmd and "." cmd' CONFIG_FEATURE_VI_DOT_CMD
|
||||
bool ' Enable -R option and "view" mode' CONFIG_FEATURE_VI_READONLY
|
||||
bool ' Enable set-able options, ai ic showmatch' CONFIG_FEATURE_VI_SETOPTS
|
||||
bool ' Support for :set' CONFIG_FEATURE_VI_SET
|
||||
bool ' Handle window resize' CONFIG_FEATURE_VI_WIN_RESIZE
|
||||
bool ' Optimize cursor movement' CONFIG_FEATURE_VI_OPTIMIZE_CURSOR
|
||||
fi
|
||||
endmenu
|
||||
|
||||
@@ -1,864 +0,0 @@
|
||||
/*
|
||||
* sed.c - very minimalist version of sed
|
||||
*
|
||||
* Copyright (C) 1999,2000,2001 by Lineo, inc. and Mark Whitley
|
||||
* Copyright (C) 1999,2000,2001 by Mark Whitley <markw@codepoet.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
Supported features and commands in this version of sed:
|
||||
|
||||
- comments ('#')
|
||||
- address matching: num|/matchstr/[,num|/matchstr/|$]command
|
||||
- commands: (p)rint, (d)elete, (s)ubstitue (with g & I flags)
|
||||
- edit commands: (a)ppend, (i)nsert, (c)hange
|
||||
- file commands: (r)ead
|
||||
- backreferences in substitution expressions (\1, \2...\9)
|
||||
|
||||
(Note: Specifying an address (range) to match is *optional*; commands
|
||||
default to the whole pattern space if no specific address match was
|
||||
requested.)
|
||||
|
||||
Unsupported features:
|
||||
|
||||
- transliteration (y/source-chars/dest-chars/) (use 'tr')
|
||||
- no pattern space hold space storing / swapping (x, etc.)
|
||||
- no labels / branching (: label, b, t, and friends)
|
||||
- and lots, lots more.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h> /* for getopt() */
|
||||
#include <regex.h>
|
||||
#include <string.h> /* for strdup() */
|
||||
#include <errno.h>
|
||||
#include <ctype.h> /* for isspace() */
|
||||
#include <stdlib.h>
|
||||
#include "busybox.h"
|
||||
|
||||
/* externs */
|
||||
extern void xregcomp(regex_t *preg, const char *regex, int cflags);
|
||||
extern int optind; /* in unistd.h */
|
||||
extern char *optarg; /* ditto */
|
||||
|
||||
/* options */
|
||||
static int be_quiet = 0;
|
||||
|
||||
|
||||
struct sed_cmd {
|
||||
/* Order by alignment requirements */
|
||||
|
||||
/* address storage */
|
||||
regex_t *beg_match; /* sed -e '/match/cmd' */
|
||||
regex_t *end_match; /* sed -e '/match/,/end_match/cmd' */
|
||||
|
||||
/* SUBSTITUTION COMMAND SPECIFIC FIELDS */
|
||||
|
||||
/* sed -e 's/sub_match/replace/' */
|
||||
regex_t *sub_match;
|
||||
char *replace;
|
||||
|
||||
/* EDIT COMMAND (a,i,c) SPECIFIC FIELDS */
|
||||
char *editline;
|
||||
|
||||
/* FILE COMMAND (r) SPECIFIC FIELDS */
|
||||
char *filename;
|
||||
|
||||
/* address storage */
|
||||
int beg_line; /* 'sed 1p' 0 == no begining line, apply commands to all lines */
|
||||
int end_line; /* 'sed 1,3p' 0 == no end line, use only beginning. -1 == $ */
|
||||
/* SUBSTITUTION COMMAND SPECIFIC FIELDS */
|
||||
|
||||
unsigned int num_backrefs:4; /* how many back references (\1..\9) */
|
||||
/* Note: GNU/POSIX sed does not save more than nine backrefs, so
|
||||
* we only use 4 bits to hold the number */
|
||||
unsigned int sub_g:1; /* sed -e 's/foo/bar/g' (global) */
|
||||
unsigned int sub_p:2; /* sed -e 's/foo/bar/p' (print substitution) */
|
||||
|
||||
/* GENERAL FIELDS */
|
||||
char delimiter; /* The delimiter used to separate regexps */
|
||||
|
||||
/* the command */
|
||||
char cmd; /* p,d,s (add more at your leisure :-) */
|
||||
};
|
||||
|
||||
/* globals */
|
||||
static struct sed_cmd *sed_cmds = NULL; /* growable arrary holding a sequence of sed cmds */
|
||||
static int ncmds = 0; /* number of sed commands */
|
||||
|
||||
/*static char *cur_file = NULL;*/ /* file currently being processed XXX: do I need this? */
|
||||
|
||||
const char * const semicolon_whitespace = "; \n\r\t\v\0";
|
||||
|
||||
#ifdef CONFIG_FEATURE_CLEAN_UP
|
||||
static void destroy_cmd_strs()
|
||||
{
|
||||
if (sed_cmds == NULL)
|
||||
return;
|
||||
|
||||
/* destroy all the elements in the array */
|
||||
while (--ncmds >= 0) {
|
||||
|
||||
if (sed_cmds[ncmds].beg_match) {
|
||||
regfree(sed_cmds[ncmds].beg_match);
|
||||
free(sed_cmds[ncmds].beg_match);
|
||||
}
|
||||
if (sed_cmds[ncmds].end_match) {
|
||||
regfree(sed_cmds[ncmds].end_match);
|
||||
free(sed_cmds[ncmds].end_match);
|
||||
}
|
||||
if (sed_cmds[ncmds].sub_match) {
|
||||
regfree(sed_cmds[ncmds].sub_match);
|
||||
free(sed_cmds[ncmds].sub_match);
|
||||
}
|
||||
if (sed_cmds[ncmds].replace)
|
||||
free(sed_cmds[ncmds].replace);
|
||||
}
|
||||
|
||||
/* destroy the array */
|
||||
free(sed_cmds);
|
||||
sed_cmds = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* index_of_next_unescaped_regexp_delim - walks left to right through a string
|
||||
* beginning at a specified index and returns the index of the next regular
|
||||
* expression delimiter (typically a forward * slash ('/')) not preceeded by
|
||||
* a backslash ('\').
|
||||
*/
|
||||
static int index_of_next_unescaped_regexp_delim(const struct sed_cmd * const sed_cmd, const char *str, int idx)
|
||||
{
|
||||
int bracket = -1;
|
||||
int escaped = 0;
|
||||
char ch;
|
||||
|
||||
for ( ; (ch = str[idx]); idx++) {
|
||||
if (bracket != -1) {
|
||||
if (ch == ']' && !(bracket == idx - 1 ||
|
||||
(bracket == idx - 2 && str[idx-1] == '^')))
|
||||
bracket = -1;
|
||||
} else if (escaped)
|
||||
escaped = 0;
|
||||
else if (ch == '\\')
|
||||
escaped = 1;
|
||||
else if (ch == '[')
|
||||
bracket = idx;
|
||||
else if (ch == sed_cmd->delimiter)
|
||||
return idx;
|
||||
}
|
||||
|
||||
/* if we make it to here, we've hit the end of the string */
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* returns the index in the string just past where the address ends.
|
||||
*/
|
||||
static int get_address(struct sed_cmd *sed_cmd, const char *str, int *linenum, regex_t **regex)
|
||||
{
|
||||
char *my_str = xstrdup(str);
|
||||
int idx = 0;
|
||||
char olddelimiter;
|
||||
olddelimiter = sed_cmd->delimiter;
|
||||
sed_cmd->delimiter = '/';
|
||||
|
||||
if (isdigit(my_str[idx])) {
|
||||
do {
|
||||
idx++;
|
||||
} while (isdigit(my_str[idx]));
|
||||
my_str[idx] = 0;
|
||||
*linenum = atoi(my_str);
|
||||
}
|
||||
else if (my_str[idx] == '$') {
|
||||
*linenum = -1;
|
||||
idx++;
|
||||
}
|
||||
else if (my_str[idx] == '/') {
|
||||
idx = index_of_next_unescaped_regexp_delim(sed_cmd, my_str, ++idx);
|
||||
if (idx == -1)
|
||||
error_msg_and_die("unterminated match expression");
|
||||
my_str[idx] = '\0';
|
||||
*regex = (regex_t *)xmalloc(sizeof(regex_t));
|
||||
xregcomp(*regex, my_str+1, REG_NEWLINE);
|
||||
idx++; /* so it points to the next character after the last '/' */
|
||||
}
|
||||
else {
|
||||
error_msg("get_address: no address found in string\n"
|
||||
"\t(you probably didn't check the string you passed me)");
|
||||
idx = -1;
|
||||
}
|
||||
|
||||
free(my_str);
|
||||
sed_cmd->delimiter = olddelimiter;
|
||||
return idx;
|
||||
}
|
||||
|
||||
static int parse_subst_cmd(struct sed_cmd * const sed_cmd, const char *substr)
|
||||
{
|
||||
int oldidx, cflags = REG_NEWLINE;
|
||||
char *match;
|
||||
int idx = 0;
|
||||
int j;
|
||||
|
||||
/*
|
||||
* the string that gets passed to this function should look like this:
|
||||
* s/match/replace/gIp
|
||||
* || | |||
|
||||
* mandatory optional
|
||||
*
|
||||
* (all three of the '/' slashes are mandatory)
|
||||
*/
|
||||
|
||||
/* verify that the 's' is followed by something. That something
|
||||
* (typically a 'slash') is now our regexp delimiter... */
|
||||
if (!substr[++idx])
|
||||
error_msg_and_die("bad format in substitution expression");
|
||||
else
|
||||
sed_cmd->delimiter=substr[idx];
|
||||
|
||||
/* save the match string */
|
||||
oldidx = idx+1;
|
||||
idx = index_of_next_unescaped_regexp_delim(sed_cmd, substr, ++idx);
|
||||
if (idx == -1)
|
||||
error_msg_and_die("bad format in substitution expression");
|
||||
match = xstrndup(substr + oldidx, idx - oldidx);
|
||||
|
||||
/* determine the number of back references in the match string */
|
||||
/* Note: we compute this here rather than in the do_subst_command()
|
||||
* function to save processor time, at the expense of a little more memory
|
||||
* (4 bits) per sed_cmd */
|
||||
|
||||
/* sed_cmd->num_backrefs = 0; */ /* XXX: not needed? --apparently not */
|
||||
for (j = 0; match[j]; j++) {
|
||||
/* GNU/POSIX sed does not save more than nine backrefs */
|
||||
if (match[j] == '\\' && match[j+1] == '(' && sed_cmd->num_backrefs <= 9)
|
||||
sed_cmd->num_backrefs++;
|
||||
}
|
||||
|
||||
/* save the replacement string */
|
||||
oldidx = idx+1;
|
||||
idx = index_of_next_unescaped_regexp_delim(sed_cmd, substr, ++idx);
|
||||
if (idx == -1)
|
||||
error_msg_and_die("bad format in substitution expression");
|
||||
sed_cmd->replace = xstrndup(substr + oldidx, idx - oldidx);
|
||||
|
||||
/* process the flags */
|
||||
while (substr[++idx]) {
|
||||
switch (substr[idx]) {
|
||||
case 'g':
|
||||
sed_cmd->sub_g = 1;
|
||||
break;
|
||||
case 'I':
|
||||
cflags |= REG_ICASE;
|
||||
break;
|
||||
case 'p':
|
||||
sed_cmd->sub_p = 1;
|
||||
break;
|
||||
default:
|
||||
/* any whitespace or semicolon trailing after a s/// is ok */
|
||||
if (strchr(semicolon_whitespace, substr[idx]))
|
||||
goto out;
|
||||
/* else */
|
||||
error_msg_and_die("bad option in substitution expression");
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
/* compile the match string into a regex */
|
||||
sed_cmd->sub_match = (regex_t *)xmalloc(sizeof(regex_t));
|
||||
xregcomp(sed_cmd->sub_match, match, cflags);
|
||||
free(match);
|
||||
|
||||
return idx;
|
||||
}
|
||||
|
||||
static void move_back(char *str, int offset)
|
||||
{
|
||||
memmove(str, str + offset, strlen(str + offset) + 1);
|
||||
}
|
||||
|
||||
static int parse_edit_cmd(struct sed_cmd *sed_cmd, const char *editstr)
|
||||
{
|
||||
int idx = 0;
|
||||
int slashes_eaten = 0;
|
||||
char *ptr; /* shorthand */
|
||||
|
||||
/*
|
||||
* the string that gets passed to this function should look like this:
|
||||
*
|
||||
* need one of these
|
||||
* |
|
||||
* | this backslash (immediately following the edit command) is mandatory
|
||||
* | |
|
||||
* [aic]\
|
||||
* TEXT1\
|
||||
* TEXT2\
|
||||
* TEXTN
|
||||
*
|
||||
* as soon as we hit a TEXT line that has no trailing '\', we're done.
|
||||
* this means a command like:
|
||||
*
|
||||
* i\
|
||||
* INSERTME
|
||||
*
|
||||
* is a-ok.
|
||||
*
|
||||
*/
|
||||
|
||||
if (editstr[1] != '\\' && (editstr[2] != '\n' || editstr[2] != '\r'))
|
||||
error_msg_and_die("bad format in edit expression");
|
||||
|
||||
/* store the edit line text */
|
||||
/* make editline big enough to accomodate the extra '\n' we will tack on
|
||||
* to the end */
|
||||
sed_cmd->editline = xmalloc(strlen(&editstr[3]) + 2);
|
||||
strcpy(sed_cmd->editline, &editstr[3]);
|
||||
ptr = sed_cmd->editline;
|
||||
|
||||
/* now we need to go through * and: s/\\[\r\n]$/\n/g on the edit line */
|
||||
while (ptr[idx]) {
|
||||
while (ptr[idx] != '\\' || (ptr[idx+1] != '\n' && ptr[idx+1] != '\r')) {
|
||||
idx++;
|
||||
if (!ptr[idx]) {
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
/* move the newline over the '\' before it (effectively eats the '\') */
|
||||
move_back(&ptr[idx], 1);
|
||||
slashes_eaten++;
|
||||
/* substitue \r for \n if needed */
|
||||
if (ptr[idx] == '\r')
|
||||
ptr[idx] = '\n';
|
||||
}
|
||||
|
||||
out:
|
||||
/* figure out if we need to add a newline */
|
||||
if (ptr[idx-1] != '\n') {
|
||||
ptr[idx] = '\n';
|
||||
idx++;
|
||||
}
|
||||
|
||||
/* terminate string */
|
||||
ptr[idx]= 0;
|
||||
|
||||
/* this accounts for discrepancies between the modified string and the
|
||||
* original string passed in to this function */
|
||||
|
||||
/* adjust for opening 2 chars [aic]\ */
|
||||
|
||||
return idx + slashes_eaten + 2;
|
||||
}
|
||||
|
||||
|
||||
static int parse_file_cmd(struct sed_cmd *sed_cmd, const char *filecmdstr)
|
||||
{
|
||||
int idx = 0;
|
||||
int filenamelen = 0;
|
||||
|
||||
/*
|
||||
* the string that gets passed to this function should look like this:
|
||||
* '[ ]filename'
|
||||
* | |
|
||||
* | a filename
|
||||
* |
|
||||
* optional whitespace
|
||||
|
||||
* re: the file to be read, the GNU manual says the following: "Note that
|
||||
* if filename cannot be read, it is treated as if it were an empty file,
|
||||
* without any error indication." Thus, all of the following commands are
|
||||
* perfectly leagal:
|
||||
*
|
||||
* sed -e '1r noexist'
|
||||
* sed -e '1r ;'
|
||||
* sed -e '1r'
|
||||
*/
|
||||
|
||||
/* the file command may be followed by whitespace; move past it. */
|
||||
while (isspace(filecmdstr[++idx]))
|
||||
{ ; }
|
||||
|
||||
/* the first non-whitespace we get is a filename. the filename ends when we
|
||||
* hit a normal sed command terminator or end of string */
|
||||
filenamelen = strcspn(&filecmdstr[idx], semicolon_whitespace);
|
||||
sed_cmd->filename = xmalloc(filenamelen + 1);
|
||||
safe_strncpy(sed_cmd->filename, &filecmdstr[idx], filenamelen + 1);
|
||||
|
||||
return idx + filenamelen;
|
||||
}
|
||||
|
||||
|
||||
static char *parse_cmd_str(struct sed_cmd * const sed_cmd, const char *const cmdstr)
|
||||
{
|
||||
int idx = 0;
|
||||
|
||||
/* parse the command
|
||||
* format is: [addr][,addr]cmd
|
||||
* |----||-----||-|
|
||||
* part1 part2 part3
|
||||
*/
|
||||
|
||||
/* first part (if present) is an address: either a number or a /regex/ */
|
||||
if (isdigit(cmdstr[idx]) || cmdstr[idx] == '/')
|
||||
idx = get_address(sed_cmd, cmdstr, &sed_cmd->beg_line, &sed_cmd->beg_match);
|
||||
|
||||
/* second part (if present) will begin with a comma */
|
||||
if (cmdstr[idx] == ',')
|
||||
idx += get_address(sed_cmd, &cmdstr[++idx], &sed_cmd->end_line, &sed_cmd->end_match);
|
||||
|
||||
/* last part (mandatory) will be a command */
|
||||
if (cmdstr[idx] == '\0')
|
||||
error_msg_and_die("missing command");
|
||||
sed_cmd->cmd = cmdstr[idx];
|
||||
|
||||
/* if it was a single-letter command that takes no arguments (such as 'p'
|
||||
* or 'd') all we need to do is increment the index past that command */
|
||||
if (strchr("pd", sed_cmd->cmd)) {
|
||||
idx++;
|
||||
}
|
||||
/* handle (s)ubstitution command */
|
||||
else if (sed_cmd->cmd == 's') {
|
||||
idx += parse_subst_cmd(sed_cmd, &cmdstr[idx]);
|
||||
}
|
||||
/* handle edit cmds: (a)ppend, (i)nsert, and (c)hange */
|
||||
else if (strchr("aic", sed_cmd->cmd)) {
|
||||
if ((sed_cmd->end_line || sed_cmd->end_match) && sed_cmd->cmd != 'c')
|
||||
error_msg_and_die("only a beginning address can be specified for edit commands");
|
||||
idx += parse_edit_cmd(sed_cmd, &cmdstr[idx]);
|
||||
}
|
||||
/* handle file cmds: (r)ead */
|
||||
else if (sed_cmd->cmd == 'r') {
|
||||
if (sed_cmd->end_line || sed_cmd->end_match)
|
||||
error_msg_and_die("Command only uses one address");
|
||||
idx += parse_file_cmd(sed_cmd, &cmdstr[idx]);
|
||||
}
|
||||
else {
|
||||
error_msg_and_die("invalid command");
|
||||
}
|
||||
|
||||
/* give back whatever's left over */
|
||||
return (char *)&cmdstr[idx];
|
||||
}
|
||||
|
||||
static void add_cmd_str(const char * const cmdstr)
|
||||
{
|
||||
char *mystr = (char *)cmdstr;
|
||||
|
||||
do {
|
||||
|
||||
/* trim leading whitespace and semicolons */
|
||||
move_back(mystr, strspn(mystr, semicolon_whitespace));
|
||||
/* if we ate the whole thing, that means there was just trailing
|
||||
* whitespace or a final / no-op semicolon. either way, get out */
|
||||
if (strlen(mystr) == 0)
|
||||
return;
|
||||
/* if this is a comment, jump past it and keep going */
|
||||
if (mystr[0] == '#') {
|
||||
mystr = strpbrk(mystr, "\n\r");
|
||||
continue;
|
||||
}
|
||||
/* grow the array */
|
||||
sed_cmds = xrealloc(sed_cmds, sizeof(struct sed_cmd) * (++ncmds));
|
||||
/* zero new element */
|
||||
memset(&sed_cmds[ncmds-1], 0, sizeof(struct sed_cmd));
|
||||
/* load command string into new array element, get remainder */
|
||||
mystr = parse_cmd_str(&sed_cmds[ncmds-1], mystr);
|
||||
|
||||
} while (mystr && strlen(mystr));
|
||||
}
|
||||
|
||||
|
||||
static void load_cmd_file(char *filename)
|
||||
{
|
||||
FILE *cmdfile;
|
||||
char *line;
|
||||
char *nextline;
|
||||
|
||||
cmdfile = xfopen(filename, "r");
|
||||
|
||||
while ((line = get_line_from_file(cmdfile)) != NULL) {
|
||||
/* if a line ends with '\' it needs the next line appended to it */
|
||||
while (line[strlen(line)-2] == '\\' &&
|
||||
(nextline = get_line_from_file(cmdfile)) != NULL) {
|
||||
line = xrealloc(line, strlen(line) + strlen(nextline) + 1);
|
||||
strcat(line, nextline);
|
||||
free(nextline);
|
||||
}
|
||||
/* eat trailing newline (if any) --if I don't do this, edit commands
|
||||
* (aic) will print an extra newline */
|
||||
chomp(line);
|
||||
add_cmd_str(line);
|
||||
free(line);
|
||||
}
|
||||
}
|
||||
|
||||
struct pipeline {
|
||||
char *buf;
|
||||
int idx;
|
||||
int len;
|
||||
};
|
||||
|
||||
#define PIPE_MAGIC 0x7f
|
||||
#define PIPE_GROW 64
|
||||
|
||||
void pipe_putc(struct pipeline *const pipeline, char c)
|
||||
{
|
||||
if (pipeline->buf[pipeline->idx] == PIPE_MAGIC) {
|
||||
pipeline->buf =
|
||||
xrealloc(pipeline->buf, pipeline->len + PIPE_GROW);
|
||||
memset(pipeline->buf + pipeline->len, 0, PIPE_GROW);
|
||||
pipeline->len += PIPE_GROW;
|
||||
pipeline->buf[pipeline->len - 1] = PIPE_MAGIC;
|
||||
}
|
||||
pipeline->buf[pipeline->idx++] = (c);
|
||||
}
|
||||
|
||||
#define pipeputc(c) pipe_putc(pipeline, c)
|
||||
|
||||
#if 0
|
||||
{ if (pipeline[pipeline_idx] == PIPE_MAGIC) { \
|
||||
pipeline = xrealloc(pipeline, pipeline_len+PIPE_GROW); \
|
||||
memset(pipeline+pipeline_len, 0, PIPE_GROW); \
|
||||
pipeline_len += PIPE_GROW; \
|
||||
pipeline[pipeline_len-1] = PIPE_MAGIC; } \
|
||||
pipeline[pipeline_idx++] = (c); }
|
||||
#endif
|
||||
|
||||
static void print_subst_w_backrefs(const char *line, const char *replace,
|
||||
regmatch_t *regmatch, struct pipeline *const pipeline, int matches)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* go through the replacement string */
|
||||
for (i = 0; replace[i]; i++) {
|
||||
/* if we find a backreference (\1, \2, etc.) print the backref'ed * text */
|
||||
if (replace[i] == '\\' && isdigit(replace[i+1])) {
|
||||
int j;
|
||||
char tmpstr[2];
|
||||
int backref;
|
||||
++i; /* i now indexes the backref number, instead of the leading slash */
|
||||
tmpstr[0] = replace[i];
|
||||
tmpstr[1] = 0;
|
||||
backref = atoi(tmpstr);
|
||||
/* print out the text held in regmatch[backref] */
|
||||
if (backref <= matches && regmatch[backref].rm_so != -1)
|
||||
for (j = regmatch[backref].rm_so; j < regmatch[backref].rm_eo; j++)
|
||||
pipeputc(line[j]);
|
||||
}
|
||||
|
||||
/* if we find a backslash escaped character, print the character */
|
||||
else if (replace[i] == '\\') {
|
||||
++i;
|
||||
pipeputc(replace[i]);
|
||||
}
|
||||
|
||||
/* if we find an unescaped '&' print out the whole matched text.
|
||||
* fortunately, regmatch[0] contains the indicies to the whole matched
|
||||
* expression (kinda seems like it was designed for just such a
|
||||
* purpose...) */
|
||||
else if (replace[i] == '&' && replace[i-1] != '\\') {
|
||||
int j;
|
||||
for (j = regmatch[0].rm_so; j < regmatch[0].rm_eo; j++)
|
||||
pipeputc(line[j]);
|
||||
}
|
||||
/* nothing special, just print this char of the replacement string to stdout */
|
||||
else
|
||||
pipeputc(replace[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static int do_subst_command(const struct sed_cmd *sed_cmd, char **line)
|
||||
{
|
||||
char *hackline = *line;
|
||||
struct pipeline thepipe = { NULL, 0 , 0};
|
||||
struct pipeline *const pipeline = &thepipe;
|
||||
int altered = 0;
|
||||
regmatch_t *regmatch = NULL;
|
||||
|
||||
/* we only proceed if the substitution 'search' expression matches */
|
||||
if (regexec(sed_cmd->sub_match, hackline, 0, NULL, 0) == REG_NOMATCH)
|
||||
return 0;
|
||||
|
||||
/* whaddaya know, it matched. get the number of back references */
|
||||
regmatch = xmalloc(sizeof(regmatch_t) * (sed_cmd->num_backrefs+1));
|
||||
|
||||
/* allocate more PIPE_GROW bytes
|
||||
if replaced string is larger than original */
|
||||
thepipe.len = strlen(hackline)+PIPE_GROW;
|
||||
thepipe.buf = xcalloc(1, thepipe.len);
|
||||
/* buffer magic */
|
||||
thepipe.buf[thepipe.len-1] = PIPE_MAGIC;
|
||||
|
||||
/* and now, as long as we've got a line to try matching and if we can match
|
||||
* the search string, we make substitutions */
|
||||
while ((*hackline || !altered) && (regexec(sed_cmd->sub_match, hackline,
|
||||
sed_cmd->num_backrefs+1, regmatch, 0) != REG_NOMATCH) ) {
|
||||
int i;
|
||||
|
||||
/* print everything before the match */
|
||||
for (i = 0; i < regmatch[0].rm_so; i++)
|
||||
pipeputc(hackline[i]);
|
||||
|
||||
/* then print the substitution string */
|
||||
print_subst_w_backrefs(hackline, sed_cmd->replace, regmatch,
|
||||
pipeline, sed_cmd->num_backrefs);
|
||||
|
||||
/* advance past the match */
|
||||
hackline += regmatch[0].rm_eo;
|
||||
/* flag that something has changed */
|
||||
altered++;
|
||||
|
||||
/* if we're not doing this globally, get out now */
|
||||
if (!sed_cmd->sub_g)
|
||||
break;
|
||||
}
|
||||
|
||||
for (; *hackline; hackline++) pipeputc(*hackline);
|
||||
if (thepipe.buf[thepipe.idx] == PIPE_MAGIC) thepipe.buf[thepipe.idx] = 0;
|
||||
|
||||
/* cleanup */
|
||||
free(regmatch);
|
||||
|
||||
free(*line);
|
||||
*line = thepipe.buf;
|
||||
return altered;
|
||||
}
|
||||
|
||||
|
||||
static void process_file(FILE *file)
|
||||
{
|
||||
char *line = NULL;
|
||||
static int linenum = 0; /* GNU sed does not restart counting lines at EOF */
|
||||
unsigned int still_in_range = 0;
|
||||
int altered;
|
||||
int i;
|
||||
|
||||
/* go through every line in the file */
|
||||
while ((line = get_line_from_file(file)) != NULL) {
|
||||
|
||||
chomp(line);
|
||||
linenum++;
|
||||
altered = 0;
|
||||
|
||||
/* for every line, go through all the commands */
|
||||
for (i = 0; i < ncmds; i++) {
|
||||
struct sed_cmd *sed_cmd = &sed_cmds[i];
|
||||
|
||||
|
||||
/*
|
||||
* entry point into sedding...
|
||||
*/
|
||||
if (
|
||||
/* no range necessary */
|
||||
(sed_cmd->beg_line == 0 && sed_cmd->end_line == 0 &&
|
||||
sed_cmd->beg_match == NULL &&
|
||||
sed_cmd->end_match == NULL) ||
|
||||
/* this line number is the first address we're looking for */
|
||||
(sed_cmd->beg_line && (sed_cmd->beg_line == linenum)) ||
|
||||
/* this line matches our first address regex */
|
||||
(sed_cmd->beg_match && (regexec(sed_cmd->beg_match, line, 0, NULL, 0) == 0)) ||
|
||||
/* we are currently within the beginning & ending address range */
|
||||
still_in_range
|
||||
) {
|
||||
|
||||
/*
|
||||
* actual sedding
|
||||
*/
|
||||
switch (sed_cmd->cmd) {
|
||||
|
||||
case 'p':
|
||||
puts(line);
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
altered++;
|
||||
break;
|
||||
|
||||
case 's':
|
||||
|
||||
/*
|
||||
* Some special cases for 's' printing to make it compliant with
|
||||
* GNU sed printing behavior (aka "The -n | s///p Matrix"):
|
||||
*
|
||||
* -n ONLY = never print anything regardless of any successful
|
||||
* substitution
|
||||
*
|
||||
* s///p ONLY = always print successful substitutions, even if
|
||||
* the line is going to be printed anyway (line will be printed
|
||||
* twice).
|
||||
*
|
||||
* -n AND s///p = print ONLY a successful substitution ONE TIME;
|
||||
* no other lines are printed - this is the reason why the 'p'
|
||||
* flag exists in the first place.
|
||||
*/
|
||||
|
||||
/* if the user specified that they didn't want anything printed (i.e., a -n
|
||||
* flag and no 'p' flag after the s///), then there's really no point doing
|
||||
* anything here. */
|
||||
if (be_quiet && !sed_cmd->sub_p)
|
||||
break;
|
||||
|
||||
/* we print the line once, unless we were told to be quiet */
|
||||
if (!be_quiet)
|
||||
altered |= do_subst_command(sed_cmd, &line);
|
||||
|
||||
/* we also print the line if we were given the 'p' flag
|
||||
* (this is quite possibly the second printing) */
|
||||
if (sed_cmd->sub_p)
|
||||
altered |= do_subst_command(sed_cmd, &line);
|
||||
if (altered && (i+1 >= ncmds || sed_cmds[i+1].cmd != 's'))
|
||||
puts(line);
|
||||
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
puts(line);
|
||||
fputs(sed_cmd->editline, stdout);
|
||||
altered++;
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
fputs(sed_cmd->editline, stdout);
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
/* single-address case */
|
||||
if ((sed_cmd->end_match == NULL && sed_cmd->end_line == 0)
|
||||
/* multi-address case */
|
||||
/* - matching text */
|
||||
|| (sed_cmd->end_match && (regexec(sed_cmd->end_match, line, 0, NULL, 0) == 0))
|
||||
/* - matching line numbers */
|
||||
|| (sed_cmd->end_line > 0 && sed_cmd->end_line == linenum))
|
||||
{
|
||||
fputs(sed_cmd->editline, stdout);
|
||||
}
|
||||
altered++;
|
||||
|
||||
break;
|
||||
|
||||
case 'r': {
|
||||
FILE *outfile;
|
||||
puts(line);
|
||||
outfile = fopen(sed_cmd->filename, "r");
|
||||
if (outfile)
|
||||
print_file(outfile);
|
||||
/* else if we couldn't open the output file,
|
||||
* no biggie, just don't print anything */
|
||||
altered++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* exit point from sedding...
|
||||
*/
|
||||
if (
|
||||
/* this is a single-address command or... */
|
||||
(sed_cmd->end_line == 0 && sed_cmd->end_match == NULL) || (
|
||||
/* we were in the middle of our address range (this
|
||||
* isn't the first time through) and.. */
|
||||
(still_in_range == 1) && (
|
||||
/* this line number is the last address we're looking for or... */
|
||||
(sed_cmd->end_line && (sed_cmd->end_line == linenum)) ||
|
||||
/* this line matches our last address regex */
|
||||
(sed_cmd->end_match && (regexec(sed_cmd->end_match, line, 0, NULL, 0) == 0))
|
||||
)
|
||||
)
|
||||
) {
|
||||
/* we're out of our address range */
|
||||
still_in_range = 0;
|
||||
}
|
||||
|
||||
/* didn't hit the exit? then we're still in the middle of an address range */
|
||||
else {
|
||||
still_in_range = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* we will print the line unless we were told to be quiet or if the
|
||||
* line was altered (via a 'd'elete or 's'ubstitution), in which case
|
||||
* the altered line was already printed */
|
||||
if (!be_quiet && !altered)
|
||||
puts(line);
|
||||
|
||||
free(line);
|
||||
}
|
||||
}
|
||||
|
||||
extern int sed_main(int argc, char **argv)
|
||||
{
|
||||
int opt, status = EXIT_SUCCESS;
|
||||
|
||||
#ifdef CONFIG_FEATURE_CLEAN_UP
|
||||
/* destroy command strings on exit */
|
||||
if (atexit(destroy_cmd_strs) == -1)
|
||||
perror_msg_and_die("atexit");
|
||||
#endif
|
||||
|
||||
/* do normal option parsing */
|
||||
while ((opt = getopt(argc, argv, "ne:f:")) > 0) {
|
||||
switch (opt) {
|
||||
case 'n':
|
||||
be_quiet++;
|
||||
break;
|
||||
case 'e':
|
||||
add_cmd_str(optarg);
|
||||
break;
|
||||
case 'f':
|
||||
load_cmd_file(optarg);
|
||||
break;
|
||||
default:
|
||||
show_usage();
|
||||
}
|
||||
}
|
||||
|
||||
/* if we didn't get a pattern from a -e and no command file was specified,
|
||||
* argv[optind] should be the pattern. no pattern, no worky */
|
||||
if (ncmds == 0) {
|
||||
if (argv[optind] == NULL)
|
||||
show_usage();
|
||||
else {
|
||||
add_cmd_str(argv[optind]);
|
||||
optind++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* argv[(optind)..(argc-1)] should be names of file to process. If no
|
||||
* files were specified or '-' was specified, take input from stdin.
|
||||
* Otherwise, we process all the files specified. */
|
||||
if (argv[optind] == NULL || (strcmp(argv[optind], "-") == 0)) {
|
||||
process_file(stdin);
|
||||
}
|
||||
else {
|
||||
int i;
|
||||
FILE *file;
|
||||
for (i = optind; i < argc; i++) {
|
||||
file = wfopen(argv[i], "r");
|
||||
if (file) {
|
||||
process_file(file);
|
||||
fclose(file);
|
||||
} else
|
||||
status = EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
@@ -21,7 +21,7 @@
|
||||
*
|
||||
* Original copyright notice is retained at the end of this file.
|
||||
*
|
||||
* Modified for BusyBox by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
|
||||
* Modified for BusyBox by Erik Andersen <andersee@debian.org>
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -1,185 +0,0 @@
|
||||
Building a Busybox Boot Floppy
|
||||
==============================
|
||||
|
||||
This document describes how to buid a boot floppy using the following
|
||||
components:
|
||||
|
||||
- Linux Kernel (http://www.kernel.org)
|
||||
- uClibc: C library (http://cvs.uclinux.org/uClibc.html)
|
||||
- Busybox: Unix utilities (http://busybox.lineo.com)
|
||||
- Syslinux: bootloader (http://syslinux.zytor.com)
|
||||
|
||||
It is based heavily on a paper presented by Erik Andersen at the 2001 Embedded
|
||||
Systems Conference.
|
||||
|
||||
|
||||
|
||||
Building The Software Components
|
||||
--------------------------------
|
||||
|
||||
Detailed instructions on how to build Busybox, uClibc, or a working Linux
|
||||
kernel are beyond the scope of this document. The following guidelines will
|
||||
help though:
|
||||
|
||||
- Stock Busybox from CVS or a tarball will work with no modifications to
|
||||
any files. Just extract and go.
|
||||
- Ditto uClibc.
|
||||
- Your Linux kernel must include support for initrd or else the floppy
|
||||
won't be able to mount it's root file system.
|
||||
|
||||
If you require further information on building Busybox uClibc or Linux, please
|
||||
refer to the web pages and documentation for those individual programs.
|
||||
|
||||
|
||||
|
||||
Making a Root File System
|
||||
-------------------------
|
||||
|
||||
The following steps will create a root file system.
|
||||
|
||||
- Create an empty file that you can format as a filesystem:
|
||||
|
||||
dd if=/dev/zero of=rootfs bs=1k count=4000
|
||||
|
||||
- Set up the rootfs file we just created to be used as a loop device (may not
|
||||
be necessary)
|
||||
|
||||
losetup /dev/loop0 rootfs
|
||||
|
||||
- Format the rootfs file with a filesystem:
|
||||
|
||||
mkfs.ext2 -F -i 2000 rootfs
|
||||
|
||||
- Mount the file on a mountpoint so we can place files in it:
|
||||
|
||||
mkdir loop
|
||||
mount -o loop rootfs loop/
|
||||
|
||||
(you will probably need to be root to do this)
|
||||
|
||||
- Copy on the C library, the dynamic linking library, and other necessary
|
||||
libraries. For this example, we copy the following files from the uClibc
|
||||
tree:
|
||||
|
||||
mkdir loop/lib
|
||||
(chdir to uClibc directory)
|
||||
cp -a libc.so* uClibc*.so \
|
||||
ld.so-1/d-link/ld-linux-uclibc.so* \
|
||||
ld.so-1/libdl/libdl.so* \
|
||||
crypt/libcrypt.so* \
|
||||
(path to)loop/lib
|
||||
|
||||
- Install the Busybox binary and accompanying symlinks:
|
||||
|
||||
(chdir to busybox directory)
|
||||
make PREFIX=(path to)loop/ install
|
||||
|
||||
- Make device files in /dev:
|
||||
|
||||
This can be done by running the 'mkdevs.sh' script. If you want the gory
|
||||
details, you can read the script.
|
||||
|
||||
- Make necessary files in /etc:
|
||||
|
||||
For this, just cp -a the etc/ directory onto rootfs. Again, if you want
|
||||
all the details, you can just look at the files in the dir.
|
||||
|
||||
- Run ldconfig so busybox and other binaries can have access to the libraries
|
||||
that they need:
|
||||
|
||||
(path to)uClibc/ld.so-1/util/ldconfig -r loop/
|
||||
|
||||
- Unmount the rootfs from the mountpoint:
|
||||
|
||||
umount loop
|
||||
|
||||
- Compress it:
|
||||
|
||||
gzip -9 rootfs
|
||||
|
||||
|
||||
Making a SYSLINUX boot floppy
|
||||
-----------------------------
|
||||
|
||||
The following steps will create the boot floppy.
|
||||
|
||||
Note: You will need to have the mtools package installed beforehand.
|
||||
|
||||
- Insert a floppy in the drive and format it with an MSDOS filesystem:
|
||||
|
||||
mformat a:
|
||||
|
||||
(if the system doesn't know what device 'a:' is, look at /etc/mtools.conf)
|
||||
|
||||
- Run syslinux on the floppy:
|
||||
|
||||
syslinux -s /dev/fd0
|
||||
|
||||
(the -s stands for "safe, slow, and stupid" and should work better with
|
||||
buggy BIOSes; it can be omitted)
|
||||
|
||||
- Put on a syslinux.cfg file:
|
||||
|
||||
mcopy syslinux.cfg a:
|
||||
|
||||
(more on syslinux.cfg below)
|
||||
|
||||
- Copy the root file system you made onto the MSDOS formatted floppy
|
||||
|
||||
mcopy rootfs.gz a:
|
||||
|
||||
- Build a linux kernel and copy it onto the disk with the filename 'linux'
|
||||
|
||||
mcopy bzImage a:linux
|
||||
|
||||
|
||||
Sample syslinux.cfg
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The following simple syslinux.cfg file should work. You can tweak it if you
|
||||
like.
|
||||
|
||||
----begin-syslinux.cfg---------------
|
||||
DEFAULT linux
|
||||
APPEND initrd=rootfs.gz root=/dev/ram0
|
||||
TIMEOUT 10
|
||||
PROMPT 1
|
||||
----end-syslinux.cfg---------------
|
||||
|
||||
Some changes you could make to syslinux.cfg:
|
||||
|
||||
- This value is the number seconds it will wait before booting. You can set
|
||||
the timeout to 0 (or omit) to boot instantly, or you can set it as high as
|
||||
10 to wait awhile.
|
||||
|
||||
- PROMPT can be set to 0 to disable the 'boot:' prompt.
|
||||
|
||||
- you can add this line to display the contents of a file as a welcome
|
||||
message:
|
||||
|
||||
DISPLAY display.txt
|
||||
|
||||
|
||||
|
||||
Additional Resources
|
||||
--------------------
|
||||
|
||||
Other useful information on making a Linux bootfloppy is available at the
|
||||
following URLs:
|
||||
|
||||
http://www.linuxdoc.org/HOWTO/Bootdisk-HOWTO/index.html
|
||||
http://www.linux-embedded.com/howto/Embedded-Linux-Howto.html
|
||||
http://linux-embedded.org/howto/LFS-HOWTO.html
|
||||
http://linux-embedded.org/pmhowto.html
|
||||
http://recycle.lbl.gov/~ldoolitt/embedded/ (Larry Doolittle's stuff)
|
||||
|
||||
|
||||
|
||||
Possible TODOs
|
||||
--------------
|
||||
|
||||
The following features that we might want to add later:
|
||||
|
||||
- support for additional filesystems besides ext2, i.e. minix
|
||||
- different libc, static vs dynamic loading
|
||||
- maybe using an alternate bootloader
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
This boot floppy is made with Busybox, uClibc, and the Linux kernel.
|
||||
Hit RETURN to boot or enter boot parameters at the prompt below.
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
proc /proc proc defaults 0 0
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
/bin/mount -a
|
||||