Compare commits

...
309 Commits
Author SHA1 Message Date
Eric Andersen c181f34c87 prepare for release 2003-12-11 02:48:15 +00:00
Eric Andersen e7047887b0 Update modutils with 2.6 module support 2003-12-11 01:42:13 +00:00
Eric Andersen 37f4116ecb go directly to current cvs 2003-12-11 01:29:46 +00:00
Eric Andersen de4f07e56e remove some spaces that mess up autodocifier.pl 2003-12-11 01:18:07 +00:00
Eric Andersen 9f6c12a42e add missing copyright text 2003-12-10 20:50:14 +00:00
Eric Andersen 2e0455d82b some minor updates 2003-12-10 20:41:48 +00:00
Eric Andersen 539eef6f28 update website 2003-12-10 12:08:20 +00:00
Eric Andersen d5c746f3a8 Fix indenting.
Fix a bug noticed by Pete Flugstad.  Make certain we close what we open, and
don't try to close invalid files when /etc/filesystems exists and is used.
2003-12-09 23:50:24 +00:00
Eric Andersen 747f2f7d78 Bump version number 2003-12-09 17:31:48 +00:00
Glenn L McGrath f6bba3d689 Splitting statements with #define's can cause trouble for cross
compilers (and it looks a bit messy)
2003-12-08 20:31:25 +00:00
Glenn L McGrath 9adcf73152 Stop sending data to the client after the first failure.
Patch by Joe.C
2003-12-08 20:21:53 +00:00
Glenn L McGrath 5c0d84aaf0 Bring usage upto date, patch by Steven Scholz 2003-12-08 20:11:55 +00:00
Glenn L McGrath 142abc18ce Fix a compile error when only using ar, patch by Paul van Gool 2003-12-05 02:51:21 +00:00
Manuel Novoa III 22e1ca382b Add (untested) support for cris, based on the (old) busybox insmod
that axis distributes.
2003-12-04 15:02:57 +00:00
Glenn L McGrath c83e3a6406 Patch from Steven Scholz, make usage more consistent with actual
behaviour.
2003-12-04 13:06:44 +00:00
Eric Andersen 50547c0745 Do not use the _syscall5 macro -- use syscall(2) instead 2003-12-04 07:07:14 +00:00
Glenn L McGrath 3860b2ebd6 Patch from Tito, size optimisation, cleanup noise when in debugging
mode, adds support for MODLOAD keyword in devfsd.conf, provides a
cleaned up version of example/devfsd.conf
2003-11-30 23:46:06 +00:00
Glenn L McGrath 5be6a200f0 Correct Matteo's email address 2003-11-28 22:55:03 +00:00
Glenn L McGrath b8c3a54531 Patch from Ian Campbell, fix or'ed dependencies and handle virtual
dependencies.
2003-11-28 22:38:14 +00:00
Glenn L McGrath 11e69471be Fix a bug, ignore the source path when installing to a directory.
We may be installing symlinks, so use lstat/lchown.
Make use of bb_getopt_ulflags and cp_mv_stat2, save 100 bytes.
2003-11-27 22:40:08 +00:00
Glenn L McGrath e39ee01821 Fix tar hard links 2003-11-27 00:01:43 +00:00
Glenn L McGrath fea4b446df Important bugfixes from Ian Campbell.
init_archive_deb_data()
        We want to filter for data.tar.* in the AR file not the TAR
        file, else we get nothing.

all_control_list()
        Make the 'extensions' array of control file names a global so it
        can be used in unpack_package as well. Name the global
        all_control_files. Don't hard code the length of
        all_control_files but instead used sizeof.

unpack_package()
        Only unpack the control files we are interested in (from
        all_control_files). Extract the data.tar.gz into / rather than
        the current directory.

dpkg_main()
        Configure packages in a second pass so all the packages being
        installed are unpacked before configuring.

Some purely cosmetic changes:

header
        update list of differences since two of them are no longer true.
        The .control file is no longer stored as a result of this patch
        -- it was redundant since the info is in status. New packages
        appear to be added to the end of the status file now rather than
        the start.

remove_package()
        Make message printing optional, so we can avoid a redundant
        message when replacing/upgrading a package. When we do print
        stuff then include the version number.

purge_package()
        Print "Purging xxx (yyy) ..." message like the other actions.

configure_package()
        Add "..." to "Setting up" message to be consistent with other
        actions.
2003-11-26 21:53:37 +00:00
Glenn L McGrath 4ddddd180e Fix for "Broken pipe" issue, vodz last_patch116_3 2003-11-25 20:45:38 +00:00
Glenn L McGrath c3498f678a When a size of 0 is passed to copyfd_size, dont do anything, it was
reading untill eof which breaks tar
2003-11-24 23:50:07 +00:00
Glenn L McGrath f0515dad66 Fix warning 2003-11-22 02:13:41 +00:00
Glenn L McGrath 7ffe133864 As we no longer use function pointers for read in common archiving code
archive_xread can be replaced with bb_full_read, and archive_copy_file
with bb_copyfd*
bb_copyfd is split into two functions bb_copyfd_size and bb_copyfd_eof,
they share a common backend.
2003-11-21 22:24:57 +00:00
Glenn L McGrath 1a2d75fd72 Use safe read 2003-11-21 22:17:28 +00:00
Glenn L McGrath d0550d8fc9 Fix warning 2003-11-21 21:54:07 +00:00
Glenn L McGrath acbdc47aac Make use of libbb functions bb_xopen, bb_full_read, used #define's
instead of static consts, avoid xmalloc.
2003-11-21 09:27:02 +00:00
Glenn L McGrath 2cd1eb16ad Remove unused function 2003-11-20 22:36:57 +00:00
Glenn L McGrath 78cd84da8a Dont over-read fd, use function pointer for hash function. 2003-11-20 21:30:58 +00:00
Glenn L McGrath e857122c97 Fix tar-handles-nested-exclude testcase 2003-11-20 10:47:06 +00:00
Glenn L McGrath d9c8ab40a4 Update status of tests which should pass 2003-11-20 09:57:44 +00:00
Glenn L McGrath 3a2fcc63b8 remove controversial tests 2003-11-20 09:56:34 +00:00
Glenn L McGrath bebc40b406 Check at least one context is specified 2003-11-20 09:53:31 +00:00
Glenn L McGrath ba49651de9 Check there are files to add the archive before removing a specified
tar file.
2003-11-20 09:06:10 +00:00
Glenn L McGrath 90c9df93f3 Dont attempt to unlink directories 2003-11-20 08:00:38 +00:00
Glenn L McGrath 0413af0e27 Superficial changes 2003-11-20 06:27:33 +00:00
Glenn L McGrath 5c069aaf2f Fix up the -s option, and make usage consitent with behaviour,
patch by Steven Scholz
2003-11-20 05:58:26 +00:00
Glenn L McGrath d85421de22 Include stdint.h 2003-11-20 05:26:38 +00:00
Glenn L McGrath 931ae9d2f8 woops, we needed that function 2003-11-18 23:56:41 +00:00
Glenn L McGrath 0c5d9c27a5 COMPRESS, not UNCOMPRESS 2003-11-18 23:27:49 +00:00
Glenn L McGrath 7370f62493 Update usage for tar -Z 2003-11-18 21:49:23 +00:00
Glenn L McGrath 0b6539f7f9 Update md5sum, sha1sum options, patch by Steven Scholz 2003-11-18 21:40:30 +00:00
Glenn L McGrath 56f16b42c9 tar -Z, uncompress support 2003-11-18 21:37:52 +00:00
Glenn L McGrath 20872be9a4 Dont close original file handle, we may need it later. 2003-11-18 21:31:19 +00:00
Glenn L McGrath 3b9fc8fe2a Make unlink old files default behaviour and add a new option -k to
prevent overwritting existing files
2003-11-18 20:23:04 +00:00
Glenn L McGrath de3ea9f049 Only use getopt and associated flags if checking is enabled 2003-11-18 19:35:06 +00:00
Glenn L McGrath aee0fd8320 Replaced by md5_sha1_sum.c 2003-11-18 19:33:13 +00:00
Glenn L McGrath 303b7d83f0 Replaced by md5_sha1_sum.c 2003-11-18 18:56:25 +00:00
Glenn L McGrath f074afc2a0 Dont free filename, its needed in the extracted files list. 2003-11-17 21:58:00 +00:00
Glenn L McGrath cccf49fb0f This was made obsolete by config-udeb-linux-i386 2003-11-17 10:46:36 +00:00
Glenn L McGrath 7e4b3347b2 Remove net-udeb flavour, we dotn use it 2003-11-17 10:43:08 +00:00
Glenn L McGrath 0874a613d2 Use the PROG variable instead of 'busybox' in the release target 2003-11-17 10:26:43 +00:00
Glenn L McGrath 8dc8cb133c Fix a bug where cpio wouldnt work unless -u was specified 2003-11-15 23:44:31 +00:00
Glenn L McGrath 5699b8525e Move from read_gz to the pipe()+fork() method.
open_transformer(), common code for pipe+fork.
Function pointer for read() no longer needed.
Allow inflate to be initialised with a specified buffer size to avoid
over-reading.
Reset static variables in inflate_get_next_window to fix a bug where
only the first file in a .zip would be be extracted.
2003-11-15 23:19:05 +00:00
Glenn L McGrath 54ac057c00 Fix memory leaks 2003-11-15 00:24:43 +00:00
Glenn L McGrath 5c2c8eca4a Fix a "broken pipe" problem. vodz, last_patch_116-2 2003-11-14 21:01:26 +00:00
Glenn L McGrath e57feeb9e6 Keep trying to find a good header, if we exit it will cause .tar.gz
files to compute incorrect crc and length for gzip
2003-11-14 12:57:14 +00:00
Glenn L McGrath eba86e2adb Catch unsupported features 2003-11-14 12:53:42 +00:00
Glenn L McGrath e9080c9f41 NEW APPLET: pipe_progress, used by debian installer 2003-11-14 10:04:33 +00:00
Glenn L McGrath 7b215b99b2 Fix build error with tar -j 2003-11-14 09:22:24 +00:00
Glenn L McGrath 1a41db8eaf Remove some tar_gz stuff that get dragged in 2003-11-14 09:21:27 +00:00
Glenn L McGrath 94cf153c2b Remove debugging noise. 2003-11-14 08:30:46 +00:00
Glenn L McGrath d09bcecda8 Read in blocks rather than one char at a time, greatly improves speed 2003-11-14 08:26:25 +00:00
Eric Andersen 5f28455c6e Oskar Liljeblad writes:
Here's a fix for the hard-coded device name in fbset.
2003-11-14 03:11:29 +00:00
Eric Andersen b6e58d2b9a Michael Smith writes:
I noticed a problem with ifconfig in busybox 0.60.5. The matching code
seems to exist in busybox CVS as well, so I'll paste in the patch that
fixed it.

I was running:
 # ifconfig wan0 1.2.3.4 pointopoint 1.2.3.5 netmask 255.255.255.255

I was seeing the inet addr and P-t-P addr both being set to 1.2.3.5
(the pointopoint address).

wan0      Link encap:Point-Point Protocol
          inet addr:1.2.3.5  P-t-P:1.2.3.5  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          ...

The patch below seems to fix it.
2003-11-14 03:04:08 +00:00
Eric Andersen c16686c1e2 Ulrich Marx writes:
hello

i had some trouble with the filedescriptor in udhcp.
Two things happened on my device:
1.) broken or not connected cable (no dhcp-server)
2.) daemonizing (starting with option -b)

i got a filedescriptor fd=0 from function raw_socket,
after daemonizing (daemon call) the fd is closed.
Client can't recieve data's anymore.

i fixed this problem (like pidfile handling):
2003-11-14 03:00:04 +00:00
Eric Andersen 61b038accc Steven Seeger writes:
Hey guys. I've found a bug in modprobe where it generates bad strings and
makes sytem calls with them. The following patch seems to have fixed the
problem. It is rather inherited elsewhere, as there seems to be incorrect
entries in the list which results in more dependencies than really exist for
a given call to mod_process. But, this patch prevents the bad text from
going to the screen. You will notice there are cases where lcmd goes
unmodified before calling system.

Please consider the following patch.

Thanks.

-Steve
2003-11-14 02:49:19 +00:00
Eric Andersen 8211db5af0 Vladimir N. Oleynik (vodz) writes:
Hi Glenn.

I analysed BSS size gzip applet and found may be mistake:
updcrc() checking  if (crc_table_empty) but not resetted this var.
This do make slow gzip applet ;-)


--w
vodz
2003-11-14 02:44:28 +00:00
Eric Andersen e0c83af4ce Marc Kleine-Budde noticed a missing semicolon 2003-11-14 02:40:08 +00:00
Glenn L McGrath d2a897aab0 Merge common parts of sha1sum and md5sum, which is everything except the
algorithms.
Move algorithms to hash_fd and make them available via a common
function.
2003-11-10 04:33:55 +00:00
Eric Andersen 0bdf41ad7e Add some basic cvs usage info 2003-11-08 00:33:02 +00:00
Eric Andersen bbce615c7e Rob Landley writes:
Remove three entries in defconfig that config no longer has.

Rob
2003-11-08 00:23:23 +00:00
Eric Andersen 2849209db2 Patch from Steven Scholz to send the output from 'time'
to stderr, rather than stdout, so that things like

~ # time bunzip2 -c /tmp/test.bz2 > /dev/null
real    0m 29.44s
user    0m 29.30s
sys     0m 0.12s

operate as expected.
2003-11-07 21:39:14 +00:00
Eric Andersen 28d4e16cd7 This appears to be the correct fix to make CONFIG_FEATURE_DEB_TAR_BZ2
support compile.  Glenn, you may want to verify this.
 -Erik
2003-11-07 21:31:58 +00:00
Eric Andersen d2160aaeab fix comment 2003-11-07 21:22:09 +00:00
Tim Riker b1ffba0401 wrap bb help output if CONFIG_FEATURE_AUTOWIDTH 2003-11-07 19:37:20 +00:00
Eric Andersen 1b1942f93d As vodz pointed out, setting unset_env to NULL is sufficient 2003-11-07 11:20:21 +00:00
Glenn L McGrath 7f9de02ca6 Rewrite, 800+ bytes smaller and more robust. 2003-11-06 03:17:23 +00:00
Eric Andersen 5912acb670 By popular demand, revert to version 1.21, since Rules.mak:1.22
causes the build to ignore CROSS_COMPILER_PREFIX set in .config
2003-11-05 11:34:26 +00:00
Glenn L McGrath 2685724e23 Fix tar -j support
Use the old fork() method of tar compression support, rather than
read_bz2....
 - (*uncompress)(int in, int out) seems like a more natural interface
for compression code.
 - it might improve performance by seperating the work into one cpu
bound and one io bound process.
 - There is extra code required to do read_[gz|bunzip] since (*uncompress)(int in,
int out) will normally be used by the standalone compression applet.

There have been problems with this method so if you see a "Short read"
error let me know.
2003-11-05 04:55:58 +00:00
Eric Andersen 6d687817a8 Fix oversight with CONFIG_FEATURE_AUTOWIDTH handling 2003-11-04 23:16:48 +00:00
Eric Andersen b7077a7316 Set unset_env pointing to a NULL item, to prevent us from walking
off the end of the list and segfaulting.
 -Erik
2003-11-03 22:46:14 +00:00
Eric Andersen 04d055f4e1 Fix rdate and ftpget/ftpput so they compile with the new xconnect.
I have checked rdate.  Someone should also check ftpget/ftpput to
be sure they still work.
2003-11-03 21:20:18 +00:00
Eric Andersen f6067beaa9 Avoid conflicts with the 2.6 kernel headers, which define
_IOR rather differently, thereby breaking the BLKGETSIZE64
ioctl.
 -Erik
2003-11-03 08:59:51 +00:00
Eric Andersen e6dc439b3a Rework wget, the xconnect interface, and its various clients
in order to fix the problems with round robin DNS reported
by Andrew Flegg:
    http://busybox.net/lists/busybox/2003-October/009579.html

This removes the ipv6 specific xconnect dns lookups.  I do
not see why that would need to be special cased for ipv6 as
was done, but that will just have to be tested.

So IPV6 people -- please test this change!

 -Erik
2003-10-31 09:31:46 +00:00
Eric Andersen 8179cf2b78 Put back the tar support stubs (and warnings) for now. 2003-10-31 08:52:57 +00:00
Eric Andersen 252183e3f5 Try to make indent formatting less horrible 2003-10-31 08:19:44 +00:00
Glenn L McGrath e64bf409dd Patch from David Meggy to make the swap default to the new version if no
version is specified and the kernel is relatively new.
2003-10-31 02:04:18 +00:00
Glenn L McGrath 4ef5a84583 Move the tail -c option from FANCY_TAIL to the default tail, this makes
the default tail options conform to SUSv3, with the non-SUS
option all in FANCY_TAIL
2003-10-31 00:35:59 +00:00
Eric Andersen 0120be94a0 Fix stupid typo 2003-10-31 00:21:28 +00:00
Glenn L McGrath 9716575f1a Remove config options for sort -u and sort -r, they are always enabled 2003-10-31 00:04:24 +00:00
Glenn L McGrath 40c9489d33 Add a comment with link to the SUSv3 standard for xargs 2003-10-30 22:51:33 +00:00
Glenn L McGrath 09c295a5bc run through indent 2003-10-30 22:47:16 +00:00
Glenn L McGrath 00ed36fd52 Patch from Dmitry Zakharov,
Fixes two bugs:
- END block didn't execute after an exit() call
- huge memory consumption and performance degradation on large input
(now performance is comparable to gawk)
2003-10-30 13:36:39 +00:00
Eric Andersen b8b6816f7b make certain values specified in the environment always win 2003-10-30 07:48:38 +00:00
Glenn L McGrath f4fd3a1331 Accept the -c option and do nothing 2003-10-29 11:10:02 +00:00
Glenn L McGrath 984b45142a fix a bug where `which' doesn't check whether the file passed as an argument
is a regular file, patch by Arthur Othieno
2003-10-29 04:50:35 +00:00
Glenn L McGrath 6530f0d3a1 make CONFIG_FEATURE_UNARCHIVE_TAPE common between itar and cpio, patch
by Arthur Othieno
2003-10-29 04:46:30 +00:00
Glenn L McGrath 4636aa9dcd "A few references to sourcefiles and URLs in docs/contributing.txt had
gone stale" - Peter Korsgaard
2003-10-29 03:40:47 +00:00
Glenn L McGrath f235d05773 Use the return value from uncompress_bunzip, fix some typo 2003-10-29 03:37:54 +00:00
Glenn L McGrath 1c834407e3 Add some error messages, use xmalloc instead of malloc 2003-10-28 23:32:12 +00:00
Glenn L McGrath debb21ece7 Fix a logic error, the old bunzip code returned non-zero for success,
new code returns 0 for success.
2003-10-28 23:04:50 +00:00
Glenn L McGrath e81fc5fb30 Conditionally compile some files.
This hides a bug related to the new bunzip code in the tar and dpkg[-deb]
applets.
It will also reduce compile time a little as some unused files wont be
compiled.
2003-10-28 10:44:58 +00:00
Eric Andersen 5fa4db29f7 Another bzip2 update and speedup from Manuel Novoa III, with some
additional changes (primarily lots of comments) from Rob Landley.
2003-10-23 06:52:01 +00:00
Eric Andersen 2053a8c747 the dc applet now needs libm
-Erik
2003-10-22 22:29:08 +00:00
Eric Andersen e78fe2414b sigh 2003-10-22 11:36:55 +00:00
Eric Andersen a92877403a Goetz Bock writes:
Dear list,

during my quest do pack busybox into an RPM, I've fixed a small bug
(missing \n) in dc's usage. And added two additional operations: mod and
exp/power.

Feel free to drop them.
2003-10-22 11:24:39 +00:00
Eric Andersen a48b0a3af7 last_patch116 from vodz:
Stephane,

>Using busybox+uclibc, crond syslog messages look like:
>
>Oct  9 09:04:46 soekris cron.notice crond[347]: ^Icrond 2.3.2 dillon,
>started, log level 8

Thanks for testing.

>The attached patch corrects the problem.

Your patch is not correct.
Correct patch attached.

Also. Last patch have
- add "Broken pipe" message to ash.c
- busybox ash synced with dash_0.4.18

--w
vodz
2003-10-22 10:56:47 +00:00
Eric Andersen 514633bf3f Tomasz Motylewski reported that the 'which' applet does not find
files when the full file PATH is specified.

This patch from Arthur Othieno fixes it.
2003-10-22 10:38:22 +00:00
Eric Andersen 7f6295f516 Patch from Arthur Othieno for style-guide.txt conformance 2003-10-22 10:34:15 +00:00
Eric Andersen 28672dd3b9 Patch from Arthur Othieno for docs/style-guide.txt conformance. 2003-10-22 10:30:53 +00:00
Eric Andersen 9ef6c93090 Patch from Arthur Othieno to fix a compiler warning 2003-10-22 10:26:38 +00:00
Eric Andersen 976a55e168 make this a little bit less messy 2003-10-22 10:23:04 +00:00
Eric Andersen f1d3ac429e Update mail location 2003-10-22 10:19:01 +00:00
Eric Andersen 637d2266e1 Disable any buffering to stdout 2003-10-22 10:18:24 +00:00
Eric Andersen 5289969f08 Tito writes:
Hi to all,
I'm sorry but  I didn't spot this big fat bug until now,
Matteo Croce emailed me about it.
Please apply this patch as the devfsd applet is broken
and works only on a system booted with a standard devfsd
( the test I mostly did :-(   ), but if used at boot time
it DOESN'T WORK.

Thanks in advance and please apply
Tito
2003-10-22 10:10:50 +00:00
Eric Andersen 88c916bdec Andreas Mohr writes:
the busybox menuconfig triggered my "inacceptable number of spelling mistakes"
upper level, so I decided to make a patch ;-)

I also improved some wording to describe some things in a better way.

Many thanks for an incredible piece of software!

Andreas Mohr, random OSS developer
2003-10-22 09:58:56 +00:00
Eric Andersen 951df20b7e Do a better job of dealing with screwy s390 abi changes 2003-10-21 06:45:29 +00:00
Eric Andersen acf6c917e2 ccording to this:
http://sources.redhat.com/ml/binutils/2003-01/msg00290.html
The name R_390_GOTOFF was changed to R_390_GOTOFF32.
 -Erik
2003-10-20 05:40:40 +00:00
Eric Andersen 1acfb72e71 Manuel Novoa III writes:
Hello Rob,

Here's a patch to your bunzip-3.c file.  Nice work btw.

One minor bug fix... checking for error return when read()ing.
Some size/performance optimizations as well.  One instance of
memset() seems unnecssary.  You might want to take a look.

Anyway, on my machine, decompressing linux-2.6.0-test7.tar.bz2
to /dev/null gave the following times:

        bunzip-3.c    bzcat (system)   bunzip-3.c (patched)
real    0m24.420s     0m22.725s        0m20.701s
user    0m23.930s     0m22.170s        0m20.180s
sys     0m0.070s      0m0.080s         0m0.140s

Size of the patched version is comparable (slightly larger or
smaller depending on compiler flags).

Manuel
2003-10-18 01:59:46 +00:00
Eric Andersen 0d6d88a205 Rob Landley's new micro-bunzip version 3. Rob writes:
The API for using partial writes, as described in my last message, sucked.

So here's a patch against my last patch that changes things so that
write_bunzip_data calls read_bunzip_data itself behind the scenes whenever
necessary.  So usage is now just start_bunzip(), write_bunzip_data() until it
returns a negative number, and then the cleanup at the end of
uncompressStream.

It adds 32 bytes to the executable, but it should allow the caller (tar) to be
simplified enough to compensate.  Total -Os stripped exe size now 6856 bytes.

Rob

P.S.  I attached the whole C file so you don't have to keep incremental
patches straight if you don't want to. :)

P.S.  In the version I'm banging on now, I've simplified the license to just
LGPL.  I read the OSL a bit more closely and the patent termination clause
would have bit IBM in their counter-suit of SCO if the code in question had
been OSL instead of GPL, and I've decided I just don't want to beta-test
legal code right now.
2003-10-18 01:58:35 +00:00
Tim Riker 6fe55ae939 old gcc 2003-10-17 18:54:55 +00:00
Eric Andersen 7857c03808 Paul Mundt (lethal) writes:
Erik,

The format for /proc/meminfo has changed between 2.4 and 2.6, quite considerably.
In addition to the removal of the two-line summary that was present in 2.4,
MemShared was also removed. Presently (at least in busybox CVS HEAD), top fails
to parse this correctly and spews forth a:

top: failed to read 'meminfo'

message. This patch switches around some of the semantics a little to do sane
parsing for both 2.4 and 2.6. Also, in the event that the summary gets yanked
from 2.4, this patch will deal with that as well. With this patch, I'm able
to run top correctly on 2.6.0-test7 (tested on sh).

Please apply.

 procps/top.c |   60 +++++++++++++++++++++++++++++++++++++++++++++++------------
  1 files changed, 48 insertions(+), 12 deletions(-)
2003-10-11 18:47:20 +00:00
Glenn L McGrath d12061b299 Vodz last_patch_117, update options for new xargs 2003-10-10 23:15:23 +00:00
Glenn L McGrath 61796945e3 Vods versions of xargs 2003-10-10 12:10:18 +00:00
Eric Andersen 75a5684793 I don't need to have my email adder listed twice 2003-10-09 21:19:21 +00:00
Eric Andersen 2af70005b9 Do not use kernel headers 2003-10-09 21:02:23 +00:00
Glenn L McGrath fe4704e948 Fix an ommision preventing building, patch by Tito. 2003-10-09 13:40:17 +00:00
Glenn L McGrath 12940e1ce0 example devfs config file, patch from Tito. 2003-10-09 13:25:00 +00:00
Glenn L McGrath 17d21fa519 New applet, devfsd, by Matteo Croce and Tito 2003-10-09 11:46:23 +00:00
Glenn L McGrath a55d72bbb4 Patch from Steven Scholz, fix some warnings 2003-10-09 11:38:45 +00:00
Glenn L McGrath 99825960c1 Bugfix for xargs 2003-10-09 11:06:45 +00:00
Eric Andersen 29c77f71ba Arnd Ben Otto writes:
Hi Eric

I have written a small patch for the Busybox syslogd. With this patch
one can limit the size of the messagfile. As soon as the limit is
reached the syslogd can rotate or purge the messagefile(s) on his own.
There is no necessity to use an external rotatescript.

Even if logread does something similar, its very handy to have some
messagefile after your box crash.

I wrote this patch initial vor BB 0.6x where no cron daemon was avail.
Now I adapted it for the new Version and i hope it is still useful. At
least I still use it :-)

bye
Arnd
2003-10-09 09:43:18 +00:00
Eric Andersen dae099b2f9 We did not have a safe_write, which is the analog to safe_read. Convert
full_write to use safe_write internally, which is needed to guarantee proper
behavior, i.e. when writing to a pipe.
2003-10-09 08:35:42 +00:00
Eric Andersen 638da75f4b Fix some warnings that have crept in recently 2003-10-09 08:18:36 +00:00
Glenn L McGrath 07085855ad Patch from Tito, size optimisation and fix error in exit code of -V
option
2003-10-09 07:28:22 +00:00
Glenn L McGrath 586d86cc8c Comaptability with gcc-2.95 2003-10-09 07:22:59 +00:00
Glenn L McGrath 9d1a33c690 Vodz last_patch_105 without his xargs patch which doenst apply cleanly 2003-10-06 13:23:06 +00:00
Glenn L McGrath add3eadc46 Add the x, n, s and E options, remove -r as its expected behaviour. 2003-10-04 14:44:27 +00:00
Glenn L McGrath 42c25735e6 Patch from Rob Landley;
Moving on to building diffutils, busybox sed needs this patch to get
past the first problem.  (Passing it a multi-line command line argument
with -e works, but if you don't use -e it doesn't break up the multiple
lines...)
2003-10-04 05:27:56 +00:00
Glenn L McGrath fd7bc13557 Woops, the previous patch reversal wasnt complete, breaking everything. 2003-10-04 00:05:47 +00:00
Glenn L McGrath f86bd9f2cd Reverse my previous changes and make a note about why its dont this way 2003-10-03 13:21:10 +00:00
Glenn L McGrath 07cf92676a Dont mix xarg options with utility option, fixes example of
`echo "README" | xargs ls -al`
Dont specify a path for the default behaviour of echo
args allocated space for an extra ptr
Use defines for the different options
2003-10-03 13:15:44 +00:00
Glenn L McGrath 1dc0ccafdd Vodz, last_patch_114
- env vars CONTENT_TYPE, CONTENT_LENGTH, HTTPD_REFERER, REMOTE_USER and
AUTH_TYPE(Basic always).
- POST data pipied now (previous version have loading into memory may be
big size data and reducing with hardcoded limit)
- removed $CGI_foo environment variables, else my have rubbish
enviroment if POST data have big binary file
2003-10-03 10:50:56 +00:00
Glenn L McGrath 8ac86e33a2 Patch by Rob Landley, fix warning 2003-10-03 08:28:59 +00:00
Glenn L McGrath 4a77c781ef argc has already been decremented 2003-10-03 07:51:30 +00:00
Glenn L McGrath cb920d9778 Patch from Rob Landley, Simplify organisation of arguments. 2003-10-03 03:25:30 +00:00
Glenn L McGrath 91b3d460c7 Fix -C option when creating tar files.
Need to chdir after the tar file is opened, so make common tar filename
parsing and send the file descriptor rather than filename to
writeTarFile.
Modify the verboseFlag operation to determine wether to display on
stderr or stdout at display time, simpler than doing it in tar_main.
2003-10-02 14:33:23 +00:00
Glenn L McGrath 9c91e4142d Thomas Lundquist, update for current structure 2003-10-01 11:33:46 +00:00
Glenn L McGrath 0ad4daa54e Patch from Rob Landley to fix backrefs 2003-10-01 10:26:23 +00:00
Glenn L McGrath 738fb33994 Patch by Rob Landley, fix "newline after edit command" 2003-10-01 06:45:11 +00:00
Glenn L McGrath aa5a602689 Patch by Rob Landley, work in progress update, fixes lots of bugs,
introduces a few others (but they are being worked on)
2003-10-01 03:06:16 +00:00
Glenn L McGrath e6ba16f830 Patch by Guillaume Morin
Fix two race conditions, as described at.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=212764
2003-09-26 10:45:55 +00:00
Glenn L McGrath f7dd10f67c Patch from Fillod Stephane
Add follow mode to logread, ala "tail -f /var/log/messages"
Note: output to a slow serial terminal can have side effects
on syslog because of the semaphore. In such case, define 
RC_LOGREAD.
2003-09-26 01:03:16 +00:00
Glenn L McGrath a79220db6e add size parameter to syslogd -C
Patch by Padraig, resubmitted by Fillod Stephane
2003-09-26 00:49:05 +00:00
Glenn L McGrath 6b0658f5c0 Patch by Fillod Stephane, declare variables as static to not clobber
busybox namespace
2003-09-26 00:33:18 +00:00
Glenn L McGrath 6376b583e2 Use a variable for the config files, makes it easier to syncronise with
debian builds
2003-09-24 15:48:29 +00:00
Glenn L McGrath c98c7d9a14 Syncronise with debian busybox-cvs package 2003-09-24 15:30:44 +00:00
Glenn L McGrath 761ec20f81 Fix some typo's, remove some extra free statements 2003-09-24 10:23:39 +00:00
Glenn L McGrath a406a9c853 Add the -d option 2003-09-24 05:00:29 +00:00
Glenn L McGrath eebcc1d98a Add the "install" applet, move get_ug_id to libbb as its used by chown,
chgrp and install.
2003-09-24 03:22:57 +00:00
Glenn L McGrath d72e34c752 Patch by Steinar H. Gunderson to fix debian bug #211675.
Linking to my_getgrnam from libpwdgrp wasnt working, instead it was
trying to use functionality from glibc, which pulled in libnss.
2003-09-20 00:59:35 +00:00
Glenn L McGrath d3612178b7 Patch by Junio C Hamano to workaround a gcc compiler bug.
The construct certain vintages of GCC (the one I have trouble
with is 3.2.3) have trouble with looks like the following:

    static struct st a;
    static struct st *p = &a;
    struct st { int foo; };
    static void init(void) { a.foo = 0; }

The problem disappears if we move the struct declaration up to
let the compiler know the shape of the struct before the first
definition uses it, like this:

    struct st { int foo; }; /* this has been moved up */
    static struct st a;
    static struct st *p = &a;
    static void init(void) { a.foo = 0; }
2003-09-17 00:22:26 +00:00
Glenn L McGrath 2570b43e82 Configuration option to define wether to follows GNU sed's behaviour
or the posix standard.
Put the cleanup code back the way it was.
2003-09-16 05:25:43 +00:00
Glenn L McGrath 204ff1cea4 Fix a bug that creapt in recently with substitution subprinting, and add
a test for it.
2003-09-16 01:46:36 +00:00
Glenn L McGrath 96fd1b98f1 Compile get_terminal_width_height 2003-09-16 00:50:36 +00:00
Glenn L McGrath baaa6e9e7d Patch from Stephane Billiart to fix an unused variable warning. 2003-09-15 15:00:43 +00:00
Glenn L McGrath a3822de23e Patch from Bastian Blank to fix a problem when runing find under ash.
"If the shell is compiled with -DJOBS, this is all fine -- find wasn't
stopped (it was killed), so it correctly uses WTERMSIG instead of WSTOPSIG.
However, if the shell _isn't_ compiled with -DJOBS (which it isn't in d-i),
only WSTOPSIG is used, which extracts the high byte instead of the low
byte from the status code.  Since the status code is 13 (SIGPIPE), "st"
suddenly gets the value 0, which is equivalent to SIGEXIT. Thus, ash prints
out "EXIT" on find's exit."
2003-09-15 14:42:39 +00:00
Glenn L McGrath e16ab475ad Patch from Tito, Reduces the size of busybox's strings applet from 1900 to
1788 bytes (for strings.o).
2003-09-15 14:22:37 +00:00
Glenn L McGrath 977451ef44 Fix a simple mistake with pattern space, and add a test for it 2003-09-15 12:07:48 +00:00
Glenn L McGrath 47e5ca1ecb Patch by Jean Wolter to fix a bug where a script wouldnt be executed
unless it had #!/bin/sh in the first line

"It correctly locates the script, tries to execute it via execve which
fails. After that it tries to hand it over to /bin/sh which fails too,
since ash

    - neither provides the absolute pathname to /bin/sh
    - nor tries to lookup the script via PATH if called as "sh script"
"
2003-09-15 12:00:19 +00:00
Glenn L McGrath e3e28d3bb6 Fix some memory allocation problems
----------------------------------------------------------------------
2003-09-15 09:22:04 +00:00
Eric Andersen 8efe967018 Be entirely consistant when using ioctl(0, TIOCGWINSZ, &winsize)
to ensure proper fallback behavior on, i.e. serial consoles.
 -Erik
2003-09-15 08:33:45 +00:00
Eric Andersen c4f72d1426 fix function prototype 2003-09-15 08:13:43 +00:00
Eric Andersen 45638df230 Needs prototype for close() 2003-09-15 08:12:53 +00:00
Eric Andersen 2205c84de4 comparison was always false due to limited range of data types.
Carefully cast to unsigned long long prior to multiply to get
the expected result.
2003-09-15 08:11:29 +00:00
Eric Andersen 1393a39df4 Do not shadow the global name 'accept' 2003-09-15 08:06:15 +00:00
Glenn L McGrath 2eed0e2d47 Add a test for the 'P' command and fix current implementation so it
doesnt permanently modify the pattern space.
2003-09-15 06:28:45 +00:00
Glenn L McGrath 6e5687abc3 A test and fix for the sed 'n' command 2003-09-15 06:12:53 +00:00
Glenn L McGrath 7b35121297 Test for use of newline in regex's, this feature is used by most
configure scripts.
2003-09-15 05:53:28 +00:00
Glenn L McGrath 73116311e5 Fix for the sed-append-next-line test 2003-09-15 05:42:05 +00:00
Glenn L McGrath 65f9dc01f3 Test the N command 2003-09-15 05:35:47 +00:00
Glenn L McGrath 640c1f547f Fix recursion problem 2003-09-15 04:55:29 +00:00
Glenn L McGrath ba5eb27ce3 Check sed doesnt go into an infinite loop (yes it does) 2003-09-15 04:41:17 +00:00
Glenn L McGrath c43f9edf88 Update Matteo Croce's email address 2003-09-15 03:37:32 +00:00
Glenn L McGrath 294d113adb Memory cleanups and fix for echo "foo" | sed 's/foo/bar/;H;q' 2003-09-14 16:28:08 +00:00
Glenn L McGrath 8417c8c38b Cleanup memory usage 2003-09-14 15:24:18 +00:00
Glenn L McGrath 7bf8f5bc5e Update sed branch tests 2003-09-14 11:10:08 +00:00
Glenn L McGrath 8a0b59fb82 Add two new tests, sed-recurses-properly should always work 2003-09-14 09:38:24 +00:00
Glenn L McGrath edc388cf4e The previous fix for 's/a/1/;s/b/2/;t one;p;:one;p' broke the case of
echo fooba | ./busybox sed -n 's/foo//;s/bar/found/p'

I really need to start adding these tests to the testsuite.

keep the substituted and altered flags seperate
2003-09-14 08:52:53 +00:00
Glenn L McGrath 3fe475677a Preserve substitution flag value within the current line.
Fixed the following testcase
# cat strings |./busybox sed -n -f test3.sed
1
1
2
c
c
# cat strings
a
b
c
2003-09-14 07:59:28 +00:00
Glenn L McGrath f4523562b6 Fix branching commands.
If a label isnt specified, jump to end of script, not the last command
in the script.

Print an error and exit if you try and jump to a non-existant label

Works for the following testcase
# cat strings
a
b
c
d
e
f
g
# cat strings | ./busybox sed -n '/d/b;p'
a
b
c
e
f
g
2003-09-14 06:01:14 +00:00
Glenn L McGrath 8aac05bfe5 Patch from Rob Landley
Fixed a memory leak in add_cmd/add_cmd_str by moving the allocation
of sed_cmd down to where it's actually first needed.
                                                                                
In get_address, if index_of_next_unescaped_regexp_delim ever failed, we
wouldn't notice because the return value was added to idx, which was 
already guaranteed to be > 0.  (This is buried in the changes made when 
I redid get_address to be based on pointer arithmetic, because all the tests 
were gratuitously dereferencing with a constant zero, which wasn't obvious.)
         
Comment in parse_regex_delim was wrong: 's' and 'y' both call it.
 
The reason "sed_cmd->num_backrefs = 0;" isn't needed is that sed_cmd was
allocated with cmalloc, which zeroes memory.

Different handling of space after \ in i...

Different handling of pattern "s/a/b s/c/d"

Cool, resursive reads don't cause a crash. :)

Fixed "sed -f blah filename - < filename" since GNU sed was handling 
both - and filenames on the same line.  (You can even list - more than 
once, although it's immediate EOF...)
2003-09-14 04:06:12 +00:00
Glenn L McGrath 7c59a83a77 Stupid typo 2003-09-14 02:37:46 +00:00
Glenn L McGrath 4dc1d25a30 Fix some memory allocation problems 2003-09-14 01:25:31 +00:00
Glenn L McGrath f36635cec6 Fix the following testcase by disabling global substitution if the regex
is anchored to the start of line, there can be only one subst.
echo "aah" | sed 's/^a/b/g'
2003-09-13 15:12:22 +00:00
Glenn L McGrath c18ce373a2 Fix the following testcase by storing the state of the adress match with
the command.
# cat strings
a
b
c
d
e
f
g
# ./busybox sed '1,2d;4,$d' <strings
c
# ./busybox sed '4,$d;1,2d' <strings
# sed '4,$d;1,2d' <strings
c
# sed '1,2d;4,$d' <strings
c
2003-09-13 06:57:39 +00:00
Glenn L McGrath c2b9186be1 Fix compile error, Vodz, last_path_113 2003-09-12 11:27:15 +00:00
Glenn L McGrath 2af30446f1 Typo. 2003-09-12 10:58:54 +00:00
Eric Andersen eb213bd2a2 As vodz just pointed out, I screwup up the call to bb_xasprintf! 2003-09-12 08:39:05 +00:00
Eric Andersen 7f2935ba0e Remove final \n 2003-09-12 08:32:24 +00:00
Eric Andersen 70af8834df Fix obligitory typos 2003-09-12 07:36:46 +00:00
Eric Andersen aa2afee922 Final changelog update 2003-09-12 07:03:52 +00:00
Eric Andersen 839bd4a73b Remove version # 2003-09-12 07:03:14 +00:00
Eric Andersen 3acfedfafe I suppose it is now Sept 12... 2003-09-12 06:59:52 +00:00
Eric Andersen 23bc836f42 Update webpage a bit 2003-09-12 06:59:17 +00:00
Glenn L McGrath beb3bbd991 Fix handling of hardlinks when OLDGNU and GNU extensions arent enabled. 2003-09-12 06:49:09 +00:00
Glenn L McGrath ef91bf67ed Use the typeflag to identify if its a hardlink on OLD and GNU posix
modes, fixes a bug extracting hardlinks to symlinks.
2003-09-12 06:31:28 +00:00
Eric Andersen 51ed242ad6 Invoke run-parts on /etc/network/if-*.d per the behavior of
the upstream ifupdown code...
2003-09-12 05:59:53 +00:00
Eric Andersen e15138a870 Teach rdate to timeout in 10 seconds to avoid blocking forever
with odd or broken networking setups
2003-09-12 05:50:51 +00:00
Eric Andersen f57a614db9 config option CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN must depend
on CONFIG_FEATURE_SH_STANDALONE_SHELL.
2003-09-12 04:49:21 +00:00
Eric Andersen a4389cfb51 Update changelog for release 2003-09-12 04:43:49 +00:00
Glenn L McGrath 14092a1ed2 Busybox CVS version ipcalc have problems:
- Can`t use 255.255.255.255 address
- typo: double check for valid ip address and uncheck for valid mask

httpd unseted SERVER_PORT (my bug from last_patch111).

last_patch_112 from Vladimir N. Oleynik
2003-09-12 00:44:50 +00:00
Eric Andersen 81155f8fa8 Update definition of struct serial_struct, per linux-2.6.0-test5,
to avoid stack corruption problems on some 64bit architectures
when sizeof(void*) != sizeof(int).  Thanks to Atsushi Nemoto
for finding this problem.
2003-09-11 08:52:22 +00:00
Eric Andersen 2fdba24620 Marc A. Lehmann writes:
The tar -x command in busybox does not restore the file mode correctly.

The reason is most probably this code in
archival/libunarachive/data_extract_all.c:

       chmod(file_header->name, file_header->mode);
       chown(file_header->name, file_header->uid, file_header->gid);

chown clears the set*id bits (on current versions of linux :). Flipping
the order around fixes the problem.

(tested with 1.00pre3 from cvs).
2003-09-11 08:32:40 +00:00
Eric Andersen 6231f092bd Patch from Philip Blundell:
On Thu, 2003-09-11 at 01:09, Glenn McGrath wrote:
> Applied

Thanks.  Unfortunately there was one small bug in that last patch.
Could you apply this one as well?

p.
2003-09-11 08:25:11 +00:00
Glenn L McGrath cc20ebc11e add ipv6 literal support to wget 2003-09-10 23:52:15 +00:00
Glenn L McGrath 1cb2622f9c Fix a bug where make clean complained about having both : and :: entries.
Remove tester.log on make clean
Patch by Arthur Othieno
2003-09-10 23:47:10 +00:00
Glenn L McGrath fe538ba5d6 Vodz, last_patch_104 2003-09-10 23:35:45 +00:00
Glenn L McGrath 87af49f26b If a tar entry is a regualr file ending in a '/' then its really a
directory.
From http://www.gnu.org/manual/tar/html_node/tar_123.html
REGTYPE
AREGTYPE
    These flags represent a regular file. In order to be compatible with
older versions of tar, a typeflag value of AREGTYPE should be silently
recognized as a regular file. New archives should be created using
REGTYPE. Also, for backward compatibility, tar treats a regular file
whose name ends with a slash as a directory.
2003-09-09 17:41:03 +00:00
Glenn L McGrath 640fb86b28 Update the config file by running it from menuconfig, get rid of some
unused entries.
2003-09-09 15:53:56 +00:00
Glenn L McGrath 07f6b95d8f Patch from Jean Wolter
expr currently always adds even if told to subtract
2003-09-08 23:19:12 +00:00
Glenn L McGrath 5875be406e Vodz, last_patch_110
no limit, no memory usage for env buffer, always call putenv().
remove small error for previous last_patch109.
2003-09-08 15:39:09 +00:00
Glenn L McGrath 55bf79f944 Preserve suid/sgid bits 2003-09-08 14:34:23 +00:00
Glenn L McGrath b65422cf65 last_patch_109 from Vladimir N. Oleynik
Busybox`s httpd have the defect (from born):
ip 1.2.3.1 have true comparing also with
1.2.3.10-1.2.3.19 and 1.2.3.100-1.2.3.199.
Last patch removed this bug and added feature:
allow/deny rule can support network/netmask
example: 1.2.3.0/255.255.255.128
  or
network/mask_bits
example: 1.2.3.0/25
now; old format
1
1.2
1.2.3
1.2.3.4
too support and converted to
1/8 1.2/16 1.2.3/24 1.2.3.4/32
automaticaly.

Also, current CVS have small problem: ignores
A:IP, (loses 'A', 'a' only work). Corrected.
2003-09-08 10:59:27 +00:00
Glenn L McGrath 350733abb8 Busybox modprobe has a couple of irritating quirks:
- attempting to modprobe a module that is already loaded yields "Failed
to load module", whereas modutils quietly ignores such a request.

 - if a module genuinely can't be loaded due to missing symbols or
similar problems, modprobe doesn't produce any useful diagnostics
because the output from insmod has been redirected to /dev/null.

Here's a patch to address these issue

Patch by Philip Blundell
2003-09-08 00:32:49 +00:00
Glenn L McGrath d6bdd5dc08 Small bug in silent option 2003-09-05 02:37:15 +00:00
Glenn L McGrath b77158a934 Set the default password to md5, patch by Joshua Jackson 2003-09-04 08:21:36 +00:00
Glenn L McGrath 99bd5adf99 more crond+crontab integrating with loginutil libbb functions and deleted
patch from Thomas Gleixner to init.
Viodz last_patch_108
2003-09-03 12:18:42 +00:00
Glenn L McGrath 759d7ececd To load GPLONLY symbols its is required that CHECK_TAINTED_MODULES be
enabled, if not GPLONLY symbols are ignored.
2003-09-03 00:42:58 +00:00
Glenn L McGrath 530ea42abc adds the ability to use and calculate network prefix specifications instead
of netmasks. It also fixes the parameters for network and netmask to match
that of the official Red Hat version (-n for network and -m for netmask).
Patch by Joshua Jackson
2003-09-02 06:59:57 +00:00
Glenn L McGrath dc4e75ef7c move all "-/bin/sh" "/bin/sh" and "sh" to libbb/messages.c file as one
constant.
Vodz last_patch_107
2003-09-02 02:36:18 +00:00
Glenn L McGrath 005f83adf5 Fix compile error and reducing size for libbb/get_console.c to previous size.
Vodz last_patch106
2003-09-01 08:53:32 +00:00
Glenn L McGrath d9461f887e Allow one to detect and handle the case where no lease could be obtained
via DHCP. (Just add a section "failed" to your script.)
Patch by Steven Scholz
2003-09-01 04:08:36 +00:00
Glenn L McGrath c2942f0904 "insmod caches the symbolname in a variable before modifying it and uses
the cached value afterwards." - Jean Wolter
2003-08-31 01:58:18 +00:00
Glenn L McGrath bb13624d8c save a couple of bytes 2003-08-30 12:38:13 +00:00
Glenn L McGrath 502907f5b3 The default behaviour for run-parts is corrected to continue if an error
is encountered in a script.
Patch by Philip Blundell
2003-08-30 12:27:36 +00:00
Glenn L McGrath 759515c26a handle GPLONLY symbols 2003-08-30 06:00:33 +00:00
Glenn L McGrath 29a05f56d5 "Without this patch, udhcpcd output may be buffered and delayed for
for minutes if stdout is not a tty." -vda@
2003-08-30 04:47:36 +00:00
Glenn L McGrath 9b04f1841e Fix the substitution print subcommand, it should only print if its
own substitution matched, not previous ones.
e.g
echo fooba | sed -n 's/foo//;s/bar/found/p'
shouldnt print anything
2003-08-30 04:35:07 +00:00
Glenn L McGrath 72f5f02184 Remove some unwanted code, patch from Holger Schurig, confirmed by vodz 2003-08-29 16:19:03 +00:00
Glenn L McGrath 5cd6461b6f "Due to a wrong format parameter in a printf httpd does not work when
compiled for with CONFIG_LFS (large file support).
The attached patch suggested by Vladimir fixes that." - Steven Scholz
2003-08-29 15:53:23 +00:00
Glenn L McGrath e01c550eab "A little patch for the strings applet of the busybox development tree
that substitutes two lines of code with a libbb function saving a couple
of bytes." - Tito
2003-08-29 15:48:37 +00:00
Glenn L McGrath 21aacba2b7 Logic error, patch by Matteo Croce 2003-08-29 15:39:07 +00:00
Glenn L McGrath 8ce8f9b482 Remove stray '\n' 2003-08-29 15:19:44 +00:00
Glenn L McGrath 2233685f00 Remove unused files 2003-08-29 15:03:12 +00:00
Glenn L McGrath 2ce002a732 Help for date -I when CONFIG_FEATURE_DATE_ISOFMT is enabled.
Patch by Steven Scholz
2003-08-29 14:18:26 +00:00
Glenn L McGrath b19c73dee6 Change make to $(MAKE), patch by Hideki IWAMOTO 2003-08-29 13:25:55 +00:00
Glenn L McGrath 3bff66617a Substitute busybox for uClibc, patch by Hideki IWAMOTO 2003-08-29 12:23:09 +00:00
Glenn L McGrath 87470def24 * Since busybox binary is unnecessary, deleted it from prerequisites.
* Changed so that not only links but /bin/busybox might be deleted.
* When double quoted PREFIX is defined by `.config' is used,
  `make uninstall' does not work correctly.
  When default PREFIX `pwd`/_install defined by Rules.mak is used,
  similarly it does not work correctly.
  Changed $$PREFIX into $(PREFIX) in order to fix this.
Patch by Hideki IWAMOTO
2003-08-29 12:20:31 +00:00
Glenn L McGrath b54a748621 Fix for compiling with ipv6 2003-08-29 11:34:08 +00:00
Glenn L McGrath 08dea3e5a7 "This function was not updating the argc and argv pointers to reflect
the arguments it consumed, which means the calling function encountered
them as well.  As a result, a command like "ip -6 addr" was yielding a usage
error." - Philip Blundell
2003-08-29 10:58:46 +00:00
Glenn L McGrath 62b031fb82 label's dont work in v4 tunnels, patch by Eric Spakman 2003-08-29 07:47:52 +00:00
Glenn L McGrath a6b7bdcf8c Vodz, last patch 105
Busybox "mount" applet unsupport "user" option and
result: must have _BB_SUID_NEVER applet option (my bug).
Last patch have reducing 216 bytes for "su" applet also.
2003-08-29 07:38:56 +00:00
Glenn L McGrath dc72f3ace2 Vodz, last patch 104 2003-08-29 07:35:08 +00:00
Glenn L McGrath 7b8765c808 vodz, last patch 103 2003-08-29 07:29:30 +00:00
Glenn L McGrath 23365976f8 Correct logic in determining size of block to download, as pointed out
by Junio C Hamano
2003-08-29 06:25:04 +00:00
Glenn L McGrath 523c1675a2 "Typo and/or thinko: scanning till the end of NUL terminated string
should check the byte pointed at not the pointer itself." -junkio@
2003-08-28 22:12:53 +00:00
Glenn L McGrath e7bdfccb3f "When the initial request by wget is responded by a 3XX redirect
response sent in chunked transfer encoding, the code path to
resubmit the request to the redirected URL forgets to reset
got_clen and chunked variables in the loop.  If the redirected
URL does not use chunked transfer encoding, this causes the code
that slurps the body of the response to incorrectly try to parse
out the chunk length which does not exist." - junkio@

----------------------------------------------------------------------
2003-08-28 22:03:19 +00:00
Glenn L McGrath 83e4a5bccf "When the filesize is known from content-length header, safe_fread is
always told to read sizeof(buf).  This waits until the underlying
fread() to time-out for the last part of the downloaded body.  Fix
this by sending the number of remaining bytes to read when known." -
junkio@
I reworked the logic in his patch
2003-08-28 21:55:22 +00:00
Glenn L McGrath 8b96b7169d *** empty log message *** 2003-08-28 19:54:16 +00:00
Glenn L McGrath 4cee66d5a8 Dont unlink when testing !
Always preserve creation date
Disable the -p option its for modification date
Remove some cpio header debugging noise
Syncronise file listing behaviour with upstream.
2003-08-28 19:12:23 +00:00
Robert Griebl 444566837c Removed some debug printfs 2003-08-26 11:06:39 +00:00
Glenn L McGrath b79db92a21 Syncronise some build files with busybox-cvs-20030819 2003-08-26 04:50:23 +00:00
Glenn L McGrath c3f2956cfa Woops, depend on SHA1 not the option 2003-08-26 04:28:05 +00:00
Glenn L McGrath 4d5e4685fe SHA1 options depend on SHA1 2003-08-26 04:25:59 +00:00
Glenn L McGrath ce6482eace Fix overflow for machines greater than 4GB, return unsigned int to avoid
a cast and for greater accuracy.
2003-08-26 02:14:58 +00:00
Eric Andersen 97e2426582 "staywithu" writes:
In BusyBox v1.00-pre2,
 commands like ls, df with -h option report a wrong file size for files larger than 4GBtye!!

For example,
   when I execute 'ls -l', it reports
      -rw-r--r--      1 root       root    5368709120    Aug    17  2003  large_stream.tp

   when I execute 'ls -lh', I expect that
      -rw-r--r--      1 root       root                5.0G    Aug    17  2003  large_stream.tp

  but it reports
      -rw-r--r--      1 root       root                1.0G    Aug    17  2003  large_stream.tp

I fixed this bug that...
 Line 31 in libbb/human_readable.c and line 275 include/libbb.h

     const char *make_human_readable_str(unsigned long size
      =>   const char *make_human_readable_str(unsigned long long size

It's OK!
2003-08-22 23:08:37 +00:00
Eric Andersen 6d3c7e7a9c trivial doc fix 2003-08-22 21:15:07 +00:00
Eric Andersen 24e098a77d Fixup 'make clean' to properly clean the _install directory 2003-08-22 20:53:38 +00:00
Glenn L McGrath d382c89467 Typo 2003-08-19 03:49:00 +00:00
Glenn L McGrath 3d5828fb6d Change hardlink handling for tar to work the same way as cpio 2003-08-14 02:55:15 +00:00
Manuel Novoa III 062913f662 Fix a bug reported by junkio@cox.net involving the mode_chars index. 2003-08-14 02:28:49 +00:00
Eric Andersen bf83355dda Patch from Paul Mundt (lethal) adding sh64 insmod support for busybox 2003-08-13 19:56:33 +00:00
Manuel Novoa III 4456f25e8f Rewrite timescmd() function to avoid the use of floating point and to
correct a bug in the seconds display where something like  65 seconds
would be output as "1m65.000000s".
2003-08-13 17:48:47 +00:00
Manuel Novoa III 5b3c05637d Remove unnecessary pointer dereference. 2003-08-13 12:11:33 +00:00
Eric Andersen 9a9f6777e9 fix style sheet so site doesn't look like crap with IE 2003-08-12 06:55:03 +00:00
Manuel Novoa III 96379b0d7d Adjust Erik's change, as I don't claim copyright of the applet. 2003-08-09 02:57:55 +00:00
Eric Andersen 8f4cdd516d Move shell descriptions to the config system 2003-08-08 23:41:50 +00:00
Eric Andersen b287e2e27a Use the new 'select' option to make the shell config
much less evil and far more obvious.
 -Erik
2003-08-08 23:40:12 +00:00
Eric Andersen c601ff149a Begin using the new "select" option. Good stuff! 2003-08-08 23:12:12 +00:00
Eric Andersen 2e9c257000 Implement a minimalist 'last' which allows the LEAF project to
no longer need dumtp.  Remove the 'dumtp' applet.
 -Erik
2003-08-08 22:26:06 +00:00
Eric Andersen f1c56a9306 quiet some noise 2003-08-08 22:13:41 +00:00
Eric Andersen 92fb9395f7 Kent Robotti noted that mt.c uses "rewind" not "rew" 2003-08-08 20:09:03 +00:00
Eric Andersen 99a75d1376 Patch from Kent Robotti to being fdisk in sync with v2.12 final. 2003-08-08 20:04:56 +00:00
Eric Andersen de6a6ae876 Remove unnecessary defamatory comment 2003-08-08 08:57:03 +00:00
Eric Andersen 6c0e0fb8ac Fix a stupid bug I introduced several months ago 2003-08-08 07:39:57 +00:00
Eric Andersen 3869f66eac Begin preparing for another release 2003-08-06 11:22:36 +00:00
Eric Andersen 9089844382 Latest dash update from vodz 2003-08-06 11:20:52 +00:00
Eric Andersen dc19af4179 Patch from Eric Spakman to update "run-parts" help text in Config.in. 2003-08-06 09:43:09 +00:00
Eric Andersen fdd2a0f318 Eric Spakman writes:
The attached patch adds "mtu" and "hwaddress" to the inet6 method and
"mtu", "hwaddr" and "pointopoint" to the inet4 method (just like in
the ifupdown part).
Note: "hwaddress" can't be used with the busybox ip applet (this
function isn't implemented in bb ip yet), but it can be of use with
an external "full blown" ip package.

The patch also removes "label" from the loopback configuration,
labels (subinterfaces) aren't used with loopback interfaces.

It further solves a problem in the bootp method, "ifconfig down
%interface%" should be "ifconfig %interface% down" and it's now also
possible to use ip with bootp.

The patch is fully tested with both busybox ip and "stand-alone" ip
and I didn't saw any problems.
2003-08-06 09:23:44 +00:00
Eric Andersen d3652bf334 Patch from vodz:
I wrote:
>>I think, fdisk have special ext2lseek special for:
>>disk can have size > 4Gb, but all any partitions have < 4Gb and lseek64
>>not require.
>>May be best create new configure option for set DOLFS for fdisk applet
>>if global DOLFS unset?
>


Erik Andersen wrote:
>Agreed.  Using an extra configure option when ! DOLFS
>would be a good idea.


Ok. Patch attached.
2003-08-06 09:07:37 +00:00
Eric Andersen 0a57a79e38 Patch from Steven Scholz:
should we rename the define into CONFIG_FEATURE_HDPARM_HDIO_DMA and
use it for "set" and "get" ???

Since although CONFIG_FEATURE_HDPARM_HDIO_GET_DMA is _not_ set I still
can use "hdparm -d 1 /dev/hda" to switch the DMA on.
Is this desireable or meant to be like that?

So how about the applied patch?
2003-08-06 08:57:35 +00:00
Eric Andersen 4b4e09854c Steven Scholz writes:
the output of lsmod (busybox-1.00-pre2) contains IMHO one "\n" too
    much when using CONFIG_FEATURE_CHECK_TAINTED_MODULE:

    ~ # lsmod
    Module                  Size  Used by    Tainted: P

    ds                      8364   1
    m8xx_pcmcia             5388   1
    pcmcia_core            40736   0 [ds m8xx_pcmcia]

and this patch from Steven fixes the problem
2003-08-06 08:53:13 +00:00
Eric Andersen 50af12dbd6 Sync hdparm -t and -T options with hdparm-5.3, which seems
to produce sensible results,
2003-08-06 08:47:59 +00:00
Eric Andersen 481772a4c2 Patch from vodz to cleanup libbb/obscure.c:password_check()
to not copy too much data.
2003-08-06 08:33:08 +00:00
Eric Andersen 5378fbcb33 Joe.C writes:
I've reported this bug in April and it still
    exists in 1.00-pre2. So I made patches for
    both 0.60.x and 1.00-pre2.  The patch is very
    simple, just use strncmp instead of strcmp.
    Please apply if it is OK.

   Here's the procedure to test this problem:
   Create a executable with very long name, say
   'test_1234567890123456' and execute it. Try
   using 'killall' or 'pidof' to find/kill this
   program.  Without this patch, you can't find
   the program.
2003-08-06 08:22:10 +00:00
Eric Andersen 8f4ef159f0 Fixup segfault on 'kill -q' 2003-08-06 07:43:58 +00:00
Eric Andersen c774efe317 extern inline is a bad bad thing. kill it (so mkfs_minix.c will
actually compile)
2003-08-06 07:34:19 +00:00
Eric Andersen 7001480a5e Seems I missed a spot 2003-08-05 05:59:48 +00:00
Eric Andersen 72d8e444f0 Merge/rework config system per the latest from linux-2.6.0-test2.
Fix the config bugs revealed by the updated config system.
 -Erik
2003-08-05 02:18:25 +00:00
Manuel Novoa III 461c279ac1 Might as well get my name in AUTHORS before 1.0... 2003-08-02 00:19:29 +00:00
Manuel Novoa III b1d5b741ac Save 0.5K. 2003-08-02 00:04:18 +00:00
Eric Andersen 546f21aa2d Remove code that too agressively disabled inlines 2003-08-01 22:27:57 +00:00
Eric Andersen e6b811583a Minor cleanup 2003-07-31 17:50:17 +00:00
Glenn L McGrath 91e464632b Fix bug when handling debian packages.
If we read the contents of compressed files within the ar archive,
e.g. control.tar.gz, then file position gets all out of whack, so
it has to be reset before reading thenext header.
2003-07-31 01:53:50 +00:00
Eric Andersen 6a9ca985b8 Remove LRP (now defunct) and replace it with leaf. 2003-07-30 17:17:33 +00:00
219 changed files with 19358 additions and 14213 deletions

No files matched your search

+19 -5
View File
@@ -11,7 +11,7 @@ incorect, _please_ let me know.
Emanuele Aina <emanuele.aina@tiscali.it>
run-parts
Erik Andersen <andersen@codepoet.org>, <andersen@codepoet.org>
Erik Andersen <andersen@codepoet.org>
Tons of new stuff, major rewrite of most of the
core apps, tons of new apps as noted in header files.
@@ -22,16 +22,16 @@ Jeff Angielski <jeff@theptrgroup.com>
ftpput, ftpget
Edward Betts <edward@debian.org>
expr, hostid, logname, tty, wc, whoami, yes
expr, hostid, logname, whoami
John Beppu <beppu@codepoet.org>
du, head, nslookup, sort, tee, uniq
du, nslookup, sort
Brian Candler <B.Candler@pobox.com>
tiny-ls(ls)
Randolph Chung <tausq@debian.org>
fbset, ping, hostname, and mkfifo
fbset, ping, hostname
Dave Cinege <dcinege@psychosis.com>
more(v2), makedevs, dutmp, modularization, auto links file,
@@ -67,11 +67,21 @@ Stephan Linz <linz@li-pro.net>
ipcalc, Red Hat equivalence
John Lombardo <john@deltanet.com>
dirname, tr
tr
Glenn McGrath <bug1@optushome.com.au>
ar, dpkg, dpkg-deb
Manuel Novoa III <mjn3@codepoet.org>
cat, head, mkfifo, mknod, rmdir, sleep, tee, tty, uniq, usleep, wc, yes,
mesg, vconfig, make_directory, parse_mode, dirname, mode_string,
get_last_path_component, simplify_path, and a number trivial libbb routines
also bug fixes, partial rewrites, and size optimizations in
ash, basename, cal, cmp, cp, df, du, echo, env, ln, logname, md5sum, mkdir,
mv, realpath, rm, sort, tail, touch, uname, watch, arith, human_readable,
interface, dutmp, ifconfig
Vladimir Oleynik <dzo@simtreas.ru>
cmdedit; xargs(current), httpd(current);
ports: ash, crond, fdisk, inetd, stty, traceroute, top;
@@ -109,3 +119,7 @@ Charles P. Wright <cpwright@villagenet.com>
Enrique Zanardi <ezanardi@ull.es>
tarcat (since removed), loadkmap, various fixes, Debian maintenance
Tito Ragusa <farmatito@tiscali.it>
devfsd and size optimizations in strings, openvt and deallocvt.
+2822 -821
View File
File diff suppressed because it is too large. Load diff
+30 -26
View File
@@ -36,6 +36,9 @@ CFLAGS += -I/usr/include/selinux
LIBRARIES += -lsecure
endif
CONFIG_CONFIG_IN = sysdeps/$(TARGET_OS)/Config.in
CONFIG_DEFCONFIG = sysdeps/$(TARGET_OS)/defconfig
ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
all: busybox busybox.links doc
@@ -45,7 +48,7 @@ all: busybox busybox.links doc
include $(patsubst %,%/Makefile.in, $(DIRS))
busybox: .depend include/config.h $(libraries-y)
$(CC) $(LDFLAGS) -o $@ $(libraries-y) $(LIBRARIES)
$(CC) $(LDFLAGS) -o $@ -Wl,--start-group $(libraries-y) $(LIBRARIES) -Wl,--end-group
$(STRIPCMD) $@
busybox.links: applets/busybox.mkll include/config.h
@@ -54,8 +57,9 @@ busybox.links: applets/busybox.mkll include/config.h
install: applets/install.sh busybox busybox.links
$(SHELL) $< $(PREFIX)
uninstall: busybox busybox.links
for i in `cat busybox.links` ; do rm -f $$PREFIX$$i; done
uninstall: busybox.links
rm -f $(PREFIX)/bin/busybox
for i in `cat busybox.links` ; do rm -f $(PREFIX)$$i; done
install-hardlinks: applets/install.sh busybox busybox.links
$(SHELL) $< $(PREFIX) --hardlinks
@@ -147,9 +151,9 @@ include/config/MARKER: depend scripts/split-include
include/config.h: .config
@if [ ! -x ./scripts/config/conf ] ; then \
make -C scripts/config conf; \
$(MAKE) -C scripts/config conf; \
fi;
@./scripts/config/conf -o sysdeps/$(TARGET_OS)/Config.in
@./scripts/config/conf -o $(CONFIG_CONFIG_IN)
%.o: %.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
@@ -167,36 +171,36 @@ all: menuconfig
# ---------------------------------------------------------------------------
scripts/config/conf:
make -C scripts/config conf
$(MAKE) -C scripts/config conf
-@if [ ! -f .config ] ; then \
cp sysdeps/$(TARGET_OS)/defconfig .config; \
cp $(CONFIG_DEFCONFIG) .config; \
fi
scripts/config/mconf:
make -C scripts/config ncurses conf mconf
$(MAKE) -C scripts/config ncurses conf mconf
-@if [ ! -f .config ] ; then \
cp sysdeps/$(TARGET_OS)/defconfig .config; \
cp $(CONFIG_DEFCONFIG) .config; \
fi
menuconfig: scripts/config/mconf
@./scripts/config/mconf sysdeps/$(TARGET_OS)/Config.in
@./scripts/config/mconf $(CONFIG_CONFIG_IN)
config: scripts/config/conf
@./scripts/config/conf sysdeps/$(TARGET_OS)/Config.in
@./scripts/config/conf $(CONFIG_CONFIG_IN)
oldconfig: scripts/config/conf
@./scripts/config/conf -o sysdeps/$(TARGET_OS)/Config.in
@./scripts/config/conf -o $(CONFIG_CONFIG_IN)
randconfig: scripts/config/conf
@./scripts/config/conf -r sysdeps/$(TARGET_OS)/Config.in
@./scripts/config/conf -r $(CONFIG_CONFIG_IN)
allyesconfig: scripts/config/conf
@./scripts/config/conf -y sysdeps/$(TARGET_OS)/Config.in
@./scripts/config/conf -y $(CONFIG_CONFIG_IN)
allnoconfig: scripts/config/conf
@./scripts/config/conf -n sysdeps/$(TARGET_OS)/Config.in
@./scripts/config/conf -n $(CONFIG_CONFIG_IN)
defconfig: scripts/config/conf
@./scripts/config/conf -d sysdeps/$(TARGET_OS)/Config.in
@./scripts/config/conf -d $(CONFIG_CONFIG_IN)
test tests: busybox
# Note that 'tests' is depricated. Use 'make check' instead
@@ -208,13 +212,13 @@ check: busybox
clean:
- $(MAKE) -C tests clean
- rm -f docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html \
docs/busybox.net/BusyBox.html
- rm -f docs/busybox.txt docs/busybox.dvi docs/busybox.ps \
docs/busybox.pdf docs/busybox.pod docs/busybox.net/busybox.html \
docs/busybox _install pod2htm* *.gdb *.elf *~ core
- rm -f busybox busybox.links libbb/loop.h .config.old .hdepend
- rm -f .*config.log
docs/busybox pod2htm* *.gdb *.elf *~ core .*config.log \
docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html \
docs/busybox.net/BusyBox.html busybox.links libbb/loop.h \
.config.old .hdepend busybox
- rm -rf _install
- find . -name .\*.flags -exec rm -f {} \;
- find . -name \*.o -exec rm -f {} \;
- find . -name \*.a -exec rm -f {} \;
@@ -228,20 +232,20 @@ distclean: clean
release: distclean #doc
cd ..; \
rm -rf busybox-$(VERSION); \
cp -a busybox busybox-$(VERSION); \
rm -rf $(PROG)-$(VERSION); \
cp -a busybox $(PROG)-$(VERSION); \
\
find busybox-$(VERSION)/ -type d \
find $(PROG)-$(VERSION)/ -type d \
-name CVS \
-print \
-exec rm -rf {} \; ; \
\
find busybox-$(VERSION)/ -type f \
find $(PROG)-$(VERSION)/ -type f \
-name .\#* \
-print \
-exec rm -f {} \; ; \
\
tar -cvzf busybox-$(VERSION).tar.gz busybox-$(VERSION)/;
tar -cvzf $(PROG)-$(VERSION).tar.gz $(PROG)-$(VERSION)/;
tags:
ctags -R .
+3 -33
View File
@@ -37,7 +37,7 @@ Supported architectures:
Busybox in general will build on any architecture supported by gcc. It has
a few specialized features added for __sparc__ and __alpha__. insmod
functionality is currently limited to x86, ARM, SH3/4, powerpc, m68k,
MIPS, and v850e.
MIPS, cris, and v850e.
Supported libcs:
@@ -56,36 +56,6 @@ Supported kernels:
----------------
Shells:
lash is the very smallest shell (adds just 10k) and it is quite usable as
a command prompt, but it is not suitable for any but the most trivial
scripting (such as an initrd that calls insmod a few times) since it does
not understand Bourne shell grammer. It does handle pipes, redirects, and
job control though. Adding in command editing makes it a very nice
lightweight command prompt.
hush is also quite small (just 18k) and it has very complete Bourne shell
grammer. It handles if/then/else/fi just fine, but doesn't handle loops
like for/do/done or case/esac and such. It also currently has a problem
with job control. Using hush is not yet recommended.
msh: The minix shell (adds just 30k) is quite complete and handles things
like for/do/done, case/esac and all the things you expect a Bourne shell to
do. It is not always pedantically correct about Bourne shell grammer (try
running the shell testscript "tests/sh.testcases" on it and compare vs bash)
but for most things it works quite well. It also uses only vfork, so it can
be used on uClinux systems. This was only recently added, so there is still
room to shrink it further...
ash: This adds about 60k in the default configuration and is the most
complete and most pedantically correct shell included with busybox. This
shell was also recently added, and several people (mainly Vladimir and Erik)
have been working on it. There are a number of configurable things at the
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
@@ -97,12 +67,12 @@ the mailing list if you are interested.
Bugs:
If you find bugs, please submit a detailed bug report to the busybox mailing
list at busybox@busybox.net. A well-written bug report should include a
list at busybox@mail.busybox.net. A well-written bug report should include a
transcript of a shell session that demonstrates the bad behavior and enables
anyone else to duplicate the bug on their own machine. The following is such
an example:
To: busybox@busybox.net
To: busybox@mail.busybox.net
From: diligent@testing.linux.org
Subject: /bin/date doesn't work
+2 -2
View File
@@ -19,7 +19,7 @@
#--------------------------------------------------------
PROG := busybox
VERSION := 1.00-pre2
VERSION := 1.00-pre4
BUILDTIME := $(shell TZ=UTC date -u "+%Y.%m.%d-%H:%M%z")
@@ -101,7 +101,7 @@ TARGET_ARCH=$(shell $(CC) -dumpmachine | sed -e s'/-.*//' \
)
endif
# Pull in the user's uClibc configuration
# Pull in the user's busybox configuration
ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
-include $(TOPDIR).config
endif
+11 -2
View File
@@ -135,6 +135,14 @@ int busybox_main(int argc, char **argv)
/* If we've already been here once, exit now */
if (been_there_done_that == 1 || argc < 1) {
const struct BB_applet *a = applets;
int output_width = 60;
#ifdef CONFIG_FEATURE_AUTOWIDTH
/* Obtain the terminal width. */
get_terminal_width_height(0, &output_width, NULL);
/* leading tab and room to wrap */
output_width -= 20;
#endif
fprintf(stderr, "%s\n\n"
"Usage: busybox [function] [arguments]...\n"
@@ -149,7 +157,7 @@ int busybox_main(int argc, char **argv)
col +=
fprintf(stderr, "%s%s", ((col == 0) ? "\t" : ", "),
(a++)->name);
if (col > 60 && a->name != 0) {
if (col > output_width && a->name != 0) {
fprintf(stderr, ",\n");
col = 0;
}
@@ -160,8 +168,9 @@ int busybox_main(int argc, char **argv)
/* Flag that we've been here already */
been_there_done_that = 1;
/* Move the command line down a notch */
/* Preserve pointers so setproctitle() works consistently */
len = argv[argc] + strlen(argv[argc]) - argv[1];
memmove(argv[0], argv[1], len);
memset(argv[0] + len, 0, argv[1] - argv[0]);
+31 -19
View File
@@ -16,13 +16,14 @@ config CONFIG_AR
The original files' contents, mode (permissions), timestamp, owner,
and group are preserved in the archive, and can be restored on
extraction.
The stored filename is limited to 15 characters. (for more information
see long filename support).
ar has 60 bytes of overheads for every stored file.
This implementation of ar can extract archives, it cannot create or
modify them.
On an x86 system, the ar applet adds about XXX bytes.
On an x86 system, the ar applet adds about 1K.
Unless you have a specific application which requires ar, you should
probably say N here.
@@ -41,14 +42,14 @@ config CONFIG_BUNZIP2
bool "bunzip2"
default n
help
bunzip2 is an compression utility using the Burrows-Wheeler block
bunzip2 is a 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.
On an x86 system, this applet adds about 11K.
Unless you have a specific application which requires bunzip2, you
should probably say N here.
@@ -92,7 +93,7 @@ config CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY
default n
depends on CONFIG_DPKG_DEB
help
This reduced dpkg-deb to the equivalent of "ar -p <deb> data.tar.gz | tar -zx".
This reduces dpkg-deb to the equivalent of "ar -p <deb> data.tar.gz | tar -zx".
However it saves space as none of the extra dpkg-deb, ar or tar options are
needed, they are linked to internally.
@@ -103,7 +104,7 @@ config CONFIG_FEATURE_DEB_TAR_GZ
help
This is the default compression method inside the debian ar file.
If you want compatability with standard .deb's you should say yes here.
If you want compatibility with standard .deb's you should say yes here.
config CONFIG_FEATURE_DEB_TAR_BZ2
bool " bzip2 debian packages"
@@ -113,7 +114,7 @@ config CONFIG_FEATURE_DEB_TAR_BZ2
This allows dpkg and dpkg-deb to extract deb's that are compressed internally
with bzip2 instead of gzip.
You only want this is your are creating your own custom debian packages that
You only want this if you are creating your own custom debian packages that
use an internal control.tar.bz2 or data.tar.bz2.
config CONFIG_GUNZIP
@@ -129,7 +130,7 @@ config CONFIG_FEATURE_GUNZIP_UNCOMPRESS
default n
depends on CONFIG_GUNZIP
help
If you want gunzip to have the ability to decompress
Enable if you want gunzip to have the ability to decompress
archives created by the program compress (not much
used anymore).
@@ -138,7 +139,7 @@ config CONFIG_GZIP
default n
help
gzip is used to compress files.
It's probably the most used UNIX compression program.
It's probably the most widely used UNIX compression program.
config CONFIG_RPM2CPIO
bool "rpm2cpio"
@@ -150,14 +151,14 @@ config CONFIG_RPM
bool "rpm"
default n
help
Mini RPM applet - querys and extracts
Mini RPM applet - queries and extracts
config CONFIG_TAR
bool "tar"
default n
help
tar is an archiving program. It's commonly used with gzip to
create compressed archives. It's probably the most used
create compressed archives. It's probably the most widely used
UNIX archive program.
config CONFIG_FEATURE_TAR_CREATE
@@ -192,13 +193,21 @@ config CONFIG_FEATURE_TAR_GZIP
If you enable this option tar will be able to call gzip,
when creating or extracting tar gziped archives.
config CONFIG_FEATURE_TAR_COMPRESS
bool " Enable -Z option"
default n
depends on CONFIG_TAR
help
If you enable this option tar will be able to call uncompress,
when extracting .tar.Z archives.
config CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY
bool " Enable support for old tar header format"
default N
depends on CONFIG_TAR
help
This option is required to unpack archives created with
in the old GNU format, help to kill this old format by
This option is required to unpack archives created in
the old GNU format; help to kill this old format by
repacking your ancient archives with the new format.
config CONFIG_FEATURE_TAR_GNU_EXTENSIONS
@@ -209,13 +218,6 @@ config CONFIG_FEATURE_TAR_GNU_EXTENSIONS
With this option busybox supports GNU long filenames and
linknames.
config CONFIG_FEATURE_UNARCHIVE_TAPE
bool " Enable tape drive support"
default n
depends on CONFIG_TAR || CONFIG_CPIO
help
I dont think this is needed anymore.
config CONFIG_UNCOMPRESS
bool "uncompress"
default n
@@ -233,4 +235,14 @@ config CONFIG_UNZIP
current directory. Use the `-d' option to extract to a
directory of your choice.
comment "Common options for cpio and tar"
depends on CONFIG_CPIO || CONFIG_TAR
config CONFIG_FEATURE_UNARCHIVE_TAPE
bool " Enable tape drive support"
default n
depends on CONFIG_CPIO || CONFIG_TAR
help
I don't think this is needed anymore.
endmenu
+1 -1
View File
@@ -59,7 +59,7 @@ static void data_extract_regular_file(archive_handle_t *archive_handle)
file_header = archive_handle->file_header;
dst_fd = bb_xopen(file_header->name, O_WRONLY | O_CREAT);
archive_copy_file(archive_handle, dst_fd);
bb_copyfd_size(archive_handle->src_fd, dst_fd, file_header->size);
close(dst_fd);
chmod(file_header->name, file_header->mode);
+5 -8
View File
@@ -83,16 +83,13 @@ int bunzip2_main(int argc, char **argv)
dst_fd = bb_xopen(save_name, O_WRONLY | O_CREAT);
}
if (uncompressStream(src_fd, dst_fd)) {
if (!(flags & bunzip_to_stdout)) {
status = uncompressStream(src_fd, dst_fd);
if(!(flags & bunzip_to_stdout)) {
if (status) {
delete_name = save_name;
} else {
delete_name = argv[optind];
}
status = EXIT_SUCCESS;
} else {
if (!(flags & bunzip_to_stdout)) {
delete_name = save_name;
}
status = EXIT_FAILURE;
}
if ((delete_name) && (unlink(delete_name) < 0)) {
+15 -5
View File
@@ -40,8 +40,8 @@ extern int cpio_main(int argc, char **argv)
archive_handle = init_handle();
archive_handle->src_fd = fileno(stdin);
archive_handle->seek = seek_by_char;
archive_handle->action_header = header_list;
archive_handle->flags = ARCHIVE_EXTRACT_NEWER | ARCHIVE_PRESERVE_DATE;
while ((opt = getopt(argc, argv, "idmuvtF:")) != -1) {
switch (opt) {
case 'i': /* extract */
@@ -50,17 +50,28 @@ extern int cpio_main(int argc, char **argv)
case 'd': /* create _leading_ directories */
archive_handle->flags |= ARCHIVE_CREATE_LEADING_DIRS;
break;
#if 0
case 'm': /* preserve modification time */
archive_handle->flags |= ARCHIVE_PRESERVE_DATE;
break;
#endif
case 'v': /* verbosly list files */
archive_handle->action_header = header_verbose_list;
if (archive_handle->action_header == header_list) {
archive_handle->action_header = header_verbose_list;
} else {
archive_handle->action_header = header_list;
}
break;
case 'u': /* unconditional */
archive_handle->flags |= ARCHIVE_EXTRACT_UNCONDITIONAL;
archive_handle->flags &= ~ARCHIVE_EXTRACT_NEWER;
break;
case 't': /* list files */
archive_handle->action_header = header_list;
if (archive_handle->action_header == header_list) {
archive_handle->action_header = header_verbose_list;
} else {
archive_handle->action_header = header_list;
}
break;
case 'F':
archive_handle->src_fd = bb_xopen(optarg, O_RDONLY);
@@ -81,4 +92,3 @@ extern int cpio_main(int argc, char **argv)
return(EXIT_SUCCESS);
}
+286 -106
View File
@@ -27,11 +27,8 @@
* consider important, its worth keeping a note of differences anyway, just to
* make it easier to maintain.
* - The first value for the Confflile: field isnt placed on a new line.
* - The <package>.control file is extracted and kept in the info dir.
* - When installing a package the Status: field is placed at the end of the
* section, rather than just after the Package: field.
* - Packages with previously unknown status are inserted at the begining of
* the status file
*
* Bugs that need to be fixed
* - (unknown, please let me know when you find any)
@@ -392,8 +389,54 @@ int search_package_hashtable(const unsigned int name, const unsigned int version
return(probe_address);
}
/*
* This function searches through the entire package_hashtable looking
* for a package which provides "needle". It returns the index into
* the package_hashtable for the provining package.
*
* needle is the index into name_hashtable of the package we are
* looking for.
*
* start_at is the index in the package_hashtable to start looking
* at. If start_at is -1 then start at the beginning. This is to allow
* for repeated searches since more than one package might provide
* needle.
*
* FIXME: I don't think this is very efficient, but I thought I'd keep
* it simple for now until it proves to be a problem.
*/
int search_for_provides(int needle, int start_at) {
int i, j;
common_node_t *p;
for (i = start_at + 1; i < PACKAGE_HASH_PRIME; i++) {
p = package_hashtable[i];
if ( p == NULL ) continue;
for(j = 0; j < p->num_of_edges; j++)
if ( p->edge[j]->type == EDGE_PROVIDES && p->edge[j]->name == needle )
return i;
}
return -1;
}
/*
* Add an edge to a node
*/
void add_edge_to_node(common_node_t *node, edge_t *edge)
{
node->num_of_edges++;
node->edge = xrealloc(node->edge, sizeof(edge_t) * (node->num_of_edges + 1));
node->edge[node->num_of_edges - 1] = edge;
}
/*
* Create one new node and one new edge for every dependency.
*
* Dependencies which contain multiple alternatives are represented as
* an EDGE_OR_PRE_DEPENDS or EDGE_OR_DEPENDS node, followed by a
* number of EDGE_PRE_DEPENDS or EDGE_DEPENDS nodes. The name field of
* the OR edge contains the full dependency string while the version
* field contains the number of EDGE nodes which follow as part of
* this alternative.
*/
void add_split_dependencies(common_node_t *parent_node, const char *whole_line, unsigned int edge_type)
{
@@ -405,25 +448,33 @@ void add_split_dependencies(common_node_t *parent_node, const char *whole_line,
char *field2;
char *version;
edge_t *edge;
edge_t *or_edge;
int offset_ch;
int type;
field = strtok_r(line, ",", &line_ptr1);
do {
/* skip leading spaces */
field += strspn(field, " ");
line2 = bb_xstrdup(field);
field2 = strtok_r(line2, "|", &line_ptr2);
if ((edge_type == EDGE_DEPENDS) && (strcmp(field, field2) != 0)) {
type = EDGE_OR_DEPENDS;
}
else if ((edge_type == EDGE_PRE_DEPENDS) && (strcmp(field, field2) != 0)) {
type = EDGE_OR_PRE_DEPENDS;
if ( (edge_type == EDGE_DEPENDS || edge_type == EDGE_PRE_DEPENDS) &&
(strcmp(field, field2) != 0)) {
or_edge = (edge_t *)xmalloc(sizeof(edge_t));
or_edge->type = edge_type + 1;
} else {
type = edge_type;
or_edge = NULL;
}
if ( or_edge ) {
or_edge->name = search_name_hashtable(field);
or_edge->version = 0; // tracks the number of altenatives
add_edge_to_node(parent_node, or_edge);
}
do {
edge = (edge_t *) xmalloc(sizeof(edge_t));
edge->type = type;
edge->type = edge_type;
/* Skip any extra leading spaces */
field2 += strspn(field2, " ");
@@ -473,11 +524,11 @@ void add_split_dependencies(common_node_t *parent_node, const char *whole_line,
/* Get the dependency name */
field2[strcspn(field2, " (")] = '\0';
edge->name = search_name_hashtable(field2);
/* link the new edge to the current node */
parent_node->num_of_edges++;
parent_node->edge = xrealloc(parent_node->edge, sizeof(edge_t) * (parent_node->num_of_edges + 1));
parent_node->edge[parent_node->num_of_edges - 1] = edge;
if ( or_edge )
or_edge->version++;
add_edge_to_node(parent_node, edge);
} while ((field2 = strtok_r(NULL, "|", &line_ptr2)) != NULL);
free(line2);
} while ((field = strtok_r(NULL, ",", &line_ptr1)) != NULL);
@@ -493,7 +544,8 @@ void free_package(common_node_t *node)
for (i = 0; i < node->num_of_edges; i++) {
free(node->edge[i]);
}
free(node->edge);
if ( node->edge )
free(node->edge);
free(node);
}
}
@@ -630,6 +682,31 @@ void set_status(const unsigned int status_node_num, const char *new_value, const
return;
}
const char *describe_status(int status_num) {
int status_want, status_state ;
if ( status_hashtable[status_num] == NULL || status_hashtable[status_num]->status == 0 )
return "is not installed or flagged to be installed\n";
status_want = get_status(status_num, 1);
status_state = get_status(status_num, 3);
if ( status_state == search_name_hashtable("installed") ) {
if ( status_want == search_name_hashtable("install") )
return "is installed";
if ( status_want == search_name_hashtable("deinstall") )
return "is marked to be removed";
if ( status_want == search_name_hashtable("purge") )
return "is marked to be purged";
}
if ( status_want == search_name_hashtable("unknown") )
return "is in an indeterminate state";
if ( status_want == search_name_hashtable("install") )
return "is marked to be installed";
return "is not installed or flagged to be installed";
}
void index_status_file(const char *filename)
{
FILE *status_file;
@@ -662,7 +739,7 @@ void index_status_file(const char *filename)
return;
}
#if 0 /* this code is no longer used */
char *get_depends_field(common_node_t *package, const int depends_type)
{
char *depends = NULL;
@@ -733,6 +810,7 @@ char *get_depends_field(common_node_t *package, const int depends_type)
}
return(depends);
}
#endif
void write_buffer_no_status(FILE *new_status_file, const char *control_buffer)
{
@@ -893,13 +971,34 @@ void write_status_file(deb_file_t **deb_file)
}
}
/* This function returns TRUE if the given package can statisfy a
* dependency of type depend_type.
*
* A pre-depends is statisfied only if a package is already installed,
* which a regular depends can be satisfied by a package which we want
* to install.
*/
int package_satisfies_dependency(int package, int depend_type)
{
int status_num = search_status_hashtable(name_hashtable[package_hashtable[package]->name]);
/* status could be unknown if package is a pure virtual
* provides which cannot satisfy any dependency by itself.
*/
if ( status_hashtable[status_num] == NULL )
return 0;
switch (depend_type) {
case EDGE_PRE_DEPENDS: return get_status(status_num, 3) == search_name_hashtable("installed");
case EDGE_DEPENDS: return get_status(status_num, 1) == search_name_hashtable("install");
}
return 0;
}
int check_deps(deb_file_t **deb_file, int deb_start, int dep_max_count)
{
int *conflicts = NULL;
int conflicts_num = 0;
int state_status;
int state_flag;
int state_want;
int i = deb_start;
int j;
@@ -955,21 +1054,17 @@ int check_deps(deb_file_t **deb_file, int deb_start, int dep_max_count)
for (j = 0; j < package_node->num_of_edges; j++) {
const edge_t *package_edge = package_node->edge[j];
const unsigned int package_num =
search_package_hashtable(package_edge->name,
package_edge->version, package_edge->operator);
if (package_edge->type == EDGE_CONFLICTS) {
const unsigned int package_num =
search_package_hashtable(package_edge->name,
package_edge->version,
package_edge->operator);
int result = 0;
if (package_hashtable[package_num] != NULL) {
status_num = search_status_hashtable(name_hashtable[package_hashtable[package_num]->name]);
state_status = get_status(status_num, 3);
state_flag = get_status(status_num, 1);
result = (state_status == search_name_hashtable("installed")) ||
(state_flag == search_name_hashtable("want-install"));
if (result) {
if (get_status(status_num, 1) == search_name_hashtable("install")) {
result = test_version(package_hashtable[deb_file[i]->package]->version,
package_edge->version, package_edge->operator);
}
@@ -987,66 +1082,123 @@ int check_deps(deb_file_t **deb_file, int deb_start, int dep_max_count)
/* Check dependendcies */
i = 0;
while (deb_file[i] != NULL) {
const common_node_t *package_node = package_hashtable[deb_file[i]->package];
for (i = 0; i < PACKAGE_HASH_PRIME; i++) {
int status_num = 0;
int number_of_alternatives = 0;
const edge_t * root_of_alternatives;
const common_node_t *package_node = package_hashtable[i];
status_num = search_status_hashtable(name_hashtable[package_node->name]);
state_status = get_status(status_num, 3);
state_want = get_status(status_num, 1);
/* If the package node does not exist then this
* package is a virtual one. In which case there are
* no dependencies to check.
*/
if ( package_node == NULL ) continue;
if (state_status == search_name_hashtable("installed")) {
i++;
status_num = search_status_hashtable(name_hashtable[package_node->name]);
/* If there is no status then this package is a
* virtual one provided by something else. In which
* case there are no dependencies to check.
*/
if ( status_hashtable[status_num] == NULL ) continue;
/* If we don't want this package installed then we may
* as well ignore it's dependencies.
*/
if (get_status(status_num, 1) != search_name_hashtable("install")) {
continue;
}
for (j = 0; j < package_hashtable[deb_file[i]->package]->num_of_edges; j++) {
#if 0
/* This might be needed so we don't complain about
* things which are broken but unrelated to the
* packages that are currently being installed
*/
if (state_status == search_name_hashtable("installed"))
continue;
#endif
/* This code is tested only for EDGE_DEPENDS, sine I
* have no suitable pre-depends available. There is no
* reason that it shouldn't work though :-)
*/
for (j = 0; j < package_node->num_of_edges; j++) {
const edge_t *package_edge = package_node->edge[j];
unsigned int package_num;
if ( package_edge->type == EDGE_OR_PRE_DEPENDS ||
package_edge->type == EDGE_OR_DEPENDS ) { /* start an EDGE_OR_ list */
number_of_alternatives = package_edge->version;
root_of_alternatives = package_edge;
continue;
} else if ( number_of_alternatives == 0 ) { /* not in the middle of an EDGE_OR_ list */
number_of_alternatives = 1;
root_of_alternatives = NULL;
}
package_num = search_package_hashtable(package_edge->name, package_edge->version, package_edge->operator);
switch (package_edge->type) {
case(EDGE_PRE_DEPENDS):
case(EDGE_OR_PRE_DEPENDS): {
int result=1;
/* It must be already installed */
/* NOTE: This is untested, nothing apropriate in my status file */
if (package_hashtable[package_num] != NULL) {
status_num = search_status_hashtable(name_hashtable[package_hashtable[package_num]->name]);
state_status = get_status(status_num, 3);
state_want = get_status(status_num, 1);
result = (state_status != search_name_hashtable("installed"));
}
if (package_edge->type == EDGE_PRE_DEPENDS ||
package_edge->type == EDGE_DEPENDS ) {
int result=1;
status_num = 0;
if (result) {
bb_error_msg_and_die("Package %s pre-depends on %s, but it is not installed",
name_hashtable[package_node->name],
name_hashtable[package_edge->name]);
/* If we are inside an alternative then check
* this edge is the right type.
*
* EDGE_DEPENDS == OR_DEPENDS -1
* EDGE_PRE_DEPENDS == OR_PRE_DEPENDS -1
*/
if ( root_of_alternatives && package_edge->type != root_of_alternatives->type - 1)
bb_error_msg_and_die("Fatal error. Package dependencies corrupt: %d != %d - 1 \n",
package_edge->type, root_of_alternatives->type);
if (package_hashtable[package_num] != NULL)
result = !package_satisfies_dependency(package_num, package_edge->type);
if (result) { /* check for other package which provide what we are looking for */
int provider = -1;
while ( (provider = search_for_provides(package_edge->name, provider) ) > -1 ) {
if ( package_hashtable[provider] == NULL ) {
printf("Have a provider but no package information for it\n");
continue;
}
result = !package_satisfies_dependency(provider, package_edge->type);
if ( result == 0 )
break;
}
break;
}
case(EDGE_DEPENDS):
case(EDGE_OR_DEPENDS): {
int result=1;
if (package_hashtable[package_num] != NULL) {
status_num = search_status_hashtable(name_hashtable[package_hashtable[package_num]->name]);
state_status = get_status(status_num, 3);
state_want = get_status(status_num, 1);
result=(state_status != search_name_hashtable("installed")) && (state_want != search_name_hashtable("want-install"));
}
/* It must be already installed, or to be installed */
if (result) {
bb_error_msg_and_die("Package %s depends on %s, but it is not installed, or flaged to be installed",
/* It must be already installed, or to be installed */
number_of_alternatives--;
if (result && number_of_alternatives == 0) {
if ( root_of_alternatives )
bb_error_msg_and_die(
"Package %s %sdepends on %s, "
"which cannot be satisfied",
name_hashtable[package_node->name],
name_hashtable[package_edge->name]);
}
break;
package_edge->type == EDGE_PRE_DEPENDS ? "pre-" : "",
name_hashtable[root_of_alternatives->name]);
else
bb_error_msg_and_die(
"Package %s %sdepends on %s, which %s\n",
name_hashtable[package_node->name],
package_edge->type == EDGE_PRE_DEPENDS ? "pre-" : "",
name_hashtable[package_edge->name],
describe_status(status_num));
} else if ( result == 0 && number_of_alternatives ) {
/* we've found a package which
* satisfies the dependency,
* so skip over the rest of
* the alternatives.
*/
j += number_of_alternatives;
number_of_alternatives = 0;
}
}
}
i++;
}
free(conflicts);
return(TRUE);
@@ -1138,21 +1290,22 @@ int run_package_script(const char *package_name, const char *script_type)
return(result);
}
const char *all_control_files[] = {"preinst", "postinst", "prerm", "postrm",
"list", "md5sums", "shlibs", "conffiles", "config", "templates", NULL };
char **all_control_list(const char *package_name)
{
const char *extensions[11] = {"preinst", "postinst", "prerm", "postrm",
"list", "md5sums", "shlibs", "conffiles", "config", "templates", NULL };
unsigned short i = 0;
char **remove_files;
/* Create a list of all /var/lib/dpkg/info/<package> files */
remove_files = malloc(sizeof(char *) * 11);
while (extensions[i]) {
remove_files[i] = xmalloc(strlen(package_name) + strlen(extensions[i]) + 21);
sprintf(remove_files[i], "/var/lib/dpkg/info/%s.%s", package_name, extensions[i]);
remove_files = malloc(sizeof(all_control_files));
while (all_control_files[i]) {
remove_files[i] = xmalloc(strlen(package_name) + strlen(all_control_files[i]) + 21);
sprintf(remove_files[i], "/var/lib/dpkg/info/%s.%s", package_name, all_control_files[i]);
i++;
}
remove_files[10] = NULL;
remove_files[sizeof(all_control_files)/sizeof(char*) - 1] = NULL;
return(remove_files);
}
@@ -1211,9 +1364,10 @@ void list_packages(void)
}
}
void remove_package(const unsigned int package_num)
void remove_package(const unsigned int package_num, int noisy)
{
const char *package_name = name_hashtable[package_hashtable[package_num]->name];
const char *package_version = name_hashtable[package_hashtable[package_num]->version];
const unsigned int status_num = search_status_hashtable(package_name);
const int package_name_length = strlen(package_name);
char **remove_files;
@@ -1222,7 +1376,8 @@ void remove_package(const unsigned int package_num)
char conffile_name[package_name_length + 30];
int return_value;
printf("Removing %s ...\n", package_name);
if ( noisy )
printf("Removing %s (%s) ...\n", package_name, package_version);
/* run prerm script */
return_value = run_package_script(package_name, "prerm");
@@ -1260,18 +1415,20 @@ void remove_package(const unsigned int package_num)
rename(conffile_name, list_name);
/* Change package status */
set_status(status_num, "deinstall", 1);
set_status(status_num, "config-files", 3);
}
void purge_package(const unsigned int package_num)
{
const char *package_name = name_hashtable[package_hashtable[package_num]->name];
const char *package_version = name_hashtable[package_hashtable[package_num]->version];
const unsigned int status_num = search_status_hashtable(package_name);
char **remove_files;
char **exclude_files;
char list_name[strlen(package_name) + 25];
printf("Purging %s (%s) ...\n", package_name, package_version);
/* run prerm script */
if (run_package_script(package_name, "prerm") != 0) {
bb_error_msg_and_die("script failed, prerm failure");
@@ -1300,7 +1457,6 @@ void purge_package(const unsigned int package_num)
}
/* Change package status */
set_status(status_num, "purge", 1);
set_status(status_num, "not-installed", 3);
}
@@ -1322,7 +1478,6 @@ static void init_archive_deb_control(archive_handle_t *ar_handle)
/* Setup the tar archive handle */
tar_handle = init_handle();
tar_handle->filter = filter_accept_list;
tar_handle->src_fd = ar_handle->src_fd;
/* We dont care about data.tar.* or debian-binary, just control.tar.* */
@@ -1345,15 +1500,14 @@ static void init_archive_deb_data(archive_handle_t *ar_handle)
/* Setup the tar archive handle */
tar_handle = init_handle();
tar_handle->filter = filter_accept_all;
tar_handle->src_fd = ar_handle->src_fd;
/* We dont care about data.tar.* or debian-binary, just control.tar.* */
/* We dont care about control.tar.* or debian-binary, just data.tar.* */
#ifdef CONFIG_FEATURE_DEB_TAR_GZ
tar_handle->accept = llist_add_to(NULL, "data.tar.gz");
ar_handle->accept = llist_add_to(NULL, "data.tar.gz");
#endif
#ifdef CONFIG_FEATURE_DEB_TAR_BZ2
tar_handle->accept = llist_add_to(ar_handle->accept, "data.tar.bz2");
ar_handle->accept = llist_add_to(ar_handle->accept, "data.tar.bz2");
#endif
/* Assign the tar handle as a subarchive of the ar handle */
@@ -1362,10 +1516,10 @@ static void init_archive_deb_data(archive_handle_t *ar_handle)
return;
}
static char *deb_extract_control_file_to_buffer(archive_handle_t *ar_handle, llist_t *accept)
static char *deb_extract_control_file_to_buffer(archive_handle_t *ar_handle, llist_t *myaccept)
{
ar_handle->sub_archive->action_data = data_extract_to_buffer;
ar_handle->sub_archive->accept = accept;
ar_handle->sub_archive->accept = myaccept;
unpack_ar_archive(ar_handle);
close(ar_handle->src_fd);
@@ -1395,6 +1549,8 @@ static void unpack_package(deb_file_t *deb_file)
char *info_prefix;
archive_handle_t *archive_handle;
FILE *out_stream;
llist_t *accept_list = NULL;
int i = 0;
/* If existing version, remove it first */
if (strcmp(name_hashtable[get_status(status_num, 3)], "installed") == 0) {
@@ -1402,7 +1558,7 @@ static void unpack_package(deb_file_t *deb_file)
printf("Preparing to replace %s %s (using %s) ...\n", package_name,
name_hashtable[package_hashtable[status_package_num]->version],
deb_file->filename);
remove_package(status_package_num);
remove_package(status_package_num, 0);
} else {
printf("Unpacking %s (from %s) ...\n", package_name, deb_file->filename);
}
@@ -1412,8 +1568,18 @@ static void unpack_package(deb_file_t *deb_file)
sprintf(info_prefix, "/var/lib/dpkg/info/%s.", package_name);
archive_handle = init_archive_deb_ar(deb_file->filename);
init_archive_deb_control(archive_handle);
while(all_control_files[i]) {
char *c = (char *) xmalloc(3 + bb_strlen(all_control_files[i]));
sprintf(c, "./%s", all_control_files[i]);
accept_list= llist_add_to(accept_list, c);
i++;
}
archive_handle->sub_archive->accept = accept_list;
archive_handle->sub_archive->filter = filter_accept_list;
archive_handle->sub_archive->action_data = data_extract_all_prefix;
archive_handle->sub_archive->buffer = info_prefix;
archive_handle->sub_archive->flags |= ARCHIVE_EXTRACT_UNCONDITIONAL;
unpack_ar_archive(archive_handle);
/* Run the preinst prior to extracting */
@@ -1425,16 +1591,19 @@ static void unpack_package(deb_file_t *deb_file)
/* Extract data.tar.gz to the root directory */
archive_handle = init_archive_deb_ar(deb_file->filename);
init_archive_deb_data(archive_handle);
archive_handle->sub_archive->action_data = data_extract_all_prefix;
archive_handle->sub_archive->buffer = "/";
archive_handle->sub_archive->flags |= ARCHIVE_EXTRACT_UNCONDITIONAL;
unpack_ar_archive(archive_handle);
/* Create the list file */
strcat(info_prefix, "list");
out_stream = bb_xfopen(info_prefix, "w");
while (archive_handle->passed) {
/* blindly skip over the leading '.' */
fputs(archive_handle->passed->data + 1, out_stream);
while (archive_handle->sub_archive->passed) {
/* the leading . has been stripped by data_extract_all_prefix already */
fputs(archive_handle->sub_archive->passed->data, out_stream);
fputc('\n', out_stream);
archive_handle->passed = archive_handle->passed->link;
archive_handle->sub_archive->passed = archive_handle->sub_archive->passed->link;
}
fclose(out_stream);
@@ -1451,7 +1620,7 @@ void configure_package(deb_file_t *deb_file)
const char *package_version = name_hashtable[package_hashtable[deb_file->package]->version];
const int status_num = search_status_hashtable(package_name);
printf("Setting up %s (%s)\n", package_name, package_version);
printf("Setting up %s (%s) ...\n", package_name, package_version);
/* Run the postinst script */
if (run_package_script(package_name, "postinst") != 0) {
@@ -1485,6 +1654,7 @@ int dpkg_main(int argc, char **argv)
if (strcmp(optarg, "depends") == 0) {
dpkg_opt |= dpkg_opt_force_ignore_depends;
}
break;
case 'i':
dpkg_opt |= dpkg_opt_install;
dpkg_opt |= dpkg_opt_filename;
@@ -1550,19 +1720,20 @@ int dpkg_main(int argc, char **argv)
/* Add the package to the status hashtable */
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;
/* 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)) {
status_node = (status_node_t *) xmalloc(sizeof(status_node_t));
status_node->package = deb_file[deb_count]->package;
/* reinstreq isnt changed to "ok" until the package control info
* is written to the status file*/
status_node->status = search_name_hashtable("want-install reinstreq not-installed");
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("want-install reinstreq not-installed");
set_status(status_num, "install", 1);
set_status(status_num, "reinstreq", 2);
}
}
}
@@ -1575,20 +1746,24 @@ int dpkg_main(int argc, char **argv)
if (package_hashtable[deb_file[deb_count]->package] == NULL) {
bb_error_msg_and_die("Package %s is uninstalled or unknown\n", argv[optind]);
}
state_status = get_status(search_status_hashtable(name_hashtable[package_hashtable[deb_file[deb_count]->package]->name]), 3);
package_num = deb_file[deb_count]->package;
status_num = search_status_hashtable(name_hashtable[package_hashtable[package_num]->name]);
state_status = get_status(status_num, 3);
/* check package status is "installed" */
if (dpkg_opt & dpkg_opt_remove) {
if ((strcmp(name_hashtable[state_status], "not-installed") == 0) ||
(strcmp(name_hashtable[state_status], "config-files") == 0)) {
bb_error_msg_and_die("%s is already removed.", name_hashtable[package_hashtable[deb_file[deb_count]->package]->name]);
bb_error_msg_and_die("%s is already removed.", name_hashtable[package_hashtable[package_num]->name]);
}
set_status(status_num, "deinstall", 1);
}
else if (dpkg_opt & dpkg_opt_purge) {
/* if package status is "conf-files" then its ok */
if (strcmp(name_hashtable[state_status], "not-installed") == 0) {
bb_error_msg_and_die("%s is already purged.", name_hashtable[package_hashtable[deb_file[deb_count]->package]->name]);
bb_error_msg_and_die("%s is already purged.", name_hashtable[package_hashtable[package_num]->name]);
}
set_status(status_num, "purge", 1);
}
}
deb_count++;
@@ -1597,17 +1772,17 @@ int dpkg_main(int argc, char **argv)
deb_file[deb_count] = NULL;
/* Check that the deb file arguments are installable */
/* TODO: check dependencies before removing */
if ((dpkg_opt & dpkg_opt_force_ignore_depends) != dpkg_opt_force_ignore_depends) {
if (!check_deps(deb_file, 0, deb_count)) {
bb_error_msg_and_die("Dependency check failed");
}
}
/* TODO: install or remove packages in the correct dependency order */
for (i = 0; i < deb_count; i++) {
/* Remove or purge packages */
if (dpkg_opt & dpkg_opt_remove) {
remove_package(deb_file[i]->package);
remove_package(deb_file[i]->package, 1);
}
else if (dpkg_opt & dpkg_opt_purge) {
purge_package(deb_file[i]->package);
@@ -1617,12 +1792,17 @@ int dpkg_main(int argc, char **argv)
}
else if (dpkg_opt & dpkg_opt_install) {
unpack_package(deb_file[i]);
configure_package(deb_file[i]);
/* package is configured in second pass below */
}
else if (dpkg_opt & dpkg_opt_configure) {
configure_package(deb_file[i]);
}
}
/* configure installed packages */
if (dpkg_opt & dpkg_opt_install) {
for (i = 0; i < deb_count; i++)
configure_package(deb_file[i]);
}
write_status_file(deb_file);
+1 -2
View File
@@ -179,11 +179,10 @@ extern int gunzip_main(int argc, char **argv)
#endif
if (magic2 == 0x8b) {
check_header_gzip(src_fd);
status = inflate(src_fd, dst_fd);
status = inflate_gunzip(src_fd, dst_fd);
if (status != 0) {
bb_error_msg_and_die("Error inflating");
}
check_trailer_gzip(src_fd);
} else {
bb_error_msg_and_die("Invalid magic");
}
+1 -4
View File
@@ -305,8 +305,6 @@ DECLARE(ush, d_buf, DIST_BUFSIZE);
DECLARE(uch, window, 2L * WSIZE);
DECLARE(ush, tab_prefix, 1L << BITS);
static int crc_table_empty = 1;
static int foreground; /* set if program run in foreground */
static int method = DEFLATED; /* compression method */
static int exit_code = OK; /* program exit code */
@@ -387,14 +385,13 @@ static ulg updcrc(uch * s, unsigned n)
register ulg c; /* temporary variable */
static unsigned long crc_32_tab[256];
if (crc_table_empty) {
if (crc_32_tab[1] == 0x00000000L) {
unsigned long csr; /* crc shift register */
const unsigned long e = 0xedb88320L; /* polynomial exclusive-or pattern */
int i; /* counter for all possible eight bit values */
int k; /* byte being shifted into crc apparatus */
/* Compute table of CRC's. */
crc_32_tab[0] = 0x00000000L;
for (i = 1; i < 256; i++) {
csr = i;
/* The idea to initialize the register with the byte instead of
+26 -25
View File
@@ -31,46 +31,47 @@ LIBUNARCHIVE-y:= \
\
filter_accept_all.o \
filter_accept_list.o \
filter_accept_list_reassign.o \
filter_accept_reject_list.o \
\
get_header_ar.o \
get_header_cpio.o \
get_header_tar.o \
get_header_tar_bz2.o \
get_header_tar_gz.o \
\
header_skip.o \
header_list.o \
header_verbose_list.o \
\
archive_xread.o \
archive_xread_all.o \
archive_xread_all_eof.o \
archive_xread_char.o \
\
seek_by_char.o \
seek_by_jump.o \
\
archive_copy_file.o \
\
check_header_gzip.o \
data_align.o \
decompress_bunzip2.o \
find_list_entry.o \
init_handle.o \
uncompress.o \
unpack_ar_archive.o \
unzip.o
open_transformer.o \
init_handle.o
LIBUNARCHIVE-$(CONFIG_DPKG) +=
LIBUNARCHIVE-$(CONFIG_DPKG_DEB) +=
LIBUNARCHIVE-$(CONFIG_AR) +=
LIBUNARCHIVE-$(CONFIG_CPIO) +=
LIBUNARCHIVE-$(CONFIG_GUNZIP) +=
LIBUNARCHIVE-$(CONFIG_RPM2CPIO) +=
LIBUNARCHIVE-$(CONFIG_TAR) +=
LIBUNARCHIVE-$(CONFIG_UNZIP) +=
GUNZIP_FILES:= check_header_gzip.o unzip.o
DPKG_FILES:= \
get_header_ar.o \
unpack_ar_archive.o \
get_header_tar.o \
filter_accept_list_reassign.o
LIBUNARCHIVE-$(CONFIG_AR) += get_header_ar.o unpack_ar_archive.o
LIBUNARCHIVE-$(CONFIG_BUNZIP2) += decompress_bunzip2.o
LIBUNARCHIVE-$(CONFIG_CPIO) += get_header_cpio.o
LIBUNARCHIVE-$(CONFIG_DPKG) += $(DPKG_FILES)
LIBUNARCHIVE-$(CONFIG_DPKG_DEB) += $(DPKG_FILES)
LIBUNARCHIVE-$(CONFIG_FEATURE_DEB_TAR_GZ) += $(GUNZIP_FILES) get_header_tar_gz.o
LIBUNARCHIVE-$(CONFIG_FEATURE_DEB_TAR_BZ2) += decompress_bunzip2.o get_header_tar_bz2.o
LIBUNARCHIVE-$(CONFIG_GUNZIP) += $(GUNZIP_FILES)
LIBUNARCHIVE-$(CONFIG_FEATURE_GUNZIP_UNCOMPRESS) += uncompress.o
LIBUNARCHIVE-$(CONFIG_RPM2CPIO) += $(GUNZIP_FILES) get_header_cpio.o
LIBUNARCHIVE-$(CONFIG_RPM) += $(GUNZIP_FILES) get_header_cpio.o
LIBUNARCHIVE-$(CONFIG_TAR) += get_header_tar.o
LIBUNARCHIVE-$(CONFIG_FEATURE_TAR_BZIP2) += decompress_bunzip2.o get_header_tar_bz2.o
LIBUNARCHIVE-$(CONFIG_FEATURE_TAR_GZIP) += $(GUNZIP_FILES) get_header_tar_gz.o
LIBUNARCHIVE-$(CONFIG_FEATURE_TAR_COMPRESS) += uncompress.o
LIBUNARCHIVE-$(CONFIG_UNCOMPRESS) += uncompress.o
LIBUNARCHIVE-$(CONFIG_UNZIP) += $(GUNZIP_FILES)
libraries-y+=$(LIBUNARCHIVE_DIR)$(LIBUNARCHIVE_AR)
-44
View File
@@ -1,44 +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 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 <unistd.h>
#include "libbb.h"
#include "unarchive.h"
extern void archive_copy_file(const archive_handle_t *archive_handle, const int dst_fd)
{
char buffer[512];
off_t chunksize = archive_handle->file_header->size;
while (chunksize != 0) {
size_t size;
if (chunksize > 512) {
size = 512;
} else {
size = chunksize;
}
// archive_xread_all(archive_handle, buffer, size);
size = archive_xread(archive_handle, buffer, size);
if (write(dst_fd, buffer, size) != size) {
bb_error_msg_and_die ("Short write");
}
chunksize -= size;
}
return;
}
+1 -1
View File
@@ -24,7 +24,7 @@ extern void archive_xread_all(const archive_handle_t *archive_handle, void *buf,
{
ssize_t size;
size = archive_xread(archive_handle, buf, count);
size = bb_full_read(archive_handle->src_fd, buf, count);
if (size != count) {
bb_error_msg_and_die("Short read");
}
@@ -24,7 +24,7 @@ extern ssize_t archive_xread_all_eof(archive_handle_t *archive_handle, unsigned
{
ssize_t size;
size = archive_xread(archive_handle, buf, count);
size = bb_full_read(archive_handle->src_fd, buf, count);
if ((size != 0) && (size != count)) {
bb_perror_msg_and_die("Short read, read %d of %d", size, count);
}
-1
View File
@@ -27,7 +27,6 @@ extern void data_align(archive_handle_t *archive_handle, const unsigned short bo
const unsigned short skip_amount = (boundary - (archive_handle->offset % boundary)) % boundary;
archive_handle->seek(archive_handle, skip_amount);
archive_handle->offset += skip_amount;
return;
+68 -46
View File
@@ -39,58 +39,80 @@ extern void data_extract_all(archive_handle_t *archive_handle)
free(name);
}
/* Create the filesystem entry */
switch(file_header->mode & S_IFMT) {
case S_IFREG: {
#ifdef CONFIG_CPIO
if (file_header->link_name && file_header->size == 0) {
/* hard link */
res = link(file_header->link_name, file_header->name);
if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
bb_perror_msg("Couldnt create hard link");
}
} else
#endif
{
/* Regular file */
unlink(file_header->name);
dst_fd = bb_xopen(file_header->name, O_WRONLY | O_CREAT | O_EXCL);
archive_copy_file(archive_handle, dst_fd);
close(dst_fd);
}
break;
/* Check if the file already exists */
if (archive_handle->flags & ARCHIVE_EXTRACT_UNCONDITIONAL) {
/* Remove the existing entry if it exists */
if (((file_header->mode & S_IFMT) != S_IFDIR) && (unlink(file_header->name) == -1) && (errno != ENOENT)) {
bb_perror_msg_and_die("Couldnt remove old file");
}
case S_IFDIR:
unlink(file_header->name);
res = mkdir(file_header->name, file_header->mode);
if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
bb_perror_msg("extract_archive: %s", file_header->name);
}
else if (archive_handle->flags & ARCHIVE_EXTRACT_NEWER) {
/* Remove the existing entry if its older than the extracted entry */
struct stat statbuf;
if (lstat(file_header->name, &statbuf) == -1) {
if (errno != ENOENT) {
bb_perror_msg_and_die("Couldnt stat old file");
}
break;
case S_IFLNK:
/* Symlink */
unlink(file_header->name);
res = symlink(file_header->link_name, file_header->name);
if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
bb_perror_msg("Cannot create symlink from %s to '%s'", file_header->name, file_header->link_name);
}
else if (statbuf.st_mtime <= file_header->mtime) {
if (!(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
bb_error_msg("%s not created: newer or same age file exists", file_header->name);
}
break;
case S_IFSOCK:
case S_IFBLK:
case S_IFCHR:
case S_IFIFO:
unlink(file_header->name);
res = mknod(file_header->name, file_header->mode, file_header->device);
if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
bb_perror_msg("Cannot create node %s", file_header->name);
}
break;
default:
bb_error_msg_and_die("Unrecognised file type");
data_skip(archive_handle);
return;
}
else if ((unlink(file_header->name) == -1) && (errno != EISDIR)) {
bb_perror_msg_and_die("Couldnt remove old file %s", file_header->name);
}
}
/* Handle hard links seperately
* We identified hard links as regular files of size 0 with a symlink */
if (S_ISREG(file_header->mode) && (file_header->link_name) && (file_header->size == 0)) {
/* hard link */
res = link(file_header->link_name, file_header->name);
if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
bb_perror_msg("Couldnt create hard link");
}
} else {
/* Create the filesystem entry */
switch(file_header->mode & S_IFMT) {
case S_IFREG: {
/* Regular file */
dst_fd = bb_xopen(file_header->name, O_WRONLY | O_CREAT | O_EXCL);
bb_copyfd_size(archive_handle->src_fd, dst_fd, file_header->size);
close(dst_fd);
break;
}
case S_IFDIR:
res = mkdir(file_header->name, file_header->mode);
if ((errno != EISDIR) && (res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
bb_perror_msg("extract_archive: %s", file_header->name);
}
break;
case S_IFLNK:
/* Symlink */
res = symlink(file_header->link_name, file_header->name);
if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
bb_perror_msg("Cannot create symlink from %s to '%s'", file_header->name, file_header->link_name);
}
break;
case S_IFSOCK:
case S_IFBLK:
case S_IFCHR:
case S_IFIFO:
res = mknod(file_header->name, file_header->mode, file_header->device);
if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
bb_perror_msg("Cannot create node %s", file_header->name);
}
break;
default:
bb_error_msg_and_die("Unrecognised file type");
}
}
chmod(file_header->name, file_header->mode);
chown(file_header->name, file_header->uid, file_header->gid);
chmod(file_header->name, file_header->mode);
if (archive_handle->flags & ARCHIVE_PRESERVE_DATE) {
struct utimbuf t;
@@ -18,5 +18,5 @@
extern void data_extract_to_stdout(archive_handle_t *archive_handle)
{
archive_copy_file(archive_handle, fileno(stdout));
bb_copyfd_eof(archive_handle->src_fd, fileno(stdout));
}
File diff suppressed because it is too large. Load diff
@@ -1,8 +1,6 @@
#include "config.h"
#include "libbb.h"
#if defined CONFIG_UNCOMPRESS || defined CONFIG_FEATURE_GUNZIP_UNCOMPRESS
/* uncompress for busybox -- (c) 2002 Robert Griebl
*
* based on the original compress42.c source
@@ -166,7 +164,7 @@ extern int uncompress(int fd_in, int fd_out)
}
if (insize < (int) sizeof(inbuf) - IBUFSIZ) {
rsize = read(fd_in, inbuf + insize, IBUFSIZ);
rsize = safe_read(fd_in, inbuf + insize, IBUFSIZ);
insize += rsize;
}
@@ -293,6 +291,3 @@ extern int uncompress(int fd_in, int fd_out)
return 0;
}
#endif
+41 -99
View File
@@ -103,7 +103,7 @@ static unsigned int gunzip_bb; /* bit buffer */
static unsigned char gunzip_bk; /* bits in bit buffer */
/* These control the size of the bytebuffer */
#define BYTEBUFFER_MAX 0x8000
static unsigned int bytebuffer_max = 0x8000;
static unsigned char *bytebuffer = NULL;
static unsigned int bytebuffer_offset = 0;
static unsigned int bytebuffer_size = 0;
@@ -144,21 +144,16 @@ static const unsigned char border[] = {
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
};
static void fill_bytebuffer(void)
{
if (bytebuffer_offset >= bytebuffer_size) {
/* Leave the first 4 bytes empty so we can always unwind the bitbuffer
* to the front of the bytebuffer, leave 4 bytes free at end of tail
* so we can easily top up buffer in check_trailer_gzip() */
bytebuffer_size = 4 + bb_xread(gunzip_src_fd, &bytebuffer[4], BYTEBUFFER_MAX - 8);
bytebuffer_offset = 4;
}
}
static unsigned int fill_bitbuffer(unsigned int bitbuffer, unsigned int *current, const unsigned int required)
{
while (*current < required) {
fill_bytebuffer();
if (bytebuffer_offset >= bytebuffer_size) {
/* Leave the first 4 bytes empty so we can always unwind the bitbuffer
* to the front of the bytebuffer, leave 4 bytes free at end of tail
* so we can easily top up buffer in check_trailer_gzip() */
bytebuffer_size = 4 + bb_xread(gunzip_src_fd, &bytebuffer[4], bytebuffer_max - 8);
bytebuffer_offset = 4;
}
bitbuffer |= ((unsigned int) bytebuffer[bytebuffer_offset]) << *current;
bytebuffer_offset++;
*current += 8;
@@ -861,9 +856,9 @@ static void calculate_gunzip_crc(void)
static int inflate_get_next_window(void)
{
static int needAnotherBlock = 1;
static int method = -1; // Method == -1 for stored, -2 for codes
static int e = 0;
static int needAnotherBlock = 1;
gunzip_outbuf_count = 0;
@@ -873,6 +868,8 @@ static int inflate_get_next_window(void)
if (needAnotherBlock) {
if(e) {
calculate_gunzip_crc();
e = 0;
needAnotherBlock = 1;
return 0;
} // Last block
method = inflate_block(&e);
@@ -895,54 +892,25 @@ static int inflate_get_next_window(void)
/* Doesnt get here */
}
/*
* User functions
*
* read_gz, GZ_gzReadOpen, GZ_gzReadClose, inflate
*/
extern ssize_t read_gz(int fd, void *buf, size_t count)
/* Initialise bytebuffer, be carefull not to overfill the buffer */
extern void inflate_init(unsigned int bufsize)
{
static int morebytes = 0, finished = 0;
if (morebytes) {
int bytesRead = morebytes > count ? count : morebytes;
memcpy(buf, gunzip_window + (gunzip_outbuf_count - morebytes), bytesRead);
morebytes -= bytesRead;
return bytesRead;
} else if (finished) {
return 0;
} else if (count >= 0x8000) { // We can decompress direcly to the buffer, 32k at a time
// Could decompress to larger buffer, but it must be a power of 2, and calculating that is probably more expensive than the benefit
unsigned char *old_gunzip_window = gunzip_window; // Save old window
gunzip_window = buf;
if (inflate_get_next_window() == 0) finished = 1;
gunzip_window = old_gunzip_window; // Restore old window
return gunzip_outbuf_count;
} else { // Oh well, need to split up the gunzip_window
int bytesRead;
if (inflate_get_next_window() == 0) finished = 1;
morebytes = gunzip_outbuf_count;
bytesRead = morebytes > count ? count : morebytes;
memcpy(buf, gunzip_window, bytesRead);
morebytes -= bytesRead;
return bytesRead;
}
/* Set the bytebuffer size, default is same as gunzip_wsize */
bytebuffer_max = bufsize + 8;
bytebuffer_offset = 4;
bytebuffer_size = 0;
}
extern void GZ_gzReadOpen(int fd, void *unused, int nUnused)
extern int inflate_unzip(int in, int out)
{
ssize_t nwrote;
typedef void (*sig_type) (int);
/* Allocate all global buffers (for DYN_ALLOC option) */
gunzip_window = xmalloc(gunzip_wsize);
gunzip_outbuf_count = 0;
gunzip_bytes_out = 0;
gunzip_src_fd = fd;
/* Input buffer */
bytebuffer = xmalloc(BYTEBUFFER_MAX);
gunzip_src_fd = in;
/* initialize gunzip_window, bit buffer */
gunzip_bk = 0;
@@ -950,10 +918,20 @@ extern void GZ_gzReadOpen(int fd, void *unused, int nUnused)
/* Create the crc table */
make_gunzip_crc_table();
}
extern void GZ_gzReadClose(void)
{
/* Allocate space for buffer */
bytebuffer = xmalloc(bytebuffer_max);
while(1) {
int ret = inflate_get_next_window();
nwrote = bb_full_write(out, gunzip_window, gunzip_outbuf_count);
if (nwrote == -1) {
bb_perror_msg("write");
return -1;
}
if (ret == 0) break;
}
/* Cleanup */
free(gunzip_window);
free(gunzip_crc_table);
@@ -967,57 +945,20 @@ extern void GZ_gzReadClose(void)
gunzip_bb >>= 8;
gunzip_bk -= 8;
}
}
/*extern int inflate(int in, int out) // Useful for testing read_gz
{
char buf[8192];
ssize_t nread, nwrote;
GZ_gzReadOpen(in, 0, 0);
while(1) { // Robbed from bb_copyfd.c
nread = read_gz(in, buf, sizeof(buf));
if (nread == 0) break; // no data to write
else if (nread == -1) {
bb_perror_msg("read");
return -1;
}
nwrote = bb_full_write(out, buf, nread);
if (nwrote == -1) {
bb_perror_msg("write");
return -1;
}
}
GZ_gzReadClose();
return 0;
}*/
extern int inflate(int in, int out)
{
ssize_t nwrote;
GZ_gzReadOpen(in, 0, 0);
while(1) {
int ret = inflate_get_next_window();
nwrote = bb_full_write(out, gunzip_window, gunzip_outbuf_count);
if (nwrote == -1) {
bb_perror_msg("write");
return -1;
}
if (ret == 0) break;
}
GZ_gzReadClose();
return 0;
}
extern void check_trailer_gzip(int src_fd)
extern int inflate_gunzip(int in, int out)
{
unsigned int stored_crc = 0;
unsigned char count;
inflate_unzip(in, out);
/* top up the input buffer with the rest of the trailer */
count = bytebuffer_size - bytebuffer_offset;
if (count < 8) {
bb_xread_all(src_fd, &bytebuffer[bytebuffer_size], 8 - count);
bb_xread_all(in, &bytebuffer[bytebuffer_size], 8 - count);
bytebuffer_size += 8 - count;
}
for (count = 0; count != 4; count++) {
@@ -1027,14 +968,15 @@ extern void check_trailer_gzip(int src_fd)
/* Validate decompression - crc */
if (stored_crc != (gunzip_crc ^ 0xffffffffL)) {
bb_error_msg_and_die("crc error");
bb_error_msg("crc error");
}
/* Validate decompression - size */
if (gunzip_bytes_out !=
(bytebuffer[bytebuffer_offset] | (bytebuffer[bytebuffer_offset+1] << 8) |
(bytebuffer[bytebuffer_offset+2] << 16) | (bytebuffer[bytebuffer_offset+3] << 24))) {
bb_error_msg_and_die("Incorrect length, but crc is correct");
bb_error_msg("Incorrect length");
}
return 0;
}
@@ -40,16 +40,13 @@ extern char filter_accept_list_reassign(archive_handle_t *archive_handle)
/* Modify the subarchive handler based on the extension */
#ifdef CONFIG_FEATURE_DEB_TAR_GZ
if (strcmp(name_ptr, ".gz") == 0) {
archive_handle->sub_archive->read = read;
archive_handle->action_data_subarchive = get_header_tar_gz;
return(EXIT_SUCCESS);
}
#endif
#ifdef CONFIG_FEATURE_DEB_TAR_BZ2
if (strcmp(name_ptr, ".bz2") == 0) {
archive_handle->sub_archive->read = read_bz2;
BZ2_bzReadOpen(archive_handle->src_fd, NULL, 0);
archive_handle->action_data_subarchive = get_header_tar;
archive_handle->action_data_subarchive = get_header_tar_bz2;
return(EXIT_SUCCESS);
}
#endif
+5 -3
View File
@@ -45,7 +45,7 @@ extern char get_header_ar(archive_handle_t *archive_handle)
if (read(archive_handle->src_fd, ar.raw, 60) != 60) {
/* End Of File */
return(EXIT_FAILURE);
}
}
/* Some ar entries have a trailing '\n' after the previous data entry */
if (ar.raw[0] == '\n') {
@@ -55,7 +55,7 @@ extern char get_header_ar(archive_handle_t *archive_handle)
archive_handle->offset++;
}
archive_handle->offset += 60;
/* align the headers based on the header magic */
if ((ar.formated.magic[0] != '`') || (ar.formated.magic[1] != '\n')) {
bb_error_msg_and_die("Invalid ar header");
@@ -115,7 +115,9 @@ extern char get_header_ar(archive_handle_t *archive_handle)
data_skip(archive_handle);
}
archive_handle->offset += typed->size + 1;
archive_handle->offset += typed->size;
/* Set the file pointer to the correct spot, we may have been reading a compressed file */
lseek(archive_handle->src_fd, archive_handle->offset, SEEK_SET);
return(EXIT_SUCCESS);
}
+4 -38
View File
@@ -36,7 +36,6 @@ extern char get_header_cpio(archive_handle_t *archive_handle)
int namesize;
char dummy[16];
int major, minor, nlink, inode;
char extract_flag;
if (pending_hardlinks) { /* Deal with any pending hardlinks */
hardlinks_t *tmp;
@@ -71,17 +70,7 @@ extern char get_header_cpio(archive_handle_t *archive_handle)
}
archive_handle->offset += 110;
if (strncmp(&cpio_header[0], "07070", 5) != 0) {
printf("cpio header is %x-%x-%x-%x-%x\n",
cpio_header[0],
cpio_header[1],
cpio_header[2],
cpio_header[3],
cpio_header[4]);
bb_error_msg_and_die("Unsupported cpio format");
}
if ((cpio_header[5] != '1') && (cpio_header[5] != '2')) {
if ((strncmp(&cpio_header[0], "07070", 5) != 0) || ((cpio_header[5] != '1') && (cpio_header[5] != '2'))) {
bb_error_msg_and_die("Unsupported cpio format, use newc or crc");
}
@@ -154,36 +143,13 @@ extern char get_header_cpio(archive_handle_t *archive_handle)
}
file_header->device = (major << 8) | minor;
extract_flag = FALSE;
if (archive_handle->filter(archive_handle) == EXIT_SUCCESS) {
struct stat statbuf;
extract_flag = TRUE;
/* Check if the file already exists */
if (lstat (file_header->name, &statbuf) == 0) {
if ((archive_handle->flags & ARCHIVE_EXTRACT_UNCONDITIONAL) || (statbuf.st_mtime < file_header->mtime)) {
/* Remove file if flag set or its older than the file to be extracted */
if (unlink(file_header->name) == -1) {
bb_perror_msg_and_die("Couldnt remove old file");
}
} else {
if (! archive_handle->flags & ARCHIVE_EXTRACT_QUIET) {
bb_error_msg("%s not created: newer or same age file exists", file_header->name);
}
extract_flag = FALSE;
}
}
archive_handle->action_header(file_header);
}
archive_handle->action_header(file_header);
if (extract_flag) {
archive_handle->action_data(archive_handle);
archive_handle->action_header(archive_handle->file_header);
} else {
data_skip(archive_handle);
data_skip(archive_handle);
}
archive_handle->offset += file_header->size;
return (EXIT_SUCCESS);
}
+22 -12
View File
@@ -29,6 +29,7 @@ extern char get_header_tar(archive_handle_t *archive_handle)
{
file_header_t *file_header = archive_handle->file_header;
union {
/* ustar header, Posix 1003.1 */
unsigned char raw[512];
struct {
char name[100]; /* 0-99 */
@@ -52,12 +53,11 @@ extern char get_header_tar(archive_handle_t *archive_handle)
} tar;
long sum = 0;
long i;
char *tmp;
/* Align header */
data_align(archive_handle, 512);
if (archive_xread(archive_handle, tar.raw, 512) != 512) {
if (bb_full_read(archive_handle->src_fd, tar.raw, 512) != 512) {
/* Assume end of file */
return(EXIT_FAILURE);
}
@@ -105,11 +105,15 @@ extern char get_header_tar(archive_handle_t *archive_handle)
} else {
file_header->name = concat_path_file(tar.formated.prefix, tar.formated.name);
}
tmp = last_char_is(archive_handle->file_header->name, '/');
if (tmp) {
*tmp = '\0';
{ /* Strip trailing '/' in directories */
char *tmp = last_char_is(file_header->name, '/');
if (tmp) {
*tmp = '\0';
}
}
file_header->mode = strtol(tar.formated.mode, NULL, 8);
file_header->uid = strtol(tar.formated.uid, NULL, 8);
file_header->gid = strtol(tar.formated.gid, NULL, 8);
@@ -120,16 +124,17 @@ extern char get_header_tar(archive_handle_t *archive_handle)
file_header->device = (dev_t) ((strtol(tar.formated.devmajor, NULL, 8) << 8) +
strtol(tar.formated.devminor, NULL, 8));
#if defined CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY || defined CONFIG_FEATURE_TAR_GNU_EXTENSIONS
/* Fix mode, used by the old format */
switch (tar.formated.typeflag) {
# ifdef CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY
case 0:
case '0':
file_header->mode |= S_IFREG;
if (last_char_is(file_header->name, '/')) {
file_header->mode |= S_IFDIR;
} else {
file_header->mode |= S_IFREG;
}
break;
case '1':
bb_error_msg("WARNING: Converting hard link to symlink");
case '2':
file_header->mode |= S_IFLNK;
break;
@@ -146,6 +151,10 @@ extern char get_header_tar(archive_handle_t *archive_handle)
file_header->mode |= S_IFIFO;
break;
# endif
/* hard links are detected as regular files with 0 size and a link name */
case '1':
file_header->mode &= (S_IFREG | 07777);
break;
# ifdef CONFIG_FEATURE_TAR_GNU_EXTENSIONS
case 'L': {
longname = xmalloc(file_header->size + 1);
@@ -172,17 +181,18 @@ extern char get_header_tar(archive_handle_t *archive_handle)
bb_error_msg("Ignoring GNU extension type %c", tar.formated.typeflag);
# endif
}
#endif
if (archive_handle->filter(archive_handle) == EXIT_SUCCESS) {
archive_handle->action_header(archive_handle->file_header);
archive_handle->flags |= ARCHIVE_EXTRACT_QUIET;
archive_handle->action_data(archive_handle);
archive_handle->passed = llist_add_to(archive_handle->passed, archive_handle->file_header->name);
archive_handle->passed = llist_add_to(archive_handle->passed, file_header->name);
} else {
data_skip(archive_handle);
}
archive_handle->offset += file_header->size;
free(file_header->link_name);
return(EXIT_SUCCESS);
}
+4 -8
View File
@@ -15,6 +15,7 @@
*/
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -25,18 +26,13 @@
extern char get_header_tar_bz2(archive_handle_t *archive_handle)
{
BZ2_bzReadOpen(archive_handle->src_fd, NULL, 0);
archive_handle->read = read_bz2;
/* Cant lseek over pipe's */
archive_handle->seek = seek_by_char;
archive_handle->src_fd = open_transformer(archive_handle->src_fd, uncompressStream);
archive_handle->offset = 0;
while (get_header_tar(archive_handle) == EXIT_SUCCESS);
/* Cleanup */
BZ2_bzReadClose();
/* Can only do one tar.bz2 per archive */
/* Can only do one file at a time */
return(EXIT_FAILURE);
}
+5 -12
View File
@@ -23,6 +23,9 @@ extern char get_header_tar_gz(archive_handle_t *archive_handle)
{
unsigned char magic[2];
/* Cant lseek over pipe's */
archive_handle->seek = seek_by_char;
archive_xread_all(archive_handle, &magic, 2);
if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) {
bb_error_msg_and_die("Invalid gzip magic");
@@ -30,20 +33,10 @@ extern char get_header_tar_gz(archive_handle_t *archive_handle)
check_header_gzip(archive_handle->src_fd);
GZ_gzReadOpen(archive_handle->src_fd, 0, 0);
archive_handle->read = read_gz;
archive_handle->seek = seek_by_char;
archive_handle->src_fd = open_transformer(archive_handle->src_fd, inflate_gunzip);
archive_handle->offset = 0;
while (get_header_tar(archive_handle) == EXIT_SUCCESS);
/* Cleanup */
GZ_gzReadClose();
check_trailer_gzip(archive_handle->src_fd);
/* Can only do one tar.bz2 per archive */
/* Can only do one file at a time */
return(EXIT_FAILURE);
}
-1
View File
@@ -30,7 +30,6 @@ archive_handle_t *init_handle(void)
archive_handle->action_header = header_skip;
archive_handle->action_data = data_skip;
archive_handle->filter = filter_accept_all;
archive_handle->read = bb_full_read;
archive_handle->seek = seek_by_jump;
return(archive_handle);
@@ -14,20 +14,38 @@
* 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 <unistd.h>
#include "libbb.h"
extern ssize_t archive_xread(const archive_handle_t *archive_handle, unsigned char *buf, const size_t count)
/* transformer(), more than meets the eye */
extern int open_transformer(int src_fd, int (*transformer)(int src_fd, int dst_fd))
{
ssize_t size;
int fd_pipe[2];
int pid;
size = archive_handle->read(archive_handle->src_fd, buf, count);
if (size < 0) {
bb_perror_msg_and_die("Read error");
if (pipe(fd_pipe) != 0) {
bb_perror_msg_and_die("Can't create pipe");
}
return(size);
pid = fork();
if (pid == -1) {
bb_perror_msg_and_die("Fork failed");
}
if (pid == 0) {
/* child process */
close(fd_pipe[0]); /* We don't wan't to read from the parent */
transformer(src_fd, fd_pipe[1]);
close(fd_pipe[1]); /* Send EOF */
close(src_fd);
exit(0);
/* notreached */
}
/* parent process */
close(fd_pipe[1]); /* Don't want to write to the child */
return(fd_pipe[0]);
}
+12 -5
View File
@@ -14,12 +14,19 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "unarchive.h"
#include <stdlib.h>
extern void seek_by_char(const archive_handle_t *archive_handle, const unsigned int amount)
#include "unarchive.h"
#include "busybox.h"
/* If we are reading through a pipe(), or from stdin then we cant lseek,
* we must read and discard the data to skip over it.
*
* TODO: rename to seek_by_read
*/
extern void seek_by_char(const archive_handle_t *archive_handle, const unsigned int jump_size)
{
unsigned int i;
for (i = 0; i < amount; i++) {
archive_xread_char(archive_handle);
if (jump_size) {
bb_full_fd_action(archive_handle->src_fd, -1, jump_size, NULL);
}
}
+1 -6
View File
@@ -1,8 +1,6 @@
#include "config.h"
#include "libbb.h"
#if defined CONFIG_UNCOMPRESS || defined CONFIG_FEATURE_GUNZIP_UNCOMPRESS
/* uncompress for busybox -- (c) 2002 Robert Griebl
*
* based on the original compress42.c source
@@ -166,7 +164,7 @@ extern int uncompress(int fd_in, int fd_out)
}
if (insize < (int) sizeof(inbuf) - IBUFSIZ) {
rsize = read(fd_in, inbuf + insize, IBUFSIZ);
rsize = safe_read(fd_in, inbuf + insize, IBUFSIZ);
insize += rsize;
}
@@ -293,6 +291,3 @@ extern int uncompress(int fd_in, int fd_out)
return 0;
}
#endif
+41 -99
View File
@@ -103,7 +103,7 @@ static unsigned int gunzip_bb; /* bit buffer */
static unsigned char gunzip_bk; /* bits in bit buffer */
/* These control the size of the bytebuffer */
#define BYTEBUFFER_MAX 0x8000
static unsigned int bytebuffer_max = 0x8000;
static unsigned char *bytebuffer = NULL;
static unsigned int bytebuffer_offset = 0;
static unsigned int bytebuffer_size = 0;
@@ -144,21 +144,16 @@ static const unsigned char border[] = {
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
};
static void fill_bytebuffer(void)
{
if (bytebuffer_offset >= bytebuffer_size) {
/* Leave the first 4 bytes empty so we can always unwind the bitbuffer
* to the front of the bytebuffer, leave 4 bytes free at end of tail
* so we can easily top up buffer in check_trailer_gzip() */
bytebuffer_size = 4 + bb_xread(gunzip_src_fd, &bytebuffer[4], BYTEBUFFER_MAX - 8);
bytebuffer_offset = 4;
}
}
static unsigned int fill_bitbuffer(unsigned int bitbuffer, unsigned int *current, const unsigned int required)
{
while (*current < required) {
fill_bytebuffer();
if (bytebuffer_offset >= bytebuffer_size) {
/* Leave the first 4 bytes empty so we can always unwind the bitbuffer
* to the front of the bytebuffer, leave 4 bytes free at end of tail
* so we can easily top up buffer in check_trailer_gzip() */
bytebuffer_size = 4 + bb_xread(gunzip_src_fd, &bytebuffer[4], bytebuffer_max - 8);
bytebuffer_offset = 4;
}
bitbuffer |= ((unsigned int) bytebuffer[bytebuffer_offset]) << *current;
bytebuffer_offset++;
*current += 8;
@@ -861,9 +856,9 @@ static void calculate_gunzip_crc(void)
static int inflate_get_next_window(void)
{
static int needAnotherBlock = 1;
static int method = -1; // Method == -1 for stored, -2 for codes
static int e = 0;
static int needAnotherBlock = 1;
gunzip_outbuf_count = 0;
@@ -873,6 +868,8 @@ static int inflate_get_next_window(void)
if (needAnotherBlock) {
if(e) {
calculate_gunzip_crc();
e = 0;
needAnotherBlock = 1;
return 0;
} // Last block
method = inflate_block(&e);
@@ -895,54 +892,25 @@ static int inflate_get_next_window(void)
/* Doesnt get here */
}
/*
* User functions
*
* read_gz, GZ_gzReadOpen, GZ_gzReadClose, inflate
*/
extern ssize_t read_gz(int fd, void *buf, size_t count)
/* Initialise bytebuffer, be carefull not to overfill the buffer */
extern void inflate_init(unsigned int bufsize)
{
static int morebytes = 0, finished = 0;
if (morebytes) {
int bytesRead = morebytes > count ? count : morebytes;
memcpy(buf, gunzip_window + (gunzip_outbuf_count - morebytes), bytesRead);
morebytes -= bytesRead;
return bytesRead;
} else if (finished) {
return 0;
} else if (count >= 0x8000) { // We can decompress direcly to the buffer, 32k at a time
// Could decompress to larger buffer, but it must be a power of 2, and calculating that is probably more expensive than the benefit
unsigned char *old_gunzip_window = gunzip_window; // Save old window
gunzip_window = buf;
if (inflate_get_next_window() == 0) finished = 1;
gunzip_window = old_gunzip_window; // Restore old window
return gunzip_outbuf_count;
} else { // Oh well, need to split up the gunzip_window
int bytesRead;
if (inflate_get_next_window() == 0) finished = 1;
morebytes = gunzip_outbuf_count;
bytesRead = morebytes > count ? count : morebytes;
memcpy(buf, gunzip_window, bytesRead);
morebytes -= bytesRead;
return bytesRead;
}
/* Set the bytebuffer size, default is same as gunzip_wsize */
bytebuffer_max = bufsize + 8;
bytebuffer_offset = 4;
bytebuffer_size = 0;
}
extern void GZ_gzReadOpen(int fd, void *unused, int nUnused)
extern int inflate_unzip(int in, int out)
{
ssize_t nwrote;
typedef void (*sig_type) (int);
/* Allocate all global buffers (for DYN_ALLOC option) */
gunzip_window = xmalloc(gunzip_wsize);
gunzip_outbuf_count = 0;
gunzip_bytes_out = 0;
gunzip_src_fd = fd;
/* Input buffer */
bytebuffer = xmalloc(BYTEBUFFER_MAX);
gunzip_src_fd = in;
/* initialize gunzip_window, bit buffer */
gunzip_bk = 0;
@@ -950,10 +918,20 @@ extern void GZ_gzReadOpen(int fd, void *unused, int nUnused)
/* Create the crc table */
make_gunzip_crc_table();
}
extern void GZ_gzReadClose(void)
{
/* Allocate space for buffer */
bytebuffer = xmalloc(bytebuffer_max);
while(1) {
int ret = inflate_get_next_window();
nwrote = bb_full_write(out, gunzip_window, gunzip_outbuf_count);
if (nwrote == -1) {
bb_perror_msg("write");
return -1;
}
if (ret == 0) break;
}
/* Cleanup */
free(gunzip_window);
free(gunzip_crc_table);
@@ -967,57 +945,20 @@ extern void GZ_gzReadClose(void)
gunzip_bb >>= 8;
gunzip_bk -= 8;
}
}
/*extern int inflate(int in, int out) // Useful for testing read_gz
{
char buf[8192];
ssize_t nread, nwrote;
GZ_gzReadOpen(in, 0, 0);
while(1) { // Robbed from bb_copyfd.c
nread = read_gz(in, buf, sizeof(buf));
if (nread == 0) break; // no data to write
else if (nread == -1) {
bb_perror_msg("read");
return -1;
}
nwrote = bb_full_write(out, buf, nread);
if (nwrote == -1) {
bb_perror_msg("write");
return -1;
}
}
GZ_gzReadClose();
return 0;
}*/
extern int inflate(int in, int out)
{
ssize_t nwrote;
GZ_gzReadOpen(in, 0, 0);
while(1) {
int ret = inflate_get_next_window();
nwrote = bb_full_write(out, gunzip_window, gunzip_outbuf_count);
if (nwrote == -1) {
bb_perror_msg("write");
return -1;
}
if (ret == 0) break;
}
GZ_gzReadClose();
return 0;
}
extern void check_trailer_gzip(int src_fd)
extern int inflate_gunzip(int in, int out)
{
unsigned int stored_crc = 0;
unsigned char count;
inflate_unzip(in, out);
/* top up the input buffer with the rest of the trailer */
count = bytebuffer_size - bytebuffer_offset;
if (count < 8) {
bb_xread_all(src_fd, &bytebuffer[bytebuffer_size], 8 - count);
bb_xread_all(in, &bytebuffer[bytebuffer_size], 8 - count);
bytebuffer_size += 8 - count;
}
for (count = 0; count != 4; count++) {
@@ -1027,14 +968,15 @@ extern void check_trailer_gzip(int src_fd)
/* Validate decompression - crc */
if (stored_crc != (gunzip_crc ^ 0xffffffffL)) {
bb_error_msg_and_die("crc error");
bb_error_msg("crc error");
}
/* Validate decompression - size */
if (gunzip_bytes_out !=
(bytebuffer[bytebuffer_offset] | (bytebuffer[bytebuffer_offset+1] << 8) |
(bytebuffer[bytebuffer_offset+2] << 16) | (bytebuffer[bytebuffer_offset+3] << 24))) {
bb_error_msg_and_die("Incorrect length, but crc is correct");
bb_error_msg("Incorrect length");
}
return 0;
}
+2 -5
View File
@@ -197,7 +197,6 @@ void extract_cpio_gz(int fd) {
/* Initialise */
archive_handle = init_handle();
archive_handle->read = read_gz;
archive_handle->seek = seek_by_char;
//archive_handle->action_header = header_list;
archive_handle->action_data = data_extract_all;
@@ -213,11 +212,9 @@ void extract_cpio_gz(int fd) {
check_header_gzip(archive_handle->src_fd);
chdir("/"); // Install RPM's to root
GZ_gzReadOpen(archive_handle->src_fd, 0, 0);
archive_handle->src_fd = open_transformer(archive_handle->src_fd, inflate_gunzip);
archive_handle->offset = 0;
while (get_header_cpio(archive_handle) == EXIT_SUCCESS);
GZ_gzReadClose();
check_trailer_gzip(archive_handle->src_fd);
}
+1 -2
View File
@@ -96,10 +96,9 @@ extern int rpm2cpio_main(int argc, char **argv)
}
check_header_gzip(rpm_fd);
if (inflate(rpm_fd, fileno(stdout)) != 0) {
if (inflate_gunzip(rpm_fd, fileno(stdout)) != 0) {
bb_error_msg("Error inflating");
}
check_trailer_gzip(rpm_fd);
close(rpm_fd);
+117 -75
View File
@@ -308,8 +308,9 @@ static inline int writeTarHeader(struct TarBallInfo *tbInfo,
if (tbInfo->verboseFlag) {
FILE *vbFd = stdout;
if (tbInfo->verboseFlag == 2) /* If the archive goes to stdout, verbose to stderr */
if (tbInfo->tarFd == fileno(stdout)) /* If the archive goes to stdout, verbose to stderr */
vbFd = stderr;
fprintf(vbFd, "%s\n", header.name);
}
@@ -413,8 +414,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf,
if ((tbInfo->hlInfo == NULL)
&& (S_ISREG(statbuf->st_mode))) {
int inputFileFd;
char buffer[BUFSIZ];
ssize_t size = 0, readSize = 0;
ssize_t readSize = 0;
/* open the file we want to archive, and make sure all is well */
if ((inputFileFd = open(fileName, O_RDONLY)) < 0) {
@@ -423,18 +423,8 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf,
}
/* write the file to the archive */
while ((size = bb_full_read(inputFileFd, buffer, sizeof(buffer))) > 0) {
if (bb_full_write(tbInfo->tarFd, buffer, size) != size) {
/* Output file seems to have a problem */
bb_error_msg(bb_msg_io_error, fileName);
return (FALSE);
}
readSize += size;
}
if (size == -1) {
bb_error_msg(bb_msg_io_error, fileName);
return (FALSE);
}
readSize = bb_copyfd_eof(inputFileFd, tbInfo->tarFd);
/* Pad the file up to the tar block size */
for (; (readSize % TAR_BLOCK_SIZE) != 0; readSize++) {
write(tbInfo->tarFd, "\0", 1);
@@ -445,7 +435,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf,
return (TRUE);
}
static inline int writeTarFile(const char *tarName, const int verboseFlag,
static inline int writeTarFile(const int tar_fd, const int verboseFlag,
const llist_t *include, const llist_t *exclude, const int gzip)
{
#ifdef CONFIG_FEATURE_TAR_GZIP
@@ -461,31 +451,14 @@ static inline int writeTarFile(const char *tarName, const int verboseFlag,
tbInfo.hlInfoHead = NULL;
/* Make sure there is at least one file to tar up. */
if (include == NULL) {
bb_error_msg_and_die("Cowardly refusing to create an empty archive");
}
/* Open the tar file for writing. */
if (tarName == NULL || (tarName[0] == '-' && tarName[1] == '\0')) {
tbInfo.tarFd = fileno(stdout);
tbInfo.verboseFlag = verboseFlag ? 2 : 0;
} else {
unlink(tarName);
tbInfo.tarFd = open(tarName, O_WRONLY | O_CREAT | O_EXCL, 0644);
tbInfo.verboseFlag = verboseFlag ? 1 : 0;
}
if (tbInfo.tarFd < 0) {
bb_perror_msg("%s: Cannot open", tarName);
freeHardLinkInfo(&tbInfo.hlInfoHead);
return (FALSE);
}
fchmod(tar_fd, 0644);
tbInfo.tarFd = tar_fd;
tbInfo.verboseFlag = verboseFlag;
/* Store the stat info for the tarball's file, so
* can avoid including the tarball into itself.... */
if (fstat(tbInfo.tarFd, &tbInfo.statBuf) < 0)
bb_error_msg_and_die(bb_msg_io_error, tarName);
bb_perror_msg_and_die("Couldnt stat tar file");
#ifdef CONFIG_FEATURE_TAR_GZIP
if (gzip) {
@@ -605,8 +578,28 @@ static llist_t *append_file_list_to_list(llist_t *list)
}
#endif
#ifdef CONFIG_FEATURE_TAR_COMPRESS
static char get_header_tar_Z(archive_handle_t *archive_handle)
{
/* Cant lseek over pipe's */
archive_handle->seek = seek_by_char;
/* do the decompression, and cleanup */
if ((bb_xread_char(archive_handle->src_fd) != 0x1f) || (bb_xread_char(archive_handle->src_fd) != 0x9d)) {
bb_error_msg_and_die("Invalid magic");
}
archive_handle->src_fd = open_transformer(archive_handle->src_fd, uncompress);
archive_handle->offset = 0;
while (get_header_tar(archive_handle) == EXIT_SUCCESS);
/* Can only do one file at a time */
return(EXIT_FAILURE);
}
#endif
static const char tar_options[]="ctxjT:X:C:f:OpvzkZ";
static const char tar_options[]="ctxjT:X:C:f:Opvz";
#define CTX_CREATE 1
#define CTX_TEST 2
#define CTX_EXTRACT 4
@@ -619,6 +612,8 @@ static const char tar_options[]="ctxjT:X:C:f:Opvz";
#define TAR_OPT_P 512
#define TAR_OPT_VERBOSE 1024
#define TAR_OPT_GZIP 2048
#define TAR_OPT_KEEP_OLD 4096
#define TAR_OPT_UNCOMPRESS 8192
int tar_main(int argc, char **argv)
{
@@ -643,7 +638,7 @@ int tar_main(int argc, char **argv)
/* Initialise default values */
tar_handle = init_handle();
tar_handle->flags = ARCHIVE_CREATE_LEADING_DIRS | ARCHIVE_PRESERVE_DATE;
tar_handle->flags = ARCHIVE_CREATE_LEADING_DIRS | ARCHIVE_PRESERVE_DATE | ARCHIVE_EXTRACT_UNCONDITIONAL;
bb_opt_complementaly = "c~tx:t~cx:x~ct:X*";
opt = bb_getopt_ulflags(argc, argv, tar_options,
@@ -656,46 +651,66 @@ int tar_main(int argc, char **argv)
if(opt & 0x80000000UL)
bb_show_usage();
ctx_flag = opt & (CTX_CREATE | CTX_TEST | CTX_EXTRACT);
if (ctx_flag == 0) {
bb_show_usage();
}
if(ctx_flag & CTX_TEST) {
if ((tar_handle->action_header == header_list) ||
(tar_handle->action_header == header_verbose_list)) {
tar_handle->action_header = header_verbose_list;
} else {
tar_handle->action_header = header_list;
}
if ((tar_handle->action_header == header_list) ||
(tar_handle->action_header == header_verbose_list)) {
tar_handle->action_header = header_verbose_list;
} else {
tar_handle->action_header = header_list;
}
}
if(ctx_flag & CTX_EXTRACT) {
if (tar_handle->action_data != data_extract_to_stdout)
tar_handle->action_data = data_extract_all;
}
tar_handle->action_data = data_extract_all;
}
if(opt & TAR_OPT_2STDOUT) {
/* To stdout */
tar_handle->action_data = data_extract_to_stdout;
tar_handle->action_data = data_extract_to_stdout;
}
if(opt & TAR_OPT_VERBOSE) {
if ((tar_handle->action_header == header_list) ||
(tar_handle->action_header == header_verbose_list))
{
tar_handle->action_header = header_verbose_list;
} else {
tar_handle->action_header = header_list;
}
if ((tar_handle->action_header == header_list) ||
(tar_handle->action_header == header_verbose_list))
{
tar_handle->action_header = header_verbose_list;
} else {
tar_handle->action_header = header_list;
}
}
#ifdef CONFIG_FEATURE_TAR_GZIP
if (opt & TAR_OPT_KEEP_OLD) {
tar_handle->flags &= ~ARCHIVE_EXTRACT_UNCONDITIONAL;
}
if(opt & TAR_OPT_GZIP) {
get_header_ptr = get_header_tar_gz;
}
#ifdef CONFIG_FEATURE_TAR_GZIP
get_header_ptr = get_header_tar_gz;
#else
bb_show_usage();
#endif
#ifdef CONFIG_FEATURE_TAR_BZIP2
}
if(opt & TAR_OPT_BZIP2) {
get_header_ptr = get_header_tar_bz2;
}
#ifdef CONFIG_FEATURE_TAR_BZIP2
get_header_ptr = get_header_tar_bz2;
#else
bb_show_usage();
#endif
#ifdef CONFIG_FEATURE_TAR_EXCLUDE
}
if(opt & TAR_OPT_UNCOMPRESS) {
#ifdef CONFIG_FEATURE_TAR_COMPRESS
get_header_ptr = get_header_tar_Z;
#else
bb_show_usage();
#endif
}
if(opt & TAR_OPT_EXCLUDE) {
#ifdef CONFIG_FEATURE_TAR_EXCLUDE
tar_handle->reject = append_file_list_to_list(tar_handle->reject);
}
#else
bb_show_usage();
#endif
}
/* Check if we are reading from stdin */
if ((argv[optind]) && (*argv[optind] == '-')) {
/* Default is to read from stdin, so just skip to next arg */
@@ -705,6 +720,11 @@ int tar_main(int argc, char **argv)
/* Setup an array of filenames to work with */
/* TODO: This is the same as in ar, seperate function ? */
while (optind < argc) {
char *filename_ptr;
filename_ptr = last_char_is(argv[optind], '/');
if (filename_ptr) {
*filename_ptr = '\0';
}
tar_handle->accept = llist_add_to(tar_handle->accept, argv[optind]);
optind++;
}
@@ -713,6 +733,39 @@ int tar_main(int argc, char **argv)
tar_handle->filter = filter_accept_reject_list;
}
/* Open the tar file */
{
FILE *tar_stream;
int flags;
#ifdef CONFIG_FEATURE_TAR_CREATE
if (ctx_flag == CTX_CREATE) {
/* Make sure there is at least one file to tar up. */
if (tar_handle->accept == NULL) {
bb_error_msg_and_die("Cowardly refusing to create an empty archive");
}
tar_stream = stdout;
flags = O_WRONLY | O_CREAT | O_EXCL;
unlink(tar_filename);
} else
#endif
{
tar_stream = stdin;
flags = O_RDONLY;
}
if ((tar_filename[0] == '-') && (tar_filename[1] == '\0')) {
tar_handle->src_fd = fileno(tar_stream);
tar_handle->seek = seek_by_char;
} else {
tar_handle->src_fd = bb_xopen(tar_filename, flags);
}
}
if ((base_dir) && (chdir(base_dir))) {
bb_perror_msg_and_die("Couldnt chdir to %s", base_dir);
}
#ifdef CONFIG_FEATURE_TAR_CREATE
/* create an archive */
if (ctx_flag == CTX_CREATE) {
@@ -734,22 +787,11 @@ int tar_main(int argc, char **argv)
(tar_handle->action_header == header_verbose_list)) {
verboseFlag = TRUE;
}
writeTarFile(tar_filename, verboseFlag, tar_handle->accept,
writeTarFile(tar_handle->src_fd, verboseFlag, tar_handle->accept,
tar_handle->reject, gzipFlag);
} else
#endif /* CONFIG_FEATURE_TAR_CREATE */
{
if ((tar_filename[0] == '-') && (tar_filename[1] == '\0')) {
tar_handle->src_fd = fileno(stdin);
tar_handle->seek = seek_by_char;
} else {
tar_handle->src_fd = bb_xopen(tar_filename, O_RDONLY);
}
if ((base_dir) && (chdir(base_dir))) {
bb_perror_msg_and_die("Couldnt chdir");
}
while (get_header_ptr(tar_handle) == EXIT_SUCCESS);
/* Ckeck that every file that should have been extracted was */
+4 -5
View File
@@ -199,7 +199,8 @@ extern int unzip_main(int argc, char **argv)
archive_handle->action_data(archive_handle);
} else {
dst_fd = bb_xopen(archive_handle->file_header->name, O_WRONLY | O_CREAT);
inflate(archive_handle->src_fd, dst_fd);
inflate_init(zip_header.formated.cmpsize);
inflate_unzip(archive_handle->src_fd, dst_fd);
close(dst_fd);
chmod(archive_handle->file_header->name, archive_handle->file_header->mode);
@@ -227,10 +228,8 @@ extern int unzip_main(int argc, char **argv)
/* Data descriptor section */
if (zip_header.formated.flags & 4) {
/* skip over duplicate crc, compressed size and uncompressed size */
unsigned short i;
for (i = 0; i != 12; i++) {
archive_xread_char(archive_handle);
}
unsigned char data_description[12];
archive_xread_all(archive_handle, data_description, 12);
archive_handle->offset += 12;
}
}
+24 -6
View File
@@ -1,11 +1,25 @@
/* vi: set sw=4 ts=4: */
/*
* chvt.c - aeb - 940227 - Change virtual terminal
* Mini chvt implementation for busybox
*
* busyboxed by Erik Andersen
* Copyright (C) 1999-2003 by Erik Andersen <andersen@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
*/
/* getopt not needed */
/* no options, no getopt */
#include <stdio.h>
#include <stdlib.h>
@@ -22,14 +36,18 @@ int chvt_main(int argc, char **argv)
{
int fd, num;
if ((argc != 2) || (**(argv + 1) == '-'))
if ((argc != 2) || (**(argv + 1) == '-')) {
bb_show_usage();
}
fd = get_console_fd();
num = atoi(argv[1]);
if (ioctl(fd, VT_ACTIVATE, num))
if (ioctl(fd, VT_ACTIVATE, num)) {
bb_perror_msg_and_die("VT_ACTIVATE");
if (ioctl(fd, VT_WAITACTIVE, num))
}
if (ioctl(fd, VT_WAITACTIVE, num)) {
bb_perror_msg_and_die("VT_WAITACTIVE");
}
return EXIT_SUCCESS;
}
+2
View File
@@ -20,6 +20,8 @@
*
*/
/* no options, no getopt */
#include <stdio.h>
#include <stdlib.h>
#include "busybox.h"
+30 -10
View File
@@ -1,8 +1,27 @@
/* vi: set sw=4 ts=4: */
/*
* disalloc.c - aeb - 940501 - Disallocate virtual terminal(s)
* Renamed deallocvt.
* Disallocate virtual terminal(s)
*
* Copyright (C) 2003 by Tito Ragusa <farmatito@tiscali.it>
* Copyright (C) 1999-2003 by Erik Andersen <andersen@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
*/
/* no options, no getopt */
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
@@ -15,21 +34,21 @@ static const int VT_DISALLOCATE = 0x5608; /* free memory associated to vt */
int deallocvt_main(int argc, char *argv[])
{
int fd, num=0;
int fd, num = 0;
if (argc > 2)
if (argc > 2) {
bb_show_usage();
}
fd = get_console_fd();
/* num=0 deallocate all unused consoles */
if (argc == 1)
if (argc == 1) {
goto disallocate_all;
}
num=bb_xgetlarg(argv[1], 10, 0, INT_MAX);
switch(num)
{
num = bb_xgetlarg(argv[1], 10, 0, INT_MAX);
switch (num) {
case 0:
bb_error_msg("0: illegal VT number");
break;
@@ -38,8 +57,9 @@ int deallocvt_main(int argc, char *argv[])
break;
default:
disallocate_all:
if (ioctl(fd, VT_DISALLOCATE, num))
if (ioctl(fd, VT_DISALLOCATE, num)) {
bb_perror_msg_and_die("VT_DISALLOCATE");
}
return EXIT_SUCCESS;
}
return EXIT_FAILURE;
+13 -20
View File
@@ -37,43 +37,35 @@ struct kbentry {
unsigned char kb_index;
unsigned short kb_value;
};
static const int KDSKBENT = 0x4B47; /* sets one entry in translation table */
/* sets one entry in translation table */
#define KDSKBENT 0x4B47
/* From <linux/keyboard.h> */
static const int NR_KEYS = 128;
static const int MAX_NR_KEYMAPS = 256;
#define NR_KEYS 128
#define MAX_NR_KEYMAPS 256
int loadkmap_main(int argc, char **argv)
{
struct kbentry ke;
u_short *ibuff;
int i, j, fd, readsz, pos, ibuffsz = NR_KEYS * sizeof(u_short);
char flags[MAX_NR_KEYMAPS], buff[7];
int i, j, fd;
u_short ibuff[NR_KEYS];
char flags[MAX_NR_KEYMAPS];
char buff[7];
if (argc != 1)
bb_show_usage();
fd = open(CURRENT_VC, O_RDWR);
if (fd < 0)
bb_perror_msg_and_die("Error opening " CURRENT_VC);
fd = bb_xopen(CURRENT_VC, O_RDWR);
read(0, buff, 7);
if (0 != strncmp(buff, BINARY_KEYMAP_MAGIC, 7))
if ((bb_full_read(0, buff, 7) != 7) || (strncmp(buff, BINARY_KEYMAP_MAGIC, 7) != 0))
bb_error_msg_and_die("This is not a valid binary keymap.");
if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS))
if (bb_full_read(0, flags, MAX_NR_KEYMAPS) != MAX_NR_KEYMAPS)
bb_perror_msg_and_die("Error reading keymap flags");
ibuff = (u_short *) xmalloc(ibuffsz);
for (i = 0; i < MAX_NR_KEYMAPS; i++) {
if (flags[i] == 1) {
pos = 0;
while (pos < ibuffsz) {
if ((readsz = read(0, (char *) ibuff + pos, ibuffsz - pos)) < 0)
bb_perror_msg_and_die("Error reading keymap");
pos += readsz;
}
bb_full_read(0, ibuff, NR_KEYS * sizeof(u_short));
for (j = 0; j < NR_KEYS; j++) {
ke.kb_index = j;
ke.kb_table = i;
@@ -82,6 +74,7 @@ int loadkmap_main(int argc, char **argv)
}
}
}
/* Don't bother to close files. Exit does that
* automagically, so we can save a few bytes */
/* close(fd); */
+4 -2
View File
@@ -21,13 +21,15 @@
*
*/
/* no options, no getopt */
#include <stdio.h>
#include <stdlib.h>
#include "busybox.h"
extern int reset_main(int argc, char **argv)
{
printf("\033[?25h\033c\033[J");
return EXIT_SUCCESS;
printf("\033[?25h\033c\033[J");
return EXIT_SUCCESS;
}
+30 -33
View File
@@ -17,7 +17,7 @@ config CONFIG_CAL
bool "cal"
default n
help
cal is used to display a montly calender.
cal is used to display a monthly calender.
config CONFIG_CAT
bool "cat"
@@ -30,7 +30,7 @@ config CONFIG_CHGRP
bool "chgrp"
default n
help
chgrp is used to change the group owership of files.
chgrp is used to change the group ownership of files.
config CONFIG_CHMOD
bool "chmod"
@@ -42,7 +42,7 @@ config CONFIG_CHOWN
bool "chown"
default n
help
chown is used too change the user and/or group ownership
chown is used to change the user and/or group ownership
of files.
config CONFIG_CHROOT
@@ -114,14 +114,14 @@ config CONFIG_DIRNAME
bool "dirname"
default n
help
dirname is used to strip a non directory suffix from
dirname is used to strip a non-directory suffix from
a file name.
config CONFIG_DOS2UNIX
bool "dos2unix/unix2dos"
default n
help
dos2unix is uses to convert a text file from DOS format to
dos2unix is used to convert a text file from DOS format to
UNIX format, and vice versa.
config CONFIG_UNIX2DOS
@@ -161,7 +161,7 @@ config CONFIG_ENV
default n
help
env is used to set an environment variable and run
a command, without options it displays the current
a command; without options it displays the current
environment.
config CONFIG_EXPR
@@ -218,6 +218,12 @@ config CONFIG_ID
help
id displays the current user and group ID names.
config CONFIG_INSTALL
bool "install"
default n
help
Copy files and set attributes.
config CONFIG_LENGTH
bool "length"
default n
@@ -347,7 +353,7 @@ config CONFIG_REALPATH
default n
help
Return the canonicalized absolute pathname.
This isnt provided by GNU shellutils, but where else does it belong.
This isn't provided by GNU shellutils, but where else does it belong.
config CONFIG_RM
bool "rm"
@@ -367,13 +373,6 @@ config CONFIG_SHA1SUM
help
Compute and check SHA1 message digest
config CONFIG_FEATURE_SHA1SUM_CHECK
bool " Enale -c and -w options"
default n
help
Enabling the -c and -w options allow files to be checked
against pre-calculated hash values.
config CONFIG_SLEEP
bool "sleep (single integer arg with no suffix)"
default n
@@ -393,22 +392,6 @@ config CONFIG_SORT
help
sort is used to sort lines of text in specified files.
config CONFIG_FEATURE_SORT_REVERSE
bool " Enable reverse sort"
default y
depends on CONFIG_SORT
help
Enable the `-r' option that allows sort to sort lines of
text in reverse.
config CONFIG_FEATURE_SORT_UNIQUE
bool " Enable unique sort"
default y
depends on CONFIG_SORT
help
Enable the `-u' option that allows sort to only sort lines
that are uniq.
config CONFIG_STTY
bool "stty"
default n
@@ -429,11 +412,12 @@ config CONFIG_TAIL
from files.
config CONFIG_FEATURE_FANCY_TAIL
bool " Enable extra tail options (-c, -q, -s, and -v)"
bool " Enable extra tail options (-q, -s, and -v)"
default y
depends on CONFIG_TAIL
help
Enable tail options (-c, -q, -s, and -v).
The options (-q, -s, and -v) are provided by GNU tail, but
are not specific in the SUSv3 standard.
config CONFIG_TEE
bool "tee"
@@ -462,7 +446,7 @@ if !CONFIG_ASH && !CONFIG_HUSH && !CONFIG_LASH && !CONFIG_MSH
help
test is used to check file types and compare values,
returning an appropriate exit code. The shells (ash
and bash have test builtin).
and bash) have test builtin.
endif
config CONFIG_TOUCH
@@ -599,4 +583,17 @@ config CONFIG_FEATURE_HUMAN_READABLE
help
Allow df, du, and ls to have human readable output.
comment "Common options for md5sum, sha1sum"
depends on CONFIG_MD5SUM || CONFIG_SHA1SUM
config CONFIG_FEATURE_MD5_SHA1_SUM_CHECK
bool " Enable -c, -s and -w options"
default n
depends on CONFIG_MD5SUM || CONFIG_SHA1SUM
help
Enabling the -c options allows files to be checked
against pre-calculated hash values.
-s and -w are useful options when verifying checksums.
endmenu
+3 -2
View File
@@ -47,11 +47,12 @@ COREUTILS-$(CONFIG_FOLD) += fold.o
COREUTILS-$(CONFIG_HEAD) += head.o
COREUTILS-$(CONFIG_HOSTID) += hostid.o
COREUTILS-$(CONFIG_ID) += id.o
COREUTILS-$(CONFIG_INSTALL) += install.o
COREUTILS-$(CONFIG_LENGTH) += length.o
COREUTILS-$(CONFIG_LN) += ln.o
COREUTILS-$(CONFIG_LOGNAME) += logname.o
COREUTILS-$(CONFIG_LS) += ls.o
COREUTILS-$(CONFIG_MD5SUM) += md5sum.o
COREUTILS-$(CONFIG_MD5SUM) += md5_sha1_sum.o
COREUTILS-$(CONFIG_MKDIR) += mkdir.o
COREUTILS-$(CONFIG_MKFIFO) += mkfifo.o
COREUTILS-$(CONFIG_MKNOD) += mknod.o
@@ -62,7 +63,7 @@ COREUTILS-$(CONFIG_PWD) += pwd.o
COREUTILS-$(CONFIG_REALPATH) += realpath.o
COREUTILS-$(CONFIG_RM) += rm.o
COREUTILS-$(CONFIG_RMDIR) += rmdir.o
COREUTILS-$(CONFIG_SHA1SUM) += sha1sum.o
COREUTILS-$(CONFIG_SHA1SUM) += md5_sha1_sum.o
COREUTILS-$(CONFIG_SLEEP) += sleep.o
COREUTILS-$(CONFIG_SORT) += sort.o
COREUTILS-$(CONFIG_STTY) += stty.o
+1 -14
View File
@@ -1,19 +1,6 @@
/* NOTE:
*
* Apparently, all "Steven J. Merrifield" did was grab the util-linux cal applet,
* spend maybe 5 minutes integrating it into busybox, slapped a copyright on it,
* and submitted it. I certainly saw no evidence of any attempt at size reduction.
* Not only do I consider his copyright below meaningless, I also consider his
* actions shameful.
*
* Manuel Novoa III (mjn3@codepoet.org)
*/
/*
* Calendar implementation for busybox
*
* Copyright (C) 2001 by Steven J. Merrifield <steve@labyrinth.net.au>
*
* See original copyright at the end of this file
*
* This program is free software; you can redistribute it and/or modify
@@ -337,7 +324,7 @@ static char *build_row(char *p, int *dp)
do {
if ((day = *dp++) != SPACE) {
if (julian) {
*++p;
++p;
if (day >= 100) {
*p = '0';
p[-1] = (day / 100) + '0';
+1 -1
View File
@@ -54,7 +54,7 @@ extern int cat_main(int argc, char **argv)
do {
if ((f = bb_wfopen_input(*argv)) != NULL) {
int r = bb_copyfd(fileno(f), STDOUT_FILENO, 0);
int r = bb_copyfd_eof(fileno(f), STDOUT_FILENO);
bb_fclose_nonstdin(f);
if (r >= 0) {
continue;
+1 -5
View File
@@ -48,7 +48,6 @@ int chgrp_main(int argc, char **argv)
long gid;
int recursiveFlag;
int retval = EXIT_SUCCESS;
char *p;
recursiveFlag = bb_getopt_ulflags(argc, argv, "R");
@@ -59,10 +58,7 @@ int chgrp_main(int argc, char **argv)
argv += optind;
/* Find the selected group */
gid = strtoul(*argv, &p, 10); /* maybe it's already numeric */
if (*p || (p == *argv)) { /* trailing chars or nonnumeric */
gid = my_getgrnam(*argv);
}
gid = get_ug_id(*argv, my_getgrnam);
++argv;
/* Ok, ready to do the deed now */
+1 -13
View File
@@ -43,6 +43,7 @@ static int (*chown_func)(const char *, uid_t, gid_t) = chown;
static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
{
if (chown_func(fileName, uid, (gid == -1) ? statbuf->st_gid : gid) == 0) {
chmod(fileName, statbuf->st_mode);
return (TRUE);
}
bb_perror_msg("%s", fileName); /* Avoid multibyte problems. */
@@ -52,19 +53,6 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
#define FLAG_R 1
#define FLAG_h 2
static unsigned long get_ug_id(const char *s, long (*my_getxxnam)(const char *))
{
unsigned long r;
char *p;
r = strtoul(s, &p, 10);
if (*p || (s == p)) {
r = my_getxxnam(s);
}
return r;
}
int chown_main(int argc, char **argv)
{
int flags;
+1 -1
View File
@@ -43,7 +43,7 @@ int chroot_main(int argc, char **argv)
if (argc == 2) {
argv -= 2;
if (!(*argv = getenv("SHELL"))) {
*argv = (char *) "/bin/sh";
*argv = (char *) DEFAULT_SHELL;
}
argv[1] = (char *) "-i";
}
+1 -1
View File
@@ -62,7 +62,7 @@ extern int env_main(int argc, char** argv)
char **ep, *p;
char *cleanenv[1] = { NULL };
unsigned long opt;
llist_t *unset_env;
llist_t *unset_env = NULL;
extern char **environ;
bb_opt_complementaly = "u*";
+69 -72
View File
@@ -7,6 +7,7 @@
*
* Busybox modifications
* Copyright (c) 2000 Edward Betts <edward@debian.org>.
* Aug 2003 Vladimir Oleynik - reduced 464 bytes.
*
* 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
@@ -40,6 +41,7 @@
#include <stdlib.h>
#include <regex.h>
#include <sys/types.h>
#include <errno.h>
#include "busybox.h"
@@ -135,10 +137,8 @@ static int null (VALUE *v)
switch (v->type) {
case integer:
return v->u.i == 0;
case string:
default: /* string: */
return v->u.s[0] == '\0' || strcmp (v->u.s, "0") == 0;
default:
abort ();
}
}
@@ -156,13 +156,9 @@ static void tostring (VALUE *v)
static int toarith (VALUE *v)
{
if(v->type == string) {
int i;
switch (v->type) {
case integer:
return 1;
case string:
i = 0;
/* Don't interpret the empty string as an integer. */
if (v->u.s == 0)
return 0;
@@ -170,10 +166,8 @@ static int toarith (VALUE *v)
free (v->u.s);
v->u.i = i;
v->type = integer;
return 1;
default:
abort ();
}
return 1;
}
/* Return nonzero if the next token matches STR exactly.
@@ -189,56 +183,59 @@ nextarg (char *str)
/* The comparison operator handling functions. */
#define cmpf(name, rel) \
static int name (VALUE *l, VALUE *r) \
{ \
if (l->type == string || r->type == string) { \
tostring (l); \
tostring (r); \
return strcmp (l->u.s, r->u.s) rel 0; \
} \
else \
return l->u.i rel r->u.i; \
}
cmpf (less_than, <)
cmpf (less_equal, <=)
cmpf (equal, ==)
cmpf (not_equal, !=)
cmpf (greater_equal, >=)
cmpf (greater_than, >)
static int cmp_common (VALUE *l, VALUE *r, int op)
{
int cmpval;
#undef cmpf
if (l->type == string || r->type == string) {
tostring (l);
tostring (r);
cmpval = strcmp (l->u.s, r->u.s);
}
else
cmpval = l->u.i - r->u.i;
switch(op) {
case '<':
return cmpval < 0;
case ('L'+'E'):
return cmpval <= 0;
case '=':
return cmpval == 0;
case '!':
return cmpval != 0;
case '>':
return cmpval > 0;
default: /* >= */
return cmpval >= 0;
}
}
/* The arithmetic operator handling functions. */
#define arithf(name, op) \
static \
int name (VALUE *l, VALUE *r) \
{ \
if (!toarith (l) || !toarith (r)) \
bb_error_msg_and_die ("non-numeric argument"); \
return l->u.i op r->u.i; \
static int arithmetic_common (VALUE *l, VALUE *r, int op)
{
int li, ri;
if (!toarith (l) || !toarith (r))
bb_error_msg_and_die ("non-numeric argument");
li = l->u.i;
ri = r->u.i;
if((op == '/' || op == '%') && ri == 0)
bb_error_msg_and_die ( "division by zero");
switch(op) {
case '+':
return li + ri;
case '-':
return li - ri;
case '*':
return li * ri;
case '/':
return li / ri;
default:
return li % ri;
}
}
#define arithdivf(name, op) \
static int name (VALUE *l, VALUE *r) \
{ \
if (!toarith (l) || !toarith (r)) \
bb_error_msg_and_die ( "non-numeric argument"); \
if (r->u.i == 0) \
bb_error_msg_and_die ( "division by zero"); \
return l->u.i op r->u.i; \
}
arithf (plus, +)
arithf (minus, -)
arithf (multiply, *)
arithdivf (divide, /)
arithdivf (mod, %)
#undef arithf
#undef arithdivf
/* Do the : operator.
SV is the VALUE for the lhs (the string),
PV is the VALUE for the rhs (the pattern). */
@@ -408,21 +405,21 @@ static VALUE *eval5 (void)
static VALUE *eval4 (void)
{
VALUE *l, *r;
int (*fxn) (VALUE *, VALUE *), val;
int op, val;
l = eval5 ();
while (1) {
if (nextarg ("*"))
fxn = multiply;
op = '*';
else if (nextarg ("/"))
fxn = divide;
op = '/';
else if (nextarg ("%"))
fxn = mod;
op = '%';
else
return l;
args++;
r = eval5 ();
val = (*fxn) (l, r);
val = arithmetic_common (l, r, op);
freev (l);
freev (r);
l = int_value (val);
@@ -434,19 +431,19 @@ static VALUE *eval4 (void)
static VALUE *eval3 (void)
{
VALUE *l, *r;
int (*fxn) (VALUE *, VALUE *), val;
int op, val;
l = eval4 ();
while (1) {
if (nextarg ("+"))
fxn = plus;
op = '+';
else if (nextarg ("-"))
fxn = minus;
op = '-';
else
return l;
args++;
r = eval4 ();
val = (*fxn) (l, r);
val = arithmetic_common (l, r, op);
freev (l);
freev (r);
l = int_value (val);
@@ -458,29 +455,29 @@ static VALUE *eval3 (void)
static VALUE *eval2 (void)
{
VALUE *l, *r;
int (*fxn) (VALUE *, VALUE *), val;
int op, val;
l = eval3 ();
while (1) {
if (nextarg ("<"))
fxn = less_than;
op = '<';
else if (nextarg ("<="))
fxn = less_equal;
op = 'L'+'E';
else if (nextarg ("=") || nextarg ("=="))
fxn = equal;
op = '=';
else if (nextarg ("!="))
fxn = not_equal;
op = '!';
else if (nextarg (">="))
fxn = greater_equal;
op = 'G'+'E';
else if (nextarg (">"))
fxn = greater_than;
op = '>';
else
return l;
args++;
r = eval3 ();
toarith (l);
toarith (r);
val = (*fxn) (l, r);
val = cmp_common (l, r, op);
freev (l);
freev (r);
l = int_value (val);
+131
View File
@@ -0,0 +1,131 @@
/*
* Copyright (C) 2003 by Glenn McGrath <bug1@optushome.com.au>
*
* 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.
*
*
* TODO: -d option, need a way of recursively making directories and changing
* owner/group, will probably modify bb_make_directory(...)
*/
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
#include <getopt.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "busybox.h"
#include "libcoreutils/coreutils.h"
#define INSTALL_OPT_CMD 1
#define INSTALL_OPT_DIRECTORY 2
#define INSTALL_OPT_PRESERVE_TIME 4
#define INSTALL_OPT_STRIP 8
#define INSTALL_OPT_GROUP 16
#define INSTALL_OPT_MODE 32
#define INSTALL_OPT_OWNER 64
extern int install_main(int argc, char **argv)
{
struct stat statbuf;
mode_t mode = 0755;
uid_t uid = -1;
gid_t gid = -1;
char *gid_str;
char *uid_str;
char *mode_str;
int copy_flags = FILEUTILS_DEREFERENCE | FILEUTILS_FORCE;
int ret = EXIT_SUCCESS;
int flags;
int i;
/* -c exists for backwards compatability, its needed */
flags = bb_getopt_ulflags(argc, argv, "cdpsg:m:o:", &gid_str, &mode_str, &uid_str); /* 'a' must be 2nd */
/* preserve access and modification time, this is GNU behaviour, BSD only preserves modification time */
if (flags & INSTALL_OPT_PRESERVE_TIME) {
copy_flags |= FILEUTILS_PRESERVE_STATUS;
}
if (flags & INSTALL_OPT_GROUP) {
gid = get_ug_id(gid_str, my_getgrnam);
}
if (flags & INSTALL_OPT_MODE) {
bb_parse_mode(mode_str, &mode);
}
if (flags & INSTALL_OPT_OWNER) {
uid = get_ug_id(uid_str, my_getpwnam);
}
/* Create directories */
if (flags & INSTALL_OPT_DIRECTORY) {
for (argv += optind; *argv; argv++) {
unsigned char *dir_name = *argv;
unsigned char *argv_ptr;
ret |= bb_make_directory(dir_name, mode, FILEUTILS_RECUR);
do {
argv_ptr = strrchr(dir_name, '/');
/* Skip the "." and ".." directories */
if ((dir_name[0] == '.') && ((dir_name[1] == '\0') || ((dir_name[1] == '.') && (dir_name[2] == '\0')))) {
break;
}
if (lchown(dir_name, uid, gid) == -1) {
bb_perror_msg("cannot change ownership of %s", argv_ptr);
ret |= EXIT_FAILURE;
}
if (argv_ptr) {
*argv_ptr = '\0';
}
} while (argv_ptr);
}
return(ret);
}
cp_mv_stat2(argv[argc - 1], &statbuf, lstat);
for (i = optind; i < argc - 1; i++) {
unsigned char *dest;
if (S_ISDIR(statbuf.st_mode)) {
dest = concat_path_file(argv[argc - 1], basename(argv[i]));
} else {
dest = argv[argc - 1];
}
ret |= copy_file(argv[i], dest, copy_flags);
/* Set the file mode */
if (chmod(dest, mode) == -1) {
bb_perror_msg("cannot change permissions of %s", dest);
ret |= EXIT_FAILURE;
}
/* Set the user and group id */
if (lchown(dest, uid, gid) == -1) {
bb_perror_msg("cannot change ownership of %s", dest);
ret |= EXIT_FAILURE;
}
if (flags & INSTALL_OPT_STRIP) {
if (execlp("strip", "strip", dest, NULL) == -1) {
bb_error_msg("strip failed");
ret |= EXIT_FAILURE;
}
}
}
return(ret);
}
+5 -8
View File
@@ -203,7 +203,7 @@ static int is_flask_enabled_flag;
#endif
#ifdef CONFIG_FEATURE_AUTOWIDTH
static unsigned short terminal_width = TERMINAL_WIDTH;
static int terminal_width = TERMINAL_WIDTH;
static unsigned short tabstops = COLUMN_GAP;
#else
#define tabstops COLUMN_GAP
@@ -915,10 +915,6 @@ extern int ls_main(int argc, char **argv)
is_flask_enabled_flag = is_flask_enabled();
#endif
#ifdef CONFIG_FEATURE_AUTOWIDTH
struct winsize win = { 0, 0, 0, 0 };
#endif
all_fmt = LIST_SHORT | DISP_NORMAL | STYLE_AUTO
#ifdef CONFIG_FEATURE_LS_TIMESTAMPS
| TIME_MOD
@@ -928,9 +924,10 @@ extern int ls_main(int argc, char **argv)
#endif
;
#ifdef CONFIG_FEATURE_AUTOWIDTH
ioctl(fileno(stdout), TIOCGWINSZ, &win);
if (win.ws_col > 0)
terminal_width = win.ws_col - 1;
/* Obtain the terminal width. */
get_terminal_width_height(0, &terminal_width, NULL);
/* Go one less... */
terminal_width--;
#endif
nfiles = 0;
+203
View File
@@ -0,0 +1,203 @@
/*
* Copyright (C) 2003 Glenn L. McGrath
* Copyright (C) 2003 Erik Andersen
*
* 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 <limits.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "busybox.h"
#define FLAG_SILENT 1
#define FLAG_CHECK 2
#define FLAG_WARN 4
/* This might be usefull elsewhere */
static unsigned char *hash_bin_to_hex(unsigned char *hash_value,
unsigned char hash_length)
{
int x, len, max;
unsigned char *hex_value;
max = (hash_length * 2) + 2;
hex_value = xmalloc(max);
for (x = len = 0; x < hash_length; x++) {
len += snprintf(hex_value + len, max - len, "%02x", hash_value[x]);
}
return (hex_value);
}
static uint8_t *hash_file(const char *filename, uint8_t hash_algo)
{
uint8_t *hash_value_bin;
uint8_t *hash_value = NULL;
uint8_t hash_length;
int src_fd;
if (strcmp(filename, "-") == 0) {
src_fd = fileno(stdin);
} else {
src_fd = open(filename, O_RDONLY);
}
if (hash_algo == HASH_MD5) {
hash_length = 16;
} else {
hash_length = 20;
}
hash_value_bin = xmalloc(hash_length);
if ((src_fd != -1) && (hash_fd(src_fd, -1, hash_algo, hash_value_bin) != -2)) {
hash_value = hash_bin_to_hex(hash_value_bin, hash_length);
} else {
bb_perror_msg("%s", filename);
}
close(src_fd);
return(hash_value);
}
/* This could become a common function for md5 as well, by using md5_stream */
extern int hash_files(int argc, char **argv, const uint8_t hash_algo)
{
int return_value = EXIT_SUCCESS;
uint8_t *hash_value;
#ifdef CONFIG_FEATURE_MD5_SHA1_SUM_CHECK
unsigned int flags;
flags = bb_getopt_ulflags(argc, argv, "scw");
#endif
#ifdef CONFIG_FEATURE_MD5_SHA1_SUM_CHECK
if (!(flags & FLAG_CHECK)) {
if (flags & FLAG_SILENT) {
bb_error_msg_and_die
("the -s option is meaningful only when verifying checksums");
} else if (flags & FLAG_WARN) {
bb_error_msg_and_die
("the -w option is meaningful only when verifying checksums");
}
}
#endif
if (argc == optind) {
argv[argc++] = "-";
}
#ifdef CONFIG_FEATURE_MD5_SHA1_SUM_CHECK
if (flags & FLAG_CHECK) {
FILE *pre_computed_stream;
int count_total = 0;
int count_failed = 0;
unsigned char *file_ptr = argv[optind];
char *line;
if (optind + 1 != argc) {
bb_error_msg_and_die
("only one argument may be specified when using -c");
}
if (strcmp(file_ptr, "-") == 0) {
pre_computed_stream = stdin;
} else {
pre_computed_stream = bb_xfopen(file_ptr, "r");
}
while ((line = bb_get_chomped_line_from_file(pre_computed_stream)) != NULL) {
char *filename_ptr;
count_total++;
filename_ptr = strstr(line, " ");
if (filename_ptr == NULL) {
if (flags & FLAG_WARN) {
bb_error_msg("Invalid format");
}
free(line);
continue;
}
*filename_ptr = '\0';
filename_ptr += 2;
hash_value = hash_file(filename_ptr, hash_algo);
if (hash_value && (strcmp(hash_value, line) == 0)) {
if (!(flags & FLAG_SILENT))
printf("%s: OK\n", filename_ptr);
} else {
if (!(flags & FLAG_SILENT))
printf("%s: FAILED\n", filename_ptr);
count_failed++;
}
/* possible free(NULL) */
free(hash_value);
free(line);
}
if (count_failed && !(flags & FLAG_SILENT)) {
bb_error_msg("WARNING: %d of %d computed checksums did NOT match",
count_failed, count_total);
}
if (bb_fclose_nonstdin(pre_computed_stream) == EOF) {
bb_perror_msg_and_die("Couldnt close file %s", file_ptr);
}
} else
#endif
{
uint8_t hash_length;
if (hash_algo == HASH_MD5) {
hash_length = 16;
} else {
hash_length = 20;
}
hash_value = xmalloc(hash_length);
while (optind < argc) {
unsigned char *file_ptr = argv[optind++];
hash_value = hash_file(file_ptr, hash_algo);
if (hash_value == NULL) {
return_value++;
} else {
printf("%s %s\n", hash_value, file_ptr);
free(hash_value);
}
}
}
return (return_value);
}
#ifdef CONFIG_MD5SUM
extern int md5sum_main(int argc, char **argv)
{
return(hash_files(argc, argv, HASH_MD5));
}
#endif
#ifdef CONFIG_SHA1SUM
extern int sha1sum_main(int argc, char **argv)
{
return(hash_files(argc, argv, HASH_SHA1));
}
#endif
-1102
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -411,7 +411,7 @@ static unsigned long xstrtoul(char *arg)
assert(arg!=NULL);
errno = 0;
result = strtoul(arg, &endptr, 10);
result = strtoul(arg, &endptr, 0);
if (errno != 0 || *endptr!='\0' || endptr==arg)
fprintf(stderr, "%s", arg);
//errno = errno_save;
@@ -427,7 +427,7 @@ static long xstrtol(char *arg)
assert(arg!=NULL);
errno = 0;
result = strtoul(arg, &endptr, 10);
result = strtoul(arg, &endptr, 0);
if (errno != 0 || *endptr!='\0' || endptr==arg)
fprintf(stderr, "%s", arg);
//errno = errno_save;
-492
View File
@@ -1,492 +0,0 @@
/*
* Based on shasum from http://www.netsw.org/crypto/hash/
* Majorly hacked up to use Dr Brian Gladman's sha1 code
*
* Copyright (C) 1999 Scott G. Miller
* Copyright (C) 2003 Glenn L. McGrath
* Copyright (C) 2003 Erik Andersen
*
* 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 <stdio.h>
#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <stdint.h>
#include <endian.h>
#include <byteswap.h>
#include "busybox.h"
/*
---------------------------------------------------------------------------
Begin Dr. Gladman's sha1 code
---------------------------------------------------------------------------
*/
/*
---------------------------------------------------------------------------
Copyright (c) 2002, Dr Brian Gladman <brg@gladman.me.uk>, Worcester, UK.
All rights reserved.
LICENSE TERMS
The free distribution and use of this software in both source and binary
form is allowed (with or without changes) provided that:
1. distributions of this source code include the above copyright
notice, this list of conditions and the following disclaimer;
2. distributions in binary form include the above copyright
notice, this list of conditions and the following disclaimer
in the documentation and/or other associated materials;
3. the copyright holder's name is not used to endorse products
built using this software without specific written permission.
ALTERNATIVELY, provided that this notice is retained in full, this product
may be distributed under the terms of the GNU General Public License (GPL),
in which case the provisions of the GPL apply INSTEAD OF those given above.
DISCLAIMER
This software is provided 'as is' with no explicit or implied warranties
in respect of its properties, including, but not limited to, correctness
and/or fitness for purpose.
---------------------------------------------------------------------------
Issue Date: 10/11/2002
This is a byte oriented version of SHA1 that operates on arrays of bytes
stored in memory. It runs at 22 cycles per byte on a Pentium P4 processor
*/
#define SHA1_BLOCK_SIZE 64
#define SHA1_DIGEST_SIZE 20
#define SHA1_HASH_SIZE SHA1_DIGEST_SIZE
#define SHA2_GOOD 0
#define SHA2_BAD 1
/* type to hold the SHA1 context */
typedef struct
{ uint32_t count[2];
uint32_t hash[5];
uint32_t wbuf[16];
} sha1_ctx;
#define rotl32(x,n) (((x) << n) | ((x) >> (32 - n)))
#if __BYTE_ORDER == __BIG_ENDIAN
# define swap_b32(x) (x)
#elif defined(bswap_32)
# define swap_b32(x) bswap_32(x)
#else
# define swap_b32(x) ((rotl32((x), 8) & 0x00ff00ff) | (rotl32((x), 24) & 0xff00ff00))
#endif
#define SHA1_MASK (SHA1_BLOCK_SIZE - 1)
/* reverse byte order in 32-bit words */
#define ch(x,y,z) (((x) & (y)) ^ (~(x) & (z)))
#define parity(x,y,z) ((x) ^ (y) ^ (z))
#define maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
/* A normal version as set out in the FIPS. This version uses */
/* partial loop unrolling and is optimised for the Pentium 4 */
#define rnd(f,k) \
t = a; a = rotl32(a,5) + f(b,c,d) + e + k + w[i]; \
e = d; d = c; c = rotl32(b, 30); b = t
void sha1_compile(sha1_ctx ctx[1])
{
uint32_t w[80], i, a, b, c, d, e, t;
/* note that words are compiled from the buffer into 32-bit */
/* words in big-endian order so an order reversal is needed */
/* here on little endian machines */
for(i = 0; i < SHA1_BLOCK_SIZE / 4; ++i)
w[i] = swap_b32(ctx->wbuf[i]);
for(i = SHA1_BLOCK_SIZE / 4; i < 80; ++i)
w[i] = rotl32(w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16], 1);
a = ctx->hash[0];
b = ctx->hash[1];
c = ctx->hash[2];
d = ctx->hash[3];
e = ctx->hash[4];
for(i = 0; i < 20; ++i)
{
rnd(ch, 0x5a827999);
}
for(i = 20; i < 40; ++i)
{
rnd(parity, 0x6ed9eba1);
}
for(i = 40; i < 60; ++i)
{
rnd(maj, 0x8f1bbcdc);
}
for(i = 60; i < 80; ++i)
{
rnd(parity, 0xca62c1d6);
}
ctx->hash[0] += a;
ctx->hash[1] += b;
ctx->hash[2] += c;
ctx->hash[3] += d;
ctx->hash[4] += e;
}
void sha1_begin(sha1_ctx ctx[1])
{
ctx->count[0] = ctx->count[1] = 0;
ctx->hash[0] = 0x67452301;
ctx->hash[1] = 0xefcdab89;
ctx->hash[2] = 0x98badcfe;
ctx->hash[3] = 0x10325476;
ctx->hash[4] = 0xc3d2e1f0;
}
/* SHA1 hash data in an array of bytes into hash buffer and call the */
/* hash_compile function as required. */
void sha1_hash(const unsigned char data[], unsigned int len, sha1_ctx ctx[1])
{
uint32_t pos = (uint32_t)(ctx->count[0] & SHA1_MASK),
freeb = SHA1_BLOCK_SIZE - pos;
const unsigned char *sp = data;
if((ctx->count[0] += len) < len)
++(ctx->count[1]);
while(len >= freeb) /* tranfer whole blocks while possible */
{
memcpy(((unsigned char*)ctx->wbuf) + pos, sp, freeb);
sp += freeb; len -= freeb; freeb = SHA1_BLOCK_SIZE; pos = 0;
sha1_compile(ctx);
}
memcpy(((unsigned char*)ctx->wbuf) + pos, sp, len);
}
/* SHA1 Final padding and digest calculation */
#if __BYTE_ORDER == __LITTLE_ENDIAN
static uint32_t mask[4] =
{ 0x00000000, 0x000000ff, 0x0000ffff, 0x00ffffff };
static uint32_t bits[4] =
{ 0x00000080, 0x00008000, 0x00800000, 0x80000000 };
#else
static uint32_t mask[4] =
{ 0x00000000, 0xff000000, 0xffff0000, 0xffffff00 };
static uint32_t bits[4] =
{ 0x80000000, 0x00800000, 0x00008000, 0x00000080 };
#endif
void sha1_end(unsigned char hval[], sha1_ctx ctx[1])
{
uint32_t i, cnt = (uint32_t)(ctx->count[0] & SHA1_MASK);
/* mask out the rest of any partial 32-bit word and then set */
/* the next byte to 0x80. On big-endian machines any bytes in */
/* the buffer will be at the top end of 32 bit words, on little */
/* endian machines they will be at the bottom. Hence the AND */
/* and OR masks above are reversed for little endian systems */
ctx->wbuf[cnt >> 2] = (ctx->wbuf[cnt >> 2] & mask[cnt & 3]) | bits[cnt & 3];
/* we need 9 or more empty positions, one for the padding byte */
/* (above) and eight for the length count. If there is not */
/* enough space pad and empty the buffer */
if(cnt > SHA1_BLOCK_SIZE - 9)
{
if(cnt < 60) ctx->wbuf[15] = 0;
sha1_compile(ctx);
cnt = 0;
}
else /* compute a word index for the empty buffer positions */
cnt = (cnt >> 2) + 1;
while(cnt < 14) /* and zero pad all but last two positions */
ctx->wbuf[cnt++] = 0;
/* assemble the eight byte counter in the buffer in big-endian */
/* format */
ctx->wbuf[14] = swap_b32((ctx->count[1] << 3) | (ctx->count[0] >> 29));
ctx->wbuf[15] = swap_b32(ctx->count[0] << 3);
sha1_compile(ctx);
/* extract the hash value as bytes in case the hash buffer is */
/* misaligned for 32-bit words */
for(i = 0; i < SHA1_DIGEST_SIZE; ++i)
hval[i] = (unsigned char)(ctx->hash[i >> 2] >> 8 * (~i & 3));
}
#if 0
void sha1(unsigned char hval[], const unsigned char data[], unsigned int len)
{ sha1_ctx cx[1];
sha1_begin(cx); sha1_hash(data, len, cx); sha1_end(hval, cx);
}
#endif
/*
---------------------------------------------------------------------------
End of Dr. Gladman's sha1 code
---------------------------------------------------------------------------
*/
/* Using a larger blocksize can make things _much_ faster
* by avoiding a zillion tiny little reads */
#define BLOCKSIZE 65536
/* Ensure that BLOCKSIZE is a multiple of 64. */
#if BLOCKSIZE % SHA1_BLOCK_SIZE != 0
# error "BLOCKSIZE not a multiple of 64"
#endif
static int sha1sum_stream(FILE *stream, unsigned char *hashval)
{
int result = 0;
sha1_ctx cx[1];
size_t sum, n;
RESERVE_CONFIG_BUFFER(buffer, BLOCKSIZE + 72);
/* Initialize the computation context. */
sha1_begin(cx);
/* Iterate over full file contents. */
while (1)
{
/* We read the file in blocks of BLOCKSIZE bytes. One call of the
computation function processes the whole buffer so that with the
next round of the loop another block can be read. */
sum = 0;
/* Read block. Take care for partial reads. */
while (1)
{
n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
sum += n;
if (sum == BLOCKSIZE)
break;
if (n == 0) {
/* Check for the error flag IFF N == 0, so that we don't
exit the loop after a partial read due to e.g., EAGAIN
or EWOULDBLOCK. */
if (feof (stream)) {
sum = 0;
goto process_partial_block;
}
if (ferror (stream)) {
result++;
goto all_done;
}
goto process_partial_block;
}
/* We've read at least one byte, so ignore errors. But always
check for EOF, since feof may be true even though N > 0.
Otherwise, we could end up calling fread after EOF. */
if (feof (stream))
goto process_partial_block;
}
/* Process buffer */
sha1_hash(buffer, BLOCKSIZE, cx);
}
process_partial_block:
/* Process any remaining bytes. */
if (sum > 0)
sha1_hash(buffer, sum, cx);
/* Finalize and write the hash into our buffer. */
sha1_end(hashval, cx);
all_done:
RELEASE_CONFIG_BUFFER(buffer);
return result;
}
#define FLAG_SILENT 1
#define FLAG_CHECK 2
#define FLAG_WARN 4
static unsigned char *hash_bin_to_hex(unsigned char *hash_value, unsigned char hash_length)
{
int x, len, max;
unsigned char *hex_value;
max = (hash_length * 2) + 2;
hex_value = xmalloc(max);
for (x = len = 0; x < hash_length; x++) {
len += snprintf(hex_value+len, max-len, "%02x", hash_value[x]);
}
return(hex_value);
}
FILE *wfopen_file_or_stdin(const char *file_ptr)
{
FILE *stream;
if ((file_ptr[0] == '-') && (file_ptr[1] == '\0')) {
stream = stdin;
} else {
stream = bb_wfopen(file_ptr, "r");
}
return(stream);
}
/* This could become a common function for md5 as well, by using md5_stream */
extern int authenticate(int argc, char **argv,
int (*hash_ptr)(FILE *stream, unsigned char *hashval),
const unsigned char hash_length)
{
unsigned char hash_value[hash_length];
unsigned int flags;
int return_value = EXIT_SUCCESS;
#ifdef CONFIG_FEATURE_SHA1SUM_CHECK
flags = bb_getopt_ulflags(argc, argv, "scw");
#else
flags = bb_getopt_ulflags(argc, argv, "s");
#endif
#ifdef CONFIG_FEATURE_SHA1SUM_CHECK
if (!(flags & FLAG_CHECK)) {
if (flags & FLAG_SILENT) {
bb_error_msg_and_die("the -s option is meaningful only when verifying checksums");
}
else if (flags & FLAG_WARN) {
bb_error_msg_and_die("the -w option is meaningful only when verifying checksums");
}
}
#endif
if (argc == optind) {
argv[argc++] = "-";
}
#ifdef CONFIG_FEATURE_SHA1SUM_CHECK
if (flags & FLAG_CHECK) {
FILE *pre_computed_stream;
int count_total = 0;
int count_failed = 0;
unsigned char *file_ptr = argv[optind];
if (optind + 1 != argc) {
bb_error_msg_and_die("only one argument may be specified when using -c");
}
pre_computed_stream = wfopen_file_or_stdin(file_ptr);
while (!feof(pre_computed_stream) && !ferror(pre_computed_stream)) {
FILE *stream;
char *line;
char *line_ptr;
char *hex_value;
line = bb_get_chomped_line_from_file(pre_computed_stream);
if (line == NULL) {
break;
}
count_total++;
line_ptr = strchr(line, ' ');
if (line_ptr == NULL) {
if (flags & FLAG_WARN) {
bb_error_msg("Invalid format");
}
free(line);
continue;
}
*line_ptr = '\0';
line_ptr++;
if ((flags & FLAG_WARN) && (*line_ptr != ' ')) {
bb_error_msg("Invalid format");
free(line);
continue;
}
line_ptr++;
stream = bb_wfopen(line_ptr, "r");
if (hash_ptr(stream, hash_value) == EXIT_FAILURE) {
bb_perror_msg("%s", file_ptr);
return_value = EXIT_FAILURE;
}
if (fclose(stream) == EOF) {
bb_perror_msg("Couldnt close file %s", file_ptr);
}
hex_value = hash_bin_to_hex(hash_value, hash_length);
printf("%s: ", line_ptr);
if (strcmp(hex_value, line) != 0) {
puts("FAILED");
count_failed++;
} else {
puts("ok");
}
free(line);
}
if (count_failed) {
bb_error_msg("WARNING: %d of %d computed checksum did NOT match", count_failed, count_total);
}
if (bb_fclose_nonstdin(pre_computed_stream) == EOF) {
bb_perror_msg_and_die("Couldnt close file %s", file_ptr);
}
} else
#endif
while (optind < argc) {
FILE *stream;
unsigned char *file_ptr = argv[optind];
optind++;
stream = wfopen_file_or_stdin(file_ptr);
if (stream == NULL) {
return_value = EXIT_FAILURE;
continue;
}
if (hash_ptr(stream, hash_value) == EXIT_FAILURE) {
bb_perror_msg("%s", file_ptr);
return_value = EXIT_FAILURE;
}
else if (!flags & FLAG_SILENT) {
char *hex_value = hash_bin_to_hex(hash_value, hash_length);
printf("%s %s\n", hex_value, file_ptr);
free(hex_value);
}
if (bb_fclose_nonstdin(stream) == EOF) {
bb_perror_msg("Couldnt close file %s", file_ptr);
return_value = EXIT_FAILURE;
}
}
return(return_value);
}
extern int sha1sum_main(int argc, char **argv)
{
return (authenticate(argc, argv, sha1sum_stream, SHA1_HASH_SIZE));
}
+6 -16
View File
@@ -89,9 +89,9 @@ static ssize_t tail_read(int fd, char *buf, size_t count)
}
static const char tail_opts[] =
"fn:"
"fn:c:"
#ifdef CONFIG_FEATURE_FANCY_TAIL
"c:qs:v"
"qs:v"
#endif
;
@@ -104,9 +104,7 @@ int tail_main(int argc, char **argv)
int from_top = 0;
int follow = 0;
int header_threshhold = 1;
#ifdef CONFIG_FEATURE_FANCY_TAIL
int count_bytes = 0;
#endif
char *tailbuf;
size_t tailbufsize;
@@ -132,11 +130,9 @@ int tail_main(int argc, char **argv)
case 'f':
follow = 1;
break;
#ifdef CONFIG_FEATURE_FANCY_TAIL
case 'c':
count_bytes = 1;
/* FALLS THROUGH */
#endif
case 'n':
GET_COUNT:
count = bb_xgetlarg10_sfx(optarg, tail_suffixes);
@@ -201,7 +197,7 @@ int tail_main(int argc, char **argv)
}
tailbufsize = BUFSIZ;
#ifdef CONFIG_FEATURE_FANCY_TAIL
/* tail the files */
if (from_top < count_bytes) { /* Each is 0 or 1, so true iff 0 < 1. */
/* Hence, !from_top && count_bytes */
@@ -209,7 +205,7 @@ int tail_main(int argc, char **argv)
tailbufsize = count + BUFSIZ;
}
}
#endif
buf = tailbuf = xmalloc(tailbufsize);
fmt = header_fmt + 1; /* Skip header leading newline on first output. */
@@ -237,13 +233,10 @@ int tail_main(int argc, char **argv)
if (from_top) {
nwrite = nread;
if (seen < count) {
#ifdef CONFIG_FEATURE_FANCY_TAIL
if (count_bytes) {
nwrite -= (count - seen);
seen = count;
} else
#endif
{
} else {
s = buf;
do {
--nwrite;
@@ -255,16 +248,13 @@ int tail_main(int argc, char **argv)
}
tail_xbb_full_write(buf + nread - nwrite, nwrite);
} else if (count) {
#ifdef CONFIG_FEATURE_FANCY_TAIL
if (count_bytes) {
taillen += nread;
if (taillen > count) {
memmove(tailbuf, tailbuf + taillen - count, count);
taillen = count;
}
} else
#endif
{
} else {
int k = nread;
int nbuf = 0;
+1
View File
@@ -89,6 +89,7 @@ int tee_main(int argc, char **argv)
#endif
#else
setvbuf(stdout, NULL, _IONBF, 0);
while ((c = getchar()) != EOF) {
for (p=files ; *p ; p++) {
putc(c, *p);
+160 -312
View File
@@ -1,353 +1,201 @@
/* uudecode.c -- uudecode utility.
* Copyright (C) 1994, 1995 Free Software Foundation, Inc.
/*
* GPLv2
* Copyright 2003, Glenn McGrath <bug1@optushome.com.au>
*
* This product 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, or (at your option)
* any later version.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation; either version 2 of the License.
*
* This product 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.
* 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 product; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
* 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.
*
* Reworked to GNU style by Ian Lance Taylor, ian@airs.com, August 93.
* Based on specification from
* http://www.opengroup.org/onlinepubs/007904975/utilities/uuencode.html
*
* Original copyright notice is retained at the end of this file.
* Bugs: the spec doesnt mention anything about "`\n`\n" prior to the "end" line
*/
#include <stdio.h>
#include <errno.h>
#include <getopt.h>
#include <string.h>
#include <stdlib.h>
#include "busybox.h"
#include "pwd_.h"
#include "grp_.h"
/*struct passwd *getpwnam();*/
#include "libbb.h"
/* Single character decode. */
#define DEC(Char) (((Char) - ' ') & 077)
static int read_stduu (const char *inname)
static int read_stduu(FILE *src_stream, FILE *dst_stream)
{
char buf[2 * BUFSIZ];
char *line;
while (1) {
int n;
char *p;
while ((line = bb_get_chomped_line_from_file(src_stream)) != NULL) {
int length;
char *line_ptr = line;
if (fgets (buf, sizeof(buf), stdin) == NULL) {
bb_error_msg("%s: Short file", inname);
return FALSE;
}
p = buf;
if (strcmp(line, "end") == 0) {
return(EXIT_SUCCESS);
}
length = ((*line_ptr - 0x20) & 0x3f)* 4 / 3;
/* N is used to avoid writing out all the characters at the end of
the file. */
n = DEC (*p);
if (n <= 0)
break;
for (++p; n > 0; p += 4, n -= 3) {
char ch;
if (length <= 0) {
/* Ignore the "`\n" line, why is it even in the encode file ? */
continue;
}
if (length > 60) {
bb_error_msg_and_die("Line too long");
}
line_ptr++;
/* Tolerate an overly long line to acomadate a possible exta '`' */
if (strlen(line_ptr) < length) {
bb_error_msg_and_die("Short file");
}
if (n >= 3) {
ch = DEC (p[0]) << 2 | DEC (p[1]) >> 4;
putchar (ch);
ch = DEC (p[1]) << 4 | DEC (p[2]) >> 2;
putchar (ch);
ch = DEC (p[2]) << 6 | DEC (p[3]);
putchar (ch);
} else {
if (n >= 1) {
ch = DEC (p[0]) << 2 | DEC (p[1]) >> 4;
putchar (ch);
}
if (n >= 2) {
ch = DEC (p[1]) << 4 | DEC (p[2]) >> 2;
putchar (ch);
}
}
}
}
while (length > 0) {
/* Merge four 6 bit chars to three 8 bit chars */
fputc(((line_ptr[0] - 0x20) & 077) << 2 | ((line_ptr[1] - 0x20) & 077) >> 4, dst_stream);
line_ptr++;
length--;
if (length == 0) {
break;
}
if (fgets (buf, sizeof(buf), stdin) == NULL
|| strcmp (buf, "end\n")) {
bb_error_msg("%s: No `end' line", inname);
return FALSE;
}
fputc(((line_ptr[0] - 0x20) & 077) << 4 | ((line_ptr[1] - 0x20) & 077) >> 2, dst_stream);
line_ptr++;
length--;
if (length == 0) {
break;
}
return TRUE;
fputc(((line_ptr[0] - 0x20) & 077) << 6 | ((line_ptr[1] - 0x20) & 077), dst_stream);
line_ptr += 2;
length -= 2;
}
free(line);
}
bb_error_msg_and_die("Short file");
}
static int read_base64 (const char *inname)
static int read_base64(FILE *src_stream, FILE *dst_stream)
{
static const char b64_tab[256] = {
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*000-007*/
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*010-017*/
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*020-027*/
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*030-037*/
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*040-047*/
'\177', '\177', '\177', '\76', '\177', '\177', '\177', '\77', /*050-057*/
'\64', '\65', '\66', '\67', '\70', '\71', '\72', '\73', /*060-067*/
'\74', '\75', '\177', '\177', '\177', '\100', '\177', '\177', /*070-077*/
'\177', '\0', '\1', '\2', '\3', '\4', '\5', '\6', /*100-107*/
'\7', '\10', '\11', '\12', '\13', '\14', '\15', '\16', /*110-117*/
'\17', '\20', '\21', '\22', '\23', '\24', '\25', '\26', /*120-127*/
'\27', '\30', '\31', '\177', '\177', '\177', '\177', '\177', /*130-137*/
'\177', '\32', '\33', '\34', '\35', '\36', '\37', '\40', /*140-147*/
'\41', '\42', '\43', '\44', '\45', '\46', '\47', '\50', /*150-157*/
'\51', '\52', '\53', '\54', '\55', '\56', '\57', '\60', /*160-167*/
'\61', '\62', '\63', '\177', '\177', '\177', '\177', '\177', /*170-177*/
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*200-207*/
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*210-217*/
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*220-227*/
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*230-237*/
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*240-247*/
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*250-257*/
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*260-267*/
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*270-277*/
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*300-307*/
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*310-317*/
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*320-327*/
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*330-337*/
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*340-347*/
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*350-357*/
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*360-367*/
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*370-377*/
};
unsigned char buf[2 * BUFSIZ];
const char *base64_table =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n";
char term_count = 0;
while (1) {
int last_data = 0;
unsigned char *p;
while (1) {
char translated[4];
int count = 0;
if (fgets (buf, sizeof(buf), stdin) == NULL) {
bb_error_msg("%s: Short file", inname);
return FALSE;
}
p = buf;
while (count < 4) {
char *table_ptr;
char ch;
if (memcmp (buf, "====", 4) == 0)
break;
if (last_data != 0) {
bb_error_msg("%s: data following `=' padding character", inname);
return FALSE;
}
/* Get next _valid_ character */
do {
ch = fgetc(src_stream);
if (ch == EOF) {
bb_error_msg_and_die("Short file");
}
} while ((table_ptr = strchr(base64_table, ch)) == NULL);
/* The following implementation of the base64 decoding might look
a bit clumsy but I only try to follow the POSIX standard:
``All line breaks or other characters not found in the table
[with base64 characters] shall be ignored by decoding
software.'' */
while (*p != '\n') {
char c1, c2, c3;
/* Convert encoded charcter to decimal */
ch = table_ptr - base64_table;
while ((b64_tab[*p] & '\100') != 0)
if (*p == '\n' || *p++ == '=')
break;
if (*p == '\n')
/* This leaves the loop. */
continue;
c1 = b64_tab[*p++];
if (*table_ptr == '=') {
if (term_count == 0) {
translated[count] = 0;
break;
}
term_count++;
}
else if (*table_ptr == '\n') {
/* Check for terminating line */
if (term_count == 5) {
return(EXIT_SUCCESS);
}
term_count = 1;
continue;
} else {
translated[count] = ch;
count++;
term_count = 0;
}
}
while ((b64_tab[*p] & '\100') != 0)
if (*p == '\n' || *p++ == '=') {
bb_error_msg("%s: illegal line", inname);
return FALSE;
}
c2 = b64_tab[*p++];
while (b64_tab[*p] == '\177')
if (*p++ == '\n') {
bb_error_msg("%s: illegal line", inname);
return FALSE;
}
if (*p == '=') {
putchar (c1 << 2 | c2 >> 4);
last_data = 1;
break;
}
c3 = b64_tab[*p++];
while (b64_tab[*p] == '\177')
if (*p++ == '\n') {
bb_error_msg("%s: illegal line", inname);
return FALSE;
}
putchar (c1 << 2 | c2 >> 4);
putchar (c2 << 4 | c3 >> 2);
if (*p == '=') {
last_data = 1;
break;
}
else
putchar (c3 << 6 | b64_tab[*p++]);
}
}
return TRUE;
/* Merge 6 bit chars to 8 bit */
fputc(translated[0] << 2 | translated[1] >> 4, dst_stream);
if (count > 2) {
fputc(translated[1] << 4 | translated[2] >> 2, dst_stream);
}
if (count > 3) {
fputc(translated[2] << 6 | translated[3], dst_stream);
}
}
}
static int decode (const char *inname,
const char *forced_outname)
extern int uudecode_main(int argc, char **argv)
{
struct passwd *pw;
register char *p;
int mode;
char buf[2 * BUFSIZ];
char *outname;
int do_base64 = 0;
int res;
int dofre;
int (*decode_fn_ptr) (FILE * src, FILE * dst);
FILE *src_stream;
char *outname = NULL;
char *line;
int opt;
/* Search for header line. */
opt = bb_getopt_ulflags(argc, argv, "o:", &outname);
while (1) {
if (fgets (buf, sizeof (buf), stdin) == NULL) {
bb_error_msg("%s: No `begin' line", inname);
return FALSE;
}
if (optind == argc) {
src_stream = stdin;
} else if (optind + 1 == argc) {
src_stream = bb_xfopen(argv[optind], "r");
} else {
bb_show_usage();
}
if (strncmp (buf, "begin", 5) == 0) {
if (sscanf (buf, "begin-base64 %o %s", &mode, buf) == 2) {
do_base64 = 1;
break;
} else if (sscanf (buf, "begin %o %s", &mode, buf) == 2)
break;
}
}
/* Search for the start of the encoding */
while ((line = bb_get_chomped_line_from_file(src_stream)) != NULL) {
char *line_ptr = NULL;
/* If the output file name is given on the command line this rules. */
dofre = FALSE;
if (forced_outname != NULL)
outname = (char *) forced_outname;
else {
/* Handle ~user/file format. */
if (buf[0] != '~')
outname = buf;
else {
p = buf + 1;
while (*p != '/')
++p;
if (*p == '\0') {
bb_error_msg("%s: Illegal ~user", inname);
return FALSE;
}
*p++ = '\0';
pw = getpwnam (buf + 1);
if (pw == NULL) {
bb_error_msg("%s: No user `%s'", inname, buf + 1);
return FALSE;
}
outname = concat_path_file(pw->pw_dir, p);
dofre = TRUE;
}
}
if (line == NULL) {
break;
} else if (strncmp(line, "begin-base64 ", 13) == 0) {
line_ptr = line + 13;
decode_fn_ptr = read_base64;
} else if (strncmp(line, "begin ", 6) == 0) {
line_ptr = line + 6;
decode_fn_ptr = read_stduu;
}
/* Create output file and set mode. */
if (strcmp (outname, "/dev/stdout") != 0 && strcmp (outname, "-") != 0
&& (freopen (outname, "w", stdout) == NULL
|| chmod (outname, mode & (S_IRWXU | S_IRWXG | S_IRWXO))
)) {
bb_perror_msg("%s", outname); /* */
if (dofre)
free(outname);
return FALSE;
}
if (line_ptr) {
FILE *dst_stream;
int mode;
int ret;
/* We differenciate decoding standard UU encoding and base64. A
common function would only slow down the program. */
/* For each input line: */
if (do_base64)
res = read_base64 (inname);
else
res = read_stduu (inname);
if (dofre)
free(outname);
return res;
mode = strtoul(line_ptr, NULL, 8);
if (outname == NULL) {
outname = strchr(line_ptr, ' ');
if ((outname == NULL) || (*outname == '\0')) {
break;
}
outname++;
}
if (strcmp(outname, "-") == 0) {
dst_stream = stdout;
} else {
dst_stream = bb_xfopen(outname, "w");
chmod(outname, mode & (S_IRWXU | S_IRWXG | S_IRWXO));
}
free(line);
ret = decode_fn_ptr(src_stream, dst_stream);
bb_fclose_nonstdin(src_stream);
return(ret);
}
free(line);
}
bb_error_msg_and_die("No `begin' line");
}
int uudecode_main (int argc,
char **argv)
{
int opt;
int exit_status;
const char *outname;
outname = NULL;
while ((opt = getopt(argc, argv, "o:")) != EOF) {
switch (opt) {
case 0:
break;
case 'o':
outname = optarg;
break;
default:
bb_show_usage();
}
}
if (optind == argc)
exit_status = decode ("stdin", outname) == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
else {
exit_status = EXIT_SUCCESS;
do {
if (freopen (argv[optind], "r", stdin) != NULL) {
if (decode (argv[optind], outname) != 0)
exit_status = FALSE;
} else {
bb_perror_msg("%s", argv[optind]);
exit_status = EXIT_FAILURE;
}
optind++;
}
while (optind < argc);
}
return(exit_status);
}
/* Copyright (c) 1983 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. <BSD Advertising Clause omitted per the July 22, 1999 licensing change
* ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change>
*
* 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.
*/
+122 -3
View File
@@ -1,9 +1,129 @@
busybox-cvs (0.60.99.cvs20030819-3) unstable; urgency=low
* shell/ash.c
- fix signal handling (upstream)
-- Bastian Blank <waldi@debian.org> Mon, 15 Sep 2003 18:12:09 +0200
busybox-cvs (0.60.99.cvs20030819-2) unstable; urgency=low
* Fix configure permisions
* Set source Section to embedded
-- Glenn McGrath <bug1@debian.org> Mon, 25 Aug 2003 06:33:19 +0000
busybox-cvs (0.60.99.cvs20030819-1) unstable; urgency=low
* new cvs version
-- Bastian Blank <waldi@debian.org> Tue, 19 Aug 2003 13:18:54 +0200
busybox-cvs (0.60.99.cvs20030426-10) unstable; urgency=low
* archival/libunarchive/*
- add hardlink support (pending)
* debian/config-*udeb*
- add support for oldgnu tar format
-- Bastian Blank <waldi@debian.org> Tue, 10 Jun 2003 12:06:41 +0200
busybox-cvs (0.60.99.cvs20030426-9) unstable; urgency=low
* modutils/depmod.c
- fix base_dir for modules.dep
-- Bastian Blank <waldi@debian.org> Sat, 07 Jun 2003 14:52:54 +0200
busybox-cvs (0.60.99.cvs20030426-8) unstable; urgency=low
* util-linux/fdisk.c
- fix syscalls. (pending)
* libpwd/*
- don't build setgroups.o
-- Bastian Blank <waldi@debian.org> Tue, 03 Jun 2003 11:26:28 +0200
busybox-cvs (0.60.99.cvs20030426-7) unstable; urgency=low
* libbb/*syscallc.c
- fix syscalls. (upstream) (closes: #194631)
* modutils/*
- update complete objects code from upstream. (pending)
* debian/config-*udeb*
- update to busybox-applets.txt:1.14
-- Bastian Blank <waldi@debian.org> Thu, 29 May 2003 16:17:14 +0200
busybox-cvs (0.60.99.cvs20030426-6) unstable; urgency=low
* modutils/Makefile.in
- don't build anything if deactivated
-- Bastian Blank <waldi@debian.org> Sat, 24 May 2003 18:57:14 +0200
busybox-cvs (0.60.99.cvs20030426-5) unstable; urgency=low
* debian/config-*udeb*
- revert changes (closes: #192717, #192753)
- readd initrd support (workaround)
- make init quiet
* archival/tar.c
- fix usage of tar -O (upstream) (closes: #193788)
-- Bastian Blank <waldi@debian.org> Sat, 24 May 2003 13:25:36 +0200
busybox-cvs (0.60.99.cvs20030426-4) unstable; urgency=low
* debian/config-*udeb*
- update to busybox-applets.txt:1.12
* debian/rules
- use system instead of arch to determine which config file to use
-- Bastian Blank <waldi@debian.org> Fri, 09 May 2003 11:21:13 +0200
busybox-cvs (0.60.99.cvs20030426-3) unstable; urgency=low
* debian/config-udeb*
- update to busybox-applets.txt:1.11
-- Bastian Blank <waldi@debian.org> Wed, 07 May 2003 10:37:40 +0200
busybox-cvs (0.60.99.cvs20030426-2) unstable; urgency=low
* modutils/*
- modprobe failes gracefully if the module is already loaded. (pending)
- implement depmod. (pending)
* debian/config*
- update
-- Bastian Blank <waldi@debian.org> Wed, 30 Apr 2003 14:12:36 +0200
busybox-cvs (0.60.99.cvs20030426-1) unstable; urgency=low
* new cvs version
-- Bastian Blank <waldi@debian.org> Sat, 26 Apr 2003 18:33:17 +0200
busybox-cvs (0.60.99.cvs20030420-4) unstable; urgency=low
* network/libiproute/iproute.c
- fix usage of ip route flush (upstream)
-- Bastian Blank <waldi@debian.org> Fri, 25 Apr 2003 16:48:43 +0200
busybox-cvs (0.60.99.cvs20030420-3) unstable; urgency=low
* debian/config-*udeb*
- update to busybox-applets.txt:1.10
-- Bastian Blank <waldi@debian.org> Fri, 25 Apr 2003 14:03:23 +0200
busybox-cvs (0.60.99.cvs20030420-2) unstable; urgency=low
* archival/tar.c
* archival/tar.c, archival/libunarchive/data_extract_all.c
- unlink files first (upstream patch)
-- Bastian Blank <waldi@debian.org> Mon, 21 Apr 2003 12:06:57 +0200
-- Bastian Blank <waldi@debian.org> Mon, 21 Apr 2003 12:42:06 +0200
busybox-cvs (0.60.99.cvs20030420-1) unstable; urgency=low
@@ -286,4 +406,3 @@ busybox (0.45-1) unstable; urgency=low
(i.e. when libc gets screwed up.)
-- Erik Andersen <andersee@debian.org> Tue, 27 Jun 2000 12:26:41 -0600
+12 -7
View File
@@ -16,6 +16,7 @@ CONFIG_FEATURE_INSTALLER=y
# CONFIG_FEATURE_DEVPTS is not set
# CONFIG_FEATURE_CLEAN_UP is not set
# CONFIG_FEATURE_SUID is not set
# CONFIG_SELINUX is not set
#
# Build Options
@@ -80,10 +81,12 @@ CONFIG_FEATURE_FANCY_ECHO=y
# CONFIG_ENV is not set
CONFIG_EXPR=y
CONFIG_FALSE=y
# CONFIG_FOLD is not set
CONFIG_HEAD=y
# CONFIG_FEATURE_FANCY_HEAD is not set
# CONFIG_HOSTID is not set
CONFIG_ID=y
# CONFIG_INSTALL is not set
# CONFIG_LENGTH is not set
CONFIG_LN=y
# CONFIG_LOGNAME is not set
@@ -168,14 +171,17 @@ CONFIG_RESET=y
# CONFIG_MKTEMP is not set
# CONFIG_READLINK is not set
# CONFIG_RUN_PARTS is not set
# CONFIG_START_STOP_DAEMON is not set
CONFIG_WHICH=y
#
# Editors
#
# CONFIG_AWK is not set
# CONFIG_PATCH is not set
CONFIG_SED=y
# CONFIG_FEATURE_SED_EMBEDED_NEWLINE is not set
CONFIG_FEATURE_SED_GNU_COMPATABILITY=y
# CONFIG_VI is not set
#
@@ -190,6 +196,7 @@ CONFIG_FEATURE_FIND_NEWER=y
CONFIG_FEATURE_FIND_INUM=y
CONFIG_GREP=y
# CONFIG_FEATURE_GREP_EGREP_ALIAS is not set
CONFIG_FEATURE_GREP_FGREP_ALIAS=y
# CONFIG_FEATURE_GREP_CONTEXT is not set
# CONFIG_XARGS is not set
@@ -204,7 +211,6 @@ CONFIG_FEATURE_INITRD=y
CONFIG_HALT=y
CONFIG_POWEROFF=y
CONFIG_REBOOT=y
# CONFIG_START_STOP_DAEMON is not set
# CONFIG_MESG is not set
#
@@ -229,17 +235,18 @@ CONFIG_REBOOT=y
# CONFIG_CROND is not set
# CONFIG_CRONTAB is not set
# CONFIG_DC is not set
# CONFIG_DUTMP is not set
# CONFIG_LAST is not set
# CONFIG_HDPARM is not set
# CONFIG_MAKEDEVS is not set
# CONFIG_MT is not set
# CONFIG_STRINGS is not set
# CONFIG_TIME is not set
# CONFIG_UPDATE is not set
# CONFIG_WATCHDOG is not set
#
# Linux Module Utilities
#
# CONFIG_DEPMOD is not set
# CONFIG_INSMOD is not set
# CONFIG_LSMOD is not set
# CONFIG_MODPROBE is not set
@@ -283,6 +290,7 @@ CONFIG_ROUTE=y
CONFIG_WGET=y
CONFIG_FEATURE_WGET_STATUSBAR=y
CONFIG_FEATURE_WGET_AUTHENTICATION=y
# CONFIG_FEATURE_WGET_IP6_LITERAL is not set
#
# udhcp Server/Client
@@ -330,6 +338,7 @@ CONFIG_LOGGER=y
CONFIG_DMESG=y
# CONFIG_FBSET is not set
# CONFIG_FDFLUSH is not set
# CONFIG_FDFORMAT is not set
# CONFIG_FDISK is not set
# CONFIG_FREERAMDISK is not set
# CONFIG_FSCK_MINIX is not set
@@ -341,10 +350,6 @@ CONFIG_LOSETUP=y
CONFIG_MKSWAP=y
CONFIG_MORE=y
CONFIG_FEATURE_USE_TERMIOS=y
#
# Common options for ls and more
#
# CONFIG_PIVOT_ROOT is not set
# CONFIG_RDATE is not set
CONFIG_SWAPONOFF=y
-369
View File
@@ -1,369 +0,0 @@
#
# Automatically generated make config: don't edit
#
HAVE_DOT_CONFIG=y
#
# General Configuration
#
# CONFIG_FEATURE_BUFFERS_USE_MALLOC is not set
CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y
# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
# CONFIG_FEATURE_VERBOSE_USAGE is not set
# CONFIG_FEATURE_INSTALLER is not set
# CONFIG_LOCALE_SUPPORT is not set
CONFIG_FEATURE_DEVFS=y
CONFIG_FEATURE_DEVPTS=y
# CONFIG_FEATURE_CLEAN_UP is not set
# CONFIG_FEATURE_SUID is not set
#
# Build Options
#
# CONFIG_STATIC is not set
# CONFIG_LFS is not set
# USING_CROSS_COMPILER is not set
EXTRA_CFLAGS_OPTIONS=""
#
# Installation Options
#
# CONFIG_INSTALL_NO_USR is not set
PREFIX="./_install"
#
# Archival Utilities
#
CONFIG_AR=y
# CONFIG_FEATURE_AR_LONG_FILENAMES is not set
# CONFIG_BUNZIP2 is not set
# CONFIG_CPIO is not set
# CONFIG_DPKG is not set
# CONFIG_DPKG_DEB is not set
CONFIG_GUNZIP=y
# CONFIG_FEATURE_GUNZIP_UNCOMPRESS is not set
# CONFIG_GZIP is not set
# CONFIG_RPM2CPIO is not set
# CONFIG_RPM is not set
CONFIG_TAR=y
# CONFIG_FEATURE_TAR_CREATE is not set
# CONFIG_FEATURE_TAR_BZIP2 is not set
# CONFIG_FEATURE_TAR_EXCLUDE is not set
CONFIG_FEATURE_TAR_GZIP=y
# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
# CONFIG_UNCOMPRESS is not set
# CONFIG_UNZIP is not set
#
# Coreutils
#
# CONFIG_BASENAME is not set
# CONFIG_CAL is not set
CONFIG_CAT=y
# CONFIG_CHGRP is not set
# CONFIG_CHMOD is not set
CONFIG_CHOWN=y
CONFIG_CHROOT=y
# CONFIG_CMP is not set
# CONFIG_CP is not set
CONFIG_CUT=y
# CONFIG_DATE is not set
# CONFIG_DD is not set
# CONFIG_DF is not set
# CONFIG_DIRNAME is not set
# CONFIG_DOS2UNIX is not set
# CONFIG_DU is not set
CONFIG_ECHO=y
# CONFIG_FEATURE_FANCY_ECHO is not set
# CONFIG_ENV is not set
# CONFIG_EXPR is not set
CONFIG_FALSE=y
# CONFIG_HEAD is not set
# CONFIG_HOSTID is not set
# CONFIG_ID is not set
# CONFIG_LENGTH is not set
CONFIG_LN=y
# CONFIG_LOGNAME is not set
# CONFIG_LS is not set
CONFIG_MD5SUM=y
CONFIG_MKDIR=y
# CONFIG_MKFIFO is not set
# CONFIG_MKNOD is not set
# CONFIG_MV is not set
# CONFIG_OD is not set
# CONFIG_PRINTF is not set
# CONFIG_PWD is not set
# CONFIG_REALPATH is not set
CONFIG_RM=y
# CONFIG_RMDIR is not set
# CONFIG_SHA1SUM is not set
# CONFIG_SLEEP is not set
# CONFIG_SORT is not set
# CONFIG_STTY is not set
CONFIG_SYNC=y
# CONFIG_TAIL is not set
# CONFIG_TEE is not set
CONFIG_TEST=y
#
# test (forced enabled for use with shell)
#
CONFIG_TOUCH=y
# CONFIG_TR is not set
CONFIG_TRUE=y
# CONFIG_TTY is not set
# CONFIG_UNAME is not set
# CONFIG_UNIQ is not set
# CONFIG_USLEEP is not set
# CONFIG_UUDECODE is not set
# CONFIG_UUENCODE is not set
# CONFIG_WATCH is not set
# CONFIG_WC is not set
# CONFIG_WHO is not set
# CONFIG_WHOAMI is not set
# CONFIG_YES is not set
#
# Console Utilities
#
# CONFIG_CHVT is not set
# CONFIG_CLEAR is not set
# CONFIG_DEALLOCVT is not set
# CONFIG_DUMPKMAP is not set
# CONFIG_LOADACM is not set
# CONFIG_LOADFONT is not set
# CONFIG_LOADKMAP is not set
# CONFIG_OPENVT is not set
# CONFIG_RESET is not set
# CONFIG_SETKEYCODES is not set
#
# Debian Utilities
#
# CONFIG_MKTEMP is not set
# CONFIG_READLINK is not set
# CONFIG_RUN_PARTS is not set
# CONFIG_WHICH is not set
#
# Editors
#
# CONFIG_AWK is not set
CONFIG_SED=y
# CONFIG_FEATURE_SED_EMBEDED_NEWLINE is not set
# CONFIG_VI is not set
#
# Finding Utilities
#
# CONFIG_FIND is not set
CONFIG_GREP=y
# CONFIG_FEATURE_GREP_EGREP_ALIAS is not set
# CONFIG_FEATURE_GREP_CONTEXT is not set
# CONFIG_XARGS is not set
#
# Init Utilities
#
CONFIG_INIT=y
CONFIG_FEATURE_USE_INITTAB=y
# CONFIG_FEATURE_INITRD is not set
# CONFIG_FEATURE_INIT_COREDUMPS is not set
# CONFIG_FEATURE_EXTRA_QUIET is not set
# CONFIG_HALT is not set
# CONFIG_POWEROFF is not set
CONFIG_REBOOT=y
# CONFIG_START_STOP_DAEMON is not set
# CONFIG_MESG is not set
#
# Login/Password Management Utilities
#
CONFIG_USE_BB_PWD_GRP=y
# CONFIG_ADDGROUP is not set
# CONFIG_DELGROUP is not set
# CONFIG_ADDUSER is not set
# CONFIG_DELUSER is not set
# CONFIG_GETTY is not set
# CONFIG_LOGIN is not set
# CONFIG_PASSWD is not set
# CONFIG_SU is not set
# CONFIG_SULOGIN is not set
# CONFIG_VLOCK is not set
#
# Miscellaneous Utilities
#
# CONFIG_ADJTIMEX is not set
# CONFIG_CROND is not set
# CONFIG_CRONTAB is not set
# CONFIG_DC is not set
# CONFIG_DUTMP is not set
# CONFIG_MAKEDEVS is not set
# CONFIG_MT is not set
# CONFIG_STRINGS is not set
# CONFIG_TIME is not set
# CONFIG_UPDATE is not set
# CONFIG_WATCHDOG is not set
#
# Linux Module Utilities
#
CONFIG_INSMOD=y
# CONFIG_FEATURE_OLD_MODULE_INTERFACE is not set
CONFIG_FEATURE_NEW_MODULE_INTERFACE=y
#
# Support new (post 2.1) Linux kernels (Forced enabled)
#
# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
# CONFIG_LSMOD is not set
# CONFIG_MODPROBE is not set
# CONFIG_RMMOD is not set
# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set
#
# Networking Utilities
#
# CONFIG_FEATURE_IPV6 is not set
# CONFIG_ARPING is not set
# CONFIG_FTPGET is not set
# CONFIG_FTPPUT is not set
# CONFIG_HOSTNAME is not set
# CONFIG_HTTPD is not set
# CONFIG_IFCONFIG is not set
# CONFIG_IFUPDOWN is not set
# CONFIG_INETD is not set
CONFIG_IP=y
CONFIG_FEATURE_IP_ADDRESS=y
CONFIG_FEATURE_IP_LINK=y
CONFIG_FEATURE_IP_ROUTE=y
# CONFIG_FEATURE_IP_TUNNEL is not set
# CONFIG_IPCALC is not set
# CONFIG_IPADDR is not set
# CONFIG_IPLINK is not set
# CONFIG_IPROUTE is not set
# CONFIG_IPTUNNEL is not set
# CONFIG_NAMEIF is not set
# CONFIG_NC is not set
# CONFIG_NETSTAT is not set
# CONFIG_NSLOOKUP is not set
# CONFIG_PING is not set
# CONFIG_ROUTE is not set
# CONFIG_TELNET is not set
# CONFIG_TELNETD is not set
# CONFIG_TFTP is not set
# CONFIG_TRACEROUTE is not set
# CONFIG_VCONFIG is not set
CONFIG_WGET=y
# CONFIG_FEATURE_WGET_STATUSBAR is not set
# CONFIG_FEATURE_WGET_AUTHENTICATION is not set
#
# udhcp Server/Client
#
# CONFIG_UDHCPD is not set
CONFIG_UDHCPC=y
CONFIG_FEATURE_UDHCP_SYSLOG=y
# CONFIG_FEATURE_UDHCP_DEBUG is not set
#
# Process Utilities
#
# CONFIG_FREE is not set
# CONFIG_KILL is not set
# CONFIG_PIDOF is not set
# CONFIG_PS is not set
# CONFIG_RENICE is not set
# CONFIG_TOP is not set
# CONFIG_UPTIME is not set
#
# Another Bourne-like Shell
#
CONFIG_FEATURE_SH_IS_ASH=y
# CONFIG_FEATURE_SH_IS_HUSH is not set
# CONFIG_FEATURE_SH_IS_LASH is not set
# CONFIG_FEATURE_SH_IS_MSH is not set
# CONFIG_FEATURE_SH_IS_NONE is not set
CONFIG_ASH=y
#
# ash (forced enabled as default shell)
#
#
# Ash Shell Options
#
CONFIG_ASH_JOB_CONTROL=y
CONFIG_ASH_ALIAS=y
CONFIG_ASH_MATH_SUPPORT=y
# CONFIG_ASH_GETOPTS is not set
# CONFIG_ASH_CMDCMD is not set
# CONFIG_ASH_MAIL is not set
CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
# CONFIG_HUSH is not set
# CONFIG_LASH is not set
# CONFIG_MSH is not set
#
# Bourne Shell Options
#
CONFIG_FEATURE_COMMAND_EDITING=y
# CONFIG_FEATURE_COMMAND_SAVEHISTORY is not set
CONFIG_FEATURE_COMMAND_TAB_COMPLETION=y
# CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION is not set
CONFIG_FEATURE_COMMAND_HISTORY=15
# CONFIG_FEATURE_SH_STANDALONE_SHELL is not set
# CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN is not set
# CONFIG_FEATURE_SH_FANCY_PROMPT is not set
# CONFIG_FEATURE_SH_EXTRA_QUIET is not set
#
# System Logging Utilities
#
CONFIG_SYSLOGD=y
# CONFIG_FEATURE_REMOTE_LOG is not set
# CONFIG_FEATURE_IPC_SYSLOG is not set
CONFIG_KLOGD=y
# CONFIG_LOGGER is not set
#
# Linux System Utilities
#
# CONFIG_DMESG is not set
# CONFIG_FBSET is not set
# CONFIG_FDFLUSH is not set
# CONFIG_FDISK is not set
# CONFIG_FREERAMDISK is not set
# CONFIG_FSCK_MINIX is not set
# CONFIG_MKFS_MINIX is not set
# CONFIG_GETOPT is not set
# CONFIG_HEXDUMP is not set
# CONFIG_HWCLOCK is not set
# CONFIG_LOSETUP is not set
# CONFIG_MKSWAP is not set
# CONFIG_MORE is not set
CONFIG_PIVOT_ROOT=y
# CONFIG_RDATE is not set
# CONFIG_SWAPONOFF is not set
CONFIG_MOUNT=y
# CONFIG_NFSMOUNT is not set
CONFIG_UMOUNT=y
# CONFIG_FEATURE_MOUNT_FORCE is not set
#
# Common options for mount/umount
#
# CONFIG_FEATURE_MOUNT_LOOP is not set
# CONFIG_FEATURE_MTAB_SUPPORT is not set
#
# Debugging Options
#
# CONFIG_DEBUG is not set
-374
View File
@@ -1,374 +0,0 @@
#
# Automatically generated make config: don't edit
#
HAVE_DOT_CONFIG=y
#
# General Configuration
#
# CONFIG_FEATURE_BUFFERS_USE_MALLOC is not set
CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y
# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
# CONFIG_FEATURE_VERBOSE_USAGE is not set
# CONFIG_FEATURE_INSTALLER is not set
# CONFIG_LOCALE_SUPPORT is not set
CONFIG_FEATURE_DEVFS=y
CONFIG_FEATURE_DEVPTS=y
# CONFIG_FEATURE_CLEAN_UP is not set
# CONFIG_FEATURE_SUID is not set
#
# Build Options
#
# CONFIG_STATIC is not set
CONFIG_LFS=y
# USING_CROSS_COMPILER is not set
EXTRA_CFLAGS_OPTIONS=""
#
# Installation Options
#
# CONFIG_INSTALL_NO_USR is not set
PREFIX="./_install"
#
# Archival Utilities
#
CONFIG_AR=y
# CONFIG_FEATURE_AR_LONG_FILENAMES is not set
# CONFIG_BUNZIP2 is not set
# CONFIG_CPIO is not set
# CONFIG_DPKG is not set
# CONFIG_DPKG_DEB is not set
CONFIG_GUNZIP=y
# CONFIG_FEATURE_GUNZIP_UNCOMPRESS is not set
# CONFIG_GZIP is not set
# CONFIG_RPM2CPIO is not set
# CONFIG_RPM is not set
CONFIG_TAR=y
# CONFIG_FEATURE_TAR_CREATE is not set
# CONFIG_FEATURE_TAR_BZIP2 is not set
# CONFIG_FEATURE_TAR_EXCLUDE is not set
CONFIG_FEATURE_TAR_GZIP=y
# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
# CONFIG_UNCOMPRESS is not set
# CONFIG_UNZIP is not set
#
# Coreutils
#
# CONFIG_BASENAME is not set
# CONFIG_CAL is not set
CONFIG_CAT=y
# CONFIG_CHGRP is not set
# CONFIG_CHMOD is not set
CONFIG_CHOWN=y
CONFIG_CHROOT=y
# CONFIG_CMP is not set
# CONFIG_CP is not set
CONFIG_CUT=y
# CONFIG_DATE is not set
# CONFIG_DD is not set
# CONFIG_DF is not set
# CONFIG_DIRNAME is not set
# CONFIG_DOS2UNIX is not set
# CONFIG_DU is not set
CONFIG_ECHO=y
CONFIG_FEATURE_FANCY_ECHO=y
# CONFIG_ENV is not set
# CONFIG_EXPR is not set
CONFIG_FALSE=y
# CONFIG_HEAD is not set
# CONFIG_HOSTID is not set
# CONFIG_ID is not set
# CONFIG_LENGTH is not set
CONFIG_LN=y
# CONFIG_LOGNAME is not set
# CONFIG_LS is not set
CONFIG_MD5SUM=y
CONFIG_MKDIR=y
# CONFIG_MKFIFO is not set
# CONFIG_MKNOD is not set
# CONFIG_MV is not set
# CONFIG_OD is not set
# CONFIG_PRINTF is not set
# CONFIG_PWD is not set
# CONFIG_REALPATH is not set
CONFIG_RM=y
# CONFIG_RMDIR is not set
# CONFIG_SHA1SUM is not set
# CONFIG_SLEEP is not set
# CONFIG_SORT is not set
# CONFIG_STTY is not set
CONFIG_SYNC=y
# CONFIG_TAIL is not set
# CONFIG_TEE is not set
CONFIG_TEST=y
#
# test (forced enabled for use with shell)
#
CONFIG_TOUCH=y
# CONFIG_TR is not set
CONFIG_TRUE=y
# CONFIG_TTY is not set
# CONFIG_UNAME is not set
# CONFIG_UNIQ is not set
# CONFIG_USLEEP is not set
# CONFIG_UUDECODE is not set
# CONFIG_UUENCODE is not set
# CONFIG_WATCH is not set
CONFIG_WC=y
# CONFIG_WHO is not set
# CONFIG_WHOAMI is not set
# CONFIG_YES is not set
#
# Console Utilities
#
# CONFIG_CHVT is not set
# CONFIG_CLEAR is not set
# CONFIG_DEALLOCVT is not set
# CONFIG_DUMPKMAP is not set
# CONFIG_LOADACM is not set
# CONFIG_LOADFONT is not set
# CONFIG_LOADKMAP is not set
# CONFIG_OPENVT is not set
# CONFIG_RESET is not set
# CONFIG_SETKEYCODES is not set
#
# Debian Utilities
#
# CONFIG_MKTEMP is not set
# CONFIG_READLINK is not set
# CONFIG_RUN_PARTS is not set
# CONFIG_WHICH is not set
#
# Editors
#
# CONFIG_AWK is not set
CONFIG_SED=y
# CONFIG_FEATURE_SED_EMBEDED_NEWLINE is not set
# CONFIG_VI is not set
#
# Finding Utilities
#
# CONFIG_FIND is not set
CONFIG_GREP=y
# CONFIG_FEATURE_GREP_EGREP_ALIAS is not set
# CONFIG_FEATURE_GREP_CONTEXT is not set
# CONFIG_XARGS is not set
#
# Init Utilities
#
CONFIG_INIT=y
CONFIG_FEATURE_USE_INITTAB=y
# CONFIG_FEATURE_INITRD is not set
# CONFIG_FEATURE_INIT_COREDUMPS is not set
# CONFIG_FEATURE_EXTRA_QUIET is not set
# CONFIG_HALT is not set
# CONFIG_POWEROFF is not set
CONFIG_REBOOT=y
# CONFIG_START_STOP_DAEMON is not set
# CONFIG_MESG is not set
#
# Login/Password Management Utilities
#
CONFIG_USE_BB_PWD_GRP=y
# CONFIG_ADDGROUP is not set
# CONFIG_DELGROUP is not set
# CONFIG_ADDUSER is not set
# CONFIG_DELUSER is not set
# CONFIG_GETTY is not set
# CONFIG_LOGIN is not set
# CONFIG_PASSWD is not set
# CONFIG_SU is not set
# CONFIG_SULOGIN is not set
# CONFIG_VLOCK is not set
#
# Miscellaneous Utilities
#
# CONFIG_ADJTIMEX is not set
# CONFIG_CROND is not set
# CONFIG_CRONTAB is not set
# CONFIG_DC is not set
# CONFIG_DUTMP is not set
# CONFIG_MAKEDEVS is not set
# CONFIG_MT is not set
# CONFIG_STRINGS is not set
# CONFIG_TIME is not set
# CONFIG_UPDATE is not set
# CONFIG_WATCHDOG is not set
#
# Linux Module Utilities
#
CONFIG_INSMOD=y
# CONFIG_FEATURE_OLD_MODULE_INTERFACE is not set
CONFIG_FEATURE_NEW_MODULE_INTERFACE=y
#
# Support new (post 2.1) Linux kernels (Forced enabled)
#
# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
# CONFIG_LSMOD is not set
# CONFIG_MODPROBE is not set
# CONFIG_RMMOD is not set
CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
#
# Networking Utilities
#
# CONFIG_FEATURE_IPV6 is not set
# CONFIG_ARPING is not set
# CONFIG_FTPGET is not set
# CONFIG_FTPPUT is not set
# CONFIG_HOSTNAME is not set
# CONFIG_HTTPD is not set
CONFIG_IFCONFIG=y
CONFIG_FEATURE_IFCONFIG_STATUS=y
# CONFIG_FEATURE_IFCONFIG_SLIP is not set
# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set
# CONFIG_FEATURE_IFCONFIG_HW is not set
# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set
# CONFIG_IFUPDOWN is not set
# CONFIG_INETD is not set
CONFIG_IP=y
CONFIG_FEATURE_IP_ADDRESS=y
CONFIG_FEATURE_IP_LINK=y
CONFIG_FEATURE_IP_ROUTE=y
# CONFIG_FEATURE_IP_TUNNEL is not set
# CONFIG_IPCALC is not set
# CONFIG_IPADDR is not set
# CONFIG_IPLINK is not set
# CONFIG_IPROUTE is not set
# CONFIG_IPTUNNEL is not set
# CONFIG_NAMEIF is not set
# CONFIG_NC is not set
# CONFIG_NETSTAT is not set
# CONFIG_NSLOOKUP is not set
# CONFIG_PING is not set
CONFIG_ROUTE=y
# CONFIG_TELNET is not set
# CONFIG_TELNETD is not set
# CONFIG_TFTP is not set
# CONFIG_TRACEROUTE is not set
# CONFIG_VCONFIG is not set
CONFIG_WGET=y
# CONFIG_FEATURE_WGET_STATUSBAR is not set
CONFIG_FEATURE_WGET_AUTHENTICATION=y
#
# udhcp Server/Client
#
# CONFIG_UDHCPD is not set
CONFIG_UDHCPC=y
CONFIG_FEATURE_UDHCP_SYSLOG=y
# CONFIG_FEATURE_UDHCP_DEBUG is not set
#
# Process Utilities
#
# CONFIG_FREE is not set
# CONFIG_KILL is not set
# CONFIG_PIDOF is not set
# CONFIG_PS is not set
# CONFIG_RENICE is not set
# CONFIG_TOP is not set
# CONFIG_UPTIME is not set
#
# Another Bourne-like Shell
#
CONFIG_FEATURE_SH_IS_ASH=y
# CONFIG_FEATURE_SH_IS_HUSH is not set
# CONFIG_FEATURE_SH_IS_LASH is not set
# CONFIG_FEATURE_SH_IS_MSH is not set
# CONFIG_FEATURE_SH_IS_NONE is not set
CONFIG_ASH=y
#
# ash (forced enabled as default shell)
#
#
# Ash Shell Options
#
# CONFIG_ASH_JOB_CONTROL is not set
# CONFIG_ASH_ALIAS is not set
CONFIG_ASH_MATH_SUPPORT=y
# CONFIG_ASH_GETOPTS is not set
# CONFIG_ASH_CMDCMD is not set
# CONFIG_ASH_MAIL is not set
CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
# CONFIG_HUSH is not set
# CONFIG_LASH is not set
# CONFIG_MSH is not set
#
# Bourne Shell Options
#
CONFIG_FEATURE_COMMAND_EDITING=y
# CONFIG_FEATURE_COMMAND_SAVEHISTORY is not set
# CONFIG_FEATURE_COMMAND_TAB_COMPLETION is not set
# CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION is not set
CONFIG_FEATURE_COMMAND_HISTORY=15
# CONFIG_FEATURE_SH_STANDALONE_SHELL is not set
# CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN is not set
# CONFIG_FEATURE_SH_FANCY_PROMPT is not set
# CONFIG_FEATURE_SH_EXTRA_QUIET is not set
#
# System Logging Utilities
#
CONFIG_SYSLOGD=y
# CONFIG_FEATURE_REMOTE_LOG is not set
# CONFIG_FEATURE_IPC_SYSLOG is not set
CONFIG_KLOGD=y
CONFIG_LOGGER=y
#
# Linux System Utilities
#
# CONFIG_DMESG is not set
# CONFIG_FBSET is not set
# CONFIG_FDFLUSH is not set
# CONFIG_FDISK is not set
# CONFIG_FREERAMDISK is not set
# CONFIG_FSCK_MINIX is not set
# CONFIG_MKFS_MINIX is not set
# CONFIG_GETOPT is not set
# CONFIG_HEXDUMP is not set
# CONFIG_HWCLOCK is not set
# CONFIG_LOSETUP is not set
# CONFIG_MKSWAP is not set
# CONFIG_MORE is not set
CONFIG_PIVOT_ROOT=y
# CONFIG_RDATE is not set
# CONFIG_SWAPONOFF is not set
CONFIG_MOUNT=y
# CONFIG_NFSMOUNT is not set
CONFIG_UMOUNT=y
CONFIG_FEATURE_MOUNT_FORCE=y
#
# Common options for mount/umount
#
# CONFIG_FEATURE_MOUNT_LOOP is not set
# CONFIG_FEATURE_MTAB_SUPPORT is not set
#
# Debugging Options
#
# CONFIG_DEBUG is not set
+17 -14
View File
@@ -16,6 +16,7 @@ CONFIG_FEATURE_DEVFS=y
CONFIG_FEATURE_DEVPTS=y
# CONFIG_FEATURE_CLEAN_UP is not set
# CONFIG_FEATURE_SUID is not set
# CONFIG_SELINUX is not set
#
# Build Options
@@ -82,6 +83,7 @@ CONFIG_DD=y
CONFIG_DF=y
CONFIG_DIRNAME=y
CONFIG_DOS2UNIX=y
CONFIG_UNIX2DOS=y
CONFIG_DU=y
CONFIG_FEATURE_DU_DEFALT_BLOCKSIZE_1K=y
CONFIG_ECHO=y
@@ -89,10 +91,12 @@ CONFIG_FEATURE_FANCY_ECHO=y
CONFIG_ENV=y
CONFIG_EXPR=y
CONFIG_FALSE=y
# CONFIG_FOLD is not set
CONFIG_HEAD=y
# CONFIG_FEATURE_FANCY_HEAD is not set
CONFIG_HOSTID=y
CONFIG_ID=y
# CONFIG_INSTALL is not set
CONFIG_LENGTH=y
CONFIG_LN=y
CONFIG_LOGNAME=y
@@ -182,6 +186,7 @@ CONFIG_SETKEYCODES=y
CONFIG_MKTEMP=y
CONFIG_READLINK=y
CONFIG_RUN_PARTS=y
CONFIG_START_STOP_DAEMON=y
CONFIG_WHICH=y
#
@@ -189,8 +194,10 @@ CONFIG_WHICH=y
#
CONFIG_AWK=y
CONFIG_FEATURE_AWK_MATH=y
CONFIG_PATCH=y
CONFIG_SED=y
# CONFIG_FEATURE_SED_EMBEDED_NEWLINE is not set
CONFIG_FEATURE_SED_GNU_COMPATABILITY=y
CONFIG_VI=y
CONFIG_FEATURE_VI_COLON=y
CONFIG_FEATURE_VI_YANKMARK=y
@@ -215,6 +222,7 @@ CONFIG_FEATURE_FIND_NEWER=y
CONFIG_FEATURE_FIND_INUM=y
CONFIG_GREP=y
CONFIG_FEATURE_GREP_EGREP_ALIAS=y
CONFIG_FEATURE_GREP_FGREP_ALIAS=y
CONFIG_FEATURE_GREP_CONTEXT=y
CONFIG_XARGS=y
@@ -229,7 +237,6 @@ CONFIG_FEATURE_INITRD=y
CONFIG_HALT=y
CONFIG_POWEROFF=y
CONFIG_REBOOT=y
CONFIG_START_STOP_DAEMON=y
CONFIG_MESG=y
#
@@ -259,19 +266,21 @@ CONFIG_USE_BB_SHADOW=y
#
CONFIG_ADJTIMEX=y
CONFIG_CROND=y
CONFIG_FEATURE_CROND_CALL_SENDMAIL=y
CONFIG_CRONTAB=y
CONFIG_DC=y
CONFIG_DUTMP=y
CONFIG_LAST=y
# CONFIG_HDPARM is not set
CONFIG_MAKEDEVS=y
CONFIG_MT=y
CONFIG_STRINGS=y
CONFIG_TIME=y
CONFIG_UPDATE=y
CONFIG_WATCHDOG=y
#
# Linux Module Utilities
#
# CONFIG_DEPMOD is not set
# CONFIG_INSMOD is not set
# CONFIG_LSMOD is not set
# CONFIG_MODPROBE is not set
@@ -288,11 +297,11 @@ CONFIG_HOSTNAME=y
CONFIG_HTTPD=y
# CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY is not set
CONFIG_FEATURE_HTTPD_BASIC_AUTH=y
# CONFIG_FEATURE_HTTPD_CGI is not set
# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
# CONFIG_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP is not set
# CONFIG_FEATURE_HTTPD_SETUID is not set
# CONFIG_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES is not set
# CONFIG_FEATURE_HTTPD_DECODE_URL_STR is not set
# CONFIG_FEATURE_HTTPD_CGI is not set
# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set
CONFIG_IFCONFIG=y
CONFIG_FEATURE_IFCONFIG_STATUS=y
@@ -302,6 +311,7 @@ CONFIG_FEATURE_IFCONFIG_HW=y
CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y
CONFIG_IFUPDOWN=y
# CONFIG_FEATURE_IFUPDOWN_IP is not set
CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN=y
CONFIG_FEATURE_IFUPDOWN_IPV4=y
CONFIG_FEATURE_IFUPDOWN_IPV6=y
CONFIG_FEATURE_IFUPDOWN_IPX=y
@@ -354,11 +364,11 @@ CONFIG_FEATURE_TFTP_BLOCKSIZE=y
CONFIG_FEATURE_TFTP_DEBUG=y
CONFIG_TRACEROUTE=y
CONFIG_FEATURE_TRACEROUTE_VERBOSE=y
CONFIG_FEATURE_TRACEROUTE_SO_DEBUG=y
# CONFIG_VCONFIG is not set
CONFIG_WGET=y
CONFIG_FEATURE_WGET_STATUSBAR=y
CONFIG_FEATURE_WGET_AUTHENTICATION=y
CONFIG_FEATURE_WGET_IP6_LITERAL=y
#
# udhcp Server/Client
@@ -392,10 +402,6 @@ CONFIG_FEATURE_SH_IS_ASH=y
# CONFIG_FEATURE_SH_IS_NONE is not set
CONFIG_ASH=y
#
# ash (forced enabled as default shell)
#
#
# Ash Shell Options
#
@@ -441,6 +447,7 @@ CONFIG_FBSET=y
CONFIG_FEATURE_FBSET_FANCY=y
CONFIG_FEATURE_FBSET_READMODE=y
CONFIG_FDFLUSH=y
# CONFIG_FDFORMAT is not set
CONFIG_FDISK=y
CONFIG_FEATURE_FDISK_WRITABLE=y
CONFIG_FEATURE_AIX_LABEL=y
@@ -464,10 +471,6 @@ CONFIG_LOSETUP=y
CONFIG_MKSWAP=y
CONFIG_MORE=y
CONFIG_FEATURE_USE_TERMIOS=y
#
# Common options for ls and more
#
CONFIG_PIVOT_ROOT=y
CONFIG_RDATE=y
CONFIG_SWAPONOFF=y
+15 -14
View File
@@ -16,6 +16,7 @@ CONFIG_FEATURE_DEVFS=y
CONFIG_FEATURE_DEVPTS=y
# CONFIG_FEATURE_CLEAN_UP is not set
# CONFIG_FEATURE_SUID is not set
# CONFIG_SELINUX is not set
#
# Build Options
@@ -50,7 +51,7 @@ CONFIG_TAR=y
# CONFIG_FEATURE_TAR_BZIP2 is not set
# CONFIG_FEATURE_TAR_EXCLUDE is not set
CONFIG_FEATURE_TAR_GZIP=y
# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
# CONFIG_UNCOMPRESS is not set
@@ -80,10 +81,12 @@ CONFIG_FEATURE_FANCY_ECHO=y
CONFIG_ENV=y
CONFIG_EXPR=y
CONFIG_FALSE=y
# CONFIG_FOLD is not set
CONFIG_HEAD=y
# CONFIG_FEATURE_FANCY_HEAD is not set
# CONFIG_HOSTID is not set
CONFIG_ID=y
# CONFIG_INSTALL is not set
# CONFIG_LENGTH is not set
CONFIG_LN=y
# CONFIG_LOGNAME is not set
@@ -101,7 +104,7 @@ CONFIG_MKDIR=y
CONFIG_MKNOD=y
CONFIG_MV=y
# CONFIG_OD is not set
# CONFIG_PRINTF is not set
CONFIG_PRINTF=y
CONFIG_PWD=y
CONFIG_REALPATH=y
CONFIG_RM=y
@@ -171,14 +174,17 @@ CONFIG_FEATURE_HUMAN_READABLE=y
# CONFIG_MKTEMP is not set
CONFIG_READLINK=y
# CONFIG_RUN_PARTS is not set
# CONFIG_START_STOP_DAEMON is not set
# CONFIG_WHICH is not set
#
# Editors
#
# CONFIG_AWK is not set
# CONFIG_PATCH is not set
CONFIG_SED=y
# CONFIG_FEATURE_SED_EMBEDED_NEWLINE is not set
CONFIG_FEATURE_SED_GNU_COMPATABILITY=y
# CONFIG_VI is not set
#
@@ -193,6 +199,7 @@ CONFIG_FEATURE_FIND_NEWER=y
CONFIG_FEATURE_FIND_INUM=y
CONFIG_GREP=y
# CONFIG_FEATURE_GREP_EGREP_ALIAS is not set
# CONFIG_FEATURE_GREP_FGREP_ALIAS is not set
# CONFIG_FEATURE_GREP_CONTEXT is not set
# CONFIG_XARGS is not set
@@ -201,13 +208,12 @@ CONFIG_GREP=y
#
CONFIG_INIT=y
CONFIG_FEATURE_USE_INITTAB=y
# CONFIG_FEATURE_INITRD is not set
CONFIG_FEATURE_INITRD=y
# CONFIG_FEATURE_INIT_COREDUMPS is not set
# CONFIG_FEATURE_EXTRA_QUIET is not set
CONFIG_HALT=y
# CONFIG_POWEROFF is not set
CONFIG_REBOOT=y
# CONFIG_START_STOP_DAEMON is not set
# CONFIG_MESG is not set
#
@@ -232,17 +238,18 @@ CONFIG_USE_BB_PWD_GRP=y
# CONFIG_CROND is not set
# CONFIG_CRONTAB is not set
# CONFIG_DC is not set
# CONFIG_DUTMP is not set
# CONFIG_LAST is not set
# CONFIG_HDPARM is not set
# CONFIG_MAKEDEVS is not set
# CONFIG_MT is not set
# CONFIG_STRINGS is not set
# CONFIG_TIME is not set
# CONFIG_UPDATE is not set
# CONFIG_WATCHDOG is not set
#
# Linux Module Utilities
#
# CONFIG_DEPMOD is not set
# CONFIG_INSMOD is not set
# CONFIG_LSMOD is not set
# CONFIG_MODPROBE is not set
@@ -289,6 +296,7 @@ CONFIG_ROUTE=y
CONFIG_WGET=y
# CONFIG_FEATURE_WGET_STATUSBAR is not set
CONFIG_FEATURE_WGET_AUTHENTICATION=y
# CONFIG_FEATURE_WGET_IP6_LITERAL is not set
#
# udhcp Server/Client
@@ -320,10 +328,6 @@ CONFIG_FEATURE_SH_IS_ASH=y
# CONFIG_FEATURE_SH_IS_NONE is not set
CONFIG_ASH=y
#
# ash (forced enabled as default shell)
#
#
# Ash Shell Options
#
@@ -366,6 +370,7 @@ CONFIG_LOGGER=y
CONFIG_DMESG=y
# CONFIG_FBSET is not set
# CONFIG_FDFLUSH is not set
# CONFIG_FDFORMAT is not set
# CONFIG_FDISK is not set
# CONFIG_FREERAMDISK is not set
# CONFIG_FSCK_MINIX is not set
@@ -377,10 +382,6 @@ CONFIG_DMESG=y
CONFIG_MKSWAP=y
CONFIG_MORE=y
CONFIG_FEATURE_USE_TERMIOS=y
#
# Common options for ls and more
#
CONFIG_PIVOT_ROOT=y
# CONFIG_RDATE is not set
CONFIG_SWAPONOFF=y
+19 -17
View File
@@ -16,6 +16,7 @@ CONFIG_FEATURE_DEVFS=y
CONFIG_FEATURE_DEVPTS=y
# CONFIG_FEATURE_CLEAN_UP is not set
# CONFIG_FEATURE_SUID is not set
# CONFIG_SELINUX is not set
#
# Build Options
@@ -50,7 +51,7 @@ CONFIG_TAR=y
# CONFIG_FEATURE_TAR_BZIP2 is not set
# CONFIG_FEATURE_TAR_EXCLUDE is not set
CONFIG_FEATURE_TAR_GZIP=y
# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
# CONFIG_UNCOMPRESS is not set
@@ -80,10 +81,12 @@ CONFIG_FEATURE_FANCY_ECHO=y
CONFIG_ENV=y
CONFIG_EXPR=y
CONFIG_FALSE=y
# CONFIG_FOLD is not set
CONFIG_HEAD=y
# CONFIG_FEATURE_FANCY_HEAD is not set
# CONFIG_HOSTID is not set
CONFIG_ID=y
# CONFIG_INSTALL is not set
# CONFIG_LENGTH is not set
CONFIG_LN=y
# CONFIG_LOGNAME is not set
@@ -101,7 +104,7 @@ CONFIG_MKDIR=y
CONFIG_MKNOD=y
CONFIG_MV=y
# CONFIG_OD is not set
# CONFIG_PRINTF is not set
CONFIG_PRINTF=y
CONFIG_PWD=y
CONFIG_REALPATH=y
CONFIG_RM=y
@@ -171,14 +174,17 @@ CONFIG_FEATURE_HUMAN_READABLE=y
# CONFIG_MKTEMP is not set
CONFIG_READLINK=y
# CONFIG_RUN_PARTS is not set
# CONFIG_START_STOP_DAEMON is not set
# CONFIG_WHICH is not set
#
# Editors
#
# CONFIG_AWK is not set
# CONFIG_PATCH is not set
CONFIG_SED=y
# CONFIG_FEATURE_SED_EMBEDED_NEWLINE is not set
CONFIG_FEATURE_SED_GNU_COMPATABILITY=y
# CONFIG_VI is not set
#
@@ -193,6 +199,7 @@ CONFIG_FEATURE_FIND_NEWER=y
CONFIG_FEATURE_FIND_INUM=y
CONFIG_GREP=y
# CONFIG_FEATURE_GREP_EGREP_ALIAS is not set
CONFIG_FEATURE_GREP_FGREP_ALIAS=y
# CONFIG_FEATURE_GREP_CONTEXT is not set
# CONFIG_XARGS is not set
@@ -201,13 +208,12 @@ CONFIG_GREP=y
#
CONFIG_INIT=y
CONFIG_FEATURE_USE_INITTAB=y
# CONFIG_FEATURE_INITRD is not set
CONFIG_FEATURE_INITRD=y
# CONFIG_FEATURE_INIT_COREDUMPS is not set
# CONFIG_FEATURE_EXTRA_QUIET is not set
CONFIG_FEATURE_EXTRA_QUIET=y
CONFIG_HALT=y
# CONFIG_POWEROFF is not set
CONFIG_REBOOT=y
# CONFIG_START_STOP_DAEMON is not set
# CONFIG_MESG is not set
#
@@ -232,20 +238,22 @@ CONFIG_USE_BB_PWD_GRP=y
# CONFIG_CROND is not set
# CONFIG_CRONTAB is not set
# CONFIG_DC is not set
# CONFIG_DUTMP is not set
# CONFIG_LAST is not set
# CONFIG_HDPARM is not set
# CONFIG_MAKEDEVS is not set
# CONFIG_MT is not set
# CONFIG_STRINGS is not set
# CONFIG_TIME is not set
# CONFIG_UPDATE is not set
# CONFIG_WATCHDOG is not set
#
# Linux Module Utilities
#
CONFIG_MODUTILS_OBJ=y
CONFIG_DEPMOD=y
CONFIG_INSMOD=y
# CONFIG_FEATURE_OLD_MODULE_INTERFACE is not set
CONFIG_FEATURE_NEW_MODULE_INTERFACE=y
# CONFIG_FEATURE_2_2_MODULES is not set
CONFIG_FEATURE_2_4_MODULES=y
#
# Support new (post 2.1) Linux kernels (Forced enabled)
@@ -301,6 +309,7 @@ CONFIG_ROUTE=y
CONFIG_WGET=y
# CONFIG_FEATURE_WGET_STATUSBAR is not set
CONFIG_FEATURE_WGET_AUTHENTICATION=y
# CONFIG_FEATURE_WGET_IP6_LITERAL is not set
#
# udhcp Server/Client
@@ -332,10 +341,6 @@ CONFIG_FEATURE_SH_IS_ASH=y
# CONFIG_FEATURE_SH_IS_NONE is not set
CONFIG_ASH=y
#
# ash (forced enabled as default shell)
#
#
# Ash Shell Options
#
@@ -378,6 +383,7 @@ CONFIG_LOGGER=y
CONFIG_DMESG=y
# CONFIG_FBSET is not set
# CONFIG_FDFLUSH is not set
# CONFIG_FDFORMAT is not set
# CONFIG_FDISK is not set
# CONFIG_FREERAMDISK is not set
# CONFIG_FSCK_MINIX is not set
@@ -389,10 +395,6 @@ CONFIG_DMESG=y
CONFIG_MKSWAP=y
CONFIG_MORE=y
CONFIG_FEATURE_USE_TERMIOS=y
#
# Common options for ls and more
#
CONFIG_PIVOT_ROOT=y
# CONFIG_RDATE is not set
CONFIG_SWAPONOFF=y
+3 -2
View File
@@ -2,8 +2,8 @@ Source: busybox-cvs
Priority: optional
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Uploaders: Erik Andersen <andersee@debian.org>, Bastian Blank <waldi@debian.org>, Tollef Fog Heen <tfheen@debian.org>, Glenn McGrath <bug1@debian.org>
Build-Depends: debhelper (>= 2.1.18)
Standards-Version: 3.5.7.0
Build-Depends: debhelper (>= 4.0.0)
Standards-Version: 3.6.0
Package: busybox-cvs
Architecture: any
@@ -52,6 +52,7 @@ Architecture: any
Depends: ${shlibs:Depends}
Section: debian-installer
Conflicts: busybox-udeb
Enhances: busybox-cvs-net-udeb
Priority: extra
Description: Tiny utilities for the debian-installer
BusyBox combines tiny versions of many common UNIX utilities into a single
+8 -2
View File
@@ -11,6 +11,12 @@ config CONFIG_MKTEMP
help
mktemp is used to create unique temporary files
config CONFIG_PIPE_PROGRESS
bool "pipe_progress"
default n
help
Display a dot to indicate pipe activity.
config CONFIG_READLINK
bool "readlink"
default n
@@ -27,8 +33,8 @@ config CONFIG_RUN_PARTS
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 does not accept long options, and
some features (such as report mode) are not implemented.
In this implementation of run-parts some features (such as report mode)
are not implemented.
Unless you know that run-parts is used in some of your scripts
you can safely say N here.
+1
View File
@@ -25,6 +25,7 @@ endif
DEBIANUTILS-y:=
DEBIANUTILS-$(CONFIG_MKTEMP) += mktemp.o
DEBIANUTILS-$(CONFIG_PIPE_PROGRESS) += pipe_progress.o
DEBIANUTILS-$(CONFIG_READLINK) += readlink.o
DEBIANUTILS-$(CONFIG_RUN_PARTS) += run_parts.o
DEBIANUTILS-$(CONFIG_START_STOP_DAEMON) += start_stop_daemon.o
+55
View File
@@ -0,0 +1,55 @@
/*
* Monitor a pipe with a simple progress display.
*
* Copyright (C) 2003 by Rob Landley <rob@landley.net>, Joey Hess
*
* 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 <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include "busybox.h"
#define PIPE_PROGRESS_SIZE 4096
/* Read a block of data from stdin, write it to stdout.
* Activity is indicated by a '.' to stderr
*/
extern int pipe_progress_main(int argc, char **argv)
{
RESERVE_CONFIG_BUFFER(buf, PIPE_PROGRESS_SIZE);
time_t t = time(NULL);
size_t len;
while ((len = fread(buf, 1, PIPE_PROGRESS_SIZE, stdin)) > 0) {
time_t new_time = time(NULL);
if (new_time != t) {
t = new_time;
fputc('.', stderr);
}
fwrite(buf, len, 1, stdout);
}
fputc('\n', stderr);
#ifdef CONFIG_FEATURE_CLEAN_UP
RELEASE_CONFIG_BUFFER(buf);
#endif
return 0;
}
+32 -12
View File
@@ -26,10 +26,21 @@
#include <stdlib.h>
#include "busybox.h"
static int file_exists(char *file)
{
struct stat filestat;
if (stat(file, &filestat) == 0 &&
S_ISREG(filestat.st_mode) &&
filestat.st_mode & S_IXUSR)
return 1;
else
return 0;
}
extern int which_main(int argc, char **argv)
{
char *path_list, *path_n;
struct stat filestat;
int i, count=1, found, status = EXIT_SUCCESS;
if (argc <= 1 || **(argv + 1) == '-')
@@ -49,21 +60,30 @@ extern int which_main(int argc, char **argv)
}
while(argc-- > 0) {
char *buf;
path_n = path_list;
argv++;
found = 0;
for (i = 0; i < count; i++) {
char *buf;
buf = concat_path_file(path_n, *argv);
if (stat (buf, &filestat) == 0
&& filestat.st_mode & S_IXUSR)
{
puts(buf);
found = 1;
break;
/*
* Check if we were given the full path, first.
* Otherwise see if the file exists in our $PATH.
*/
buf = *argv;
if (file_exists(buf)) {
puts(buf);
found = 1;
} else {
for (i = 0; i < count; i++) {
buf = concat_path_file(path_n, *argv);
if (file_exists(buf)) {
puts(buf);
found = 1;
break;
}
free(buf);
path_n += (strlen(path_n) + 1);
}
free(buf);
path_n += (strlen(path_n) + 1);
}
if (!found)
status = EXIT_FAILURE;
+29
View File
@@ -0,0 +1,29 @@
The code and graphics on this website (and it's mirror sites, if any) are
Copyright (c) 1999-2003 by Erik Andersen. All rights reserved.
Documents on this Web site including their graphical elements, design, and
layout are protected by trade dress and other laws and MAY BE COPIED OR
IMITATED IN WHOLE OR IN PART. THIS WEBSITE IS LICENSED FREE OF CHARGE, THERE
IS NO WARRANTY FOR THE WEBSITE TO THE EXTENT PERMITTED BY APPLICABLE LAW.
SHOULD THIS WEBSITE PROVE DEFECTIVE, YOU MAY ASSUME THAT SOMEONE MIGHT GET
AROUND TO SERVICING, REPAIRING OR CORRECTING IT SOMETIME WHEN THEY HAVE NOTHING
BETTER TO DO. REGARDLESS, YOU GET TO KEEP BOTH PIECES.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY
COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THIS
WEBSITE AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
INABILITY TO USE THIS WEBSITE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR
LOSS OF HAIR, LOSS OF LIFE, LOSS OF MEMORY, LOSS OF YOUR CARKEYS, MISPLACEMENT
OF YOUR PAYCHECK, OR COMMANDER DATA BEING RENDERED UNABLE TO ASSIST THE
STARFLEET OFFICERS ABORD THE STARSHIP ENTERPRISE TO RECALIBRATE THE MAIN
DEFLECTOR ARRAY, LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
WEBSITE TO OPERATE WITH YOUR WEBBROWSER), EVEN IF SUCH HOLDER OR OTHER PARTY
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
You have been warned.
You can contact the webmaster at <andersen@codepoet.org> if you have some sort
of problem with this.
+4 -88
View File
@@ -1,39 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<title>BusyBox Anonymous CVS Instructions</title>
</HEAD>
<body text="#000000" alink="#660000" link="#660000" bgcolor="#dee2de" vlink="#660000">
<basefont face="lucida, helvetica, arial" size="3">
<!--#include file="header.html" -->
<H3>Accessing the Busybox CVS Repository</H3>
<CENTER>
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2>
<TR>
<td bgcolor="#000000">
<FONT FACE="lucida, helvetica" COLOR="#ccccc0">
<B>B&nbsp;u&nbsp;s&nbsp;y&nbsp;B&nbsp;o&nbsp;x</B>
</FONT>
</TD>
</TR>
</TABLE>
<a href="/"><IMG SRC="images/busybox2.jpg" alt="BusyBox" border="0" width="360" height="230"></a><BR>
</CENTER>
<TABLE WIDTH="95%" CELLSPACING=1 CELLPADDING=4 BORDER=1>
<TR><TD BGCOLOR="#ccccc0" ALIGN=center>
<A NAME="intro"> <BIG><B>
Anonymous CVS
</B></BIG></A>
</TD></TR>
<TR><TD BGCOLOR="#eeeee0">
<h3>Anonymous CVS</h3>
We allow anonymous (read-only) CVS access to everyone. The first command you
need to run for anonymous CVS access is:
@@ -78,59 +46,7 @@ cvs update</pre>
Because you've only been granted anonymous access to the tree, you won't be
able to commit any changes. Changes can be submitted for inclusion by posting
them to the appropriate <a href="http://busybox.net/mailman/listinfo">mailing list</a>.
<!-- 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-2002, 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>
</BODY>
</HTML>
them to the appropriate mailing list.
<!--#include file="footer.html" -->
+44
View File
@@ -0,0 +1,44 @@
<!--#include file="header.html" -->
<h3>How to use CVS</h3>
If you want to know all the gory details, you will want to visit
<a href="http://www.cvshome.org/">the CVS main web page</a>.<p>
For the impatient, the following is probably about all you need to know:
<p>
<dl>
<dt><pre>cvs checkout -c</pre>
<dd>Will list the modules available for checkout
<dt><pre>cvs checkout &lt module name &gt</pre>
<dd>Will checkout the named module
<dt><pre>cvs co &lt module name &gt</pre>
<dd>Same thing
<dt><pre>cvs update</pre>
<dd>Updates your local archive so it is in sync with the repository
-- your local updates are left intact. Tries to merge upstream updates
into your local updates. You will see the following tags when it is
updating your local repository: C means conflict, U means update,
P means patched, and M means modified.
<dt><pre>cvs up</pre>
<dd>Same thing
<dt><pre>cvs update &lt file name &gt</pre>
<dd>Same thing but for just the named file(s)/directory(s).
<dt><pre>cvs commit</pre>
<dd>Will check in all your work.
<dt><pre>cvs add &lt file name &gt</pre>
<dd>Adds the named file/directory into CVS
<dt><pre>cvs remove &lt file name &gt</pre>
<dd>Removes the named file/directory from the upstream repository.
<dt><pre>cvs rm &lt file name &gt</pre>
<dd>Same thing
<dt><pre>cvs log &lt file name &gt</pre>
</dl>
<!--#include file="footer.html" -->
+27
View File
@@ -0,0 +1,27 @@
<!--#include file="header.html" -->
<h3>Documentation</h3>
Current documentation for BusyBox includes:
<ul>
<li><a href=
"downloads/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>
<li><a href="downloads/README">README</a>. This is
the README file included in the busybox source
release.</li>
<li>If you need more help, the BusyBox <a href=
"lists/busybox/">mailing list</a> is a good place to
start.</li>
</ul>
<!--#include file="footer.html" -->
+38
View File
@@ -0,0 +1,38 @@
<!--#include file="header.html" -->
<h3>Download</h3>
Source for the latest release can always be
downloaded from <a href="downloads">http://www.busybox.net/downloads</a>.
<p>
You can also obtain <a href= "downloads/snapshots/">Daily Snapshots</a> of
the latest stable, and the latest development CVS source trees.
<p>
BusyBox now has <b>two</b> CVS trees. The "busybox-stable" tree
contains the older 0.60.x stable series. The "busybox" tree contains
the latest 1.0.0-preX development version of busybox.<br>
<ul>
<li> Click here to browse the <a href="/cgi-bin/cvsweb/busybox/">
CVS tree for the 1.0.0-preX development version of BusyBox</a>
</li>
<li>Click here to browse the <a href="/cgi-bin/cvsweb/busybox.stable/">
CVS tree for the stable 0.60.x version of BusyBox</a>.
</li>
<li>Anonymous <a href="cvs_anon.html">CVS access</a> is available.
</li>
<li>For those that are actively contributing there is
even <a href="cvs_write.html">CVS write access</a>.
</li>
</ul>
<!--#include file="footer.html" -->
+18
View File
@@ -0,0 +1,18 @@
<!-- Footer -->
</td>
</tr>
</table>
<p>
<font face="arial, helvetica, sans-serif" size="-1">
<a HREF="/copyright.txt">Copyright &copy; 1999-2003 Erik Andersen</a>
<br>
Mail all comments, insults, suggestions and bribes to
<br>
Erik Andersen <A HREF="mailto:andersen@codepoet.org">andersen@codepoet.org</A><BR>
</font>
</body>
</html>
+83
View File
@@ -0,0 +1,83 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>BusyBox</title>
<style type="text/css">
body {
background-color: #DEE2DE;
color: #000000;
}
:link { color: #660000 }
:visited { color: #660000 }
:active { color: #660000 }
td.c2 {font-family: arial, helvetica, sans-serif; font-size: 80%}
td.c1 {font-family: lucida, helvetica; font-size: 248%}
</style>
</head>
<body>
<basefont face="lucida, helvetica, arial" size="3">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<div class="c3">
<table border="0" cellspacing="1" cellpadding="2">
<tr>
<td class="c1">BUSYBOX</td>
</tr>
</table>
</div>
<a href="/"><IMG SRC="images/busybox1.png" alt="BusyBox" border="0"></a><BR>
</td>
</tr>
<tr>
<td valign="TOP">
<br><a href="/">Home</a>
<br><a href="/screenshot.html">Screenshot</a>
<br><a href="/lists.html">Mailing Lists</a>
<br><a href="/news.html">Latest News</a>
<br><a href="/download.html">Download</a>
<br><a href="/cvs_anon.html">Accessing CVS</a>
<br><a href="/cvs_howto.html">Intro to CVS</a>
<br><a href="/cgi-bin/cvsweb/busybox/">Browse CVS</a>
<br><a href="/docs.html">Documentation</a>
<br><a href="/products.html">Products</a>
<br><a href="/shame.html">Hall of Shame</a>
</dl>
<dl>
<dt><b>Related Sites</b>
<br><a href="http://uclibc.org/">uClibc.org</a>
<br><a href="http://udhcp.busybox.net/">udhcp</a>
<br><a href="http://tinylogin.busybox.net/">tinylogin</a>
<br><a href="http://www.ucdot.org/">uCdot</a>
<br><a href="http://www.linuxdevices.com">LinuxDevices</a>
<br><a href="http://slashdot.org/">Slashdot</a>
<br><a href="http://freshmeat.net/">Freshmeat</a>
<br><a href="http://linuxtoday.com/">Linux Today</a>
<br><a href="http://lwn.net/">Linux Weekly News</a>
<br><a href="http://www.tldp.org/HOWTO">Linux HOWTOs</a>
<!--
<a href="http://validator.w3.org/check/referer"><img
src="/images/vh40.gif" height=31 width=88
align=left border=0 alt="Valid HTML 4.0!"></a>
-->
</td>
<td Valign="TOP">
Binary file not shown.

After

Width:  |  Height:  |  Size: 906 B

+43 -470
View File
@@ -1,490 +1,63 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<!--#include file="header.html" -->
<html>
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 1st February 2002), see www.w3.org">
<title>BusyBox</title>
<style type="text/css">
body {
background-color: #DEE2DE;
color: #000000;
}
:link { color: #660000 }
:visited { color: #660000 }
:active { color: #660000 }
div.c3 {text-align: center}
td.c2 {font-family: arial, helvetica, sans-serif; font-size: 80%}
td.c1 {font-family: lucida, helvetica; font-size: 248%}
</style>
</head>
<!-- Begin Introduction section -->
<body>
<basefont face="lucida, helvetica, arial" size="3">
<h3>BusyBox: The Swiss Army Knife of Embedded Linux</h3>
<div class="c3">
<table border="0" cellspacing="1" cellpadding="2">
<tr>
<td class="c1">BUSYBOX</td>
</tr>
</table>
<a href="/"><img src="images/busybox1.png" alt="BusyBox"
border="0" width="164" height="116"></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>
BusyBox combines tiny versions of many common UNIX utilities into a single
small executable. It provides replacements for most of the utilities you
usually find in GNU fileutils, shellutils, etc. 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. BusyBox provides a fairly complete
environment for any small or embedded system.
<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 GNU
fileutils, shellutils, etc. 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.
BusyBox provides a fairly complete POSIX environment for any
small or embedded system.
<p>
<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 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 some device
nodes in /dev, a few configuration files in /etc, and a Linux 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>
<p>
<h3>Screenshot</h3>
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>Because everybody loves screenshots, a screenshot of
BusyBox is now available <a href=
"screenshot.html">right here</a>.</p>
<p>
<p>
<h3>Mailing List Information</h3>
BusyBox has a <a href="/lists/busybox/">mailing list</a>.<br>
To subscribe, go and visit <a href="/mailman/listinfo/busybox">this page</a>.
<br>
Before asking questions on the mailing list
you should probably first search the mailing list archives...
<form method="GET" action="http://www.google.com/custom">
<input type="hidden" name="domains" value="busybox.net">
<input type="hidden" name="sitesearch" value="busybox.net">
<a href="http://www.google.com"><img src="http://www.google.com/logos/Logo_25wht.gif" border="0" alt="Google" height="32" width="75" align="middle"></a>&nbsp;<input type="text" name="q" size="31" maxlength="255" value="">&nbsp;<input type="submit" name="sa" value="search the mailing list archives">...
</form>
<h3>Sponsors</h3>
Please visit our sponsors and thank them for their
support! They have provided money for equipment and
bandwidth. Next time you need help with a project,
consider these fine companies!
<!-- Begin Latest News section -->
</td>
</tr>
<ul>
<li><a href="http://www.penguru.net">Penguru Consulting</a><br>
Custom development for embedded Linux systems and multimedia platforms
</li>
<tr>
<td bgcolor="#CCCCC0" align="center"><a name=
"news"><big><b>Latest News</b></big></a></td>
</tr>
<li><a href="http://opensource.se/">opensource.se</a><br>
Embedded open source consulting in Europe.
</li>
<tr>
<td bgcolor="#EEEEE0">
<ul>
<li><a href="http://www.codepoet-consulting.com">Codepoet Consulting</a><br>
Custom Linux, embedded Linux, BusyBox, and uClibc
development.
</li>
<p>
<li><b>30 July 2003 -- BusyBox 1.0.0-pre2 released</b><p>
</ul>
Here goes another pre release for the new BusyBox stable
series. The last prerelease (pre1) was given quite a lot of
testing (thanks everyone!) which has helped turn up a number of
bugs, and these problems have now been fixed.
If you wish to be a sponsor, or if you have already contributed and would like
your name added here, email <a href= "mailto:andersen@codepoet.org">Erik</a>.
<p>
Highlights of -pre2 include updating the 'ash' shell to sync up
with the Debian 'dash' shell, a new 'hdparm' applet was added,
init again supports pivot_root, The 'reboot' 'halt' and
'poweroff' applets can now be used without using busybox init.
an ifconfig buffer overflow was fixed, losetup now allows
read-write loop devices, uClinux daemon support was added, the
'watchdog', 'fdisk', and 'kill' applets were rewritten, there were
tons of doc updates, and there were many other bugs fixed.
<p>
If you have submitted a patch and it is not included in this
release and Erik has not emailed you explaining why your patch
was rejected, it is safe to say that he has lost your patch.
That happens sometimes. Please re-submit your patch to the
BusyBox mailing list.
<p>
The point of the "-preX" versions is to get a larger group of
people and vendors testing, so any problems that turn up can be
fixed prior to the final 1.0.0 release. The main feature that
is still still on the TODO list before the final BusyBox 1.0.0
release is adding module support for the new 2.6.x kernels. If
necessary, a -pre3 BusyBox release will happen on August 6th.
Hopefully (i.e. unless some horrible catastrophic problem
turns up) the final BusyBox 1.0.0 release will be ready by
then...
<p>
As usual you can <a href="downloads">download busybox here</a>.
You don't really need to bother with the
<a href="downloads/Changelog">changelog</a>, as the changes
vs the stable version are way too extensive to easily enumerate.
But you can take a look if you really want too.
<p>Have Fun!
<p>
<p>
<li><b>Old News</b><br>
For the old news, visit <a href="oldnews.html">the
old news page</a>.</li>
</ul>
</td>
</tr>
<!-- Begin Sponsors section -->
<tr>
<td bgcolor="#CCCCC0" align="center"><a name=
"sponsors"><big><b>Sponsors</b></big></a></td>
</tr>
<tr>
<td bgcolor="#EEEEE0">
Please visit our sponsors and thank them for their
support! They have provided money for equipment and
bandwidth. Next time you need help with a project,
consider these fine companies!
<ul>
<li><a href="http://www.penguru.net">Penguru Consulting</a><br>
Custom development for embedded Linux systems and multimedia platforms
</li>
<li><a href="http://opensource.se/">opensource.se</a><br>
Embedded open source consulting in Europe.
</li>
<li><a href="http://www.codepoet-consulting.com">Codepoet Consulting</a><br>
Custom Linux, embedded Linux, BusyBox, and uClibc
development.
</li>
</ul>
Several individuals have also contributed. If you have
already contributed and would like your name added
here, just let me know. If you would like to be a
BusyBox sponsor, email <a href=
"mailto:andersen@codepoet.org">Erik</a>.
</td>
</tr>
<!-- Begin Download section -->
<p>
<tr>
<td bgcolor="#CCCCC0" align="center"><a name=
"download"><big><b>Download</b></big></a></td>
</tr>
<tr>
<td bgcolor="#EEEEE0">
Source for the latest release can always be
downloaded from <a href="downloads">http://www.busybox.net/downloads</a>.
<p>
BusyBox now has <b>two</b> CVS trees. The "busybox-stable" tree
contains the older 0.60.x stable series. The "busybox" tree contains
the latest 1.0.0-preX development version of busybox.<br>
<ul>
<li><a href= "downloads/snapshots/">Daily Snapshots of the the latest
stable, and the latest development CVS source trees can be found right here</a>.
<br>
</li><li><a href="/cgi-bin/cvsweb/busybox/">Click here to browse the CVS
tree for the 1.0.0-preX development version of BusyBox</a>
</li><li><a href="/cgi-bin/cvsweb/busybox.stable/">Click here to browse
the CVS tree for the stable 0.60.x version of BusyBox</a>.
</li><li>Anonymous <a href="cvs_anon.html">CVS
access</a> is available.
</li><li>For those that are actively contributing there is
even <a href="cvs_write.html">CVS write access</a>.</li>
</ul>
</td>
</tr>
<!-- 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=
"downloads/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>
<li><a href="downloads/README">README</a>. This is
the README file included in the busybox source
release.</li>
<li>If you need more help, the BusyBox <a href=
"lists/busybox/">mailing list</a> is a good place to
start.</li>
</ul>
</td>
</tr>
<!-- 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.</li>
<li><a href=
"http://freshmeat.net/projects/busybox/">Freshmeat
AppIndex record for BusyBox</a></li>
<li><a href=
"http://tinylogin.busybox.net/">TinyLogin</a> is a
nice embedded tool for handling authentication,
changing passwords, and similar tasks which nicely
complements BusyBox.</li>
<li><a href="http://udhcp.busybox.net/">udhcp</a> is
a tiny dhcp client and/or server which is ideal for
embedded systems.</li>
<li><a href="http://www.uclibc.org/">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 Linux systems.
</li>
</ul>
</td>
</tr>
<!-- 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:</p>
<ul>
<li><a href="/cgi-bin/cvsweb/buildroot/">buildroot</a> a configurable
means for building your own busybox/uClibc based system systems.
</li><li><a href=
"http://cvs.debian.org/boot-floppies/">
Debian installer (boot floppies) project</a>
</li><li><a href="http://redhat.com/">Red Hat 7.2
installer</a>
</li><li><a href=
"http://distro.ibiblio.org/pub/Linux/distributions/slackware/source/rootdsks/">
Slackware Installer</a>
</li><li><a href="http://www.gentoo.org/">Gentoo Linux install/boot CDs</a>
</li><li><a href="http://www.mandrake.com/">The Mandrake installer</a>
</li><li><a href="http://www.linuxrouter.org/">Linux
Router Project</a>
</li><li><a href="http://linux-embedded.org/">LEM</a>
</li><li><a href=
"http://www.toms.net/rb/">tomsrtbt</a>
</li><li><a href="http://www.stormix.com/">Stormix
Installer</a>
</li><li><a href=
"http://www.emacinc.com/linux2_sbc.htm">EMAC Linux
2.0 SBC</a>
</li><li><a href="http://www.trinux.org/">Trinux</a>
</li><li><a href="http://oddas.sourceforge.net/">ODDAS
project</a>
</li><li><a href="http://byld.sourceforge.net/">Build Your
Linux Disk</a>
</li><li><a href=
"http://homepages.ihug.co.nz/~ichi/baslinux.html">BasicLinux</a>
</li><li><a href=
"http://ibiblio.org/pub/Linux/system/recovery">Zdisk</a>
</li><li><a href="http://www.adtran.com">AdTran -
VPN/firewall VPN Linux Distribution</a>
</li><li><a href="http://mkcdrec.ota.be/">mkCDrec - make
CD-ROM recovery</a>
</li><li><a href=
"http://recycle.lbl.gov/~ldoolitt/bse/">Linux on
nanoEngine</a>
</li><li><a href=
"http://www.zelow.no/floppyfw/">Floppyfw</a>
</li><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><li><a href="http://www.ltsp.org/">Linux Terminal
Server Project</a>
</li><li><a href=
"http://www.devil-linux.org/">Devil-Linux</a>
</li><li><a href=
"http://dutnux.sourceforge.net/">DutNux</a>
</li><li><a href=
"http://www.microwerks.net/~hugo/mindi/">Mindi</a>
</li><li><a href=
"http://www.tzi.de/~pharao90/ttylinux">ttylinux</a>
</li><li><a href="http://www.coyotelinux.com/">Coyote Linux</a>
</li><li><a href="http://www.partimage.org/">Partition
Image</a>
</li><li><a href="http://www.fli4l.de/">fli4l the on(e)-disk-router</a>
</li><li><a href="http://tinfoilhat.cultists.net/">Tinfoil
Hat Linux</a>
</li><li><a href="http://familiar.handhelds.org/">Familiar Linux</a> - a linux distribution for handheld computers
</li><li><a href="http://rescuecd.sourceforge.net/">Timo's Rescue CD Set</a>
</li><li><a href="http://sf.net/projects/netstation/">Netstation</a>
</li><li><a href="http://www.fiwix.org/">GNU/Fiwix Operating System</a>
</li><li><a href="http://www.softcraft.com/">Generations Linux</a>
</li><li><a href="http://systemimager.org/relatedprojects/">SystemImager / System Installation Suite</a>
</li><li><a href="http://www.bablokb.de/gendist/">GENDIST distribution generator</a>
</li><li><a href="http://diet-pc.sourceforge.net/">DIET-PC embedded Linux thin client distribution</a>
</li><li><a href="http://byzgl.sourceforge.net/">BYZantine Gnu/Linux</a>
</li><li><a href="http://dban.sourceforge.net/">Darik's Boot and Nuke</a>
</li><li><a href="http://www.timesys.com/">TimeSys real-time Linux</a>
</li><li><a href="http://movix.sf.net/">MoviX</a> -- boots from CD and automatically plays every video file on the CD
</li><li><a href="http://katamaran.sourceforge.net">katamaran</a>Linux, X11, xfce windowmanager, based on BusyBox
</li><li><a href="http://www.sourceforge.net/projects/simplygnustep">Prometheus SimplyGNUstep</a>
</li><li><a href="http://www.renyi.hu/~ekho/lowlife/">lowlife</a>A documentation project on how to make your own uClibc-based systems and floppy.
</li><li><a href="http://metadistros.hispalinux.es/">Metadistros</a>a project to allow you easily make Live-CD distributions.
</li><li><a href="http://salvare.sourceforge.net/">Salvare</a>More Linux than tomsrtbt but less than Knoppix, aims to provide a useful workstation as well as a rescue disk.
</li><li><a href="http://www.stresslinux.org/">stresslinux</a>minimal linux distribution running from a bootable cdrom or via PXE.
</li><li><a href="http://thinstation.sourceforge.net/">thinstation</a>convert standard PCs into full-featured diskless thinclients.
</li><li><a href="http://www.uhulinux.hu/">UHU-Linux Hungary</a>
</li><li><a href="http://tuxscreen.net">Tuxscreen Linux Phone</a>
</li><li><a href="http://www.kerbango.com/">The Kerbango Internet Radio</a>
</li><li><a href="http://www.linuxmagic.com/vpn/">LinuxMagic VPN Firewall</a>
</li><li><a href="http://www.isilver-inc.com/">I-Silver Linux appliance servers</a>
</li><li><a href="http://zaurus.sourceforge.net/">Sharp Zaurus PDA</a>
</li><li><a href="http://www.cyclades.com/">Cyclades-TS and other Cyclades products</a>
</li><li><a href="http://www.buffalo-technology.com/products/wireless/wbr-g54.htm">Buffalo WBR-G54 wireless router</a>
</li><li><a href="http://catalog.belkin.com/IWCatProductPage.process?Merchant_Id=&Section_Id=201522&pcount=&Product_Id=136493">Belkin 54g Wireless DSL/Cable Gateway Router</a>
</li><li><a href="http://www.linksys.com/products/product.asp?prid=508">Linksys WRT54G - Wireless-G Broadband Router</a>
</li><li><a href="http://www.dell.com/us/en/biz/topics/sbtopic_005_truemobile.htm">Dell TrueMobile 1184</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 -->
</p>
</td>
</tr>
</table>
<!-- Footer -->
<hr>
<table width="100%">
<tr>
<td class="c2">Mail all comments, insults, suggestions
and bribes to <a href="mailto:andersen@codepoet.org">Erik
Andersen</a><br>
The Busybox logo is copyright 1999-2002, Erik
Andersen.</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></p>
</td>
<td><a href="http://freshmeat.net"><img width="90"
height="36" src="images/fm.mini.png" alt="Freshmeat">
</a></td>
</tr>
</table>
</div>
</body>
</html>
<!--#include file="footer.html" -->
+42
View File
@@ -0,0 +1,42 @@
<!--#include file="header.html" -->
<!-- Begin Introduction section -->
<h3>Mailing List Information</h3>
BusyBox has a <a href="/lists/busybox/">mailing list</a> for discussion and
development. You can subscribe by visiting
<a href="http://codepoet.org/mailman/listinfo/busybox">this page</a>.
<p>
There is also a mailing list for <a href="/lists/busybox-cvs/">active developers</a>
wishing to read the complete diff of each and every change to busybox -- not for the
faint of heart. Active developers can subscribe by visiting
<a href="http://codepoet.org/mailman/listinfo/busybox-cvs">this page</a>.
<p>
<h3>Search the List Archives</h3>
Please search the mailing list archives before asking questions on the mailing
list, since there is a good chance someone else has asked the same question
before. Checking the archives is a great way to avoid annoying everyone on the
list with frequently asked questions...
<p>
<center>
<form method="GET" action="http://www.google.com/custom">
<input type="hidden" name="domains" value="busybox.net">
<input type="hidden" name="sitesearch" value="busybox.net">
<input type="text" name="q" size="31" maxlength="255" value="">
<br>
<input type="submit" name="sa" value="search the mailing list archives">
<br>
<a href="http://www.google.com"><img src="http://www.google.com/logos/Logo_25wht.gif" border="0" alt="Google" height="32" width="75" align="middle"></a>
<br>
</form>
</center>
<!--#include file="footer.html" -->
+150
View File
@@ -0,0 +1,150 @@
<!--#include file="header.html" -->
<ul>
<p>
<li><b>10 December 2003 -- BusyBox 1.0.0-pre4 released</b><p>
Here goes the fourth pre-release for the new BusyBox stable
series. This release includes major rework to sed, lots of
rework on tar, a new tiny implementation of bunzip2, a new
devfsd applet, support for 2.6.x kernel modules, updates to
the ash shell, sha1sum and md5sum have been merged into a
common applet, the dpkg applets has been cleaned up, and tons
of random bugs have been fixed. Thanks everyone for all the
testing, bug reports, and patches! Once again, a big
thank-you goes to Glenn McGrath (bug1) for stepping helping
get patches merged!
<p>
And of course, if you are reading this, you might have noticed
the busybox website has been completely reworked. Hopefully
things are now somewhat easier to navigate... If you see any
problems, of have suggestions to make, as always, please feel
free to send an email to the busybox mailing list.
<p>
The <a href="downloads/Changelog">changelog</a> has all
the details. And as usual you can
<a href="downloads">download busybox here</a>.
<p>Have Fun!
<p>
<p>
<li><b>12 Sept 2003 -- BusyBox 1.0.0-pre3 released</b><p>
Here goes the third pre-release for the new BusyBox stable
series. The last prerelease has held up quite well under
testing, but a number of problems have turned up as the number
of people using it has increased. Thanks everyone for all
the testing, bug reports, and patches!
<p>
If you have submitted a patch or a bug report to the busybox
mailing list and no one has emailed you explaining why your
patch was rejected, it is safe to say that your patch has
somehow gotten lost or forgotten. That happens sometimes.
Please re-submit your patch or bug report to the BusyBox
mailing list!
<p>
The point of the "-preX" versions is to get a larger group of
people and vendors testing, so any problems that turn up can be
fixed prior to the final 1.0.0 release. The main feature
(besides additional testing) that is still still on the TODO
list before the final BusyBox 1.0.0 release is sorting out the
modutils issues. For the new 2.6.x kernels, we already have
patches adding insmod and rmmod support and those need to be
integrated. For 2.4.x kernels, for which busybox only supports
a limited number of architectures, we may want to invest a bit
more work before we cut 1.0.0. Or we may just leave 2.4.x
module loading alone.
<p>
I had hoped this release would be out a month ago. And of
course, it wasn't since Erik became busy getting a release of
<a href="http://www.uclibc.org/">uClibc</a>
out the door. Many thanks to Glenn McGrath (bug1) for
stepping in and helping get a bunch of patches merged! I am
not even going to state a date for releasing BusyBox 1.0.0
-pre4 (or the final 1.0.0). We're aiming for late September...
But if this release proves as to be exceptionally stable (or
exceptionally unstable!), the next release may be very soon
indeed.
<p>
The <a href="downloads/Changelog">changelog</a> has all
the details. And as usual you can
<a href="downloads">download busybox here</a>.
<p>Have Fun!
<p>
<p>
<li><b>30 July 2003 -- BusyBox 1.0.0-pre2 released</b><p>
Here goes another pre release for the new BusyBox stable
series. The last prerelease (pre1) was given quite a lot of
testing (thanks everyone!) which has helped turn up a number of
bugs, and these problems have now been fixed.
<p>
Highlights of -pre2 include updating the 'ash' shell to sync up
with the Debian 'dash' shell, a new 'hdparm' applet was added,
init again supports pivot_root, The 'reboot' 'halt' and
'poweroff' applets can now be used without using busybox init.
an ifconfig buffer overflow was fixed, losetup now allows
read-write loop devices, uClinux daemon support was added, the
'watchdog', 'fdisk', and 'kill' applets were rewritten, there were
tons of doc updates, and there were many other bugs fixed.
<p>
If you have submitted a patch and it is not included in this
release and Erik has not emailed you explaining why your patch
was rejected, it is safe to say that he has lost your patch.
That happens sometimes. Please re-submit your patch to the
BusyBox mailing list.
<p>
The point of the "-preX" versions is to get a larger group of
people and vendors testing, so any problems that turn up can be
fixed prior to the final 1.0.0 release. The main feature that
is still still on the TODO list before the final BusyBox 1.0.0
release is adding module support for the new 2.6.x kernels. If
necessary, a -pre3 BusyBox release will happen on August 6th.
Hopefully (i.e. unless some horrible catastrophic problem
turns up) the final BusyBox 1.0.0 release will be ready by
then...
<p>
The <a href="downloads/Changelog">changelog</a> has all
the details. As usual you can <a href="downloads">download busybox here</a>.
<p>Have Fun!
<p>
<p>
<p>
<li><b>Old News</b><p>
<a href="/oldnews.html">Click here to read older news</a>
</ul>
<!--#include file="footer.html" -->
File diff suppressed because it is too large. Load diff
+152
View File
@@ -0,0 +1,152 @@
<!--#include file="header.html" -->
<h3>Products/Projects Using BusyBox</h3>
Do you use BusyBox? I'd love to know about it and
I'd be happy to link to you.
<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="/cgi-bin/cvsweb/buildroot/">buildroot</a> a configurable
means for building your own busybox/uClibc based system systems.
<li><a href="http://www.pengutronix.de/software/ptxdist_en.html">PTXdist</a> another
configurable means for building your own busybox based system systems.
</li><li><a href=
"http://cvs.debian.org/boot-floppies/">
Debian installer (boot floppies) project</a>
</li><li><a href="http://redhat.com/">Red Hat installer</a>
</li><li><a href=
"http://distro.ibiblio.org/pub/Linux/distributions/slackware/source/rootdsks/">
Slackware Installer</a>
</li><li><a href="http://www.gentoo.org/">Gentoo Linux install/boot CDs</a>
</li><li><a href="http://www.mandrake.com/">The Mandrake installer</a>
</li><li><a href="http://Leaf.SourceForge.net">Linux Embedded Appliance Firewall</a> the sucessor of the Linux Router Project, supporting all sorts of embedded Linux gateways, routers, wireless routers, and firewalls.
</li><li><a href="http://linux-embedded.org/">LEM</a>
</li><li><a href=
"http://www.toms.net/rb/">tomsrtbt</a>
</li><li><a href="http://www.stormix.com/">Stormix
Installer</a>
</li><li><a href=
"http://www.emacinc.com/linux2_sbc.htm">EMAC Linux
2.0 SBC</a>
</li><li><a href="http://www.trinux.org/">Trinux</a>
</li><li><a href="http://oddas.sourceforge.net/">ODDAS
project</a>
</li><li><a href="http://byld.sourceforge.net/">Build Your
Linux Disk</a>
</li><li><a href=
"http://homepages.ihug.co.nz/~ichi/baslinux.html">BasicLinux</a>
</li><li><a href=
"http://ibiblio.org/pub/Linux/system/recovery">Zdisk</a>
</li><li><a href="http://www.adtran.com">AdTran -
VPN/firewall VPN Linux Distribution</a>
</li><li><a href="http://mkcdrec.ota.be/">mkCDrec - make
CD-ROM recovery</a>
</li><li><a href=
"http://recycle.lbl.gov/~ldoolitt/bse/">Linux on
nanoEngine</a>
</li><li><a href=
"http://www.zelow.no/floppyfw/">Floppyfw</a>
</li><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><li><a href="http://www.ltsp.org/">Linux Terminal
Server Project</a>
</li><li><a href=
"http://www.devil-linux.org/">Devil-Linux</a>
</li><li><a href=
"http://dutnux.sourceforge.net/">DutNux</a>
</li><li><a href=
"http://www.microwerks.net/~hugo/mindi/">Mindi</a>
</li><li><a href=
"http://www.tzi.de/~pharao90/ttylinux">ttylinux</a>
</li><li><a href="http://www.coyotelinux.com/">Coyote Linux</a>
</li><li><a href="http://www.partimage.org/">Partition
Image</a>
</li><li><a href="http://www.fli4l.de/">fli4l the on(e)-disk-router</a>
</li><li><a href="http://tinfoilhat.cultists.net/">Tinfoil
Hat Linux</a>
</li><li><a href="http://familiar.handhelds.org/">Familiar Linux</a> - a linux distribution for handheld computers
</li><li><a href="http://rescuecd.sourceforge.net/">Timo's Rescue CD Set</a>
</li><li><a href="http://sf.net/projects/netstation/">Netstation</a>
</li><li><a href="http://www.fiwix.org/">GNU/Fiwix Operating System</a>
</li><li><a href="http://www.softcraft.com/">Generations Linux</a>
</li><li><a href="http://systemimager.org/relatedprojects/">SystemImager / System Installation Suite</a>
</li><li><a href="http://www.bablokb.de/gendist/">GENDIST distribution generator</a>
</li><li><a href="http://diet-pc.sourceforge.net/">DIET-PC embedded Linux thin client distribution</a>
</li><li><a href="http://byzgl.sourceforge.net/">BYZantine Gnu/Linux</a>
</li><li><a href="http://dban.sourceforge.net/">Darik's Boot and Nuke</a>
</li><li><a href="http://www.timesys.com/">TimeSys real-time Linux</a>
</li><li><a href="http://movix.sf.net/">MoviX</a> -- boots from CD and automatically plays every video file on the CD
</li><li><a href="http://katamaran.sourceforge.net">katamaran</a>Linux, X11, xfce windowmanager, based on BusyBox
</li><li><a href="http://www.sourceforge.net/projects/simplygnustep">Prometheus SimplyGNUstep</a>
</li><li><a href="http://www.renyi.hu/~ekho/lowlife/">lowlife</a>A documentation project on how to make your own uClibc-based systems and floppy.
</li><li><a href="http://metadistros.hispalinux.es/">Metadistros</a>a project to allow you easily make Live-CD distributions.
</li><li><a href="http://salvare.sourceforge.net/">Salvare</a>More Linux than tomsrtbt but less than Knoppix, aims to provide a useful workstation as well as a rescue disk.
</li><li><a href="http://www.stresslinux.org/">stresslinux</a>minimal linux distribution running from a bootable cdrom or via PXE.
</li><li><a href="http://thinstation.sourceforge.net/">thinstation</a>convert standard PCs into full-featured diskless thinclients.
</li><li><a href="http://www.uhulinux.hu/">UHU-Linux Hungary</a>
</li><li><a href="http://deep-water.berlios.de/">Deep-Water Linux</a>
</li><li><a href="http://www.freesco.org/">Freesco router</a>
</li><li><a href="http://Sentry.SourceForge.net/">Sentry Firewall CD</a>
</li><li><a href="http://tuxscreen.net">Tuxscreen Linux Phone</a>
</li><li><a href="http://www.kerbango.com/">The Kerbango Internet Radio</a>
</li><li><a href="http://www.linuxmagic.com/vpn/">LinuxMagic VPN Firewall</a>
</li><li><a href="http://www.isilver-inc.com/">I-Silver Linux appliance servers</a>
</li><li><a href="http://zaurus.sourceforge.net/">Sharp Zaurus PDA</a>
</li><li><a href="http://www.cyclades.com/">Cyclades-TS and other Cyclades products</a>
</li><li><a href="http://www.linksys.com/products/product.asp?prid=508">Linksys WRT54G - Wireless-G Broadband Router</a>
</li><li><a href="http://www.dell.com/us/en/biz/topics/sbtopic_005_truemobile.htm">Dell TrueMobile 1184</a>
</li><li><a href="http://actiontec.com/products/modems/dual_pcmodem/dpm_overview.html">Actiontec Dual PC Modem</a>
</li><li><a href="http://www.kiss-technology.com/">Kiss DP Series DVD players</a>
</ul>
<!--#include file="footer.html" -->
-3
View File
@@ -1,3 +0,0 @@
# go away
User-agent: *
Disallow: /cgi-bin
+9 -23
View File
@@ -1,28 +1,19 @@
<html>
<!--#include file="header.html" -->
<head>
<title> Busybox Screenshot! </title>
<!-- Begin Screenshot -->
<meta name="Author" content="Mark Whitley">
<meta name="Description" content="A screenshot of Busybox">
<h3> Busybox Screenshot! </h3>
</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">
Everybody loves to look at screenshots, so here is a live action screenshot of BusyBox.
<pre style="background-color: black; color: lightgreen; padding: 5px;
font-family: monospace; font-size: smaller;" width="80%">
font-family: monospace; font-size: smaller;" width="100%">
$ ./busybox
BusyBox v1.00-pre1 (2003.07.15-06:37+0000) multi-call binary
BusyBox v1.00-pre3 (2003.09.12-05:48+0000) multi-call binary
Usage: busybox [function] [arguments]...
or: [function] [arguments]...
@@ -37,12 +28,12 @@ Currently defined functions:
bunzip2, busybox, bzcat, cal, cat, chgrp, chmod, chown, chroot,
chvt, clear, cmp, cp, cpio, crond, crontab, cut, date, dc, dd,
deallocvt, delgroup, deluser, df, dirname, dmesg, dos2unix, dpkg,
dpkg-deb, du, dumpkmap, dumpleases, dutmp, echo, egrep, env, expr,
dpkg-deb, du, dumpkmap, dumpleases, echo, egrep, env, expr,
false, fbset, fdflush, fdformat, fgrep, find, fold, free, freeramdisk,
fsck.minix, ftpget, ftpput, getopt, getty, grep, gunzip, gzip,
halt, head, hexdump, hostid, hostname, httpd, hush, hwclock, id,
ifconfig, ifdown, ifup, inetd, init, insmod, ip, ipcalc, iplink,
iproute, iptunnel, kill, killall, klogd, lash, length, linuxrc,
iproute, iptunnel, kill, killall, klogd, lash, last, length, linuxrc,
ln, loadacm, loadfont, loadkmap, logger, login, logname, logread,
losetup, ls, lsmod, makedevs, md5sum, mesg, minit, mkdir, mkfifo,
mkfs.minix, mknod, mkswap, mktemp, modprobe, more, mount, msh,
@@ -62,10 +53,5 @@ $ <blink>_</blink>
</pre>
</TD></TR>
</TABLE>
</body>
</html>
<!--#include file="footer.html" -->
+46
View File
@@ -0,0 +1,46 @@
<!--#include file="header.html" -->
<h3>Hall of Shame!!!</h3>
The following products and/or projects appear to use BusyBox, but do not appear
to release source code as required by the BusyBox license. This is a violation
of the law! The distributors of these products are invited to contact <a href=
"mailto:andersen@codepoet.org">Erik Andersen</a> if they have any confusion as
to what is needed to bring their products into compliance, or if they have
already brought their product into compliance and wish to be removed from the
Hall of Shame.
<p>
Complying with the Busybox license is easy and completely free, so the
companies listed below should be ashamed of themselves. Furthermore, each
product listed here is subject to being legally ordered to cease and desist
distribution for violation of copyright law, and the distributor of each
product is subject to being sued for statutory copyright infringement damages
plus legal fees. Nobody wants to be sued, and <a
href="mailto:andersen@codepoet.org">Erik</a> certainly has better things to do
than sue people. But he will sue if forced to do so to maintain compliance.
Do everyone a favor and don't break the law -- if you use busybox, comply with
the busybox license by releasing the source code with your product.
</p>
<ul>
<li><a href="http://www.hauppauge.co.uk/html/mvp.htm">Hauppauge Media MVP</a>
</li><li><a href="http://www.buffalo-technology.com/products/wireless/wbr-g54.htm">Buffalo WBR-G54 wireless router</a>
</li><li><a href="http://www.netgear.com/products/prod_details.asp?prodID=170">NetGear WG602 wireless router</a>
</li><li><a href="http://catalog.belkin.com/IWCatProductPage.process?Merchant_Id=&Section_Id=201522&pcount=&Product_Id=136493">Belkin 54g Wireless DSL/Cable Gateway Router</a>
</li><li><a href="http://www.dmmtv.com/">Dreambox DM7000S DVB Satellite Receiver</a>
</li><li><a href="http://testing.lkml.org/slashdot.php?mid=331690">Sigma Designs EM8500 based DVD players</a>
</li><li><a href="http://testing.lkml.org/slashdot.php?mid=433790">Liteon LVD2001 DVD player using the Sigma Designs EM8500</a>
</li><li><a href="http://www.rimax.net/">Rimax DVD players using the Sigma Designs EM8500</a>
</li><li><a href="http://www.vinc.us/">Bravo DVD players using the Sigma Designs EM8500</a>
</li><li>Undoubtedly there are others... Please report them so we can shame them (or if necessary sue them) into compliance.
</ul>
<!--#include file="footer.html" -->
+7 -7
View File
@@ -171,7 +171,7 @@ Consult Existing Sources
For a quick listing of "needs work" spots in the sources, cd into the Busybox
directory and run the following:
for i in TODO FIXME XXX; do grep $i *.[ch]; done
for i in TODO FIXME XXX; do find -name '*.[ch]'|xargs grep $i; done
This will show all of the trouble spots or 'questionable' code. Pick a spot,
any spot, these are all invitations for you to contribute.
@@ -199,16 +199,16 @@ Janitorial Work
These are dirty jobs, but somebody's gotta do 'em.
- Converting applets to use getopt() for option processing. Type 'grep -L
getopt *.c' to get a listing of the applets that currently don't use
getopt. If a .c file processes no options, it should have a line that
- Converting applets to use getopt() for option processing. Type 'find -name
'*.c'|grep -L getopt' to get a listing of the applets that currently don't
use getopt. If a .c file processes no options, it should have a line that
reads: /* no options, no getopt */ somewhere in the file.
- Replace any "naked" calls to malloc, calloc, realloc, str[n]dup, fopen with
the x* equivalents found in utility.c.
the x* equivalents found in libbb/xfuncs.c.
- Security audits:
http://www.securityfocus.com/frames/?content=/forums/secprog/secure-programming.html
http://www.securityfocus.com/popups/forums/secprog/intro.shtml
- Synthetic code removal: http://www.perl.com/pub/2000/06/commify.html - This
is very Perl-specific, but the advice given in here applies equally well to
@@ -231,7 +231,7 @@ These are dirty jobs, but somebody's gotta do 'em.
- "Ten Commandments" compliance: (this is a "maybe", certainly not as
important as any of the previous items.)
http://web.onetelnet.ch/~twolf/tw/c/ten_commandments.html
http://www.lysator.liu.se/c/ten-commandments.html
Other useful links:
+20 -11
View File
@@ -14,8 +14,9 @@ Initial Write
First, write your applet. Be sure to include copyright information at the
top, such as who you stole the code from and so forth. Also include the
mini-GPL boilerplate. Be sure to name the main function <applet>_main instead
of main. And be sure to put it in <applet>.c. For a new applet mu, here is
the code that would go in mu.c:
of main. And be sure to put it in <applet>.c. Usage do not have to be taken care of by your applet.
For a new applet mu, here is the code that would go in mu.c:
----begin example code------
@@ -86,13 +87,20 @@ Placement / Directory
Find the appropriate directory for your new applet.
Add the applet to the applet directory Makefile:
Make sure you find the appropriate places in the files, the applets are
sorted alphabetically.
Add the applet to Makefile.in in the chosen applet directory:
obj-$(CONFIG_MU) += mu.o
Add the applet to the applet directory config.in:
Add the applet to Config.in in the chosen applet directory:
bool 'mu' CONFIG_MU
config CONFIG_MU
bool "MU"
default n
help
Returns an indeterminate value.
Usage String(s)
@@ -129,9 +137,9 @@ algorithm in busybox.c and the Gods of BusyBox smite you. Yea, verily:
/* all programs below here are alphabetically "greater than" 'mu' */
Finally, add a define for your applet to Config.h:
Finally, add a define for your applet to include/config.h
#define CONFIG_MU
#undef CONFIG_MU
Documentation
@@ -146,9 +154,10 @@ Adding some text to docs/Configure.help is a nice start.
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@busybox.net. Sending patches as attachments is preferred, but
not required.
Then create a diff -urN of the files you added (<appletdir/><applet>.c,
include/usage.c, include/applets.h, include/config.h, <appletdir>/Makefile.in, <appletdir>/config.in)
and send it to the mailing list:
busybox@busybox.net.
Sending patches as attachments is preferred, but not required.
+1 -10
View File
@@ -24,7 +24,7 @@ config CONFIG_PATCH
bool "patch"
default n
help
Apply a unified diff formated patch.
Apply a unified diff formatted patch.
config CONFIG_SED
bool "sed"
@@ -33,15 +33,6 @@ config CONFIG_SED
sed is used to perform text transformations on a file
or input from a pipeline.
config CONFIG_FEATURE_SED_EMBEDED_NEWLINE
bool " Embeded newline (EXPERIMENTAL)"
default n
depends on CONFIG_SED
help
This is a hack to allow matching of '\n' in regular expressions.
It works by translating '\n' to "\n" and back.
It may introduce unexpected results if you use "\n" in your text.
config CONFIG_VI
bool "vi"
default n
+28 -12
View File
@@ -82,6 +82,7 @@ typedef struct func_s {
typedef struct rstream_s {
FILE *F;
char *buffer;
int adv;
int size;
int pos;
unsigned short is_pipe;
@@ -426,6 +427,7 @@ static nvblock *cb = NULL;
static char *pos;
static char *buf;
static int icase = FALSE;
static int exiting = FALSE;
static struct {
unsigned long tclass;
@@ -464,7 +466,7 @@ static const char EMSG_NO_MATH[] = "Math support is not compiled in";
static void syntax_error(const char * const message)
{
bb_error_msg("%s:%i: %s", programname, lineno, message);
awk_exit(1);
exit(1);
}
#define runtime_error(x) syntax_error(x)
@@ -1634,21 +1636,24 @@ static int awk_getline(rstream *rsm, var *v) {
char *b;
regmatch_t pmatch[2];
int p, pp=0, size;
int a, p, pp=0, size;
int fd, so, eo, r, rp;
char c, *s;
char c, *m, *s;
/* we're using our own buffer since we need access to accumulating
* characters
*/
fd = fileno(rsm->F);
b = rsm->buffer;
m = rsm->buffer;
a = rsm->adv;
p = rsm->pos;
size = rsm->size;
c = (char) rsplitter.n.info;
rp = 0;
if (! m) qrealloc(&m, 256, &size);
do {
qrealloc(&b, p+128, &size);
b = m + a;
so = eo = p;
r = 1;
if (p > 0) {
@@ -1680,6 +1685,14 @@ static int awk_getline(rstream *rsm, var *v) {
}
}
if (a > 0) {
memmove(m, (const void *)(m+a), p+1);
b = m;
a = 0;
}
qrealloc(&m, a+p+128, &size);
b = m + a;
pp = p;
p += safe_read(fd, b+p, size-p-1);
if (p < pp) {
@@ -1703,11 +1716,9 @@ static int awk_getline(rstream *rsm, var *v) {
b[eo] = c;
}
p -= eo;
if (p) memmove(b, (const void *)(b+eo), p+1);
rsm->buffer = b;
rsm->pos = p;
rsm->buffer = m;
rsm->adv = a + eo;
rsm->pos = p - eo;
rsm->size = size;
return r;
@@ -2534,6 +2545,12 @@ static int awk_exit(int r) {
unsigned int i;
hash_item *hi;
static var tv;
if (! exiting) {
exiting = TRUE;
evaluate(endseq.first, &tv);
}
/* waiting for children */
for (i=0; i<fdhash->csize; i++) {
@@ -2581,7 +2598,7 @@ static rstream *next_input_file(void) {
if (rsm.F) fclose(rsm.F);
rsm.F = NULL;
rsm.pos = 0;
rsm.pos = rsm.adv = 0;
do {
if (getvar_i(V[ARGIND])+1 >= getvar_i(V[ARGC])) {
@@ -2733,7 +2750,6 @@ extern int awk_main(int argc, char **argv) {
}
evaluate(endseq.first, &tv);
awk_exit(EXIT_SUCCESS);
return 0;
+738 -780
View File
File diff suppressed because it is too large. Load diff
+9 -27
View File
@@ -19,7 +19,7 @@
*/
static const char vi_Version[] =
"$Id: vi.c,v 1.28 2003/03/19 09:11:45 mjn3 Exp $";
"$Id: vi.c,v 1.29 2003/09/15 08:33:36 andersen Exp $";
/*
* To compile for standalone use:
@@ -197,9 +197,6 @@ static jmp_buf restart; // catch_sig()
#if defined(CONFIG_FEATURE_VI_USE_SIGNALS) || defined(CONFIG_FEATURE_VI_CRASHME)
static int my_pid;
#endif
#ifdef CONFIG_FEATURE_VI_WIN_RESIZE
static struct winsize winsize; // remember the window size
#endif /* CONFIG_FEATURE_VI_WIN_RESIZE */
#ifdef CONFIG_FEATURE_VI_DOT_CMD
static int adding2q; // are we currently adding user input to q
static Byte *last_modifying_cmd; // last modifying cmd for "."
@@ -412,6 +409,14 @@ extern int vi_main(int argc, char **argv)
return (0);
}
#ifdef CONFIG_FEATURE_VI_WIN_RESIZE
//----- See what the window size currently is --------------------
static inline void window_size_get(int fd)
{
get_terminal_width_height(fd, &columns, &rows);
}
#endif /* CONFIG_FEATURE_VI_WIN_RESIZE */
static void edit_file(Byte * fn)
{
Byte c;
@@ -2122,29 +2127,6 @@ static void cookmode(void)
tcsetattr(0, TCSANOW, &term_orig);
}
#ifdef CONFIG_FEATURE_VI_WIN_RESIZE
//----- See what the window size currently is --------------------
static void window_size_get(int sig)
{
int i;
i = ioctl(0, TIOCGWINSZ, &winsize);
if (i != 0) {
// force 24x80
winsize.ws_row = 24;
winsize.ws_col = 80;
}
if (winsize.ws_row <= 1) {
winsize.ws_row = 24;
}
if (winsize.ws_col <= 1) {
winsize.ws_col = 80;
}
rows = (int) winsize.ws_row;
columns = (int) winsize.ws_col;
}
#endif /* CONFIG_FEATURE_VI_WIN_RESIZE */
//----- Come here when we get a window resize signal ---------
#ifdef CONFIG_FEATURE_VI_USE_SIGNALS
static void winch_sig(int sig)
+133
View File
@@ -0,0 +1,133 @@
# Sample /etc/devfsd.conf configuration file.
# Richard Gooch <rgooch@atnf.csiro.au> 17-FEB-2002
#
# adapted for busybox devfsd implementation by Tito <farmatito@tiscali.it>
#
# Enable full compatibility mode for old device names. You may comment these
# out if you don't use the old device names. Make sure you know what you're
# doing!
REGISTER .* MKOLDCOMPAT
UNREGISTER .* RMOLDCOMPAT
# You may comment out the above and uncomment the following if you've
# configured your system to use the original "new" devfs names or the really
# new names
#REGISTER ^vc/ MKOLDCOMPAT
#UNREGISTER ^vc/ RMOLDCOMPAT
#REGISTER ^pty/ MKOLDCOMPAT
#UNREGISTER ^pty/ RMOLDCOMPAT
#REGISTER ^misc/ MKOLDCOMPAT
#UNREGISTER ^misc/ RMOLDCOMPAT
# You may comment these out if you don't use the original "new" names
REGISTER .* MKNEWCOMPAT
UNREGISTER .* RMNEWCOMPAT
# Enable module autoloading. You may comment this out if you don't use
# autoloading
# Supported by busybox when CONFIG_DEVFSD_MODLOAD is set.
# This actually doesn't work with busybox modutils but needs
# the real modutils' modprobe
LOOKUP .* MODLOAD
# Uncomment the following if you want to set the group to "tty" for the
# pseudo-tty devices. This is necessary so that mesg(1) can later be used to
# enable/disable talk requests and wall(1) messages.
REGISTER ^pty/s.* PERMISSIONS -1.tty 0600
#REGISTER ^pts/.* PERMISSIONS -1.tty 0600
# Restoring /dev/log on startup would trigger the minilogd/initlog deadlock
# (minilogd falsely assuming syslogd has been started).
REGISTER ^log$ IGNORE
CREATE ^log$ IGNORE
CHANGE ^log$ IGNORE
DELETE ^log$ IGNORE
#
# Uncomment this if you want permissions to be saved and restored
# Do not do this for pseudo-terminal devices
REGISTER ^pt[sy] IGNORE
CREATE ^pt[sy] IGNORE
CHANGE ^pt[sy] IGNORE
DELETE ^pt[sy] IGNORE
REGISTER .* COPY /lib/dev-state/$devname $devpath
CREATE .* COPY $devpath /lib/dev-state/$devname
CHANGE .* COPY $devpath /lib/dev-state/$devname
#DELETE .* CFUNCTION GLOBAL unlink /lib/dev-state/$devname
# Busybox
DELETE .* EXECUTE /bin/rm -f /lib/dev-state/$devname
RESTORE /lib/dev-state
#
# Uncomment this if you want the old /dev/cdrom symlink
#REGISTER ^cdroms/cdrom0$ CFUNCTION GLOBAL mksymlink $devname cdrom
#UNREGISTER ^cdroms/cdrom0$ CFUNCTION GLOBAL unlink cdrom
# busybox
REGISTER ^cdroms/cdrom0$ EXECUTE /bin/ln -sf $devname cdrom
UNREGISTER ^cdroms/cdrom0$ EXECUTE /bin/rm -f cdrom
#REGISTER ^v4l/video0$ CFUNCTION GLOBAL mksymlink v4l/video0 video
#UNREGISTER ^v4l/video0$ CFUNCTION GLOBAL unlink video
#REGISTER ^radio0$ CFUNCTION GLOBAL mksymlink radio0 radio
#UNREGISTER ^radio0$ CFUNCTION GLOBAL unlink radio
# Busybox
REGISTER ^v4l/video0$ EXECUTE /bin/ln -sf v4l/video0 video
UNREGISTER ^v4l/video0$ EXECUTE /bin/rm -f video
REGISTER ^radio0$ EXECUTE /bin/ln -sf radio0 radio
UNREGISTER ^radio0$ EXECUTE /bin/rm -f radio
# ALSA stuff
#LOOKUP snd MODLOAD ACTION snd
# Uncomment this to let PAM manage devfs
# Not supported by busybox
#REGISTER .* CFUNCTION /lib/security/pam_console_apply_devfsd.so pam_console_apply_single $devpath
# Uncomment this to manage USB mouse
# Not supported by busybox
#REGISTER ^input/mouse0$ CFUNCTION GLOBAL mksymlink $devname usbmouse
#UNREGISTER ^input/mouse0$ CFUNCTION GLOBAL unlink usbmouse
# Busybox
#REGISTER ^input/mouse0$ EXECUTE /bin/ln -sf $devname usbmouse
#UNREGISTER ^input/mouse0$ EXECUTE /bin/rm -f usbmouse
# Not supported by busybox
#REGISTER ^input/mice$ CFUNCTION GLOBAL mksymlink $devname usbmouse
#UNREGISTER ^input/mice$ CFUNCTION GLOBAL unlink usbmouse
# Busybox
REGISTER ^input/mice$ EXECUTE /bin/ln -sf $devname usbmouse
UNREGISTER ^input/mice$ EXECUTE /bin/rm -f usbmouse
# If you have removable media and want to force media revalidation when looking
# up new or old compatibility names, uncomment the following lines
# SCSI NEWCOMPAT /dev/sd/* names
LOOKUP ^(sd/c[0-9]+b[0-9]+t[0-9]+u[0-9]+)p[0-9]+$ EXECUTE /bin/dd if=$mntpnt/\1 of=/dev/null count=1
# SCSI OLDCOMPAT /dev/sd?? names
LOOKUP ^(sd[a-z]+)[0-9]+$ EXECUTE /bin/dd if=$mntpnt/\1 of=/dev/null count=1
# IDE NEWCOMPAT /dev/ide/hd/* names
LOOKUP ^(ide/hd/c[0-9]+b[0-9]+t[0-9]+u[0-9]+)p[0-9]+$ EXECUTE /bin/dd if=$mntpnt/\1 of=/dev/null count=1
# IDE OLDCOMPAT /dev/hd?? names
LOOKUP ^(hd[a-z])[0-9]+$ EXECUTE /bin/dd if=$mntpnt/\1 of=/dev/null count=1
# IDE-SCSI NEWCOMPAT /dev/sd/* names
#LOOKUP ^(sd/c[0-9]+b[0-9]+t[0-9]+u[0-9]+)p[0-9]+$ EXECUTE /bin/dd if=$mntpnt/\1 of=/dev/null count=1
#SCSI OLDCOMPAT /dev/scd? names
LOOKUP ^(scd+)[0-9]+$ EXECUTE /bin/dd if=$mntpnt/\1 of=/dev/null count=1
REGISTER ^dvb/card[0-9]+/[^/]+$ PERMISSIONS root.video 0660
# Not supported by busybox
#REGISTER ^dvb/card([0-9]+)/([^/0-9]*)[0-9]+$ CFUNCTION GLOBAL mksymlink /dev/$devname ost/\2\1
#UNREGISTER ^dvb/card([0-9]+)/([^/0-9]*)[0-9]+$ CFUNCTION GLOBAL unlink ost/\2\1
# Busybox
REGISTER ^dvb/card([0-9]+)/([^/0-9]*)[0-9]+$ EXECUTE /bin/ln -sf /dev/$devname ost/\2\1
UNREGISTER ^dvb/card([0-9]+)/([^/0-9]*)[0-9]+$ EXECUTE /bin/rm -f ost/\2\1
# Include package-generated files from /etc/devfs/conf.d
# Supported by busybox
# INCLUDE /etc/devfs/conf.d/
INCLUDE /etc/devfs/busybox/
# Busybox: just for testing
#INCLUDE /etc/devfs/nothing/
#INCLUDE /etc/devfs/nothing/nothing
#OPTIONAL_INCLUDE /etc/devfs/nothing/
#OPTIONAL_INCLUDE /etc/devfs/nothing/nothing
+36 -4
View File
@@ -39,7 +39,7 @@ config CONFIG_FEATURE_FIND_XDEV
default y
depends on CONFIG_FIND
help
This option will restrict find to a single
This option will allow find to restrict searches to a single
filesystem.
config CONFIG_FEATURE_FIND_NEWER
@@ -55,7 +55,7 @@ config CONFIG_FEATURE_FIND_INUM
default y
depends on CONFIG_FIND
help
Support the 'fine -inum' option for searching by inode number.
Support the 'find -inum' option for searching by inode number.
config CONFIG_GREP
bool "grep"
@@ -77,7 +77,7 @@ config CONFIG_FEATURE_GREP_FGREP_ALIAS
default y
depends on CONFIG_GREP
help
fgrep sees the search pattern as a normal sting rather than
fgrep sees the search pattern as a normal string rather than
regular expressions.
grep -f is always builtin, this just creates the fgrep alias.
@@ -97,5 +97,37 @@ config CONFIG_XARGS
xargs is used to execute a specified command on
every item from standard input.
endmenu
config CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION
bool " Enable prompt and confirmation option -p"
default n
depends on CONFIG_XARGS
help
Support prompt the user about whether to run each command
line and read a line from the terminal.
config CONFIG_FEATURE_XARGS_SUPPORT_QUOTES
bool " Enable support single and double quotes and backslash"
default n
depends on CONFIG_XARGS
help
Default xargs unsupport single and double quotes
and backslash for can use aruments with spaces.
config CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT
bool " Enable support options -x"
default n
depends on CONFIG_XARGS
help
Enable support exit if the size (see the -s or -n option)
is exceeded.
config CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM
bool " Enable options -0"
default n
depends on CONFIG_XARGS
help
Enable input filenames are terminated by a null character
instead of by whitespace, and the quotes and backslash
are not special.
endmenu
+515 -44
View File
@@ -1,10 +1,13 @@
/*
* Mini xargs implementation for busybox
* Only "-prt" options are supported in this version of xargs.
* Options are supported: "-prtx -n max_arg -s max_chars -e[ouf_str]"
*
* (C) 2002 by Vladimir Oleynik <dzo@simtreas.ru>
* (C) 2002,2003 by Vladimir Oleynik <dzo@simtreas.ru>
*
* Special thanks Mark Whitley for stimul to rewrote :)
* Special thanks
* - Mark Whitley and Glenn McGrath for stimul to rewrote :)
* - Mike Rendell <michael@cs.mun.ca>
* and David MacKenzie <djm@gnu.ai.mit.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
@@ -20,40 +23,91 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* xargs is described in the Single Unix Specification v3 at
* http://www.opengroup.org/onlinepubs/007904975/utilities/xargs.html
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <getopt.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/wait.h>
#include "busybox.h"
/* COMPAT: SYSV version defaults size (and has a max value of) to 470.
We try to make it as large as possible. */
#if !defined(ARG_MAX) && defined(_SC_ARG_MAX)
#define ARG_MAX sysconf (_SC_ARG_MAX)
#endif
#ifndef ARG_MAX
#define ARG_MAX 470
#endif
#ifdef TEST
# ifndef CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION
# define CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION
# endif
# ifndef CONFIG_FEATURE_XARGS_SUPPORT_QUOTES
# define CONFIG_FEATURE_XARGS_SUPPORT_QUOTES
# endif
# ifndef CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT
# define CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT
# endif
# ifndef CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM
# define CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM
# endif
#endif
/*
This function have special algorithm.
Don`t use fork and include to main!
*/
static void xargs_exec(char * const * args)
static int xargs_exec(char *const *args)
{
int p;
int common[4]; /* shared vfork stack */
pid_t p;
volatile int exec_errno = 0; /* shared vfork stack */
common[0] = 0;
if ((p = vfork()) >= 0) {
if (p == 0) {
/* vfork -- child */
execvp(args[0], args);
common[0] = errno; /* set error to shared stack */
exec_errno = errno; /* set error to shared stack */
_exit(1);
} else {
/* vfork -- parent */
wait(NULL);
if(common[0]) {
errno = common[0];
bb_perror_msg_and_die("%s", args[0]);
int status;
while (wait(&status) == (pid_t) - 1)
if (errno != EINTR)
break;
if (exec_errno) {
errno = exec_errno;
bb_perror_msg("%s", args[0]);
return exec_errno == ENOENT ? 127 : 126;
} else {
if (WEXITSTATUS(status) == 255) {
bb_error_msg("%s: exited with status 255; aborting", args[0]);
return 124;
}
if (WIFSTOPPED(status)) {
bb_error_msg("%s: stopped by signal %d",
args[0], WSTOPSIG(status));
return 125;
}
if (WIFSIGNALED(status)) {
bb_error_msg("%s: terminated by signal %d",
args[0], WTERMSIG(status));
return 125;
}
if (WEXITSTATUS(status) != 0)
return 123;
return 0;
}
}
} else {
@@ -61,55 +115,472 @@ static void xargs_exec(char * const * args)
}
}
typedef struct xlist_s {
char *data;
size_t lenght;
struct xlist_s *link;
} xlist_t;
static int eof_stdin_detected;
#define ISBLANK(c) ((c) == ' ' || (c) == '\t')
#define ISSPACE(c) (ISBLANK (c) || (c) == '\n' || (c) == '\r' \
|| (c) == '\f' || (c) == '\v')
#ifdef CONFIG_FEATURE_XARGS_SUPPORT_QUOTES
static xlist_t *process_stdin(xlist_t * list_arg,
const char *eof_str, size_t mc, char *buf)
{
#define NORM 0
#define QUOTE 1
#define BACKSLASH 2
#define SPACE 4
char *s = NULL; /* start word */
char *p = NULL; /* pointer to end word */
char q = 0; /* quote char */
char state = NORM;
char eof_str_detected = 0;
size_t line_l = 0; /* size loaded args line */
int c; /* current char */
xlist_t *cur;
xlist_t *prev;
for (prev = cur = list_arg; cur; cur = cur->link) {
line_l += cur->lenght; /* previous allocated */
if (prev != cur)
prev = prev->link;
}
while (!eof_stdin_detected) {
c = getchar();
if (c == EOF) {
eof_stdin_detected++;
if (s)
goto unexpected_eof;
break;
}
if (eof_str_detected)
continue;
if (state == BACKSLASH) {
state = NORM;
goto set;
} else if (state == QUOTE) {
if (c == q) {
q = 0;
state = NORM;
} else {
goto set;
}
} else { /* if(state == NORM) */
if (ISSPACE(c)) {
if (s) {
unexpected_eof:
state = SPACE;
c = 0;
goto set;
}
} else {
if (s == NULL)
s = p = buf;
if (c == '\\') {
state = BACKSLASH;
} else if (c == '\'' || c == '"') {
q = c;
state = QUOTE;
} else {
set:
if ((p - buf) >= mc)
bb_error_msg_and_die("argument line too long");
*p++ = c;
}
}
}
if (state == SPACE) { /* word's delimiter or EOF detected */
if (q) {
bb_error_msg_and_die("unmatched %s quote",
q == '\'' ? "single" : "double");
}
/* word loaded */
if (eof_str) {
eof_str_detected = strcmp(s, eof_str) == 0;
}
if (!eof_str_detected) {
size_t lenght = (p - buf);
cur = xmalloc(sizeof(xlist_t) + lenght);
cur->data = memcpy(cur + 1, s, lenght);
cur->lenght = lenght;
cur->link = NULL;
if (prev == NULL) {
list_arg = cur;
} else {
prev->link = cur;
}
prev = cur;
line_l += lenght;
if (line_l > mc) {
/* stop memory usage :-) */
break;
}
}
s = NULL;
state = NORM;
}
}
return list_arg;
}
#else
/* The variant does not support single quotes, double quotes or backslash */
static xlist_t *process_stdin(xlist_t * list_arg,
const char *eof_str, size_t mc, char *buf)
{
int c; /* current char */
int eof_str_detected = 0;
char *s = NULL; /* start word */
char *p = NULL; /* pointer to end word */
size_t line_l = 0; /* size loaded args line */
xlist_t *cur;
xlist_t *prev;
for (prev = cur = list_arg; cur; cur = cur->link) {
line_l += cur->lenght; /* previous allocated */
if (prev != cur)
prev = prev->link;
}
while (!eof_stdin_detected) {
c = getchar();
if (c == EOF) {
eof_stdin_detected++;
}
if (eof_str_detected)
continue;
if (c == EOF || ISSPACE(c)) {
if (s == NULL)
continue;
c = EOF;
}
if (s == NULL)
s = p = buf;
if ((p - buf) >= mc)
bb_error_msg_and_die("argument line too long");
*p++ = c == EOF ? 0 : c;
if (c == EOF) { /* word's delimiter or EOF detected */
/* word loaded */
if (eof_str) {
eof_str_detected = strcmp(s, eof_str) == 0;
}
if (!eof_str_detected) {
size_t lenght = (p - buf);
cur = xmalloc(sizeof(xlist_t) + lenght);
cur->data = memcpy(cur + 1, s, lenght);
cur->lenght = lenght;
cur->link = NULL;
if (prev == NULL) {
list_arg = cur;
} else {
prev->link = cur;
}
prev = cur;
line_l += lenght;
if (line_l > mc) {
/* stop memory usage :-) */
break;
}
s = NULL;
}
}
}
return list_arg;
}
#endif /* CONFIG_FEATURE_XARGS_SUPPORT_QUOTES */
#ifdef CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION
/* Prompt the user for a response, and
if the user responds affirmatively, return true;
otherwise, return false. Used "/dev/tty", not stdin. */
static int xargs_ask_confirmation(void)
{
static FILE *tty_stream;
int c, savec;
if (!tty_stream) {
tty_stream = fopen("/dev/tty", "r");
if (!tty_stream)
bb_perror_msg_and_die("/dev/tty");
/* pranoidal security by vodz */
fcntl(fileno(tty_stream), F_SETFD, FD_CLOEXEC);
}
fputs(" ?...", stderr);
fflush(stderr);
c = savec = getc(tty_stream);
while (c != EOF && c != '\n')
c = getc(tty_stream);
if (savec == 'y' || savec == 'Y')
return 1;
return 0;
}
# define OPT_INC_P 1
#else
# define OPT_INC_P 0
# define xargs_ask_confirmation() 1
#endif /* CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION */
#ifdef CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT
# define OPT_INC_X 1
#else
# define OPT_INC_X 0
#endif
#ifdef CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM
static xlist_t *process0_stdin(xlist_t * list_arg, const char *eof_str,
size_t mc, char *buf)
{
int c; /* current char */
char *s = NULL; /* start word */
char *p = NULL; /* pointer to end word */
size_t line_l = 0; /* size loaded args line */
xlist_t *cur;
xlist_t *prev;
for (prev = cur = list_arg; cur; cur = cur->link) {
line_l += cur->lenght; /* previous allocated */
if (prev != cur)
prev = prev->link;
}
while (!eof_stdin_detected) {
c = getchar();
if (c == EOF) {
eof_stdin_detected++;
if (s == NULL)
break;
c = 0;
}
if (s == NULL)
s = p = buf;
if ((p - buf) >= mc)
bb_error_msg_and_die("argument line too long");
*p++ = c;
if (c == 0) { /* word's delimiter or EOF detected */
/* word loaded */
size_t lenght = (p - buf);
cur = xmalloc(sizeof(xlist_t) + lenght);
cur->data = memcpy(cur + 1, s, lenght);
cur->lenght = lenght;
cur->link = NULL;
if (prev == NULL) {
list_arg = cur;
} else {
prev->link = cur;
}
prev = cur;
line_l += lenght;
if (line_l > mc) {
/* stop memory usage :-) */
break;
}
s = NULL;
}
}
return list_arg;
}
# define READ_ARGS(l, e, nmc, mc) (*read_args)(l, e, nmc, mc)
# define OPT_INC_0 1 /* future use */
#else
# define OPT_INC_0 0 /* future use */
# define READ_ARGS(l, e, nmc, mc) process_stdin(l, e, nmc, mc)
#endif /* CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM */
#define OPT_VERBOSE (1<<0)
#define OPT_NO_EMPTY (1<<1)
#define OPT_UPTO_NUMBER (1<<2)
#define OPT_UPTO_SIZE (1<<3)
#define OPT_EOF_STRING (1<<4)
#ifdef CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION
#define OPT_INTERACTIVE (1<<5)
#else
#define OPT_INTERACTIVE (0) /* require for algorithm &| */
#endif
#define OPT_TERMINATE (1<<(5+OPT_INC_P))
#define OPT_ZEROTERM (1<<(5+OPT_INC_P+OPT_INC_X))
/* next future
#define OPT_NEXT_OTHER (1<<(5+OPT_INC_P+OPT_INC_X+OPT_INC_0))
*/
int xargs_main(int argc, char **argv)
{
char *file_to_act_on;
char **args;
int i, a;
char flg_vi; /* verbose |& interactive */
char flg_no_empty;
int i, a, n;
xlist_t *list = NULL;
xlist_t *cur;
int child_error = 0;
char *max_args, *max_chars;
int n_max_arg;
size_t n_chars = 0;
long orig_arg_max;
const char *eof_str = "_";
unsigned long opt;
size_t n_max_chars;
#ifdef CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM
xlist_t *(*read_args) (xlist_t *, const char *, size_t, char *) = process_stdin;
#endif
#ifdef CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION
bb_opt_complementaly = "pt";
a = bb_getopt_ulflags(argc, argv, "tpr");
flg_vi = a & 3;
flg_no_empty = a & 4;
#endif
opt = bb_getopt_ulflags(argc, argv, "+trn:s:e::"
#ifdef CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION
"p"
#endif
#ifdef CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT
"x"
#endif
#ifdef CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM
"0"
#endif
,&max_args, &max_chars, &eof_str);
a = argc - optind;
argv += optind;
if(a==0) {
if (a == 0) {
/* default behavior is to echo all the filenames */
*argv = "/bin/echo";
*argv = "echo";
a++;
}
/* allocating pointers for execvp: a*arg, arg from stdin, NULL */
args = xcalloc(a + 3, sizeof(char *));
/* Store the command to be executed (taken from the command line) */
for (i = 0; i < a; i++)
args[i] = *argv++;
orig_arg_max = ARG_MAX;
if (orig_arg_max == -1)
orig_arg_max = LONG_MAX;
orig_arg_max -= 2048; /* POSIX.2 requires subtracting 2048. */
if ((opt & OPT_UPTO_SIZE)) {
n_max_chars = bb_xgetularg10_bnd(max_chars, 1, orig_arg_max);
for (i = 0; i < a; i++) {
n_chars += strlen(*argv) + 1;
}
if (n_max_chars < n_chars) {
bb_error_msg_and_die("can not fit single argument within argument list size limit");
}
n_max_chars -= n_chars;
} else {
/* Sanity check for systems with huge ARG_MAX defines (e.g., Suns which
have it at 1 meg). Things will work fine with a large ARG_MAX but it
will probably hurt the system more than it needs to; an array of this
size is allocated. */
if (orig_arg_max > 20 * 1024)
orig_arg_max = 20 * 1024;
n_max_chars = orig_arg_max;
}
max_chars = xmalloc(n_max_chars);
/* Now, read in one line at a time from stdin, and store this
* line to be used later as an argument to the command */
while ((file_to_act_on = bb_get_chomped_line_from_file(stdin)) != NULL) {
if(file_to_act_on[0] != 0 || flg_no_empty == 0) {
args[a] = file_to_act_on[0] ? file_to_act_on : NULL;
if(flg_vi) {
for(i=0; args[i]; i++) {
if(i)
fputc(' ', stderr);
fputs(args[i], stderr);
}
fputs(((flg_vi & 2) ? " ?..." : "\n"), stderr);
}
if((flg_vi & 2) == 0 || bb_ask_confirmation() != 0 ) {
xargs_exec(args);
if ((opt & OPT_UPTO_NUMBER)) {
n_max_arg = bb_xgetularg10_bnd(max_args, 1, INT_MAX);
} else {
n_max_arg = n_max_chars;
}
#ifdef CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM
if (opt & OPT_ZEROTERM)
read_args = process0_stdin;
#endif
while ((list = READ_ARGS(list, eof_str, n_max_chars, max_chars)) != NULL ||
(opt & OPT_NO_EMPTY) == 0)
{
opt |= OPT_NO_EMPTY;
n = 0;
n_chars = 0;
#ifdef CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT
for (cur = list; cur;) {
n_chars += cur->lenght;
n++;
cur = cur->link;
if (n_chars > n_max_chars || (n == n_max_arg && cur)) {
if (opt & OPT_TERMINATE)
bb_error_msg_and_die("argument list too long");
break;
}
}
#else
for (cur = list; cur; cur = cur->link) {
n_chars += cur->lenght;
n++;
if (n_chars > n_max_chars || n == n_max_arg) {
break;
}
}
#endif /* CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT */
/* allocating pointers for execvp:
a*arg, n*arg from stdin, NULL */
args = xcalloc(n + a + 1, sizeof(char *));
/* Store the command to be executed
(taken from the command line) */
for (i = 0; i < a; i++)
args[i] = argv[i];
/* (taken from stdin) */
for (cur = list; n; cur = cur->link) {
args[i++] = cur->data;
n--;
}
if ((opt & (OPT_INTERACTIVE | OPT_VERBOSE))) {
for (i = 0; args[i]; i++) {
if (i)
fputc(' ', stderr);
fputs(args[i], stderr);
}
if ((opt & OPT_INTERACTIVE) == 0)
fputc('\n', stderr);
}
if ((opt & OPT_INTERACTIVE) == 0 || xargs_ask_confirmation() != 0) {
child_error = xargs_exec(args);
}
/* clean up */
free(file_to_act_on);
for (i = a; args[i]; i++) {
cur = list;
list = list->link;
free(cur);
}
free(args);
if (child_error > 0 && child_error != 123) {
break;
}
}
#ifdef CONFIG_FEATURE_CLEAN_UP
free(args);
free(max_chars);
#endif
return 0;
return child_error;
}
#ifdef TEST
const char *bb_applet_name = "debug stuff usage";
void bb_show_usage(void)
{
fprintf(stderr, "Usage: %s [-p] [-r] [-t] -[x] [-n max_arg] [-s max_chars]\n",
bb_applet_name);
exit(1);
}
int main(int argc, char **argv)
{
return xargs_main(argc, argv);
}
#endif /* TEST */
+13 -4
View File
@@ -142,6 +142,9 @@
#ifdef CONFIG_DELUSER
APPLET(deluser, deluser_main, _BB_DIR_BIN, _BB_SUID_NEVER)
#endif
#ifdef CONFIG_DEVFSD
APPLET(devfsd, devfsd_main, _BB_DIR_SBIN, _BB_SUID_NEVER)
#endif
#ifdef CONFIG_DF
APPLET(df, df_main, _BB_DIR_BIN, _BB_SUID_NEVER)
#endif
@@ -169,9 +172,6 @@
#ifdef CONFIG_DUMPLEASES
APPLET(dumpleases, dumpleases_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
#endif
#ifdef CONFIG_DUTMP
APPLET(dutmp, dutmp_main, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)
#endif
#ifdef CONFIG_ECHO
APPLET(echo, echo_main, _BB_DIR_BIN, _BB_SUID_NEVER)
#endif
@@ -286,6 +286,9 @@
#ifdef CONFIG_INSMOD
APPLET(insmod, insmod_main, _BB_DIR_SBIN, _BB_SUID_NEVER)
#endif
#ifdef CONFIG_INSTALL
APPLET(install, install_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
#endif
#ifdef CONFIG_IP
APPLET(ip, ip_main, _BB_DIR_BIN, _BB_SUID_NEVER)
#endif
@@ -316,6 +319,9 @@
#ifdef CONFIG_LASH
APPLET(lash, lash_main, _BB_DIR_BIN, _BB_SUID_NEVER)
#endif
#ifdef CONFIG_LAST
APPLET(last, last_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
#endif
#ifdef CONFIG_LENGTH
APPLET(length, length_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
#endif
@@ -392,7 +398,7 @@
APPLET(more, more_main, _BB_DIR_BIN, _BB_SUID_NEVER)
#endif
#ifdef CONFIG_MOUNT
APPLET(mount, mount_main, _BB_DIR_BIN, _BB_SUID_MAYBE)
APPLET(mount, mount_main, _BB_DIR_BIN, _BB_SUID_NEVER)
#endif
#ifdef CONFIG_MSH
APPLET_NOUSAGE("msh", msh_main, _BB_DIR_BIN, _BB_SUID_NEVER)
@@ -442,6 +448,9 @@
#ifdef CONFIG_PING6
APPLET(ping6, ping6_main, _BB_DIR_BIN, _BB_SUID_NEVER)
#endif
#ifdef CONFIG_PIPE_PROGRESS
APPLET_NOUSAGE("pipe_progress", pipe_progress_main, _BB_DIR_BIN, _BB_SUID_NEVER)
#endif
#ifdef CONFIG_PIVOT_ROOT
APPLET(pivot_root, pivot_root_main, _BB_DIR_SBIN, _BB_SUID_NEVER)
#endif
+40 -12
View File
@@ -28,7 +28,9 @@
#include <stdarg.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <regex.h>
#include <termios.h>
#include <stdint.h>
#include <netdb.h>
@@ -52,11 +54,6 @@
# include "sha1.h"
#endif
/* Compatability with ANSI C */
#ifndef inline
# define inline
#endif
/* Convenience macros to test the version of gcc. */
#if defined __GNUC__ && defined __GNUC_MINOR__
# define __GNUC_PREREQ(maj, min) \
@@ -113,8 +110,9 @@ extern int is_directory(const char *name, int followLinks, struct stat *statBuf)
extern int remove_file(const char *path, int flags);
extern int copy_file(const char *source, const char *dest, int flags);
extern ssize_t safe_read(int fd, void *buf, size_t count);
extern ssize_t bb_full_write(int fd, const void *buf, size_t len);
extern ssize_t bb_full_read(int fd, void *buf, size_t len);
extern ssize_t safe_write(int fd, const void *buf, size_t count);
extern ssize_t bb_full_write(int fd, const void *buf, size_t len);
extern int recursive_action(const char *fileName, int recurse,
int followLinks, int depthFirst,
int (*fileAction) (const char *fileName, struct stat* statbuf, void* userData),
@@ -138,7 +136,8 @@ extern long *find_pid_by_name( const char* pidName);
extern char *find_real_root_device_name(const char* name);
extern char *bb_get_line_from_file(FILE *file);
extern char *bb_get_chomped_line_from_file(FILE *file);
extern int bb_copyfd(int fd1, int fd2, const off_t chunksize);
extern int bb_copyfd_size(int fd1, int fd2, const off_t size);
extern int bb_copyfd_eof(int fd1, int fd2);
extern void bb_xprint_and_close_file(FILE *file);
extern int bb_xprint_file_by_name(const char *filename);
extern char bb_process_escape_sequence(const char **ptr);
@@ -272,7 +271,8 @@ enum {
MEGABYTE = (KILOBYTE*1024),
GIGABYTE = (MEGABYTE*1024)
};
const char *make_human_readable_str(unsigned long size, unsigned long block_size, unsigned long display_unit);
const char *make_human_readable_str(unsigned long long size,
unsigned long block_size, unsigned long display_unit);
int bb_ask_confirmation(void);
int klogctl(int type, char * b, int len);
@@ -296,7 +296,9 @@ extern struct hostent *xgethostbyname(const char *name);
extern struct hostent *xgethostbyname2(const char *name, int af);
extern int create_icmp_socket(void);
extern int create_icmp6_socket(void);
extern int xconnect(const char *host, const char *port);
extern int xconnect(struct sockaddr_in *s_addr);
extern int bb_getport(const char *port);
extern void bb_lookup_host(struct sockaddr_in *s_in, const char *host, const char *port);
//#warning wrap this?
char *dirname (char *path);
@@ -336,6 +338,21 @@ extern const char * const bb_path_group_file;
extern const char * const bb_path_securetty_file;
extern const char * const bb_path_motd_file;
/*
* You can change LIBBB_DEFAULT_LOGIN_SHELL, but don`t use,
* use bb_default_login_shell and next defines,
* if you LIBBB_DEFAULT_LOGIN_SHELL change,
* don`t lose change increment constant!
*/
#define LIBBB_DEFAULT_LOGIN_SHELL "-/bin/sh"
extern const char * const bb_default_login_shell;
/* "/bin/sh" */
#define DEFAULT_SHELL (bb_default_login_shell+1)
/* "sh" */
#define DEFAULT_SHELL_SHORT_NAME (bb_default_login_shell+6)
extern const char bb_path_mtab_file[];
extern int bb_default_error_retval;
@@ -361,6 +378,7 @@ extern int bb_default_error_retval;
#endif
# define VC_FORMAT "/dev/vc/%d"
# define LOOP_FORMAT "/dev/loop/%d"
# define FB_0 "/dev/fb/0"
#else
# define CURRENT_VC "/dev/tty0"
# define VC_1 "/dev/tty1"
@@ -379,6 +397,7 @@ extern int bb_default_error_retval;
#endif
# define VC_FORMAT "/dev/tty%d"
# define LOOP_FORMAT "/dev/loop%d"
# define FB_0 "/dev/fb0"
#endif
//#warning put these in .o files
@@ -400,6 +419,7 @@ void bb_xasprintf(char **string_ptr, const char *format, ...) __attribute__ ((fo
#define FAIL_DELAY 3
extern void change_identity ( const struct passwd *pw );
extern const char *change_identity_e2str ( const struct passwd *pw );
extern void run_shell ( const char *shell, int loginshell, const char *command, const char **additional_args
#ifdef CONFIG_SELINUX
, security_id_t sid
@@ -450,9 +470,17 @@ typedef struct llist_s {
} llist_t;
extern llist_t *llist_add_to(llist_t *old_head, char *new_item);
void print_login_issue(const char *issue_file, const char *tty);
void print_login_prompt(void);
extern void print_login_issue(const char *issue_file, const char *tty);
extern void print_login_prompt(void);
void vfork_daemon_rexec(int argc, char **argv, char *foreground_opt);
extern void vfork_daemon_rexec(int argc, char **argv, char *foreground_opt);
extern void get_terminal_width_height(int fd, int *width, int *height);
extern unsigned long get_ug_id(const char *s, long (*my_getxxnam)(const char *));
extern void xregcomp(regex_t *preg, const char *regex, int cflags);
#define HASH_SHA1 1
#define HASH_MD5 2
extern int hash_fd(int fd, const size_t size, const uint8_t hash_algo, uint8_t *hashval);
extern size_t bb_full_fd_action(int src_fd, int dst_fd, const size_t size, ssize_t (*action)(int fd, const void *, size_t));
#endif /* __LIBCONFIG_H__ */
Loaded 100 of 219 files, more files were not shown because too many files have changed in this diff. Show more