Whamcloud - gitweb
mke2fs: the -d option can now handle tarball input
authorJohannes Schauer Marin Rodrigues <josch@mister-muffin.de>
Wed, 20 Jul 2022 04:37:51 +0000 (06:37 +0200)
committerJohannes Schauer Marin Rodrigues <josch@mister-muffin.de>
Thu, 18 Apr 2024 09:02:09 +0000 (11:02 +0200)
commit7e3a4f0a33e9859af2bf44e8e1e278c8b10313cc
tree2fbfe6ecb0e9da0ddbe2366de6a21d85ca9b6273
parent260dfea450e387cbd2c8de79a7c2eeacc26f74e9
mke2fs: the -d option can now handle tarball input

If archive.h is available during compilation, enable mke2fs to read a
tarball as input. Since libarchive.so.13 is opened with dlopen,
libarchive is not a hard library dependency of the resulting binary.

In comparison with feeding a directory tree to mke2fs via -d this has
the following advantages:

 - no superuser privileges, nor fakeroot, nor unshared user namespaces
   are needed to create filesystems with arbitrary ownership information
   and special files like device nodes which otherwise require being root

 - by reading a tarball from standard input, no temporary files need to
   be written out first as mke2fs can be used as part of a shell pipeline
   which reduces disk usage and makes the conversion independent of the
   underlying file system

A round-trip from tarball to ext4 to tarball yields bit-by-bit identical
results

Signed-off-by: Johannes Schauer Marin Rodrigues <josch@mister-muffin.de>
25 files changed:
MCONFIG.in
configure
configure.ac
debugfs/Makefile.in
lib/config.h.in
lib/ext2fs/Makefile.in
misc/Makefile.in
misc/create_inode.c
misc/create_inode.h
misc/create_inode_libarchive.c [new file with mode: 0644]
misc/create_inode_libarchive.h [new file with mode: 0644]
misc/mke2fs.8.in
misc/mke2fs.c
tests/m_rootgnutar/expect [new file with mode: 0644]
tests/m_rootgnutar/mkgnutar.pl [new file with mode: 0644]
tests/m_rootgnutar/output.sed [new file with mode: 0644]
tests/m_rootgnutar/script [new file with mode: 0644]
tests/m_rootpaxtar/expect [new file with mode: 0644]
tests/m_rootpaxtar/mkpaxtar.pl [new file with mode: 0644]
tests/m_rootpaxtar/output.sed [new file with mode: 0644]
tests/m_rootpaxtar/script [new file with mode: 0644]
tests/m_roottar/expect [new file with mode: 0644]
tests/m_roottar/mktar.pl [new file with mode: 0644]
tests/m_roottar/output.sed [new file with mode: 0644]
tests/m_roottar/script [new file with mode: 0644]