1MTREE(5) BSD File Formats Manual MTREE(5)
2
4 mtree — format of mtree dir hierarchy files
5
7 The mtree format is a textual format that describes a collection of
8 filesystem objects. Such files are typically used to create or verify
9 directory hierarchies.
10
11 General Format
12 An mtree file consists of a series of lines, each providing information
13 about a single filesystem object. Leading whitespace is always ignored.
14
15 When encoding file or pathnames, any backslash character or character
16 outside of the 95 printable ASCII characters must be encoded as a back‐
17 slash followed by three octal digits. When reading mtree files, any
18 appearance of a backslash followed by three octal digits should be con‐
19 verted into the corresponding character.
20
21 Each line is interpreted independently as one of the following types:
22
23 Blank Blank lines are ignored.
24
25 Comment Lines beginning with # are ignored.
26
27 Special Lines beginning with / are special commands that influence
28 the interpretation of later lines.
29
30 Relative If the first whitespace-delimited word has no / characters,
31 it is the name of a file in the current directory. Any rela‐
32 tive entry that describes a directory changes the current
33 directory.
34
35 dot-dot As a special case, a relative entry with the filename ..
36 changes the current directory to the parent directory.
37 Options on dot-dot entries are always ignored.
38
39 Full If the first whitespace-delimited word has a / character
40 after the first character, it is the pathname of a file rela‐
41 tive to the starting directory. There can be multiple full
42 entries describing the same file.
43
44 Some tools that process mtree files may require that multiple lines
45 describing the same file occur consecutively. It is not permitted for
46 the same file to be mentioned using both a relative and a full file spec‐
47 ification.
48
49 Special commands
50 Two special commands are currently defined:
51
52 /set This command defines default values for one or more keywords.
53 It is followed on the same line by one or more whitespace-
54 separated keyword definitions. These definitions apply to
55 all following files that do not specify a value for that key‐
56 word.
57
58 /unset This command removes any default value set by a previous /set
59 command. It is followed on the same line by one or more key‐
60 words separated by whitespace.
61
62 Keywords
63 After the filename, a full or relative entry consists of zero or more
64 whitespace-separated keyword definitions. Each such definition consists
65 of a key from the following list immediately followed by an '=' sign and
66 a value. Software programs reading mtree files should warn about unrec‐
67 ognized keywords.
68
69 Currently supported keywords are as follows:
70
71 cksum The checksum of the file using the default algorithm speci‐
72 fied by the cksum(1) utility.
73
74 device The device number for block or char file types. The value
75 must be one of the following forms:
76
77 format,major,minor[,subunit]
78 A device with major, minor and optional subunit fields.
79 Their meaning is specified by the operating's system
80 format. See below for valid formats.
81
82 number
83 Opaque number (as stored on the file system).
84
85 The following values for format are recognized: native,
86 386bsd, 4bsd, bsdos, freebsd, hpux, isc, linux, netbsd, osf1,
87 sco, solaris, sunos, svr3, svr4, and ultrix.
88
89 See mknod(8) for more details.
90
91 contents The full pathname of a file that holds the contents of this
92 file.
93
94 flags The file flags as a symbolic name. See chflags(1) for infor‐
95 mation on these names. If no flags are to be set the string
96 “none” may be used to override the current default.
97
98 gid The file group as a numeric value.
99
100 gname The file group as a symbolic name.
101
102 ignore Ignore any file hierarchy below this file.
103
104 inode The inode number.
105
106 link The target of the symbolic link when type=link.
107
108 md5 The MD5 message digest of the file.
109
110 md5digest A synonym for md5.
111
112 mode The current file's permissions as a numeric (octal) or sym‐
113 bolic value.
114
115 nlink The number of hard links the file is expected to have.
116
117 nochange Make sure this file or directory exists but otherwise ignore
118 all attributes.
119
120 optional The file is optional; do not complain about the file if it is
121 not in the file hierarchy.
122
123 resdevice The “resident” device number of the file, e.g. the ID of the
124 device that contains the file. Its format is the same as the
125 one for device.
126
127 ripemd160digest
128 The RIPEMD160 message digest of the file.
129
130 rmd160 A synonym for ripemd160digest.
131
132 rmd160digest
133 A synonym for ripemd160digest.
134
135 sha1 The FIPS 160-1 (“SHA-1”) message digest of the file.
136
137 sha1digest A synonym for sha1.
138
139 sha256 The FIPS 180-2 (“SHA-256”) message digest of the file.
140
141 sha256digest
142 A synonym for sha256.
143
144 sha384 The FIPS 180-2 (“SHA-384”) message digest of the file.
145
146 sha384digest
147 A synonym for sha384.
148
149 sha512 The FIPS 180-2 (“SHA-512”) message digest of the file.
150
151 sha512digest
152 A synonym for sha512.
153
154 size The size, in bytes, of the file.
155
156 time The last modification time of the file.
157
158 type The type of the file; may be set to any one of the following:
159
160 block block special device
161 char character special device
162 dir directory
163 fifo fifo
164 file regular file
165 link symbolic link
166 socket socket
167
168 uid The file owner as a numeric value.
169
170 uname The file owner as a symbolic name.
171
173 cksum(1), find(1), mtree(8)
174
177 The mtree utility appeared in 4.3BSD-Reno. The MD5 digest capability was
178 added in FreeBSD 2.1, in response to the widespread use of programs which
179 can spoof cksum(1). The SHA-1 and RIPEMD160 digests were added in
180 FreeBSD 4.0, as new attacks have demonstrated weaknesses in MD5. The
181 SHA-256 digest was added in FreeBSD 6.0. Support for file flags was
182 added in FreeBSD 4.0, and mostly comes from NetBSD. The “full” entry
183 format was added by NetBSD.
184
185BSD September 4, 2013 BSD