cvs commit: src/lib/libarchive Makefile archive_entry.c archive_entry.h archive_entry_link_resolver.c archive_entry_private.h archive_entry_strmode.c archive_platform.h archive_read.c archive_read_support_compression_none.c archive_read_support_format_all.c ...

Tim Kientzle kientzle at
Tue Jan 1 06:09:47 UTC 2008

M. Warner Losh wrote:
> In message: <20071231001554.GB987 at>
>             "Simon L. Nielsen" <simon at> writes:
> : >   * New read support: mtree format
> : 
> : This sounds interesting but I can't really figure out what it
> : does... ? :) (and I couldn't find any mention in the updated manual
> : pages.)
> Any chance our 'install' tools can be made to copy the files w/o the
> right permissions and 'log' the right stuff to an mtree formatted
> file?  That would make building a distribution as a mere mortal
> possible...

Yep.  ;-)  That's a major motivation of this work.
In fact, you don't even need to copy the files
anywhere.  The approach I'm considering would
have "make buildworld" write out entries of this
form during the build:

/bin/ls uid=0 mode=0555 contents=/usr/obj/usr/src/bin/ls

Then "make installworld" becomes essentially just:

   tar -xUvf world.mtree -C ${DESTDIR}

or you can create a distribution tarball with:

   tar -czf world.tgz @world.mtree

In particular, I like that this approach uses exactly
the same machinery for local installs or distribution
building, varying only in the very last step.

The code I just committed to -CURRENT is sufficient to
begin experimenting with this approach; you just need
to be careful to include "#mtree" as the first line
(to please libarchive's auto-format detection).
The use of full pathnames in mtree files is another
idea I copied from the NetBSD folks; I've documented
this as "mtree v2" in the mtree.5 manpage.

There are still a lot of details to work out, but I
hope this is sufficient for someone else to begin
experimenting with the next step, which is figuring out
the appropriate ways to change our distribution build.

Tim Kientzle

More information about the cvs-all mailing list