xref: /freebsd/etc/mtree/README (revision f9ce010afdd3136fc73e2b500f2ed916bf9cfa59)
1$FreeBSD$
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 keep 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 -cdin -k uname,gname,mode | sed -e 's/ *$//' | \
27                tail +5 >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 commited, will be missing the
38        correct header, and important keywords like ``nochange''.  Simply
39        use the diff for a sanity check to make sure things are in the
40        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