[PATCH] Tar with transformer (gzip, bzip2, ...) on NOMMU
Denys Vlasenko
vda.linux at googlemail.com
Wed Sep 5 04:31:10 PDT 2007
On Wednesday 05 September 2007 12:12, Alex Landau wrote:
> The attached patch makes "tar -xzf" work on NOMMU.
>
> - The main part is the open_transformer function that instead of forking and running a
> "transformation" function (that should decompress the archive), vforks and execs the
> appropriate decompressor.
> - A bit of preprocessor magic (include/unarchive.h) removes the unused arguments at the
> time of call (the transformer function is unused on NOMMU, and the external helper to
> exec is unused on MMU).
> - Changed components and how thorough they were tested:
> * tar -xzf - fullly tested on MMU and NOMMU.
> * tar -xjf - same.
> * tar -xaf (LZMA) - same.
> * LZMA (archival/bbunzip.c) - added -f option (same meaning as for gunzip).
> It was present in the usage message, seems to be implemented by the
> common function bbunpack(), but just was not passed to getopt32().
> * tar -xZf (uncompress) - compile-tested only (both MMU and NOMMU).
> I don't have .Z files to test on... Should work as long as uncompress can be
> invoked as "uncompress -cf -".
> * rpm - compile-tested on both MMU and NOMMU. Sort of runtime tested on MMU.
> I downloaded an rpm file and ran ./busybox rpm -i <the-file>.rpm. It
> complained that it can't create some file under /etc. That's normal since
> I'm not root. The files it tried to create have the correct names, so it should
> work (tm).
> - The patch should change nothing on MMU machines. Someone using rpm and compress, please
> verify that...
> - gzip, bzip2 and lzma work for me on NOMMU (and on MMU too, of course).
> - The patch touches quite a lot of files, but the changes are minor in most cases (except
> open_transformer that is at the core). Diffstat below.
>
> archival/bbunzip.c | 2 +-
> archival/libunarchive/Kbuild | 1 -
> archival/libunarchive/get_header_tar_bz2.c | 2 +-
> archival/libunarchive/get_header_tar_gz.c | 9 ++++++++-
> archival/libunarchive/get_header_tar_lzma.c | 2 +-
> archival/libunarchive/open_transformer.c | 22 +++++++++++++++++++++-
> archival/rpm.c | 26 +++++++++++++++++++++++---
> archival/tar.c | 2 +-
> include/unarchive.h | 6 ++++++
> 9 files changed, 62 insertions(+), 10 deletions(-)
Applied with very minor changes, many thanks!
(bloatcheck says 0 bytes difference for MMU)
--
vda
More information about the busybox
mailing list