This patch adds full lzip/lunzip support to busybox, including seamless lz decompression (of tar.lz files, etc), but not including tar.lz archive creation. With all features enabled, this patch adds 12272 bytes to busybox on x86 (see busybox_objsizes.diff). I think this patch follows all the guidelines of new-applet-HOWTO.txt. It has to be applied to the corresponding busybox release like this: cd busybox-VERSION patch -p1 < PATH/busybox-VERSION_lzip-N.patch chmod a+x testsuite/lunzip.tests testsuite/lzip.tests This patch adds the following files: archival/libarchive/decompress_lunzip.c archival/libarchive/get_header_tar_lz.c archival/libarchive/lzip.h archival/lzip.c testsuite/lunzip.tests testsuite/lzip.tests And modifies the following files: archival/Config.src archival/Kbuild.src archival/bbunzip.c archival/libarchive/Kbuild.src archival/libarchive/filter_accept_list_reassign.c archival/libarchive/open_transformer.c archival/tar.c configs/TEST_nommu_defconfig configs/TEST_noprintf_defconfig configs/TEST_rh9_defconfig configs/android2_defconfig configs/android_defconfig configs/android_ndk_defconfig configs/cygwin_defconfig configs/freebsd_defconfig include/applets.src.h include/bb_archive.h include/libbb.h miscutils/man.c testsuite/bunzip2.tests testsuite/tar.tests Description of the new files: archival/libarchive/decompress_lunzip.c Lunzip implementation. Defines the function 'unpack_lz_stream'. archival/libarchive/get_header_tar_lz.c Defines the function 'get_header_tar_lz'. archival/libarchive/lzip.h Common definitions for lzip and lunzip. archival/lzip.c Lzip implementation. Defines the function 'lzip_main'. testsuite/lunzip.tests Executes 'bunzip2.tests' with ext=lz. testsuite/lzip.tests Tests lzip compression using the new method (see testsuite/TODO). Description of the changes to the existing files: archival/Config.src Added FEATURE_SEAMLESS_LZ, LUNZIP and LZIP. Added FEATURE_SEAMLESS_LZ to the definition of FEATURE_TAR_AUTODETECT. archival/Kbuild.src Added lib-$(CONFIG_LZIP) and lib-$(CONFIG_LUNZIP). archival/bbunzip.c Modified 'make_new_name_generic' So that it also replaces tlz --> tar. This change works for all extensions except Z (tbz2,tlz,tlzma,txz), making the behaviour of all decompressors consistent with gzip and with the 'real' decompressors. Added 'lunzip_main'. archival/libarchive/Kbuild.src Addded lib-$(CONFIG_LUNZIP) and lib-$(CONFIG_FEATURE_SEAMLESS_LZ). archival/libarchive/filter_accept_list_reassign.c Added lzip support to dpkg. archival/libarchive/open_transformer.c Added lzip magic support to 'setup_unzip_on_fd'. archival/tar.c Added option '-y, --lzip' to tar for lzip decompression (conditioned to IF_FEATURE_SEAMLESS_LZ). configs/TEST_nommu_defconfig configs/TEST_noprintf_defconfig configs/TEST_rh9_defconfig configs/android2_defconfig configs/android_defconfig configs/android_ndk_defconfig configs/cygwin_defconfig configs/freebsd_defconfig Added suitable definitions of CONFIG_FEATURE_SEAMLESS_LZ, CONFIG_LUNZIP and CONFIG_LZIP to all *_defconfig files. include/applets.src.h Added IF_LUNZIP(APPLET(lunzip, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_LZIP(APPLET(lzip, BB_DIR_USR_BIN, BB_SUID_DROP)) include/bb_archive.h Defined LZIP_MAGIC1 and LZIP_MAGIC2. Added prototypes for functions 'get_header_tar_lz' and 'unpack_lz_stream'. include/libbb.h Added ENABLE_FEATURE_SEAMLESS_LZ to the definition of SEAMLESS_COMPRESSION. Added prototype for function 'lunzip_main'. miscutils/man.c Added support for lzipped manpages to 'show_manpage'. testsuite/bunzip2.tests Use it to test lunzip (in addition to gunzip and bunzip2). Added new test 'replace .t$ext --> .tar' (for tgz/tbz2/tlz). testsuite/tar.tests Added new test 'tar extract tlz'.