Codebase list dosfstools / upstream/4.1
New upstream version 4.1 Andreas Bombe 7 years ago
40 changed file(s) with 2604 addition(s) and 146 deletion(s). Raw diff Collapse all Expand all
0 commit cad2c17
1 Author: Andreas Bombe <aeb@debian.org>
2 Date: Mon Jan 23 03:10:56 2017 +0100
3
4 fatlabel: Make sure printf style patterns in label are not expanded
5
6 Writing a label to an unlabeled filesystem involves creating a root
7 directory entry to contain the label. For this, the
8 alloc_rootdir_entry() function used for creating new directory nodes for
9 recovered orphan cluster chains is reused. However, this expects the
10 filename to be a printf style pattern to generate a unique name.
11
12 If the filesystem is unlabeled and the new label contains a printf
13 specifier other than %d or similar, the attempted expansion of the
14 pattern might crash fatlabel.
15
16 Change alloc_rootdir_entry() to take an additional argument gen_name and
17 only expand the name if its value is true.
18
19 Signed-off-by: Andreas Bombe <aeb@debian.org>
20
21 commit 77371e2
22 Author: Andreas Bombe <aeb@debian.org>
23 Date: Fri Nov 4 13:10:58 2016 +0100
24
25 testsuite: Add missing fsck test files to dist_check_DATA
26
27 Signed-off-by: Andreas Bombe <aeb@debian.org>
28
29 commit d6df1d4
30 Author: Andreas Bombe <aeb@debian.org>
31 Date: Thu Nov 3 20:03:25 2016 +0100
32
33 testsuite: Test for bad characters in file names
34
35 The FAT16 test image contains four files with three errors. One has a
36 space in the name, one a space in the extension and one contains '>' in
37 the name.
38
39 Signed-off-by: Andreas Bombe <aeb@debian.org>
40
41 commit 307966c
42 Author: Andreas Bombe <aeb@debian.org>
43 Date: Sun Sep 18 00:11:43 2016 +0200
44
45 fsck: Fix reporting of length to truncate with shared clusters
46
47 When files share clusters and one of the two files has been selected to
48 truncate fsck reports which file has been selected and the length to
49 which it will be truncated. All code paths erronously printed the length
50 of the file that was not going to be truncated, leading to possible user
51 confusion.
52
53 Signed-off-by: Andreas Bombe <aeb@debian.org>
54
55 commit b33424e
56 Author: Andreas Bombe <aeb@debian.org>
57 Date: Sat Sep 17 23:34:07 2016 +0200
58
59 testsuite: Test for files sharing clusters
60
61 The FAT32 test image contains three files. One shares a cluster with the
62 root directory and the other two share clusters among themselves.
63
64 Signed-off-by: Andreas Bombe <aeb@debian.org>
65
66 commit db5ec04
67 Author: Andreas Bombe <aeb@debian.org>
68 Date: Sat Sep 17 22:41:07 2016 +0200
69
70 testsuite: Run fsck in test-mkfs
71
72 Now the test-mkfs script also runs fsck on the created image to test its
73 basic operation. The test fails if fsck reports seeing an error.
74
75 Signed-off-by: Andreas Bombe <aeb@debian.org>
76
77 commit 4ac17ae
78 Author: Andreas Bombe <aeb@debian.org>
79 Date: Sat Sep 17 22:25:06 2016 +0200
80
81 Fix FAT32 FSInfo signature checking
82
83 In commit 7444694 the definition of struct info_sector was corrected to
84 match the FSInfo sector specification. The initialization was adapted,
85 but other places were missed. All runs of fsck would then incorrectly
86 report a signature error on the FSInfo sector.
87
88 Signed-off-by: Andreas Bombe <aeb@debian.org>
89
90 commit e883d07
91 Author: Nico Roeser <nico@n1c0.de>
92 Date: Fri Sep 16 20:05:08 2016 +0200
93
94 mkfs: Bring back ability to set sector size.
95
96 This had accidently been broken when the code was overhauled, resulting
97 in unconditionally setting the sector size when devinfo detected it.
98
99 Signed-off-by: Andreas Bombe <aeb@debian.org>
100
101 commit 4ef83db
102 Author: Andreas Bombe <aeb@debian.org>
103 Date: Fri Sep 16 03:32:12 2016 +0200
104
105 Request minimum automake version 1.11 and add workaround for <1.13
106
107 Before automake 1.13, parallel-tests wasn't the default set it
108 explicitly in the automake options list. The parallel test harness was
109 introduced in 1.11 therefore that is the minimum now.
110
111 However, the AM_TESTS_ENVIRONMENT variable was only starting to work in
112 1.13, so there is now a version check and a conditional assignment to
113 TESTS_ENVIRONMENT (which should be for user setting only) in case
114 automake is 1.11 or 1.12.
115
116 Without it, the fact of xxd being found is not passed to the test
117 scripts which then skip all tests due to perceived lack of xxd.
118
119 Signed-off-by: Andreas Bombe <aeb@debian.org>
120
121 commit 6a8c8b7
122 Author: Andreas Bombe <aeb@debian.org>
123 Date: Fri Sep 16 01:45:17 2016 +0200
124
125 Add missing autoreconf step to Travis CI configuration
126
127 Signed-off-by: Andreas Bombe <aeb@debian.org>
128
129 commit 54f7aef
130 Author: Andreas Bombe <aeb@debian.org>
131 Date: Fri Sep 16 01:39:08 2016 +0200
132
133 Add configuration for the Travis CI build service
134
135 Signed-off-by: Andreas Bombe <aeb@debian.org>
136
137 commit 5421752
138 Author: Andreas Bombe <aeb@debian.org>
139 Date: Wed Sep 14 20:37:57 2016 +0200
140
141 Check and fix printf style arguments to die() and pdie()
142
143 Add the "format" gcc style attribute to the declarations of die() and
144 pdie() so that the compiler knows how to check their arguments for
145 correctness.
146
147 Fix all problematic calls detected by this.
148
149 Signed-off-by: Andreas Bombe <aeb@debian.org>
150
151 commit 83e5ec5
152 Author: Andreas Bombe <aeb@debian.org>
153 Date: Wed Sep 14 03:38:08 2016 +0200
154
155 Make some implicit integer conversions safer
156
157 Coverity reports a few places where signed or short integers are
158 promoted to int and then extended to long which might cause unintended
159 sign extension. Given the context (being sector sizes and similar) the
160 values should never actually reach unsafe values, but this patch cleans
161 it up anyway.
162
163 Signed-off-by: Andreas Bombe <aeb@debian.org>
164
165 commit ff5e718
166 Author: Andreas Bombe <aeb@debian.org>
167 Date: Tue Sep 13 20:25:34 2016 +0200
168
169 mkfs: Remove redundant unreachable warning message
170
171 At some point the check for too many clusters for user requested FAT16
172 was moved a few lines above. The original location can only be reached
173 when the cluster count is too low for FAT16 which means the too many
174 clusters message can not be triggered there.
175
176 Found through the dead code detection of Coverity Scan.
177
178 Signed-off-by: Andreas Bombe <aeb@debian.org>
179
180 commit e359a33
181 Author: Andreas Bombe <aeb@debian.org>
182 Date: Tue Sep 13 20:12:21 2016 +0200
183
184 Fix octal character parsing in file_cvt()
185
186 Apparently the octal code parsing got rewritten into a loop at some
187 point while the rest of the code was not removed. It was impossible to
188 specify an octal character code without the function returning an error.
189
190 This affected the -u and -d options for fsck.
191
192 Found through the dead code detection of Coverity Scan.
193
194 Signed-off-by: Andreas Bombe <aeb@debian.org>
195
196 commit ccd0a9d
197 Author: Andreas Bombe <aeb@debian.org>
198 Date: Mon Sep 12 20:21:53 2016 +0200
199
200 testsuite: Test for circular cluster chain
201
202 The test image contains a file four clusters in length where the third
203 cluster has been modified to point back to the second cluster.
204
205 Signed-off-by: Andreas Bombe <aeb@debian.org>
206
207 commit fab40f8
208 Author: Andreas Bombe <aeb@debian.org>
209 Date: Mon Sep 12 19:51:10 2016 +0200
210
211 Fix truncation logic in circular chain check
212
213 When scanning for circular chains, the first FAT entry that appeared a
214 second time in a chain should cause the previous cluster to be the
215 termination of the chain.
216
217 To that end, test_file() keeps variables to point to the previous
218 cluster and the current number of clusters. When the -t option is given,
219 all clusters are checked to be readable and skipped (variables not
220 updates) in test_file() when they are not.
221
222 The problem was that the variables were updated only when the read check
223 succeeded. If the -t option is not given, that check does not happen and
224 the variables keep their initial value. The circular chain fix would
225 then always truncate to zero length and fail to update the free cluster
226 count, requiring a second fsck run.
227
228 Fix by updating these variables unconditionally when -t option is not
229 given.
230
231 Signed-off-by: Andreas Bombe <aeb@debian.org>
232
233 commit 8394ceb
234 Author: Andreas Bombe <aeb@debian.org>
235 Date: Mon Sep 12 14:39:11 2016 +0200
236
237 testsuite: Test for too long cluster chain
238
239 The test image contains a file marked as 7 bytes in length (just a small
240 part of 1 cluster) in the directory entry that has 2 clusters assigned
241 to it in the FAT.
242
243 Signed-off-by: Andreas Bombe <aeb@debian.org>
244
245 commit 7444694
246 Author: Andreas Bombe <aeb@debian.org>
247 Date: Wed Sep 7 21:09:41 2016 +0200
248
249 Fix definition and initialization of fsinfo sector
250
251 Change the definition of the fsinfo struct to be more in line with the
252 official definition, in particular make the trailing signature field 32
253 bit instead of 16 bit. During initialization in init_fsinfo(), first
254 clear the whole struct to zero before setting fields, to make sure
255 reserved fields are zeroed.
256
257 Fixes #33.
258
259 Signed-off-by: Andreas Bombe <aeb@debian.org>
260
261 commit f78cb68
262 Author: Andreas Bombe <aeb@debian.org>
263 Date: Wed Sep 7 20:45:29 2016 +0200
264
265 Add fsck testsuite
266
267 Add the framework for a fsck testsuite and a few tests, including a test
268 for the yet unimplemented check for misordered dot/dotdot directory
269 entries.
270
271 The test driver runs fsck twice on a given image and fails the test if
272 the first run does not detect an error or the second run still detects
273 an error.
274
275 Signed-off-by: Andreas Bombe <aeb@debian.org>
276
277 commit 7667295
278 Author: Andreas Bombe <aeb@debian.org>
279 Date: Tue May 31 03:32:42 2016 +0200
280
281 Add testsuite foundations
282
283 Add testsuite on the basis of the automake framework. As a start, three
284 tests for basic mkfs functionality compare mkfs generated images against
285 references images.
286
287 Signed-off-by: Andreas Bombe <aeb@debian.org>
288
289 commit f881195
290 Author: Andreas Bombe <aeb@debian.org>
291 Date: Wed Sep 7 03:48:16 2016 +0200
292
293 Append +git to version number in configure.ac
294
295 Don't let dosfstools compiled from git with additional commits show the
296 exact release version number.
297
298 Signed-off-by: Andreas Bombe <aeb@debian.org>
299
300 commit 8788615
301 Author: Álvaro Fernández Rojas <noltari@gmail.com>
302 Date: Thu Jun 30 08:43:50 2016 +0200
303
304 Add config.guess and config.sub to gitignore
305
306 Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
307 Signed-off-by: Andreas Bombe <aeb@debian.org>
308
309 commit 39ab842
310 Author: Álvaro Fernández Rojas <noltari@gmail.com>
311 Date: Thu Jun 30 08:41:51 2016 +0200
312
313 Use autoconf to look for OS X endian include.
314
315 Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
316 Signed-off-by: Andreas Bombe <aeb@debian.org>
317
318 commit 69ac2b0
319 Author: Alessio Sergi <al3hex@gmail.com>
320 Date: Fri May 6 18:18:18 2016 +0200
321
322 src/device_info.c: Fix undefined PATH_MAX under musl
323
324 In musl libc, PATH_MAX is defined in <limits.h>.
325
326 Signed-off-by: Andreas Bombe <aeb@debian.org>
327
328 commit 744db84
329 Author: Lars Wendler <polynomial-c@gentoo.org>
330 Date: Tue May 10 09:47:57 2016 +0200
331
332 Don't link to udev via LDFLAGS. There's LDADD for such a task.
333
334 See also:
335 https://www.gnu.org/software/automake/manual/html_node/Linking.html
336
337 Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
338 Signed-off-by: Andreas Bombe <aeb@debian.org>
339
340 commit 1e76e57
341 Author: Andreas Bombe <aeb@debian.org>
342 Date: Wed May 11 03:44:58 2016 +0200
343
344 mkfs: Default to 64/32 heads/sectors for targets smaller than 512 MB
345
346 This may put defaults in certain use cases a little bit more in line
347 with the old defaults in versions up to 3.0.28. It has mostly aesthetic
348 value in most cases.
349
350 Signed-off-by: Andreas Bombe <aeb@debian.org>
351
352 commit 786e66e (tag: v4.0)
353 Author: Andreas Bombe <aeb@debian.org>
354 Date: Fri May 6 03:19:07 2016 +0200
355
356 Releasing version 4.0.
357
358 Signed-off-by: Andreas Bombe <aeb@debian.org>
359
0360 commit a79ff90
1361 Author: Andreas Bombe <aeb@debian.org>
2362 Date: Fri May 6 02:34:42 2016 +0200
0 Installation Instructions
1 *************************
2
3 Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation,
4 Inc.
5
6 Copying and distribution of this file, with or without modification,
7 are permitted in any medium without royalty provided the copyright
8 notice and this notice are preserved. This file is offered as-is,
9 without warranty of any kind.
10
11 Basic Installation
12 ==================
13
14 Briefly, the shell commands `./configure; make; make install' should
15 configure, build, and install this package. The following
16 more-detailed instructions are generic; see the `README' file for
17 instructions specific to this package. Some packages provide this
18 `INSTALL' file but do not implement all of the features documented
19 below. The lack of an optional feature in a given package is not
20 necessarily a bug. More recommendations for GNU packages can be found
21 in *note Makefile Conventions: (standards)Makefile Conventions.
22
23 The `configure' shell script attempts to guess correct values for
24 various system-dependent variables used during compilation. It uses
25 those values to create a `Makefile' in each directory of the package.
26 It may also create one or more `.h' files containing system-dependent
27 definitions. Finally, it creates a shell script `config.status' that
28 you can run in the future to recreate the current configuration, and a
29 file `config.log' containing compiler output (useful mainly for
30 debugging `configure').
31
32 It can also use an optional file (typically called `config.cache'
33 and enabled with `--cache-file=config.cache' or simply `-C') that saves
34 the results of its tests to speed up reconfiguring. Caching is
35 disabled by default to prevent problems with accidental use of stale
36 cache files.
37
38 If you need to do unusual things to compile the package, please try
39 to figure out how `configure' could check whether to do them, and mail
40 diffs or instructions to the address given in the `README' so they can
41 be considered for the next release. If you are using the cache, and at
42 some point `config.cache' contains results you don't want to keep, you
43 may remove or edit it.
44
45 The file `configure.ac' (or `configure.in') is used to create
46 `configure' by a program called `autoconf'. You need `configure.ac' if
47 you want to change it or regenerate `configure' using a newer version
48 of `autoconf'.
49
50 The simplest way to compile this package is:
51
52 1. `cd' to the directory containing the package's source code and type
53 `./configure' to configure the package for your system.
54
55 Running `configure' might take a while. While running, it prints
56 some messages telling which features it is checking for.
57
58 2. Type `make' to compile the package.
59
60 3. Optionally, type `make check' to run any self-tests that come with
61 the package, generally using the just-built uninstalled binaries.
62
63 4. Type `make install' to install the programs and any data files and
64 documentation. When installing into a prefix owned by root, it is
65 recommended that the package be configured and built as a regular
66 user, and only the `make install' phase executed with root
67 privileges.
68
69 5. Optionally, type `make installcheck' to repeat any self-tests, but
70 this time using the binaries in their final installed location.
71 This target does not install anything. Running this target as a
72 regular user, particularly if the prior `make install' required
73 root privileges, verifies that the installation completed
74 correctly.
75
76 6. You can remove the program binaries and object files from the
77 source code directory by typing `make clean'. To also remove the
78 files that `configure' created (so you can compile the package for
79 a different kind of computer), type `make distclean'. There is
80 also a `make maintainer-clean' target, but that is intended mainly
81 for the package's developers. If you use it, you may have to get
82 all sorts of other programs in order to regenerate files that came
83 with the distribution.
84
85 7. Often, you can also type `make uninstall' to remove the installed
86 files again. In practice, not all packages have tested that
87 uninstallation works correctly, even though it is required by the
88 GNU Coding Standards.
89
90 8. Some packages, particularly those that use Automake, provide `make
91 distcheck', which can by used by developers to test that all other
92 targets like `make install' and `make uninstall' work correctly.
93 This target is generally not run by end users.
94
95 Compilers and Options
96 =====================
97
98 Some systems require unusual options for compilation or linking that
99 the `configure' script does not know about. Run `./configure --help'
100 for details on some of the pertinent environment variables.
101
102 You can give `configure' initial values for configuration parameters
103 by setting variables in the command line or in the environment. Here
104 is an example:
105
106 ./configure CC=c99 CFLAGS=-g LIBS=-lposix
107
108 *Note Defining Variables::, for more details.
109
110 Compiling For Multiple Architectures
111 ====================================
112
113 You can compile the package for more than one kind of computer at the
114 same time, by placing the object files for each architecture in their
115 own directory. To do this, you can use GNU `make'. `cd' to the
116 directory where you want the object files and executables to go and run
117 the `configure' script. `configure' automatically checks for the
118 source code in the directory that `configure' is in and in `..'. This
119 is known as a "VPATH" build.
120
121 With a non-GNU `make', it is safer to compile the package for one
122 architecture at a time in the source code directory. After you have
123 installed the package for one architecture, use `make distclean' before
124 reconfiguring for another architecture.
125
126 On MacOS X 10.5 and later systems, you can create libraries and
127 executables that work on multiple system types--known as "fat" or
128 "universal" binaries--by specifying multiple `-arch' options to the
129 compiler but only a single `-arch' option to the preprocessor. Like
130 this:
131
132 ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
133 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
134 CPP="gcc -E" CXXCPP="g++ -E"
135
136 This is not guaranteed to produce working output in all cases, you
137 may have to build one architecture at a time and combine the results
138 using the `lipo' tool if you have problems.
139
140 Installation Names
141 ==================
142
143 By default, `make install' installs the package's commands under
144 `/usr/local/bin', include files under `/usr/local/include', etc. You
145 can specify an installation prefix other than `/usr/local' by giving
146 `configure' the option `--prefix=PREFIX', where PREFIX must be an
147 absolute file name.
148
149 You can specify separate installation prefixes for
150 architecture-specific files and architecture-independent files. If you
151 pass the option `--exec-prefix=PREFIX' to `configure', the package uses
152 PREFIX as the prefix for installing programs and libraries.
153 Documentation and other data files still use the regular prefix.
154
155 In addition, if you use an unusual directory layout you can give
156 options like `--bindir=DIR' to specify different values for particular
157 kinds of files. Run `configure --help' for a list of the directories
158 you can set and what kinds of files go in them. In general, the
159 default for these options is expressed in terms of `${prefix}', so that
160 specifying just `--prefix' will affect all of the other directory
161 specifications that were not explicitly provided.
162
163 The most portable way to affect installation locations is to pass the
164 correct locations to `configure'; however, many packages provide one or
165 both of the following shortcuts of passing variable assignments to the
166 `make install' command line to change installation locations without
167 having to reconfigure or recompile.
168
169 The first method involves providing an override variable for each
170 affected directory. For example, `make install
171 prefix=/alternate/directory' will choose an alternate location for all
172 directory configuration variables that were expressed in terms of
173 `${prefix}'. Any directories that were specified during `configure',
174 but not in terms of `${prefix}', must each be overridden at install
175 time for the entire installation to be relocated. The approach of
176 makefile variable overrides for each directory variable is required by
177 the GNU Coding Standards, and ideally causes no recompilation.
178 However, some platforms have known limitations with the semantics of
179 shared libraries that end up requiring recompilation when using this
180 method, particularly noticeable in packages that use GNU Libtool.
181
182 The second method involves providing the `DESTDIR' variable. For
183 example, `make install DESTDIR=/alternate/directory' will prepend
184 `/alternate/directory' before all installation names. The approach of
185 `DESTDIR' overrides is not required by the GNU Coding Standards, and
186 does not work on platforms that have drive letters. On the other hand,
187 it does better at avoiding recompilation issues, and works well even
188 when some directory options were not specified in terms of `${prefix}'
189 at `configure' time.
190
191 Optional Features
192 =================
193
194 If the package supports it, you can cause programs to be installed
195 with an extra prefix or suffix on their names by giving `configure' the
196 option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
197
198 Some packages pay attention to `--enable-FEATURE' options to
199 `configure', where FEATURE indicates an optional part of the package.
200 They may also pay attention to `--with-PACKAGE' options, where PACKAGE
201 is something like `gnu-as' or `x' (for the X Window System). The
202 `README' should mention any `--enable-' and `--with-' options that the
203 package recognizes.
204
205 For packages that use the X Window System, `configure' can usually
206 find the X include and library files automatically, but if it doesn't,
207 you can use the `configure' options `--x-includes=DIR' and
208 `--x-libraries=DIR' to specify their locations.
209
210 Some packages offer the ability to configure how verbose the
211 execution of `make' will be. For these packages, running `./configure
212 --enable-silent-rules' sets the default to minimal output, which can be
213 overridden with `make V=1'; while running `./configure
214 --disable-silent-rules' sets the default to verbose, which can be
215 overridden with `make V=0'.
216
217 Particular systems
218 ==================
219
220 On HP-UX, the default C compiler is not ANSI C compatible. If GNU
221 CC is not installed, it is recommended to use the following options in
222 order to use an ANSI C compiler:
223
224 ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
225
226 and if that doesn't work, install pre-built binaries of GCC for HP-UX.
227
228 HP-UX `make' updates targets which have the same time stamps as
229 their prerequisites, which makes it generally unusable when shipped
230 generated files such as `configure' are involved. Use GNU `make'
231 instead.
232
233 On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
234 parse its `<wchar.h>' header file. The option `-nodtk' can be used as
235 a workaround. If GNU CC is not installed, it is therefore recommended
236 to try
237
238 ./configure CC="cc"
239
240 and if that doesn't work, try
241
242 ./configure CC="cc -nodtk"
243
244 On Solaris, don't put `/usr/ucb' early in your `PATH'. This
245 directory contains several dysfunctional programs; working variants of
246 these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
247 in your `PATH', put it _after_ `/usr/bin'.
248
249 On Haiku, software installed for all users goes in `/boot/common',
250 not `/usr/local'. It is recommended to use the following options:
251
252 ./configure --prefix=/boot/common
253
254 Specifying the System Type
255 ==========================
256
257 There may be some features `configure' cannot figure out
258 automatically, but needs to determine by the type of machine the package
259 will run on. Usually, assuming the package is built to be run on the
260 _same_ architectures, `configure' can figure that out, but if it prints
261 a message saying it cannot guess the machine type, give it the
262 `--build=TYPE' option. TYPE can either be a short name for the system
263 type, such as `sun4', or a canonical name which has the form:
264
265 CPU-COMPANY-SYSTEM
266
267 where SYSTEM can have one of these forms:
268
269 OS
270 KERNEL-OS
271
272 See the file `config.sub' for the possible values of each field. If
273 `config.sub' isn't included in this package, then this package doesn't
274 need to know the machine type.
275
276 If you are _building_ compiler tools for cross-compiling, you should
277 use the option `--target=TYPE' to select the type of system they will
278 produce code for.
279
280 If you want to _use_ a cross compiler, that generates code for a
281 platform different from the build platform, you should specify the
282 "host" platform (i.e., that on which the generated programs will
283 eventually be run) with `--host=TYPE'.
284
285 Sharing Defaults
286 ================
287
288 If you want to set default values for `configure' scripts to share,
289 you can create a site shell script called `config.site' that gives
290 default values for variables like `CC', `cache_file', and `prefix'.
291 `configure' looks for `PREFIX/share/config.site' if it exists, then
292 `PREFIX/etc/config.site' if it exists. Or, you can set the
293 `CONFIG_SITE' environment variable to the location of the site script.
294 A warning: not all `configure' scripts look for a site script.
295
296 Defining Variables
297 ==================
298
299 Variables not defined in a site shell script can be set in the
300 environment passed to `configure'. However, some packages may run
301 configure again during the build, and the customized values of these
302 variables may be lost. In order to avoid this problem, you should set
303 them in the `configure' command line, using `VAR=value'. For example:
304
305 ./configure CC=/usr/local2/bin/gcc
306
307 causes the specified `gcc' to be used as the C compiler (unless it is
308 overridden in the site shell script).
309
310 Unfortunately, this technique does not work for `CONFIG_SHELL' due to
311 an Autoconf bug. Until the bug is fixed you can use this workaround:
312
313 CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
314
315 `configure' Invocation
316 ======================
317
318 `configure' recognizes the following options to control how it
319 operates.
320
321 `--help'
322 `-h'
323 Print a summary of all of the options to `configure', and exit.
324
325 `--help=short'
326 `--help=recursive'
327 Print a summary of the options unique to this package's
328 `configure', and exit. The `short' variant lists options used
329 only in the top level, while the `recursive' variant lists options
330 also present in any nested packages.
331
332 `--version'
333 `-V'
334 Print the version of Autoconf used to generate the `configure'
335 script, and exit.
336
337 `--cache-file=FILE'
338 Enable the cache: use and save the results of the tests in FILE,
339 traditionally `config.cache'. FILE defaults to `/dev/null' to
340 disable caching.
341
342 `--config-cache'
343 `-C'
344 Alias for `--cache-file=config.cache'.
345
346 `--quiet'
347 `--silent'
348 `-q'
349 Do not print messages saying which checks are being made. To
350 suppress all normal output, redirect it to `/dev/null' (any error
351 messages will still be shown).
352
353 `--srcdir=DIR'
354 Look for the package's source code in directory DIR. Usually
355 `configure' can determine that directory automatically.
356
357 `--prefix=DIR'
358 Use DIR as the installation prefix. *note Installation Names::
359 for more details, including other options available for fine-tuning
360 the installation locations.
361
362 `--no-create'
363 `-n'
364 Run the configure checks, but stop before creating any output
365 files.
366
367 `configure' also accepts some other, not widely useful, options. Run
368 `configure --help' for more details.
369
0 SUBDIRS = src manpages
0 SUBDIRS = src manpages tests
11
22 dist_doc_DATA = doc/ANNOUNCE.mkdosfs \
33 doc/ChangeLog.dosfsck \
182182 CTAGS = ctags
183183 CSCOPE = cscope
184184 DIST_SUBDIRS = $(SUBDIRS)
185 am__DIST_COMMON = $(srcdir)/Makefile.in COPYING ChangeLog NEWS README \
186 TODO compile depcomp install-sh missing
185 am__DIST_COMMON = $(srcdir)/Makefile.in COPYING ChangeLog INSTALL NEWS \
186 README TODO compile depcomp install-sh missing
187187 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
188188 distdir = $(PACKAGE)-$(VERSION)
189189 top_distdir = $(distdir)
278278 UDEV_CFLAGS = @UDEV_CFLAGS@
279279 UDEV_LIBS = @UDEV_LIBS@
280280 VERSION = @VERSION@
281 XXD_FOUND = @XXD_FOUND@
281282 abs_builddir = @abs_builddir@
282283 abs_srcdir = @abs_srcdir@
283284 abs_top_builddir = @abs_top_builddir@
321322 top_build_prefix = @top_build_prefix@
322323 top_builddir = @top_builddir@
323324 top_srcdir = @top_srcdir@
324 SUBDIRS = src manpages
325 SUBDIRS = src manpages tests
325326 dist_doc_DATA = doc/ANNOUNCE.mkdosfs \
326327 doc/ChangeLog.dosfsck \
327328 doc/ChangeLog.dosfstools-2.x \
0 dosfstools 4.1 - released 2017-01-24
1 ====================================
2
3 A test suite is now included and can be run with "make check". The test suite
4 requires xxd from the vim distribution to recreate image files from hexdumps and
5 also adds a dependency on automake 1.11 or later for building from sources other
6 than the release tarball.
7
8 Now the default for mkfs for filesystems smaller than 512 MB is 64 heads / 32
9 sectors to make the defaults a bit more in line with the old defaults used up to
10 3.0.28.
11
12 Other changes are fixes, some of them user visible, such as setting the sector
13 size by command line option for mkfs working again after being broken in 4.0.
14
15 Fixed a possible fatlabel crash when writing a label to an unlabelled filesystem
16 and the given label contains printf style format specifiers.
17
18 When circular cluster chains were detected and the -t option was not given, fsck
19 used to truncate the file to zero length while not updating the free cluster
20 count. This required a second fsck run to clear. Now it always truncates to the
21 last cluster that begins the loop, as it is supposed to.
22
23 The parsing of octal character specifications for filenames in the -u and -d
24 options of fsck now works. It was broken in some ancient version and would
25 always fail.
26
27
028 dosfstools 4.0 - released 2016-05-06
129 ====================================
230
77 dosfstools recommends libudev. It is used in mkfs.fat to collect additional
88 information about the device to format in order to refuse potentially unsafe
99 operations without additional confirmation.
10
11 The test suite requires the tool xxd (available as part of the vim
12 distribution).
1013
1114
1215 ### Installing
2730 mkfs.msdos and mkfs.vfat for mkfs.fat and dosfslabel for fatlabel.
2831
2932
33 ### Running the test suite
34
35 The test suite can be run with "make check" after configuring. Note that if
36 xxd isn't available, all tests will be skipped and nothing actually tested.
37
38 During the tests temporary files of multiple GB in size will be created, but the
39 actual data content is not more than a few MB. The operating system and the
40 filesystem the tests are executed on should support sparse files, otherwise the
41 tests will be resource intensive.
42
43
3044 ### Building from the VCS repository
3145
3246 If you are working directly from a git clone of the official dosfstools
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.69 for dosfstools 4.0.
2 # Generated by GNU Autoconf 2.69 for dosfstools 4.1.
33 #
44 #
55 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
576576 # Identity of this package.
577577 PACKAGE_NAME='dosfstools'
578578 PACKAGE_TARNAME='dosfstools'
579 PACKAGE_VERSION='4.0'
580 PACKAGE_STRING='dosfstools 4.0'
579 PACKAGE_VERSION='4.1'
580 PACKAGE_STRING='dosfstools 4.1'
581581 PACKAGE_BUGREPORT=''
582582 PACKAGE_URL=''
583583
621621 am__EXEEXT_TRUE
622622 LTLIBOBJS
623623 LIBOBJS
624 AUTOMAKE_TEST_COMPAT_FALSE
625 AUTOMAKE_TEST_COMPAT_TRUE
626 XXD_FOUND
624627 UDEV_LIBS
625628 UDEV_CFLAGS
626629 PKG_CONFIG_LIBDIR
12891292 # Omit some internal or obsolete options to make the list less imposing.
12901293 # This message is too long to be a string in the A/UX 3.1 sh.
12911294 cat <<_ACEOF
1292 \`configure' configures dosfstools 4.0 to adapt to many kinds of systems.
1295 \`configure' configures dosfstools 4.1 to adapt to many kinds of systems.
12931296
12941297 Usage: $0 [OPTION]... [VAR=VALUE]...
12951298
13561359
13571360 if test -n "$ac_init_help"; then
13581361 case $ac_init_help in
1359 short | recursive ) echo "Configuration of dosfstools 4.0:";;
1362 short | recursive ) echo "Configuration of dosfstools 4.1:";;
13601363 esac
13611364 cat <<\_ACEOF
13621365
14621465 test -n "$ac_init_help" && exit $ac_status
14631466 if $ac_init_version; then
14641467 cat <<\_ACEOF
1465 dosfstools configure 4.0
1468 dosfstools configure 4.1
14661469 generated by GNU Autoconf 2.69
14671470
14681471 Copyright (C) 2012 Free Software Foundation, Inc.
18061809 This file contains any messages produced by compilers while
18071810 running configure, to aid debugging if configure makes a mistake.
18081811
1809 It was created by dosfstools $as_me 4.0, which was
1812 It was created by dosfstools $as_me 4.1, which was
18101813 generated by GNU Autoconf 2.69. Invocation command line was
18111814
18121815 $ $0 $@
21542157 ac_compiler_gnu=$ac_cv_c_compiler_gnu
21552158
21562159
2157 RELEASE_DATE=2016-05-06
2160 RELEASE_DATE=2017-01-24
21582161
21592162 am__api_version='1.15'
21602163
26712674
26722675 # Define the identity of the package.
26732676 PACKAGE='dosfstools'
2674 VERSION='4.0'
2677 VERSION='4.1'
26752678
26762679
26772680 cat >>confdefs.h <<_ACEOF
44604463 done
44614464
44624465
4463 for ac_header in endian.h sys/endian.h
4466 for ac_header in endian.h sys/endian.h libkern/OSByteOrder.h
44644467 do :
44654468 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
44664469 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
47574760 fi
47584761
47594762
4760 ac_config_files="$ac_config_files Makefile src/Makefile src/version.h manpages/Makefile manpages/mkfs.fat.8 manpages/fsck.fat.8 manpages/fatlabel.8"
4763 # xxd (distributed with vim) is used in the testsuite
4764 # Extract the first word of "xxd", so it can be a program name with args.
4765 set dummy xxd; ac_word=$2
4766 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4767 $as_echo_n "checking for $ac_word... " >&6; }
4768 if ${ac_cv_prog_XXD_FOUND+:} false; then :
4769 $as_echo_n "(cached) " >&6
4770 else
4771 if test -n "$XXD_FOUND"; then
4772 ac_cv_prog_XXD_FOUND="$XXD_FOUND" # Let the user override the test.
4773 else
4774 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4775 for as_dir in $PATH
4776 do
4777 IFS=$as_save_IFS
4778 test -z "$as_dir" && as_dir=.
4779 for ac_exec_ext in '' $ac_executable_extensions; do
4780 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4781 ac_cv_prog_XXD_FOUND="yes"
4782 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4783 break 2
4784 fi
4785 done
4786 done
4787 IFS=$as_save_IFS
4788
4789 fi
4790 fi
4791 XXD_FOUND=$ac_cv_prog_XXD_FOUND
4792 if test -n "$XXD_FOUND"; then
4793 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XXD_FOUND" >&5
4794 $as_echo "$XXD_FOUND" >&6; }
4795 else
4796 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4797 $as_echo "no" >&6; }
4798 fi
4799
4800
4801
4802 # check if automake is 1.11 or 1.12 for using a workaround for the parallel test harness
4803 # (we check for a minimum version of 1.11 above, so these are the only two values to check)
4804 if test $am__api_version = 1.11 -o $am__api_version = 1.12; then
4805 AUTOMAKE_TEST_COMPAT_TRUE=
4806 AUTOMAKE_TEST_COMPAT_FALSE='#'
4807 else
4808 AUTOMAKE_TEST_COMPAT_TRUE='#'
4809 AUTOMAKE_TEST_COMPAT_FALSE=
4810 fi
4811
4812
4813 ac_config_files="$ac_config_files Makefile src/Makefile src/version.h manpages/Makefile manpages/mkfs.fat.8 manpages/fsck.fat.8 manpages/fatlabel.8 tests/Makefile"
47614814
47624815 cat >confcache <<\_ACEOF
47634816 # This file is a shell script that caches the results of configure
49324985 as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
49334986 Usually this means the macro was only invoked conditionally." "$LINENO" 5
49344987 fi
4988 if test -z "${AUTOMAKE_TEST_COMPAT_TRUE}" && test -z "${AUTOMAKE_TEST_COMPAT_FALSE}"; then
4989 as_fn_error $? "conditional \"AUTOMAKE_TEST_COMPAT\" was never defined.
4990 Usually this means the macro was only invoked conditionally." "$LINENO" 5
4991 fi
49354992
49364993 : "${CONFIG_STATUS=./config.status}"
49374994 ac_write_fail=0
53295386 # report actual input values of CONFIG_FILES etc. instead of their
53305387 # values after options handling.
53315388 ac_log="
5332 This file was extended by dosfstools $as_me 4.0, which was
5389 This file was extended by dosfstools $as_me 4.1, which was
53335390 generated by GNU Autoconf 2.69. Invocation command line was
53345391
53355392 CONFIG_FILES = $CONFIG_FILES
53865443 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
53875444 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
53885445 ac_cs_version="\\
5389 dosfstools config.status 4.0
5446 dosfstools config.status 4.1
53905447 configured by $0, generated by GNU Autoconf 2.69,
53915448 with options \\"\$ac_cs_config\\"
53925449
55125569 "manpages/mkfs.fat.8") CONFIG_FILES="$CONFIG_FILES manpages/mkfs.fat.8" ;;
55135570 "manpages/fsck.fat.8") CONFIG_FILES="$CONFIG_FILES manpages/fsck.fat.8" ;;
55145571 "manpages/fatlabel.8") CONFIG_FILES="$CONFIG_FILES manpages/fatlabel.8" ;;
5572 "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
55155573
55165574 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
55175575 esac
1313 # You should have received a copy of the GNU General Public License
1414 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1515
16 AC_INIT([dosfstools], [4.0])
17 AC_SUBST([RELEASE_DATE], [2016-05-06])
18 AM_INIT_AUTOMAKE([foreign subdir-objects])
16 AC_INIT([dosfstools], [4.1])
17 AC_SUBST([RELEASE_DATE], [2017-01-24])
18 AM_INIT_AUTOMAKE([1.11 foreign subdir-objects parallel-tests])
1919
2020 AC_ARG_ENABLE([compat-symlinks],
2121 [AS_HELP_STRING([--enable-compat-symlinks],
4646 sys/queue.h \
4747 ])
4848
49 AC_CHECK_HEADERS([endian.h sys/endian.h])
49 AC_CHECK_HEADERS([endian.h sys/endian.h libkern/OSByteOrder.h])
5050
5151 AC_CHECK_DECLS([getmntent], [], [], [[#include <mntent.h>]])
5252 AC_CHECK_DECLS([getmntinfo], [], [], [[#include <sys/mount.h>]])
6060
6161 AC_SEARCH_LIBS(iconv_open, iconv)
6262
63 # xxd (distributed with vim) is used in the testsuite
64 AC_CHECK_PROG([XXD_FOUND], [xxd], [yes])
65
66 # check if automake is 1.11 or 1.12 for using a workaround for the parallel test harness
67 # (we check for a minimum version of 1.11 above, so these are the only two values to check)
68 AM_CONDITIONAL(AUTOMAKE_TEST_COMPAT, test $am__api_version = 1.11 -o $am__api_version = 1.12)
69
6370 AC_CONFIG_FILES([Makefile src/Makefile src/version.h
6471 manpages/Makefile manpages/mkfs.fat.8
65 manpages/fsck.fat.8 manpages/fatlabel.8])
72 manpages/fsck.fat.8 manpages/fatlabel.8
73 tests/Makefile])
6674 AC_OUTPUT
215215 UDEV_CFLAGS = @UDEV_CFLAGS@
216216 UDEV_LIBS = @UDEV_LIBS@
217217 VERSION = @VERSION@
218 XXD_FOUND = @XXD_FOUND@
218219 abs_builddir = @abs_builddir@
219220 abs_srcdir = @abs_srcdir@
220221 abs_top_builddir = @abs_top_builddir@
3333 mkfs_fat_SOURCES = mkfs.fat.c msdos_fs.h $(mkfs_common_sources)
3434 mkfs_fat_CPPFLAGS = -I$(srcdir)/blkdev
3535 mkfs_fat_CFLAGS = $(AM_CFLAGS) $(UDEV_CFLAGS)
36 mkfs_fat_LDFLAGS = $(UDEV_LIBS)
36 mkfs_fat_LDADD = $(UDEV_LIBS)
3737
3838 testdevinfo_SOURCES = testdevinfo.c $(mkfs_common_sources)
3939 testdevinfo_CPPFLAGS = -I$(srcdir)/blkdev
4040 testdevinfo_CFLAGS = $(AM_CFLAGS) $(UDEV_CFLAGS)
41 testdevinfo_LDFLAGS = $(UDEV_LIBS)
41 testdevinfo_LDADD = $(UDEV_LIBS)
4242
4343
4444 if COMPAT_SYMLINKS
129129 blkdev/mkfs_fat-linux_version.$(OBJEXT)
130130 am_mkfs_fat_OBJECTS = mkfs_fat-mkfs.fat.$(OBJEXT) $(am__objects_2)
131131 mkfs_fat_OBJECTS = $(am_mkfs_fat_OBJECTS)
132 mkfs_fat_LDADD = $(LDADD)
133 mkfs_fat_LINK = $(CCLD) $(mkfs_fat_CFLAGS) $(CFLAGS) \
134 $(mkfs_fat_LDFLAGS) $(LDFLAGS) -o $@
132 am__DEPENDENCIES_1 =
133 mkfs_fat_DEPENDENCIES = $(am__DEPENDENCIES_1)
134 mkfs_fat_LINK = $(CCLD) $(mkfs_fat_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
135 $(LDFLAGS) -o $@
135136 am__objects_3 = testdevinfo-device_info.$(OBJEXT) \
136137 blkdev/testdevinfo-blkdev.$(OBJEXT) \
137138 blkdev/testdevinfo-linux_version.$(OBJEXT)
138139 am_testdevinfo_OBJECTS = testdevinfo-testdevinfo.$(OBJEXT) \
139140 $(am__objects_3)
140141 testdevinfo_OBJECTS = $(am_testdevinfo_OBJECTS)
141 testdevinfo_LDADD = $(LDADD)
142 testdevinfo_DEPENDENCIES = $(am__DEPENDENCIES_1)
142143 testdevinfo_LINK = $(CCLD) $(testdevinfo_CFLAGS) $(CFLAGS) \
143 $(testdevinfo_LDFLAGS) $(LDFLAGS) -o $@
144 $(AM_LDFLAGS) $(LDFLAGS) -o $@
144145 AM_V_P = $(am__v_P_@AM_V@)
145146 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
146147 am__v_P_0 = false
256257 UDEV_CFLAGS = @UDEV_CFLAGS@
257258 UDEV_LIBS = @UDEV_LIBS@
258259 VERSION = @VERSION@
260 XXD_FOUND = @XXD_FOUND@
259261 abs_builddir = @abs_builddir@
260262 abs_srcdir = @abs_srcdir@
261263 abs_top_builddir = @abs_top_builddir@
317319 mkfs_fat_SOURCES = mkfs.fat.c msdos_fs.h $(mkfs_common_sources)
318320 mkfs_fat_CPPFLAGS = -I$(srcdir)/blkdev
319321 mkfs_fat_CFLAGS = $(AM_CFLAGS) $(UDEV_CFLAGS)
320 mkfs_fat_LDFLAGS = $(UDEV_LIBS)
322 mkfs_fat_LDADD = $(UDEV_LIBS)
321323 testdevinfo_SOURCES = testdevinfo.c $(mkfs_common_sources)
322324 testdevinfo_CPPFLAGS = -I$(srcdir)/blkdev
323325 testdevinfo_CFLAGS = $(AM_CFLAGS) $(UDEV_CFLAGS)
324 testdevinfo_LDFLAGS = $(UDEV_LIBS)
326 testdevinfo_LDADD = $(UDEV_LIBS)
325327 all: all-am
326328
327329 .SUFFIXES:
129129 printf("%10u sectors total\n", sectors ? sectors : le32toh(b->total_sect));
130130 }
131131
132 static void check_backup_boot(DOS_FS * fs, struct boot_sector *b, int lss)
132 static void check_backup_boot(DOS_FS * fs, struct boot_sector *b, unsigned int lss)
133133 {
134134 struct boot_sector b2;
135135
144144 else
145145 printf(" Auto-creating backup boot block.\n");
146146 if (!interactive || get_key("12", "?") == '1') {
147 int bbs;
147 unsigned int bbs;
148148 /* The usual place for the backup boot sector is sector 6. Choose
149149 * that or the last reserved sector. */
150150 if (le16toh(b->reserved) >= 7 && le16toh(b->info_sector) != 6)
209209
210210 static void init_fsinfo(struct info_sector *i)
211211 {
212 memset(i, 0, sizeof (struct info_sector));
212213 i->magic = htole32(0x41615252);
213214 i->signature = htole32(0x61417272);
214215 i->free_clusters = htole32(-1);
215216 i->next_cluster = htole32(2);
216 i->boot_sign = htole16(0xaa55);
217 }
218
219 static void read_fsinfo(DOS_FS * fs, struct boot_sector *b, int lss)
217 i->boot_sign = htole32(0xaa550000);
218 }
219
220 static void read_fsinfo(DOS_FS * fs, struct boot_sector *b, unsigned int lss)
220221 {
221222 struct info_sector i;
222223
256257 fs_read(fs->fsinfo_start, sizeof(i), &i);
257258
258259 if (i.magic != htole32(0x41615252) ||
259 i.signature != htole32(0x61417272) || i.boot_sign != htole16(0xaa55)) {
260 i.signature != htole32(0x61417272) || i.boot_sign != htole32(0xaa550000)) {
260261 printf("FSINFO sector has bad magic number(s):\n");
261262 if (i.magic != htole32(0x41615252))
262263 printf(" Offset %llu: 0x%08x != expected 0x%08x\n",
266267 printf(" Offset %llu: 0x%08x != expected 0x%08x\n",
267268 (unsigned long long)offsetof(struct info_sector, signature),
268269 le32toh(i.signature), 0x61417272);
269 if (i.boot_sign != htole16(0xaa55))
270 printf(" Offset %llu: 0x%04x != expected 0x%04x\n",
270 if (i.boot_sign != htole32(0xaa550000))
271 printf(" Offset %llu: 0x%08x != expected 0x%08x\n",
271272 (unsigned long long)offsetof(struct info_sector, boot_sign),
272 le16toh(i.boot_sign), 0xaa55);
273 le32toh(i.boot_sign), 0xaa550000);
273274 if (interactive)
274275 printf("1) Correct\n2) Don't correct (FSINFO invalid then)\n");
275276 else
327328 {
328329 struct boot_sector b;
329330 unsigned total_sectors;
330 unsigned short logical_sector_size, sectors;
331 unsigned int logical_sector_size, sectors;
331332 off_t fat_length;
332333 unsigned total_fat_entries;
333334 off_t data_size;
414415 * much clusers otherwise. */
415416 fs->fat_bits = (fs->data_clusters >= FAT12_THRESHOLD) ? 16 : 12;
416417 if (fs->data_clusters >= FAT16_THRESHOLD)
417 die("Too many clusters (%lu) for FAT16 filesystem.", fs->data_clusters);
418 die("Too many clusters (%lu) for FAT16 filesystem.",
419 (unsigned long)fs->data_clusters);
418420 check_fat_state_bit(fs, &b);
419421 } else {
420422 /* On Atari, things are more difficult: GEMDOS always uses 12bit FATs
456458 die("Root directory (%d entries) doesn't span an integral number of "
457459 "sectors.", fs->root_entries);
458460 if (logical_sector_size & (SECTOR_SIZE - 1))
459 die("Logical sector size (%d bytes) is not a multiple of the physical "
461 die("Logical sector size (%u bytes) is not a multiple of the physical "
460462 "sector size.", logical_sector_size);
461463 #if 0 /* linux kernel doesn't check that either */
462464 /* ++roman: On Atari, these two fields are often left uninitialized */
539541 offset = find_volume_de(fs, &de);
540542 if (offset == 0) {
541543 created = 1;
542 offset = alloc_rootdir_entry(fs, &de, label);
544 offset = alloc_rootdir_entry(fs, &de, label, 0);
543545 }
544546 memcpy(de.name, label, 11);
545547 de.time = htole16((unsigned short)((mtime->tm_sec >> 1) +
7878 } \
7979 } while(0)
8080
81 off_t alloc_rootdir_entry(DOS_FS * fs, DIR_ENT * de, const char *pattern)
81 off_t alloc_rootdir_entry(DOS_FS * fs, DIR_ENT * de, const char *pattern, int gen_name)
8282 {
8383 static int curr_num = 0;
8484 off_t offset;
132132 fs_write(offset + i, sizeof(d2), &d2);
133133 }
134134 memset(de, 0, sizeof(DIR_ENT));
135 while (1) {
136 char expanded[12];
137 sprintf(expanded, pattern, curr_num);
138 memcpy(de->name, expanded, MSDOS_NAME);
139 clu_num = fs->root_cluster;
140 i = 0;
141 offset2 = cluster_start(fs, clu_num);
142 while (clu_num > 0 && clu_num != -1) {
143 fs_read(offset2, sizeof(DIR_ENT), &d2);
144 if (offset2 != offset &&
145 !strncmp((const char *)d2.name, (const char *)de->name,
146 MSDOS_NAME))
135 if (gen_name) {
136 while (1) {
137 char expanded[12];
138 sprintf(expanded, pattern, curr_num);
139 memcpy(de->name, expanded, MSDOS_NAME);
140 clu_num = fs->root_cluster;
141 i = 0;
142 offset2 = cluster_start(fs, clu_num);
143 while (clu_num > 0 && clu_num != -1) {
144 fs_read(offset2, sizeof(DIR_ENT), &d2);
145 if (offset2 != offset &&
146 !strncmp((const char *)d2.name, (const char *)de->name,
147 MSDOS_NAME))
148 break;
149 i += sizeof(DIR_ENT);
150 offset2 += sizeof(DIR_ENT);
151 if ((i % fs->cluster_size) == 0) {
152 if ((clu_num = next_cluster(fs, clu_num)) == 0 ||
153 clu_num == -1)
154 break;
155 offset2 = cluster_start(fs, clu_num);
156 }
157 }
158 if (clu_num == 0 || clu_num == -1)
147159 break;
148 i += sizeof(DIR_ENT);
149 offset2 += sizeof(DIR_ENT);
150 if ((i % fs->cluster_size) == 0) {
151 if ((clu_num = next_cluster(fs, clu_num)) == 0 ||
152 clu_num == -1)
153 break;
154 offset2 = cluster_start(fs, clu_num);
155 }
156 }
157 if (clu_num == 0 || clu_num == -1)
158 break;
159 if (++curr_num >= 10000)
160 die("Unable to create unique name");
160 if (++curr_num >= 10000)
161 die("Unable to create unique name");
162 }
163 } else {
164 memcpy(de->name, pattern, MSDOS_NAME);
161165 }
162166 } else {
163167 DIR_ENT *root;
176180 die("Root directory is full.");
177181 offset = fs->root_start + next_free * sizeof(DIR_ENT);
178182 memset(de, 0, sizeof(DIR_ENT));
179 while (1) {
180 char expanded[12];
181 sprintf(expanded, pattern, curr_num);
182 memcpy(de->name, expanded, MSDOS_NAME);
183 for (scan = 0; scan < fs->root_entries; scan++)
184 if (scan != next_free &&
185 !strncmp((const char *)root[scan].name,
186 (const char *)de->name, MSDOS_NAME))
183 if (gen_name) {
184 while (1) {
185 char expanded[12];
186 sprintf(expanded, pattern, curr_num);
187 memcpy(de->name, expanded, MSDOS_NAME);
188 for (scan = 0; scan < fs->root_entries; scan++)
189 if (scan != next_free &&
190 !strncmp((const char *)root[scan].name,
191 (const char *)de->name, MSDOS_NAME))
192 break;
193 if (scan == fs->root_entries)
187194 break;
188 if (scan == fs->root_entries)
189 break;
190 if (++curr_num >= 10000)
191 die("Unable to create unique name");
195 if (++curr_num >= 10000)
196 die("Unable to create unique name");
197 }
198 } else {
199 memcpy(de->name, pattern, MSDOS_NAME);
192200 }
193201 free(root);
194202 }
601609 if (!owner->offset) {
602610 printf(" Truncating second to %llu bytes because first "
603611 "is FAT32 root dir.\n",
604 (unsigned long long)clusters2 * fs->cluster_size);
612 (unsigned long long)clusters * fs->cluster_size);
605613 do_trunc = 2;
606614 } else if (!file->offset) {
607615 printf(" Truncating first to %llu bytes because second "
608616 "is FAT32 root dir.\n",
609 (unsigned long long)clusters * fs->cluster_size);
617 (unsigned long long)clusters2 * fs->cluster_size);
610618 do_trunc = 1;
611619 } else if (interactive)
612620 printf("1) Truncate first to %llu bytes%s\n"
613621 "2) Truncate second to %llu bytes\n",
614 (unsigned long long)clusters * fs->cluster_size,
622 (unsigned long long)clusters2 * fs->cluster_size,
615623 restart ? " and restart" : "",
616 (unsigned long long)clusters2 * fs->cluster_size);
624 (unsigned long long)clusters * fs->cluster_size);
617625 else
618626 printf(" Truncating second to %llu bytes.\n",
619 (unsigned long long)clusters2 * fs->cluster_size);
627 (unsigned long long)clusters * fs->cluster_size);
620628 if (do_trunc != 2
621629 && (do_trunc == 1
622630 || (interactive && get_key("12", "?") == '1'))) {
878886 MODIFY_START(file, next_cluster(fs, walk), fs);
879887 set_fat(fs, walk, -2);
880888 }
889 } else {
890 prev = walk;
891 clusters++;
881892 }
882893 set_owner(fs, walk, file);
883894 }
2222 #ifndef _CHECK_H
2323 #define _CHECK_H
2424
25 off_t alloc_rootdir_entry(DOS_FS * fs, DIR_ENT * de, const char *pattern);
25 off_t alloc_rootdir_entry(DOS_FS * fs, DIR_ENT * de, const char *pattern, int gen_name);
2626
27 /* Allocate a free slot in the root directory for a new file. The file name is
28 constructed after 'pattern', which must include a %d type format for printf
29 and expand to exactly 11 characters. The name actually used is written into
30 the 'de' structure, the rest of *de is cleared. The offset returned is to
31 where in the filesystem the entry belongs. */
27 /* Allocate a free slot in the root directory for a new file. If gen_name is
28 true, the file name is constructed after 'pattern', which must include a %d
29 type format for printf and expand to exactly 11 characters. The name
30 actually used is written into the 'de' structure, the rest of *de is cleared.
31 The offset returned is to where in the filesystem the entry belongs. */
3232
3333 int scan_root(DOS_FS * fs);
3434
2222 #ifndef _COMMON_H
2323 #define _COMMON_H
2424
25 void die(const char *msg, ...) __attribute((noreturn));
25 void die(const char *msg, ...)
26 __attribute((noreturn, format(printf, 1, 2)));
2627
2728 /* Displays a prinf-style message and terminates the program. */
2829
29 void pdie(const char *msg, ...) __attribute((noreturn));
30 void pdie(const char *msg, ...)
31 __attribute((noreturn, format(printf, 1, 2)));
3032
3133 /* Like die, but appends an error message according to the state of errno. */
3234
1616 */
1717
1818
19 #include <limits.h>
1920 #include <stdint.h>
2021 #include <stdbool.h>
2122 #include <sys/types.h>
44 #include <endian.h>
55 #elif defined(HAVE_SYS_ENDIAN_H)
66 #include <sys/endian.h>
7 #elif defined(__APPLE__)
7 #elif defined(HAVE_LIBKERN_OSBYTEORDER_H)
88 #include <libkern/OSByteOrder.h>
99
1010 #define htobe16(x) OSSwapHostToBigInt16(x)
502502 DIR_ENT de;
503503 off_t offset;
504504 files++;
505 offset = alloc_rootdir_entry(fs, &de, "FSCK%04dREC");
505 offset = alloc_rootdir_entry(fs, &de, "FSCK%04dREC", 1);
506506 de.start = htole16(i & 0xffff);
507507 if (fs->fat_bits == 32)
508508 de.starthi = htole16(i >> 16);
112112 }
113113 if (c == '\\') {
114114 c = 0;
115 name++;
115116 for (cnt = 3; cnt; cnt--) {
116117 if (*name < '0' || *name > '7') {
117 printf("Invalid octal character.\n");
118 printf("Expected three octal digits.\n");
118119 return 0;
119120 }
120121 c = c * 8 + *name++ - '0';
121122 }
122 if (cnt < 4) {
123 printf("Expected three octal digits.\n");
124 return 0;
125 }
126 name += 3;
123 name--;
127124 }
128125 if (islower(c))
129126 c = toupper(c);
110110
111111 struct info_sector {
112112 uint32_t magic; /* Magic for info sector ('RRaA') */
113 uint8_t junk[0x1dc];
114 uint32_t reserved1; /* Nothing as far as I can tell */
113 uint8_t reserved1[480];
115114 uint32_t signature; /* 0x61417272 ('rrAa') */
116115 uint32_t free_clusters; /* Free cluster count. -1 if unknown */
117116 uint32_t next_cluster; /* Most recently allocated cluster. */
118 uint32_t reserved2[3];
119 uint16_t reserved3;
120 uint16_t boot_sign;
117 uint8_t reserved2[12];
118 uint32_t boot_sign;
121119 };
122120
123121 typedef struct {
8080 int got;
8181
8282 if (lseek(fd, pos, 0) != pos)
83 pdie("Seek to %lld", pos);
83 pdie("Seek to %lld", (long long)pos);
8484 if ((got = read(fd, data, size)) < 0)
85 pdie("Read %d bytes at %lld", size, pos);
85 pdie("Read %d bytes at %lld", size, (long long)pos);
8686 if (got != size)
87 die("Got %d bytes instead of %d at %lld", got, size, pos);
87 die("Got %d bytes instead of %d at %lld", got, size, (long long)pos);
8888 for (walk = changes; walk; walk = walk->next) {
8989 if (walk->pos < pos + size && walk->pos + walk->size > pos) {
9090 if (walk->pos < pos)
103103 int okay;
104104
105105 if (lseek(fd, pos, 0) != pos)
106 pdie("Seek to %lld", pos);
106 pdie("Seek to %lld", (long long)pos);
107107 scratch = alloc(size);
108108 okay = read(fd, scratch, size) == size;
109109 free(scratch);
118118 if (write_immed) {
119119 did_change = 1;
120120 if (lseek(fd, pos, 0) != pos)
121 pdie("Seek to %lld", pos);
121 pdie("Seek to %lld", (long long)pos);
122122 if ((did = write(fd, data, size)) == size)
123123 return;
124124 if (did < 0)
125 pdie("Write %d bytes at %lld", size, pos);
126 die("Wrote %d bytes instead of %d at %lld", did, size, pos);
125 pdie("Write %d bytes at %lld", size, (long long)pos);
126 die("Wrote %d bytes instead of %d at %lld", did, size, (long long)pos);
127127 }
128128 new = alloc(sizeof(CHANGE));
129129 new->pos = pos;
224224 static time_t create_time; /* Creation time */
225225 static char volume_name[] = NO_NAME; /* Volume name */
226226 static uint64_t blocks; /* Number of blocks in filesystem */
227 static int sector_size = 512; /* Size of a logical sector */
227 static unsigned sector_size = 512; /* Size of a logical sector */
228228 static int sector_size_set = 0; /* User selected sector size */
229229 static int backup_boot = 0; /* Sector# of backup boot sector */
230230 static int reserved_sectors = 0; /* Number of reserved sectors */
518518 unsigned int cluster_size = 4; /* starting point for FAT12 and FAT16 */
519519 int def_root_dir_entries = 512;
520520
521 if (info->size < 512 * 1024 * 1024) {
522 /*
523 * These values are more or less meaningless, but we can at least
524 * use less extreme values for smaller filesystems where the large
525 * dummy values signifying LBA only access are not needed.
526 */
527 sec_per_track = 32;
528 heads = 64;
529 }
530
521531 if (info->type != TYPE_FIXED) {
522532 /* enter default parameters for floppy disks if the size matches */
523533 switch (info->size / 1024) {
803813 if (clust16 < FAT12_THRESHOLD
804814 && !(size_fat_by_user && size_fat == 16)) {
805815 if (verbose >= 2)
806 printf(clust16 < FAT12_THRESHOLD ?
807 "FAT16: would be misdetected as FAT12\n" :
808 "FAT16: too much clusters\n");
816 printf("FAT16: would be misdetected as FAT12\n");
809817 clust16 = 0;
810818 }
811819
16181626 if (devinfo.size <= 0)
16191627 die("unable to discover size of %s");
16201628
1621 if (devinfo.sector_size > 0)
1622 sector_size = devinfo.sector_size;
1623
1624 cblocks = devinfo.size / BLOCK_SIZE;
1625 orphaned_sectors = (devinfo.size % BLOCK_SIZE) / sector_size;
1626
1627 if (blocks_specified) {
1628 if (blocks != cblocks) {
1629 fprintf(stderr, "Warning: block count mismatch: ");
1630 fprintf(stderr, "found %llu but assuming %llu.\n",
1631 (unsigned long long)cblocks, (unsigned long long)blocks);
1632 }
1633 } else {
1634 blocks = cblocks;
1635 }
1636
1637 /*
1638 * Ignore any 'full' fixed disk devices, if -I is not given.
1639 */
1640 if (!ignore_full_disk && devinfo.type == TYPE_FIXED &&
1641 devinfo.partition == 0)
1642 die("Device partition expected, not making filesystem on entire device '%s' (use -I to override)");
1643
1644 if (!ignore_full_disk && devinfo.has_children > 0)
1645 die("Partitions or virtual mappings on device '%s', not making filesystem (use -I to override)");
1646
16471629 if (devinfo.sector_size > 0) {
16481630 if (sector_size_set) {
16491631 if (sector_size < devinfo.sector_size) {
16631645 "Warning: sector size %d > 4096 is non-standard, filesystem may not be usable\n",
16641646 sector_size);
16651647
1648 cblocks = devinfo.size / BLOCK_SIZE;
1649 orphaned_sectors = (devinfo.size % BLOCK_SIZE) / sector_size;
1650
1651 if (blocks_specified) {
1652 if (blocks != cblocks) {
1653 fprintf(stderr, "Warning: block count mismatch: ");
1654 fprintf(stderr, "found %llu but assuming %llu.\n",
1655 (unsigned long long)cblocks, (unsigned long long)blocks);
1656 }
1657 } else {
1658 blocks = cblocks;
1659 }
1660
1661 /*
1662 * Ignore any 'full' fixed disk devices, if -I is not given.
1663 */
1664 if (!ignore_full_disk && devinfo.type == TYPE_FIXED &&
1665 devinfo.partition == 0)
1666 die("Device partition expected, not making filesystem on entire device '%s' (use -I to override)");
1667
1668 if (!ignore_full_disk && devinfo.has_children > 0)
1669 die("Partitions or virtual mappings on device '%s', not making filesystem (use -I to override)");
1670
16661671 establish_params(&devinfo);
16671672 /* Establish the media parameters */
16681673
0 #! /bin/sh
1 # test-driver - basic testsuite driver script.
2
3 scriptversion=2013-07-13.22; # UTC
4
5 # Copyright (C) 2011-2014 Free Software Foundation, Inc.
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20 # As a special exception to the GNU General Public License, if you
21 # distribute this file as part of a program that contains a
22 # configuration script generated by Autoconf, you may include it under
23 # the same distribution terms that you use for the rest of that program.
24
25 # This file is maintained in Automake, please report
26 # bugs to <bug-automake@gnu.org> or send patches to
27 # <automake-patches@gnu.org>.
28
29 # Make unconditional expansion of undefined variables an error. This
30 # helps a lot in preventing typo-related bugs.
31 set -u
32
33 usage_error ()
34 {
35 echo "$0: $*" >&2
36 print_usage >&2
37 exit 2
38 }
39
40 print_usage ()
41 {
42 cat <<END
43 Usage:
44 test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
45 [--expect-failure={yes|no}] [--color-tests={yes|no}]
46 [--enable-hard-errors={yes|no}] [--]
47 TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
48 The '--test-name', '--log-file' and '--trs-file' options are mandatory.
49 END
50 }
51
52 test_name= # Used for reporting.
53 log_file= # Where to save the output of the test script.
54 trs_file= # Where to save the metadata of the test run.
55 expect_failure=no
56 color_tests=no
57 enable_hard_errors=yes
58 while test $# -gt 0; do
59 case $1 in
60 --help) print_usage; exit $?;;
61 --version) echo "test-driver $scriptversion"; exit $?;;
62 --test-name) test_name=$2; shift;;
63 --log-file) log_file=$2; shift;;
64 --trs-file) trs_file=$2; shift;;
65 --color-tests) color_tests=$2; shift;;
66 --expect-failure) expect_failure=$2; shift;;
67 --enable-hard-errors) enable_hard_errors=$2; shift;;
68 --) shift; break;;
69 -*) usage_error "invalid option: '$1'";;
70 *) break;;
71 esac
72 shift
73 done
74
75 missing_opts=
76 test x"$test_name" = x && missing_opts="$missing_opts --test-name"
77 test x"$log_file" = x && missing_opts="$missing_opts --log-file"
78 test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
79 if test x"$missing_opts" != x; then
80 usage_error "the following mandatory options are missing:$missing_opts"
81 fi
82
83 if test $# -eq 0; then
84 usage_error "missing argument"
85 fi
86
87 if test $color_tests = yes; then
88 # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
89 red='' # Red.
90 grn='' # Green.
91 lgn='' # Light green.
92 blu='' # Blue.
93 mgn='' # Magenta.
94 std='' # No color.
95 else
96 red= grn= lgn= blu= mgn= std=
97 fi
98
99 do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
100 trap "st=129; $do_exit" 1
101 trap "st=130; $do_exit" 2
102 trap "st=141; $do_exit" 13
103 trap "st=143; $do_exit" 15
104
105 # Test script is run here.
106 "$@" >$log_file 2>&1
107 estatus=$?
108
109 if test $enable_hard_errors = no && test $estatus -eq 99; then
110 tweaked_estatus=1
111 else
112 tweaked_estatus=$estatus
113 fi
114
115 case $tweaked_estatus:$expect_failure in
116 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
117 0:*) col=$grn res=PASS recheck=no gcopy=no;;
118 77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
119 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
120 *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
121 *:*) col=$red res=FAIL recheck=yes gcopy=yes;;
122 esac
123
124 # Report the test outcome and exit status in the logs, so that one can
125 # know whether the test passed or failed simply by looking at the '.log'
126 # file, without the need of also peaking into the corresponding '.trs'
127 # file (automake bug#11814).
128 echo "$res $test_name (exit status: $estatus)" >>$log_file
129
130 # Report outcome to console.
131 echo "${col}${res}${std}: $test_name"
132
133 # Register the test result, and other relevant metadata.
134 echo ":test-result: $res" > $trs_file
135 echo ":global-test-result: $res" >> $trs_file
136 echo ":recheck: $recheck" >> $trs_file
137 echo ":copy-in-global-log: $gcopy" >> $trs_file
138
139 # Local Variables:
140 # mode: shell-script
141 # sh-indentation: 2
142 # eval: (add-hook 'write-file-hooks 'time-stamp)
143 # time-stamp-start: "scriptversion="
144 # time-stamp-format: "%:y-%02m-%02d.%02H"
145 # time-stamp-time-zone: "UTC"
146 # time-stamp-end: "; # UTC"
147 # End:
0 AM_TESTS_ENVIRONMENT = XXD_FOUND=@XXD_FOUND@; export XXD_FOUND;
1
2 if AUTOMAKE_TEST_COMPAT
3 TESTS_ENVIRONMENT = $(AM_TESTS_ENVIRONMENT)
4 endif
5
6 TESTS = referenceFAT12.mkfs \
7 referenceFAT16.mkfs \
8 referenceFAT32.mkfs \
9 check-bad_names.fsck \
10 check-chain_to_free_cluster.fsck \
11 check-chain_too_long.fsck \
12 check-chain_to_other_file.fsck \
13 check-circular_chain.fsck \
14 check-duplicate_names.fsck \
15 check-dot_entries.fsck
16
17 XFAIL_TESTS = check-dot_entries.fsck
18
19 TEST_EXTENSIONS = .mkfs .fsck
20 MKFS_LOG_COMPILER = $(srcdir)/test-mkfs
21 FSCK_LOG_COMPILER = $(srcdir)/test-fsck
22
23 dist_check_DATA = test-mkfs test-fsck \
24 referenceFAT12.mkfs \
25 referenceFAT12.xxd \
26 referenceFAT16.mkfs \
27 referenceFAT16.xxd \
28 referenceFAT32.mkfs \
29 referenceFAT32.xxd \
30 check-bad_names.fsck \
31 check-chain_to_free_cluster.fsck \
32 check-chain_too_long.fsck \
33 check-chain_to_other_file.fsck \
34 check-circular_chain.fsck \
35 check-duplicate_names.fsck \
36 check-dot_entries.fsck
0 # Makefile.in generated by automake 1.15 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994-2014 Free Software Foundation, Inc.
4
5 # This Makefile.in is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 @SET_MAKE@
15 VPATH = @srcdir@
16 am__is_gnu_make = { \
17 if test -z '$(MAKELEVEL)'; then \
18 false; \
19 elif test -n '$(MAKE_HOST)'; then \
20 true; \
21 elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
22 true; \
23 else \
24 false; \
25 fi; \
26 }
27 am__make_running_with_option = \
28 case $${target_option-} in \
29 ?) ;; \
30 *) echo "am__make_running_with_option: internal error: invalid" \
31 "target option '$${target_option-}' specified" >&2; \
32 exit 1;; \
33 esac; \
34 has_opt=no; \
35 sane_makeflags=$$MAKEFLAGS; \
36 if $(am__is_gnu_make); then \
37 sane_makeflags=$$MFLAGS; \
38 else \
39 case $$MAKEFLAGS in \
40 *\\[\ \ ]*) \
41 bs=\\; \
42 sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
43 | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
44 esac; \
45 fi; \
46 skip_next=no; \
47 strip_trailopt () \
48 { \
49 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
50 }; \
51 for flg in $$sane_makeflags; do \
52 test $$skip_next = yes && { skip_next=no; continue; }; \
53 case $$flg in \
54 *=*|--*) continue;; \
55 -*I) strip_trailopt 'I'; skip_next=yes;; \
56 -*I?*) strip_trailopt 'I';; \
57 -*O) strip_trailopt 'O'; skip_next=yes;; \
58 -*O?*) strip_trailopt 'O';; \
59 -*l) strip_trailopt 'l'; skip_next=yes;; \
60 -*l?*) strip_trailopt 'l';; \
61 -[dEDm]) skip_next=yes;; \
62 -[JT]) skip_next=yes;; \
63 esac; \
64 case $$flg in \
65 *$$target_option*) has_opt=yes; break;; \
66 esac; \
67 done; \
68 test $$has_opt = yes
69 am__make_dryrun = (target_option=n; $(am__make_running_with_option))
70 am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
71 pkgdatadir = $(datadir)/@PACKAGE@
72 pkgincludedir = $(includedir)/@PACKAGE@
73 pkglibdir = $(libdir)/@PACKAGE@
74 pkglibexecdir = $(libexecdir)/@PACKAGE@
75 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
76 install_sh_DATA = $(install_sh) -c -m 644
77 install_sh_PROGRAM = $(install_sh) -c
78 install_sh_SCRIPT = $(install_sh) -c
79 INSTALL_HEADER = $(INSTALL_DATA)
80 transform = $(program_transform_name)
81 NORMAL_INSTALL = :
82 PRE_INSTALL = :
83 POST_INSTALL = :
84 NORMAL_UNINSTALL = :
85 PRE_UNINSTALL = :
86 POST_UNINSTALL = :
87 subdir = tests
88 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
89 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
90 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
91 $(ACLOCAL_M4)
92 DIST_COMMON = $(srcdir)/Makefile.am $(dist_check_DATA) \
93 $(am__DIST_COMMON)
94 mkinstalldirs = $(install_sh) -d
95 CONFIG_CLEAN_FILES =
96 CONFIG_CLEAN_VPATH_FILES =
97 AM_V_P = $(am__v_P_@AM_V@)
98 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
99 am__v_P_0 = false
100 am__v_P_1 = :
101 AM_V_GEN = $(am__v_GEN_@AM_V@)
102 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
103 am__v_GEN_0 = @echo " GEN " $@;
104 am__v_GEN_1 =
105 AM_V_at = $(am__v_at_@AM_V@)
106 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
107 am__v_at_0 = @
108 am__v_at_1 =
109 SOURCES =
110 DIST_SOURCES =
111 am__can_run_installinfo = \
112 case $$AM_UPDATE_INFO_DIR in \
113 n|no|NO) false;; \
114 *) (install-info --version) >/dev/null 2>&1;; \
115 esac
116 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
117 am__tty_colors_dummy = \
118 mgn= red= grn= lgn= blu= brg= std=; \
119 am__color_tests=no
120 am__tty_colors = { \
121 $(am__tty_colors_dummy); \
122 if test "X$(AM_COLOR_TESTS)" = Xno; then \
123 am__color_tests=no; \
124 elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
125 am__color_tests=yes; \
126 elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
127 am__color_tests=yes; \
128 fi; \
129 if test $$am__color_tests = yes; then \
130 red=''; \
131 grn=''; \
132 lgn=''; \
133 blu=''; \
134 mgn=''; \
135 brg=''; \
136 std=''; \
137 fi; \
138 }
139 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
140 am__vpath_adj = case $$p in \
141 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
142 *) f=$$p;; \
143 esac;
144 am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
145 am__install_max = 40
146 am__nobase_strip_setup = \
147 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
148 am__nobase_strip = \
149 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
150 am__nobase_list = $(am__nobase_strip_setup); \
151 for p in $$list; do echo "$$p $$p"; done | \
152 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
153 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
154 if (++n[$$2] == $(am__install_max)) \
155 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
156 END { for (dir in files) print dir, files[dir] }'
157 am__base_list = \
158 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
159 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
160 am__uninstall_files_from_dir = { \
161 test -z "$$files" \
162 || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
163 || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
164 $(am__cd) "$$dir" && rm -f $$files; }; \
165 }
166 am__recheck_rx = ^[ ]*:recheck:[ ]*
167 am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
168 am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
169 # A command that, given a newline-separated list of test names on the
170 # standard input, print the name of the tests that are to be re-run
171 # upon "make recheck".
172 am__list_recheck_tests = $(AWK) '{ \
173 recheck = 1; \
174 while ((rc = (getline line < ($$0 ".trs"))) != 0) \
175 { \
176 if (rc < 0) \
177 { \
178 if ((getline line2 < ($$0 ".log")) < 0) \
179 recheck = 0; \
180 break; \
181 } \
182 else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
183 { \
184 recheck = 0; \
185 break; \
186 } \
187 else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
188 { \
189 break; \
190 } \
191 }; \
192 if (recheck) \
193 print $$0; \
194 close ($$0 ".trs"); \
195 close ($$0 ".log"); \
196 }'
197 # A command that, given a newline-separated list of test names on the
198 # standard input, create the global log from their .trs and .log files.
199 am__create_global_log = $(AWK) ' \
200 function fatal(msg) \
201 { \
202 print "fatal: making $@: " msg | "cat >&2"; \
203 exit 1; \
204 } \
205 function rst_section(header) \
206 { \
207 print header; \
208 len = length(header); \
209 for (i = 1; i <= len; i = i + 1) \
210 printf "="; \
211 printf "\n\n"; \
212 } \
213 { \
214 copy_in_global_log = 1; \
215 global_test_result = "RUN"; \
216 while ((rc = (getline line < ($$0 ".trs"))) != 0) \
217 { \
218 if (rc < 0) \
219 fatal("failed to read from " $$0 ".trs"); \
220 if (line ~ /$(am__global_test_result_rx)/) \
221 { \
222 sub("$(am__global_test_result_rx)", "", line); \
223 sub("[ ]*$$", "", line); \
224 global_test_result = line; \
225 } \
226 else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
227 copy_in_global_log = 0; \
228 }; \
229 if (copy_in_global_log) \
230 { \
231 rst_section(global_test_result ": " $$0); \
232 while ((rc = (getline line < ($$0 ".log"))) != 0) \
233 { \
234 if (rc < 0) \
235 fatal("failed to read from " $$0 ".log"); \
236 print line; \
237 }; \
238 printf "\n"; \
239 }; \
240 close ($$0 ".trs"); \
241 close ($$0 ".log"); \
242 }'
243 # Restructured Text title.
244 am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
245 # Solaris 10 'make', and several other traditional 'make' implementations,
246 # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
247 # by disabling -e (using the XSI extension "set +e") if it's set.
248 am__sh_e_setup = case $$- in *e*) set +e;; esac
249 # Default flags passed to test drivers.
250 am__common_driver_flags = \
251 --color-tests "$$am__color_tests" \
252 --enable-hard-errors "$$am__enable_hard_errors" \
253 --expect-failure "$$am__expect_failure"
254 # To be inserted before the command running the test. Creates the
255 # directory for the log if needed. Stores in $dir the directory
256 # containing $f, in $tst the test, in $log the log. Executes the
257 # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
258 # passes TESTS_ENVIRONMENT. Set up options for the wrapper that
259 # will run the test scripts (or their associated LOG_COMPILER, if
260 # thy have one).
261 am__check_pre = \
262 $(am__sh_e_setup); \
263 $(am__vpath_adj_setup) $(am__vpath_adj) \
264 $(am__tty_colors); \
265 srcdir=$(srcdir); export srcdir; \
266 case "$@" in \
267 */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
268 *) am__odir=.;; \
269 esac; \
270 test "x$$am__odir" = x"." || test -d "$$am__odir" \
271 || $(MKDIR_P) "$$am__odir" || exit $$?; \
272 if test -f "./$$f"; then dir=./; \
273 elif test -f "$$f"; then dir=; \
274 else dir="$(srcdir)/"; fi; \
275 tst=$$dir$$f; log='$@'; \
276 if test -n '$(DISABLE_HARD_ERRORS)'; then \
277 am__enable_hard_errors=no; \
278 else \
279 am__enable_hard_errors=yes; \
280 fi; \
281 case " $(XFAIL_TESTS) " in \
282 *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
283 am__expect_failure=yes;; \
284 *) \
285 am__expect_failure=no;; \
286 esac; \
287 $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
288 # A shell command to get the names of the tests scripts with any registered
289 # extension removed (i.e., equivalently, the names of the test logs, with
290 # the '.log' extension removed). The result is saved in the shell variable
291 # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
292 # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
293 # since that might cause problem with VPATH rewrites for suffix-less tests.
294 # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
295 am__set_TESTS_bases = \
296 bases='$(TEST_LOGS)'; \
297 bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
298 bases=`echo $$bases`
299 RECHECK_LOGS = $(TEST_LOGS)
300 AM_RECURSIVE_TARGETS = check recheck
301 TEST_SUITE_LOG = test-suite.log
302 am__test_logs1 = $(TESTS:=.log)
303 am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
304 am__test_logs3 = $(am__test_logs2:.mkfs.log=.log)
305 MKFS_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
306 MKFS_LOG_COMPILE = $(MKFS_LOG_COMPILER) $(AM_MKFS_LOG_FLAGS) \
307 $(MKFS_LOG_FLAGS)
308 am__set_b = \
309 case '$@' in \
310 */*) \
311 case '$*' in \
312 */*) b='$*';; \
313 *) b=`echo '$@' | sed 's/\.log$$//'`; \
314 esac;; \
315 *) \
316 b='$*';; \
317 esac
318 TEST_LOGS = $(am__test_logs3:.fsck.log=.log)
319 FSCK_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
320 FSCK_LOG_COMPILE = $(FSCK_LOG_COMPILER) $(AM_FSCK_LOG_FLAGS) \
321 $(FSCK_LOG_FLAGS)
322 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/test-driver
323 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
324 ACLOCAL = @ACLOCAL@
325 AMTAR = @AMTAR@
326 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
327 AUTOCONF = @AUTOCONF@
328 AUTOHEADER = @AUTOHEADER@
329 AUTOMAKE = @AUTOMAKE@
330 AWK = @AWK@
331 CC = @CC@
332 CCDEPMODE = @CCDEPMODE@
333 CFLAGS = @CFLAGS@
334 CPP = @CPP@
335 CPPFLAGS = @CPPFLAGS@
336 CYGPATH_W = @CYGPATH_W@
337 DEFS = @DEFS@
338 DEPDIR = @DEPDIR@
339 ECHO_C = @ECHO_C@
340 ECHO_N = @ECHO_N@
341 ECHO_T = @ECHO_T@
342 EGREP = @EGREP@
343 EXEEXT = @EXEEXT@
344 GREP = @GREP@
345 INSTALL = @INSTALL@
346 INSTALL_DATA = @INSTALL_DATA@
347 INSTALL_PROGRAM = @INSTALL_PROGRAM@
348 INSTALL_SCRIPT = @INSTALL_SCRIPT@
349 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
350 LDFLAGS = @LDFLAGS@
351 LIBOBJS = @LIBOBJS@
352 LIBS = @LIBS@
353 LN_S = @LN_S@
354 LTLIBOBJS = @LTLIBOBJS@
355 MAKEINFO = @MAKEINFO@
356 MKDIR_P = @MKDIR_P@
357 OBJEXT = @OBJEXT@
358 PACKAGE = @PACKAGE@
359 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
360 PACKAGE_NAME = @PACKAGE_NAME@
361 PACKAGE_STRING = @PACKAGE_STRING@
362 PACKAGE_TARNAME = @PACKAGE_TARNAME@
363 PACKAGE_URL = @PACKAGE_URL@
364 PACKAGE_VERSION = @PACKAGE_VERSION@
365 PATH_SEPARATOR = @PATH_SEPARATOR@
366 PKG_CONFIG = @PKG_CONFIG@
367 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
368 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
369 RELEASE_DATE = @RELEASE_DATE@
370 SET_MAKE = @SET_MAKE@
371 SHELL = @SHELL@
372 STRIP = @STRIP@
373 UDEV_CFLAGS = @UDEV_CFLAGS@
374 UDEV_LIBS = @UDEV_LIBS@
375 VERSION = @VERSION@
376 XXD_FOUND = @XXD_FOUND@
377 abs_builddir = @abs_builddir@
378 abs_srcdir = @abs_srcdir@
379 abs_top_builddir = @abs_top_builddir@
380 abs_top_srcdir = @abs_top_srcdir@
381 ac_ct_CC = @ac_ct_CC@
382 am__include = @am__include@
383 am__leading_dot = @am__leading_dot@
384 am__quote = @am__quote@
385 am__tar = @am__tar@
386 am__untar = @am__untar@
387 bindir = @bindir@
388 build_alias = @build_alias@
389 builddir = @builddir@
390 datadir = @datadir@
391 datarootdir = @datarootdir@
392 docdir = @docdir@
393 dvidir = @dvidir@
394 exec_prefix = @exec_prefix@
395 host_alias = @host_alias@
396 htmldir = @htmldir@
397 includedir = @includedir@
398 infodir = @infodir@
399 install_sh = @install_sh@
400 libdir = @libdir@
401 libexecdir = @libexecdir@
402 localedir = @localedir@
403 localstatedir = @localstatedir@
404 mandir = @mandir@
405 mkdir_p = @mkdir_p@
406 oldincludedir = @oldincludedir@
407 pdfdir = @pdfdir@
408 prefix = @prefix@
409 program_transform_name = @program_transform_name@
410 psdir = @psdir@
411 runstatedir = @runstatedir@
412 sbindir = @sbindir@
413 sharedstatedir = @sharedstatedir@
414 srcdir = @srcdir@
415 sysconfdir = @sysconfdir@
416 target_alias = @target_alias@
417 top_build_prefix = @top_build_prefix@
418 top_builddir = @top_builddir@
419 top_srcdir = @top_srcdir@
420 AM_TESTS_ENVIRONMENT = XXD_FOUND=@XXD_FOUND@; export XXD_FOUND;
421 @AUTOMAKE_TEST_COMPAT_TRUE@TESTS_ENVIRONMENT = $(AM_TESTS_ENVIRONMENT)
422 TESTS = referenceFAT12.mkfs \
423 referenceFAT16.mkfs \
424 referenceFAT32.mkfs \
425 check-bad_names.fsck \
426 check-chain_to_free_cluster.fsck \
427 check-chain_too_long.fsck \
428 check-chain_to_other_file.fsck \
429 check-circular_chain.fsck \
430 check-duplicate_names.fsck \
431 check-dot_entries.fsck
432
433 XFAIL_TESTS = check-dot_entries.fsck
434 TEST_EXTENSIONS = .mkfs .fsck
435 MKFS_LOG_COMPILER = $(srcdir)/test-mkfs
436 FSCK_LOG_COMPILER = $(srcdir)/test-fsck
437 dist_check_DATA = test-mkfs test-fsck \
438 referenceFAT12.mkfs \
439 referenceFAT12.xxd \
440 referenceFAT16.mkfs \
441 referenceFAT16.xxd \
442 referenceFAT32.mkfs \
443 referenceFAT32.xxd \
444 check-bad_names.fsck \
445 check-chain_to_free_cluster.fsck \
446 check-chain_too_long.fsck \
447 check-chain_to_other_file.fsck \
448 check-circular_chain.fsck \
449 check-duplicate_names.fsck \
450 check-dot_entries.fsck
451
452 all: all-am
453
454 .SUFFIXES:
455 .SUFFIXES: .fsck .fsck$(EXEEXT) .log .mkfs .mkfs$(EXEEXT) .trs
456 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
457 @for dep in $?; do \
458 case '$(am__configure_deps)' in \
459 *$$dep*) \
460 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
461 && { if test -f $@; then exit 0; else break; fi; }; \
462 exit 1;; \
463 esac; \
464 done; \
465 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \
466 $(am__cd) $(top_srcdir) && \
467 $(AUTOMAKE) --foreign tests/Makefile
468 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
469 @case '$?' in \
470 *config.status*) \
471 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
472 *) \
473 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
474 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
475 esac;
476
477 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
478 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
479
480 $(top_srcdir)/configure: $(am__configure_deps)
481 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
482 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
483 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
484 $(am__aclocal_m4_deps):
485 tags TAGS:
486
487 ctags CTAGS:
488
489 cscope cscopelist:
490
491
492 # Recover from deleted '.trs' file; this should ensure that
493 # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
494 # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
495 # to avoid problems with "make -n".
496 .log.trs:
497 rm -f $< $@
498 $(MAKE) $(AM_MAKEFLAGS) $<
499
500 # Leading 'am--fnord' is there to ensure the list of targets does not
501 # expand to empty, as could happen e.g. with make check TESTS=''.
502 am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
503 am--force-recheck:
504 @:
505
506 $(TEST_SUITE_LOG): $(TEST_LOGS)
507 @$(am__set_TESTS_bases); \
508 am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
509 redo_bases=`for i in $$bases; do \
510 am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
511 done`; \
512 if test -n "$$redo_bases"; then \
513 redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
514 redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
515 if $(am__make_dryrun); then :; else \
516 rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
517 fi; \
518 fi; \
519 if test -n "$$am__remaking_logs"; then \
520 echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
521 "recursion detected" >&2; \
522 elif test -n "$$redo_logs"; then \
523 am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
524 fi; \
525 if $(am__make_dryrun); then :; else \
526 st=0; \
527 errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
528 for i in $$redo_bases; do \
529 test -f $$i.trs && test -r $$i.trs \
530 || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
531 test -f $$i.log && test -r $$i.log \
532 || { echo "$$errmsg $$i.log" >&2; st=1; }; \
533 done; \
534 test $$st -eq 0 || exit 1; \
535 fi
536 @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
537 ws='[ ]'; \
538 results=`for b in $$bases; do echo $$b.trs; done`; \
539 test -n "$$results" || results=/dev/null; \
540 all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
541 pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
542 fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
543 skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
544 xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
545 xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
546 error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
547 if test `expr $$fail + $$xpass + $$error` -eq 0; then \
548 success=true; \
549 else \
550 success=false; \
551 fi; \
552 br='==================='; br=$$br$$br$$br$$br; \
553 result_count () \
554 { \
555 if test x"$$1" = x"--maybe-color"; then \
556 maybe_colorize=yes; \
557 elif test x"$$1" = x"--no-color"; then \
558 maybe_colorize=no; \
559 else \
560 echo "$@: invalid 'result_count' usage" >&2; exit 4; \
561 fi; \
562 shift; \
563 desc=$$1 count=$$2; \
564 if test $$maybe_colorize = yes && test $$count -gt 0; then \
565 color_start=$$3 color_end=$$std; \
566 else \
567 color_start= color_end=; \
568 fi; \
569 echo "$${color_start}# $$desc $$count$${color_end}"; \
570 }; \
571 create_testsuite_report () \
572 { \
573 result_count $$1 "TOTAL:" $$all "$$brg"; \
574 result_count $$1 "PASS: " $$pass "$$grn"; \
575 result_count $$1 "SKIP: " $$skip "$$blu"; \
576 result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
577 result_count $$1 "FAIL: " $$fail "$$red"; \
578 result_count $$1 "XPASS:" $$xpass "$$red"; \
579 result_count $$1 "ERROR:" $$error "$$mgn"; \
580 }; \
581 { \
582 echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
583 $(am__rst_title); \
584 create_testsuite_report --no-color; \
585 echo; \
586 echo ".. contents:: :depth: 2"; \
587 echo; \
588 for b in $$bases; do echo $$b; done \
589 | $(am__create_global_log); \
590 } >$(TEST_SUITE_LOG).tmp || exit 1; \
591 mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
592 if $$success; then \
593 col="$$grn"; \
594 else \
595 col="$$red"; \
596 test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
597 fi; \
598 echo "$${col}$$br$${std}"; \
599 echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
600 echo "$${col}$$br$${std}"; \
601 create_testsuite_report --maybe-color; \
602 echo "$$col$$br$$std"; \
603 if $$success; then :; else \
604 echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
605 if test -n "$(PACKAGE_BUGREPORT)"; then \
606 echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
607 fi; \
608 echo "$$col$$br$$std"; \
609 fi; \
610 $$success || exit 1
611
612 check-TESTS:
613 @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
614 @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
615 @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
616 @set +e; $(am__set_TESTS_bases); \
617 log_list=`for i in $$bases; do echo $$i.log; done`; \
618 trs_list=`for i in $$bases; do echo $$i.trs; done`; \
619 log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
620 $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
621 exit $$?;
622 recheck: all $(dist_check_DATA)
623 @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
624 @set +e; $(am__set_TESTS_bases); \
625 bases=`for i in $$bases; do echo $$i; done \
626 | $(am__list_recheck_tests)` || exit 1; \
627 log_list=`for i in $$bases; do echo $$i.log; done`; \
628 log_list=`echo $$log_list`; \
629 $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
630 am__force_recheck=am--force-recheck \
631 TEST_LOGS="$$log_list"; \
632 exit $$?
633 .mkfs.log:
634 @p='$<'; \
635 $(am__set_b); \
636 $(am__check_pre) $(MKFS_LOG_DRIVER) --test-name "$$f" \
637 --log-file $$b.log --trs-file $$b.trs \
638 $(am__common_driver_flags) $(AM_MKFS_LOG_DRIVER_FLAGS) $(MKFS_LOG_DRIVER_FLAGS) -- $(MKFS_LOG_COMPILE) \
639 "$$tst" $(AM_TESTS_FD_REDIRECT)
640 @am__EXEEXT_TRUE@.mkfs$(EXEEXT).log:
641 @am__EXEEXT_TRUE@ @p='$<'; \
642 @am__EXEEXT_TRUE@ $(am__set_b); \
643 @am__EXEEXT_TRUE@ $(am__check_pre) $(MKFS_LOG_DRIVER) --test-name "$$f" \
644 @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
645 @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_MKFS_LOG_DRIVER_FLAGS) $(MKFS_LOG_DRIVER_FLAGS) -- $(MKFS_LOG_COMPILE) \
646 @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
647 .fsck.log:
648 @p='$<'; \
649 $(am__set_b); \
650 $(am__check_pre) $(FSCK_LOG_DRIVER) --test-name "$$f" \
651 --log-file $$b.log --trs-file $$b.trs \
652 $(am__common_driver_flags) $(AM_FSCK_LOG_DRIVER_FLAGS) $(FSCK_LOG_DRIVER_FLAGS) -- $(FSCK_LOG_COMPILE) \
653 "$$tst" $(AM_TESTS_FD_REDIRECT)
654 @am__EXEEXT_TRUE@.fsck$(EXEEXT).log:
655 @am__EXEEXT_TRUE@ @p='$<'; \
656 @am__EXEEXT_TRUE@ $(am__set_b); \
657 @am__EXEEXT_TRUE@ $(am__check_pre) $(FSCK_LOG_DRIVER) --test-name "$$f" \
658 @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
659 @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_FSCK_LOG_DRIVER_FLAGS) $(FSCK_LOG_DRIVER_FLAGS) -- $(FSCK_LOG_COMPILE) \
660 @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
661
662 distdir: $(DISTFILES)
663 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
664 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
665 list='$(DISTFILES)'; \
666 dist_files=`for file in $$list; do echo $$file; done | \
667 sed -e "s|^$$srcdirstrip/||;t" \
668 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
669 case $$dist_files in \
670 */*) $(MKDIR_P) `echo "$$dist_files" | \
671 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
672 sort -u` ;; \
673 esac; \
674 for file in $$dist_files; do \
675 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
676 if test -d $$d/$$file; then \
677 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
678 if test -d "$(distdir)/$$file"; then \
679 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
680 fi; \
681 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
682 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
683 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
684 fi; \
685 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
686 else \
687 test -f "$(distdir)/$$file" \
688 || cp -p $$d/$$file "$(distdir)/$$file" \
689 || exit 1; \
690 fi; \
691 done
692 check-am: all-am
693 $(MAKE) $(AM_MAKEFLAGS) $(dist_check_DATA)
694 $(MAKE) $(AM_MAKEFLAGS) check-TESTS
695 check: check-am
696 all-am: Makefile
697 installdirs:
698 install: install-am
699 install-exec: install-exec-am
700 install-data: install-data-am
701 uninstall: uninstall-am
702
703 install-am: all-am
704 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
705
706 installcheck: installcheck-am
707 install-strip:
708 if test -z '$(STRIP)'; then \
709 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
710 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
711 install; \
712 else \
713 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
714 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
715 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
716 fi
717 mostlyclean-generic:
718 -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
719 -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
720 -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
721
722 clean-generic:
723
724 distclean-generic:
725 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
726 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
727
728 maintainer-clean-generic:
729 @echo "This command is intended for maintainers to use"
730 @echo "it deletes files that may require special tools to rebuild."
731 clean: clean-am
732
733 clean-am: clean-generic mostlyclean-am
734
735 distclean: distclean-am
736 -rm -f Makefile
737 distclean-am: clean-am distclean-generic
738
739 dvi: dvi-am
740
741 dvi-am:
742
743 html: html-am
744
745 html-am:
746
747 info: info-am
748
749 info-am:
750
751 install-data-am:
752
753 install-dvi: install-dvi-am
754
755 install-dvi-am:
756
757 install-exec-am:
758
759 install-html: install-html-am
760
761 install-html-am:
762
763 install-info: install-info-am
764
765 install-info-am:
766
767 install-man:
768
769 install-pdf: install-pdf-am
770
771 install-pdf-am:
772
773 install-ps: install-ps-am
774
775 install-ps-am:
776
777 installcheck-am:
778
779 maintainer-clean: maintainer-clean-am
780 -rm -f Makefile
781 maintainer-clean-am: distclean-am maintainer-clean-generic
782
783 mostlyclean: mostlyclean-am
784
785 mostlyclean-am: mostlyclean-generic
786
787 pdf: pdf-am
788
789 pdf-am:
790
791 ps: ps-am
792
793 ps-am:
794
795 uninstall-am:
796
797 .MAKE: check-am install-am install-strip
798
799 .PHONY: all all-am check check-TESTS check-am clean clean-generic \
800 cscopelist-am ctags-am distclean distclean-generic distdir dvi \
801 dvi-am html html-am info info-am install install-am \
802 install-data install-data-am install-dvi install-dvi-am \
803 install-exec install-exec-am install-html install-html-am \
804 install-info install-info-am install-man install-pdf \
805 install-pdf-am install-ps install-ps-am install-strip \
806 installcheck installcheck-am installdirs maintainer-clean \
807 maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
808 pdf-am ps ps-am recheck tags-am uninstall uninstall-am
809
810 .PRECIOUS: Makefile
811
812
813 # Tell versions [3.59,3.63) of GNU make to not export all variables.
814 # Otherwise a system limit (for SysV at least) may be exceeded.
815 .NOEXPORT:
0 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
1 00000010: 0200 0200 00f8 0001 2000 4000 0000 0000 ........ .@.....
2 00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
3 00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
4 00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
5 00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
6 00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
7 00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
8 00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
9 00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
10 000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
11 000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
12 000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
13 *
14 000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
15 00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
16 *
17 00001000: f8ff ffff 0000 0000 0000 0000 0000 0000 ................
18 00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
19 *
20 00021000: f8ff ffff 0000 0000 0000 0000 0000 0000 ................
21 00021010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
22 *
23 00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
24 00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
25 00041020: 4e41 4d20 3120 2020 4249 4e20 0000 cca0 NAM 1 BIN ....
26 00041030: 6249 6249 0000 cca0 6249 0000 0000 0000 bIbI....bI......
27 00041040: 4e41 4d45 3220 2020 4220 4e20 0000 cea0 NAME2 B N ....
28 00041050: 6249 6249 0000 cea0 6249 0000 0000 0000 bIbI....bI......
29 00041060: 4e41 4d45 3320 2020 4249 4e20 0064 cfa0 NAME3 BIN .d..
30 00041070: 6249 6249 0000 cfa0 6249 0000 0000 0000 bIbI....bI......
31 00041080: 4e3e 4d45 3420 2020 4249 4e20 0000 09a1 N>ME4 BIN ....
32 00041090: 6249 6249 0000 09a1 6249 0000 0000 0000 bIbI....bI......
33 000410a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
34 *
35 0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
1 00000010: 0200 0200 00f8 0001 2000 4000 0000 0000 ........ .@.....
2 00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
3 00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
4 00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
5 00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
6 00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
7 00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
8 00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
9 00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
10 000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
11 000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
12 000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
13 *
14 000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
15 00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
16 *
17 00001000: f8ff ffff 0000 0004 0000 0000 0000 0000 ................
18 00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
19 *
20 00021000: f8ff ffff 0000 0004 0000 0000 0000 0000 ................
21 00021010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
22 *
23 00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
24 00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
25 00041020: 5445 5354 2020 2020 5458 5420 0064 6a1b TEST TXT .dj.
26 00041030: 2749 2749 0000 6a1b 2749 0300 0500 0000 'I'I..j.'I......
27 00041040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
28 *
29 00046000: 7465 7374 0a00 0000 0000 0000 0000 0000 test............
30 00046010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
31 *
32 0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
1 00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
2 00000020: 0040 1f00 d007 0000 0000 0000 0200 0000 .@..............
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 8000 29cd ab34 1254 4553 5446 4154 3332 ..)..4.TESTFAT32
5 00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
6 00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
7 00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
8 00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
9 00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
10 000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
11 000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
12 000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
13 000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
14 000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
15 *
16 000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
17 00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
18 00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
19 *
20 000003e0: 0000 0000 7272 4161 fbe5 0300 0e00 0000 ....rrAa........
21 000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
22 00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
23 *
24 00000c00: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
25 00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
26 00000c20: 0040 1f00 d007 0000 0000 0000 0200 0000 .@..............
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 8000 29cd ab34 1254 4553 5446 4154 3332 ..)..4.TESTFAT32
29 00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
30 00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
31 00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
32 00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
33 00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
34 00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
35 00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
36 00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
37 00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
38 00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
39 *
40 00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
41 00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
42 *
43 00004000: f8ff ff0f ffff ff0f f8ff ff0f 0400 0000 ................
44 00004010: 0500 0000 0200 0000 ffff ff0f 0800 0000 ................
45 00004020: 0d00 0000 0a00 0000 ffff ff0f 0c00 0000 ................
46 00004030: 0d00 0000 0e00 0000 ffff ff0f 0000 0000 ................
47 00004040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
48 *
49 000fe000: f8ff ff0f ffff ff0f f8ff ff0f 0400 0000 ................
50 000fe010: 0500 0000 0200 0000 ffff ff0f 0800 0000 ................
51 000fe020: 0d00 0000 0a00 0000 ffff ff0f 0c00 0000 ................
52 000fe030: 0d00 0000 0e00 0000 ffff ff0f 0000 0000 ................
53 000fe040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
54 *
55 001f8000: 5445 5354 4641 5433 3220 2008 0000 5a4b TESTFAT32 ...ZK
56 001f8010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
57 001f8020: 5445 5354 524f 4f54 5458 5420 0064 1076 TESTROOTTXT .d.v
58 001f8030: 3149 3149 0000 1076 3149 0300 0040 0000 1I1I...v1I...@..
59 001f8040: 5445 5354 3120 2020 5458 5420 0064 1476 TEST1 TXT .d.v
60 001f8050: 3149 3149 0000 1476 3149 0700 0040 0000 1I1I...v1I...@..
61 001f8060: 5445 5354 3220 2020 5458 5420 0064 1576 TEST2 TXT .d.v
62 001f8070: 3149 3149 0000 1576 3149 0b00 0040 0000 1I1I...v1I...@..
63 001f8080: 0000 0000 0000 0000 0000 0000 0000 0000 ................
64 *
65 001f9000: 7465 7374 2063 6c75 7374 6572 2031 0a00 test cluster 1..
66 001f9010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
67 *
68 001fa000: 7465 7374 2063 6c75 7374 6572 2032 0a00 test cluster 2..
69 001fa010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
70 *
71 001fb000: 7465 7374 2063 6c75 7374 6572 2033 0a00 test cluster 3..
72 001fb010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
73 *
74 001fc000: 7465 7374 2063 6c75 7374 6572 2034 0a00 test cluster 4..
75 001fc010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
76 *
77 001fd000: 7465 7374 2063 6c75 7374 6572 2031 0a00 test cluster 1..
78 001fd010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
79 *
80 001fe000: 7465 7374 2063 6c75 7374 6572 2032 0a00 test cluster 2..
81 001fe010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
82 *
83 001ff000: 7465 7374 2063 6c75 7374 6572 2033 0a00 test cluster 3..
84 001ff010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
85 *
86 00200000: 7465 7374 2063 6c75 7374 6572 2034 0a00 test cluster 4..
87 00200010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
88 *
89 00201000: 7465 7374 2063 6c75 7374 6572 2031 0a00 test cluster 1..
90 00201010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
91 *
92 00202000: 7465 7374 2063 6c75 7374 6572 2032 0a00 test cluster 2..
93 00202010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
94 *
95 00203000: 7465 7374 2063 6c75 7374 6572 2033 0a00 test cluster 3..
96 00203010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
97 *
98 00204000: 7465 7374 2063 6c75 7374 6572 2034 0a00 test cluster 4..
99 00204010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
100 *
101 3e7ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
1 00000010: 0200 0200 00f8 0001 2000 4000 0000 0000 ........ .@.....
2 00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
3 00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
4 00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
5 00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
6 00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
7 00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
8 00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
9 00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
10 000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
11 000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
12 000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
13 *
14 000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
15 00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
16 *
17 00001000: f8ff ffff 0000 0400 ffff 0000 0000 0000 ................
18 00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
19 *
20 00021000: f8ff ffff 0000 0400 ffff 0000 0000 0000 ................
21 00021010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
22 *
23 00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
24 00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
25 00041020: 5445 5354 2020 2020 5458 5420 0000 e95a TEST TXT ...Z
26 00041030: 2749 2749 0000 e95a 2749 0300 0700 0000 'I'I...Z'I......
27 00041040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
28 *
29 00046000: 7465 7374 2031 0a00 0000 0000 0000 0000 test 1..........
30 00046010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
31 *
32 00047000: 7465 7374 2032 0a00 0000 0000 0000 0000 test 2..........
33 00047010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
34 *
35 0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
1 00000010: 0200 0200 00f8 0001 2000 4000 0000 0000 ........ .@.....
2 00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
3 00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
4 00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
5 00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
6 00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
7 00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
8 00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
9 00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
10 000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
11 000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
12 000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
13 *
14 000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
15 00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
16 *
17 00001000: f8ff ffff 0000 0400 0500 0400 ffff 0000 ................
18 00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
19 *
20 00021000: f8ff ffff 0000 0400 0500 0400 ffff 0000 ................
21 00021010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
22 *
23 00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
24 00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
25 00041020: 5445 5354 3443 4c53 5458 5420 0000 6f8d TEST4CLSTXT ..o.
26 00041030: 2c49 2c49 0000 6f8d 2c49 0300 0040 0000 ,I,I..o.,I...@..
27 00041040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
28 *
29 00046000: 7465 7374 2063 6c75 7374 6572 2031 0a00 test cluster 1..
30 00046010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
31 *
32 00047000: 7465 7374 2063 6c75 7374 6572 2032 0a00 test cluster 2..
33 00047010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
34 *
35 00048000: 7465 7374 2063 6c75 7374 6572 2033 0a00 test cluster 3..
36 00048010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
37 *
38 00049000: 7465 7374 2063 6c75 7374 6572 2034 0a00 test cluster 4..
39 00049010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
40 *
41 0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
1 00000010: 0200 0200 00f8 0001 2000 4000 0000 0000 ........ .@.....
2 00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
3 00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
4 00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
5 00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
6 00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
7 00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
8 00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
9 00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
10 000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
11 000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
12 000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
13 *
14 000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
15 00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
16 *
17 00001000: f8ff ffff 0000 ffff ffff ffff 0000 0000 ................
18 00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
19 *
20 00021000: f8ff ffff 0000 ffff ffff ffff 0000 0000 ................
21 00021010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
22 *
23 00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
24 00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
25 00041020: 4449 5220 2020 2020 2020 2010 0064 2012 DIR ..d .
26 00041030: 2749 2749 0000 2012 2749 0300 0000 0000 'I'I.. .'I......
27 00041040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
28 *
29 00046000: 5445 5354 3120 2020 5458 5420 0064 2012 TEST1 TXT .d .
30 00046010: 2749 2749 0000 2012 2749 0400 0700 0000 'I'I.. .'I......
31 00046020: 5445 5354 3220 2020 5458 5420 0064 2012 TEST2 TXT .d .
32 00046030: 2749 2749 0000 2012 2749 0500 0700 0000 'I'I.. .'I......
33 00046040: 2e2e 2020 2020 2020 2020 2010 0000 e611 .. .....
34 00046050: 2749 2749 0000 e611 2749 0000 0000 0000 'I'I....'I......
35 00046060: 2e20 2020 2020 2020 2020 2010 0000 e611 . .....
36 00046070: 2749 2749 0000 e611 2749 0300 0000 0000 'I'I....'I......
37 00046080: 0000 0000 0000 0000 0000 0000 0000 0000 ................
38 *
39 00047000: 7465 7374 2031 0a00 0000 0000 0000 0000 test 1..........
40 00047010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
41 *
42 00048000: 7465 7374 2032 0a00 0000 0000 0000 0000 test 2..........
43 00048010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
44 *
45 0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
1 00000010: 0200 0200 00f8 0001 2000 4000 0000 0000 ........ .@.....
2 00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
3 00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
4 00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
5 00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
6 00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
7 00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
8 00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
9 00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
10 000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
11 000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
12 000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
13 *
14 000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
15 00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
16 *
17 00001000: f8ff ffff 0000 ffff ffff 0000 0000 0000 ................
18 00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
19 *
20 00021000: f8ff ffff 0000 ffff ffff 0000 0000 0000 ................
21 00021010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
22 *
23 00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
24 00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
25 00041020: 5445 5354 2020 2020 5458 5420 0000 e95a TEST TXT ...Z
26 00041030: 2749 2749 0000 e95a 2749 0300 0700 0000 'I'I...Z'I......
27 00041040: 5445 5354 2020 2020 5458 5420 0000 e95a TEST TXT ...Z
28 00041050: 2749 2749 0000 e95a 2749 0400 0700 0000 'I'I...Z'I......
29 00041060: 0000 0000 0000 0000 0000 0000 0000 0000 ................
30 *
31 00046000: 7465 7374 2031 0a00 0000 0000 0000 0000 test 1..........
32 00046010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
33 *
34 00047000: 7465 7374 2032 0a00 0000 0000 0000 0000 test 2..........
35 00047010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
36 *
37 0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 ARGS="-n TESTFAT12"
1 SIZE=1440
2 CMP_LIMIT=
0 00000000: eb3c 906d 6b66 732e 6661 7400 0201 0100 .<.mkfs.fat.....
1 00000010: 02e0 0040 0bf0 0900 1200 0200 0000 0000 ...@............
2 00000020: 0000 0000 0000 29cd ab34 1254 4553 5446 ......)..4.TESTF
3 00000030: 4154 3132 2020 4641 5431 3220 2020 0e1f AT12 FAT12 ..
4 00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
5 00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
6 00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
7 00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
8 00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
9 00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
10 000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
11 000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
12 000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
13 *
14 000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
15 00000200: f0ff ff00 0000 0000 0000 0000 0000 0000 ................
16 00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
17 *
18 00001400: f0ff ff00 0000 0000 0000 0000 0000 0000 ................
19 00001410: 0000 0000 0000 0000 0000 0000 0000 0000 ................
20 *
21 00002600: 5445 5354 4641 5431 3220 2008 0000 5a4b TESTFAT12 ...ZK
22 00002610: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
23 00002620: 0000 0000 0000 0000 0000 0000 0000 0000 ................
24 *
25 00167ff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 ARGS="-n TESTFAT16"
1 SIZE=256000
2 CMP_LIMIT=1M
0 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
1 00000010: 0200 0200 00f8 0001 2000 4000 0000 0000 ........ .@.....
2 00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
3 00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
4 00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
5 00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
6 00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
7 00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
8 00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
9 00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
10 000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
11 000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
12 000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
13 *
14 000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
15 00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
16 *
17 00001000: f8ff ffff 0000 0000 0000 0000 0000 0000 ................
18 00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
19 *
20 00021000: f8ff ffff 0000 0000 0000 0000 0000 0000 ................
21 00021010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
22 *
23 00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
24 00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
25 00041020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
26 *
27 0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 ARGS="-n TESTFAT32"
1 SIZE=1024000
2 CMP_LIMIT=10M
0 00000000: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
1 00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
2 00000020: 0040 1f00 d007 0000 0000 0000 0200 0000 .@..............
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 8000 29cd ab34 1254 4553 5446 4154 3332 ..)..4.TESTFAT32
5 00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
6 00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
7 00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
8 00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
9 00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
10 000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
11 000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
12 000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
13 000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
14 000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
15 *
16 000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
17 00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
18 00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
19 *
20 000003e0: 0000 0000 7272 4161 07e6 0300 0200 0000 ....rrAa........
21 000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
22 00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
23 *
24 00000c00: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
25 00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
26 00000c20: 0040 1f00 d007 0000 0000 0000 0200 0000 .@..............
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 8000 29cd ab34 1254 4553 5446 4154 3332 ..)..4.TESTFAT32
29 00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
30 00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
31 00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
32 00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
33 00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
34 00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
35 00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
36 00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
37 00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
38 00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
39 *
40 00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
41 00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
42 *
43 00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
44 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
45 *
46 000fe000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
47 000fe010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
48 *
49 001f8000: 5445 5354 4641 5433 3220 2008 0000 5a4b TESTFAT32 ...ZK
50 001f8010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
51 001f8020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
52 *
53 3e7ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 #!/bin/sh
1 # Copyright (C) 2016 Andreas Bombe <aeb@debian.org>
2 #
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15 #
16 #
17 # This script expects a testname.fsck file as its sole argument. It must
18 # be a hex dump that can be converted to a filesystem image with xxd.
19 # fsck.fat is run on that image to attempt to fix the problem and then
20 # it is run a second time to determine if the problem has been fixed.
21 # The test fails if the first run does not detect an error or if the
22 # second run still detects an error.
23
24
25 run_fsck () {
26 "../src/fsck.fat" "$@"
27 }
28
29
30 if [ $# -ne 1 ]; then
31 echo "$0 called with wrong number of arguments"
32 exit 99
33 fi
34 testname=$(basename "$1" .fsck)
35
36
37 if [ "$XXD_FOUND" != "yes" ]; then
38 echo "xxd not available, required by test"
39 exit 77 # report test skipped
40 fi
41
42
43 echo "Test $testname"
44
45 # make sure there aren't files remaining from earlier run
46 rm -f "${testname}.img"
47
48 xxd -r "${srcdir}/${testname}.fsck" "${testname}.img" || exit 99
49
50
51 echo "First fsck run to check and fix error..."
52 run_fsck -a "${testname}.img"
53 success=$?
54 if [ $success -eq 0 ]; then
55 echo "*** Error was not detected by fsck."
56 success=100
57 elif [ $success -eq 1 ]; then
58 echo "Second fsck run to check if error was fixed..."
59 run_fsck -n "${testname}.img"
60 success=$?
61
62 if [ $success -ne 0 ]; then
63 echo "*** Error was not fixed by fsck."
64 fi
65 fi
66
67
68 rm -f "${testname}.img"
69 exit $success
0 #!/bin/sh
1 # Copyright (C) 2016 Andreas Bombe <aeb@debian.org>
2 #
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15 #
16 #
17 # This script expects a testname.mkfs file as its sole argument. It must
18 # be a shell snippet setting the variables ARGS, SIZE and CMP_LIMIT. ARGS and
19 # SIZE are used in the mkfs invocation and the result is compared against a
20 # reference image generated from the hexdump in testname.xxd. The comparison
21 # is stopped after CMP_LIMIT since freshly build FAT filesystems are just
22 # zeros after the initial info sectors, FATs and root directory.
23
24
25 run_mkfs () {
26 "../src/mkfs.fat" "$@"
27 }
28
29 run_fsck () {
30 "../src/fsck.fat" "$@"
31 }
32
33
34 if [ $# -ne 1 ]; then
35 echo "$0 called with wrong number of arguments"
36 exit 99
37 fi
38 testname=$(basename "$1" .mkfs)
39
40
41 if [ "$XXD_FOUND" != "yes" ]; then
42 echo "xxd not available, required by test"
43 exit 77 # report test skipped
44 fi
45
46
47 . "$1" || exit 99
48 echo "Test $testname"
49
50 # make sure there aren't files remaining from earlier run
51 rm -f "${testname}.out" "${testname}.refimg"
52
53 xxd -r "${srcdir}/${testname}.xxd" "${testname}.refimg" || exit 99
54 run_mkfs -C -v --invariant $ARGS "${testname}.out" $SIZE || exit 99
55
56 echo
57 echo "Comparing..."
58 limitarg=
59 if [ -n "$CMP_LIMIT" ]; then
60 limitarg="--bytes=$CMP_LIMIT"
61 fi
62 cmp $limitarg "${testname}.out" "${testname}.refimg"
63 success=$?
64
65 if [ $success -eq 0 ]; then
66 echo
67 echo "Testing fsck..."
68 run_fsck -n "${testname}.out"
69 success=$?
70 fi
71
72 rm -f "${testname}.out" "${testname}.refimg"
73
74 if [ $success -eq 2 ]; then
75 # cmp reported error
76 exit 99
77 fi
78 exit $success