Tar output mode for installworld

Matthew Seaman m.seaman at infracaninophile.co.uk
Mon Jul 16 17:37:49 UTC 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Tim Kientzle wrote:
>> Being able to record a series of incremental changes in a filesystem
>> hierarchy, and then roll them back as required.  That would be
>> exceedingly useful, and I think your 'ntree' format has virtually
>> everything necessary to do that.  The most obvious missing bit I can
>> see is creating a backup of a file before overwriting it with
>> different content.
> 
> Is this something that requires changes to the specification
> file format, or just a feature of the tool that uses the
> specification file?
> 
> If the former, what do you envision would be required?

In your example earlier you said not entirely unlike the following:

#%ntree
bin/echo contents=my/bin/echo uid=0 gid=0 group=wheel

I've taken the liberty of reordering it a bit, because then it can
be interpreted (for example) as directly translating into a sequence
of shell commands:

	cp my/bin/echo /bin/echo
        chown 0 /bin/echo
        chgrp 0 /bin/echo
        chgrp wheel /bin/echo

This could be seen as a fragment of the process of building the /bin
filesystem from scratch, or as a patch to an existing /bin
filesystem, overlaying the echo command with a new version.

Thinking of it as the latter, so long as you know where to copy the
original /bin/echo to and how to record various other metadata then
you can fairly readily write another ntree program that reverses the
effect of this one[*].  The tool used to unpack the ntree file would
have to record the original file metadata (presumably directly in
ntree format), and you'ld probably need a reasonably cunning
approach to storing the backup copies of files so you avoid
accidentally overwriting them.  (Use the checksum of the file as the
name to store it under? Some sort of directory hashing probably
useful too)

	Cheers,

	Matthew

[*] almost literally by reversing the sense of each command and then
reversing the order they are applied.  Admittedly this is a trivial
example, but I don't see why that approach shouldn't work in general.

- --
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGm6zb8Mjk52CukIwRCCTtAJ9cLxb13VEmr06WVKX4r7D3z9UkVQCePB94
SE++fRzlgNecWtv6svCYIzE=
=o4XJ
-----END PGP SIGNATURE-----


More information about the freebsd-hackers mailing list