aboutsummaryrefslogtreecommitdiff
path: root/mkfs.jffs2.1
blob: 9b0acc35fecf5e5f66c7e84a29ed82282857ebbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
.TH MKFS.JFFS2 1
.SH NAME
mkfs.jffs2 \- Create a JFFS2 file system image from directory
.SH SYNOPSIS
.B mkfs.jffs2
[
.B -p,--pad[=SIZE]
]
[
.B -r,-d,--root
.I directory
]
[
.B -s,--pagesize=SIZE
]
[
.B -e,--eraseblock=SIZE
]
[
.B -c,--cleanmarker=SIZE
]
[
.B -n,--no-cleanmarkers
]
[
.B -o,--output
.I image.jffs2
]
[
.B -l,--little-endian
]
[
.B -b,--big-endian
]
[
.B -D,--devtable=FILE
]
[
.B -f,--faketime
]
[
.B -q,--squash
]
[
.B -U,--squash-uids
]
[
.B -P,--squash-perms
]
[
.B --with-xattr
]
[
.B --with-selinux
]
[
.B --with-posix-acl
]
[
.B -m,--compression-mode=MODE
]
[
.B -x,--disable-compressor=NAME
]
[
.B -X,--enable-compressor=NAME
]
[
.B -y,--compressor-priority=PRIORITY:NAME
]
[
.B -L,--list-compressors
]
[
.B -t,--test-compression
]
[
.B -h,--help
]
[
.B -v,--verbose
]
[
.B -V,--version
]
[
.B -i,--incremental
.I image.jffs2
]

.SH DESCRIPTION
The program
.B mkfs.jffs2
creates a JFFS2 (Second Journalling Flash File System) file system
image and writes the resulting image to the file specified by the
.B -o
option or by default to the standard output, unless the standard
output is a terminal device in which case mkfs.jffs2 will abort.

The file system image is created using the files and directories
contained in the directory specified by the option
.B -r
or the present directory, if the
.B -r
option is not specified.

Each block of the files to be placed into the file system image
are compressed using one of the avaiable compressors depending
on the selected compression mode.

File systems are created with the same endianness as the host,
unless the
.B -b
or
.B -l
options are specified.  JFFS2 driver in the 2.4 Linux kernel only
supported images having the same endianness as the CPU. As of 2.5.48,
the kernel can be changed with a #define to accept images of the
non-native endianness. Full bi-endian support in the kernel is not
planned.

It is unlikely that JFFS2 images are useful except in conjuction
with the MTD (Memory Technology Device) drivers in the Linux
kernel, since the JFFS2 file system driver in the kernel requires
MTD devices.
.SH OPTIONS
Options that take SIZE arguments can be specified as either
decimal (e.g., 65536), octal (0200000), or hexidecimal (0x1000).
.TP
.B -p, --pad[=SIZE]
Pad output to SIZE bytes with 0xFF.  If SIZE is not specified,
the output is padded to the end of the final erase block.
.TP
.B -r, -d, --root=DIR
Build file system from directory DIR.  The default is the current
directory.
.TP
.B -s, --pagesize=SIZE
Use page size SIZE.  The default is 4 KiB.  This size is the
maximum size of a data node.
.TP
.B -e, --eraseblock=SIZE
Use erase block size SIZE.  The default is 64 KiB.  If you use a erase
block size different than the erase block size of the target MTD
device, JFFS2 may not perform optimally. If the SIZE specified is
below 4096, the units are assumed to be KiB.
.TP
.B -c, --cleanmarker=SIZE
Write \'CLEANMARKER\' nodes with the size specified. It is not
normally appropriate to specify a size other than the default 12
bytes.
.TP
.B -n, --no-cleanmarkers
Do not write \'CLEANMARKER\' nodes to the beginning of each erase
block. This option can be useful for creating JFFS2 images for
use on NAND flash, and for creating images which are to be used
on a variety of hardware with differing eraseblock sizes.
.TP
.B -o, --output=FILE
Write JFFS2 image to file FILE.  Default is the standard output.
.TP
.B -l, --little-endian
Create a little-endian JFFS2 image.  Default is to make an image
with the same endianness as the host.
.TP
.B -b, --big-endian
Create a big-endian JFFS2 image.  Default is to make an image
with the same endianness as the host.
.TP
.B -D, --devtable=FILE
Use the named FILE as a device table file, for including devices and
changing permissions in the created image when the user does not have
appropriate permissions to create them on the file system used as
source.
.TP
.B -f, --faketime
Change all file timestamps to \'0\' for regression testing.
.TP
.B -q, --squash
Squash permissions and owners, making all files be owned by root and
removing write permission for \'group\' and \'other\'.
.TP
.B -U, --squash-uids
Squash owners making all files be owned by root.
.TP
.B -P, --squash-perms
Squash permissions, removing write permission for \'group\' and \'other\'.
.TP
.B --with-xattr
Enables xattr, stuff all xattr entries into jffs2 image file.
.TP
.B --with-selinux
Enables xattr, stuff only SELinux Labels into jffs2 image file.
.TP
.B --with-posix-acl
Enable xattr, stuff only POSIX ACL entries into jffs2 image file.
.TP
.B -m, --compression-mode=MODE
Set the default compression mode. The default mode is
.B priority
which tries the compressors in a predefinied order and chooses the first
successful one. The alternatives are:
.B none
(mkfs will not compress) and
.B size
(mkfs will try all compressor and chooses the one which have the smallest result).
.TP
.B -x, --disable-compressor=NAME
Disable a compressor. Use
.B -L
to see the list of the avaiable compressors and their default states.
.TP
.B -X, --enable-compressor=NAME
Enable a compressor. Use
.B -L
to see the list of the avaiable compressors and their default states.
.TP
.B -y, --compressor-priority=PRIORITY:NAME
Set the priority of a compressor. Use
.B -L
to see the list of the avaiable compressors and their default priority.
Priorities are used by priority compression mode.
.TP
.B -L, --list-compressors
Show the list of the avaiable compressors and their states.
.TP
.B -t, --test-compression
Call decompress after every compress - and compare the result with the original data -, and
some other check.
.TP
.B -h, --help
Display help text.
.TP
.B -v, --verbose
Verbose operation.
.TP
.B -V, --version
Display version information.
.TP
.B -i, --incremental=FILE
Generate an appendage image for FILE. If FILE is written to flash and flash
is appended with the output, then it seems as if it was one thing.

.SH LIMITATIONS
The format and grammar of the device table file does not allow it to
create symbolic links when the symbolic links are not already present
in the root working directory.

However, symbolic links may be specified in the device table file
using the \fIl\fR type for the purposes of setting their permissions
and ownership.
.SH BUGS
JFFS2 limits device major and minor numbers to 8 bits each.  Some
consider this a bug.

.B mkfs.jffs2
does not properly handle hard links in the input directory structure.
Currently, hard linked files will be expanded to multiple identical
files in the output image.
.SH AUTHORS
David Woodhouse
.br
Manual page written by David Schleef <ds@schleef.org>
.SH SEE ALSO
.BR mkfs (8),
.BR mkfs.jffs (1),
.BR fakeroot (1)