diff options
-rw-r--r-- | archival/Config.src | 2 | ||||
-rw-r--r-- | archival/bbunzip.c | 82 | ||||
-rw-r--r-- | archival/lzop.c | 32 |
3 files changed, 81 insertions, 35 deletions
diff --git a/archival/Config.src b/archival/Config.src index a9afaea5b..5e7cfc0a4 100644 --- a/archival/Config.src +++ b/archival/Config.src | |||
@@ -30,7 +30,7 @@ config FEATURE_SEAMLESS_GZ | |||
30 | Make tar, rpm, modprobe etc understand .gz data. | 30 | Make tar, rpm, modprobe etc understand .gz data. |
31 | 31 | ||
32 | config FEATURE_SEAMLESS_Z | 32 | config FEATURE_SEAMLESS_Z |
33 | bool "tar, rpm, modprobe etc understand .Z data" | 33 | bool "Make tar, rpm, modprobe etc understand .Z data" |
34 | default n # it is ancient | 34 | default n # it is ancient |
35 | help | 35 | help |
36 | Make tar, rpm, modprobe etc understand .Z data. | 36 | Make tar, rpm, modprobe etc understand .Z data. |
diff --git a/archival/bbunzip.c b/archival/bbunzip.c index 07ef8617e..7d5402e8d 100644 --- a/archival/bbunzip.c +++ b/archival/bbunzip.c | |||
@@ -291,18 +291,24 @@ int uncompress_main(int argc UNUSED_PARAM, char **argv) | |||
291 | //config: You can use the `-t' option to test the integrity of | 291 | //config: You can use the `-t' option to test the integrity of |
292 | //config: an archive, without decompressing it. | 292 | //config: an archive, without decompressing it. |
293 | //config: | 293 | //config: |
294 | //config:config ZCAT | ||
295 | //config: bool "zcat" | ||
296 | //config: default y | ||
297 | //config: help | ||
298 | //config: Alias to "gunzip -c". | ||
299 | //config: | ||
294 | //config:config FEATURE_GUNZIP_LONG_OPTIONS | 300 | //config:config FEATURE_GUNZIP_LONG_OPTIONS |
295 | //config: bool "Enable long options" | 301 | //config: bool "Enable long options" |
296 | //config: default y | 302 | //config: default y |
297 | //config: depends on GUNZIP && LONG_OPTS | 303 | //config: depends on (GUNZIP || ZCAT) && LONG_OPTS |
298 | //config: help | 304 | //config: help |
299 | //config: Enable use of long options. | 305 | //config: Enable use of long options. |
300 | 306 | ||
301 | //applet:IF_GUNZIP(APPLET(gunzip, BB_DIR_BIN, BB_SUID_DROP)) | 307 | //applet:IF_GUNZIP(APPLET(gunzip, BB_DIR_BIN, BB_SUID_DROP)) |
302 | //applet:IF_GUNZIP(APPLET_ODDNAME(zcat, gunzip, BB_DIR_BIN, BB_SUID_DROP, zcat)) | 308 | //applet:IF_ZCAT(APPLET_ODDNAME(zcat, gunzip, BB_DIR_BIN, BB_SUID_DROP, zcat)) |
303 | //kbuild:lib-$(CONFIG_GZIP) += bbunzip.o | ||
304 | //kbuild:lib-$(CONFIG_GUNZIP) += bbunzip.o | 309 | //kbuild:lib-$(CONFIG_GUNZIP) += bbunzip.o |
305 | #if ENABLE_GUNZIP | 310 | //kbuild:lib-$(CONFIG_ZCAT) += bbunzip.o |
311 | #if ENABLE_GUNZIP || ENABLE_ZCAT | ||
306 | static | 312 | static |
307 | char* FAST_FUNC make_new_name_gunzip(char *filename, const char *expected_ext UNUSED_PARAM) | 313 | char* FAST_FUNC make_new_name_gunzip(char *filename, const char *expected_ext UNUSED_PARAM) |
308 | { | 314 | { |
@@ -365,7 +371,7 @@ int gunzip_main(int argc UNUSED_PARAM, char **argv) | |||
365 | * Normally, "zcat" is just "gunzip -c". | 371 | * Normally, "zcat" is just "gunzip -c". |
366 | * But if seamless magic is enabled, then we are much more clever. | 372 | * But if seamless magic is enabled, then we are much more clever. |
367 | */ | 373 | */ |
368 | if (applet_name[1] == 'c') | 374 | if (ENABLE_ZCAT && applet_name[1] == 'c') |
369 | option_mask32 |= OPT_STDOUT | SEAMLESS_MAGIC; | 375 | option_mask32 |= OPT_STDOUT | SEAMLESS_MAGIC; |
370 | 376 | ||
371 | return bbunpack(argv, unpack_gz_stream, make_new_name_gunzip, /*unused:*/ NULL); | 377 | return bbunpack(argv, unpack_gz_stream, make_new_name_gunzip, /*unused:*/ NULL); |
@@ -402,18 +408,24 @@ int gunzip_main(int argc UNUSED_PARAM, char **argv) | |||
402 | //config: | 408 | //config: |
403 | //config: Unless you have a specific application which requires bunzip2, you | 409 | //config: Unless you have a specific application which requires bunzip2, you |
404 | //config: should probably say N here. | 410 | //config: should probably say N here. |
411 | //config: | ||
412 | //config:config BZCAT | ||
413 | //config: bool "bzcat" | ||
414 | //config: default y | ||
415 | //config: help | ||
416 | //config: Alias to "bunzip2 -c". | ||
405 | 417 | ||
406 | //applet:IF_BUNZIP2(APPLET(bunzip2, BB_DIR_USR_BIN, BB_SUID_DROP)) | 418 | //applet:IF_BUNZIP2(APPLET(bunzip2, BB_DIR_USR_BIN, BB_SUID_DROP)) |
407 | //applet:IF_BUNZIP2(APPLET_ODDNAME(bzcat, bunzip2, BB_DIR_USR_BIN, BB_SUID_DROP, bzcat)) | 419 | //applet:IF_BZCAT(APPLET_ODDNAME(bzcat, bunzip2, BB_DIR_USR_BIN, BB_SUID_DROP, bzcat)) |
408 | //kbuild:lib-$(CONFIG_BZIP2) += bbunzip.o | ||
409 | //kbuild:lib-$(CONFIG_BUNZIP2) += bbunzip.o | 420 | //kbuild:lib-$(CONFIG_BUNZIP2) += bbunzip.o |
410 | #if ENABLE_BUNZIP2 | 421 | //kbuild:lib-$(CONFIG_BZCAT) += bbunzip.o |
422 | #if ENABLE_BUNZIP2 || ENABLE_BZCAT | ||
411 | int bunzip2_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 423 | int bunzip2_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
412 | int bunzip2_main(int argc UNUSED_PARAM, char **argv) | 424 | int bunzip2_main(int argc UNUSED_PARAM, char **argv) |
413 | { | 425 | { |
414 | getopt32(argv, "cfvqdt"); | 426 | getopt32(argv, "cfvqdt"); |
415 | argv += optind; | 427 | argv += optind; |
416 | if (applet_name[2] == 'c') /* bzcat */ | 428 | if (ENABLE_BZCAT && applet_name[2] == 'c') /* bzcat */ |
417 | option_mask32 |= OPT_STDOUT; | 429 | option_mask32 |= OPT_STDOUT; |
418 | 430 | ||
419 | return bbunpack(argv, unpack_bz2_stream, make_new_name_generic, "bz2"); | 431 | return bbunpack(argv, unpack_bz2_stream, make_new_name_generic, "bz2"); |
@@ -481,27 +493,40 @@ int bunzip2_main(int argc UNUSED_PARAM, char **argv) | |||
481 | //config: The BusyBox unlzma applet is limited to decompression only. | 493 | //config: The BusyBox unlzma applet is limited to decompression only. |
482 | //config: On an x86 system, this applet adds about 4K. | 494 | //config: On an x86 system, this applet adds about 4K. |
483 | //config: | 495 | //config: |
484 | //config:config FEATURE_LZMA_FAST | 496 | //config:config LZCAT |
485 | //config: bool "Optimize unlzma for speed" | 497 | //config: bool "lzcat" |
486 | //config: default n | 498 | //config: default y |
487 | //config: depends on UNLZMA | ||
488 | //config: help | 499 | //config: help |
489 | //config: This option reduces decompression time by about 25% at the cost of | 500 | //config: unlzma is a compression utility using the Lempel-Ziv-Markov chain |
490 | //config: a 1K bigger binary. | 501 | //config: compression algorithm, and range coding. Compression |
502 | //config: is generally considerably better than that achieved by the bzip2 | ||
503 | //config: compressors. | ||
504 | //config: | ||
505 | //config: The BusyBox unlzma applet is limited to decompression only. | ||
506 | //config: On an x86 system, this applet adds about 4K. | ||
491 | //config: | 507 | //config: |
492 | //config:config LZMA | 508 | //config:config LZMA |
493 | //config: bool "Provide lzma alias which supports only unpacking" | 509 | //config: bool "lzma -d" |
494 | //config: default y | 510 | //config: default y |
495 | //config: depends on UNLZMA | ||
496 | //config: help | 511 | //config: help |
497 | //config: Enable this option if you want commands like "lzma -d" to work. | 512 | //config: Enable this option if you want commands like "lzma -d" to work. |
498 | //config: IOW: you'll get lzma applet, but it will always require -d option. | 513 | //config: IOW: you'll get lzma applet, but it will always require -d option. |
514 | //config: | ||
515 | //config:config FEATURE_LZMA_FAST | ||
516 | //config: bool "Optimize unlzma for speed" | ||
517 | //config: default n | ||
518 | //config: depends on UNLZMA || LZCAT || LZMA | ||
519 | //config: help | ||
520 | //config: This option reduces decompression time by about 25% at the cost of | ||
521 | //config: a 1K bigger binary. | ||
499 | 522 | ||
500 | //applet:IF_UNLZMA(APPLET(unlzma, BB_DIR_USR_BIN, BB_SUID_DROP)) | 523 | //applet:IF_UNLZMA(APPLET(unlzma, BB_DIR_USR_BIN, BB_SUID_DROP)) |
501 | //applet:IF_UNLZMA(APPLET_ODDNAME(lzcat, unlzma, BB_DIR_USR_BIN, BB_SUID_DROP, lzcat)) | 524 | //applet:IF_LZCAT(APPLET_ODDNAME(lzcat, unlzma, BB_DIR_USR_BIN, BB_SUID_DROP, lzcat)) |
502 | //applet:IF_LZMA(APPLET_ODDNAME(lzma, unlzma, BB_DIR_USR_BIN, BB_SUID_DROP, lzma)) | 525 | //applet:IF_LZMA(APPLET_ODDNAME(lzma, unlzma, BB_DIR_USR_BIN, BB_SUID_DROP, lzma)) |
503 | //kbuild:lib-$(CONFIG_UNLZMA) += bbunzip.o | 526 | //kbuild:lib-$(CONFIG_UNLZMA) += bbunzip.o |
504 | #if ENABLE_UNLZMA | 527 | //kbuild:lib-$(CONFIG_LZCAT) += bbunzip.o |
528 | //kbuild:lib-$(CONFIG_LZMA) += bbunzip.o | ||
529 | #if ENABLE_UNLZMA || ENABLE_LZCAT || ENABLE_LZMA | ||
505 | int unlzma_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 530 | int unlzma_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
506 | int unlzma_main(int argc UNUSED_PARAM, char **argv) | 531 | int unlzma_main(int argc UNUSED_PARAM, char **argv) |
507 | { | 532 | { |
@@ -512,7 +537,7 @@ int unlzma_main(int argc UNUSED_PARAM, char **argv) | |||
512 | bb_show_usage(); | 537 | bb_show_usage(); |
513 | # endif | 538 | # endif |
514 | /* lzcat? */ | 539 | /* lzcat? */ |
515 | if (applet_name[2] == 'c') | 540 | if (ENABLE_LZCAT && applet_name[2] == 'c') |
516 | option_mask32 |= OPT_STDOUT; | 541 | option_mask32 |= OPT_STDOUT; |
517 | 542 | ||
518 | argv += optind; | 543 | argv += optind; |
@@ -527,19 +552,26 @@ int unlzma_main(int argc UNUSED_PARAM, char **argv) | |||
527 | //config: help | 552 | //config: help |
528 | //config: unxz is a unlzma successor. | 553 | //config: unxz is a unlzma successor. |
529 | //config: | 554 | //config: |
555 | //config:config XZCAT | ||
556 | //config: bool "xzcat" | ||
557 | //config: default y | ||
558 | //config: help | ||
559 | //config: Alias to "unxz -c". | ||
560 | //config: | ||
530 | //config:config XZ | 561 | //config:config XZ |
531 | //config: bool "Provide xz alias which supports only unpacking" | 562 | //config: bool "xz -d" |
532 | //config: default y | 563 | //config: default y |
533 | //config: depends on UNXZ | ||
534 | //config: help | 564 | //config: help |
535 | //config: Enable this option if you want commands like "xz -d" to work. | 565 | //config: Enable this option if you want commands like "xz -d" to work. |
536 | //config: IOW: you'll get xz applet, but it will always require -d option. | 566 | //config: IOW: you'll get xz applet, but it will always require -d option. |
537 | 567 | ||
538 | //applet:IF_UNXZ(APPLET(unxz, BB_DIR_USR_BIN, BB_SUID_DROP)) | 568 | //applet:IF_UNXZ(APPLET(unxz, BB_DIR_USR_BIN, BB_SUID_DROP)) |
539 | //applet:IF_UNXZ(APPLET_ODDNAME(xzcat, unxz, BB_DIR_USR_BIN, BB_SUID_DROP, xzcat)) | 569 | //applet:IF_XZCAT(APPLET_ODDNAME(xzcat, unxz, BB_DIR_USR_BIN, BB_SUID_DROP, xzcat)) |
540 | //applet:IF_XZ(APPLET_ODDNAME(xz, unxz, BB_DIR_USR_BIN, BB_SUID_DROP, xz)) | 570 | //applet:IF_XZ(APPLET_ODDNAME(xz, unxz, BB_DIR_USR_BIN, BB_SUID_DROP, xz)) |
541 | //kbuild:lib-$(CONFIG_UNXZ) += bbunzip.o | 571 | //kbuild:lib-$(CONFIG_UNXZ) += bbunzip.o |
542 | #if ENABLE_UNXZ | 572 | //kbuild:lib-$(CONFIG_XZCAT) += bbunzip.o |
573 | //kbuild:lib-$(CONFIG_XZ) += bbunzip.o | ||
574 | #if ENABLE_UNXZ || ENABLE_XZCAT || ENABLE_XZ | ||
543 | int unxz_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 575 | int unxz_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
544 | int unxz_main(int argc UNUSED_PARAM, char **argv) | 576 | int unxz_main(int argc UNUSED_PARAM, char **argv) |
545 | { | 577 | { |
@@ -550,7 +582,7 @@ int unxz_main(int argc UNUSED_PARAM, char **argv) | |||
550 | bb_show_usage(); | 582 | bb_show_usage(); |
551 | # endif | 583 | # endif |
552 | /* xzcat? */ | 584 | /* xzcat? */ |
553 | if (applet_name[2] == 'c') | 585 | if (ENABLE_XZCAT && applet_name[2] == 'c') |
554 | option_mask32 |= OPT_STDOUT; | 586 | option_mask32 |= OPT_STDOUT; |
555 | 587 | ||
556 | argv += optind; | 588 | argv += optind; |
diff --git a/archival/lzop.c b/archival/lzop.c index 202de4d03..e0e90ac6c 100644 --- a/archival/lzop.c +++ b/archival/lzop.c | |||
@@ -31,19 +31,33 @@ | |||
31 | //config: help | 31 | //config: help |
32 | //config: Lzop compression/decompresion. | 32 | //config: Lzop compression/decompresion. |
33 | //config: | 33 | //config: |
34 | //config:config UNLZOP | ||
35 | //config: bool "unlzop" | ||
36 | //config: default y | ||
37 | //config: help | ||
38 | //config: Lzop decompresion. | ||
39 | //config: | ||
40 | //config:config LZOPCAT | ||
41 | //config: bool "lzopcat" | ||
42 | //config: default y | ||
43 | //config: help | ||
44 | //config: Alias to "unlzop -c". | ||
45 | //config: | ||
34 | //config:config LZOP_COMPR_HIGH | 46 | //config:config LZOP_COMPR_HIGH |
35 | //config: bool "lzop compression levels 7,8,9 (not very useful)" | 47 | //config: bool "lzop compression levels 7,8,9 (not very useful)" |
36 | //config: default n | 48 | //config: default n |
37 | //config: depends on LZOP | 49 | //config: depends on LZOP || UNLZOP || LZOPCAT |
38 | //config: help | 50 | //config: help |
39 | //config: High levels (7,8,9) of lzop compression. These levels | 51 | //config: High levels (7,8,9) of lzop compression. These levels |
40 | //config: are actually slower than gzip at equivalent compression ratios | 52 | //config: are actually slower than gzip at equivalent compression ratios |
41 | //config: and take up 3.2K of code. | 53 | //config: and take up 3.2K of code. |
42 | 54 | ||
43 | //applet:IF_LZOP(APPLET(lzop, BB_DIR_BIN, BB_SUID_DROP)) | 55 | //applet:IF_LZOP(APPLET(lzop, BB_DIR_BIN, BB_SUID_DROP)) |
44 | //applet:IF_LZOP(APPLET_ODDNAME(lzopcat, lzop, BB_DIR_USR_BIN, BB_SUID_DROP, lzopcat)) | 56 | //applet:IF_UNLZOP(APPLET_ODDNAME(unlzop, lzop, BB_DIR_USR_BIN, BB_SUID_DROP, unlzop)) |
45 | //applet:IF_LZOP(APPLET_ODDNAME(unlzop, lzop, BB_DIR_USR_BIN, BB_SUID_DROP, unlzop)) | 57 | //applet:IF_LZOPCAT(APPLET_ODDNAME(lzopcat, lzop, BB_DIR_USR_BIN, BB_SUID_DROP, lzopcat)) |
46 | //kbuild:lib-$(CONFIG_LZOP) += lzop.o | 58 | //kbuild:lib-$(CONFIG_LZOP) += lzop.o |
59 | //kbuild:lib-$(CONFIG_UNLZOP) += lzop.o | ||
60 | //kbuild:lib-$(CONFIG_LZOPCAT) += lzop.o | ||
47 | 61 | ||
48 | //usage:#define lzop_trivial_usage | 62 | //usage:#define lzop_trivial_usage |
49 | //usage: "[-cfvd123456789CF] [FILE]..." | 63 | //usage: "[-cfvd123456789CF] [FILE]..." |
@@ -57,18 +71,18 @@ | |||
57 | //usage: "\n -C Also write checksum of compressed block" | 71 | //usage: "\n -C Also write checksum of compressed block" |
58 | //usage: | 72 | //usage: |
59 | //usage:#define lzopcat_trivial_usage | 73 | //usage:#define lzopcat_trivial_usage |
60 | //usage: "[-vCF] [FILE]..." | 74 | //usage: "[-vF] [FILE]..." |
61 | //usage:#define lzopcat_full_usage "\n\n" | 75 | //usage:#define lzopcat_full_usage "\n\n" |
62 | //usage: " -v Verbose" | 76 | //usage: " -v Verbose" |
63 | //usage: "\n -F Don't store or verify checksum" | 77 | //usage: "\n -F Don't verify checksum" |
64 | //usage: | 78 | //usage: |
65 | //usage:#define unlzop_trivial_usage | 79 | //usage:#define unlzop_trivial_usage |
66 | //usage: "[-cfvCF] [FILE]..." | 80 | //usage: "[-cfvF] [FILE]..." |
67 | //usage:#define unlzop_full_usage "\n\n" | 81 | //usage:#define unlzop_full_usage "\n\n" |
68 | //usage: " -c Write to stdout" | 82 | //usage: " -c Write to stdout" |
69 | //usage: "\n -f Force" | 83 | //usage: "\n -f Force" |
70 | //usage: "\n -v Verbose" | 84 | //usage: "\n -v Verbose" |
71 | //usage: "\n -F Don't store or verify checksum" | 85 | //usage: "\n -F Don't verify checksum" |
72 | 86 | ||
73 | #include "libbb.h" | 87 | #include "libbb.h" |
74 | #include "common_bufsiz.h" | 88 | #include "common_bufsiz.h" |
@@ -1111,10 +1125,10 @@ int lzop_main(int argc UNUSED_PARAM, char **argv) | |||
1111 | getopt32(argv, OPTION_STRING); | 1125 | getopt32(argv, OPTION_STRING); |
1112 | argv += optind; | 1126 | argv += optind; |
1113 | /* lzopcat? */ | 1127 | /* lzopcat? */ |
1114 | if (applet_name[4] == 'c') | 1128 | if (ENABLE_LZOPCAT && applet_name[4] == 'c') |
1115 | option_mask32 |= (OPT_STDOUT | OPT_DECOMPRESS); | 1129 | option_mask32 |= (OPT_STDOUT | OPT_DECOMPRESS); |
1116 | /* unlzop? */ | 1130 | /* unlzop? */ |
1117 | if (applet_name[4] == 'o') | 1131 | if (ENABLE_UNLZOP && applet_name[4] == 'o') |
1118 | option_mask32 |= OPT_DECOMPRESS; | 1132 | option_mask32 |= OPT_DECOMPRESS; |
1119 | 1133 | ||
1120 | global_crc32_table = crc32_filltable(NULL, 0); | 1134 | global_crc32_table = crc32_filltable(NULL, 0); |