xref: /freebsd/etc/mtree/README (revision a90b9d0159070121c221b966469c3e36d912bf82)
1Note: If you modify these files, please keep hier(7) updated!
2
3These files are used to create empty file hierarchies for building the
4system into.  Some notes about working with them are placed here to try
5and keep them in good working order.
6
7    a)  The files use 4 space indentation, and other than in the header
8        comments, should not contain any tabs.  An indentation of 4 is
9        preferable to the standard indentation of 8 because the indentation
10        of levels in these files can become quite deep causing the line to
11        overflow 80 characters.
12
13        This also matches with the files generated when using the
14        mtree -c option, which was implemented that way for the same reason.
15
16    b)  Only directories should be listed here.
17
18    c)  The listing should be kept in filename sorted order.
19
20    d)  Sanity checking changes to these files can be done by following
21        this procedure (the sed -e is ugly, but fixing mtree -c to
22        not emit the trailing white space would be even uglier):
23
24            mkdir /tmp/MTREE
25            mtree -deU -f BSD.X.dist -p /tmp/MTREE
26            mtree -bcdjn -F freebsd9 -k uname,gname,mode -p /tmp/MTREE | \
27                sed -e 's/ *$//' >BSD.X.new
28            diff -u BSD.X.dist BSD.X.new
29            rm -r /tmp/MTREE
30
31        Note that you will get some differences about /set lines,
32        and uname= gname= on certain directory areas, mainly man page
33        sections.  This is caused by mtree not having a look ahead
34        mechanism for making better selections for these as it
35        traverses the hierarchy.
36
37        The BSD.X.new file should NOT be committed, as it will be missing
38        the correct header, and important keywords like ``nochange''.
39        Simply use the diff for a sanity check to make sure things are in
40        the correct order and correctly indented.
41
42    e)  Further sanity checking of the system builds with DESTDIR=/someplace
43        are more complicated, but can often catch missing entries in these
44        files.  I tend to run this more complete sanity check shortly after
45        the target date for a new release is announced.
46
47        If you want details on it bug me about it via email to
48        rgrimes@FreeBSD.org.
49