Codebase list dosfstools / fdb963d
New upstream version 4.2 Andreas Bombe 3 years ago
126 changed file(s) with 16869 addition(s) and 3293 deletion(s). Raw diff Collapse all Expand all
0 commit eb9111e
1 Author: Pali Rohár <pali.rohar@gmail.com>
2 Date: Sun Jan 31 13:26:03 2021 +0100
3
4 Add missing files into distribution tarball
5
6 commit 52518ae
7 Author: Pali Rohár <pali.rohar@gmail.com>
8 Date: Sun Jan 31 03:03:39 2021 +0100
9
10 mkfs.fat: Read geom_start from sysfs
11
12 HDIO_GETGEO which provides start member is not supported for loop block
13 devices. Also start member is only unsigned long so it cannot be used for
14 bigger disks. So instead read geom_start from sysfs and store it into long
15 long type to prevent overflow.
16
17 commit ed2062b
18 Author: Pali Rohár <pali.rohar@gmail.com>
19 Date: Fri Jan 29 16:40:56 2021 +0100
20
21 Autogenerate release date in manpages
22
23 commit fca589b
24 Author: Pali Rohár <pali.rohar@gmail.com>
25 Date: Fri Jan 29 16:40:20 2021 +0100
26
27 Update (C) and maintainers
28
29 commit c251412
30 Author: Pali Rohár <pali.rohar@gmail.com>
31 Date: Fri Jan 29 16:33:41 2021 +0100
32
33 Add TODO comments for checking integer overflow
34
35 commit 73003cd
36 Author: Pali Rohár <pali.rohar@gmail.com>
37 Date: Sat Jan 19 13:28:45 2019 +0100
38
39 Replace uint64_t type by unsigned long long type
40
41 commit c56ef3d
42 Author: Pali Rohár <pali.rohar@gmail.com>
43 Date: Sat Jan 19 13:22:05 2019 +0100
44
45 Remove useless casting to uint64_t or long long in check_file()
46
47 Value of clusters * fs->cluster_size is file size and it always fits into
48 32bit value. So use just unsigned int type for it.
49
50 commit 2e597d6
51 Author: Pali Rohár <pali.rohar@gmail.com>
52 Date: Sat Jan 19 13:20:16 2019 +0100
53
54 Check that file size is not larger than maximal possible size
55
56 commit 53d04ff
57 Author: Pali Rohár <pali.rohar@gmail.com>
58 Date: Sat Jan 19 13:15:25 2019 +0100
59
60 Change fat_size type from off_t to unsigned int
61
62 Value in fat_size is result of multiplication of two 16bit unsigned values,
63 therefore it fits into unsigned int.
64
65 commit 2f6d8cf
66 Author: Pali Rohár <pali.rohar@gmail.com>
67 Date: Fri Jan 29 02:10:58 2021 +0100
68
69 testsuite: Add reference images of fsck result tests
70
71 This ensures that fsck does not change its behavior and repair filesystems
72 in the same way. Repaired reference images were generated by dosfstools 4.1
73 to ensure that they are still same.
74
75 commit 5265c64
76 Author: Pali Rohár <pali.rohar@gmail.com>
77 Date: Fri Jan 29 02:10:22 2021 +0100
78
79 testsuite: Add fsck tests for fat labels
80
81 commit 2260f80
82 Author: Pali Rohár <pali.rohar@gmail.com>
83 Date: Sun Jan 3 23:22:42 2021 +0100
84
85 fsck.fat: Check and fix label
86
87 Checks the volume label from the root directory entry that is valid and
88 matches the label stored in boot sector.
89
90 Add new command line option -U which consider lowercase volume label as
91 invalid and allows only uppercase labels. By default lowercase volume
92 labels are allowed.
93
94 commit 77c3de9
95 Author: Pali Rohár <pali.rohar@gmail.com>
96 Date: Tue Jan 14 00:58:21 2020 +0100
97
98 Simplify usage of validate_volume_label() function
99
100 Use new function dos_string_to_wchar_string() for converting label from DOS
101 OEM code page to wchar_t* string. Therefore caller does not have to supply
102 label in both DOS OEM encoding and locale independent wchar_t* string.
103
104 commit f89b42d
105 Author: Pali Rohár <pali.rohar@gmail.com>
106 Date: Sun Aug 19 18:54:07 2018 +0200
107
108 Update warning message about lowercase labels
109
110 They are working fine on MS-DOS and Windows systems.
111
112 commit 5bbae89
113 Author: Pali Rohár <pali.rohar@gmail.com>
114 Date: Wed Aug 15 16:35:48 2018 +0200
115
116 charconv: Add functions for converting DOS strings to locale independent wchar_t strings
117
118 Use iconv library for it. And as a fallback use internal cp850_table.
119
120 commit 3a3c1d3
121 Author: Pali Rohár <pali.rohar@gmail.com>
122 Date: Thu Jan 28 10:39:36 2021 +0100
123
124 testsuite: Update mkfs-fat32_2_res_sects.xxd test as it is now not aligned due to -a
125
126 commit 289fa53
127 Author: Pali Rohár <pali.rohar@gmail.com>
128 Date: Wed Jan 27 02:03:39 2021 +0100
129
130 manpages: End every sentence by a newline
131
132 commit 61390f3
133 Author: Pali Rohár <pali.rohar@gmail.com>
134 Date: Wed Jan 27 02:01:48 2021 +0100
135
136 mkfs.fat: Do not align number of sectors when -a was specified
137
138 commit 7deb97d
139 Author: Pali Rohár <pali.rohar@gmail.com>
140 Date: Wed Jan 27 02:00:33 2021 +0100
141
142 mkfs.fat: Document that -r and -R specify minimal number (and not exact)
143
144 commit 4e06c33
145 Author: Pali Rohár <pali.rohar@gmail.com>
146 Date: Wed Jan 27 01:58:38 2021 +0100
147
148 fsck: Move check_dirty_bits() from boot.c to check.c
149
150 commit 738ee98
151 Author: Pali Rohár <pali.rohar@gmail.com>
152 Date: Sun Jan 17 16:15:41 2021 +0100
153
154 fatlabel: Print warnings on stderr
155
156 Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=803391
157
158 commit e62e52c
159 Author: Pali Rohár <pali.rohar@gmail.com>
160 Date: Sun Jan 17 19:45:26 2021 +0100
161
162 fatlabel: Do not call parts of fsck repair procedure
163
164 This change adds a new parameter for read_fat() function to indicate a mode
165 in which filesystem is doing to be used: Read-only, Read-write or Repair.
166
167 fsck.fat uses Repair mode and fatlabel either Read-only or Read-write
168 (which depends on fatlabel operation).
169
170 fatlabel cannot repair broken FAT filesystem like fsck.fat. So when trying
171 to modify FAT label on currupted FAT filesystem rather throw an fatal error
172 indicating that running fsck.fat is needed.
173
174 When fatlabel was called to just read existing FAT label, first FAT table
175 is corrupted and second FAT table is clean then use second FAT table.
176
177 This change also ensures that fatlabel does not print fsck/repair messages
178 on stdout, which should be used only for printing FAT label.
179
180 commit b8c8531
181 Author: Pali Rohár <pali.rohar@gmail.com>
182 Date: Sun Jan 17 22:47:18 2021 +0100
183
184 testsuite: Add tests for DOS Clean Shutdown bit
185
186 commit 82c2111
187 Author: Pali Rohár <pali.rohar@gmail.com>
188 Date: Sun Jan 17 20:20:39 2021 +0100
189
190 testsuite: Add fsck tests with broken first FAT cluster
191
192 Extend also test-fsck script to read additional arguments from .args file.
193
194 commit 82e9730
195 Author: Pali Rohár <pali.rohar@gmail.com>
196 Date: Sun Jan 17 19:34:10 2021 +0100
197
198 fsck.fat: Add code for fixing first FAT cluster
199
200 This patch tries to fix infamous fsck.fat error:
201
202 Both FATs appear to be corrupt. Giving up.
203
204 It just fill again FAT media type and sets other bits to one as it is
205 required by FAT specification. Similar thing is doing also Windows chkdsk
206 tool.
207
208 In the most cases corrupted first FAT cluster is fatal error which
209 indicates totally corrupted filesystem impossible to repair. So fixing
210 first FAT cluster is not done by fsck.fat automatically and needs to be
211 enabled by a new -F option, which forces usage of specified FAT table
212 (either clean or corrupted).
213
214 commit e579a7d
215 Author: Pali Rohár <pali.rohar@gmail.com>
216 Date: Sat Nov 17 01:12:52 2018 +0100
217
218 mkfs.fat: Allow to specify disk geometry via new -g option
219
220 commit 9443732
221 Author: Pali Rohár <pali.rohar@gmail.com>
222 Date: Fri Jan 8 11:49:27 2021 +0100
223
224 testsuite: Add mkfs test for 600MB large 4K disk
225
226 commit 3300839
227 Author: Pali Rohár <pali.rohar@gmail.com>
228 Date: Sun Oct 14 16:19:51 2018 +0200
229
230 mkfs.fat: Do not show verbose messages not relevant to selected FAT size
231
232 commit 43f0c4e
233 Author: Pali Rohár <pali.rohar@gmail.com>
234 Date: Fri Aug 17 14:26:30 2018 +0200
235
236 mkfs.fat: Fix text of verbose messages
237
238 commit c01f78b
239 Author: Pali Rohár <pali.rohar@gmail.com>
240 Date: Tue Aug 14 15:48:50 2018 +0200
241
242 mkfs.fat: Fix limits for number of clusters
243
244 According to Microsoft FAT specification (fatgen103.doc) disk with at least
245 4085 clusters and less then 65525 clusters is FAT16.
246
247 But Microsoft Windows FAT driver fastfat.sys detects disk with less then
248 4087 clusters as FAT12. Linux FAT drivers msdos.ko and vfat.ko detect disk
249 with 4085 clusters (or more) as FAT16, therefore for compatibility reasons
250 with both systems disallow formatting disks to 4085 or 4086 clusters.
251
252 So after this change mkfs.fat disallow to create a FAT16 which would be
253 misinterpreted as FAT12. Next run of cluster detection algorithm would
254 choose higher cluster size which decrease number of clusters.
255
256 According to specification, FAT32 is detected by at least 65525 clusters,
257 but Microsoft Windows FAT driver fastfat.sys, Linux FAT drivers msdos.ko
258 and vfat.ko detect disk as FAT32 when Sectors Per FAT (fat_length) is set
259 to zero.
260
261 commit 404ead8
262 Author: Pali Rohár <pali.rohar@gmail.com>
263 Date: Sat Aug 11 20:34:08 2018 +0200
264
265 mkfs.fat: Fix calculation of FAT32 cluster size on non 512 bytes sector disks
266
267 Previous FAT32 calculation worked correctly only for disks with 512 byte
268 sectors. New calculation formula is generalized variant of previous one,
269 but to be sector size independent.
270
271 commit e6d2fc7
272 Author: Pali Rohár <pali.rohar@gmail.com>
273 Date: Wed Aug 15 15:11:30 2018 +0200
274
275 mkfs.fat: Fix printing number of sectors
276
277 It is unsigned 32bit number therefore use %u format.
278
279 commit b29eb5b
280 Author: Pali Rohár <pali.rohar@gmail.com>
281 Date: Wed Aug 15 15:15:06 2018 +0200
282
283 mkfs.fat: Align total number of sectors to be multiple of sectors per track
284
285 This requirement is needed by DOS systems and also by Linux mtools project.
286 Without proper alignment, mtools applications refuse to work on such
287 filesystem.
288
289 commit 8c81232
290 Author: Pali Rohár <pali.rohar@gmail.com>
291 Date: Sun Jan 10 22:29:48 2021 +0100
292
293 testsuite: Add referenceFAT32mbr test data to dist_check_DATA
294
295 commit 468aad7
296 Author: Pali Rohár <pali.rohar@gmail.com>
297 Date: Sun Jan 10 22:16:49 2021 +0100
298
299 manpages: Escape dot in fsck.fat manpage at the beginning of the line
300
301 commit 9069ba0
302 Author: felix <felix.von.s@posteo.de>
303 Date: Mon Apr 2 22:43:46 2018 +0200
304
305 fsck.fat: properly check for valid "." and ".." entries
306
307 This change makes fsck.fat check whether "." and ".." entries exist in
308 all non-root directories as the two very first. If those entries are
309 occupied by some other file, fsck.fat will offer to move them to some
310 later slot. "." and ".." entries found in any other slots are treated
311 as ordinary bad-shortname entries. The test case for this situation has
312 been enabled and verified to perform as expected.
313
314 The function drop_file() was also modified so that it does not mark
315 dropped file clusters as free. This was necessary because otherwise
316 dropping too-late "." and ".." entries would delete their containing
317 directory. If deleted entries' clusters are truly no longer used, they
318 shall be picked up by a later reclamation stage.
319
320 Additionally, subdirs() and check_file() were modified not to check
321 unused directory entries.
322
323 Additionally-fixed-by: Dave Odell <dmo2118@gmail.com>
324
325 commit 512141a
326 Author: C. Masloch <pushbx@ulukai.org>
327 Date: Sat Oct 24 13:53:08 2020 +0200
328
329 fsck.fat: preserve info sector reserved fields
330
331 This allows the FSIBOOT stage of lDOS boot32.asm to remain
332 in the FSINFO sector even when the info entries are reset.
333
334 I reviewed several sources to determine whether we are in the right to
335 assume that the reserved 480 bytes used by FSIBOOT should be preserved
336 by drivers updating the FSINFO entry fields.
337
338 Quoting the document "Microsoft Extensible Firmware Initiative - FAT32
339 File System Specification - FAT: General Overview of On-Disk Format -
340 Version 1.03, December 6, 2000" on these bytes:
341
342 > [Name] FSI_Reserved1
343 >
344 > [Offset (byte)] 4
345 >
346 > [Size (bytes)] 480
347 >
348 > [Description] This field is currently reserved for future expansion.
349 > FAT32 format code should always initialize all bytes of this field
350 > to 0. Bytes in this field must currently never be used.
351
352 This specifically states that "FAT32 format code" should zero-initialise
353 this space. It does not specify that a driver should or should not reset
354 this space.
355
356 The FreeDOS kernel uses a struct [1] that does not include the space
357 used by FSIBOOT. Its driver's implementation [2] does preserve the
358 FSIBOOT area. I have verified this in dosemu2; if the FreeDOS kernel
359 updates the FSINFO sector it preserves this area.
360
361 The Linux kernel uses a struct with a "reserved1" member [3] which is
362 commented as being "Nothing as far as I can tell". If I am reading the
363 source correctly, its driver [4] also preserves this area when updating
364 the FSINFO entries.
365
366 Testing on MS-DOS version 7.10 (as bundled with MS Windows 98 SE) I
367 determined that it also preserves the area when updating the FSINFO entries.
368
369 The free software RxDOS/lDOS boot loader for FAT32 that I wrote uses
370 this reserved area to store its FSIBOOT stage, essentially an extension
371 to the primary boot sector loader. To avoid clashing with Microsoft
372 loaders which may use some of the reserved sectors, the large reserved
373 area in the FSINFO sector was selected to hold this stage (if sector
374 size is <= 512 bytes). If valid, the area starts with a signature [5]
375 the first four bytes of which form the letters "FSIB"; the subsequent
376 four bytes specify a protocol version. For example, the current
377 (non-experimental) version is "FSIBOOT3" [6].
378
379 If there is no FSINFO sector or the FSIBOOT signature does not match the
380 one expected, then the 'I' error code letter ("i"nvalid FS"I"BOOT) is
381 displayed and the loading is aborted [7]. Prior to this patch, if the
382 FSINFO entries were invalid (any of the three FSINFO signatures don't
383 match) and then fsck.fat was used and instructed to correct this, it
384 would reset the space used by FSIBOOT, rendering the image unbootable
385 if the lDOS boot32 loader had been installed into the image.
386
387 I previously posted a similar patch for mtools to the info-mtools
388 mailing list [8]. I was approached to check whether dosfstools behaved
389 as expected. I determined that this patch is needed to fix the corner
390 case of invalid FSINFO entries with FSIBOOT installed into the sector.
391 I also patched the lDOS instsect application [9] so it insures that the
392 FSINFO entries are valid while installing FSIBOOT. With either that
393 patch to instsect or this patch to dosfstools, FSIBOOT will always be
394 preserved when running fsck.fat on a file system.
395
396 [1]:
397 https://github.com/FDOS/kernel/blob/6e42bb6d7c6dd304f738cf0d7a2db719598f1b9e/hdr/device.h#L325
398 [2]:
399 https://github.com/FDOS/kernel/blob/6e42bb6d7c6dd304f738cf0d7a2db719598f1b9e/kernel/fattab.c#L116
400 [3]:
401 https://github.com/torvalds/linux/blob/7cf726a59435301046250c42131554d9ccc566b8/include/uapi/linux/msdos_fs.h#L163
402 [4]:
403 https://github.com/torvalds/linux/blob/7cf726a59435301046250c42131554d9ccc566b8/fs/fat/misc.c#L60
404 [5]: https://hg.ulukai.org/ecm/ldosboot/file/aa15fd7bc58e/boot32.asm#l1164
405 [6]: https://hg.ulukai.org/ecm/ldosboot/file/aa15fd7bc58e/boot32.asm#l27
406 [7]: https://hg.ulukai.org/ecm/ldosboot/file/aa15fd7bc58e/boot32.asm#l775
407 [8]: https://lists.gnu.org/archive/html/info-mtools/2020-10/msg00000.html
408 [9]: https://hg.ulukai.org/ecm/instsect/rev/eee5dfaa52f6
409
410 commit 201665c
411 Author: Pali Rohár <pali.rohar@gmail.com>
412 Date: Sun Feb 16 12:33:32 2020 +0100
413
414 mkfs.fat: Update --help for -h (hidden sectors)
415
416 commit 25da96e
417 Author: Pali Rohár <pali.rohar@gmail.com>
418 Date: Sun Feb 16 12:22:04 2020 +0100
419
420 mkfs.fat: Relax -D option (BIOS drive number)
421
422 Allow to specify also second hard disk (0x81) or second floppy device
423 (0x01) as -D option = BIOS drive number.
424
425 commit bce0940
426 Author: Pali Rohár <pali.rohar@gmail.com>
427 Date: Sun Feb 17 18:59:54 2019 +0100
428
429 manpages: Update mkfs.fat manpage about FAT32 backup boot sector
430
431 commit da36707
432 Author: Pali Rohár <pali.rohar@gmail.com>
433 Date: Sun Feb 17 11:48:32 2019 +0100
434
435 mkfs.fat: Write FAT32 backup info sector after FAT32 backup boot sector
436
437 Write it only in the case when location does not conflict with real/primary
438 FAT32 info sector and reserved area is big enough.
439
440 commit 5b61d9f
441 Author: Pali Rohár <pali.rohar@gmail.com>
442 Date: Sun Feb 17 11:01:15 2019 +0100
443
444 testsuite: Run fsck test step always even if mkfs test step fails
445
446 fsck test step can show more details about badly created image by mkfs.
447
448 commit 53bfa1f
449 Author: Pali Rohár <pali.rohar@gmail.com>
450 Date: Sun Feb 17 10:56:06 2019 +0100
451
452 testsuite: Add test for mkfs.fat with two FAT32 sectors in reserved area
453
454 commit 3cca83a
455 Author: Pali Rohár <pali.rohar@gmail.com>
456 Date: Sun Feb 17 10:36:33 2019 +0100
457
458 mkfs.fat: Fix setting location of FAT32 backup boot sector
459
460 For FAT32 if there are only two sectors in reserved area, first must be
461 boot sector and second must be FAT32 fs info sector. And there would not be
462 FAT32 backup boot sector as it is optional. FAT32 info sector is for FAT32
463 media mandatory.
464
465 When backup_boot variable is set to zero it means that no FAT32 backup boot
466 sector is written. Check that FAT32 backup boot sector differs from FAT32
467 info sector is already there.
468
469 Also allow user to specify zero for -b option which disable creating of
470 FAT32 backup boot sector.
471
472 commit c5e35e7
473 Author: Pali Rohár <pali.rohar@gmail.com>
474 Date: Sun Feb 17 10:34:24 2019 +0100
475
476 mkfs.fat: Put FAT32 info sector number into variable
477
478 Also check that it is not same as backup boot sector value.
479
480 commit d276ddb
481 Author: Pali Rohár <pali.rohar@gmail.com>
482 Date: Sun Feb 17 10:32:08 2019 +0100
483
484 mkfs.fat: Rename info_sector buffer variable to info_sector_buffer
485
486 Also call free() unconditionally as it does nothing for NULL argument.
487
488 commit 5e936c9
489 Author: Pali Rohár <pali.rohar@gmail.com>
490 Date: Sat Nov 24 19:45:39 2018 +0100
491
492 mkfs.fat: Remove dependency on systemd/udev
493
494 There is no need that mkfs.fat depends on systemd. It uses it only for
495 reading additional information about block device.
496
497 This patch replace systemd/udev dependency code by reading those additional
498 information about block device directly from sysfs.
499
500 So no functionality of mkfs.fat is lost or removed.
501
502 commit 18a05e7
503 Author: Pali Rohár <pali.rohar@gmail.com>
504 Date: Sun Jan 5 00:58:41 2020 +0100
505
506 manpages: Fix '. SF' file names
507
508 commit 7e6d7d3
509 Author: Pali Rohár <pali.rohar@gmail.com>
510 Date: Sat Nov 24 18:18:53 2018 +0100
511
512 manpages: Fix switching to previous font style
513
514 In troff manpage language previous font style is selected by "\fP"
515 sequence, not by "\fR". "\fR" selects roman font style.
516
517 commit ffa5dfa
518 Author: Pali Rohár <pali.rohar@gmail.com>
519 Date: Sun Nov 18 21:14:24 2018 +0100
520
521 manpages: Fix formatting of bullets
522
523 In troff manpage language bullet is written as "\(bu".
524
525 commit bc65dd6
526 Author: Pali Rohár <pali.rohar@gmail.com>
527 Date: Sun Nov 18 21:10:29 2018 +0100
528
529 manpages: Fix formatting of emphases
530
531 To emphasize use italic font style instead of putting word into two
532 apostrophes. Ascii apostrophe in troff manpage language means "right single
533 quotation mark", therefore putting word into two apostrophes is fully
534 wrong.
535
536 Also arguments and file names should be formatted in italic.
537
538 commit 0273989
539 Author: Pali Rohár <pali.rohar@gmail.com>
540 Date: Sun Nov 18 21:01:55 2018 +0100
541
542 manpages: Fix formatting of hyphens, en and em dashes
543
544 In troff manpage language ascii minus is written as "\-", mathematical
545 minus as "\(mi", hyphen as "-", en-dash as "\(en" and em-dash as "\(em".
546
547 commit c85c863
548 Author: Pali Rohár <pali.rohar@gmail.com>
549 Date: Sun Oct 21 12:58:19 2018 +0200
550
551 manpages: Clarify unit of BLOCK-COUNT
552
553 BLOCK-COUNT is always in KiB unit independently of the disk sector size,
554 FAT sector size or FAT cluster size.
555
556 commit 69fcfe5
557 Author: Pali Rohár <pali.rohar@gmail.com>
558 Date: Sun Aug 19 16:35:22 2018 +0200
559
560 fsck.fat: Check for DOS Clean Shutdown bit
561
562 DOS Clean Shutdown bit in first reserved FAT entry is cleared when DOS or
563 Windows FAT driver mounts a volume and set is back when doing unmount.
564 Therefore set this bit when clearing FAT dirty bit in boot sector.
565
566 commit 68e8e54
567 Author: Pali Rohár <pali.rohar@gmail.com>
568 Date: Sat Jan 4 14:53:28 2020 +0100
569
570 mkfs.fat: Calculate CHS geometry according to SD Card Part 2 File System Specification
571
572 Use this CHS calculation when disk geometry is not available. This change
573 replaces hardcoded 64/32 value by formula based on total number of sectors.
574
575 For SD cards with more then 256MB capacity is CHS calculation according to
576 SD Card Part 2 File System Specification same as CHS calculation for hard
577 disks via LBA-Assist Translation.
578
579 commit 5199d68
580 Author: Pali Rohár <pali.rohar@gmail.com>
581 Date: Sun Aug 19 09:57:41 2018 +0200
582
583 mkfs.fat: Add a new option --mbr which fills MBR table with one partition
584
585 It is needed only for non-removable disks used on Microsoft Windows systems
586 and only when formatting whole unpartitioned disk.
587
588 Also some removable USB flash disks accessed via USB Mass Storage declares
589 themselves as non-removable and Microsoft Windows systems do not recognize
590 them without MBR partition table and MBR disk signature.
591
592 Because MBR sector and first FAT sector are very similar (starts with
593 boot code, ends with boot sign 0xAA55) they can live together at one
594 sector. Moreover location of the MBR partition table overlaps only with the
595 end of FAT boot code where is just place for the error message, it is
596 possible to fill (fake) MBR partition table with one partition which refers
597 to whole disk itself (starts at sector 0 and spans whole disk).
598
599 Similar thing is doing mformat (FAT12/16/32 formatting tool) from mtools
600 project or mkudffs (UDF formatting tool) from udftools project.
601
602 commit 9f856b7
603 Author: Pali Rohár <pali.rohar@gmail.com>
604 Date: Mon Jan 27 22:12:38 2020 +0100
605
606 charconv: Do not use %lc format modifier for wide char which cannot be converted to multibyte string
607
608 commit 032ec02
609 Author: Pali Rohár <pali.rohar@gmail.com>
610 Date: Tue Jan 14 00:27:31 2020 +0100
611
612 charconv: Fix usage of iconv() for state-dependent encodings
613
614 After first main iconv() call set conversion state to the initial state and
615 store corresponding shift sequence to output buffer via second iconv() call.
616
617 commit 4428d7d
618 Author: Pali Rohár <pali.rohar@gmail.com>
619 Date: Mon Jan 13 23:15:22 2020 +0100
620
621 charconv: Fix checks for overlong input strings
622
623 commit 2779d70
624 Author: Pali Rohár <pali.rohar@gmail.com>
625 Date: Wed Jan 8 01:03:24 2020 +0100
626
627 charconv: Use ICONV_CONST macro to fix compile warnings with GNU libiconv
628
629 Macro ICONV_CONST is defined by autoconf and expands either to "const" or
630 nothing based on what API provides iconv() implementation, either according
631 to SUSv2 or POSIX.1-2001/POSIX.1-2008.
632
633 commit 565d7a2
634 Author: Pali Rohár <pali.rohar@gmail.com>
635 Date: Wed Jan 8 01:02:16 2020 +0100
636
637 charconv: Fix check for return value of iconv
638
639 iconv() returns (unsigned) size_t type, so its return value is always
640 different from (signed) negative -1. To compare with -1 it first needs to
641 be casted to size_t type.
642
643 commit e9b42f5
644 Author: Pali Rohár <pali.rohar@gmail.com>
645 Date: Wed Jan 8 00:44:27 2020 +0100
646
647 charconv: Increase buffer size for output strings in current locale
648
649 MSDOS_NAME * 4 does not have to be enough size as iconv in translit mode
650 can return also 5 bytes per one wide character.
651
652 commit 1403c53
653 Author: Pali Rohár <pali.rohar@gmail.com>
654 Date: Wed Jan 8 00:42:35 2020 +0100
655
656 charconv: Fix buffer overflows by specifying output buffer size
657
658 commit 917846b
659 Author: Pali Rohár <pali.rohar@gmail.com>
660 Date: Tue Jan 7 00:54:15 2020 +0100
661
662 charconv: Fix put_char() function
663
664 Ensure that this function always print characters according to current
665 locale. So do not treat characters above 0xA0 as printable when
666 dos_char_to_printable() cannot process them.
667
668 commit 6dc68a8
669 Author: Pali Rohár <pali.rohar@gmail.com>
670 Date: Tue Jan 7 00:52:43 2020 +0100
671
672 charconv: Fix comment for init_conversion() function
673
674 commit 2d6c37d
675 Author: Pali Rohár <pali.rohar@gmail.com>
676 Date: Tue Jan 7 00:52:25 2020 +0100
677
678 charconv: For internal CP850 conversion add translit table
679
680 This CP850 translit table was created by iconv ASCII//TRANSLIT as a 7bit ASCII fallback.
681
682 commit 3ccfe29
683 Author: Pali Rohár <pali.rohar@gmail.com>
684 Date: Tue Jan 7 00:50:09 2020 +0100
685
686 charconv: As a fallback try to use also non-translit iconv conversion
687
688 commit 1b72fdf
689 Author: Pali Rohár <pali.rohar@gmail.com>
690 Date: Mon Jan 6 18:30:28 2020 +0100
691
692 charconv: Use const for input strings
693
694 commit 102aa76
695 Author: Pali Rohár <pali.rohar@gmail.com>
696 Date: Mon Jan 6 18:29:30 2020 +0100
697
698 charconv: Rename third argument of local_string_to_dos_string()
699
700 Correct name is out_size as it is size of output buffer and not length of string.
701
702 commit 49cc12a
703 Author: Lennart Poettering <lennart@poettering.net>
704 Date: Mon Aug 3 12:17:12 2020 +0200
705
706 mkfs: fsync() the block device before exiting
707
708 Let's make sure to sync the block device, before exiting. Otherwise, if
709 we operate on a loop device and people issue "losetup -d" right after
710 this command finishes our in-flight writes might never hit the disk.
711
712 (This took 4h of my life for me to figure out. The mkfs for all other
713 file systems I tested appear to synchronize when done, hence fat should
714 do too.)
715
716 commit cc75143
717 Author: Pali Rohár <pali.rohar@gmail.com>
718 Date: Mon Jan 27 22:22:35 2020 +0100
719
720 mkfs.fat: Mark struct fat32_fsinfo as packed
721
722 commit f8f455b
723 Author: Pali Rohár <pali.rohar@gmail.com>
724 Date: Mon Jan 27 22:25:20 2020 +0100
725
726 fatlabel: Update documentation about DOS codepage
727
728 commit 3ce32fa
729 Author: Pali Rohár <pali.rohar@gmail.com>
730 Date: Sat Jan 4 15:27:59 2020 +0100
731
732 mkfs.fat: Clarify licensing of the dummy boot sector
733
734 Original author H. Peter Anvin allowed to put mkfs.fat boot sector code
735 into the public domain.
736
737 commit 8dc8976
738 Author: Pali Rohár <pali.rohar@gmail.com>
739 Date: Fri Feb 14 00:00:27 2020 +0100
740
741 manpages: Update documentation about hidden sectors
742
743 Fixes #29
744
745 commit 17be357
746 Author: David Gumberg <davidzgumberg@gmail.com>
747 Date: Sun Oct 13 18:21:57 2019 -0600
748
749 Get cross-platform libc6 generically
750
751 commit 5e2529e
752 Author: Pali Rohár <pali.rohar@gmail.com>
753 Date: Mon Oct 14 12:21:36 2019 +0200
754
755 travis: use if ... fi construction
756
757 As single test command has side effect in return value for Travis.
758
759 commit 20092b8
760 Author: Pali Rohár <pali.rohar@gmail.com>
761 Date: Mon Oct 14 12:14:07 2019 +0200
762
763 travis: Check for fatlabel test errors only for non-static builds
764
765 Static builds have broken iconv support which is detected at configure time
766 as usable. This leads to usage of internal CP850 conversion table as
767 fallback solution which throws runtime non-fatal error.
768
769 commit a4a0d62
770 Author: Pali Rohár <pali.rohar@gmail.com>
771 Date: Mon Oct 14 09:48:43 2019 +0200
772
773 tests: Check for stderr errors from fatlabel tests
774
775 commit 84a8d1c
776 Author: Pali Rohár <pali.rohar@gmail.com>
777 Date: Sun Jun 23 12:01:48 2019 +0200
778
779 charconv: Update Travis configuration
780
781 Use autogen.sh instead of non-working autoreconf and test also
782 static linked versions and configurations without iconv.
783
784 commit b657ede
785 Author: Pali Rohár <pali.rohar@gmail.com>
786 Date: Sun Jun 23 10:47:44 2019 +0200
787
788 charconv: Add autogen.sh script
789
790 AM_ICONV macro depends on gettext installation. Unfortunately autoreconf is
791 not able to install config.rpath file so do it manually in autogen.sh.
792
793 See reported bug:
794 https://lists.gnu.org/archive/html/bug-gettext/2011-10/msg00012.html
795
796 commit 0dec6a7
797 Author: Pali Rohár <pali.rohar@gmail.com>
798 Date: Sat Jun 22 22:14:31 2019 +0200
799
800 charconv: Fix sources for testdevinfo target
801
802 testdevinfo does not use any of charconv functions, nor any of mkfs
803 functions. So do not link charconv/mkfs into testdevinfo.
804
805 This fixes linking problems when iconv functions are not present in
806 standard libraries.
807
808 commit 664192e
809 Author: Pali Rohár <pali.rohar@gmail.com>
810 Date: Sat Jun 22 01:23:54 2019 +0200
811
812 charconv: Check return value of all set_dos_codepage() calls
813
814 commit 6d49a1f
815 Author: Pali Rohár <pali.rohar@gmail.com>
816 Date: Sat Jun 22 01:16:44 2019 +0200
817
818 charconv: Check presence of iconv
819
820 Use autoconf AM_ICONV macro for it. AM_ICONV should handle both cases when
821 iconv_open is available in external libiconv library or as part of libc
822 library.
823
824 To force compilation of dosfstools without iconv support there is a new
825 configure option --without-iconv.
826
827 commit fa9761f
828 Author: Pali Rohár <pali.rohar@gmail.com>
829 Date: Sat Jun 22 01:14:37 2019 +0200
830
831 charconv: Fix return value from iconv_init_codepage function
832
833 commit d74c592
834 Author: Pali Rohár <pali.rohar@gmail.com>
835 Date: Sat Jun 22 01:12:46 2019 +0200
836
837 charconv: Add fallback to internal CP850 table
838
839 Static linked version of glibc does not contain iconv with CP850 support.
840 As CP850 is default code page for all dosfstools programs add own internal
841 implementation which will be always supported. It would be used only in
842 case iconv_open() fails.
843
844 commit 91978a2
845 Author: Michael Forney <mforney@mforney.org>
846 Date: Fri Jun 7 08:48:13 2019 -0700
847
848 Use static inline function instead of statement expression
849
850 commit e06e759
851 Author: Pali Rohár <pali.rohar@gmail.com>
852 Date: Wed Jun 5 09:25:52 2019 +0200
853
854 Fix Travis CI configuration for powerpc and arm
855
856 commit fc55b63
857 Author: Noé Rubinstein <nrubinstein@aldebaran.com>
858 Date: Mon Aug 31 15:19:57 2015 +0200
859
860 mkfs: document --offset in the man page
861
862 commit f473459
863 Author: Noé Rubinstein <nrubinstein@aldebaran.com>
864 Date: Thu Jul 2 15:49:06 2015 +0200
865
866 Allow specifying an offset in the device file in mkfs
867
868 commit 93b4288
869 Author: Tobias Stoeckmann <stoeckmann@users.noreply.github.com>
870 Date: Sun Feb 24 20:55:15 2019 +0100
871
872 Fix out of boundary read in fsck.fat/fatlabel
873
874 Faulty filesystems are able to trigger integer overflows in read_boot which eventually lead to insufficient allocation of memory for the FAT and therefore out of boundary reads.
875
876 commit af3e50d
877 Author: Pali Rohár <pali.rohar@gmail.com>
878 Date: Sun Aug 12 12:15:45 2018 +0200
879
880 device_info: Fix parsing partition number
881
882 Ensures that it is always valid number which does not overflow or
883 underflow.
884
885 commit 086e13c
886 Author: Pali Rohár <pali.rohar@gmail.com>
887 Date: Sun Aug 12 12:15:21 2018 +0200
888
889 mkfs.fat: Fix parsing of block number
890
891 Block number must not be negative. It is 32bit so use long long type and
892 strtoll() function to ensure that converted positive 32bit value would fit
893 into type.
894
895 commit a2b97c9
896 Author: Pali Rohár <pali.rohar@gmail.com>
897 Date: Sun Aug 12 12:13:35 2018 +0200
898
899 mkfs.fat: Fix validation of numeric command line arguments
900
901 Ensures that argument is always valid number which does not overflow or
902 underflow.
903
904 commit 07e63ac
905 Author: Pali Rohár <pali.rohar@gmail.com>
906 Date: Sun Aug 12 11:56:32 2018 +0200
907
908 mkfs.fat: Fix validation of volume ID
909
910 Use same logic as in fatlabel.
911
912 commit 425a415
913 Author: Pali Rohár <pali.rohar@gmail.com>
914 Date: Sat Aug 11 22:49:37 2018 +0200
915
916 fatlabel: Fix validation of volume ID
917
918 Standard C function strtoull() does not signal underflow, therefore it
919 cannot be used for conversion of arbitrary string to integer with detection
920 of failure.
921
922 Instead use function strtoll() and detect underflow (negative value)
923 manually.
924
925 Note that strto* functions skips and ignores leading whitespace characters,
926 so detects them manually via standard C function isspace().
927
928 commit da07aa4
929 Author: Pali Rohár <pali.rohar@gmail.com>
930 Date: Sat Jan 19 09:48:25 2019 +0100
931
932 Update Travis configuration
933
934 * Use both gcc and clang compilers
935 * Compile with -fwrapv and -fsanitize=address
936 * Compile in both 32 and 64 modes for x86 systems
937 * Cross compile for little endian arm and big endian powerpc
938 * Run cross compiled binaries in qemu
939
940 commit a6ec69d
941 Author: Tobias Stoeckmann <tobias@stoeckmann.org>
942 Date: Mon Jan 14 22:47:40 2019 +0100
943
944 Renamed len to out_size.
945
946 As pointed out by pali it makes sense to rename len to out_size
947 to make explicitly sure by proper naming that this is the actually
948 available memory size at "out", not the length of a string.
949
950 Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
951
952 commit 6080fe2
953 Author: Tobias Stoeckmann <tobias@stoeckmann.org>
954 Date: Mon Jan 14 19:36:11 2019 +0100
955
956 Fixed off-by-one in local_string_to_dos_string.
957
958 The function local_string_to_dos_string is vulnerable to an off-by-one
959 buffer overflow. In fact, it is triggered in default usage and becomes
960 visible when compiled with ASAN:
961
962 $ CFLAGS="-fsanitize=address" ./configure
963 $ dd if=/dev/zero of=example.iso bs=1024 seek=64 count=1
964 $ ./src/mkfs.fat example.iso
965 mkfs.fat 4.1+git (2017-01-24)
966 =================================================================
967 ==3857==ERROR: AddressSanitizer: stack-buffer-overflow on address ...
968
969 The problem is that the argument "len" to local_string_to_dos_string
970 stores the length of the output buffer. Yet it can also be used as an
971 index to store '\0':
972
973 If the whole "out" buffer has been written to, bytes_out is 0 and
974 the assignment in out[len-bytes_out] therefore leads to an off-by-one.
975
976 Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
977
978 commit 332fc29
979 Author: Pali Rohár <pali.rohar@gmail.com>
980 Date: Sun Nov 18 20:47:29 2018 +0100
981
982 Fix memory leaks in read_fat() function
983
984 Function read_fat() allocates memory to the user supplied buffer. Therefore
985 that function needs complement function for releasing allocated memory and
986 user needs to call if after finish its work.
987
988 This patch fixes memory leaks in fsck.fat and fatlabel tools.
989
990 Fixes #13
991
992 commit 4cfd643
993 Author: Pali Rohár <pali.rohar@gmail.com>
994 Date: Sat Sep 29 10:08:12 2018 +0200
995
996 mkfs.fat: Fix endianity for hidden_sectors
997
998 Global variable hidden_sectors is in host byte order.
999
1000 commit a874650
1001 Author: Pali Rohár <pali.rohar@gmail.com>
1002 Date: Tue Aug 14 21:13:52 2018 +0200
1003
1004 mkfs.fat: Add some workaround for Year 2038 Bug
1005
1006 Check return values of time(), gmtime() and localtime() function which may
1007 fail. Fallback to date/time 1.1.1980 00:00:00 when those functions fail.
1008
1009 For generating volume id, add fallback code based on rand() function.
1010
1011 commit 607fbed
1012 Author: Pali Rohár <pali.rohar@gmail.com>
1013 Date: Tue Aug 14 20:57:27 2018 +0200
1014
1015 fsck.fat: Fix Year 2038 Bug
1016
1017 Do not use time_t type and strftime() function which are affected by the
1018 Year 2038 Bug. Instead parse date/time directly from DOS format which
1019 avoids conversion from DOS to UNIX + conversion from UNIX to string.
1020
1021 commit fb0cc0d
1022 Author: Andreas Bombe <aeb@debian.org>
1023 Date: Tue Aug 14 12:58:58 2018 +0200
1024
1025 Fix gcc sprintf() length warnings
1026
1027 There are two sprintf() calls that receive warnings from current
1028 versions of gcc for possibly overrunning the temporary buffers they're
1029 writing into.
1030
1031 The first one in src/check.c is theoretically safe since strftime()
1032 shouldn't generate such a long string. Reduce the maximum length of the
1033 strftime() string to fix this warning. Also detect strftime() errors
1034 and overwrite the buffer with a message in that case.
1035
1036 The second one in src/boot.c should not be possible and is a limitation
1037 of gcc's detection. It assumes that %02x could write up to 8
1038 characters, even though the arguments are pointers to uint8_t which
1039 can't be more than two characters. Placate gcc by lengthening the
1040 temporary buffer by 12 bytes.
1041
1042 commit ca54953
1043 Author: Pali Rohár <pali.rohar@gmail.com>
1044 Date: Mon May 7 09:27:16 2018 +0200
1045
1046 mkfs.fat: Add support for --codepage option for label and validate it
1047
1048 commit 40da1b2
1049 Author: Pali Rohár <pali.rohar@gmail.com>
1050 Date: Mon May 7 09:26:42 2018 +0200
1051
1052 fatlabel: Implement proper checks when setting new label
1053
1054 According to Microsoft FAT specification "fatgen103.doc" there are
1055 following restrictions for FAT label stored in root directory:
1056
1057 * DIR_Name[0] may not equal 0x20.
1058
1059 * Lower case characters are not allowed in DIR_Name (what these characters
1060 are is country specific).
1061
1062 * The following characters are not legal in any bytes of DIR_Name:
1063
1064 - Values less than 0x20 except for the special case of 0x05 in
1065 DIR_Name[0]
1066
1067 - 0x22, 0x2A, 0x2B, 0x2C, 0x2E, 0x2F, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
1068 0x5B, 0x5C, 0x5D, and 0x7C
1069
1070 And another Microsoft "FAT32 Spec (SDA Contribution).pdf" describe:
1071
1072 * DIR_Name[0] cannot equal 0x20 (in other words, names cannot start with a
1073 space character).
1074
1075 commit 4f953bb
1076 Author: Andreas Bombe <aeb@debian.org>
1077 Date: Mon Jun 11 14:21:17 2018 +0200
1078
1079 Remove long file name when changing short file name
1080
1081 In the current state, long file names are poorly supported and in case
1082 the file got automatically or manually renamed in auto_rename() or
1083 rename_file(), only the short file name would be manipulated.
1084
1085 Only the checksum would be fixed to have the LFN stay valid. This would
1086 cause issues such as the rename being hidden by the unchanged LFN or
1087 duplicate LFNs remaining if they were the cause for a rename.
1088
1089 Change so that existing LFNs are removed for files being renamed.
1090
1091 commit b356cf0
1092 Author: Andreas Bombe <aeb@debian.org>
1093 Date: Mon Jun 11 14:17:03 2018 +0200
1094
1095 Print error message when auto_rename() is called on FAT32 root directory
1096
1097 Use the same error message as rename_file() uses for the same reason
1098 when called on the FAT32 root directory pseudo file rather than silently
1099 ignoring.
1100
1101 commit 8c4122e
1102 Author: felix <felix.von.s@posteo.de>
1103 Date: Mon Jun 11 04:35:35 2018 +0200
1104
1105 Fix allowing changes in SFNs reporting bogus error on FAT32 root directory
1106
1107 The code to permit spaces in short filenames introduced in commit
1108 4d01db7c6 caused the root directory pseudo file to be checked for a bad
1109 name. Since the name for that file is not set (zeroed out), bad_name()
1110 would report an error. Attempting to fix it would do nothing as the
1111 rename functions check for and ignore the root directory.
1112
1113 Fix by checking for the root directory in bad_name().
1114
1115 commit 96e6efd
1116 Author: Andreas Bombe <aeb@debian.org>
1117 Date: Sun Jun 10 03:09:14 2018 +0200
1118
1119 fsck: Fix -S option not being recognized
1120
1121 The call to getopt_long() did not include the -S option, so that it was
1122 not recognized even though its handling was implemented.
1123
1124 commit 4d01db7
1125 Author: felix <felix.von.s@posteo.de>
1126 Date: Mon Apr 2 10:20:10 2018 +0200
1127
1128 fsck.fat: Allow spaces in the middle of SFNs
1129
1130 Also, introduce an -S option (mostly) restoring previous behaviour.
1131
1132 commit c74ca0c
1133 Author: Pali Rohár <pali.rohar@gmail.com>
1134 Date: Wed Mar 7 18:00:15 2018 +0100
1135
1136 manpages: Add section DOS CODEPAGES to fatlabel
1137
1138 Table was extracted from the National Language Support (NLS) API Reference:
1139 https://www.microsoft.com/resources/msdn/goglobal/default.mspx?OS=Windows+7
1140
1141 And filtered by codepages supported by GNU libiconv.
1142
1143 commit b665a93
1144 Author: Pali Rohár <pali.rohar@gmail.com>
1145 Date: Wed Mar 7 17:59:50 2018 +0100
1146
1147 fatlabel: Add support for --codepage option
1148
1149 FAT label in both boot sector and root directory is stored according to
1150 current OEM code page. Microsoft Windows system treat FAT label really in
1151 this way. In most cases OEM code page is just 8bit extension of the
1152 printable ASCII, therefore for ASCII-only labels there is no change.
1153
1154 By default OEM code page 850 is used which contains most of the characters
1155 that are also available in ISO-8859-1. Same default which is used by
1156 fsck.fat and mlabel (from mtools project).
1157
1158 commit 76c0362
1159 Author: Pali Rohár <pali.rohar@gmail.com>
1160 Date: Wed Mar 7 17:58:05 2018 +0100
1161
1162 fsck.fat: Change default DOS codepage to 850
1163
1164 The reason for change is that 850 is more common on Windowes and used by
1165 more regions as 437. Also it contains most of the characters that are also
1166 available in ISO-8859-1. And 850 is also default DOS code page used by
1167 mtools, which is used on Linux.
1168
1169 commit 18ed349
1170 Author: Pali Rohár <pali.rohar@gmail.com>
1171 Date: Wed Mar 7 17:57:23 2018 +0100
1172
1173 Initialize iconv "from codepage" with //TRANSLIT
1174
1175 This would allow to show characters from DOS codepage on systems which
1176 current locale does not support it via transliteration.
1177
1178 For example byte E8 in DOS CP437 (e with a grave accent) does not have
1179 representation in Linux locale Latin2. But it can be shown after
1180 transliteration as simple character "e".
1181
1182 commit 08d743c
1183 Author: Pali Rohár <pali.rohar@gmail.com>
1184 Date: Wed Mar 7 17:57:13 2018 +0100
1185
1186 Initialize only LC_CTYPE locale
1187
1188 LC_ALL is not needed as locale is used just for CODESET. LC_CTYPE is enough
1189 for using nl_langinfo(CODESET).
1190
1191 commit 2112913
1192 Author: Pali Rohár <pali.rohar@gmail.com>
1193 Date: Sun Apr 8 11:37:29 2018 +0200
1194
1195 Add tests for FAT32 labels
1196
1197 These FAT32 images were generated for FAT label test suite in October 2017.
1198 Now fatlabel reports same FAT32 label as MS-DOS 6, 7 and Windows 98, XP, 10.
1199
1200 For more information about test result see email:
1201 https://www.spinics.net/lists/kernel/msg2640891.html
1202
1203 commit bfeedfc
1204 Author: Pali Rohár <pali.rohar@gmail.com>
1205 Date: Thu Nov 9 21:25:05 2017 +0100
1206
1207 mkfs.fat: Correctly process 0xe5 as first character of directory entry
1208
1209 Same as commit 51da71aa9edc36fabf83323282f14e7ee71aa07b but for mkfs.fat.
1210
1211 commit 1b866f4
1212 Author: Pali Rohár <pali.rohar@gmail.com>
1213 Date: Thu Nov 9 21:25:01 2017 +0100
1214
1215 fsck.fat: Handle 0xe5 as first character of directory entry
1216
1217 Same as commit 51da71aa9edc36fabf83323282f14e7ee71aa07b but for fsck.fat.
1218
1219 commit 5b702a7
1220 Author: Pali Rohár <pali.rohar@gmail.com>
1221 Date: Thu Nov 30 00:07:39 2017 +0100
1222
1223 manpages: Add section COMPATIBILITY and BUGS to fatlabel
1224
1225 commit 900edb6
1226 Author: Pali Rohár <pali.rohar@gmail.com>
1227 Date: Thu Nov 30 00:07:22 2017 +0100
1228
1229 fatlabel: Optimize size of the binary
1230
1231 Move implementation of the alloc_rootdir_entry() function from the check.c
1232 to boot.c and do not link unneeded objects files into fatlabel binary.
1233
1234 This would decrease size of the fatlabel binary nearly by half. With -g -O2
1235 size before was about 194131 bytes and after just 104497 bytes.
1236
1237 commit 0901aa8
1238 Author: Pali Rohár <pali.rohar@gmail.com>
1239 Date: Thu Nov 30 00:07:05 2017 +0100
1240
1241 fatlabel: Clear ATTR_VOLUME from directory entry when removing label
1242
1243 Older versions of fatlabel ignored FAT entries with deletion mark 0xE5 and
1244 tried to read labels also from those entries. This fix clear ATTR_VOLUME so
1245 older versions would not try to read label from deleted entry.
1246
1247 commit cb8e674
1248 Author: Pali Rohár <pali.rohar@gmail.com>
1249 Date: Thu Nov 30 00:06:51 2017 +0100
1250
1251 fatlabel: Print label without padding spaces
1252
1253 Every entry in FAT directory is padded with spaces, which are not part of
1254 entry name. Therefore show also label from root FAT directory without those
1255 padding spaces.
1256
1257 commit d822d5b
1258 Author: Pali Rohár <pali.rohar@gmail.com>
1259 Date: Thu Nov 30 00:06:36 2017 +0100
1260
1261 fatlabel: Show only label stored in root directory
1262
1263 MS-DOS 6.22, MS-DOS 7.10, Windows 98, Windows XP and also Windows 10
1264 ignores label stored in boot sector. When label in boot sector is non-empty
1265 and label in root directory is missing then they treat situation as there
1266 is no label for particular disk. So when labels in boot sector and root
1267 directory are out of sync, fatlabel shown different label as those MS-DOS
1268 and Windows systems. To make behavior between DOS, Windows and Linux
1269 consistent, ignores label in boot sector also in fatlabel.
1270
1271 commit c598354
1272 Author: Ashe David Sterkehus <ashe.goulding@gmail.com>
1273 Date: Wed Nov 22 00:20:40 2017 +0900
1274
1275 mkfs: Check volume label given with -n is no longer than 11 characters
1276
1277 Fixes #70
1278
1279 commit 87a8f29
1280 Author: Will Newton <willn@resin.io>
1281 Date: Thu Aug 31 10:42:13 2017 +0100
1282
1283 src/check.c: Fix up mtools created bad dir entries
1284
1285 mtools writes uninitialized data to the case field of some
1286 directory entries. Running fsck.fat on these filesystems
1287 will cause the directory to get deleted which can lead to
1288 data loss. Detect this situation and clear the flag instead.
1289
1290 mtools patch to fix the original issue:
1291
1292 https://lists.gnu.org/archive/html/info-mtools/2014-08/msg00000.html
1293
1294 Signed-off-by: Will Newton <willn@resin.io>
1295
1296 commit fe3ada3
1297 Author: Andreas Bombe <aeb@debian.org>
1298 Date: Sun Oct 15 16:26:01 2017 +0200
1299
1300 manpages: Remove formatting from NAME sections where it doesn't belong
1301
1302 The .SH NAME sections are supposed to contain just "name \- description"
1303 with no bolding on the name.
1304
1305 Signed-off-by: Andreas Bombe <aeb@debian.org>
1306
1307 commit 0d2d2b2
1308 Author: Andreas Bombe <aeb@debian.org>
1309 Date: Sun Oct 1 15:17:13 2017 +0200
1310
1311 manpages: Clarify rules for volume labels as implemented
1312
1313 Signed-off-by: Andreas Bombe <aeb@debian.org>
1314
1315 commit 86fa0d8
1316 Author: Andreas Bombe <aeb@debian.org>
1317 Date: Sun Oct 1 15:16:12 2017 +0200
1318
1319 manpages: Make SEE ALSO sections conform to conventions
1320
1321 Signed-off-by: Andreas Bombe <aeb@debian.org>
1322
1323 commit 5cdad55
1324 Author: Andreas Bombe <aeb@debian.org>
1325 Date: Sun Oct 1 03:57:59 2017 +0200
1326
1327 Harmonize unknown command line option handling
1328
1329 Now all binaries will show help and not try to print something like
1330 "unknown option '?'" because '?' is the value getopt_long() returns when
1331 it encounters an unknown option. At this point, getopt_long() has
1332 already printed the problem to stderr so we don't have to.
1333
1334 The default action on getopt_long() return values (neither known option
1335 nor '?') is to report an internal error with the unexpected value.
1336
1337 Signed-off-by: Andreas Bombe <aeb@debian.org>
1338
1339 commit 34fd8eb
1340 Author: Andreas Bombe <aeb@debian.org>
1341 Date: Sun Oct 1 03:04:00 2017 +0200
1342
1343 fatlabel: Add new -r, --reset option
1344
1345 This new option removes the label or generates a new serial number if in
1346 volume ID mode.
1347
1348 Signed-off-by: Andreas Bombe <aeb@debian.org>
1349
1350 commit e4e346f
1351 Author: Andreas Bombe <aeb@debian.org>
1352 Date: Sun Oct 1 02:43:03 2017 +0200
1353
1354 fatlabel: Don't access element of argv array that may not exist
1355
1356 Signed-off-by: Andreas Bombe <aeb@debian.org>
1357
1358 commit 17dea47
1359 Author: Andreas Bombe <aeb@debian.org>
1360 Date: Sun Oct 1 02:27:31 2017 +0200
1361
1362 Move generation of serial number into new function generate_volume_id()
1363
1364 Signed-off-by: Andreas Bombe <aeb@debian.org>
1365
1366 commit 07f0238
1367 Author: Andreas Bombe <aeb@debian.org>
1368 Date: Sun Oct 1 02:17:41 2017 +0200
1369
1370 Add remove_label() function
1371
1372 Signed-off-by: Andreas Bombe <aeb@debian.org>
1373
1374 commit ce7e7f9
1375 Author: Andreas Bombe <aeb@debian.org>
1376 Date: Sun Oct 1 01:42:55 2017 +0200
1377
1378 fatlabel: Refuse empty strings as labels
1379
1380 Signed-off-by: Andreas Bombe <aeb@debian.org>
1381
1382 commit 51da71a
1383 Author: Andreas Bombe <aeb@debian.org>
1384 Date: Sun Oct 1 01:28:32 2017 +0200
1385
1386 Handle 0xe5 as first character of volume label
1387
1388 Directory entries are not allowed to have 0xe5 as the first character as
1389 that is the marker for deleted entries. Instead, these have to be
1390 converted to 0x05 on writing and the other way on reading.
1391
1392 Signed-off-by: Andreas Bombe <aeb@debian.org>
1393
1394 commit 3a1aac1
1395 Author: Andreas Bombe <aeb@debian.org>
1396 Date: Sun Oct 1 01:11:05 2017 +0200
1397
1398 Remove leftover handling of split directory entry name
1399
1400 The name field in DIR_ENT used to be split into name and ext. Reading
1401 the volume label from a DIR_ENT used to require merging the contents of
1402 both fields and that handling was still there as reading parts of the
1403 same name field and merging them. Simply read in one go instead.
1404
1405 Signed-off-by: Andreas Bombe <aeb@debian.org>
1406
1407 commit 04aca69
1408 Author: Andreas Bombe <aeb@debian.org>
1409 Date: Sun Oct 1 00:54:12 2017 +0200
1410
1411 Terminate volume label search at end of directory
1412
1413 In find_volume_de() there is no point in scanning the directory entries
1414 after the first end of directory marker (name starts with a zero byte).
1415 Simply return 0 if end of directory is encountered.
1416
1417 Signed-off-by: Andreas Bombe <aeb@debian.org>
1418
1419 commit 747c8f9
1420 Author: Andreas Bombe <aeb@debian.org>
1421 Date: Sun Oct 1 00:46:05 2017 +0200
1422
1423 Avoid returning deleted directory entries as labels
1424
1425 In find_volume_de(), only the attributes were tested to decide whether a
1426 directory entry was a volume label. This could lead to deleted entries
1427 being returned. Check the name for deleted or unallocated marker to
1428 prevent this.
1429
1430 Signed-off-by: Andreas Bombe <aeb@debian.org>
1431
1432 commit 0a733d8
1433 Author: Pali Rohár <pali.rohar@gmail.com>
1434 Date: Wed Jul 5 20:44:00 2017 +0200
1435
1436 fatlabel: Fix erasing label
1437
1438 Empty label needs to be stored as "NO NAME ". Like in mkfs treat label
1439 which starts with character 0xE5 as empty.
1440
1441 commit e1397b9
1442 Author: Pali Rohár <pali.rohar@gmail.com>
1443 Date: Wed Jul 5 20:37:17 2017 +0200
1444
1445 mkfs: Handle -n "" correctly
1446
1447 When user specify empty argument for -n, then it is empty label and needs
1448 to be transformed to NO_NAME. Also treat -n argument which starts with
1449 character 0xE5 as empty because label is stored also in root FAT directory
1450 and such entry is marked as deleted.
1451
1452 Fixes #54
1453
1454 commit 2afb699
1455 Author: Pali Rohár <pali.rohar@gmail.com>
1456 Date: Thu Sep 28 10:13:56 2017 +0200
1457
1458 fatlabel: Fix parsing volume ID
1459
1460 * Do not allow specifying empty argument as volume ID
1461 * Check for errno (as general error) after more specific errors
1462
1463 Fixes #64
1464
1465 commit 7ddcf9b
1466 Author: Andreas Bombe <aeb@debian.org>
1467 Date: Mon Sep 25 01:21:23 2017 +0200
1468
1469 fatlabel: Implement volume ID mode
1470
1471 When given the new -i or --volume-id option, fatlabel will display or
1472 change the volume ID (serial number) instead of the volume label. The ID
1473 is displayed as an 8 digit hexadecimal number, when changing it must
1474 also be given as a hexadecimal number that fits within 32 bits.
1475
1476 Fixes #52
1477
1478 Signed-off-by: Andreas Bombe <aeb@debian.org>
1479
1480 commit 20a3e0f
1481 Author: Andreas Bombe <aeb@debian.org>
1482 Date: Mon Sep 25 00:36:33 2017 +0200
1483
1484 Add write_serial() function
1485
1486 write_serial() works like write_boot_label() but sets the volume ID
1487 instead of the volume label in the boot sector.
1488
1489 Signed-off-by: Andreas Bombe <aeb@debian.org>
1490
1491 commit d7c9ffa
1492 Author: Andreas Bombe <aeb@debian.org>
1493 Date: Mon Sep 25 00:07:17 2017 +0200
1494
1495 Make fs_open() path argument const char*
1496
1497 Signed-off-by: Andreas Bombe <aeb@debian.org>
1498
1499 commit 06c2d11
1500 Author: Andreas Bombe <aeb@debian.org>
1501 Date: Sun Sep 24 22:32:16 2017 +0200
1502
1503 Read volume ID in read_boot()
1504
1505 The DOS_FS struct gets a new 32 bit field "serial" and read_boot() will
1506 now read the volume ID into this field.
1507
1508 Signed-off-by: Andreas Bombe <aeb@debian.org>
1509
1510 commit e501243
1511 Author: Andreas Bombe <aeb@debian.org>
1512 Date: Thu Sep 21 15:20:33 2017 +0200
1513
1514 fatlabel: Expand help message by description and options
1515
1516 Signed-off-by: Andreas Bombe <aeb@debian.org>
1517
1518 commit 944ffe4
1519 Author: Andreas Bombe <aeb@debian.org>
1520 Date: Thu Sep 21 15:15:54 2017 +0200
1521
1522 fatlabel: Change option parsing to getopt_long()
1523
1524 Signed-off-by: Andreas Bombe <aeb@debian.org>
1525
1526 commit 33dd224
1527 Author: Andreas Bombe <aeb@debian.org>
1528 Date: Sat Aug 5 20:02:04 2017 -0400
1529
1530 Warn that -r is useless with FAT32 filesystems
1531
1532 The option -r specifies the root directory size that neither is nor can
1533 be fixed on FAT32. If generating a FAT32 filesystem and this option is
1534 specified, warn the user that it has no effect.
1535
1536 Fixes #43
1537
1538 Signed-off-by: Andreas Bombe <aeb@debian.org>
1539
1540 commit ed9facf
1541 Author: Jakub Wilk <jwilk@jwilk.net>
1542 Date: Tue Jul 11 01:01:20 2017 +0200
1543
1544 Fix signed integer overflow in FSTART
1545
1546 uint16_t was promoted to int, and then left shift could overflow it.
1547 Add explicit cast to uint32_t to avoid undefined behavior.
1548
1549 Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
1550 Signed-off-by: Andreas Bombe <aeb@debian.org>
1551
1552 commit 995d814
1553 Author: Emanuel Czirai <xftroxgpx@gmail.com>
1554 Date: Fri May 5 22:43:54 2017 +0200
1555
1556 add missing \n
1557
1558 To fix this:
1559 ```
1560 Starting check/repair pass.
1561 FATs differ but appear to be intact.1) Use first FAT
1562 2) Use second FAT
1563 [12?q]?
1564 ```
1565
1566 commit 9d822ba
1567 Author: Andreas Bombe <aeb@debian.org>
1568 Date: Thu Jun 29 20:56:03 2017 +0200
1569
1570 mkfs: List all options with short descriptions in --help message
1571
1572 Make the help message more informative by giving a short description,
1573 simplifying the usage line and giving a short description of every
1574 option. The usage line now also shows the actual executable name instead
1575 of a hardwired 'mkfs.fat'.
1576
1577 Signed-off-by: Andreas Bombe <aeb@debian.org>
1578
1579 commit 32b3bce
1580 Author: Andreas Bombe <aeb@debian.org>
1581 Date: Wed Jun 28 15:17:33 2017 +0200
1582
1583 mkfs, fsck: Add --variant=TYPE command line option
1584
1585 TYPE can be 'standard' or 'atari' (case insensitive) to select the
1586 desired mode rather than having to toggle with -A.
1587
1588 Signed-off-by: Andreas Bombe <aeb@debian.org>
1589
1590 commit 6fc9004
1591 Author: Andreas Bombe <aeb@debian.org>
1592 Date: Tue May 30 21:26:44 2017 +0200
1593
1594 manpages: Rework the intro of the mkfs man page
1595
1596 Acknowledge that image files can be used in place of device files.
1597 Remove mentions of "under Linux" since it has been portable for a while.
1598
1599 Signed-off-by: Andreas Bombe <aeb@debian.org>
1600
1601 commit bbbd077
1602 Author: Andreas Bombe <aeb@debian.org>
1603 Date: Fri Apr 21 20:47:32 2017 +0200
1604
1605 manpages, configure.ac: Correct description of Atari format selection
1606
1607 The -A option doesn't turn on (or turn off) Atari format selection, it
1608 toggles it with every occurrence. Change wording in the man pages to
1609 reflect that.
1610
1611 Also mention that automatic selection can happen only on 68k Atari Linux
1612 in the man pages and the --enable-atari-check option help in
1613 configure.ac.
1614
1615 Signed-off-by: Andreas Bombe <aeb@debian.org>
1616
1617 commit 9fa180c
1618 Author: Andreas Bombe <aeb@debian.org>
1619 Date: Thu Apr 6 20:47:11 2017 +0200
1620
1621 Disable legacy check for 68k Atari by default
1622
1623 The code that checked for Atari hardware when compiled for the 68k
1624 architecture is now disabled by default. A new configure option
1625 --enable-atari-check allows enabling it again.
1626
1627 In addition to the the new configure option and the symbol __mc68000__
1628 it also depends on __linux__, since its implementation checks Linux
1629 specific /proc files.
1630
1631 Signed-off-by: Andreas Bombe <aeb@debian.org>
1632
1633 commit d0c8900
1634 Author: Andreas Bombe <aeb@debian.org>
1635 Date: Wed Apr 5 20:40:33 2017 +0200
1636
1637 Move all three check_atari() and atari_format definitions to common.c
1638
1639 Now that mkfs is also using common.c, all three identical check_atari()
1640 definitions from mkfs, fsck and fatlabel can be combined in a single
1641 location in common.c
1642
1643 Signed-off-by: Andreas Bombe <aeb@debian.org>
1644
1645 commit a753734
1646 Author: Andreas Bombe <aeb@debian.org>
1647 Date: Wed Apr 5 20:29:20 2017 +0200
1648
1649 mkfs: Link with common.c and use its die() implementation
1650
1651 Now common.c is linked into mkfs and its die() implementation is used
1652 instead of the local implementation. That implementation consisting of a
1653 die() macro and fatal_error() function has been removed.
1654
1655 To reproduce current messages exactly, there is now a program_name
1656 variable in common.c. If it is not NULL, die() will prepend its contents
1657 to the message it prints.
1658
1659 The previous implementation implicitly passed device_name to the
1660 printf() so that die() invocations only needed to put "%s" where they
1661 wanted the device name to appear in the string. These invocations now
1662 have explicit device_name arguments.
1663
1664 Signed-off-by: Andreas Bombe <aeb@debian.org>
1665
1666 commit b0d524d
1667 Author: Andreas Bombe <aeb@debian.org>
1668 Date: Tue Apr 4 20:42:02 2017 +0200
1669
1670 fsck.fat.h: Remove extern declarations of interactive and write_immed
1671
1672 These two declarations were forgotten when the variables moved to
1673 common.c.
1674
1675 Signed-off-by: Andreas Bombe <aeb@debian.org>
1676
1677 commit 2af848f
1678 Author: Andreas Bombe <aeb@debian.org>
1679 Date: Mon Apr 3 20:53:14 2017 +0200
1680
1681 fsck: Switch to getopt_long() option parser and add --help option
1682
1683 Signed-off-by: Andreas Bombe <aeb@debian.org>
1684
1685 commit c0c3141
1686 Author: Andreas Bombe <aeb@debian.org>
1687 Date: Mon Apr 3 20:45:20 2017 +0200
1688
1689 fsck: Pass the exit value to use to usage()
1690
1691 Signed-off-by: Andreas Bombe <aeb@debian.org>
1692
1693 commit 112bdc6
1694 Author: Andreas Bombe <aeb@debian.org>
1695 Date: Mon Apr 3 20:41:31 2017 +0200
1696
1697 fsck: Clean up usage() message a little
1698
1699 Bring the usage() help message more in line with common conventions.
1700
1701 Signed-off-by: Andreas Bombe <aeb@debian.org>
1702
1703 commit 4d2273a
1704 Author: Andreas Bombe <aeb@debian.org>
1705 Date: Fri Mar 31 14:41:42 2017 +0200
1706
1707 mkfs.fat.c: Change misleading comment about FAT32 selection
1708
1709 There was an apparently very old comment in setup_tables() about FAT32
1710 not yet being chosen automatically. If a specific FAT size is not
1711 requested from the command line, establish_params() will previously have
1712 set size_fat to 32 when the filesystem size is at least 512 MiB.
1713
1714 Signed-off-by: Andreas Bombe <aeb@debian.org>
1715
1716 commit 8585962
1717 Author: Andreas Bombe <aeb@debian.org>
1718 Date: Fri Mar 24 20:40:12 2017 +0100
1719
1720 fsck: Add quit choice to interactive prompts
1721
1722 All prompts now get an additional 'q' choice to explicitly quit fsck.
1723 Selecting 'q' will print a message detailing the situation and ask for
1724 confirmation.
1725
1726 Since the message describing the situation depends on whether fsck is in
1727 immediate-write mode, the variable selecting that is moved to common.c
1728 to make it accessible to the get_choice() function.
1729
1730 Signed-off-by: Andreas Bombe <aeb@debian.org>
1731
1732 commit c366076
1733 Author: Andreas Bombe <aeb@debian.org>
1734 Date: Thu Feb 23 21:00:59 2017 +0100
1735
1736 fsck: Make prompts asking for writing changes at end more verbose and clear
1737
1738 Signed-off-by: Andreas Bombe <aeb@debian.org>
1739
1740 commit 141b009
1741 Author: Andreas Bombe <aeb@debian.org>
1742 Date: Wed Feb 22 20:07:25 2017 +0100
1743
1744 fsck: Don't ask whether to perform changes in immediate write mode
1745
1746 When all changes have already been written directly, it is useless to
1747 ask whether to commit the changes and probably confusing to the user.
1748
1749 Signed-off-by: Andreas Bombe <aeb@debian.org>
1750
1751 commit b2cfd70
1752 Author: Andreas Bombe <aeb@debian.org>
1753 Date: Tue Feb 21 21:36:04 2017 +0100
1754
1755 Remove get_key()
1756
1757 Signed-off-by: Andreas Bombe <aeb@debian.org>
1758
1759 commit 0c1c5fc
1760 Author: Andreas Bombe <aeb@debian.org>
1761 Date: Tue Feb 21 21:24:14 2017 +0100
1762
1763 Overhaul interactive prompts
1764
1765 All uses of get_key() are converted to get_choice() and fsck now
1766 disables canonical terminal mode to directly get key presses. It is no
1767 longer required to press enter after typing the choice and it is no
1768 longer possible to enter whole strings where only a character is
1769 expected. The reaction to invalid input should be consistent now (i.e.
1770 always repeat the prompt).
1771
1772 Signed-off-by: Andreas Bombe <aeb@debian.org>
1773
1774 commit 91b20bd
1775 Author: Andreas Bombe <aeb@debian.org>
1776 Date: Tue Feb 21 21:14:43 2017 +0100
1777
1778 Add get_choice() function
1779
1780 The get_choice() function is intended to supersede get_key(). It takes
1781 pairs of return values and strings for every choice and a
1782 non-interactive default choice, does the prompting and reading of user
1783 input (if interactive) and returns the value for the selected choice.
1784
1785 Since it needs to know if it runs in interactive mode, the "interactive"
1786 variable has been moved to common.c and removed from fsck.fat.c and
1787 fatlabel.c.
1788
1789 Signed-off-by: Andreas Bombe <aeb@debian.org>
1790
1791 commit fd92fab
1792 Author: Andreas Bombe <aeb@debian.org>
1793 Date: Tue Feb 21 14:15:12 2017 +0100
1794
1795 Add get_line() function to read user input in canonical mode
1796
1797 The function will first save the terminal state and enable canonical and
1798 echo mode, display a prompt, call fgets(), then restore previous
1799 terminal mode. This allows it to work correctly regardless of the
1800 current terminal mode.
1801
1802 Signed-off-by: Andreas Bombe <aeb@debian.org>
1803
1804 commit 0155c9c
1805 Author: Andreas Bombe <aeb@debian.org>
1806 Date: Mon Feb 20 14:09:43 2017 +0100
1807
1808 Add asprintf() wrapper
1809
1810 Make xasprintf() a wrapper that calls asprintf() and terminates if an
1811 error occurs like the alloc() function does for malloc(). The
1812 availability of the non-standard asprintf() call is checked in
1813 configure.ac and xasprintf() uses a local implementation if it isn't.
1814
1815 Signed-off-by: Andreas Bombe <aeb@debian.org>
1816
1817 commit 09769e6
1818 Author: Andreas Bombe <aeb@debian.org>
1819 Date: Fri Feb 10 14:06:40 2017 +0100
1820
1821 Fix printf format specifier for printing label
1822
1823 Fix a mistake introduced in the last commit where a field width instead
1824 of precision was given for rendering a fixed length string (without null
1825 termination).
1826
1827 Signed-off-by: Andreas Bombe <aeb@debian.org>
1828
1829 commit 08cf67b
1830 Author: Andreas Bombe <aeb@debian.org>
1831 Date: Thu Jan 26 21:31:03 2017 +0100
1832
1833 Turn label in struct DOS_FS into char array from pointer
1834
1835 Signed-off-by: Andreas Bombe <aeb@debian.org>
1836
1837 commit 32eff6f
1838 Author: Andreas Bombe <aeb@debian.org>
1839 Date: Thu Jan 26 21:27:19 2017 +0100
1840
1841 Append +git to version number
1842
1843 Signed-off-by: Andreas Bombe <aeb@debian.org>
1844
1845 commit 820c2f9 (tag: v4.1)
1846 Author: Andreas Bombe <aeb@debian.org>
1847 Date: Tue Jan 24 13:10:23 2017 +0100
1848
1849 Releasing version 4.1
1850
1851 Signed-off-by: Andreas Bombe <aeb@debian.org>
1852
01853 commit cad2c17
11854 Author: Andreas Bombe <aeb@debian.org>
21855 Date: Mon Jan 23 03:10:56 2017 +0100
+0
-370
INSTALL less more
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
66 doc/README.dosfsck \
77 doc/README.dosfstools-2.x \
88 doc/README.mkdosfs \
9 doc/TODO.dosfstools-2.x
9 doc/TODO.dosfstools-2.x \
10 COPYING ChangeLog NEWS README
11
12 EXTRA_DIST = autogen.sh
0 # Makefile.in generated by automake 1.15 from Makefile.am.
0 # Makefile.in generated by automake 1.16.1 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2014 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2018 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
8585 NORMAL_UNINSTALL = :
8686 PRE_UNINSTALL = :
8787 POST_UNINSTALL = :
88 build_triplet = @build@
89 host_triplet = @host@
8890 subdir = .
8991 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
9092 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
160162 $(RECURSIVE_CLEAN_TARGETS) \
161163 $(am__extra_recursive_targets)
162164 AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
163 cscope distdir dist dist-all distcheck
165 cscope distdir distdir-am dist dist-all distcheck
164166 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
165167 # Read a list of newline-separated strings from the standard input,
166168 # and print each of them once, without duplicates. Input order is
182184 CTAGS = ctags
183185 CSCOPE = cscope
184186 DIST_SUBDIRS = $(SUBDIRS)
185 am__DIST_COMMON = $(srcdir)/Makefile.in COPYING ChangeLog INSTALL NEWS \
186 README TODO compile depcomp install-sh missing
187 am__DIST_COMMON = $(srcdir)/Makefile.in COPYING ChangeLog NEWS README \
188 compile config.guess config.rpath config.sub install-sh \
189 missing
187190 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
188191 distdir = $(PACKAGE)-$(VERSION)
189192 top_distdir = $(distdir)
236239 CC = @CC@
237240 CCDEPMODE = @CCDEPMODE@
238241 CFLAGS = @CFLAGS@
242 CHECKATARI = @CHECKATARI@
239243 CPP = @CPP@
240244 CPPFLAGS = @CPPFLAGS@
241245 CYGPATH_W = @CYGPATH_W@
253257 INSTALL_SCRIPT = @INSTALL_SCRIPT@
254258 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
255259 LDFLAGS = @LDFLAGS@
260 LIBICONV = @LIBICONV@
256261 LIBOBJS = @LIBOBJS@
257262 LIBS = @LIBS@
258263 LN_S = @LN_S@
264 LTLIBICONV = @LTLIBICONV@
259265 LTLIBOBJS = @LTLIBOBJS@
260266 MAKEINFO = @MAKEINFO@
261267 MKDIR_P = @MKDIR_P@
268274 PACKAGE_URL = @PACKAGE_URL@
269275 PACKAGE_VERSION = @PACKAGE_VERSION@
270276 PATH_SEPARATOR = @PATH_SEPARATOR@
271 PKG_CONFIG = @PKG_CONFIG@
272 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
273 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
274277 RELEASE_DATE = @RELEASE_DATE@
275278 SET_MAKE = @SET_MAKE@
276279 SHELL = @SHELL@
277280 STRIP = @STRIP@
278 UDEV_CFLAGS = @UDEV_CFLAGS@
279 UDEV_LIBS = @UDEV_LIBS@
280281 VERSION = @VERSION@
281282 XXD_FOUND = @XXD_FOUND@
282283 abs_builddir = @abs_builddir@
290291 am__tar = @am__tar@
291292 am__untar = @am__untar@
292293 bindir = @bindir@
294 build = @build@
293295 build_alias = @build_alias@
296 build_cpu = @build_cpu@
297 build_os = @build_os@
298 build_vendor = @build_vendor@
294299 builddir = @builddir@
295300 datadir = @datadir@
296301 datarootdir = @datarootdir@
297302 docdir = @docdir@
298303 dvidir = @dvidir@
299304 exec_prefix = @exec_prefix@
305 host = @host@
300306 host_alias = @host_alias@
307 host_cpu = @host_cpu@
308 host_os = @host_os@
309 host_vendor = @host_vendor@
301310 htmldir = @htmldir@
302311 includedir = @includedir@
303312 infodir = @infodir@
330339 doc/README.dosfsck \
331340 doc/README.dosfstools-2.x \
332341 doc/README.mkdosfs \
333 doc/TODO.dosfstools-2.x
334
342 doc/TODO.dosfstools-2.x \
343 COPYING ChangeLog NEWS README
344
345 EXTRA_DIST = autogen.sh
335346 all: all-recursive
336347
337348 .SUFFIXES:
356367 echo ' $(SHELL) ./config.status'; \
357368 $(SHELL) ./config.status;; \
358369 *) \
359 echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
360 cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
370 echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
371 cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
361372 esac;
362373
363374 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
496507 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
497508 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
498509
499 distdir: $(DISTFILES)
510 distdir: $(BUILT_SOURCES)
511 $(MAKE) $(AM_MAKEFLAGS) distdir-am
512
513 distdir-am: $(DISTFILES)
500514 $(am__remove_distdir)
501515 test -d "$(distdir)" || mkdir "$(distdir)"
502516 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
561575 ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
562576 || chmod -R a+r "$(distdir)"
563577 dist-gzip: distdir
564 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
578 tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
565579 $(am__post_remove_distdir)
566580
567581 dist-bzip2: distdir
587601 @echo WARNING: "Support for shar distribution archives is" \
588602 "deprecated." >&2
589603 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
590 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
604 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
591605 $(am__post_remove_distdir)
592606
593607 dist-zip: distdir
605619 distcheck: dist
606620 case '$(DIST_ARCHIVES)' in \
607621 *.tar.gz*) \
608 GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
622 eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
609623 *.tar.bz2*) \
610624 bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
611625 *.tar.lz*) \
615629 *.tar.Z*) \
616630 uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
617631 *.shar.gz*) \
618 GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
632 eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
619633 *.zip*) \
620634 unzip $(distdir).zip ;;\
621635 esac
+157
-0
NEWS less more
0 dosfstools 4.2 - released 2021-01-31
1 ====================================
2
3 fatlabel now accepts two new options. When given the -i or --volume-id option,
4 fatlabel changes to an alternate mode where it displays or changes the volume
5 serial number instead of the volume label. With the -r or --reset option, it
6 will remove the label or (in the alternate mode) generate a new volume serial
7 number.
8
9 The user prompting for interactive fsck has been overhauled. Now it will
10 directly react to a pressed key without the user having to additionally press
11 enter. The changed prompting is also consistently repeating the prompt when
12 invalid input is given.
13
14 The legacy check whether it is running on Atari hardware when compiled for 68k
15 in order to automatically switch to Atari mode is now disabled by default. It
16 can be compiled in with the new configure switch --enable-atari-check.
17
18 Both mkfs and fsck now have a new option --variant=TYPE where TYPE can be
19 'standard' or 'atari' to explicitly select one of those variants rather than
20 having to toggle between them with -A.
21
22 fsck, mkfs and fatlabel were fixed to process volume label correctly. Previously
23 there were many issues during processing labels. Fixes issues are: leading byte
24 0xE5 of root label needs to be handled in special way, label cannot contain some
25 special characters, label itself is stored according to the current DOS codepage
26 which may be specified by a new --codepage option. fatlabel now reads volume
27 label only from the root directory to be compatible with existing systems like
28 MS-DOS 5.00, MS-DOS 6.22, MS-DOS 7.10, Windows 98, Windows XP, Windows 7, 8, 10
29 and also with the Linux mlabel from mtools project. fsck was extended to fix
30 incorrect volume labels and ensure that volume label from the root directory is
31 same as the volume label stored in boot sector. Old versions of dosfslabel read
32 label only from the boot sector. So with all these changes fsck now ensures
33 compatibility with both MS-DOS/Windows and old Linux/dosfslabel world.
34
35 fsck now allows spaces in the middle of SFNs. Previous behavior (when spaces
36 are disallowed) can be achieved by a new option -S.
37
38 Both mkfs and fsck now have fixed Year 2038 Bug. mkfs may still set filesystem
39 timestamp to 1980-01-01 00:00:00 (beginning of the FAT era) in case operating
40 system has Year 2038 Bug and cannot provide current time in time_t variable.
41
42 Some memory leaks were fixed in fatlabel and fsck to make valgrind happy.
43
44 Processing of command line arguments in all tools were fixed to ensure that
45 invalid options are not accepted anymore and proper error message is thrown
46 instead of trying to continue with uninitialized or undefined value.
47
48 In fsck and fatlabel were fixed issues that faulty filesystems were able to
49 trigger integer overflows during reading them.
50
51 mkfs now has a new option --offset for specifying offset at which filesystem
52 would start. This is useful when formatting FAT filesystem on disk image with
53 MBR table without need to use loopback kernel driver with partx to access only
54 specific partition.
55
56 All tools now can be compiled without iconv library and in this case they
57 support only CP850 codepage which is integrated into tools. This internal
58 CP850 codepage can be used also when tools were compiled with iconv library
59 which do not support CP850 (e.g. iconv from GNU libc without installed gconv
60 shared libraries).
61
62 Manual pages were updated to clarify some ambiguous options and descriptions.
63 fatlabel has a new section with details about volume label and codepage issues.
64
65 mkfs now has a new option --mbr which fills (fake) MBR table with one partition
66 which spans whole disk device. This (fake) MBR table is needed only for
67 non-removable disks used on Microsoft Windows systems and only when formatting
68 whole unpartitioned disk.
69
70 mkfs now calculates CHS geometry according to the SD Card Part 2 File System
71 Specification. For SD cards with more than 256MB capacity is this new CHS
72 calculation same as CHS calculation defined for hard disks via LBA-Assist
73 Translation. So CHS geometry calculation in mkfs is now compatible with both
74 SD Card specification and also LBA-Assist Translation. Moreover mkfs now has
75 also a new option -g for specifying CHS geometry manually if it is needed for
76 compatibility with some SD card readers. CHS geometry is part of FAT boot
77 sector which mkfs.fat must fill.
78
79 fsck now checks for DOS Clean Shutdown bit and marks filesystem as clean after
80 successful run. This is for compatibility with Microsft Windows 98 and also with
81 Windows NT-based variants.
82
83 Dependency on systemd/udev was completely removed from mkfs tool. But there is
84 no lost or removed functionality. Existing systemd/udev code was rewritten to
85 directly access sysfs and new implementation has less lines of code as previous
86 implementation which used systemd/udev libraries.
87
88 mkfs was fixed to setup FAT32 backup boot sector correctly.
89
90 mkfs's -D option (BIOS drive number) was relaxed to support also higher level
91 hard disk and floppy devices (second, third, ...).
92
93 fsck now preserve reserved fields in info sector. They are used by other systems
94 (e.g. FSIBOOT stage of lDOS boot32.asm), hence why are reserved.
95
96 fsck was extended to check and fix that first two entires in directory
97 structures are . and ..
98
99 mkfs now aligns total number of sectors to be multiple of the value of sectors
100 per track which is stored in FAT boot sector. This requirement is needed by DOS
101 systems and also by Linux FAT tools from mtools project. Alignment can be turned
102 off by -a option.
103
104 mkfs is now able to calculate FAT32 cluster size also for disks which have
105 sector size different than 512 bytes. Note that this calculation is not optimal.
106 It is just first step which ensures that mkfs does not fail during formatting
107 Native 4K disks.
108
109 mkfs cluster calculation was fixed to correctly handle differences between
110 FAT12 and FAT16 variants. mkfs now explicitly disallow to create FAT filesystem
111 with 4085 or 4086 clusters because Windows fastfat.sys detects such filesystem
112 as FAT12 but Linux msdos.ko/vfat.ko detects it as FAT16. mkfs now avoids this
113 situation to happen by fully automatic increasing or decreasing cluster size.
114
115 fsck now has a new option -F which can be used to specify FAT table used for
116 reading whole FAT filesystem. It can be useful in situation when user wants
117 to do recovery and filesystem repairing from second FAT table independently
118 of what fsck thinks that is the best.
119
120 fsck was extended to try fixing first FAT cluster but only when -F option is
121 specified. Previously when first FAT cluster was broken, fsck just printed
122 error: "Both FATs appear to be corrupt. Giving up." and failed.
123
124 fatlabel was fixed to not call parts of fsck procedure and to not print
125 warning or log messages on stdout as it conflicts with expected label
126 output on stdout.
127
128 A test suite was heavily extended and now it also checks that fsck repairs
129 broken filesystem into the expected state.
130
131 List of fixed issues:
132 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=803391
133 https://github.com/dosfstools/dosfstools/issues/13
134 https://github.com/dosfstools/dosfstools/issues/18
135 https://github.com/dosfstools/dosfstools/issues/22
136 https://github.com/dosfstools/dosfstools/issues/29
137 https://github.com/dosfstools/dosfstools/issues/32
138 https://github.com/dosfstools/dosfstools/issues/38
139 https://github.com/dosfstools/dosfstools/issues/39
140 https://github.com/dosfstools/dosfstools/issues/43
141 https://github.com/dosfstools/dosfstools/issues/45
142 https://github.com/dosfstools/dosfstools/issues/52
143 https://github.com/dosfstools/dosfstools/issues/53
144 https://github.com/dosfstools/dosfstools/issues/54
145 https://github.com/dosfstools/dosfstools/issues/64
146 https://github.com/dosfstools/dosfstools/issues/66
147 https://github.com/dosfstools/dosfstools/issues/69
148 https://github.com/dosfstools/dosfstools/issues/70
149 https://github.com/dosfstools/dosfstools/issues/74
150 https://github.com/dosfstools/dosfstools/issues/88
151 https://github.com/dosfstools/dosfstools/issues/99
152 https://github.com/dosfstools/dosfstools/issues/111
153 https://github.com/dosfstools/dosfstools/issues/139
154 https://github.com/dosfstools/dosfstools/issues/151
155
156
0157 dosfstools 4.1 - released 2017-01-24
1158 ====================================
2159
33
44
55 ### Build Requirements
6
7 dosfstools recommends libudev. It is used in mkfs.fat to collect additional
8 information about the device to format in order to refuse potentially unsafe
9 operations without additional confirmation.
106
117 The test suite requires the tool xxd (available as part of the vim
128 distribution).
4844 because it, like other autogenerated files for the build system, is not included
4945 in the repository.
5046
51 First, autoconf and automake have to be installed. Then you can run
52 "autoreconf -i" to generate all the required files.
47 First, autoconf, automake and gettext have to be installed. Then you can run
48 "./autogen.sh" to generate all the required files.
+0
-2
TODO less more
0 * fsck overlap backup boot
1 * correct backup generation
0 # generated automatically by aclocal 1.15 -*- Autoconf -*-
1
2 # Copyright (C) 1996-2014 Free Software Foundation, Inc.
0 # generated automatically by aclocal 1.16.1 -*- Autoconf -*-
1
2 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
33
44 # This file is free software; the Free Software Foundation
55 # gives unlimited permission to copy and/or distribute it,
1919 If you have problems, you may need to regenerate the build system entirely.
2020 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
2121
22 dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
23 dnl serial 11 (pkg-config-0.29)
24 dnl
25 dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
26 dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
27 dnl
28 dnl This program is free software; you can redistribute it and/or modify
29 dnl it under the terms of the GNU General Public License as published by
30 dnl the Free Software Foundation; either version 2 of the License, or
31 dnl (at your option) any later version.
32 dnl
33 dnl This program is distributed in the hope that it will be useful, but
34 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
35 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
36 dnl General Public License for more details.
37 dnl
38 dnl You should have received a copy of the GNU General Public License
39 dnl along with this program; if not, write to the Free Software
40 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
41 dnl 02111-1307, USA.
42 dnl
43 dnl As a special exception to the GNU General Public License, if you
44 dnl distribute this file as part of a program that contains a
45 dnl configuration script generated by Autoconf, you may include it under
46 dnl the same distribution terms that you use for the rest of that
47 dnl program.
48
49 dnl PKG_PREREQ(MIN-VERSION)
50 dnl -----------------------
51 dnl Since: 0.29
52 dnl
53 dnl Verify that the version of the pkg-config macros are at least
54 dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
55 dnl installed version of pkg-config, this checks the developer's version
56 dnl of pkg.m4 when generating configure.
57 dnl
58 dnl To ensure that this macro is defined, also add:
59 dnl m4_ifndef([PKG_PREREQ],
60 dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
61 dnl
62 dnl See the "Since" comment for each macro you use to see what version
63 dnl of the macros you require.
64 m4_defun([PKG_PREREQ],
65 [m4_define([PKG_MACROS_VERSION], [0.29])
66 m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
67 [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
68 ])dnl PKG_PREREQ
69
70 dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
71 dnl ----------------------------------
72 dnl Since: 0.16
73 dnl
74 dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
75 dnl first found in the path. Checks that the version of pkg-config found
76 dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
77 dnl used since that's the first version where most current features of
78 dnl pkg-config existed.
79 AC_DEFUN([PKG_PROG_PKG_CONFIG],
80 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
81 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
82 m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
83 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
84 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
85 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
86
87 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
88 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
22 # iconv.m4 serial 19 (gettext-0.18.2)
23 dnl Copyright (C) 2000-2002, 2007-2014, 2016 Free Software Foundation, Inc.
24 dnl This file is free software; the Free Software Foundation
25 dnl gives unlimited permission to copy and/or distribute it,
26 dnl with or without modifications, as long as this notice is preserved.
27
28 dnl From Bruno Haible.
29
30 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
31 [
32 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
33 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
34 AC_REQUIRE([AC_LIB_RPATH])
35
36 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
37 dnl accordingly.
38 AC_LIB_LINKFLAGS_BODY([iconv])
39 ])
40
41 AC_DEFUN([AM_ICONV_LINK],
42 [
43 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
44 dnl those with the standalone portable GNU libiconv installed).
45 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
46
47 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
48 dnl accordingly.
49 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
50
51 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
52 dnl because if the user has installed libiconv and not disabled its use
53 dnl via --without-libiconv-prefix, he wants to use it. The first
54 dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
55 am_save_CPPFLAGS="$CPPFLAGS"
56 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
57
58 AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
59 am_cv_func_iconv="no, consider installing GNU libiconv"
60 am_cv_lib_iconv=no
61 AC_LINK_IFELSE(
62 [AC_LANG_PROGRAM(
63 [[
64 #include <stdlib.h>
65 #include <iconv.h>
66 ]],
67 [[iconv_t cd = iconv_open("","");
68 iconv(cd,NULL,NULL,NULL,NULL);
69 iconv_close(cd);]])],
70 [am_cv_func_iconv=yes])
71 if test "$am_cv_func_iconv" != yes; then
72 am_save_LIBS="$LIBS"
73 LIBS="$LIBS $LIBICONV"
74 AC_LINK_IFELSE(
75 [AC_LANG_PROGRAM(
76 [[
77 #include <stdlib.h>
78 #include <iconv.h>
79 ]],
80 [[iconv_t cd = iconv_open("","");
81 iconv(cd,NULL,NULL,NULL,NULL);
82 iconv_close(cd);]])],
83 [am_cv_lib_iconv=yes]
84 [am_cv_func_iconv=yes])
85 LIBS="$am_save_LIBS"
86 fi
87 ])
88 if test "$am_cv_func_iconv" = yes; then
89 AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
90 dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
91 dnl Solaris 10.
92 am_save_LIBS="$LIBS"
93 if test $am_cv_lib_iconv = yes; then
94 LIBS="$LIBS $LIBICONV"
95 fi
96 am_cv_func_iconv_works=no
97 for ac_iconv_const in '' 'const'; do
98 AC_RUN_IFELSE(
99 [AC_LANG_PROGRAM(
100 [[
101 #include <iconv.h>
102 #include <string.h>
103
104 #ifndef ICONV_CONST
105 # define ICONV_CONST $ac_iconv_const
106 #endif
107 ]],
108 [[int result = 0;
109 /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
110 returns. */
111 {
112 iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
113 if (cd_utf8_to_88591 != (iconv_t)(-1))
114 {
115 static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
116 char buf[10];
117 ICONV_CONST char *inptr = input;
118 size_t inbytesleft = strlen (input);
119 char *outptr = buf;
120 size_t outbytesleft = sizeof (buf);
121 size_t res = iconv (cd_utf8_to_88591,
122 &inptr, &inbytesleft,
123 &outptr, &outbytesleft);
124 if (res == 0)
125 result |= 1;
126 iconv_close (cd_utf8_to_88591);
127 }
128 }
129 /* Test against Solaris 10 bug: Failures are not distinguishable from
130 successful returns. */
131 {
132 iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
133 if (cd_ascii_to_88591 != (iconv_t)(-1))
134 {
135 static ICONV_CONST char input[] = "\263";
136 char buf[10];
137 ICONV_CONST char *inptr = input;
138 size_t inbytesleft = strlen (input);
139 char *outptr = buf;
140 size_t outbytesleft = sizeof (buf);
141 size_t res = iconv (cd_ascii_to_88591,
142 &inptr, &inbytesleft,
143 &outptr, &outbytesleft);
144 if (res == 0)
145 result |= 2;
146 iconv_close (cd_ascii_to_88591);
147 }
148 }
149 /* Test against AIX 6.1..7.1 bug: Buffer overrun. */
150 {
151 iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
152 if (cd_88591_to_utf8 != (iconv_t)(-1))
153 {
154 static ICONV_CONST char input[] = "\304";
155 static char buf[2] = { (char)0xDE, (char)0xAD };
156 ICONV_CONST char *inptr = input;
157 size_t inbytesleft = 1;
158 char *outptr = buf;
159 size_t outbytesleft = 1;
160 size_t res = iconv (cd_88591_to_utf8,
161 &inptr, &inbytesleft,
162 &outptr, &outbytesleft);
163 if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
164 result |= 4;
165 iconv_close (cd_88591_to_utf8);
166 }
167 }
168 #if 0 /* This bug could be worked around by the caller. */
169 /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
170 {
171 iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
172 if (cd_88591_to_utf8 != (iconv_t)(-1))
173 {
174 static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
175 char buf[50];
176 ICONV_CONST char *inptr = input;
177 size_t inbytesleft = strlen (input);
178 char *outptr = buf;
179 size_t outbytesleft = sizeof (buf);
180 size_t res = iconv (cd_88591_to_utf8,
181 &inptr, &inbytesleft,
182 &outptr, &outbytesleft);
183 if ((int)res > 0)
184 result |= 8;
185 iconv_close (cd_88591_to_utf8);
186 }
187 }
188 #endif
189 /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
190 provided. */
191 if (/* Try standardized names. */
192 iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
193 /* Try IRIX, OSF/1 names. */
194 && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
195 /* Try AIX names. */
196 && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
197 /* Try HP-UX names. */
198 && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
199 result |= 16;
200 return result;
201 ]])],
202 [am_cv_func_iconv_works=yes], ,
203 [case "$host_os" in
204 aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
205 *) am_cv_func_iconv_works="guessing yes" ;;
206 esac])
207 test "$am_cv_func_iconv_works" = no || break
208 done
209 LIBS="$am_save_LIBS"
210 ])
211 case "$am_cv_func_iconv_works" in
212 *no) am_func_iconv=no am_cv_lib_iconv=no ;;
213 *) am_func_iconv=yes ;;
214 esac
215 else
216 am_func_iconv=no am_cv_lib_iconv=no
217 fi
218 if test "$am_func_iconv" = yes; then
219 AC_DEFINE([HAVE_ICONV], [1],
220 [Define if you have the iconv() function and it works.])
221 fi
222 if test "$am_cv_lib_iconv" = yes; then
223 AC_MSG_CHECKING([how to link with libiconv])
224 AC_MSG_RESULT([$LIBICONV])
225 else
226 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
227 dnl either.
228 CPPFLAGS="$am_save_CPPFLAGS"
229 LIBICONV=
230 LTLIBICONV=
231 fi
232 AC_SUBST([LIBICONV])
233 AC_SUBST([LTLIBICONV])
234 ])
235
236 dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
237 dnl avoid warnings like
238 dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
239 dnl This is tricky because of the way 'aclocal' is implemented:
240 dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
241 dnl Otherwise aclocal's initial scan pass would miss the macro definition.
242 dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
243 dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
244 dnl warnings.
245 m4_define([gl_iconv_AC_DEFUN],
246 m4_version_prereq([2.64],
247 [[AC_DEFUN_ONCE(
248 [$1], [$2])]],
249 [m4_ifdef([gl_00GNULIB],
250 [[AC_DEFUN_ONCE(
251 [$1], [$2])]],
252 [[AC_DEFUN(
253 [$1], [$2])]])]))
254 gl_iconv_AC_DEFUN([AM_ICONV],
255 [
256 AM_ICONV_LINK
257 if test "$am_cv_func_iconv" = yes; then
258 AC_MSG_CHECKING([for iconv declaration])
259 AC_CACHE_VAL([am_cv_proto_iconv], [
260 AC_COMPILE_IFELSE(
261 [AC_LANG_PROGRAM(
262 [[
263 #include <stdlib.h>
264 #include <iconv.h>
265 extern
266 #ifdef __cplusplus
267 "C"
268 #endif
269 #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
270 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
271 #else
272 size_t iconv();
273 #endif
274 ]],
275 [[]])],
276 [am_cv_proto_iconv_arg1=""],
277 [am_cv_proto_iconv_arg1="const"])
278 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
279 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
280 AC_MSG_RESULT([
281 $am_cv_proto_iconv])
282 AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
283 [Define as const if the declaration of iconv() needs const.])
284 dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
285 m4_ifdef([gl_ICONV_H_DEFAULTS],
286 [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
287 if test -n "$am_cv_proto_iconv_arg1"; then
288 ICONV_CONST="const"
289 fi
290 ])
291 fi
292 ])
293
294 # lib-ld.m4 serial 6
295 dnl Copyright (C) 1996-2003, 2009-2016 Free Software Foundation, Inc.
296 dnl This file is free software; the Free Software Foundation
297 dnl gives unlimited permission to copy and/or distribute it,
298 dnl with or without modifications, as long as this notice is preserved.
299
300 dnl Subroutines of libtool.m4,
301 dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
302 dnl collision with libtool.m4.
303
304 dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
305 AC_DEFUN([AC_LIB_PROG_LD_GNU],
306 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
307 [# I'd rather use --version here, but apparently some GNU lds only accept -v.
308 case `$LD -v 2>&1 </dev/null` in
309 *GNU* | *'with BFD'*)
310 acl_cv_prog_gnu_ld=yes
311 ;;
312 *)
313 acl_cv_prog_gnu_ld=no
314 ;;
315 esac])
316 with_gnu_ld=$acl_cv_prog_gnu_ld
317 ])
318
319 dnl From libtool-2.4. Sets the variable LD.
320 AC_DEFUN([AC_LIB_PROG_LD],
321 [AC_REQUIRE([AC_PROG_CC])dnl
322 AC_REQUIRE([AC_CANONICAL_HOST])dnl
323
324 AC_ARG_WITH([gnu-ld],
325 [AS_HELP_STRING([--with-gnu-ld],
326 [assume the C compiler uses GNU ld [default=no]])],
327 [test "$withval" = no || with_gnu_ld=yes],
328 [with_gnu_ld=no])dnl
329
330 # Prepare PATH_SEPARATOR.
331 # The user is always right.
332 if test "${PATH_SEPARATOR+set}" != set; then
333 # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
334 # contains only /bin. Note that ksh looks also at the FPATH variable,
335 # so we have to set that as well for the test.
336 PATH_SEPARATOR=:
337 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
338 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
339 || PATH_SEPARATOR=';'
340 }
89341 fi
90 if test -n "$PKG_CONFIG"; then
91 _pkg_min_version=m4_default([$1], [0.9.0])
92 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
93 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
94 AC_MSG_RESULT([yes])
95 else
96 AC_MSG_RESULT([no])
97 PKG_CONFIG=""
98 fi
99 fi[]dnl
100 ])dnl PKG_PROG_PKG_CONFIG
101
102 dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
103 dnl -------------------------------------------------------------------
104 dnl Since: 0.18
105 dnl
106 dnl Check to see whether a particular set of modules exists. Similar to
107 dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
108 dnl
109 dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
110 dnl only at the first occurence in configure.ac, so if the first place
111 dnl it's called might be skipped (such as if it is within an "if", you
112 dnl have to call PKG_CHECK_EXISTS manually
113 AC_DEFUN([PKG_CHECK_EXISTS],
114 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
115 if test -n "$PKG_CONFIG" && \
116 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
117 m4_default([$2], [:])
118 m4_ifvaln([$3], [else
119 $3])dnl
342
343 ac_prog=ld
344 if test "$GCC" = yes; then
345 # Check if gcc -print-prog-name=ld gives a path.
346 AC_MSG_CHECKING([for ld used by $CC])
347 case $host in
348 *-*-mingw*)
349 # gcc leaves a trailing carriage return which upsets mingw
350 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
351 *)
352 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
353 esac
354 case $ac_prog in
355 # Accept absolute paths.
356 [[\\/]]* | ?:[[\\/]]*)
357 re_direlt='/[[^/]][[^/]]*/\.\./'
358 # Canonicalize the pathname of ld
359 ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
360 while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
361 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
362 done
363 test -z "$LD" && LD="$ac_prog"
364 ;;
365 "")
366 # If it fails, then pretend we aren't using GCC.
367 ac_prog=ld
368 ;;
369 *)
370 # If it is relative, then search for the first ld in PATH.
371 with_gnu_ld=unknown
372 ;;
373 esac
374 elif test "$with_gnu_ld" = yes; then
375 AC_MSG_CHECKING([for GNU ld])
376 else
377 AC_MSG_CHECKING([for non-GNU ld])
378 fi
379 AC_CACHE_VAL([acl_cv_path_LD],
380 [if test -z "$LD"; then
381 acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
382 for ac_dir in $PATH; do
383 IFS="$acl_save_ifs"
384 test -z "$ac_dir" && ac_dir=.
385 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
386 acl_cv_path_LD="$ac_dir/$ac_prog"
387 # Check to see if the program is GNU ld. I'd rather use --version,
388 # but apparently some variants of GNU ld only accept -v.
389 # Break only if it was the GNU/non-GNU ld that we prefer.
390 case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
391 *GNU* | *'with BFD'*)
392 test "$with_gnu_ld" != no && break
393 ;;
394 *)
395 test "$with_gnu_ld" != yes && break
396 ;;
397 esac
398 fi
399 done
400 IFS="$acl_save_ifs"
401 else
402 acl_cv_path_LD="$LD" # Let the user override the test with a path.
120403 fi])
121
122 dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
123 dnl ---------------------------------------------
124 dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
125 dnl pkg_failed based on the result.
126 m4_define([_PKG_CONFIG],
127 [if test -n "$$1"; then
128 pkg_cv_[]$1="$$1"
129 elif test -n "$PKG_CONFIG"; then
130 PKG_CHECK_EXISTS([$3],
131 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
132 test "x$?" != "x0" && pkg_failed=yes ],
133 [pkg_failed=yes])
134 else
135 pkg_failed=untried
136 fi[]dnl
137 ])dnl _PKG_CONFIG
138
139 dnl _PKG_SHORT_ERRORS_SUPPORTED
140 dnl ---------------------------
141 dnl Internal check to see if pkg-config supports short errors.
142 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
143 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
144 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
145 _pkg_short_errors_supported=yes
404 LD="$acl_cv_path_LD"
405 if test -n "$LD"; then
406 AC_MSG_RESULT([$LD])
146407 else
147 _pkg_short_errors_supported=no
148 fi[]dnl
149 ])dnl _PKG_SHORT_ERRORS_SUPPORTED
150
151
152 dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
153 dnl [ACTION-IF-NOT-FOUND])
154 dnl --------------------------------------------------------------
155 dnl Since: 0.4.0
156 dnl
157 dnl Note that if there is a possibility the first call to
158 dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
159 dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
160 AC_DEFUN([PKG_CHECK_MODULES],
161 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
162 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
163 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
164
165 pkg_failed=no
166 AC_MSG_CHECKING([for $1])
167
168 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
169 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
170
171 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
172 and $1[]_LIBS to avoid the need to call pkg-config.
173 See the pkg-config man page for more details.])
174
175 if test $pkg_failed = yes; then
176 AC_MSG_RESULT([no])
177 _PKG_SHORT_ERRORS_SUPPORTED
178 if test $_pkg_short_errors_supported = yes; then
179 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
180 else
181 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
408 AC_MSG_RESULT([no])
409 fi
410 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
411 AC_LIB_PROG_LD_GNU
412 ])
413
414 # lib-link.m4 serial 26 (gettext-0.18.2)
415 dnl Copyright (C) 2001-2016 Free Software Foundation, Inc.
416 dnl This file is free software; the Free Software Foundation
417 dnl gives unlimited permission to copy and/or distribute it,
418 dnl with or without modifications, as long as this notice is preserved.
419
420 dnl From Bruno Haible.
421
422 AC_PREREQ([2.54])
423
424 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
425 dnl the libraries corresponding to explicit and implicit dependencies.
426 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
427 dnl augments the CPPFLAGS variable.
428 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
429 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
430 AC_DEFUN([AC_LIB_LINKFLAGS],
431 [
432 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
433 AC_REQUIRE([AC_LIB_RPATH])
434 pushdef([Name],[m4_translit([$1],[./+-], [____])])
435 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
436 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
437 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
438 AC_LIB_LINKFLAGS_BODY([$1], [$2])
439 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
440 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
441 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
442 ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
443 ])
444 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
445 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
446 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
447 LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
448 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
449 AC_SUBST([LIB]NAME)
450 AC_SUBST([LTLIB]NAME)
451 AC_SUBST([LIB]NAME[_PREFIX])
452 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
453 dnl results of this search when this library appears as a dependency.
454 HAVE_LIB[]NAME=yes
455 popdef([NAME])
456 popdef([Name])
457 ])
458
459 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
460 dnl searches for libname and the libraries corresponding to explicit and
461 dnl implicit dependencies, together with the specified include files and
462 dnl the ability to compile and link the specified testcode. The missing-message
463 dnl defaults to 'no' and may contain additional hints for the user.
464 dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
465 dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
466 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
467 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
468 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
469 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
470 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
471 [
472 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
473 AC_REQUIRE([AC_LIB_RPATH])
474 pushdef([Name],[m4_translit([$1],[./+-], [____])])
475 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
476 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
477
478 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
479 dnl accordingly.
480 AC_LIB_LINKFLAGS_BODY([$1], [$2])
481
482 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
483 dnl because if the user has installed lib[]Name and not disabled its use
484 dnl via --without-lib[]Name-prefix, he wants to use it.
485 ac_save_CPPFLAGS="$CPPFLAGS"
486 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
487
488 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
489 ac_save_LIBS="$LIBS"
490 dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
491 dnl because these -l options might require -L options that are present in
492 dnl LIBS. -l options benefit only from the -L options listed before it.
493 dnl Otherwise, add it to the front of LIBS, because it may be a static
494 dnl library that depends on another static library that is present in LIBS.
495 dnl Static libraries benefit only from the static libraries listed after
496 dnl it.
497 case " $LIB[]NAME" in
498 *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
499 *) LIBS="$LIB[]NAME $LIBS" ;;
500 esac
501 AC_LINK_IFELSE(
502 [AC_LANG_PROGRAM([[$3]], [[$4]])],
503 [ac_cv_lib[]Name=yes],
504 [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
505 LIBS="$ac_save_LIBS"
506 ])
507 if test "$ac_cv_lib[]Name" = yes; then
508 HAVE_LIB[]NAME=yes
509 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
510 AC_MSG_CHECKING([how to link with lib[]$1])
511 AC_MSG_RESULT([$LIB[]NAME])
512 else
513 HAVE_LIB[]NAME=no
514 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
515 dnl $INC[]NAME either.
516 CPPFLAGS="$ac_save_CPPFLAGS"
517 LIB[]NAME=
518 LTLIB[]NAME=
519 LIB[]NAME[]_PREFIX=
520 fi
521 AC_SUBST([HAVE_LIB]NAME)
522 AC_SUBST([LIB]NAME)
523 AC_SUBST([LTLIB]NAME)
524 AC_SUBST([LIB]NAME[_PREFIX])
525 popdef([NAME])
526 popdef([Name])
527 ])
528
529 dnl Determine the platform dependent parameters needed to use rpath:
530 dnl acl_libext,
531 dnl acl_shlibext,
532 dnl acl_libname_spec,
533 dnl acl_library_names_spec,
534 dnl acl_hardcode_libdir_flag_spec,
535 dnl acl_hardcode_libdir_separator,
536 dnl acl_hardcode_direct,
537 dnl acl_hardcode_minus_L.
538 AC_DEFUN([AC_LIB_RPATH],
539 [
540 dnl Tell automake >= 1.10 to complain if config.rpath is missing.
541 m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
542 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
543 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
544 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
545 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
546 AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
547 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
548 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
549 . ./conftest.sh
550 rm -f ./conftest.sh
551 acl_cv_rpath=done
552 ])
553 wl="$acl_cv_wl"
554 acl_libext="$acl_cv_libext"
555 acl_shlibext="$acl_cv_shlibext"
556 acl_libname_spec="$acl_cv_libname_spec"
557 acl_library_names_spec="$acl_cv_library_names_spec"
558 acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
559 acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
560 acl_hardcode_direct="$acl_cv_hardcode_direct"
561 acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
562 dnl Determine whether the user wants rpath handling at all.
563 AC_ARG_ENABLE([rpath],
564 [ --disable-rpath do not hardcode runtime library paths],
565 :, enable_rpath=yes)
566 ])
567
568 dnl AC_LIB_FROMPACKAGE(name, package)
569 dnl declares that libname comes from the given package. The configure file
570 dnl will then not have a --with-libname-prefix option but a
571 dnl --with-package-prefix option. Several libraries can come from the same
572 dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
573 dnl macro call that searches for libname.
574 AC_DEFUN([AC_LIB_FROMPACKAGE],
575 [
576 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
577 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
578 define([acl_frompackage_]NAME, [$2])
579 popdef([NAME])
580 pushdef([PACK],[$2])
581 pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
582 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
583 define([acl_libsinpackage_]PACKUP,
584 m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
585 popdef([PACKUP])
586 popdef([PACK])
587 ])
588
589 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
590 dnl the libraries corresponding to explicit and implicit dependencies.
591 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
592 dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
593 dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
594 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
595 [
596 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
597 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
598 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
599 pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
600 pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
601 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
602 pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
603 dnl Autoconf >= 2.61 supports dots in --with options.
604 pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
605 dnl By default, look in $includedir and $libdir.
606 use_additional=yes
607 AC_LIB_WITH_FINAL_PREFIX([
608 eval additional_includedir=\"$includedir\"
609 eval additional_libdir=\"$libdir\"
610 ])
611 AC_ARG_WITH(P_A_C_K[-prefix],
612 [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
613 --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
614 [
615 if test "X$withval" = "Xno"; then
616 use_additional=no
617 else
618 if test "X$withval" = "X"; then
619 AC_LIB_WITH_FINAL_PREFIX([
620 eval additional_includedir=\"$includedir\"
621 eval additional_libdir=\"$libdir\"
622 ])
623 else
624 additional_includedir="$withval/include"
625 additional_libdir="$withval/$acl_libdirstem"
626 if test "$acl_libdirstem2" != "$acl_libdirstem" \
627 && ! test -d "$withval/$acl_libdirstem"; then
628 additional_libdir="$withval/$acl_libdirstem2"
182629 fi
183 # Put the nasty error message in config.log where it belongs
184 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
185
186 m4_default([$4], [AC_MSG_ERROR(
187 [Package requirements ($2) were not met:
188
189 $$1_PKG_ERRORS
190
191 Consider adjusting the PKG_CONFIG_PATH environment variable if you
192 installed software in a non-standard prefix.
193
194 _PKG_TEXT])[]dnl
630 fi
631 fi
632 ])
633 dnl Search the library and its dependencies in $additional_libdir and
634 dnl $LDFLAGS. Using breadth-first-seach.
635 LIB[]NAME=
636 LTLIB[]NAME=
637 INC[]NAME=
638 LIB[]NAME[]_PREFIX=
639 dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
640 dnl computed. So it has to be reset here.
641 HAVE_LIB[]NAME=
642 rpathdirs=
643 ltrpathdirs=
644 names_already_handled=
645 names_next_round='$1 $2'
646 while test -n "$names_next_round"; do
647 names_this_round="$names_next_round"
648 names_next_round=
649 for name in $names_this_round; do
650 already_handled=
651 for n in $names_already_handled; do
652 if test "$n" = "$name"; then
653 already_handled=yes
654 break
655 fi
656 done
657 if test -z "$already_handled"; then
658 names_already_handled="$names_already_handled $name"
659 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
660 dnl or AC_LIB_HAVE_LINKFLAGS call.
661 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
662 eval value=\"\$HAVE_LIB$uppername\"
663 if test -n "$value"; then
664 if test "$value" = yes; then
665 eval value=\"\$LIB$uppername\"
666 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
667 eval value=\"\$LTLIB$uppername\"
668 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
669 else
670 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
671 dnl that this library doesn't exist. So just drop it.
672 :
673 fi
674 else
675 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
676 dnl and the already constructed $LIBNAME/$LTLIBNAME.
677 found_dir=
678 found_la=
679 found_so=
680 found_a=
681 eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
682 if test -n "$acl_shlibext"; then
683 shrext=".$acl_shlibext" # typically: shrext=.so
684 else
685 shrext=
686 fi
687 if test $use_additional = yes; then
688 dir="$additional_libdir"
689 dnl The same code as in the loop below:
690 dnl First look for a shared library.
691 if test -n "$acl_shlibext"; then
692 if test -f "$dir/$libname$shrext"; then
693 found_dir="$dir"
694 found_so="$dir/$libname$shrext"
695 else
696 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
697 ver=`(cd "$dir" && \
698 for f in "$libname$shrext".*; do echo "$f"; done \
699 | sed -e "s,^$libname$shrext\\\\.,," \
700 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
701 | sed 1q ) 2>/dev/null`
702 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
703 found_dir="$dir"
704 found_so="$dir/$libname$shrext.$ver"
705 fi
706 else
707 eval library_names=\"$acl_library_names_spec\"
708 for f in $library_names; do
709 if test -f "$dir/$f"; then
710 found_dir="$dir"
711 found_so="$dir/$f"
712 break
713 fi
714 done
715 fi
716 fi
717 fi
718 dnl Then look for a static library.
719 if test "X$found_dir" = "X"; then
720 if test -f "$dir/$libname.$acl_libext"; then
721 found_dir="$dir"
722 found_a="$dir/$libname.$acl_libext"
723 fi
724 fi
725 if test "X$found_dir" != "X"; then
726 if test -f "$dir/$libname.la"; then
727 found_la="$dir/$libname.la"
728 fi
729 fi
730 fi
731 if test "X$found_dir" = "X"; then
732 for x in $LDFLAGS $LTLIB[]NAME; do
733 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
734 case "$x" in
735 -L*)
736 dir=`echo "X$x" | sed -e 's/^X-L//'`
737 dnl First look for a shared library.
738 if test -n "$acl_shlibext"; then
739 if test -f "$dir/$libname$shrext"; then
740 found_dir="$dir"
741 found_so="$dir/$libname$shrext"
742 else
743 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
744 ver=`(cd "$dir" && \
745 for f in "$libname$shrext".*; do echo "$f"; done \
746 | sed -e "s,^$libname$shrext\\\\.,," \
747 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
748 | sed 1q ) 2>/dev/null`
749 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
750 found_dir="$dir"
751 found_so="$dir/$libname$shrext.$ver"
752 fi
753 else
754 eval library_names=\"$acl_library_names_spec\"
755 for f in $library_names; do
756 if test -f "$dir/$f"; then
757 found_dir="$dir"
758 found_so="$dir/$f"
759 break
760 fi
761 done
762 fi
763 fi
764 fi
765 dnl Then look for a static library.
766 if test "X$found_dir" = "X"; then
767 if test -f "$dir/$libname.$acl_libext"; then
768 found_dir="$dir"
769 found_a="$dir/$libname.$acl_libext"
770 fi
771 fi
772 if test "X$found_dir" != "X"; then
773 if test -f "$dir/$libname.la"; then
774 found_la="$dir/$libname.la"
775 fi
776 fi
777 ;;
778 esac
779 if test "X$found_dir" != "X"; then
780 break
781 fi
782 done
783 fi
784 if test "X$found_dir" != "X"; then
785 dnl Found the library.
786 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
787 if test "X$found_so" != "X"; then
788 dnl Linking with a shared library. We attempt to hardcode its
789 dnl directory into the executable's runpath, unless it's the
790 dnl standard /usr/lib.
791 if test "$enable_rpath" = no \
792 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
793 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
794 dnl No hardcoding is needed.
795 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
796 else
797 dnl Use an explicit option to hardcode DIR into the resulting
798 dnl binary.
799 dnl Potentially add DIR to ltrpathdirs.
800 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
801 haveit=
802 for x in $ltrpathdirs; do
803 if test "X$x" = "X$found_dir"; then
804 haveit=yes
805 break
806 fi
807 done
808 if test -z "$haveit"; then
809 ltrpathdirs="$ltrpathdirs $found_dir"
810 fi
811 dnl The hardcoding into $LIBNAME is system dependent.
812 if test "$acl_hardcode_direct" = yes; then
813 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
814 dnl resulting binary.
815 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
816 else
817 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
818 dnl Use an explicit option to hardcode DIR into the resulting
819 dnl binary.
820 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
821 dnl Potentially add DIR to rpathdirs.
822 dnl The rpathdirs will be appended to $LIBNAME at the end.
823 haveit=
824 for x in $rpathdirs; do
825 if test "X$x" = "X$found_dir"; then
826 haveit=yes
827 break
828 fi
829 done
830 if test -z "$haveit"; then
831 rpathdirs="$rpathdirs $found_dir"
832 fi
833 else
834 dnl Rely on "-L$found_dir".
835 dnl But don't add it if it's already contained in the LDFLAGS
836 dnl or the already constructed $LIBNAME
837 haveit=
838 for x in $LDFLAGS $LIB[]NAME; do
839 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
840 if test "X$x" = "X-L$found_dir"; then
841 haveit=yes
842 break
843 fi
844 done
845 if test -z "$haveit"; then
846 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
847 fi
848 if test "$acl_hardcode_minus_L" != no; then
849 dnl FIXME: Not sure whether we should use
850 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
851 dnl here.
852 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
853 else
854 dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
855 dnl here, because this doesn't fit in flags passed to the
856 dnl compiler. So give up. No hardcoding. This affects only
857 dnl very old systems.
858 dnl FIXME: Not sure whether we should use
859 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
860 dnl here.
861 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
862 fi
863 fi
864 fi
865 fi
866 else
867 if test "X$found_a" != "X"; then
868 dnl Linking with a static library.
869 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
870 else
871 dnl We shouldn't come here, but anyway it's good to have a
872 dnl fallback.
873 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
874 fi
875 fi
876 dnl Assume the include files are nearby.
877 additional_includedir=
878 case "$found_dir" in
879 */$acl_libdirstem | */$acl_libdirstem/)
880 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
881 if test "$name" = '$1'; then
882 LIB[]NAME[]_PREFIX="$basedir"
883 fi
884 additional_includedir="$basedir/include"
885 ;;
886 */$acl_libdirstem2 | */$acl_libdirstem2/)
887 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
888 if test "$name" = '$1'; then
889 LIB[]NAME[]_PREFIX="$basedir"
890 fi
891 additional_includedir="$basedir/include"
892 ;;
893 esac
894 if test "X$additional_includedir" != "X"; then
895 dnl Potentially add $additional_includedir to $INCNAME.
896 dnl But don't add it
897 dnl 1. if it's the standard /usr/include,
898 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
899 dnl 3. if it's already present in $CPPFLAGS or the already
900 dnl constructed $INCNAME,
901 dnl 4. if it doesn't exist as a directory.
902 if test "X$additional_includedir" != "X/usr/include"; then
903 haveit=
904 if test "X$additional_includedir" = "X/usr/local/include"; then
905 if test -n "$GCC"; then
906 case $host_os in
907 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
908 esac
909 fi
910 fi
911 if test -z "$haveit"; then
912 for x in $CPPFLAGS $INC[]NAME; do
913 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
914 if test "X$x" = "X-I$additional_includedir"; then
915 haveit=yes
916 break
917 fi
918 done
919 if test -z "$haveit"; then
920 if test -d "$additional_includedir"; then
921 dnl Really add $additional_includedir to $INCNAME.
922 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
923 fi
924 fi
925 fi
926 fi
927 fi
928 dnl Look for dependencies.
929 if test -n "$found_la"; then
930 dnl Read the .la file. It defines the variables
931 dnl dlname, library_names, old_library, dependency_libs, current,
932 dnl age, revision, installed, dlopen, dlpreopen, libdir.
933 save_libdir="$libdir"
934 case "$found_la" in
935 */* | *\\*) . "$found_la" ;;
936 *) . "./$found_la" ;;
937 esac
938 libdir="$save_libdir"
939 dnl We use only dependency_libs.
940 for dep in $dependency_libs; do
941 case "$dep" in
942 -L*)
943 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
944 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
945 dnl But don't add it
946 dnl 1. if it's the standard /usr/lib,
947 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
948 dnl 3. if it's already present in $LDFLAGS or the already
949 dnl constructed $LIBNAME,
950 dnl 4. if it doesn't exist as a directory.
951 if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
952 && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
953 haveit=
954 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
955 || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
956 if test -n "$GCC"; then
957 case $host_os in
958 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
959 esac
960 fi
961 fi
962 if test -z "$haveit"; then
963 haveit=
964 for x in $LDFLAGS $LIB[]NAME; do
965 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
966 if test "X$x" = "X-L$additional_libdir"; then
967 haveit=yes
968 break
969 fi
970 done
971 if test -z "$haveit"; then
972 if test -d "$additional_libdir"; then
973 dnl Really add $additional_libdir to $LIBNAME.
974 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
975 fi
976 fi
977 haveit=
978 for x in $LDFLAGS $LTLIB[]NAME; do
979 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
980 if test "X$x" = "X-L$additional_libdir"; then
981 haveit=yes
982 break
983 fi
984 done
985 if test -z "$haveit"; then
986 if test -d "$additional_libdir"; then
987 dnl Really add $additional_libdir to $LTLIBNAME.
988 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
989 fi
990 fi
991 fi
992 fi
993 ;;
994 -R*)
995 dir=`echo "X$dep" | sed -e 's/^X-R//'`
996 if test "$enable_rpath" != no; then
997 dnl Potentially add DIR to rpathdirs.
998 dnl The rpathdirs will be appended to $LIBNAME at the end.
999 haveit=
1000 for x in $rpathdirs; do
1001 if test "X$x" = "X$dir"; then
1002 haveit=yes
1003 break
1004 fi
1005 done
1006 if test -z "$haveit"; then
1007 rpathdirs="$rpathdirs $dir"
1008 fi
1009 dnl Potentially add DIR to ltrpathdirs.
1010 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1011 haveit=
1012 for x in $ltrpathdirs; do
1013 if test "X$x" = "X$dir"; then
1014 haveit=yes
1015 break
1016 fi
1017 done
1018 if test -z "$haveit"; then
1019 ltrpathdirs="$ltrpathdirs $dir"
1020 fi
1021 fi
1022 ;;
1023 -l*)
1024 dnl Handle this in the next round.
1025 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1026 ;;
1027 *.la)
1028 dnl Handle this in the next round. Throw away the .la's
1029 dnl directory; it is already contained in a preceding -L
1030 dnl option.
1031 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1032 ;;
1033 *)
1034 dnl Most likely an immediate library name.
1035 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1036 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1037 ;;
1038 esac
1039 done
1040 fi
1041 else
1042 dnl Didn't find the library; assume it is in the system directories
1043 dnl known to the linker and runtime loader. (All the system
1044 dnl directories known to the linker should also be known to the
1045 dnl runtime loader, otherwise the system is severely misconfigured.)
1046 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1047 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1048 fi
1049 fi
1050 fi
1051 done
1052 done
1053 if test "X$rpathdirs" != "X"; then
1054 if test -n "$acl_hardcode_libdir_separator"; then
1055 dnl Weird platform: only the last -rpath option counts, the user must
1056 dnl pass all path elements in one option. We can arrange that for a
1057 dnl single library, but not when more than one $LIBNAMEs are used.
1058 alldirs=
1059 for found_dir in $rpathdirs; do
1060 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
1061 done
1062 dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
1063 acl_save_libdir="$libdir"
1064 libdir="$alldirs"
1065 eval flag=\"$acl_hardcode_libdir_flag_spec\"
1066 libdir="$acl_save_libdir"
1067 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1068 else
1069 dnl The -rpath options are cumulative.
1070 for found_dir in $rpathdirs; do
1071 acl_save_libdir="$libdir"
1072 libdir="$found_dir"
1073 eval flag=\"$acl_hardcode_libdir_flag_spec\"
1074 libdir="$acl_save_libdir"
1075 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1076 done
1077 fi
1078 fi
1079 if test "X$ltrpathdirs" != "X"; then
1080 dnl When using libtool, the option that works for both libraries and
1081 dnl executables is -R. The -R options are cumulative.
1082 for found_dir in $ltrpathdirs; do
1083 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1084 done
1085 fi
1086 popdef([P_A_C_K])
1087 popdef([PACKLIBS])
1088 popdef([PACKUP])
1089 popdef([PACK])
1090 popdef([NAME])
1091 ])
1092
1093 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1094 dnl unless already present in VAR.
1095 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1096 dnl contains two or three consecutive elements that belong together.
1097 AC_DEFUN([AC_LIB_APPENDTOVAR],
1098 [
1099 for element in [$2]; do
1100 haveit=
1101 for x in $[$1]; do
1102 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1103 if test "X$x" = "X$element"; then
1104 haveit=yes
1105 break
1106 fi
1107 done
1108 if test -z "$haveit"; then
1109 [$1]="${[$1]}${[$1]:+ }$element"
1110 fi
1111 done
1112 ])
1113
1114 dnl For those cases where a variable contains several -L and -l options
1115 dnl referring to unknown libraries and directories, this macro determines the
1116 dnl necessary additional linker options for the runtime path.
1117 dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
1118 dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
1119 dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
1120 dnl otherwise linking without libtool is assumed.
1121 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
1122 [
1123 AC_REQUIRE([AC_LIB_RPATH])
1124 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1125 $1=
1126 if test "$enable_rpath" != no; then
1127 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1128 dnl Use an explicit option to hardcode directories into the resulting
1129 dnl binary.
1130 rpathdirs=
1131 next=
1132 for opt in $2; do
1133 if test -n "$next"; then
1134 dir="$next"
1135 dnl No need to hardcode the standard /usr/lib.
1136 if test "X$dir" != "X/usr/$acl_libdirstem" \
1137 && test "X$dir" != "X/usr/$acl_libdirstem2"; then
1138 rpathdirs="$rpathdirs $dir"
1139 fi
1140 next=
1141 else
1142 case $opt in
1143 -L) next=yes ;;
1144 -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
1145 dnl No need to hardcode the standard /usr/lib.
1146 if test "X$dir" != "X/usr/$acl_libdirstem" \
1147 && test "X$dir" != "X/usr/$acl_libdirstem2"; then
1148 rpathdirs="$rpathdirs $dir"
1149 fi
1150 next= ;;
1151 *) next= ;;
1152 esac
1153 fi
1154 done
1155 if test "X$rpathdirs" != "X"; then
1156 if test -n ""$3""; then
1157 dnl libtool is used for linking. Use -R options.
1158 for dir in $rpathdirs; do
1159 $1="${$1}${$1:+ }-R$dir"
1160 done
1161 else
1162 dnl The linker is used for linking directly.
1163 if test -n "$acl_hardcode_libdir_separator"; then
1164 dnl Weird platform: only the last -rpath option counts, the user
1165 dnl must pass all path elements in one option.
1166 alldirs=
1167 for dir in $rpathdirs; do
1168 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
1169 done
1170 acl_save_libdir="$libdir"
1171 libdir="$alldirs"
1172 eval flag=\"$acl_hardcode_libdir_flag_spec\"
1173 libdir="$acl_save_libdir"
1174 $1="$flag"
1175 else
1176 dnl The -rpath options are cumulative.
1177 for dir in $rpathdirs; do
1178 acl_save_libdir="$libdir"
1179 libdir="$dir"
1180 eval flag=\"$acl_hardcode_libdir_flag_spec\"
1181 libdir="$acl_save_libdir"
1182 $1="${$1}${$1:+ }$flag"
1183 done
1184 fi
1185 fi
1186 fi
1187 fi
1188 fi
1189 AC_SUBST([$1])
1190 ])
1191
1192 # lib-prefix.m4 serial 7 (gettext-0.18)
1193 dnl Copyright (C) 2001-2005, 2008-2016 Free Software Foundation, Inc.
1194 dnl This file is free software; the Free Software Foundation
1195 dnl gives unlimited permission to copy and/or distribute it,
1196 dnl with or without modifications, as long as this notice is preserved.
1197
1198 dnl From Bruno Haible.
1199
1200 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1201 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1202 dnl require excessive bracketing.
1203 ifdef([AC_HELP_STRING],
1204 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1205 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1206
1207 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1208 dnl to access previously installed libraries. The basic assumption is that
1209 dnl a user will want packages to use other packages he previously installed
1210 dnl with the same --prefix option.
1211 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1212 dnl libraries, but is otherwise very convenient.
1213 AC_DEFUN([AC_LIB_PREFIX],
1214 [
1215 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1216 AC_REQUIRE([AC_PROG_CC])
1217 AC_REQUIRE([AC_CANONICAL_HOST])
1218 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1219 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1220 dnl By default, look in $includedir and $libdir.
1221 use_additional=yes
1222 AC_LIB_WITH_FINAL_PREFIX([
1223 eval additional_includedir=\"$includedir\"
1224 eval additional_libdir=\"$libdir\"
1225 ])
1226 AC_LIB_ARG_WITH([lib-prefix],
1227 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1228 --without-lib-prefix don't search for libraries in includedir and libdir],
1229 [
1230 if test "X$withval" = "Xno"; then
1231 use_additional=no
1232 else
1233 if test "X$withval" = "X"; then
1234 AC_LIB_WITH_FINAL_PREFIX([
1235 eval additional_includedir=\"$includedir\"
1236 eval additional_libdir=\"$libdir\"
1951237 ])
196 elif test $pkg_failed = untried; then
197 AC_MSG_RESULT([no])
198 m4_default([$4], [AC_MSG_FAILURE(
199 [The pkg-config script could not be found or is too old. Make sure it
200 is in your PATH or set the PKG_CONFIG environment variable to the full
201 path to pkg-config.
202
203 _PKG_TEXT
204
205 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
1238 else
1239 additional_includedir="$withval/include"
1240 additional_libdir="$withval/$acl_libdirstem"
1241 fi
1242 fi
1243 ])
1244 if test $use_additional = yes; then
1245 dnl Potentially add $additional_includedir to $CPPFLAGS.
1246 dnl But don't add it
1247 dnl 1. if it's the standard /usr/include,
1248 dnl 2. if it's already present in $CPPFLAGS,
1249 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1250 dnl 4. if it doesn't exist as a directory.
1251 if test "X$additional_includedir" != "X/usr/include"; then
1252 haveit=
1253 for x in $CPPFLAGS; do
1254 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1255 if test "X$x" = "X-I$additional_includedir"; then
1256 haveit=yes
1257 break
1258 fi
1259 done
1260 if test -z "$haveit"; then
1261 if test "X$additional_includedir" = "X/usr/local/include"; then
1262 if test -n "$GCC"; then
1263 case $host_os in
1264 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1265 esac
1266 fi
1267 fi
1268 if test -z "$haveit"; then
1269 if test -d "$additional_includedir"; then
1270 dnl Really add $additional_includedir to $CPPFLAGS.
1271 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1272 fi
1273 fi
1274 fi
1275 fi
1276 dnl Potentially add $additional_libdir to $LDFLAGS.
1277 dnl But don't add it
1278 dnl 1. if it's the standard /usr/lib,
1279 dnl 2. if it's already present in $LDFLAGS,
1280 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1281 dnl 4. if it doesn't exist as a directory.
1282 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1283 haveit=
1284 for x in $LDFLAGS; do
1285 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1286 if test "X$x" = "X-L$additional_libdir"; then
1287 haveit=yes
1288 break
1289 fi
1290 done
1291 if test -z "$haveit"; then
1292 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1293 if test -n "$GCC"; then
1294 case $host_os in
1295 linux*) haveit=yes;;
1296 esac
1297 fi
1298 fi
1299 if test -z "$haveit"; then
1300 if test -d "$additional_libdir"; then
1301 dnl Really add $additional_libdir to $LDFLAGS.
1302 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1303 fi
1304 fi
1305 fi
1306 fi
1307 fi
1308 ])
1309
1310 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1311 dnl acl_final_exec_prefix, containing the values to which $prefix and
1312 dnl $exec_prefix will expand at the end of the configure script.
1313 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1314 [
1315 dnl Unfortunately, prefix and exec_prefix get only finally determined
1316 dnl at the end of configure.
1317 if test "X$prefix" = "XNONE"; then
1318 acl_final_prefix="$ac_default_prefix"
1319 else
1320 acl_final_prefix="$prefix"
1321 fi
1322 if test "X$exec_prefix" = "XNONE"; then
1323 acl_final_exec_prefix='${prefix}'
1324 else
1325 acl_final_exec_prefix="$exec_prefix"
1326 fi
1327 acl_save_prefix="$prefix"
1328 prefix="$acl_final_prefix"
1329 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1330 prefix="$acl_save_prefix"
1331 ])
1332
1333 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1334 dnl variables prefix and exec_prefix bound to the values they will have
1335 dnl at the end of the configure script.
1336 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1337 [
1338 acl_save_prefix="$prefix"
1339 prefix="$acl_final_prefix"
1340 acl_save_exec_prefix="$exec_prefix"
1341 exec_prefix="$acl_final_exec_prefix"
1342 $1
1343 exec_prefix="$acl_save_exec_prefix"
1344 prefix="$acl_save_prefix"
1345 ])
1346
1347 dnl AC_LIB_PREPARE_MULTILIB creates
1348 dnl - a variable acl_libdirstem, containing the basename of the libdir, either
1349 dnl "lib" or "lib64" or "lib/64",
1350 dnl - a variable acl_libdirstem2, as a secondary possible value for
1351 dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
1352 dnl "lib/amd64".
1353 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
1354 [
1355 dnl There is no formal standard regarding lib and lib64.
1356 dnl On glibc systems, the current practice is that on a system supporting
1357 dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
1358 dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
1359 dnl the compiler's default mode by looking at the compiler's library search
1360 dnl path. If at least one of its elements ends in /lib64 or points to a
1361 dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
1362 dnl Otherwise we use the default, namely "lib".
1363 dnl On Solaris systems, the current practice is that on a system supporting
1364 dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
1365 dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
1366 dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
1367 AC_REQUIRE([AC_CANONICAL_HOST])
1368 acl_libdirstem=lib
1369 acl_libdirstem2=
1370 case "$host_os" in
1371 solaris*)
1372 dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
1373 dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
1374 dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
1375 dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
1376 dnl symlink is missing, so we set acl_libdirstem2 too.
1377 AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
1378 [AC_EGREP_CPP([sixtyfour bits], [
1379 #ifdef _LP64
1380 sixtyfour bits
1381 #endif
1382 ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
2061383 ])
207 else
208 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
209 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
210 AC_MSG_RESULT([yes])
211 $3
212 fi[]dnl
213 ])dnl PKG_CHECK_MODULES
214
215
216 dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
217 dnl [ACTION-IF-NOT-FOUND])
218 dnl ---------------------------------------------------------------------
219 dnl Since: 0.29
220 dnl
221 dnl Checks for existence of MODULES and gathers its build flags with
222 dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
223 dnl and VARIABLE-PREFIX_LIBS from --libs.
224 dnl
225 dnl Note that if there is a possibility the first call to
226 dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
227 dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
228 dnl configure.ac.
229 AC_DEFUN([PKG_CHECK_MODULES_STATIC],
230 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
231 _save_PKG_CONFIG=$PKG_CONFIG
232 PKG_CONFIG="$PKG_CONFIG --static"
233 PKG_CHECK_MODULES($@)
234 PKG_CONFIG=$_save_PKG_CONFIG[]dnl
235 ])dnl PKG_CHECK_MODULES_STATIC
236
237
238 dnl PKG_INSTALLDIR([DIRECTORY])
239 dnl -------------------------
240 dnl Since: 0.27
241 dnl
242 dnl Substitutes the variable pkgconfigdir as the location where a module
243 dnl should install pkg-config .pc files. By default the directory is
244 dnl $libdir/pkgconfig, but the default can be changed by passing
245 dnl DIRECTORY. The user can override through the --with-pkgconfigdir
246 dnl parameter.
247 AC_DEFUN([PKG_INSTALLDIR],
248 [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
249 m4_pushdef([pkg_description],
250 [pkg-config installation directory @<:@]pkg_default[@:>@])
251 AC_ARG_WITH([pkgconfigdir],
252 [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
253 [with_pkgconfigdir=]pkg_default)
254 AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
255 m4_popdef([pkg_default])
256 m4_popdef([pkg_description])
257 ])dnl PKG_INSTALLDIR
258
259
260 dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
261 dnl --------------------------------
262 dnl Since: 0.27
263 dnl
264 dnl Substitutes the variable noarch_pkgconfigdir as the location where a
265 dnl module should install arch-independent pkg-config .pc files. By
266 dnl default the directory is $datadir/pkgconfig, but the default can be
267 dnl changed by passing DIRECTORY. The user can override through the
268 dnl --with-noarch-pkgconfigdir parameter.
269 AC_DEFUN([PKG_NOARCH_INSTALLDIR],
270 [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
271 m4_pushdef([pkg_description],
272 [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
273 AC_ARG_WITH([noarch-pkgconfigdir],
274 [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
275 [with_noarch_pkgconfigdir=]pkg_default)
276 AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
277 m4_popdef([pkg_default])
278 m4_popdef([pkg_description])
279 ])dnl PKG_NOARCH_INSTALLDIR
280
281
282 dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
283 dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
284 dnl -------------------------------------------
285 dnl Since: 0.28
286 dnl
287 dnl Retrieves the value of the pkg-config variable for the given module.
288 AC_DEFUN([PKG_CHECK_VAR],
289 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
290 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
291
292 _PKG_CONFIG([$1], [variable="][$3]["], [$2])
293 AS_VAR_COPY([$1], [pkg_cv_][$1])
294
295 AS_VAR_IF([$1], [""], [$5], [$4])dnl
296 ])dnl PKG_CHECK_VAR
297
298 # Copyright (C) 2002-2014 Free Software Foundation, Inc.
1384 if test $gl_cv_solaris_64bit = yes; then
1385 acl_libdirstem=lib/64
1386 case "$host_cpu" in
1387 sparc*) acl_libdirstem2=lib/sparcv9 ;;
1388 i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
1389 esac
1390 fi
1391 ;;
1392 *)
1393 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
1394 if test -n "$searchpath"; then
1395 acl_save_IFS="${IFS= }"; IFS=":"
1396 for searchdir in $searchpath; do
1397 if test -d "$searchdir"; then
1398 case "$searchdir" in
1399 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
1400 */../ | */.. )
1401 # Better ignore directories of this form. They are misleading.
1402 ;;
1403 *) searchdir=`cd "$searchdir" && pwd`
1404 case "$searchdir" in
1405 */lib64 ) acl_libdirstem=lib64 ;;
1406 esac ;;
1407 esac
1408 fi
1409 done
1410 IFS="$acl_save_IFS"
1411 fi
1412 ;;
1413 esac
1414 test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
1415 ])
1416
1417 # Copyright (C) 2002-2018 Free Software Foundation, Inc.
2991418 #
3001419 # This file is free software; the Free Software Foundation
3011420 # gives unlimited permission to copy and/or distribute it,
3071426 # generated from the m4 files accompanying Automake X.Y.
3081427 # (This private macro should not be called outside this file.)
3091428 AC_DEFUN([AM_AUTOMAKE_VERSION],
310 [am__api_version='1.15'
1429 [am__api_version='1.16'
3111430 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3121431 dnl require some minimum version. Point them to the right macro.
313 m4_if([$1], [1.15], [],
1432 m4_if([$1], [1.16.1], [],
3141433 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
3151434 ])
3161435
3261445 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
3271446 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
3281447 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
329 [AM_AUTOMAKE_VERSION([1.15])dnl
1448 [AM_AUTOMAKE_VERSION([1.16.1])dnl
3301449 m4_ifndef([AC_AUTOCONF_VERSION],
3311450 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
3321451 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
3331452
3341453 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
3351454
336 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
1455 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
3371456 #
3381457 # This file is free software; the Free Software Foundation
3391458 # gives unlimited permission to copy and/or distribute it,
3851504
3861505 # AM_CONDITIONAL -*- Autoconf -*-
3871506
388 # Copyright (C) 1997-2014 Free Software Foundation, Inc.
1507 # Copyright (C) 1997-2018 Free Software Foundation, Inc.
3891508 #
3901509 # This file is free software; the Free Software Foundation
3911510 # gives unlimited permission to copy and/or distribute it,
4161535 Usually this means the macro was only invoked conditionally.]])
4171536 fi])])
4181537
419 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
1538 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
4201539 #
4211540 # This file is free software; the Free Software Foundation
4221541 # gives unlimited permission to copy and/or distribute it,
6071726
6081727 # Generate code to set up dependency tracking. -*- Autoconf -*-
6091728
610 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
1729 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
6111730 #
6121731 # This file is free software; the Free Software Foundation
6131732 # gives unlimited permission to copy and/or distribute it,
6141733 # with or without modifications, as long as this notice is preserved.
615
6161734
6171735 # _AM_OUTPUT_DEPENDENCY_COMMANDS
6181736 # ------------------------------
6211739 # Older Autoconf quotes --file arguments for eval, but not when files
6221740 # are listed without --file. Let's play safe and only enable the eval
6231741 # if we detect the quoting.
624 case $CONFIG_FILES in
625 *\'*) eval set x "$CONFIG_FILES" ;;
626 *) set x $CONFIG_FILES ;;
627 esac
1742 # TODO: see whether this extra hack can be removed once we start
1743 # requiring Autoconf 2.70 or later.
1744 AS_CASE([$CONFIG_FILES],
1745 [*\'*], [eval set x "$CONFIG_FILES"],
1746 [*], [set x $CONFIG_FILES])
6281747 shift
629 for mf
1748 # Used to flag and report bootstrapping failures.
1749 am_rc=0
1750 for am_mf
6301751 do
6311752 # Strip MF so we end up with the name of the file.
632 mf=`echo "$mf" | sed -e 's/:.*$//'`
633 # Check whether this is an Automake generated Makefile or not.
634 # We used to match only the files named 'Makefile.in', but
635 # some people rename them; so instead we look at the file content.
636 # Grep'ing the first line is not enough: some people post-process
637 # each Makefile.in and add a new line on top of each file to say so.
638 # Grep'ing the whole file is not good either: AIX grep has a line
1753 am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
1754 # Check whether this is an Automake generated Makefile which includes
1755 # dependency-tracking related rules and includes.
1756 # Grep'ing the whole file directly is not great: AIX grep has a line
6391757 # limit of 2048, but all sed's we know have understand at least 4000.
640 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
641 dirpart=`AS_DIRNAME("$mf")`
642 else
643 continue
644 fi
645 # Extract the definition of DEPDIR, am__include, and am__quote
646 # from the Makefile without running 'make'.
647 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
648 test -z "$DEPDIR" && continue
649 am__include=`sed -n 's/^am__include = //p' < "$mf"`
650 test -z "$am__include" && continue
651 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
652 # Find all dependency output files, they are included files with
653 # $(DEPDIR) in their names. We invoke sed twice because it is the
654 # simplest approach to changing $(DEPDIR) to its actual value in the
655 # expansion.
656 for file in `sed -n "
657 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
658 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
659 # Make sure the directory exists.
660 test -f "$dirpart/$file" && continue
661 fdir=`AS_DIRNAME(["$file"])`
662 AS_MKDIR_P([$dirpart/$fdir])
663 # echo "creating $dirpart/$file"
664 echo '# dummy' > "$dirpart/$file"
665 done
1758 sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
1759 || continue
1760 am_dirpart=`AS_DIRNAME(["$am_mf"])`
1761 am_filepart=`AS_BASENAME(["$am_mf"])`
1762 AM_RUN_LOG([cd "$am_dirpart" \
1763 && sed -e '/# am--include-marker/d' "$am_filepart" \
1764 | $MAKE -f - am--depfiles]) || am_rc=$?
6661765 done
1766 if test $am_rc -ne 0; then
1767 AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
1768 for automatic dependency tracking. Try re-running configure with the
1769 '--disable-dependency-tracking' option to at least be able to build
1770 the package (albeit without support for automatic dependency tracking).])
1771 fi
1772 AS_UNSET([am_dirpart])
1773 AS_UNSET([am_filepart])
1774 AS_UNSET([am_mf])
1775 AS_UNSET([am_rc])
1776 rm -f conftest-deps.mk
6671777 }
6681778 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
6691779
6721782 # -----------------------------
6731783 # This macro should only be invoked once -- use via AC_REQUIRE.
6741784 #
675 # This code is only required when automatic dependency tracking
676 # is enabled. FIXME. This creates each '.P' file that we will
677 # need in order to bootstrap the dependency handling code.
1785 # This code is only required when automatic dependency tracking is enabled.
1786 # This creates each '.Po' and '.Plo' makefile fragment that we'll need in
1787 # order to bootstrap the dependency handling code.
6781788 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
6791789 [AC_CONFIG_COMMANDS([depfiles],
6801790 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
681 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
682 ])
1791 [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
6831792
6841793 # Do all the work for Automake. -*- Autoconf -*-
6851794
686 # Copyright (C) 1996-2014 Free Software Foundation, Inc.
1795 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
6871796 #
6881797 # This file is free software; the Free Software Foundation
6891798 # gives unlimited permission to copy and/or distribute it,
7701879 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
7711880 # For better backward compatibility. To be removed once Automake 1.9.x
7721881 # dies out for good. For more background, see:
773 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
774 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
1882 # <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
1883 # <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
7751884 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
7761885 # We need awk for the "check" target (and possibly the TAP driver). The
7771886 # system "awk" is bad on some platforms.
8381947 Aborting the configuration process, to ensure you take notice of the issue.
8391948
8401949 You can download and install GNU coreutils to get an 'rm' implementation
841 that behaves properly: <http://www.gnu.org/software/coreutils/>.
1950 that behaves properly: <https://www.gnu.org/software/coreutils/>.
8421951
8431952 If you want to complete the configuration process using your problematic
8441953 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
8801989 done
8811990 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
8821991
883 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
1992 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
8841993 #
8851994 # This file is free software; the Free Software Foundation
8861995 # gives unlimited permission to copy and/or distribute it,
9012010 fi
9022011 AC_SUBST([install_sh])])
9032012
904 # Copyright (C) 2003-2014 Free Software Foundation, Inc.
2013 # Copyright (C) 2003-2018 Free Software Foundation, Inc.
9052014 #
9062015 # This file is free software; the Free Software Foundation
9072016 # gives unlimited permission to copy and/or distribute it,
9222031
9232032 # Check to see how 'make' treats includes. -*- Autoconf -*-
9242033
925 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
2034 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
9262035 #
9272036 # This file is free software; the Free Software Foundation
9282037 # gives unlimited permission to copy and/or distribute it,
9302039
9312040 # AM_MAKE_INCLUDE()
9322041 # -----------------
933 # Check to see how make treats includes.
2042 # Check whether make has an 'include' directive that can support all
2043 # the idioms we need for our automatic dependency tracking code.
9342044 AC_DEFUN([AM_MAKE_INCLUDE],
935 [am_make=${MAKE-make}
936 cat > confinc << 'END'
2045 [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
2046 cat > confinc.mk << 'END'
9372047 am__doit:
938 @echo this is the am__doit target
2048 @echo this is the am__doit target >confinc.out
9392049 .PHONY: am__doit
9402050 END
941 # If we don't find an include directive, just comment out the code.
942 AC_MSG_CHECKING([for style of include used by $am_make])
9432051 am__include="#"
9442052 am__quote=
945 _am_result=none
946 # First try GNU make style include.
947 echo "include confinc" > confmf
948 # Ignore all kinds of additional output from 'make'.
949 case `$am_make -s -f confmf 2> /dev/null` in #(
950 *the\ am__doit\ target*)
951 am__include=include
952 am__quote=
953 _am_result=GNU
954 ;;
955 esac
956 # Now try BSD make style include.
957 if test "$am__include" = "#"; then
958 echo '.include "confinc"' > confmf
959 case `$am_make -s -f confmf 2> /dev/null` in #(
960 *the\ am__doit\ target*)
961 am__include=.include
962 am__quote="\""
963 _am_result=BSD
964 ;;
965 esac
966 fi
967 AC_SUBST([am__include])
968 AC_SUBST([am__quote])
969 AC_MSG_RESULT([$_am_result])
970 rm -f confinc confmf
971 ])
2053 # BSD make does it like this.
2054 echo '.include "confinc.mk" # ignored' > confmf.BSD
2055 # Other make implementations (GNU, Solaris 10, AIX) do it like this.
2056 echo 'include confinc.mk # ignored' > confmf.GNU
2057 _am_result=no
2058 for s in GNU BSD; do
2059 AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
2060 AS_CASE([$?:`cat confinc.out 2>/dev/null`],
2061 ['0:this is the am__doit target'],
2062 [AS_CASE([$s],
2063 [BSD], [am__include='.include' am__quote='"'],
2064 [am__include='include' am__quote=''])])
2065 if test "$am__include" != "#"; then
2066 _am_result="yes ($s style)"
2067 break
2068 fi
2069 done
2070 rm -f confinc.* confmf.*
2071 AC_MSG_RESULT([${_am_result}])
2072 AC_SUBST([am__include])])
2073 AC_SUBST([am__quote])])
9722074
9732075 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
9742076
975 # Copyright (C) 1997-2014 Free Software Foundation, Inc.
2077 # Copyright (C) 1997-2018 Free Software Foundation, Inc.
9762078 #
9772079 # This file is free software; the Free Software Foundation
9782080 # gives unlimited permission to copy and/or distribute it,
10112113
10122114 # Helper functions for option handling. -*- Autoconf -*-
10132115
1014 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
2116 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
10152117 #
10162118 # This file is free software; the Free Software Foundation
10172119 # gives unlimited permission to copy and/or distribute it,
10402142 AC_DEFUN([_AM_IF_OPTION],
10412143 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
10422144
1043 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
2145 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
10442146 #
10452147 # This file is free software; the Free Software Foundation
10462148 # gives unlimited permission to copy and/or distribute it,
10872189 # For backward compatibility.
10882190 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
10892191
1090 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
2192 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
10912193 #
10922194 # This file is free software; the Free Software Foundation
10932195 # gives unlimited permission to copy and/or distribute it,
11062208
11072209 # Check to make sure that the build environment is sane. -*- Autoconf -*-
11082210
1109 # Copyright (C) 1996-2014 Free Software Foundation, Inc.
2211 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
11102212 #
11112213 # This file is free software; the Free Software Foundation
11122214 # gives unlimited permission to copy and/or distribute it,
11872289 rm -f conftest.file
11882290 ])
11892291
1190 # Copyright (C) 2009-2014 Free Software Foundation, Inc.
2292 # Copyright (C) 2009-2018 Free Software Foundation, Inc.
11912293 #
11922294 # This file is free software; the Free Software Foundation
11932295 # gives unlimited permission to copy and/or distribute it,
12472349 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
12482350 ])
12492351
1250 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
2352 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
12512353 #
12522354 # This file is free software; the Free Software Foundation
12532355 # gives unlimited permission to copy and/or distribute it,
12752377 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
12762378 AC_SUBST([INSTALL_STRIP_PROGRAM])])
12772379
1278 # Copyright (C) 2006-2014 Free Software Foundation, Inc.
2380 # Copyright (C) 2006-2018 Free Software Foundation, Inc.
12792381 #
12802382 # This file is free software; the Free Software Foundation
12812383 # gives unlimited permission to copy and/or distribute it,
12942396
12952397 # Check how to create a tarball. -*- Autoconf -*-
12962398
1297 # Copyright (C) 2004-2014 Free Software Foundation, Inc.
2399 # Copyright (C) 2004-2018 Free Software Foundation, Inc.
12982400 #
12992401 # This file is free software; the Free Software Foundation
13002402 # gives unlimited permission to copy and/or distribute it,
0 #!/bin/sh
1
2 # Install config.rpath which is needed for AM_ICONV macro
3 for dir in "$GETTEXT_DIR" /usr/share/gettext /usr/local/share/gettext; do
4 if test -f "$dir/config.rpath"; then
5 test -f config.rpath || echo "autogen.sh: installing './config.rpath'"
6 cp -f "$dir/config.rpath" .
7 break
8 fi
9 done
10
11 aclocal --force
12 autoconf --force
13 automake --add-missing --copy --force-missing
00 #! /bin/sh
11 # Wrapper for compilers which do not understand '-c -o'.
22
3 scriptversion=2012-10-14.11; # UTC
4
5 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
3 scriptversion=2018-03-07.03; # UTC
4
5 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
66 # Written by Tom Tromey <tromey@cygnus.com>.
77 #
88 # This program is free software; you can redistribute it and/or modify
1616 # GNU General Public License for more details.
1717 #
1818 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 # along with this program. If not, see <https://www.gnu.org/licenses/>.
2020
2121 # As a special exception to the GNU General Public License, if you
2222 # distribute this file as part of a program that contains a
254254 echo "compile $scriptversion"
255255 exit $?
256256 ;;
257 cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
257 cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
258 icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
258259 func_cl_wrapper "$@" # Doesn't return...
259260 ;;
260261 esac
338339 # Local Variables:
339340 # mode: shell-script
340341 # sh-indentation: 2
341 # eval: (add-hook 'write-file-hooks 'time-stamp)
342 # eval: (add-hook 'before-save-hook 'time-stamp)
342343 # time-stamp-start: "scriptversion="
343344 # time-stamp-format: "%:y-%02m-%02d.%02H"
344 # time-stamp-time-zone: "UTC"
345 # time-stamp-time-zone: "UTC0"
345346 # time-stamp-end: "; # UTC"
346347 # End:
0 #! /bin/sh
1 # Attempt to guess a canonical system name.
2 # Copyright 1992-2018 Free Software Foundation, Inc.
3
4 timestamp='2018-02-24'
5
6 # This file is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <https://www.gnu.org/licenses/>.
18 #
19 # As a special exception to the GNU General Public License, if you
20 # distribute this file as part of a program that contains a
21 # configuration script generated by Autoconf, you may include it under
22 # the same distribution terms that you use for the rest of that
23 # program. This Exception is an additional permission under section 7
24 # of the GNU General Public License, version 3 ("GPLv3").
25 #
26 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
27 #
28 # You can get the latest version of this script from:
29 # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
30 #
31 # Please send patches to <config-patches@gnu.org>.
32
33
34 me=`echo "$0" | sed -e 's,.*/,,'`
35
36 usage="\
37 Usage: $0 [OPTION]
38
39 Output the configuration name of the system \`$me' is run on.
40
41 Options:
42 -h, --help print this help, then exit
43 -t, --time-stamp print date of last modification, then exit
44 -v, --version print version number, then exit
45
46 Report bugs and patches to <config-patches@gnu.org>."
47
48 version="\
49 GNU config.guess ($timestamp)
50
51 Originally written by Per Bothner.
52 Copyright 1992-2018 Free Software Foundation, Inc.
53
54 This is free software; see the source for copying conditions. There is NO
55 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
56
57 help="
58 Try \`$me --help' for more information."
59
60 # Parse command line
61 while test $# -gt 0 ; do
62 case $1 in
63 --time-stamp | --time* | -t )
64 echo "$timestamp" ; exit ;;
65 --version | -v )
66 echo "$version" ; exit ;;
67 --help | --h* | -h )
68 echo "$usage"; exit ;;
69 -- ) # Stop option processing
70 shift; break ;;
71 - ) # Use stdin as input.
72 break ;;
73 -* )
74 echo "$me: invalid option $1$help" >&2
75 exit 1 ;;
76 * )
77 break ;;
78 esac
79 done
80
81 if test $# != 0; then
82 echo "$me: too many arguments$help" >&2
83 exit 1
84 fi
85
86 trap 'exit 1' 1 2 15
87
88 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
89 # compiler to aid in system detection is discouraged as it requires
90 # temporary files to be created and, as you can see below, it is a
91 # headache to deal with in a portable fashion.
92
93 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
94 # use `HOST_CC' if defined, but it is deprecated.
95
96 # Portable tmp directory creation inspired by the Autoconf team.
97
98 set_cc_for_build='
99 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
100 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
101 : ${TMPDIR=/tmp} ;
102 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
103 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
104 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
105 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
106 dummy=$tmp/dummy ;
107 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
108 case $CC_FOR_BUILD,$HOST_CC,$CC in
109 ,,) echo "int x;" > "$dummy.c" ;
110 for c in cc gcc c89 c99 ; do
111 if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
112 CC_FOR_BUILD="$c"; break ;
113 fi ;
114 done ;
115 if test x"$CC_FOR_BUILD" = x ; then
116 CC_FOR_BUILD=no_compiler_found ;
117 fi
118 ;;
119 ,,*) CC_FOR_BUILD=$CC ;;
120 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
121 esac ; set_cc_for_build= ;'
122
123 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
124 # (ghazi@noc.rutgers.edu 1994-08-24)
125 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
126 PATH=$PATH:/.attbin ; export PATH
127 fi
128
129 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
130 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
131 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
132 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
133
134 case "$UNAME_SYSTEM" in
135 Linux|GNU|GNU/*)
136 # If the system lacks a compiler, then just pick glibc.
137 # We could probably try harder.
138 LIBC=gnu
139
140 eval "$set_cc_for_build"
141 cat <<-EOF > "$dummy.c"
142 #include <features.h>
143 #if defined(__UCLIBC__)
144 LIBC=uclibc
145 #elif defined(__dietlibc__)
146 LIBC=dietlibc
147 #else
148 LIBC=gnu
149 #endif
150 EOF
151 eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
152
153 # If ldd exists, use it to detect musl libc.
154 if command -v ldd >/dev/null && \
155 ldd --version 2>&1 | grep -q ^musl
156 then
157 LIBC=musl
158 fi
159 ;;
160 esac
161
162 # Note: order is significant - the case branches are not exclusive.
163
164 case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
165 *:NetBSD:*:*)
166 # NetBSD (nbsd) targets should (where applicable) match one or
167 # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
168 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
169 # switched to ELF, *-*-netbsd* would select the old
170 # object file format. This provides both forward
171 # compatibility and a consistent mechanism for selecting the
172 # object file format.
173 #
174 # Note: NetBSD doesn't particularly care about the vendor
175 # portion of the name. We always set it to "unknown".
176 sysctl="sysctl -n hw.machine_arch"
177 UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
178 "/sbin/$sysctl" 2>/dev/null || \
179 "/usr/sbin/$sysctl" 2>/dev/null || \
180 echo unknown)`
181 case "$UNAME_MACHINE_ARCH" in
182 armeb) machine=armeb-unknown ;;
183 arm*) machine=arm-unknown ;;
184 sh3el) machine=shl-unknown ;;
185 sh3eb) machine=sh-unknown ;;
186 sh5el) machine=sh5le-unknown ;;
187 earmv*)
188 arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
189 endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
190 machine="${arch}${endian}"-unknown
191 ;;
192 *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
193 esac
194 # The Operating System including object format, if it has switched
195 # to ELF recently (or will in the future) and ABI.
196 case "$UNAME_MACHINE_ARCH" in
197 earm*)
198 os=netbsdelf
199 ;;
200 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
201 eval "$set_cc_for_build"
202 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
203 | grep -q __ELF__
204 then
205 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
206 # Return netbsd for either. FIX?
207 os=netbsd
208 else
209 os=netbsdelf
210 fi
211 ;;
212 *)
213 os=netbsd
214 ;;
215 esac
216 # Determine ABI tags.
217 case "$UNAME_MACHINE_ARCH" in
218 earm*)
219 expr='s/^earmv[0-9]/-eabi/;s/eb$//'
220 abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
221 ;;
222 esac
223 # The OS release
224 # Debian GNU/NetBSD machines have a different userland, and
225 # thus, need a distinct triplet. However, they do not need
226 # kernel version information, so it can be replaced with a
227 # suitable tag, in the style of linux-gnu.
228 case "$UNAME_VERSION" in
229 Debian*)
230 release='-gnu'
231 ;;
232 *)
233 release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
234 ;;
235 esac
236 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
237 # contains redundant information, the shorter form:
238 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
239 echo "$machine-${os}${release}${abi}"
240 exit ;;
241 *:Bitrig:*:*)
242 UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
243 echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
244 exit ;;
245 *:OpenBSD:*:*)
246 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
247 echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
248 exit ;;
249 *:LibertyBSD:*:*)
250 UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
251 echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
252 exit ;;
253 *:MidnightBSD:*:*)
254 echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
255 exit ;;
256 *:ekkoBSD:*:*)
257 echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
258 exit ;;
259 *:SolidBSD:*:*)
260 echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
261 exit ;;
262 macppc:MirBSD:*:*)
263 echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
264 exit ;;
265 *:MirBSD:*:*)
266 echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
267 exit ;;
268 *:Sortix:*:*)
269 echo "$UNAME_MACHINE"-unknown-sortix
270 exit ;;
271 *:Redox:*:*)
272 echo "$UNAME_MACHINE"-unknown-redox
273 exit ;;
274 mips:OSF1:*.*)
275 echo mips-dec-osf1
276 exit ;;
277 alpha:OSF1:*:*)
278 case $UNAME_RELEASE in
279 *4.0)
280 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
281 ;;
282 *5.*)
283 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
284 ;;
285 esac
286 # According to Compaq, /usr/sbin/psrinfo has been available on
287 # OSF/1 and Tru64 systems produced since 1995. I hope that
288 # covers most systems running today. This code pipes the CPU
289 # types through head -n 1, so we only detect the type of CPU 0.
290 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
291 case "$ALPHA_CPU_TYPE" in
292 "EV4 (21064)")
293 UNAME_MACHINE=alpha ;;
294 "EV4.5 (21064)")
295 UNAME_MACHINE=alpha ;;
296 "LCA4 (21066/21068)")
297 UNAME_MACHINE=alpha ;;
298 "EV5 (21164)")
299 UNAME_MACHINE=alphaev5 ;;
300 "EV5.6 (21164A)")
301 UNAME_MACHINE=alphaev56 ;;
302 "EV5.6 (21164PC)")
303 UNAME_MACHINE=alphapca56 ;;
304 "EV5.7 (21164PC)")
305 UNAME_MACHINE=alphapca57 ;;
306 "EV6 (21264)")
307 UNAME_MACHINE=alphaev6 ;;
308 "EV6.7 (21264A)")
309 UNAME_MACHINE=alphaev67 ;;
310 "EV6.8CB (21264C)")
311 UNAME_MACHINE=alphaev68 ;;
312 "EV6.8AL (21264B)")
313 UNAME_MACHINE=alphaev68 ;;
314 "EV6.8CX (21264D)")
315 UNAME_MACHINE=alphaev68 ;;
316 "EV6.9A (21264/EV69A)")
317 UNAME_MACHINE=alphaev69 ;;
318 "EV7 (21364)")
319 UNAME_MACHINE=alphaev7 ;;
320 "EV7.9 (21364A)")
321 UNAME_MACHINE=alphaev79 ;;
322 esac
323 # A Pn.n version is a patched version.
324 # A Vn.n version is a released version.
325 # A Tn.n version is a released field test version.
326 # A Xn.n version is an unreleased experimental baselevel.
327 # 1.2 uses "1.2" for uname -r.
328 echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
329 # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
330 exitcode=$?
331 trap '' 0
332 exit $exitcode ;;
333 Amiga*:UNIX_System_V:4.0:*)
334 echo m68k-unknown-sysv4
335 exit ;;
336 *:[Aa]miga[Oo][Ss]:*:*)
337 echo "$UNAME_MACHINE"-unknown-amigaos
338 exit ;;
339 *:[Mm]orph[Oo][Ss]:*:*)
340 echo "$UNAME_MACHINE"-unknown-morphos
341 exit ;;
342 *:OS/390:*:*)
343 echo i370-ibm-openedition
344 exit ;;
345 *:z/VM:*:*)
346 echo s390-ibm-zvmoe
347 exit ;;
348 *:OS400:*:*)
349 echo powerpc-ibm-os400
350 exit ;;
351 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
352 echo arm-acorn-riscix"$UNAME_RELEASE"
353 exit ;;
354 arm*:riscos:*:*|arm*:RISCOS:*:*)
355 echo arm-unknown-riscos
356 exit ;;
357 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
358 echo hppa1.1-hitachi-hiuxmpp
359 exit ;;
360 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
361 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
362 if test "`(/bin/universe) 2>/dev/null`" = att ; then
363 echo pyramid-pyramid-sysv3
364 else
365 echo pyramid-pyramid-bsd
366 fi
367 exit ;;
368 NILE*:*:*:dcosx)
369 echo pyramid-pyramid-svr4
370 exit ;;
371 DRS?6000:unix:4.0:6*)
372 echo sparc-icl-nx6
373 exit ;;
374 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
375 case `/usr/bin/uname -p` in
376 sparc) echo sparc-icl-nx7; exit ;;
377 esac ;;
378 s390x:SunOS:*:*)
379 echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
380 exit ;;
381 sun4H:SunOS:5.*:*)
382 echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
383 exit ;;
384 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
385 echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
386 exit ;;
387 i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
388 echo i386-pc-auroraux"$UNAME_RELEASE"
389 exit ;;
390 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
391 eval "$set_cc_for_build"
392 SUN_ARCH=i386
393 # If there is a compiler, see if it is configured for 64-bit objects.
394 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
395 # This test works for both compilers.
396 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
397 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
398 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
399 grep IS_64BIT_ARCH >/dev/null
400 then
401 SUN_ARCH=x86_64
402 fi
403 fi
404 echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
405 exit ;;
406 sun4*:SunOS:6*:*)
407 # According to config.sub, this is the proper way to canonicalize
408 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
409 # it's likely to be more like Solaris than SunOS4.
410 echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
411 exit ;;
412 sun4*:SunOS:*:*)
413 case "`/usr/bin/arch -k`" in
414 Series*|S4*)
415 UNAME_RELEASE=`uname -v`
416 ;;
417 esac
418 # Japanese Language versions have a version number like `4.1.3-JL'.
419 echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
420 exit ;;
421 sun3*:SunOS:*:*)
422 echo m68k-sun-sunos"$UNAME_RELEASE"
423 exit ;;
424 sun*:*:4.2BSD:*)
425 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
426 test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
427 case "`/bin/arch`" in
428 sun3)
429 echo m68k-sun-sunos"$UNAME_RELEASE"
430 ;;
431 sun4)
432 echo sparc-sun-sunos"$UNAME_RELEASE"
433 ;;
434 esac
435 exit ;;
436 aushp:SunOS:*:*)
437 echo sparc-auspex-sunos"$UNAME_RELEASE"
438 exit ;;
439 # The situation for MiNT is a little confusing. The machine name
440 # can be virtually everything (everything which is not
441 # "atarist" or "atariste" at least should have a processor
442 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
443 # to the lowercase version "mint" (or "freemint"). Finally
444 # the system name "TOS" denotes a system which is actually not
445 # MiNT. But MiNT is downward compatible to TOS, so this should
446 # be no problem.
447 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
448 echo m68k-atari-mint"$UNAME_RELEASE"
449 exit ;;
450 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
451 echo m68k-atari-mint"$UNAME_RELEASE"
452 exit ;;
453 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
454 echo m68k-atari-mint"$UNAME_RELEASE"
455 exit ;;
456 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
457 echo m68k-milan-mint"$UNAME_RELEASE"
458 exit ;;
459 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
460 echo m68k-hades-mint"$UNAME_RELEASE"
461 exit ;;
462 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
463 echo m68k-unknown-mint"$UNAME_RELEASE"
464 exit ;;
465 m68k:machten:*:*)
466 echo m68k-apple-machten"$UNAME_RELEASE"
467 exit ;;
468 powerpc:machten:*:*)
469 echo powerpc-apple-machten"$UNAME_RELEASE"
470 exit ;;
471 RISC*:Mach:*:*)
472 echo mips-dec-mach_bsd4.3
473 exit ;;
474 RISC*:ULTRIX:*:*)
475 echo mips-dec-ultrix"$UNAME_RELEASE"
476 exit ;;
477 VAX*:ULTRIX*:*:*)
478 echo vax-dec-ultrix"$UNAME_RELEASE"
479 exit ;;
480 2020:CLIX:*:* | 2430:CLIX:*:*)
481 echo clipper-intergraph-clix"$UNAME_RELEASE"
482 exit ;;
483 mips:*:*:UMIPS | mips:*:*:RISCos)
484 eval "$set_cc_for_build"
485 sed 's/^ //' << EOF > "$dummy.c"
486 #ifdef __cplusplus
487 #include <stdio.h> /* for printf() prototype */
488 int main (int argc, char *argv[]) {
489 #else
490 int main (argc, argv) int argc; char *argv[]; {
491 #endif
492 #if defined (host_mips) && defined (MIPSEB)
493 #if defined (SYSTYPE_SYSV)
494 printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
495 #endif
496 #if defined (SYSTYPE_SVR4)
497 printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
498 #endif
499 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
500 printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
501 #endif
502 #endif
503 exit (-1);
504 }
505 EOF
506 $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
507 dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
508 SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
509 { echo "$SYSTEM_NAME"; exit; }
510 echo mips-mips-riscos"$UNAME_RELEASE"
511 exit ;;
512 Motorola:PowerMAX_OS:*:*)
513 echo powerpc-motorola-powermax
514 exit ;;
515 Motorola:*:4.3:PL8-*)
516 echo powerpc-harris-powermax
517 exit ;;
518 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
519 echo powerpc-harris-powermax
520 exit ;;
521 Night_Hawk:Power_UNIX:*:*)
522 echo powerpc-harris-powerunix
523 exit ;;
524 m88k:CX/UX:7*:*)
525 echo m88k-harris-cxux7
526 exit ;;
527 m88k:*:4*:R4*)
528 echo m88k-motorola-sysv4
529 exit ;;
530 m88k:*:3*:R3*)
531 echo m88k-motorola-sysv3
532 exit ;;
533 AViiON:dgux:*:*)
534 # DG/UX returns AViiON for all architectures
535 UNAME_PROCESSOR=`/usr/bin/uname -p`
536 if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
537 then
538 if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
539 [ "$TARGET_BINARY_INTERFACE"x = x ]
540 then
541 echo m88k-dg-dgux"$UNAME_RELEASE"
542 else
543 echo m88k-dg-dguxbcs"$UNAME_RELEASE"
544 fi
545 else
546 echo i586-dg-dgux"$UNAME_RELEASE"
547 fi
548 exit ;;
549 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
550 echo m88k-dolphin-sysv3
551 exit ;;
552 M88*:*:R3*:*)
553 # Delta 88k system running SVR3
554 echo m88k-motorola-sysv3
555 exit ;;
556 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
557 echo m88k-tektronix-sysv3
558 exit ;;
559 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
560 echo m68k-tektronix-bsd
561 exit ;;
562 *:IRIX*:*:*)
563 echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
564 exit ;;
565 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
566 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
567 exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
568 i*86:AIX:*:*)
569 echo i386-ibm-aix
570 exit ;;
571 ia64:AIX:*:*)
572 if [ -x /usr/bin/oslevel ] ; then
573 IBM_REV=`/usr/bin/oslevel`
574 else
575 IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
576 fi
577 echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
578 exit ;;
579 *:AIX:2:3)
580 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
581 eval "$set_cc_for_build"
582 sed 's/^ //' << EOF > "$dummy.c"
583 #include <sys/systemcfg.h>
584
585 main()
586 {
587 if (!__power_pc())
588 exit(1);
589 puts("powerpc-ibm-aix3.2.5");
590 exit(0);
591 }
592 EOF
593 if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
594 then
595 echo "$SYSTEM_NAME"
596 else
597 echo rs6000-ibm-aix3.2.5
598 fi
599 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
600 echo rs6000-ibm-aix3.2.4
601 else
602 echo rs6000-ibm-aix3.2
603 fi
604 exit ;;
605 *:AIX:*:[4567])
606 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
607 if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
608 IBM_ARCH=rs6000
609 else
610 IBM_ARCH=powerpc
611 fi
612 if [ -x /usr/bin/lslpp ] ; then
613 IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
614 awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
615 else
616 IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
617 fi
618 echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
619 exit ;;
620 *:AIX:*:*)
621 echo rs6000-ibm-aix
622 exit ;;
623 ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
624 echo romp-ibm-bsd4.4
625 exit ;;
626 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
627 echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
628 exit ;; # report: romp-ibm BSD 4.3
629 *:BOSX:*:*)
630 echo rs6000-bull-bosx
631 exit ;;
632 DPX/2?00:B.O.S.:*:*)
633 echo m68k-bull-sysv3
634 exit ;;
635 9000/[34]??:4.3bsd:1.*:*)
636 echo m68k-hp-bsd
637 exit ;;
638 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
639 echo m68k-hp-bsd4.4
640 exit ;;
641 9000/[34678]??:HP-UX:*:*)
642 HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
643 case "$UNAME_MACHINE" in
644 9000/31?) HP_ARCH=m68000 ;;
645 9000/[34]??) HP_ARCH=m68k ;;
646 9000/[678][0-9][0-9])
647 if [ -x /usr/bin/getconf ]; then
648 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
649 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
650 case "$sc_cpu_version" in
651 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
652 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
653 532) # CPU_PA_RISC2_0
654 case "$sc_kernel_bits" in
655 32) HP_ARCH=hppa2.0n ;;
656 64) HP_ARCH=hppa2.0w ;;
657 '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
658 esac ;;
659 esac
660 fi
661 if [ "$HP_ARCH" = "" ]; then
662 eval "$set_cc_for_build"
663 sed 's/^ //' << EOF > "$dummy.c"
664
665 #define _HPUX_SOURCE
666 #include <stdlib.h>
667 #include <unistd.h>
668
669 int main ()
670 {
671 #if defined(_SC_KERNEL_BITS)
672 long bits = sysconf(_SC_KERNEL_BITS);
673 #endif
674 long cpu = sysconf (_SC_CPU_VERSION);
675
676 switch (cpu)
677 {
678 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
679 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
680 case CPU_PA_RISC2_0:
681 #if defined(_SC_KERNEL_BITS)
682 switch (bits)
683 {
684 case 64: puts ("hppa2.0w"); break;
685 case 32: puts ("hppa2.0n"); break;
686 default: puts ("hppa2.0"); break;
687 } break;
688 #else /* !defined(_SC_KERNEL_BITS) */
689 puts ("hppa2.0"); break;
690 #endif
691 default: puts ("hppa1.0"); break;
692 }
693 exit (0);
694 }
695 EOF
696 (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
697 test -z "$HP_ARCH" && HP_ARCH=hppa
698 fi ;;
699 esac
700 if [ "$HP_ARCH" = hppa2.0w ]
701 then
702 eval "$set_cc_for_build"
703
704 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
705 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
706 # generating 64-bit code. GNU and HP use different nomenclature:
707 #
708 # $ CC_FOR_BUILD=cc ./config.guess
709 # => hppa2.0w-hp-hpux11.23
710 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
711 # => hppa64-hp-hpux11.23
712
713 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
714 grep -q __LP64__
715 then
716 HP_ARCH=hppa2.0w
717 else
718 HP_ARCH=hppa64
719 fi
720 fi
721 echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
722 exit ;;
723 ia64:HP-UX:*:*)
724 HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
725 echo ia64-hp-hpux"$HPUX_REV"
726 exit ;;
727 3050*:HI-UX:*:*)
728 eval "$set_cc_for_build"
729 sed 's/^ //' << EOF > "$dummy.c"
730 #include <unistd.h>
731 int
732 main ()
733 {
734 long cpu = sysconf (_SC_CPU_VERSION);
735 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
736 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
737 results, however. */
738 if (CPU_IS_PA_RISC (cpu))
739 {
740 switch (cpu)
741 {
742 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
743 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
744 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
745 default: puts ("hppa-hitachi-hiuxwe2"); break;
746 }
747 }
748 else if (CPU_IS_HP_MC68K (cpu))
749 puts ("m68k-hitachi-hiuxwe2");
750 else puts ("unknown-hitachi-hiuxwe2");
751 exit (0);
752 }
753 EOF
754 $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
755 { echo "$SYSTEM_NAME"; exit; }
756 echo unknown-hitachi-hiuxwe2
757 exit ;;
758 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
759 echo hppa1.1-hp-bsd
760 exit ;;
761 9000/8??:4.3bsd:*:*)
762 echo hppa1.0-hp-bsd
763 exit ;;
764 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
765 echo hppa1.0-hp-mpeix
766 exit ;;
767 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
768 echo hppa1.1-hp-osf
769 exit ;;
770 hp8??:OSF1:*:*)
771 echo hppa1.0-hp-osf
772 exit ;;
773 i*86:OSF1:*:*)
774 if [ -x /usr/sbin/sysversion ] ; then
775 echo "$UNAME_MACHINE"-unknown-osf1mk
776 else
777 echo "$UNAME_MACHINE"-unknown-osf1
778 fi
779 exit ;;
780 parisc*:Lites*:*:*)
781 echo hppa1.1-hp-lites
782 exit ;;
783 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
784 echo c1-convex-bsd
785 exit ;;
786 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
787 if getsysinfo -f scalar_acc
788 then echo c32-convex-bsd
789 else echo c2-convex-bsd
790 fi
791 exit ;;
792 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
793 echo c34-convex-bsd
794 exit ;;
795 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
796 echo c38-convex-bsd
797 exit ;;
798 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
799 echo c4-convex-bsd
800 exit ;;
801 CRAY*Y-MP:*:*:*)
802 echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
803 exit ;;
804 CRAY*[A-Z]90:*:*:*)
805 echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
806 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
807 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
808 -e 's/\.[^.]*$/.X/'
809 exit ;;
810 CRAY*TS:*:*:*)
811 echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
812 exit ;;
813 CRAY*T3E:*:*:*)
814 echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
815 exit ;;
816 CRAY*SV1:*:*:*)
817 echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
818 exit ;;
819 *:UNICOS/mp:*:*)
820 echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
821 exit ;;
822 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
823 FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
824 FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
825 FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
826 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
827 exit ;;
828 5000:UNIX_System_V:4.*:*)
829 FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
830 FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
831 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
832 exit ;;
833 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
834 echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
835 exit ;;
836 sparc*:BSD/OS:*:*)
837 echo sparc-unknown-bsdi"$UNAME_RELEASE"
838 exit ;;
839 *:BSD/OS:*:*)
840 echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
841 exit ;;
842 *:FreeBSD:*:*)
843 UNAME_PROCESSOR=`/usr/bin/uname -p`
844 case "$UNAME_PROCESSOR" in
845 amd64)
846 UNAME_PROCESSOR=x86_64 ;;
847 i386)
848 UNAME_PROCESSOR=i586 ;;
849 esac
850 echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
851 exit ;;
852 i*:CYGWIN*:*)
853 echo "$UNAME_MACHINE"-pc-cygwin
854 exit ;;
855 *:MINGW64*:*)
856 echo "$UNAME_MACHINE"-pc-mingw64
857 exit ;;
858 *:MINGW*:*)
859 echo "$UNAME_MACHINE"-pc-mingw32
860 exit ;;
861 *:MSYS*:*)
862 echo "$UNAME_MACHINE"-pc-msys
863 exit ;;
864 i*:PW*:*)
865 echo "$UNAME_MACHINE"-pc-pw32
866 exit ;;
867 *:Interix*:*)
868 case "$UNAME_MACHINE" in
869 x86)
870 echo i586-pc-interix"$UNAME_RELEASE"
871 exit ;;
872 authenticamd | genuineintel | EM64T)
873 echo x86_64-unknown-interix"$UNAME_RELEASE"
874 exit ;;
875 IA64)
876 echo ia64-unknown-interix"$UNAME_RELEASE"
877 exit ;;
878 esac ;;
879 i*:UWIN*:*)
880 echo "$UNAME_MACHINE"-pc-uwin
881 exit ;;
882 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
883 echo x86_64-unknown-cygwin
884 exit ;;
885 prep*:SunOS:5.*:*)
886 echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
887 exit ;;
888 *:GNU:*:*)
889 # the GNU system
890 echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
891 exit ;;
892 *:GNU/*:*:*)
893 # other systems with GNU libc and userland
894 echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
895 exit ;;
896 i*86:Minix:*:*)
897 echo "$UNAME_MACHINE"-pc-minix
898 exit ;;
899 aarch64:Linux:*:*)
900 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
901 exit ;;
902 aarch64_be:Linux:*:*)
903 UNAME_MACHINE=aarch64_be
904 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
905 exit ;;
906 alpha:Linux:*:*)
907 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
908 EV5) UNAME_MACHINE=alphaev5 ;;
909 EV56) UNAME_MACHINE=alphaev56 ;;
910 PCA56) UNAME_MACHINE=alphapca56 ;;
911 PCA57) UNAME_MACHINE=alphapca56 ;;
912 EV6) UNAME_MACHINE=alphaev6 ;;
913 EV67) UNAME_MACHINE=alphaev67 ;;
914 EV68*) UNAME_MACHINE=alphaev68 ;;
915 esac
916 objdump --private-headers /bin/sh | grep -q ld.so.1
917 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
918 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
919 exit ;;
920 arc:Linux:*:* | arceb:Linux:*:*)
921 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
922 exit ;;
923 arm*:Linux:*:*)
924 eval "$set_cc_for_build"
925 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
926 | grep -q __ARM_EABI__
927 then
928 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
929 else
930 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
931 | grep -q __ARM_PCS_VFP
932 then
933 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
934 else
935 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
936 fi
937 fi
938 exit ;;
939 avr32*:Linux:*:*)
940 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
941 exit ;;
942 cris:Linux:*:*)
943 echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
944 exit ;;
945 crisv32:Linux:*:*)
946 echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
947 exit ;;
948 e2k:Linux:*:*)
949 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
950 exit ;;
951 frv:Linux:*:*)
952 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
953 exit ;;
954 hexagon:Linux:*:*)
955 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
956 exit ;;
957 i*86:Linux:*:*)
958 echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
959 exit ;;
960 ia64:Linux:*:*)
961 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
962 exit ;;
963 k1om:Linux:*:*)
964 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
965 exit ;;
966 m32r*:Linux:*:*)
967 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
968 exit ;;
969 m68*:Linux:*:*)
970 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
971 exit ;;
972 mips:Linux:*:* | mips64:Linux:*:*)
973 eval "$set_cc_for_build"
974 sed 's/^ //' << EOF > "$dummy.c"
975 #undef CPU
976 #undef ${UNAME_MACHINE}
977 #undef ${UNAME_MACHINE}el
978 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
979 CPU=${UNAME_MACHINE}el
980 #else
981 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
982 CPU=${UNAME_MACHINE}
983 #else
984 CPU=
985 #endif
986 #endif
987 EOF
988 eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
989 test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
990 ;;
991 mips64el:Linux:*:*)
992 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
993 exit ;;
994 openrisc*:Linux:*:*)
995 echo or1k-unknown-linux-"$LIBC"
996 exit ;;
997 or32:Linux:*:* | or1k*:Linux:*:*)
998 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
999 exit ;;
1000 padre:Linux:*:*)
1001 echo sparc-unknown-linux-"$LIBC"
1002 exit ;;
1003 parisc64:Linux:*:* | hppa64:Linux:*:*)
1004 echo hppa64-unknown-linux-"$LIBC"
1005 exit ;;
1006 parisc:Linux:*:* | hppa:Linux:*:*)
1007 # Look for CPU level
1008 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
1009 PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
1010 PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
1011 *) echo hppa-unknown-linux-"$LIBC" ;;
1012 esac
1013 exit ;;
1014 ppc64:Linux:*:*)
1015 echo powerpc64-unknown-linux-"$LIBC"
1016 exit ;;
1017 ppc:Linux:*:*)
1018 echo powerpc-unknown-linux-"$LIBC"
1019 exit ;;
1020 ppc64le:Linux:*:*)
1021 echo powerpc64le-unknown-linux-"$LIBC"
1022 exit ;;
1023 ppcle:Linux:*:*)
1024 echo powerpcle-unknown-linux-"$LIBC"
1025 exit ;;
1026 riscv32:Linux:*:* | riscv64:Linux:*:*)
1027 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1028 exit ;;
1029 s390:Linux:*:* | s390x:Linux:*:*)
1030 echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
1031 exit ;;
1032 sh64*:Linux:*:*)
1033 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1034 exit ;;
1035 sh*:Linux:*:*)
1036 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1037 exit ;;
1038 sparc:Linux:*:* | sparc64:Linux:*:*)
1039 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1040 exit ;;
1041 tile*:Linux:*:*)
1042 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1043 exit ;;
1044 vax:Linux:*:*)
1045 echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
1046 exit ;;
1047 x86_64:Linux:*:*)
1048 if objdump -f /bin/sh | grep -q elf32-x86-64; then
1049 echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32
1050 else
1051 echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
1052 fi
1053 exit ;;
1054 xtensa*:Linux:*:*)
1055 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1056 exit ;;
1057 i*86:DYNIX/ptx:4*:*)
1058 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1059 # earlier versions are messed up and put the nodename in both
1060 # sysname and nodename.
1061 echo i386-sequent-sysv4
1062 exit ;;
1063 i*86:UNIX_SV:4.2MP:2.*)
1064 # Unixware is an offshoot of SVR4, but it has its own version
1065 # number series starting with 2...
1066 # I am not positive that other SVR4 systems won't match this,
1067 # I just have to hope. -- rms.
1068 # Use sysv4.2uw... so that sysv4* matches it.
1069 echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
1070 exit ;;
1071 i*86:OS/2:*:*)
1072 # If we were able to find `uname', then EMX Unix compatibility
1073 # is probably installed.
1074 echo "$UNAME_MACHINE"-pc-os2-emx
1075 exit ;;
1076 i*86:XTS-300:*:STOP)
1077 echo "$UNAME_MACHINE"-unknown-stop
1078 exit ;;
1079 i*86:atheos:*:*)
1080 echo "$UNAME_MACHINE"-unknown-atheos
1081 exit ;;
1082 i*86:syllable:*:*)
1083 echo "$UNAME_MACHINE"-pc-syllable
1084 exit ;;
1085 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1086 echo i386-unknown-lynxos"$UNAME_RELEASE"
1087 exit ;;
1088 i*86:*DOS:*:*)
1089 echo "$UNAME_MACHINE"-pc-msdosdjgpp
1090 exit ;;
1091 i*86:*:4.*:*)
1092 UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
1093 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1094 echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
1095 else
1096 echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
1097 fi
1098 exit ;;
1099 i*86:*:5:[678]*)
1100 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1101 case `/bin/uname -X | grep "^Machine"` in
1102 *486*) UNAME_MACHINE=i486 ;;
1103 *Pentium) UNAME_MACHINE=i586 ;;
1104 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1105 esac
1106 echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
1107 exit ;;
1108 i*86:*:3.2:*)
1109 if test -f /usr/options/cb.name; then
1110 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1111 echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
1112 elif /bin/uname -X 2>/dev/null >/dev/null ; then
1113 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1114 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1115 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1116 && UNAME_MACHINE=i586
1117 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1118 && UNAME_MACHINE=i686
1119 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1120 && UNAME_MACHINE=i686
1121 echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
1122 else
1123 echo "$UNAME_MACHINE"-pc-sysv32
1124 fi
1125 exit ;;
1126 pc:*:*:*)
1127 # Left here for compatibility:
1128 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1129 # the processor, so we play safe by assuming i586.
1130 # Note: whatever this is, it MUST be the same as what config.sub
1131 # prints for the "djgpp" host, or else GDB configure will decide that
1132 # this is a cross-build.
1133 echo i586-pc-msdosdjgpp
1134 exit ;;
1135 Intel:Mach:3*:*)
1136 echo i386-pc-mach3
1137 exit ;;
1138 paragon:*:*:*)
1139 echo i860-intel-osf1
1140 exit ;;
1141 i860:*:4.*:*) # i860-SVR4
1142 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1143 echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
1144 else # Add other i860-SVR4 vendors below as they are discovered.
1145 echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
1146 fi
1147 exit ;;
1148 mini*:CTIX:SYS*5:*)
1149 # "miniframe"
1150 echo m68010-convergent-sysv
1151 exit ;;
1152 mc68k:UNIX:SYSTEM5:3.51m)
1153 echo m68k-convergent-sysv
1154 exit ;;
1155 M680?0:D-NIX:5.3:*)
1156 echo m68k-diab-dnix
1157 exit ;;
1158 M68*:*:R3V[5678]*:*)
1159 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1160 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
1161 OS_REL=''
1162 test -r /etc/.relid \
1163 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1164 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1165 && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1166 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1167 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1168 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1169 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1170 && { echo i486-ncr-sysv4; exit; } ;;
1171 NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1172 OS_REL='.3'
1173 test -r /etc/.relid \
1174 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1175 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1176 && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1177 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1178 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
1179 /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1180 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1181 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1182 echo m68k-unknown-lynxos"$UNAME_RELEASE"
1183 exit ;;
1184 mc68030:UNIX_System_V:4.*:*)
1185 echo m68k-atari-sysv4
1186 exit ;;
1187 TSUNAMI:LynxOS:2.*:*)
1188 echo sparc-unknown-lynxos"$UNAME_RELEASE"
1189 exit ;;
1190 rs6000:LynxOS:2.*:*)
1191 echo rs6000-unknown-lynxos"$UNAME_RELEASE"
1192 exit ;;
1193 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1194 echo powerpc-unknown-lynxos"$UNAME_RELEASE"
1195 exit ;;
1196 SM[BE]S:UNIX_SV:*:*)
1197 echo mips-dde-sysv"$UNAME_RELEASE"
1198 exit ;;
1199 RM*:ReliantUNIX-*:*:*)
1200 echo mips-sni-sysv4
1201 exit ;;
1202 RM*:SINIX-*:*:*)
1203 echo mips-sni-sysv4
1204 exit ;;
1205 *:SINIX-*:*:*)
1206 if uname -p 2>/dev/null >/dev/null ; then
1207 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1208 echo "$UNAME_MACHINE"-sni-sysv4
1209 else
1210 echo ns32k-sni-sysv
1211 fi
1212 exit ;;
1213 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1214 # says <Richard.M.Bartel@ccMail.Census.GOV>
1215 echo i586-unisys-sysv4
1216 exit ;;
1217 *:UNIX_System_V:4*:FTX*)
1218 # From Gerald Hewes <hewes@openmarket.com>.
1219 # How about differentiating between stratus architectures? -djm
1220 echo hppa1.1-stratus-sysv4
1221 exit ;;
1222 *:*:*:FTX*)
1223 # From seanf@swdc.stratus.com.
1224 echo i860-stratus-sysv4
1225 exit ;;
1226 i*86:VOS:*:*)
1227 # From Paul.Green@stratus.com.
1228 echo "$UNAME_MACHINE"-stratus-vos
1229 exit ;;
1230 *:VOS:*:*)
1231 # From Paul.Green@stratus.com.
1232 echo hppa1.1-stratus-vos
1233 exit ;;
1234 mc68*:A/UX:*:*)
1235 echo m68k-apple-aux"$UNAME_RELEASE"
1236 exit ;;
1237 news*:NEWS-OS:6*:*)
1238 echo mips-sony-newsos6
1239 exit ;;
1240 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1241 if [ -d /usr/nec ]; then
1242 echo mips-nec-sysv"$UNAME_RELEASE"
1243 else
1244 echo mips-unknown-sysv"$UNAME_RELEASE"
1245 fi
1246 exit ;;
1247 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1248 echo powerpc-be-beos
1249 exit ;;
1250 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1251 echo powerpc-apple-beos
1252 exit ;;
1253 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1254 echo i586-pc-beos
1255 exit ;;
1256 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1257 echo i586-pc-haiku
1258 exit ;;
1259 x86_64:Haiku:*:*)
1260 echo x86_64-unknown-haiku
1261 exit ;;
1262 SX-4:SUPER-UX:*:*)
1263 echo sx4-nec-superux"$UNAME_RELEASE"
1264 exit ;;
1265 SX-5:SUPER-UX:*:*)
1266 echo sx5-nec-superux"$UNAME_RELEASE"
1267 exit ;;
1268 SX-6:SUPER-UX:*:*)
1269 echo sx6-nec-superux"$UNAME_RELEASE"
1270 exit ;;
1271 SX-7:SUPER-UX:*:*)
1272 echo sx7-nec-superux"$UNAME_RELEASE"
1273 exit ;;
1274 SX-8:SUPER-UX:*:*)
1275 echo sx8-nec-superux"$UNAME_RELEASE"
1276 exit ;;
1277 SX-8R:SUPER-UX:*:*)
1278 echo sx8r-nec-superux"$UNAME_RELEASE"
1279 exit ;;
1280 SX-ACE:SUPER-UX:*:*)
1281 echo sxace-nec-superux"$UNAME_RELEASE"
1282 exit ;;
1283 Power*:Rhapsody:*:*)
1284 echo powerpc-apple-rhapsody"$UNAME_RELEASE"
1285 exit ;;
1286 *:Rhapsody:*:*)
1287 echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
1288 exit ;;
1289 *:Darwin:*:*)
1290 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1291 eval "$set_cc_for_build"
1292 if test "$UNAME_PROCESSOR" = unknown ; then
1293 UNAME_PROCESSOR=powerpc
1294 fi
1295 if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
1296 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
1297 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1298 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1299 grep IS_64BIT_ARCH >/dev/null
1300 then
1301 case $UNAME_PROCESSOR in
1302 i386) UNAME_PROCESSOR=x86_64 ;;
1303 powerpc) UNAME_PROCESSOR=powerpc64 ;;
1304 esac
1305 fi
1306 # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1307 if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
1308 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1309 grep IS_PPC >/dev/null
1310 then
1311 UNAME_PROCESSOR=powerpc
1312 fi
1313 fi
1314 elif test "$UNAME_PROCESSOR" = i386 ; then
1315 # Avoid executing cc on OS X 10.9, as it ships with a stub
1316 # that puts up a graphical alert prompting to install
1317 # developer tools. Any system running Mac OS X 10.7 or
1318 # later (Darwin 11 and later) is required to have a 64-bit
1319 # processor. This is not true of the ARM version of Darwin
1320 # that Apple uses in portable devices.
1321 UNAME_PROCESSOR=x86_64
1322 fi
1323 echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
1324 exit ;;
1325 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1326 UNAME_PROCESSOR=`uname -p`
1327 if test "$UNAME_PROCESSOR" = x86; then
1328 UNAME_PROCESSOR=i386
1329 UNAME_MACHINE=pc
1330 fi
1331 echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
1332 exit ;;
1333 *:QNX:*:4*)
1334 echo i386-pc-qnx
1335 exit ;;
1336 NEO-*:NONSTOP_KERNEL:*:*)
1337 echo neo-tandem-nsk"$UNAME_RELEASE"
1338 exit ;;
1339 NSE-*:NONSTOP_KERNEL:*:*)
1340 echo nse-tandem-nsk"$UNAME_RELEASE"
1341 exit ;;
1342 NSR-*:NONSTOP_KERNEL:*:*)
1343 echo nsr-tandem-nsk"$UNAME_RELEASE"
1344 exit ;;
1345 NSV-*:NONSTOP_KERNEL:*:*)
1346 echo nsv-tandem-nsk"$UNAME_RELEASE"
1347 exit ;;
1348 NSX-*:NONSTOP_KERNEL:*:*)
1349 echo nsx-tandem-nsk"$UNAME_RELEASE"
1350 exit ;;
1351 *:NonStop-UX:*:*)
1352 echo mips-compaq-nonstopux
1353 exit ;;
1354 BS2000:POSIX*:*:*)
1355 echo bs2000-siemens-sysv
1356 exit ;;
1357 DS/*:UNIX_System_V:*:*)
1358 echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
1359 exit ;;
1360 *:Plan9:*:*)
1361 # "uname -m" is not consistent, so use $cputype instead. 386
1362 # is converted to i386 for consistency with other x86
1363 # operating systems.
1364 if test "$cputype" = 386; then
1365 UNAME_MACHINE=i386
1366 else
1367 UNAME_MACHINE="$cputype"
1368 fi
1369 echo "$UNAME_MACHINE"-unknown-plan9
1370 exit ;;
1371 *:TOPS-10:*:*)
1372 echo pdp10-unknown-tops10
1373 exit ;;
1374 *:TENEX:*:*)
1375 echo pdp10-unknown-tenex
1376 exit ;;
1377 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1378 echo pdp10-dec-tops20
1379 exit ;;
1380 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1381 echo pdp10-xkl-tops20
1382 exit ;;
1383 *:TOPS-20:*:*)
1384 echo pdp10-unknown-tops20
1385 exit ;;
1386 *:ITS:*:*)
1387 echo pdp10-unknown-its
1388 exit ;;
1389 SEI:*:*:SEIUX)
1390 echo mips-sei-seiux"$UNAME_RELEASE"
1391 exit ;;
1392 *:DragonFly:*:*)
1393 echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
1394 exit ;;
1395 *:*VMS:*:*)
1396 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1397 case "$UNAME_MACHINE" in
1398 A*) echo alpha-dec-vms ; exit ;;
1399 I*) echo ia64-dec-vms ; exit ;;
1400 V*) echo vax-dec-vms ; exit ;;
1401 esac ;;
1402 *:XENIX:*:SysV)
1403 echo i386-pc-xenix
1404 exit ;;
1405 i*86:skyos:*:*)
1406 echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
1407 exit ;;
1408 i*86:rdos:*:*)
1409 echo "$UNAME_MACHINE"-pc-rdos
1410 exit ;;
1411 i*86:AROS:*:*)
1412 echo "$UNAME_MACHINE"-pc-aros
1413 exit ;;
1414 x86_64:VMkernel:*:*)
1415 echo "$UNAME_MACHINE"-unknown-esx
1416 exit ;;
1417 amd64:Isilon\ OneFS:*:*)
1418 echo x86_64-unknown-onefs
1419 exit ;;
1420 esac
1421
1422 echo "$0: unable to guess system type" >&2
1423
1424 case "$UNAME_MACHINE:$UNAME_SYSTEM" in
1425 mips:Linux | mips64:Linux)
1426 # If we got here on MIPS GNU/Linux, output extra information.
1427 cat >&2 <<EOF
1428
1429 NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
1430 the system type. Please install a C compiler and try again.
1431 EOF
1432 ;;
1433 esac
1434
1435 cat >&2 <<EOF
1436
1437 This script (version $timestamp), has failed to recognize the
1438 operating system you are using. If your script is old, overwrite *all*
1439 copies of config.guess and config.sub with the latest versions from:
1440
1441 https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
1442 and
1443 https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
1444
1445 If $0 has already been updated, send the following data and any
1446 information you think might be pertinent to config-patches@gnu.org to
1447 provide the necessary information to handle your system.
1448
1449 config.guess timestamp = $timestamp
1450
1451 uname -m = `(uname -m) 2>/dev/null || echo unknown`
1452 uname -r = `(uname -r) 2>/dev/null || echo unknown`
1453 uname -s = `(uname -s) 2>/dev/null || echo unknown`
1454 uname -v = `(uname -v) 2>/dev/null || echo unknown`
1455
1456 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1457 /bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1458
1459 hostinfo = `(hostinfo) 2>/dev/null`
1460 /bin/universe = `(/bin/universe) 2>/dev/null`
1461 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1462 /bin/arch = `(/bin/arch) 2>/dev/null`
1463 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1464 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1465
1466 UNAME_MACHINE = "$UNAME_MACHINE"
1467 UNAME_RELEASE = "$UNAME_RELEASE"
1468 UNAME_SYSTEM = "$UNAME_SYSTEM"
1469 UNAME_VERSION = "$UNAME_VERSION"
1470 EOF
1471
1472 exit 1
1473
1474 # Local variables:
1475 # eval: (add-hook 'write-file-functions 'time-stamp)
1476 # time-stamp-start: "timestamp='"
1477 # time-stamp-format: "%:y-%02m-%02d"
1478 # time-stamp-end: "'"
1479 # End:
0 #! /bin/sh
1 # Output a system dependent set of variables, describing how to set the
2 # run time search path of shared libraries in an executable.
3 #
4 # Copyright 1996-2016 Free Software Foundation, Inc.
5 # Taken from GNU libtool, 2001
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7 #
8 # This file is free software; the Free Software Foundation gives
9 # unlimited permission to copy and/or distribute it, with or without
10 # modifications, as long as this notice is preserved.
11 #
12 # The first argument passed to this file is the canonical host specification,
13 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
14 # or
15 # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
16 # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
17 # should be set by the caller.
18 #
19 # The set of defined variables is at the end of this script.
20
21 # Known limitations:
22 # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
23 # than 256 bytes, otherwise the compiler driver will dump core. The only
24 # known workaround is to choose shorter directory names for the build
25 # directory and/or the installation directory.
26
27 # All known linkers require a '.a' archive for static linking (except MSVC,
28 # which needs '.lib').
29 libext=a
30 shrext=.so
31
32 host="$1"
33 host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
34 host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
35 host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
36
37 # Code taken from libtool.m4's _LT_CC_BASENAME.
38
39 for cc_temp in $CC""; do
40 case $cc_temp in
41 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
42 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
43 \-*) ;;
44 *) break;;
45 esac
46 done
47 cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
48
49 # Code taken from libtool.m4's _LT_COMPILER_PIC.
50
51 wl=
52 if test "$GCC" = yes; then
53 wl='-Wl,'
54 else
55 case "$host_os" in
56 aix*)
57 wl='-Wl,'
58 ;;
59 mingw* | cygwin* | pw32* | os2* | cegcc*)
60 ;;
61 hpux9* | hpux10* | hpux11*)
62 wl='-Wl,'
63 ;;
64 irix5* | irix6* | nonstopux*)
65 wl='-Wl,'
66 ;;
67 linux* | k*bsd*-gnu | kopensolaris*-gnu)
68 case $cc_basename in
69 ecc*)
70 wl='-Wl,'
71 ;;
72 icc* | ifort*)
73 wl='-Wl,'
74 ;;
75 lf95*)
76 wl='-Wl,'
77 ;;
78 nagfor*)
79 wl='-Wl,-Wl,,'
80 ;;
81 pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
82 wl='-Wl,'
83 ;;
84 ccc*)
85 wl='-Wl,'
86 ;;
87 xl* | bgxl* | bgf* | mpixl*)
88 wl='-Wl,'
89 ;;
90 como)
91 wl='-lopt='
92 ;;
93 *)
94 case `$CC -V 2>&1 | sed 5q` in
95 *Sun\ F* | *Sun*Fortran*)
96 wl=
97 ;;
98 *Sun\ C*)
99 wl='-Wl,'
100 ;;
101 esac
102 ;;
103 esac
104 ;;
105 newsos6)
106 ;;
107 *nto* | *qnx*)
108 ;;
109 osf3* | osf4* | osf5*)
110 wl='-Wl,'
111 ;;
112 rdos*)
113 ;;
114 solaris*)
115 case $cc_basename in
116 f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
117 wl='-Qoption ld '
118 ;;
119 *)
120 wl='-Wl,'
121 ;;
122 esac
123 ;;
124 sunos4*)
125 wl='-Qoption ld '
126 ;;
127 sysv4 | sysv4.2uw2* | sysv4.3*)
128 wl='-Wl,'
129 ;;
130 sysv4*MP*)
131 ;;
132 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
133 wl='-Wl,'
134 ;;
135 unicos*)
136 wl='-Wl,'
137 ;;
138 uts4*)
139 ;;
140 esac
141 fi
142
143 # Code taken from libtool.m4's _LT_LINKER_SHLIBS.
144
145 hardcode_libdir_flag_spec=
146 hardcode_libdir_separator=
147 hardcode_direct=no
148 hardcode_minus_L=no
149
150 case "$host_os" in
151 cygwin* | mingw* | pw32* | cegcc*)
152 # FIXME: the MSVC++ port hasn't been tested in a loooong time
153 # When not using gcc, we currently assume that we are using
154 # Microsoft Visual C++.
155 if test "$GCC" != yes; then
156 with_gnu_ld=no
157 fi
158 ;;
159 interix*)
160 # we just hope/assume this is gcc and not c89 (= MSVC++)
161 with_gnu_ld=yes
162 ;;
163 openbsd*)
164 with_gnu_ld=no
165 ;;
166 esac
167
168 ld_shlibs=yes
169 if test "$with_gnu_ld" = yes; then
170 # Set some defaults for GNU ld with shared library support. These
171 # are reset later if shared libraries are not supported. Putting them
172 # here allows them to be overridden if necessary.
173 # Unlike libtool, we use -rpath here, not --rpath, since the documented
174 # option of GNU ld is called -rpath, not --rpath.
175 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
176 case "$host_os" in
177 aix[3-9]*)
178 # On AIX/PPC, the GNU linker is very broken
179 if test "$host_cpu" != ia64; then
180 ld_shlibs=no
181 fi
182 ;;
183 amigaos*)
184 case "$host_cpu" in
185 powerpc)
186 ;;
187 m68k)
188 hardcode_libdir_flag_spec='-L$libdir'
189 hardcode_minus_L=yes
190 ;;
191 esac
192 ;;
193 beos*)
194 if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
195 :
196 else
197 ld_shlibs=no
198 fi
199 ;;
200 cygwin* | mingw* | pw32* | cegcc*)
201 # hardcode_libdir_flag_spec is actually meaningless, as there is
202 # no search path for DLLs.
203 hardcode_libdir_flag_spec='-L$libdir'
204 if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
205 :
206 else
207 ld_shlibs=no
208 fi
209 ;;
210 haiku*)
211 ;;
212 interix[3-9]*)
213 hardcode_direct=no
214 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
215 ;;
216 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
217 if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
218 :
219 else
220 ld_shlibs=no
221 fi
222 ;;
223 netbsd*)
224 ;;
225 solaris*)
226 if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
227 ld_shlibs=no
228 elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
229 :
230 else
231 ld_shlibs=no
232 fi
233 ;;
234 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
235 case `$LD -v 2>&1` in
236 *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
237 ld_shlibs=no
238 ;;
239 *)
240 if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
241 hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
242 else
243 ld_shlibs=no
244 fi
245 ;;
246 esac
247 ;;
248 sunos4*)
249 hardcode_direct=yes
250 ;;
251 *)
252 if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
253 :
254 else
255 ld_shlibs=no
256 fi
257 ;;
258 esac
259 if test "$ld_shlibs" = no; then
260 hardcode_libdir_flag_spec=
261 fi
262 else
263 case "$host_os" in
264 aix3*)
265 # Note: this linker hardcodes the directories in LIBPATH if there
266 # are no directories specified by -L.
267 hardcode_minus_L=yes
268 if test "$GCC" = yes; then
269 # Neither direct hardcoding nor static linking is supported with a
270 # broken collect2.
271 hardcode_direct=unsupported
272 fi
273 ;;
274 aix[4-9]*)
275 if test "$host_cpu" = ia64; then
276 # On IA64, the linker does run time linking by default, so we don't
277 # have to do anything special.
278 aix_use_runtimelinking=no
279 else
280 aix_use_runtimelinking=no
281 # Test if we are trying to use run time linking or normal
282 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
283 # need to do runtime linking.
284 case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
285 for ld_flag in $LDFLAGS; do
286 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
287 aix_use_runtimelinking=yes
288 break
289 fi
290 done
291 ;;
292 esac
293 fi
294 hardcode_direct=yes
295 hardcode_libdir_separator=':'
296 if test "$GCC" = yes; then
297 case $host_os in aix4.[012]|aix4.[012].*)
298 collect2name=`${CC} -print-prog-name=collect2`
299 if test -f "$collect2name" && \
300 strings "$collect2name" | grep resolve_lib_name >/dev/null
301 then
302 # We have reworked collect2
303 :
304 else
305 # We have old collect2
306 hardcode_direct=unsupported
307 hardcode_minus_L=yes
308 hardcode_libdir_flag_spec='-L$libdir'
309 hardcode_libdir_separator=
310 fi
311 ;;
312 esac
313 fi
314 # Begin _LT_AC_SYS_LIBPATH_AIX.
315 echo 'int main () { return 0; }' > conftest.c
316 ${CC} ${LDFLAGS} conftest.c -o conftest
317 aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
318 }'`
319 if test -z "$aix_libpath"; then
320 aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
321 }'`
322 fi
323 if test -z "$aix_libpath"; then
324 aix_libpath="/usr/lib:/lib"
325 fi
326 rm -f conftest.c conftest
327 # End _LT_AC_SYS_LIBPATH_AIX.
328 if test "$aix_use_runtimelinking" = yes; then
329 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
330 else
331 if test "$host_cpu" = ia64; then
332 hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
333 else
334 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
335 fi
336 fi
337 ;;
338 amigaos*)
339 case "$host_cpu" in
340 powerpc)
341 ;;
342 m68k)
343 hardcode_libdir_flag_spec='-L$libdir'
344 hardcode_minus_L=yes
345 ;;
346 esac
347 ;;
348 bsdi[45]*)
349 ;;
350 cygwin* | mingw* | pw32* | cegcc*)
351 # When not using gcc, we currently assume that we are using
352 # Microsoft Visual C++.
353 # hardcode_libdir_flag_spec is actually meaningless, as there is
354 # no search path for DLLs.
355 hardcode_libdir_flag_spec=' '
356 libext=lib
357 ;;
358 darwin* | rhapsody*)
359 hardcode_direct=no
360 if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
361 :
362 else
363 ld_shlibs=no
364 fi
365 ;;
366 dgux*)
367 hardcode_libdir_flag_spec='-L$libdir'
368 ;;
369 freebsd2.[01]*)
370 hardcode_direct=yes
371 hardcode_minus_L=yes
372 ;;
373 freebsd* | dragonfly*)
374 hardcode_libdir_flag_spec='-R$libdir'
375 hardcode_direct=yes
376 ;;
377 hpux9*)
378 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
379 hardcode_libdir_separator=:
380 hardcode_direct=yes
381 # hardcode_minus_L: Not really in the search PATH,
382 # but as the default location of the library.
383 hardcode_minus_L=yes
384 ;;
385 hpux10*)
386 if test "$with_gnu_ld" = no; then
387 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
388 hardcode_libdir_separator=:
389 hardcode_direct=yes
390 # hardcode_minus_L: Not really in the search PATH,
391 # but as the default location of the library.
392 hardcode_minus_L=yes
393 fi
394 ;;
395 hpux11*)
396 if test "$with_gnu_ld" = no; then
397 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
398 hardcode_libdir_separator=:
399 case $host_cpu in
400 hppa*64*|ia64*)
401 hardcode_direct=no
402 ;;
403 *)
404 hardcode_direct=yes
405 # hardcode_minus_L: Not really in the search PATH,
406 # but as the default location of the library.
407 hardcode_minus_L=yes
408 ;;
409 esac
410 fi
411 ;;
412 irix5* | irix6* | nonstopux*)
413 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
414 hardcode_libdir_separator=:
415 ;;
416 netbsd*)
417 hardcode_libdir_flag_spec='-R$libdir'
418 hardcode_direct=yes
419 ;;
420 newsos6)
421 hardcode_direct=yes
422 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
423 hardcode_libdir_separator=:
424 ;;
425 *nto* | *qnx*)
426 ;;
427 openbsd*)
428 if test -f /usr/libexec/ld.so; then
429 hardcode_direct=yes
430 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
431 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
432 else
433 case "$host_os" in
434 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
435 hardcode_libdir_flag_spec='-R$libdir'
436 ;;
437 *)
438 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
439 ;;
440 esac
441 fi
442 else
443 ld_shlibs=no
444 fi
445 ;;
446 os2*)
447 hardcode_libdir_flag_spec='-L$libdir'
448 hardcode_minus_L=yes
449 ;;
450 osf3*)
451 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
452 hardcode_libdir_separator=:
453 ;;
454 osf4* | osf5*)
455 if test "$GCC" = yes; then
456 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
457 else
458 # Both cc and cxx compiler support -rpath directly
459 hardcode_libdir_flag_spec='-rpath $libdir'
460 fi
461 hardcode_libdir_separator=:
462 ;;
463 solaris*)
464 hardcode_libdir_flag_spec='-R$libdir'
465 ;;
466 sunos4*)
467 hardcode_libdir_flag_spec='-L$libdir'
468 hardcode_direct=yes
469 hardcode_minus_L=yes
470 ;;
471 sysv4)
472 case $host_vendor in
473 sni)
474 hardcode_direct=yes # is this really true???
475 ;;
476 siemens)
477 hardcode_direct=no
478 ;;
479 motorola)
480 hardcode_direct=no #Motorola manual says yes, but my tests say they lie
481 ;;
482 esac
483 ;;
484 sysv4.3*)
485 ;;
486 sysv4*MP*)
487 if test -d /usr/nec; then
488 ld_shlibs=yes
489 fi
490 ;;
491 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
492 ;;
493 sysv5* | sco3.2v5* | sco5v6*)
494 hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
495 hardcode_libdir_separator=':'
496 ;;
497 uts4*)
498 hardcode_libdir_flag_spec='-L$libdir'
499 ;;
500 *)
501 ld_shlibs=no
502 ;;
503 esac
504 fi
505
506 # Check dynamic linker characteristics
507 # Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
508 # Unlike libtool.m4, here we don't care about _all_ names of the library, but
509 # only about the one the linker finds when passed -lNAME. This is the last
510 # element of library_names_spec in libtool.m4, or possibly two of them if the
511 # linker has special search rules.
512 library_names_spec= # the last element of library_names_spec in libtool.m4
513 libname_spec='lib$name'
514 case "$host_os" in
515 aix3*)
516 library_names_spec='$libname.a'
517 ;;
518 aix[4-9]*)
519 library_names_spec='$libname$shrext'
520 ;;
521 amigaos*)
522 case "$host_cpu" in
523 powerpc*)
524 library_names_spec='$libname$shrext' ;;
525 m68k)
526 library_names_spec='$libname.a' ;;
527 esac
528 ;;
529 beos*)
530 library_names_spec='$libname$shrext'
531 ;;
532 bsdi[45]*)
533 library_names_spec='$libname$shrext'
534 ;;
535 cygwin* | mingw* | pw32* | cegcc*)
536 shrext=.dll
537 library_names_spec='$libname.dll.a $libname.lib'
538 ;;
539 darwin* | rhapsody*)
540 shrext=.dylib
541 library_names_spec='$libname$shrext'
542 ;;
543 dgux*)
544 library_names_spec='$libname$shrext'
545 ;;
546 freebsd[23].*)
547 library_names_spec='$libname$shrext$versuffix'
548 ;;
549 freebsd* | dragonfly*)
550 library_names_spec='$libname$shrext'
551 ;;
552 gnu*)
553 library_names_spec='$libname$shrext'
554 ;;
555 haiku*)
556 library_names_spec='$libname$shrext'
557 ;;
558 hpux9* | hpux10* | hpux11*)
559 case $host_cpu in
560 ia64*)
561 shrext=.so
562 ;;
563 hppa*64*)
564 shrext=.sl
565 ;;
566 *)
567 shrext=.sl
568 ;;
569 esac
570 library_names_spec='$libname$shrext'
571 ;;
572 interix[3-9]*)
573 library_names_spec='$libname$shrext'
574 ;;
575 irix5* | irix6* | nonstopux*)
576 library_names_spec='$libname$shrext'
577 case "$host_os" in
578 irix5* | nonstopux*)
579 libsuff= shlibsuff=
580 ;;
581 *)
582 case $LD in
583 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
584 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
585 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
586 *) libsuff= shlibsuff= ;;
587 esac
588 ;;
589 esac
590 ;;
591 linux*oldld* | linux*aout* | linux*coff*)
592 ;;
593 linux* | k*bsd*-gnu | kopensolaris*-gnu)
594 library_names_spec='$libname$shrext'
595 ;;
596 knetbsd*-gnu)
597 library_names_spec='$libname$shrext'
598 ;;
599 netbsd*)
600 library_names_spec='$libname$shrext'
601 ;;
602 newsos6)
603 library_names_spec='$libname$shrext'
604 ;;
605 *nto* | *qnx*)
606 library_names_spec='$libname$shrext'
607 ;;
608 openbsd*)
609 library_names_spec='$libname$shrext$versuffix'
610 ;;
611 os2*)
612 libname_spec='$name'
613 shrext=.dll
614 library_names_spec='$libname.a'
615 ;;
616 osf3* | osf4* | osf5*)
617 library_names_spec='$libname$shrext'
618 ;;
619 rdos*)
620 ;;
621 solaris*)
622 library_names_spec='$libname$shrext'
623 ;;
624 sunos4*)
625 library_names_spec='$libname$shrext$versuffix'
626 ;;
627 sysv4 | sysv4.3*)
628 library_names_spec='$libname$shrext'
629 ;;
630 sysv4*MP*)
631 library_names_spec='$libname$shrext'
632 ;;
633 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
634 library_names_spec='$libname$shrext'
635 ;;
636 tpf*)
637 library_names_spec='$libname$shrext'
638 ;;
639 uts4*)
640 library_names_spec='$libname$shrext'
641 ;;
642 esac
643
644 sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
645 escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
646 shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
647 escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
648 escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
649 escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
650
651 LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
652
653 # How to pass a linker flag through the compiler.
654 wl="$escaped_wl"
655
656 # Static library suffix (normally "a").
657 libext="$libext"
658
659 # Shared library suffix (normally "so").
660 shlibext="$shlibext"
661
662 # Format of library name prefix.
663 libname_spec="$escaped_libname_spec"
664
665 # Library names that the linker finds when passed -lNAME.
666 library_names_spec="$escaped_library_names_spec"
667
668 # Flag to hardcode \$libdir into a binary during linking.
669 # This must work even if \$libdir does not exist.
670 hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
671
672 # Whether we need a single -rpath flag with a separated argument.
673 hardcode_libdir_separator="$hardcode_libdir_separator"
674
675 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
676 # resulting binary.
677 hardcode_direct="$hardcode_direct"
678
679 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
680 # resulting binary.
681 hardcode_minus_L="$hardcode_minus_L"
682
683 EOF
0 #! /bin/sh
1 # Configuration validation subroutine script.
2 # Copyright 1992-2018 Free Software Foundation, Inc.
3
4 timestamp='2018-02-22'
5
6 # This file is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <https://www.gnu.org/licenses/>.
18 #
19 # As a special exception to the GNU General Public License, if you
20 # distribute this file as part of a program that contains a
21 # configuration script generated by Autoconf, you may include it under
22 # the same distribution terms that you use for the rest of that
23 # program. This Exception is an additional permission under section 7
24 # of the GNU General Public License, version 3 ("GPLv3").
25
26
27 # Please send patches to <config-patches@gnu.org>.
28 #
29 # Configuration subroutine to validate and canonicalize a configuration type.
30 # Supply the specified configuration type as an argument.
31 # If it is invalid, we print an error message on stderr and exit with code 1.
32 # Otherwise, we print the canonical config type on stdout and succeed.
33
34 # You can get the latest version of this script from:
35 # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
36
37 # This file is supposed to be the same for all GNU packages
38 # and recognize all the CPU types, system types and aliases
39 # that are meaningful with *any* GNU software.
40 # Each package is responsible for reporting which valid configurations
41 # it does not support. The user should be able to distinguish
42 # a failure to support a valid configuration from a meaningless
43 # configuration.
44
45 # The goal of this file is to map all the various variations of a given
46 # machine specification into a single specification in the form:
47 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
48 # or in some cases, the newer four-part form:
49 # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
50 # It is wrong to echo any other type of specification.
51
52 me=`echo "$0" | sed -e 's,.*/,,'`
53
54 usage="\
55 Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
56
57 Canonicalize a configuration name.
58
59 Options:
60 -h, --help print this help, then exit
61 -t, --time-stamp print date of last modification, then exit
62 -v, --version print version number, then exit
63
64 Report bugs and patches to <config-patches@gnu.org>."
65
66 version="\
67 GNU config.sub ($timestamp)
68
69 Copyright 1992-2018 Free Software Foundation, Inc.
70
71 This is free software; see the source for copying conditions. There is NO
72 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
73
74 help="
75 Try \`$me --help' for more information."
76
77 # Parse command line
78 while test $# -gt 0 ; do
79 case $1 in
80 --time-stamp | --time* | -t )
81 echo "$timestamp" ; exit ;;
82 --version | -v )
83 echo "$version" ; exit ;;
84 --help | --h* | -h )
85 echo "$usage"; exit ;;
86 -- ) # Stop option processing
87 shift; break ;;
88 - ) # Use stdin as input.
89 break ;;
90 -* )
91 echo "$me: invalid option $1$help"
92 exit 1 ;;
93
94 *local*)
95 # First pass through any local machine types.
96 echo "$1"
97 exit ;;
98
99 * )
100 break ;;
101 esac
102 done
103
104 case $# in
105 0) echo "$me: missing argument$help" >&2
106 exit 1;;
107 1) ;;
108 *) echo "$me: too many arguments$help" >&2
109 exit 1;;
110 esac
111
112 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
113 # Here we must recognize all the valid KERNEL-OS combinations.
114 maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
115 case $maybe_os in
116 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
117 linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
118 knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
119 kopensolaris*-gnu* | cloudabi*-eabi* | \
120 storm-chaos* | os2-emx* | rtmk-nova*)
121 os=-$maybe_os
122 basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
123 ;;
124 android-linux)
125 os=-linux-android
126 basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
127 ;;
128 *)
129 basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
130 if [ "$basic_machine" != "$1" ]
131 then os=`echo "$1" | sed 's/.*-/-/'`
132 else os=; fi
133 ;;
134 esac
135
136 ### Let's recognize common machines as not being operating systems so
137 ### that things like config.sub decstation-3100 work. We also
138 ### recognize some manufacturers as not being operating systems, so we
139 ### can provide default operating systems below.
140 case $os in
141 -sun*os*)
142 # Prevent following clause from handling this invalid input.
143 ;;
144 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
145 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
146 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
147 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
148 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
149 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
150 -apple | -axis | -knuth | -cray | -microblaze*)
151 os=
152 basic_machine=$1
153 ;;
154 -bluegene*)
155 os=-cnk
156 ;;
157 -sim | -cisco | -oki | -wec | -winbond)
158 os=
159 basic_machine=$1
160 ;;
161 -scout)
162 ;;
163 -wrs)
164 os=-vxworks
165 basic_machine=$1
166 ;;
167 -chorusos*)
168 os=-chorusos
169 basic_machine=$1
170 ;;
171 -chorusrdb)
172 os=-chorusrdb
173 basic_machine=$1
174 ;;
175 -hiux*)
176 os=-hiuxwe2
177 ;;
178 -sco6)
179 os=-sco5v6
180 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
181 ;;
182 -sco5)
183 os=-sco3.2v5
184 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
185 ;;
186 -sco4)
187 os=-sco3.2v4
188 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
189 ;;
190 -sco3.2.[4-9]*)
191 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
192 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
193 ;;
194 -sco3.2v[4-9]*)
195 # Don't forget version if it is 3.2v4 or newer.
196 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
197 ;;
198 -sco5v6*)
199 # Don't forget version if it is 3.2v4 or newer.
200 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
201 ;;
202 -sco*)
203 os=-sco3.2v2
204 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
205 ;;
206 -udk*)
207 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
208 ;;
209 -isc)
210 os=-isc2.2
211 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
212 ;;
213 -clix*)
214 basic_machine=clipper-intergraph
215 ;;
216 -isc*)
217 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
218 ;;
219 -lynx*178)
220 os=-lynxos178
221 ;;
222 -lynx*5)
223 os=-lynxos5
224 ;;
225 -lynx*)
226 os=-lynxos
227 ;;
228 -ptx*)
229 basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
230 ;;
231 -psos*)
232 os=-psos
233 ;;
234 -mint | -mint[0-9]*)
235 basic_machine=m68k-atari
236 os=-mint
237 ;;
238 esac
239
240 # Decode aliases for certain CPU-COMPANY combinations.
241 case $basic_machine in
242 # Recognize the basic CPU types without company name.
243 # Some are omitted here because they have special meanings below.
244 1750a | 580 \
245 | a29k \
246 | aarch64 | aarch64_be \
247 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
248 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
249 | am33_2.0 \
250 | arc | arceb \
251 | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
252 | avr | avr32 \
253 | ba \
254 | be32 | be64 \
255 | bfin \
256 | c4x | c8051 | clipper \
257 | d10v | d30v | dlx | dsp16xx \
258 | e2k | epiphany \
259 | fido | fr30 | frv | ft32 \
260 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
261 | hexagon \
262 | i370 | i860 | i960 | ia16 | ia64 \
263 | ip2k | iq2000 \
264 | k1om \
265 | le32 | le64 \
266 | lm32 \
267 | m32c | m32r | m32rle | m68000 | m68k | m88k \
268 | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
269 | mips | mipsbe | mipseb | mipsel | mipsle \
270 | mips16 \
271 | mips64 | mips64el \
272 | mips64octeon | mips64octeonel \
273 | mips64orion | mips64orionel \
274 | mips64r5900 | mips64r5900el \
275 | mips64vr | mips64vrel \
276 | mips64vr4100 | mips64vr4100el \
277 | mips64vr4300 | mips64vr4300el \
278 | mips64vr5000 | mips64vr5000el \
279 | mips64vr5900 | mips64vr5900el \
280 | mipsisa32 | mipsisa32el \
281 | mipsisa32r2 | mipsisa32r2el \
282 | mipsisa32r6 | mipsisa32r6el \
283 | mipsisa64 | mipsisa64el \
284 | mipsisa64r2 | mipsisa64r2el \
285 | mipsisa64r6 | mipsisa64r6el \
286 | mipsisa64sb1 | mipsisa64sb1el \
287 | mipsisa64sr71k | mipsisa64sr71kel \
288 | mipsr5900 | mipsr5900el \
289 | mipstx39 | mipstx39el \
290 | mn10200 | mn10300 \
291 | moxie \
292 | mt \
293 | msp430 \
294 | nds32 | nds32le | nds32be \
295 | nios | nios2 | nios2eb | nios2el \
296 | ns16k | ns32k \
297 | open8 | or1k | or1knd | or32 \
298 | pdp10 | pj | pjl \
299 | powerpc | powerpc64 | powerpc64le | powerpcle \
300 | pru \
301 | pyramid \
302 | riscv32 | riscv64 \
303 | rl78 | rx \
304 | score \
305 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
306 | sh64 | sh64le \
307 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
308 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
309 | spu \
310 | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
311 | ubicom32 \
312 | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
313 | visium \
314 | wasm32 \
315 | x86 | xc16x | xstormy16 | xtensa \
316 | z8k | z80)
317 basic_machine=$basic_machine-unknown
318 ;;
319 c54x)
320 basic_machine=tic54x-unknown
321 ;;
322 c55x)
323 basic_machine=tic55x-unknown
324 ;;
325 c6x)
326 basic_machine=tic6x-unknown
327 ;;
328 leon|leon[3-9])
329 basic_machine=sparc-$basic_machine
330 ;;
331 m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
332 basic_machine=$basic_machine-unknown
333 os=-none
334 ;;
335 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
336 ;;
337 ms1)
338 basic_machine=mt-unknown
339 ;;
340
341 strongarm | thumb | xscale)
342 basic_machine=arm-unknown
343 ;;
344 xgate)
345 basic_machine=$basic_machine-unknown
346 os=-none
347 ;;
348 xscaleeb)
349 basic_machine=armeb-unknown
350 ;;
351
352 xscaleel)
353 basic_machine=armel-unknown
354 ;;
355
356 # We use `pc' rather than `unknown'
357 # because (1) that's what they normally are, and
358 # (2) the word "unknown" tends to confuse beginning users.
359 i*86 | x86_64)
360 basic_machine=$basic_machine-pc
361 ;;
362 # Object if more than one company name word.
363 *-*-*)
364 echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
365 exit 1
366 ;;
367 # Recognize the basic CPU types with company name.
368 580-* \
369 | a29k-* \
370 | aarch64-* | aarch64_be-* \
371 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
372 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
373 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
374 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
375 | avr-* | avr32-* \
376 | ba-* \
377 | be32-* | be64-* \
378 | bfin-* | bs2000-* \
379 | c[123]* | c30-* | [cjt]90-* | c4x-* \
380 | c8051-* | clipper-* | craynv-* | cydra-* \
381 | d10v-* | d30v-* | dlx-* \
382 | e2k-* | elxsi-* \
383 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
384 | h8300-* | h8500-* \
385 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
386 | hexagon-* \
387 | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
388 | ip2k-* | iq2000-* \
389 | k1om-* \
390 | le32-* | le64-* \
391 | lm32-* \
392 | m32c-* | m32r-* | m32rle-* \
393 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
394 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
395 | microblaze-* | microblazeel-* \
396 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
397 | mips16-* \
398 | mips64-* | mips64el-* \
399 | mips64octeon-* | mips64octeonel-* \
400 | mips64orion-* | mips64orionel-* \
401 | mips64r5900-* | mips64r5900el-* \
402 | mips64vr-* | mips64vrel-* \
403 | mips64vr4100-* | mips64vr4100el-* \
404 | mips64vr4300-* | mips64vr4300el-* \
405 | mips64vr5000-* | mips64vr5000el-* \
406 | mips64vr5900-* | mips64vr5900el-* \
407 | mipsisa32-* | mipsisa32el-* \
408 | mipsisa32r2-* | mipsisa32r2el-* \
409 | mipsisa32r6-* | mipsisa32r6el-* \
410 | mipsisa64-* | mipsisa64el-* \
411 | mipsisa64r2-* | mipsisa64r2el-* \
412 | mipsisa64r6-* | mipsisa64r6el-* \
413 | mipsisa64sb1-* | mipsisa64sb1el-* \
414 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
415 | mipsr5900-* | mipsr5900el-* \
416 | mipstx39-* | mipstx39el-* \
417 | mmix-* \
418 | mt-* \
419 | msp430-* \
420 | nds32-* | nds32le-* | nds32be-* \
421 | nios-* | nios2-* | nios2eb-* | nios2el-* \
422 | none-* | np1-* | ns16k-* | ns32k-* \
423 | open8-* \
424 | or1k*-* \
425 | orion-* \
426 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
427 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
428 | pru-* \
429 | pyramid-* \
430 | riscv32-* | riscv64-* \
431 | rl78-* | romp-* | rs6000-* | rx-* \
432 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
433 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
434 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
435 | sparclite-* \
436 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
437 | tahoe-* \
438 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
439 | tile*-* \
440 | tron-* \
441 | ubicom32-* \
442 | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
443 | vax-* \
444 | visium-* \
445 | wasm32-* \
446 | we32k-* \
447 | x86-* | x86_64-* | xc16x-* | xps100-* \
448 | xstormy16-* | xtensa*-* \
449 | ymp-* \
450 | z8k-* | z80-*)
451 ;;
452 # Recognize the basic CPU types without company name, with glob match.
453 xtensa*)
454 basic_machine=$basic_machine-unknown
455 ;;
456 # Recognize the various machine names and aliases which stand
457 # for a CPU type and a company and sometimes even an OS.
458 386bsd)
459 basic_machine=i386-pc
460 os=-bsd
461 ;;
462 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
463 basic_machine=m68000-att
464 ;;
465 3b*)
466 basic_machine=we32k-att
467 ;;
468 a29khif)
469 basic_machine=a29k-amd
470 os=-udi
471 ;;
472 abacus)
473 basic_machine=abacus-unknown
474 ;;
475 adobe68k)
476 basic_machine=m68010-adobe
477 os=-scout
478 ;;
479 alliant | fx80)
480 basic_machine=fx80-alliant
481 ;;
482 altos | altos3068)
483 basic_machine=m68k-altos
484 ;;
485 am29k)
486 basic_machine=a29k-none
487 os=-bsd
488 ;;
489 amd64)
490 basic_machine=x86_64-pc
491 ;;
492 amd64-*)
493 basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
494 ;;
495 amdahl)
496 basic_machine=580-amdahl
497 os=-sysv
498 ;;
499 amiga | amiga-*)
500 basic_machine=m68k-unknown
501 ;;
502 amigaos | amigados)
503 basic_machine=m68k-unknown
504 os=-amigaos
505 ;;
506 amigaunix | amix)
507 basic_machine=m68k-unknown
508 os=-sysv4
509 ;;
510 apollo68)
511 basic_machine=m68k-apollo
512 os=-sysv
513 ;;
514 apollo68bsd)
515 basic_machine=m68k-apollo
516 os=-bsd
517 ;;
518 aros)
519 basic_machine=i386-pc
520 os=-aros
521 ;;
522 asmjs)
523 basic_machine=asmjs-unknown
524 ;;
525 aux)
526 basic_machine=m68k-apple
527 os=-aux
528 ;;
529 balance)
530 basic_machine=ns32k-sequent
531 os=-dynix
532 ;;
533 blackfin)
534 basic_machine=bfin-unknown
535 os=-linux
536 ;;
537 blackfin-*)
538 basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
539 os=-linux
540 ;;
541 bluegene*)
542 basic_machine=powerpc-ibm
543 os=-cnk
544 ;;
545 c54x-*)
546 basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
547 ;;
548 c55x-*)
549 basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
550 ;;
551 c6x-*)
552 basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
553 ;;
554 c90)
555 basic_machine=c90-cray
556 os=-unicos
557 ;;
558 cegcc)
559 basic_machine=arm-unknown
560 os=-cegcc
561 ;;
562 convex-c1)
563 basic_machine=c1-convex
564 os=-bsd
565 ;;
566 convex-c2)
567 basic_machine=c2-convex
568 os=-bsd
569 ;;
570 convex-c32)
571 basic_machine=c32-convex
572 os=-bsd
573 ;;
574 convex-c34)
575 basic_machine=c34-convex
576 os=-bsd
577 ;;
578 convex-c38)
579 basic_machine=c38-convex
580 os=-bsd
581 ;;
582 cray | j90)
583 basic_machine=j90-cray
584 os=-unicos
585 ;;
586 craynv)
587 basic_machine=craynv-cray
588 os=-unicosmp
589 ;;
590 cr16 | cr16-*)
591 basic_machine=cr16-unknown
592 os=-elf
593 ;;
594 crds | unos)
595 basic_machine=m68k-crds
596 ;;
597 crisv32 | crisv32-* | etraxfs*)
598 basic_machine=crisv32-axis
599 ;;
600 cris | cris-* | etrax*)
601 basic_machine=cris-axis
602 ;;
603 crx)
604 basic_machine=crx-unknown
605 os=-elf
606 ;;
607 da30 | da30-*)
608 basic_machine=m68k-da30
609 ;;
610 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
611 basic_machine=mips-dec
612 ;;
613 decsystem10* | dec10*)
614 basic_machine=pdp10-dec
615 os=-tops10
616 ;;
617 decsystem20* | dec20*)
618 basic_machine=pdp10-dec
619 os=-tops20
620 ;;
621 delta | 3300 | motorola-3300 | motorola-delta \
622 | 3300-motorola | delta-motorola)
623 basic_machine=m68k-motorola
624 ;;
625 delta88)
626 basic_machine=m88k-motorola
627 os=-sysv3
628 ;;
629 dicos)
630 basic_machine=i686-pc
631 os=-dicos
632 ;;
633 djgpp)
634 basic_machine=i586-pc
635 os=-msdosdjgpp
636 ;;
637 dpx20 | dpx20-*)
638 basic_machine=rs6000-bull
639 os=-bosx
640 ;;
641 dpx2*)
642 basic_machine=m68k-bull
643 os=-sysv3
644 ;;
645 e500v[12])
646 basic_machine=powerpc-unknown
647 os=$os"spe"
648 ;;
649 e500v[12]-*)
650 basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
651 os=$os"spe"
652 ;;
653 ebmon29k)
654 basic_machine=a29k-amd
655 os=-ebmon
656 ;;
657 elxsi)
658 basic_machine=elxsi-elxsi
659 os=-bsd
660 ;;
661 encore | umax | mmax)
662 basic_machine=ns32k-encore
663 ;;
664 es1800 | OSE68k | ose68k | ose | OSE)
665 basic_machine=m68k-ericsson
666 os=-ose
667 ;;
668 fx2800)
669 basic_machine=i860-alliant
670 ;;
671 genix)
672 basic_machine=ns32k-ns
673 ;;
674 gmicro)
675 basic_machine=tron-gmicro
676 os=-sysv
677 ;;
678 go32)
679 basic_machine=i386-pc
680 os=-go32
681 ;;
682 h3050r* | hiux*)
683 basic_machine=hppa1.1-hitachi
684 os=-hiuxwe2
685 ;;
686 h8300hms)
687 basic_machine=h8300-hitachi
688 os=-hms
689 ;;
690 h8300xray)
691 basic_machine=h8300-hitachi
692 os=-xray
693 ;;
694 h8500hms)
695 basic_machine=h8500-hitachi
696 os=-hms
697 ;;
698 harris)
699 basic_machine=m88k-harris
700 os=-sysv3
701 ;;
702 hp300-*)
703 basic_machine=m68k-hp
704 ;;
705 hp300bsd)
706 basic_machine=m68k-hp
707 os=-bsd
708 ;;
709 hp300hpux)
710 basic_machine=m68k-hp
711 os=-hpux
712 ;;
713 hp3k9[0-9][0-9] | hp9[0-9][0-9])
714 basic_machine=hppa1.0-hp
715 ;;
716 hp9k2[0-9][0-9] | hp9k31[0-9])
717 basic_machine=m68000-hp
718 ;;
719 hp9k3[2-9][0-9])
720 basic_machine=m68k-hp
721 ;;
722 hp9k6[0-9][0-9] | hp6[0-9][0-9])
723 basic_machine=hppa1.0-hp
724 ;;
725 hp9k7[0-79][0-9] | hp7[0-79][0-9])
726 basic_machine=hppa1.1-hp
727 ;;
728 hp9k78[0-9] | hp78[0-9])
729 # FIXME: really hppa2.0-hp
730 basic_machine=hppa1.1-hp
731 ;;
732 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
733 # FIXME: really hppa2.0-hp
734 basic_machine=hppa1.1-hp
735 ;;
736 hp9k8[0-9][13679] | hp8[0-9][13679])
737 basic_machine=hppa1.1-hp
738 ;;
739 hp9k8[0-9][0-9] | hp8[0-9][0-9])
740 basic_machine=hppa1.0-hp
741 ;;
742 hppaosf)
743 basic_machine=hppa1.1-hp
744 os=-osf
745 ;;
746 hppro)
747 basic_machine=hppa1.1-hp
748 os=-proelf
749 ;;
750 i370-ibm* | ibm*)
751 basic_machine=i370-ibm
752 ;;
753 i*86v32)
754 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
755 os=-sysv32
756 ;;
757 i*86v4*)
758 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
759 os=-sysv4
760 ;;
761 i*86v)
762 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
763 os=-sysv
764 ;;
765 i*86sol2)
766 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
767 os=-solaris2
768 ;;
769 i386mach)
770 basic_machine=i386-mach
771 os=-mach
772 ;;
773 vsta)
774 basic_machine=i386-unknown
775 os=-vsta
776 ;;
777 iris | iris4d)
778 basic_machine=mips-sgi
779 case $os in
780 -irix*)
781 ;;
782 *)
783 os=-irix4
784 ;;
785 esac
786 ;;
787 isi68 | isi)
788 basic_machine=m68k-isi
789 os=-sysv
790 ;;
791 leon-*|leon[3-9]-*)
792 basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
793 ;;
794 m68knommu)
795 basic_machine=m68k-unknown
796 os=-linux
797 ;;
798 m68knommu-*)
799 basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
800 os=-linux
801 ;;
802 magnum | m3230)
803 basic_machine=mips-mips
804 os=-sysv
805 ;;
806 merlin)
807 basic_machine=ns32k-utek
808 os=-sysv
809 ;;
810 microblaze*)
811 basic_machine=microblaze-xilinx
812 ;;
813 mingw64)
814 basic_machine=x86_64-pc
815 os=-mingw64
816 ;;
817 mingw32)
818 basic_machine=i686-pc
819 os=-mingw32
820 ;;
821 mingw32ce)
822 basic_machine=arm-unknown
823 os=-mingw32ce
824 ;;
825 miniframe)
826 basic_machine=m68000-convergent
827 ;;
828 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
829 basic_machine=m68k-atari
830 os=-mint
831 ;;
832 mips3*-*)
833 basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
834 ;;
835 mips3*)
836 basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
837 ;;
838 monitor)
839 basic_machine=m68k-rom68k
840 os=-coff
841 ;;
842 morphos)
843 basic_machine=powerpc-unknown
844 os=-morphos
845 ;;
846 moxiebox)
847 basic_machine=moxie-unknown
848 os=-moxiebox
849 ;;
850 msdos)
851 basic_machine=i386-pc
852 os=-msdos
853 ;;
854 ms1-*)
855 basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
856 ;;
857 msys)
858 basic_machine=i686-pc
859 os=-msys
860 ;;
861 mvs)
862 basic_machine=i370-ibm
863 os=-mvs
864 ;;
865 nacl)
866 basic_machine=le32-unknown
867 os=-nacl
868 ;;
869 ncr3000)
870 basic_machine=i486-ncr
871 os=-sysv4
872 ;;
873 netbsd386)
874 basic_machine=i386-unknown
875 os=-netbsd
876 ;;
877 netwinder)
878 basic_machine=armv4l-rebel
879 os=-linux
880 ;;
881 news | news700 | news800 | news900)
882 basic_machine=m68k-sony
883 os=-newsos
884 ;;
885 news1000)
886 basic_machine=m68030-sony
887 os=-newsos
888 ;;
889 news-3600 | risc-news)
890 basic_machine=mips-sony
891 os=-newsos
892 ;;
893 necv70)
894 basic_machine=v70-nec
895 os=-sysv
896 ;;
897 next | m*-next)
898 basic_machine=m68k-next
899 case $os in
900 -nextstep* )
901 ;;
902 -ns2*)
903 os=-nextstep2
904 ;;
905 *)
906 os=-nextstep3
907 ;;
908 esac
909 ;;
910 nh3000)
911 basic_machine=m68k-harris
912 os=-cxux
913 ;;
914 nh[45]000)
915 basic_machine=m88k-harris
916 os=-cxux
917 ;;
918 nindy960)
919 basic_machine=i960-intel
920 os=-nindy
921 ;;
922 mon960)
923 basic_machine=i960-intel
924 os=-mon960
925 ;;
926 nonstopux)
927 basic_machine=mips-compaq
928 os=-nonstopux
929 ;;
930 np1)
931 basic_machine=np1-gould
932 ;;
933 neo-tandem)
934 basic_machine=neo-tandem
935 ;;
936 nse-tandem)
937 basic_machine=nse-tandem
938 ;;
939 nsr-tandem)
940 basic_machine=nsr-tandem
941 ;;
942 nsv-tandem)
943 basic_machine=nsv-tandem
944 ;;
945 nsx-tandem)
946 basic_machine=nsx-tandem
947 ;;
948 op50n-* | op60c-*)
949 basic_machine=hppa1.1-oki
950 os=-proelf
951 ;;
952 openrisc | openrisc-*)
953 basic_machine=or32-unknown
954 ;;
955 os400)
956 basic_machine=powerpc-ibm
957 os=-os400
958 ;;
959 OSE68000 | ose68000)
960 basic_machine=m68000-ericsson
961 os=-ose
962 ;;
963 os68k)
964 basic_machine=m68k-none
965 os=-os68k
966 ;;
967 pa-hitachi)
968 basic_machine=hppa1.1-hitachi
969 os=-hiuxwe2
970 ;;
971 paragon)
972 basic_machine=i860-intel
973 os=-osf
974 ;;
975 parisc)
976 basic_machine=hppa-unknown
977 os=-linux
978 ;;
979 parisc-*)
980 basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
981 os=-linux
982 ;;
983 pbd)
984 basic_machine=sparc-tti
985 ;;
986 pbb)
987 basic_machine=m68k-tti
988 ;;
989 pc532 | pc532-*)
990 basic_machine=ns32k-pc532
991 ;;
992 pc98)
993 basic_machine=i386-pc
994 ;;
995 pc98-*)
996 basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
997 ;;
998 pentium | p5 | k5 | k6 | nexgen | viac3)
999 basic_machine=i586-pc
1000 ;;
1001 pentiumpro | p6 | 6x86 | athlon | athlon_*)
1002 basic_machine=i686-pc
1003 ;;
1004 pentiumii | pentium2 | pentiumiii | pentium3)
1005 basic_machine=i686-pc
1006 ;;
1007 pentium4)
1008 basic_machine=i786-pc
1009 ;;
1010 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
1011 basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1012 ;;
1013 pentiumpro-* | p6-* | 6x86-* | athlon-*)
1014 basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1015 ;;
1016 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
1017 basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1018 ;;
1019 pentium4-*)
1020 basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1021 ;;
1022 pn)
1023 basic_machine=pn-gould
1024 ;;
1025 power) basic_machine=power-ibm
1026 ;;
1027 ppc | ppcbe) basic_machine=powerpc-unknown
1028 ;;
1029 ppc-* | ppcbe-*)
1030 basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1031 ;;
1032 ppcle | powerpclittle)
1033 basic_machine=powerpcle-unknown
1034 ;;
1035 ppcle-* | powerpclittle-*)
1036 basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1037 ;;
1038 ppc64) basic_machine=powerpc64-unknown
1039 ;;
1040 ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1041 ;;
1042 ppc64le | powerpc64little)
1043 basic_machine=powerpc64le-unknown
1044 ;;
1045 ppc64le-* | powerpc64little-*)
1046 basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1047 ;;
1048 ps2)
1049 basic_machine=i386-ibm
1050 ;;
1051 pw32)
1052 basic_machine=i586-unknown
1053 os=-pw32
1054 ;;
1055 rdos | rdos64)
1056 basic_machine=x86_64-pc
1057 os=-rdos
1058 ;;
1059 rdos32)
1060 basic_machine=i386-pc
1061 os=-rdos
1062 ;;
1063 rom68k)
1064 basic_machine=m68k-rom68k
1065 os=-coff
1066 ;;
1067 rm[46]00)
1068 basic_machine=mips-siemens
1069 ;;
1070 rtpc | rtpc-*)
1071 basic_machine=romp-ibm
1072 ;;
1073 s390 | s390-*)
1074 basic_machine=s390-ibm
1075 ;;
1076 s390x | s390x-*)
1077 basic_machine=s390x-ibm
1078 ;;
1079 sa29200)
1080 basic_machine=a29k-amd
1081 os=-udi
1082 ;;
1083 sb1)
1084 basic_machine=mipsisa64sb1-unknown
1085 ;;
1086 sb1el)
1087 basic_machine=mipsisa64sb1el-unknown
1088 ;;
1089 sde)
1090 basic_machine=mipsisa32-sde
1091 os=-elf
1092 ;;
1093 sei)
1094 basic_machine=mips-sei
1095 os=-seiux
1096 ;;
1097 sequent)
1098 basic_machine=i386-sequent
1099 ;;
1100 sh5el)
1101 basic_machine=sh5le-unknown
1102 ;;
1103 simso-wrs)
1104 basic_machine=sparclite-wrs
1105 os=-vxworks
1106 ;;
1107 sps7)
1108 basic_machine=m68k-bull
1109 os=-sysv2
1110 ;;
1111 spur)
1112 basic_machine=spur-unknown
1113 ;;
1114 st2000)
1115 basic_machine=m68k-tandem
1116 ;;
1117 stratus)
1118 basic_machine=i860-stratus
1119 os=-sysv4
1120 ;;
1121 strongarm-* | thumb-*)
1122 basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1123 ;;
1124 sun2)
1125 basic_machine=m68000-sun
1126 ;;
1127 sun2os3)
1128 basic_machine=m68000-sun
1129 os=-sunos3
1130 ;;
1131 sun2os4)
1132 basic_machine=m68000-sun
1133 os=-sunos4
1134 ;;
1135 sun3os3)
1136 basic_machine=m68k-sun
1137 os=-sunos3
1138 ;;
1139 sun3os4)
1140 basic_machine=m68k-sun
1141 os=-sunos4
1142 ;;
1143 sun4os3)
1144 basic_machine=sparc-sun
1145 os=-sunos3
1146 ;;
1147 sun4os4)
1148 basic_machine=sparc-sun
1149 os=-sunos4
1150 ;;
1151 sun4sol2)
1152 basic_machine=sparc-sun
1153 os=-solaris2
1154 ;;
1155 sun3 | sun3-*)
1156 basic_machine=m68k-sun
1157 ;;
1158 sun4)
1159 basic_machine=sparc-sun
1160 ;;
1161 sun386 | sun386i | roadrunner)
1162 basic_machine=i386-sun
1163 ;;
1164 sv1)
1165 basic_machine=sv1-cray
1166 os=-unicos
1167 ;;
1168 symmetry)
1169 basic_machine=i386-sequent
1170 os=-dynix
1171 ;;
1172 t3e)
1173 basic_machine=alphaev5-cray
1174 os=-unicos
1175 ;;
1176 t90)
1177 basic_machine=t90-cray
1178 os=-unicos
1179 ;;
1180 tile*)
1181 basic_machine=$basic_machine-unknown
1182 os=-linux-gnu
1183 ;;
1184 tx39)
1185 basic_machine=mipstx39-unknown
1186 ;;
1187 tx39el)
1188 basic_machine=mipstx39el-unknown
1189 ;;
1190 toad1)
1191 basic_machine=pdp10-xkl
1192 os=-tops20
1193 ;;
1194 tower | tower-32)
1195 basic_machine=m68k-ncr
1196 ;;
1197 tpf)
1198 basic_machine=s390x-ibm
1199 os=-tpf
1200 ;;
1201 udi29k)
1202 basic_machine=a29k-amd
1203 os=-udi
1204 ;;
1205 ultra3)
1206 basic_machine=a29k-nyu
1207 os=-sym1
1208 ;;
1209 v810 | necv810)
1210 basic_machine=v810-nec
1211 os=-none
1212 ;;
1213 vaxv)
1214 basic_machine=vax-dec
1215 os=-sysv
1216 ;;
1217 vms)
1218 basic_machine=vax-dec
1219 os=-vms
1220 ;;
1221 vpp*|vx|vx-*)
1222 basic_machine=f301-fujitsu
1223 ;;
1224 vxworks960)
1225 basic_machine=i960-wrs
1226 os=-vxworks
1227 ;;
1228 vxworks68)
1229 basic_machine=m68k-wrs
1230 os=-vxworks
1231 ;;
1232 vxworks29k)
1233 basic_machine=a29k-wrs
1234 os=-vxworks
1235 ;;
1236 w65*)
1237 basic_machine=w65-wdc
1238 os=-none
1239 ;;
1240 w89k-*)
1241 basic_machine=hppa1.1-winbond
1242 os=-proelf
1243 ;;
1244 x64)
1245 basic_machine=x86_64-pc
1246 ;;
1247 xbox)
1248 basic_machine=i686-pc
1249 os=-mingw32
1250 ;;
1251 xps | xps100)
1252 basic_machine=xps100-honeywell
1253 ;;
1254 xscale-* | xscalee[bl]-*)
1255 basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
1256 ;;
1257 ymp)
1258 basic_machine=ymp-cray
1259 os=-unicos
1260 ;;
1261 none)
1262 basic_machine=none-none
1263 os=-none
1264 ;;
1265
1266 # Here we handle the default manufacturer of certain CPU types. It is in
1267 # some cases the only manufacturer, in others, it is the most popular.
1268 w89k)
1269 basic_machine=hppa1.1-winbond
1270 ;;
1271 op50n)
1272 basic_machine=hppa1.1-oki
1273 ;;
1274 op60c)
1275 basic_machine=hppa1.1-oki
1276 ;;
1277 romp)
1278 basic_machine=romp-ibm
1279 ;;
1280 mmix)
1281 basic_machine=mmix-knuth
1282 ;;
1283 rs6000)
1284 basic_machine=rs6000-ibm
1285 ;;
1286 vax)
1287 basic_machine=vax-dec
1288 ;;
1289 pdp11)
1290 basic_machine=pdp11-dec
1291 ;;
1292 we32k)
1293 basic_machine=we32k-att
1294 ;;
1295 sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1296 basic_machine=sh-unknown
1297 ;;
1298 cydra)
1299 basic_machine=cydra-cydrome
1300 ;;
1301 orion)
1302 basic_machine=orion-highlevel
1303 ;;
1304 orion105)
1305 basic_machine=clipper-highlevel
1306 ;;
1307 mac | mpw | mac-mpw)
1308 basic_machine=m68k-apple
1309 ;;
1310 pmac | pmac-mpw)
1311 basic_machine=powerpc-apple
1312 ;;
1313 *-unknown)
1314 # Make sure to match an already-canonicalized machine name.
1315 ;;
1316 *)
1317 echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
1318 exit 1
1319 ;;
1320 esac
1321
1322 # Here we canonicalize certain aliases for manufacturers.
1323 case $basic_machine in
1324 *-digital*)
1325 basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
1326 ;;
1327 *-commodore*)
1328 basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
1329 ;;
1330 *)
1331 ;;
1332 esac
1333
1334 # Decode manufacturer-specific aliases for certain operating systems.
1335
1336 if [ x"$os" != x"" ]
1337 then
1338 case $os in
1339 # First match some system type aliases that might get confused
1340 # with valid system types.
1341 # -solaris* is a basic system type, with this one exception.
1342 -auroraux)
1343 os=-auroraux
1344 ;;
1345 -solaris1 | -solaris1.*)
1346 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1347 ;;
1348 -solaris)
1349 os=-solaris2
1350 ;;
1351 -unixware*)
1352 os=-sysv4.2uw
1353 ;;
1354 -gnu/linux*)
1355 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1356 ;;
1357 # es1800 is here to avoid being matched by es* (a different OS)
1358 -es1800*)
1359 os=-ose
1360 ;;
1361 # Now accept the basic system types.
1362 # The portable systems comes first.
1363 # Each alternative MUST end in a * to match a version number.
1364 # -sysv* is not here because it comes later, after sysvr4.
1365 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1366 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1367 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1368 | -sym* | -kopensolaris* | -plan9* \
1369 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1370 | -aos* | -aros* | -cloudabi* | -sortix* \
1371 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1372 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1373 | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
1374 | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
1375 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1376 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1377 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1378 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1379 | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
1380 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1381 | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
1382 | -linux-newlib* | -linux-musl* | -linux-uclibc* \
1383 | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
1384 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
1385 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1386 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1387 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1388 | -morphos* | -superux* | -rtmk* | -windiss* \
1389 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1390 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
1391 | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
1392 | -midnightbsd*)
1393 # Remember, each alternative MUST END IN *, to match a version number.
1394 ;;
1395 -qnx*)
1396 case $basic_machine in
1397 x86-* | i*86-*)
1398 ;;
1399 *)
1400 os=-nto$os
1401 ;;
1402 esac
1403 ;;
1404 -nto-qnx*)
1405 ;;
1406 -nto*)
1407 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1408 ;;
1409 -sim | -xray | -os68k* | -v88r* \
1410 | -windows* | -osx | -abug | -netware* | -os9* \
1411 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1412 ;;
1413 -mac*)
1414 os=`echo "$os" | sed -e 's|mac|macos|'`
1415 ;;
1416 -linux-dietlibc)
1417 os=-linux-dietlibc
1418 ;;
1419 -linux*)
1420 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1421 ;;
1422 -sunos5*)
1423 os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
1424 ;;
1425 -sunos6*)
1426 os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
1427 ;;
1428 -opened*)
1429 os=-openedition
1430 ;;
1431 -os400*)
1432 os=-os400
1433 ;;
1434 -wince*)
1435 os=-wince
1436 ;;
1437 -utek*)
1438 os=-bsd
1439 ;;
1440 -dynix*)
1441 os=-bsd
1442 ;;
1443 -acis*)
1444 os=-aos
1445 ;;
1446 -atheos*)
1447 os=-atheos
1448 ;;
1449 -syllable*)
1450 os=-syllable
1451 ;;
1452 -386bsd)
1453 os=-bsd
1454 ;;
1455 -ctix* | -uts*)
1456 os=-sysv
1457 ;;
1458 -nova*)
1459 os=-rtmk-nova
1460 ;;
1461 -ns2)
1462 os=-nextstep2
1463 ;;
1464 -nsk*)
1465 os=-nsk
1466 ;;
1467 # Preserve the version number of sinix5.
1468 -sinix5.*)
1469 os=`echo $os | sed -e 's|sinix|sysv|'`
1470 ;;
1471 -sinix*)
1472 os=-sysv4
1473 ;;
1474 -tpf*)
1475 os=-tpf
1476 ;;
1477 -triton*)
1478 os=-sysv3
1479 ;;
1480 -oss*)
1481 os=-sysv3
1482 ;;
1483 -svr4*)
1484 os=-sysv4
1485 ;;
1486 -svr3)
1487 os=-sysv3
1488 ;;
1489 -sysvr4)
1490 os=-sysv4
1491 ;;
1492 # This must come after -sysvr4.
1493 -sysv*)
1494 ;;
1495 -ose*)
1496 os=-ose
1497 ;;
1498 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1499 os=-mint
1500 ;;
1501 -zvmoe)
1502 os=-zvmoe
1503 ;;
1504 -dicos*)
1505 os=-dicos
1506 ;;
1507 -pikeos*)
1508 # Until real need of OS specific support for
1509 # particular features comes up, bare metal
1510 # configurations are quite functional.
1511 case $basic_machine in
1512 arm*)
1513 os=-eabi
1514 ;;
1515 *)
1516 os=-elf
1517 ;;
1518 esac
1519 ;;
1520 -nacl*)
1521 ;;
1522 -ios)
1523 ;;
1524 -none)
1525 ;;
1526 *)
1527 # Get rid of the `-' at the beginning of $os.
1528 os=`echo $os | sed 's/[^-]*-//'`
1529 echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
1530 exit 1
1531 ;;
1532 esac
1533 else
1534
1535 # Here we handle the default operating systems that come with various machines.
1536 # The value should be what the vendor currently ships out the door with their
1537 # machine or put another way, the most popular os provided with the machine.
1538
1539 # Note that if you're going to try to match "-MANUFACTURER" here (say,
1540 # "-sun"), then you have to tell the case statement up towards the top
1541 # that MANUFACTURER isn't an operating system. Otherwise, code above
1542 # will signal an error saying that MANUFACTURER isn't an operating
1543 # system, and we'll never get to this point.
1544
1545 case $basic_machine in
1546 score-*)
1547 os=-elf
1548 ;;
1549 spu-*)
1550 os=-elf
1551 ;;
1552 *-acorn)
1553 os=-riscix1.2
1554 ;;
1555 arm*-rebel)
1556 os=-linux
1557 ;;
1558 arm*-semi)
1559 os=-aout
1560 ;;
1561 c4x-* | tic4x-*)
1562 os=-coff
1563 ;;
1564 c8051-*)
1565 os=-elf
1566 ;;
1567 hexagon-*)
1568 os=-elf
1569 ;;
1570 tic54x-*)
1571 os=-coff
1572 ;;
1573 tic55x-*)
1574 os=-coff
1575 ;;
1576 tic6x-*)
1577 os=-coff
1578 ;;
1579 # This must come before the *-dec entry.
1580 pdp10-*)
1581 os=-tops20
1582 ;;
1583 pdp11-*)
1584 os=-none
1585 ;;
1586 *-dec | vax-*)
1587 os=-ultrix4.2
1588 ;;
1589 m68*-apollo)
1590 os=-domain
1591 ;;
1592 i386-sun)
1593 os=-sunos4.0.2
1594 ;;
1595 m68000-sun)
1596 os=-sunos3
1597 ;;
1598 m68*-cisco)
1599 os=-aout
1600 ;;
1601 mep-*)
1602 os=-elf
1603 ;;
1604 mips*-cisco)
1605 os=-elf
1606 ;;
1607 mips*-*)
1608 os=-elf
1609 ;;
1610 or32-*)
1611 os=-coff
1612 ;;
1613 *-tti) # must be before sparc entry or we get the wrong os.
1614 os=-sysv3
1615 ;;
1616 sparc-* | *-sun)
1617 os=-sunos4.1.1
1618 ;;
1619 pru-*)
1620 os=-elf
1621 ;;
1622 *-be)
1623 os=-beos
1624 ;;
1625 *-ibm)
1626 os=-aix
1627 ;;
1628 *-knuth)
1629 os=-mmixware
1630 ;;
1631 *-wec)
1632 os=-proelf
1633 ;;
1634 *-winbond)
1635 os=-proelf
1636 ;;
1637 *-oki)
1638 os=-proelf
1639 ;;
1640 *-hp)
1641 os=-hpux
1642 ;;
1643 *-hitachi)
1644 os=-hiux
1645 ;;
1646 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1647 os=-sysv
1648 ;;
1649 *-cbm)
1650 os=-amigaos
1651 ;;
1652 *-dg)
1653 os=-dgux
1654 ;;
1655 *-dolphin)
1656 os=-sysv3
1657 ;;
1658 m68k-ccur)
1659 os=-rtu
1660 ;;
1661 m88k-omron*)
1662 os=-luna
1663 ;;
1664 *-next)
1665 os=-nextstep
1666 ;;
1667 *-sequent)
1668 os=-ptx
1669 ;;
1670 *-crds)
1671 os=-unos
1672 ;;
1673 *-ns)
1674 os=-genix
1675 ;;
1676 i370-*)
1677 os=-mvs
1678 ;;
1679 *-gould)
1680 os=-sysv
1681 ;;
1682 *-highlevel)
1683 os=-bsd
1684 ;;
1685 *-encore)
1686 os=-bsd
1687 ;;
1688 *-sgi)
1689 os=-irix
1690 ;;
1691 *-siemens)
1692 os=-sysv4
1693 ;;
1694 *-masscomp)
1695 os=-rtu
1696 ;;
1697 f30[01]-fujitsu | f700-fujitsu)
1698 os=-uxpv
1699 ;;
1700 *-rom68k)
1701 os=-coff
1702 ;;
1703 *-*bug)
1704 os=-coff
1705 ;;
1706 *-apple)
1707 os=-macos
1708 ;;
1709 *-atari*)
1710 os=-mint
1711 ;;
1712 *)
1713 os=-none
1714 ;;
1715 esac
1716 fi
1717
1718 # Here we handle the case where we know the os, and the CPU type, but not the
1719 # manufacturer. We pick the logical manufacturer.
1720 vendor=unknown
1721 case $basic_machine in
1722 *-unknown)
1723 case $os in
1724 -riscix*)
1725 vendor=acorn
1726 ;;
1727 -sunos*)
1728 vendor=sun
1729 ;;
1730 -cnk*|-aix*)
1731 vendor=ibm
1732 ;;
1733 -beos*)
1734 vendor=be
1735 ;;
1736 -hpux*)
1737 vendor=hp
1738 ;;
1739 -mpeix*)
1740 vendor=hp
1741 ;;
1742 -hiux*)
1743 vendor=hitachi
1744 ;;
1745 -unos*)
1746 vendor=crds
1747 ;;
1748 -dgux*)
1749 vendor=dg
1750 ;;
1751 -luna*)
1752 vendor=omron
1753 ;;
1754 -genix*)
1755 vendor=ns
1756 ;;
1757 -mvs* | -opened*)
1758 vendor=ibm
1759 ;;
1760 -os400*)
1761 vendor=ibm
1762 ;;
1763 -ptx*)
1764 vendor=sequent
1765 ;;
1766 -tpf*)
1767 vendor=ibm
1768 ;;
1769 -vxsim* | -vxworks* | -windiss*)
1770 vendor=wrs
1771 ;;
1772 -aux*)
1773 vendor=apple
1774 ;;
1775 -hms*)
1776 vendor=hitachi
1777 ;;
1778 -mpw* | -macos*)
1779 vendor=apple
1780 ;;
1781 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1782 vendor=atari
1783 ;;
1784 -vos*)
1785 vendor=stratus
1786 ;;
1787 esac
1788 basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
1789 ;;
1790 esac
1791
1792 echo "$basic_machine$os"
1793 exit
1794
1795 # Local variables:
1796 # eval: (add-hook 'write-file-functions 'time-stamp)
1797 # time-stamp-start: "timestamp='"
1798 # time-stamp-format: "%:y-%02m-%02d"
1799 # time-stamp-end: "'"
1800 # End:
+2381
-651
configure less more
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.69 for dosfstools 4.1.
2 # Generated by GNU Autoconf 2.69 for dosfstools 4.2.
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.1'
580 PACKAGE_STRING='dosfstools 4.1'
579 PACKAGE_VERSION='4.2'
580 PACKAGE_STRING='dosfstools 4.2'
581581 PACKAGE_BUGREPORT=''
582582 PACKAGE_URL=''
583583
624624 AUTOMAKE_TEST_COMPAT_FALSE
625625 AUTOMAKE_TEST_COMPAT_TRUE
626626 XXD_FOUND
627 UDEV_LIBS
628 UDEV_CFLAGS
629 PKG_CONFIG_LIBDIR
630 PKG_CONFIG_PATH
631 PKG_CONFIG
627 LTLIBICONV
628 LIBICONV
629 host_os
630 host_vendor
631 host_cpu
632 host
633 build_os
634 build_vendor
635 build_cpu
636 build
637 LN_S
632638 EGREP
633639 GREP
634640 CPP
635 LN_S
636641 am__fastdepCC_FALSE
637642 am__fastdepCC_TRUE
638643 CCDEPMODE
640645 AMDEPBACKSLASH
641646 AMDEP_FALSE
642647 AMDEP_TRUE
643 am__quote
644648 am__include
645649 DEPDIR
646650 OBJEXT
650654 LDFLAGS
651655 CFLAGS
652656 CC
657 CHECKATARI
653658 COMPAT_SYMLINKS_FALSE
654659 COMPAT_SYMLINKS_TRUE
655660 AM_BACKSLASH
718723 PACKAGE_TARNAME
719724 PACKAGE_NAME
720725 PATH_SEPARATOR
721 SHELL'
726 SHELL
727 am__quote'
722728 ac_subst_files=''
723729 ac_user_opts='
724730 enable_option_checking
725731 enable_silent_rules
726732 enable_compat_symlinks
733 enable_atari_check
727734 enable_dependency_tracking
728735 enable_largefile
729 with_udev
736 with_iconv
737 with_gnu_ld
738 enable_rpath
739 with_libiconv_prefix
730740 '
731741 ac_precious_vars='build_alias
732742 host_alias
736746 LDFLAGS
737747 LIBS
738748 CPPFLAGS
739 CPP
740 PKG_CONFIG
741 PKG_CONFIG_PATH
742 PKG_CONFIG_LIBDIR
743 UDEV_CFLAGS
744 UDEV_LIBS'
749 CPP'
745750
746751
747752 # Initialize some variables set by options.
12921297 # Omit some internal or obsolete options to make the list less imposing.
12931298 # This message is too long to be a string in the A/UX 3.1 sh.
12941299 cat <<_ACEOF
1295 \`configure' configures dosfstools 4.1 to adapt to many kinds of systems.
1300 \`configure' configures dosfstools 4.2 to adapt to many kinds of systems.
12961301
12971302 Usage: $0 [OPTION]... [VAR=VALUE]...
12981303
13541359 --program-prefix=PREFIX prepend PREFIX to installed program names
13551360 --program-suffix=SUFFIX append SUFFIX to installed program names
13561361 --program-transform-name=PROGRAM run sed PROGRAM on installed program names
1362
1363 System types:
1364 --build=BUILD configure for building on BUILD [guessed]
1365 --host=HOST cross-compile to build programs to run on HOST [BUILD]
13571366 _ACEOF
13581367 fi
13591368
13601369 if test -n "$ac_init_help"; then
13611370 case $ac_init_help in
1362 short | recursive ) echo "Configuration of dosfstools 4.1:";;
1371 short | recursive ) echo "Configuration of dosfstools 4.2:";;
13631372 esac
13641373 cat <<\_ACEOF
13651374
13711380 --disable-silent-rules verbose build output (undo: "make V=0")
13721381 --enable-compat-symlinks
13731382 install symlinks for legacy names of the tools
1383 --enable-atari-check enable legacy check to let tools switch to Atari
1384 mode when they detect they are running on 68k Atari
1385 hardware (Linux only)
13741386 --enable-dependency-tracking
13751387 do not reject slow dependency extractors
13761388 --disable-dependency-tracking
13771389 speeds up one-time build
13781390 --disable-largefile omit support for large files
1391 --disable-rpath do not hardcode runtime library paths
13791392
13801393 Optional Packages:
13811394 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
13821395 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
1383 --without-udev build without libudev support
1396 --without-iconv build without iconv support
1397 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
1398 --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib
1399 --without-libiconv-prefix don't search for libiconv in includedir and libdir
13841400
13851401 Some influential environment variables:
13861402 CC C compiler command
13911407 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
13921408 you have headers in a nonstandard directory <include dir>
13931409 CPP C preprocessor
1394 PKG_CONFIG path to pkg-config utility
1395 PKG_CONFIG_PATH
1396 directories to add to pkg-config's search path
1397 PKG_CONFIG_LIBDIR
1398 path overriding pkg-config's built-in search path
1399 UDEV_CFLAGS C compiler flags for UDEV, overriding pkg-config
1400 UDEV_LIBS linker flags for UDEV, overriding pkg-config
14011410
14021411 Use these variables to override the choices made by `configure' or to help
14031412 it to find libraries and programs with nonstandard names/locations.
14651474 test -n "$ac_init_help" && exit $ac_status
14661475 if $ac_init_version; then
14671476 cat <<\_ACEOF
1468 dosfstools configure 4.1
1477 dosfstools configure 4.2
14691478 generated by GNU Autoconf 2.69
14701479
14711480 Copyright (C) 2012 Free Software Foundation, Inc.
17131722 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
17141723
17151724 } # ac_fn_c_check_header_compile
1716
1717 # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
1718 # ---------------------------------------------
1719 # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
1720 # accordingly.
1721 ac_fn_c_check_decl ()
1722 {
1723 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1724 as_decl_name=`echo $2|sed 's/ *(.*//'`
1725 as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
1726 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
1727 $as_echo_n "checking whether $as_decl_name is declared... " >&6; }
1728 if eval \${$3+:} false; then :
1729 $as_echo_n "(cached) " >&6
1730 else
1731 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1732 /* end confdefs.h. */
1733 $4
1734 int
1735 main ()
1736 {
1737 #ifndef $as_decl_name
1738 #ifdef __cplusplus
1739 (void) $as_decl_use;
1740 #else
1741 (void) $as_decl_name;
1742 #endif
1743 #endif
1744
1745 ;
1746 return 0;
1747 }
1748 _ACEOF
1749 if ac_fn_c_try_compile "$LINENO"; then :
1750 eval "$3=yes"
1751 else
1752 eval "$3=no"
1753 fi
1754 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1755 fi
1756 eval ac_res=\$$3
1757 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1758 $as_echo "$ac_res" >&6; }
1759 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1760
1761 } # ac_fn_c_check_decl
17621725
17631726 # ac_fn_c_try_link LINENO
17641727 # -----------------------
18051768 as_fn_set_status $ac_retval
18061769
18071770 } # ac_fn_c_try_link
1771
1772 # ac_fn_c_check_func LINENO FUNC VAR
1773 # ----------------------------------
1774 # Tests whether FUNC exists, setting the cache variable VAR accordingly
1775 ac_fn_c_check_func ()
1776 {
1777 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1778 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1779 $as_echo_n "checking for $2... " >&6; }
1780 if eval \${$3+:} false; then :
1781 $as_echo_n "(cached) " >&6
1782 else
1783 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1784 /* end confdefs.h. */
1785 /* Define $2 to an innocuous variant, in case <limits.h> declares $2.
1786 For example, HP-UX 11i <limits.h> declares gettimeofday. */
1787 #define $2 innocuous_$2
1788
1789 /* System header to define __stub macros and hopefully few prototypes,
1790 which can conflict with char $2 (); below.
1791 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
1792 <limits.h> exists even on freestanding compilers. */
1793
1794 #ifdef __STDC__
1795 # include <limits.h>
1796 #else
1797 # include <assert.h>
1798 #endif
1799
1800 #undef $2
1801
1802 /* Override any GCC internal prototype to avoid an error.
1803 Use char because int might match the return type of a GCC
1804 builtin and then its argument prototype would still apply. */
1805 #ifdef __cplusplus
1806 extern "C"
1807 #endif
1808 char $2 ();
1809 /* The GNU C library defines this for functions which it implements
1810 to always fail with ENOSYS. Some functions are actually named
1811 something starting with __ and the normal name is an alias. */
1812 #if defined __stub_$2 || defined __stub___$2
1813 choke me
1814 #endif
1815
1816 int
1817 main ()
1818 {
1819 return $2 ();
1820 ;
1821 return 0;
1822 }
1823 _ACEOF
1824 if ac_fn_c_try_link "$LINENO"; then :
1825 eval "$3=yes"
1826 else
1827 eval "$3=no"
1828 fi
1829 rm -f core conftest.err conftest.$ac_objext \
1830 conftest$ac_exeext conftest.$ac_ext
1831 fi
1832 eval ac_res=\$$3
1833 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1834 $as_echo "$ac_res" >&6; }
1835 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1836
1837 } # ac_fn_c_check_func
1838
1839 # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
1840 # ---------------------------------------------
1841 # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
1842 # accordingly.
1843 ac_fn_c_check_decl ()
1844 {
1845 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1846 as_decl_name=`echo $2|sed 's/ *(.*//'`
1847 as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
1848 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
1849 $as_echo_n "checking whether $as_decl_name is declared... " >&6; }
1850 if eval \${$3+:} false; then :
1851 $as_echo_n "(cached) " >&6
1852 else
1853 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1854 /* end confdefs.h. */
1855 $4
1856 int
1857 main ()
1858 {
1859 #ifndef $as_decl_name
1860 #ifdef __cplusplus
1861 (void) $as_decl_use;
1862 #else
1863 (void) $as_decl_name;
1864 #endif
1865 #endif
1866
1867 ;
1868 return 0;
1869 }
1870 _ACEOF
1871 if ac_fn_c_try_compile "$LINENO"; then :
1872 eval "$3=yes"
1873 else
1874 eval "$3=no"
1875 fi
1876 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1877 fi
1878 eval ac_res=\$$3
1879 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1880 $as_echo "$ac_res" >&6; }
1881 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1882
1883 } # ac_fn_c_check_decl
18081884 cat >config.log <<_ACEOF
18091885 This file contains any messages produced by compilers while
18101886 running configure, to aid debugging if configure makes a mistake.
18111887
1812 It was created by dosfstools $as_me 4.1, which was
1888 It was created by dosfstools $as_me 4.2, which was
18131889 generated by GNU Autoconf 2.69. Invocation command line was
18141890
18151891 $ $0 $@
21572233 ac_compiler_gnu=$ac_cv_c_compiler_gnu
21582234
21592235
2160 RELEASE_DATE=2017-01-24
2161
2162 am__api_version='1.15'
2236 RELEASE_DATE=2021-01-31
2237
2238 am__api_version='1.16'
21632239
21642240 ac_aux_dir=
21652241 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
26742750
26752751 # Define the identity of the package.
26762752 PACKAGE='dosfstools'
2677 VERSION='4.1'
2753 VERSION='4.2'
26782754
26792755
26802756 cat >>confdefs.h <<_ACEOF
27042780
27052781 # For better backward compatibility. To be removed once Automake 1.9.x
27062782 # dies out for good. For more background, see:
2707 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
2708 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
2783 # <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
2784 # <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
27092785 mkdir_p='$(MKDIR_P)'
27102786
27112787 # We need awk for the "check" target (and possibly the TAP driver). The
27562832 Aborting the configuration process, to ensure you take notice of the issue.
27572833
27582834 You can download and install GNU coreutils to get an 'rm' implementation
2759 that behaves properly: <http://www.gnu.org/software/coreutils/>.
2835 that behaves properly: <https://www.gnu.org/software/coreutils/>.
27602836
27612837 If you want to complete the configuration process using your problematic
27622838 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
27872863 COMPAT_SYMLINKS_FALSE=
27882864 fi
27892865
2866
2867 # Check whether --enable-atari-check was given.
2868 if test "${enable_atari_check+set}" = set; then :
2869 enableval=$enable_atari_check; case "${enableval}" in
2870 yes) CHECKATARI=1
2871
2872 $as_echo "#define CONF_CHECK_ATARI 1" >>confdefs.h
2873 ;;
2874 no) CHECKATARI=0
2875 ;;
2876 *) as_fn_error $? "bad value ${enableval} for --enable-atari-check" "$LINENO" 5 ;;
2877 esac
2878 else
2879 CHECKATARI=0
2880
2881 fi
2882
2883
2884 DEPDIR="${am__leading_dot}deps"
2885
2886 ac_config_commands="$ac_config_commands depfiles"
2887
2888 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
2889 $as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
2890 cat > confinc.mk << 'END'
2891 am__doit:
2892 @echo this is the am__doit target >confinc.out
2893 .PHONY: am__doit
2894 END
2895 am__include="#"
2896 am__quote=
2897 # BSD make does it like this.
2898 echo '.include "confinc.mk" # ignored' > confmf.BSD
2899 # Other make implementations (GNU, Solaris 10, AIX) do it like this.
2900 echo 'include confinc.mk # ignored' > confmf.GNU
2901 _am_result=no
2902 for s in GNU BSD; do
2903 { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
2904 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
2905 ac_status=$?
2906 echo "$as_me:$LINENO: \$? = $ac_status" >&5
2907 (exit $ac_status); }
2908 case $?:`cat confinc.out 2>/dev/null` in #(
2909 '0:this is the am__doit target') :
2910 case $s in #(
2911 BSD) :
2912 am__include='.include' am__quote='"' ;; #(
2913 *) :
2914 am__include='include' am__quote='' ;;
2915 esac ;; #(
2916 *) :
2917 ;;
2918 esac
2919 if test "$am__include" != "#"; then
2920 _am_result="yes ($s style)"
2921 break
2922 fi
2923 done
2924 rm -f confinc.* confmf.*
2925 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
2926 $as_echo "${_am_result}" >&6; }
2927
2928 # Check whether --enable-dependency-tracking was given.
2929 if test "${enable_dependency_tracking+set}" = set; then :
2930 enableval=$enable_dependency_tracking;
2931 fi
2932
2933 if test "x$enable_dependency_tracking" != xno; then
2934 am_depcomp="$ac_aux_dir/depcomp"
2935 AMDEPBACKSLASH='\'
2936 am__nodep='_no'
2937 fi
2938 if test "x$enable_dependency_tracking" != xno; then
2939 AMDEP_TRUE=
2940 AMDEP_FALSE='#'
2941 else
2942 AMDEP_TRUE='#'
2943 AMDEP_FALSE=
2944 fi
27902945
27912946
27922947 ac_ext=c
36353790 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
36363791 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
36373792 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3638
3639 DEPDIR="${am__leading_dot}deps"
3640
3641 ac_config_commands="$ac_config_commands depfiles"
3642
3643
3644 am_make=${MAKE-make}
3645 cat > confinc << 'END'
3646 am__doit:
3647 @echo this is the am__doit target
3648 .PHONY: am__doit
3649 END
3650 # If we don't find an include directive, just comment out the code.
3651 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
3652 $as_echo_n "checking for style of include used by $am_make... " >&6; }
3653 am__include="#"
3654 am__quote=
3655 _am_result=none
3656 # First try GNU make style include.
3657 echo "include confinc" > confmf
3658 # Ignore all kinds of additional output from 'make'.
3659 case `$am_make -s -f confmf 2> /dev/null` in #(
3660 *the\ am__doit\ target*)
3661 am__include=include
3662 am__quote=
3663 _am_result=GNU
3664 ;;
3665 esac
3666 # Now try BSD make style include.
3667 if test "$am__include" = "#"; then
3668 echo '.include "confinc"' > confmf
3669 case `$am_make -s -f confmf 2> /dev/null` in #(
3670 *the\ am__doit\ target*)
3671 am__include=.include
3672 am__quote="\""
3673 _am_result=BSD
3674 ;;
3675 esac
3676 fi
3677
3678
3679 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
3680 $as_echo "$_am_result" >&6; }
3681 rm -f confinc confmf
3682
3683 # Check whether --enable-dependency-tracking was given.
3684 if test "${enable_dependency_tracking+set}" = set; then :
3685 enableval=$enable_dependency_tracking;
3686 fi
3687
3688 if test "x$enable_dependency_tracking" != xno; then
3689 am_depcomp="$ac_aux_dir/depcomp"
3690 AMDEPBACKSLASH='\'
3691 am__nodep='_no'
3692 fi
3693 if test "x$enable_dependency_tracking" != xno; then
3694 AMDEP_TRUE=
3695 AMDEP_FALSE='#'
3696 else
3697 AMDEP_TRUE='#'
3698 AMDEP_FALSE=
3699 fi
3700
37013793
37023794
37033795 depcc="$CC" am_compiler_list=
38283920 fi
38293921
38303922
3831 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
3832 $as_echo_n "checking whether ln -s works... " >&6; }
3833 LN_S=$as_ln_s
3834 if test "$LN_S" = "ln -s"; then
3835 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3836 $as_echo "yes" >&6; }
3837 else
3838 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
3839 $as_echo "no, using $LN_S" >&6; }
3840 fi
3841
3842
3843
3844 # Check whether --enable-largefile was given.
3845 if test "${enable_largefile+set}" = set; then :
3846 enableval=$enable_largefile;
3847 fi
3848
3849 if test "$enable_largefile" != no; then
3850
3851 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
3852 $as_echo_n "checking for special C compiler options needed for large files... " >&6; }
3853 if ${ac_cv_sys_largefile_CC+:} false; then :
3854 $as_echo_n "(cached) " >&6
3855 else
3856 ac_cv_sys_largefile_CC=no
3857 if test "$GCC" != yes; then
3858 ac_save_CC=$CC
3859 while :; do
3860 # IRIX 6.2 and later do not support large files by default,
3861 # so use the C compiler's -n32 option if that helps.
3862 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3863 /* end confdefs.h. */
3864 #include <sys/types.h>
3865 /* Check that off_t can represent 2**63 - 1 correctly.
3866 We can't simply define LARGE_OFF_T to be 9223372036854775807,
3867 since some C++ compilers masquerading as C compilers
3868 incorrectly reject 9223372036854775807. */
3869 #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
3870 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
3871 && LARGE_OFF_T % 2147483647 == 1)
3872 ? 1 : -1];
3873 int
3874 main ()
3875 {
3876
3877 ;
3878 return 0;
3879 }
3880 _ACEOF
3881 if ac_fn_c_try_compile "$LINENO"; then :
3882 break
3883 fi
3884 rm -f core conftest.err conftest.$ac_objext
3885 CC="$CC -n32"
3886 if ac_fn_c_try_compile "$LINENO"; then :
3887 ac_cv_sys_largefile_CC=' -n32'; break
3888 fi
3889 rm -f core conftest.err conftest.$ac_objext
3890 break
3891 done
3892 CC=$ac_save_CC
3893 rm -f conftest.$ac_ext
3894 fi
3895 fi
3896 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
3897 $as_echo "$ac_cv_sys_largefile_CC" >&6; }
3898 if test "$ac_cv_sys_largefile_CC" != no; then
3899 CC=$CC$ac_cv_sys_largefile_CC
3900 fi
3901
3902 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
3903 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
3904 if ${ac_cv_sys_file_offset_bits+:} false; then :
3905 $as_echo_n "(cached) " >&6
3906 else
3907 while :; do
3908 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3909 /* end confdefs.h. */
3910 #include <sys/types.h>
3911 /* Check that off_t can represent 2**63 - 1 correctly.
3912 We can't simply define LARGE_OFF_T to be 9223372036854775807,
3913 since some C++ compilers masquerading as C compilers
3914 incorrectly reject 9223372036854775807. */
3915 #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
3916 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
3917 && LARGE_OFF_T % 2147483647 == 1)
3918 ? 1 : -1];
3919 int
3920 main ()
3921 {
3922
3923 ;
3924 return 0;
3925 }
3926 _ACEOF
3927 if ac_fn_c_try_compile "$LINENO"; then :
3928 ac_cv_sys_file_offset_bits=no; break
3929 fi
3930 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3931 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3932 /* end confdefs.h. */
3933 #define _FILE_OFFSET_BITS 64
3934 #include <sys/types.h>
3935 /* Check that off_t can represent 2**63 - 1 correctly.
3936 We can't simply define LARGE_OFF_T to be 9223372036854775807,
3937 since some C++ compilers masquerading as C compilers
3938 incorrectly reject 9223372036854775807. */
3939 #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
3940 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
3941 && LARGE_OFF_T % 2147483647 == 1)
3942 ? 1 : -1];
3943 int
3944 main ()
3945 {
3946
3947 ;
3948 return 0;
3949 }
3950 _ACEOF
3951 if ac_fn_c_try_compile "$LINENO"; then :
3952 ac_cv_sys_file_offset_bits=64; break
3953 fi
3954 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3955 ac_cv_sys_file_offset_bits=unknown
3956 break
3957 done
3958 fi
3959 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
3960 $as_echo "$ac_cv_sys_file_offset_bits" >&6; }
3961 case $ac_cv_sys_file_offset_bits in #(
3962 no | unknown) ;;
3963 *)
3964 cat >>confdefs.h <<_ACEOF
3965 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
3966 _ACEOF
3967 ;;
3968 esac
3969 rm -rf conftest*
3970 if test $ac_cv_sys_file_offset_bits = unknown; then
3971 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
3972 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
3973 if ${ac_cv_sys_large_files+:} false; then :
3974 $as_echo_n "(cached) " >&6
3975 else
3976 while :; do
3977 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3978 /* end confdefs.h. */
3979 #include <sys/types.h>
3980 /* Check that off_t can represent 2**63 - 1 correctly.
3981 We can't simply define LARGE_OFF_T to be 9223372036854775807,
3982 since some C++ compilers masquerading as C compilers
3983 incorrectly reject 9223372036854775807. */
3984 #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
3985 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
3986 && LARGE_OFF_T % 2147483647 == 1)
3987 ? 1 : -1];
3988 int
3989 main ()
3990 {
3991
3992 ;
3993 return 0;
3994 }
3995 _ACEOF
3996 if ac_fn_c_try_compile "$LINENO"; then :
3997 ac_cv_sys_large_files=no; break
3998 fi
3999 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4000 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4001 /* end confdefs.h. */
4002 #define _LARGE_FILES 1
4003 #include <sys/types.h>
4004 /* Check that off_t can represent 2**63 - 1 correctly.
4005 We can't simply define LARGE_OFF_T to be 9223372036854775807,
4006 since some C++ compilers masquerading as C compilers
4007 incorrectly reject 9223372036854775807. */
4008 #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
4009 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
4010 && LARGE_OFF_T % 2147483647 == 1)
4011 ? 1 : -1];
4012 int
4013 main ()
4014 {
4015
4016 ;
4017 return 0;
4018 }
4019 _ACEOF
4020 if ac_fn_c_try_compile "$LINENO"; then :
4021 ac_cv_sys_large_files=1; break
4022 fi
4023 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4024 ac_cv_sys_large_files=unknown
4025 break
4026 done
4027 fi
4028 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
4029 $as_echo "$ac_cv_sys_large_files" >&6; }
4030 case $ac_cv_sys_large_files in #(
4031 no | unknown) ;;
4032 *)
4033 cat >>confdefs.h <<_ACEOF
4034 #define _LARGE_FILES $ac_cv_sys_large_files
4035 _ACEOF
4036 ;;
4037 esac
4038 rm -rf conftest*
4039 fi
4040
4041
4042 fi
4043
40443923
40453924 ac_ext=c
40463925 ac_cpp='$CPP $CPPFLAGS'
44394318 done
44404319
44414320
4321
4322 ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
4323 if test "x$ac_cv_header_minix_config_h" = xyes; then :
4324 MINIX=yes
4325 else
4326 MINIX=
4327 fi
4328
4329
4330 if test "$MINIX" = yes; then
4331
4332 $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
4333
4334
4335 $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
4336
4337
4338 $as_echo "#define _MINIX 1" >>confdefs.h
4339
4340 fi
4341
4342
4343 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
4344 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
4345 if ${ac_cv_safe_to_define___extensions__+:} false; then :
4346 $as_echo_n "(cached) " >&6
4347 else
4348 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4349 /* end confdefs.h. */
4350
4351 # define __EXTENSIONS__ 1
4352 $ac_includes_default
4353 int
4354 main ()
4355 {
4356
4357 ;
4358 return 0;
4359 }
4360 _ACEOF
4361 if ac_fn_c_try_compile "$LINENO"; then :
4362 ac_cv_safe_to_define___extensions__=yes
4363 else
4364 ac_cv_safe_to_define___extensions__=no
4365 fi
4366 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4367 fi
4368 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
4369 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
4370 test $ac_cv_safe_to_define___extensions__ = yes &&
4371 $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
4372
4373 $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
4374
4375 $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
4376
4377 $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
4378
4379 $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
4380
4381
4382
4383 ac_ext=c
4384 ac_cpp='$CPP $CPPFLAGS'
4385 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4386 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4387 ac_compiler_gnu=$ac_cv_c_compiler_gnu
4388 if test -n "$ac_tool_prefix"; then
4389 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
4390 set dummy ${ac_tool_prefix}gcc; ac_word=$2
4391 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4392 $as_echo_n "checking for $ac_word... " >&6; }
4393 if ${ac_cv_prog_CC+:} false; then :
4394 $as_echo_n "(cached) " >&6
4395 else
4396 if test -n "$CC"; then
4397 ac_cv_prog_CC="$CC" # Let the user override the test.
4398 else
4399 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4400 for as_dir in $PATH
4401 do
4402 IFS=$as_save_IFS
4403 test -z "$as_dir" && as_dir=.
4404 for ac_exec_ext in '' $ac_executable_extensions; do
4405 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4406 ac_cv_prog_CC="${ac_tool_prefix}gcc"
4407 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4408 break 2
4409 fi
4410 done
4411 done
4412 IFS=$as_save_IFS
4413
4414 fi
4415 fi
4416 CC=$ac_cv_prog_CC
4417 if test -n "$CC"; then
4418 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4419 $as_echo "$CC" >&6; }
4420 else
4421 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4422 $as_echo "no" >&6; }
4423 fi
4424
4425
4426 fi
4427 if test -z "$ac_cv_prog_CC"; then
4428 ac_ct_CC=$CC
4429 # Extract the first word of "gcc", so it can be a program name with args.
4430 set dummy gcc; ac_word=$2
4431 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4432 $as_echo_n "checking for $ac_word... " >&6; }
4433 if ${ac_cv_prog_ac_ct_CC+:} false; then :
4434 $as_echo_n "(cached) " >&6
4435 else
4436 if test -n "$ac_ct_CC"; then
4437 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
4438 else
4439 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4440 for as_dir in $PATH
4441 do
4442 IFS=$as_save_IFS
4443 test -z "$as_dir" && as_dir=.
4444 for ac_exec_ext in '' $ac_executable_extensions; do
4445 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4446 ac_cv_prog_ac_ct_CC="gcc"
4447 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4448 break 2
4449 fi
4450 done
4451 done
4452 IFS=$as_save_IFS
4453
4454 fi
4455 fi
4456 ac_ct_CC=$ac_cv_prog_ac_ct_CC
4457 if test -n "$ac_ct_CC"; then
4458 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
4459 $as_echo "$ac_ct_CC" >&6; }
4460 else
4461 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4462 $as_echo "no" >&6; }
4463 fi
4464
4465 if test "x$ac_ct_CC" = x; then
4466 CC=""
4467 else
4468 case $cross_compiling:$ac_tool_warned in
4469 yes:)
4470 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4471 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4472 ac_tool_warned=yes ;;
4473 esac
4474 CC=$ac_ct_CC
4475 fi
4476 else
4477 CC="$ac_cv_prog_CC"
4478 fi
4479
4480 if test -z "$CC"; then
4481 if test -n "$ac_tool_prefix"; then
4482 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
4483 set dummy ${ac_tool_prefix}cc; ac_word=$2
4484 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4485 $as_echo_n "checking for $ac_word... " >&6; }
4486 if ${ac_cv_prog_CC+:} false; then :
4487 $as_echo_n "(cached) " >&6
4488 else
4489 if test -n "$CC"; then
4490 ac_cv_prog_CC="$CC" # Let the user override the test.
4491 else
4492 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4493 for as_dir in $PATH
4494 do
4495 IFS=$as_save_IFS
4496 test -z "$as_dir" && as_dir=.
4497 for ac_exec_ext in '' $ac_executable_extensions; do
4498 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4499 ac_cv_prog_CC="${ac_tool_prefix}cc"
4500 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4501 break 2
4502 fi
4503 done
4504 done
4505 IFS=$as_save_IFS
4506
4507 fi
4508 fi
4509 CC=$ac_cv_prog_CC
4510 if test -n "$CC"; then
4511 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4512 $as_echo "$CC" >&6; }
4513 else
4514 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4515 $as_echo "no" >&6; }
4516 fi
4517
4518
4519 fi
4520 fi
4521 if test -z "$CC"; then
4522 # Extract the first word of "cc", so it can be a program name with args.
4523 set dummy cc; ac_word=$2
4524 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4525 $as_echo_n "checking for $ac_word... " >&6; }
4526 if ${ac_cv_prog_CC+:} false; then :
4527 $as_echo_n "(cached) " >&6
4528 else
4529 if test -n "$CC"; then
4530 ac_cv_prog_CC="$CC" # Let the user override the test.
4531 else
4532 ac_prog_rejected=no
4533 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4534 for as_dir in $PATH
4535 do
4536 IFS=$as_save_IFS
4537 test -z "$as_dir" && as_dir=.
4538 for ac_exec_ext in '' $ac_executable_extensions; do
4539 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4540 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
4541 ac_prog_rejected=yes
4542 continue
4543 fi
4544 ac_cv_prog_CC="cc"
4545 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4546 break 2
4547 fi
4548 done
4549 done
4550 IFS=$as_save_IFS
4551
4552 if test $ac_prog_rejected = yes; then
4553 # We found a bogon in the path, so make sure we never use it.
4554 set dummy $ac_cv_prog_CC
4555 shift
4556 if test $# != 0; then
4557 # We chose a different compiler from the bogus one.
4558 # However, it has the same basename, so the bogon will be chosen
4559 # first if we set CC to just the basename; use the full file name.
4560 shift
4561 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
4562 fi
4563 fi
4564 fi
4565 fi
4566 CC=$ac_cv_prog_CC
4567 if test -n "$CC"; then
4568 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4569 $as_echo "$CC" >&6; }
4570 else
4571 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4572 $as_echo "no" >&6; }
4573 fi
4574
4575
4576 fi
4577 if test -z "$CC"; then
4578 if test -n "$ac_tool_prefix"; then
4579 for ac_prog in cl.exe
4580 do
4581 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4582 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4583 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4584 $as_echo_n "checking for $ac_word... " >&6; }
4585 if ${ac_cv_prog_CC+:} false; then :
4586 $as_echo_n "(cached) " >&6
4587 else
4588 if test -n "$CC"; then
4589 ac_cv_prog_CC="$CC" # Let the user override the test.
4590 else
4591 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4592 for as_dir in $PATH
4593 do
4594 IFS=$as_save_IFS
4595 test -z "$as_dir" && as_dir=.
4596 for ac_exec_ext in '' $ac_executable_extensions; do
4597 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4598 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
4599 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4600 break 2
4601 fi
4602 done
4603 done
4604 IFS=$as_save_IFS
4605
4606 fi
4607 fi
4608 CC=$ac_cv_prog_CC
4609 if test -n "$CC"; then
4610 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
4611 $as_echo "$CC" >&6; }
4612 else
4613 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4614 $as_echo "no" >&6; }
4615 fi
4616
4617
4618 test -n "$CC" && break
4619 done
4620 fi
4621 if test -z "$CC"; then
4622 ac_ct_CC=$CC
4623 for ac_prog in cl.exe
4624 do
4625 # Extract the first word of "$ac_prog", so it can be a program name with args.
4626 set dummy $ac_prog; ac_word=$2
4627 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4628 $as_echo_n "checking for $ac_word... " >&6; }
4629 if ${ac_cv_prog_ac_ct_CC+:} false; then :
4630 $as_echo_n "(cached) " >&6
4631 else
4632 if test -n "$ac_ct_CC"; then
4633 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
4634 else
4635 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4636 for as_dir in $PATH
4637 do
4638 IFS=$as_save_IFS
4639 test -z "$as_dir" && as_dir=.
4640 for ac_exec_ext in '' $ac_executable_extensions; do
4641 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4642 ac_cv_prog_ac_ct_CC="$ac_prog"
4643 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4644 break 2
4645 fi
4646 done
4647 done
4648 IFS=$as_save_IFS
4649
4650 fi
4651 fi
4652 ac_ct_CC=$ac_cv_prog_ac_ct_CC
4653 if test -n "$ac_ct_CC"; then
4654 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
4655 $as_echo "$ac_ct_CC" >&6; }
4656 else
4657 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4658 $as_echo "no" >&6; }
4659 fi
4660
4661
4662 test -n "$ac_ct_CC" && break
4663 done
4664
4665 if test "x$ac_ct_CC" = x; then
4666 CC=""
4667 else
4668 case $cross_compiling:$ac_tool_warned in
4669 yes:)
4670 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4671 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4672 ac_tool_warned=yes ;;
4673 esac
4674 CC=$ac_ct_CC
4675 fi
4676 fi
4677
4678 fi
4679
4680
4681 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4682 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4683 as_fn_error $? "no acceptable C compiler found in \$PATH
4684 See \`config.log' for more details" "$LINENO" 5; }
4685
4686 # Provide some information about the compiler.
4687 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
4688 set X $ac_compile
4689 ac_compiler=$2
4690 for ac_option in --version -v -V -qversion; do
4691 { { ac_try="$ac_compiler $ac_option >&5"
4692 case "(($ac_try" in
4693 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4694 *) ac_try_echo=$ac_try;;
4695 esac
4696 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4697 $as_echo "$ac_try_echo"; } >&5
4698 (eval "$ac_compiler $ac_option >&5") 2>conftest.err
4699 ac_status=$?
4700 if test -s conftest.err; then
4701 sed '10a\
4702 ... rest of stderr output deleted ...
4703 10q' conftest.err >conftest.er1
4704 cat conftest.er1 >&5
4705 fi
4706 rm -f conftest.er1 conftest.err
4707 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4708 test $ac_status = 0; }
4709 done
4710
4711 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
4712 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
4713 if ${ac_cv_c_compiler_gnu+:} false; then :
4714 $as_echo_n "(cached) " >&6
4715 else
4716 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4717 /* end confdefs.h. */
4718
4719 int
4720 main ()
4721 {
4722 #ifndef __GNUC__
4723 choke me
4724 #endif
4725
4726 ;
4727 return 0;
4728 }
4729 _ACEOF
4730 if ac_fn_c_try_compile "$LINENO"; then :
4731 ac_compiler_gnu=yes
4732 else
4733 ac_compiler_gnu=no
4734 fi
4735 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4736 ac_cv_c_compiler_gnu=$ac_compiler_gnu
4737
4738 fi
4739 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
4740 $as_echo "$ac_cv_c_compiler_gnu" >&6; }
4741 if test $ac_compiler_gnu = yes; then
4742 GCC=yes
4743 else
4744 GCC=
4745 fi
4746 ac_test_CFLAGS=${CFLAGS+set}
4747 ac_save_CFLAGS=$CFLAGS
4748 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
4749 $as_echo_n "checking whether $CC accepts -g... " >&6; }
4750 if ${ac_cv_prog_cc_g+:} false; then :
4751 $as_echo_n "(cached) " >&6
4752 else
4753 ac_save_c_werror_flag=$ac_c_werror_flag
4754 ac_c_werror_flag=yes
4755 ac_cv_prog_cc_g=no
4756 CFLAGS="-g"
4757 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4758 /* end confdefs.h. */
4759
4760 int
4761 main ()
4762 {
4763
4764 ;
4765 return 0;
4766 }
4767 _ACEOF
4768 if ac_fn_c_try_compile "$LINENO"; then :
4769 ac_cv_prog_cc_g=yes
4770 else
4771 CFLAGS=""
4772 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4773 /* end confdefs.h. */
4774
4775 int
4776 main ()
4777 {
4778
4779 ;
4780 return 0;
4781 }
4782 _ACEOF
4783 if ac_fn_c_try_compile "$LINENO"; then :
4784
4785 else
4786 ac_c_werror_flag=$ac_save_c_werror_flag
4787 CFLAGS="-g"
4788 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4789 /* end confdefs.h. */
4790
4791 int
4792 main ()
4793 {
4794
4795 ;
4796 return 0;
4797 }
4798 _ACEOF
4799 if ac_fn_c_try_compile "$LINENO"; then :
4800 ac_cv_prog_cc_g=yes
4801 fi
4802 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4803 fi
4804 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4805 fi
4806 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4807 ac_c_werror_flag=$ac_save_c_werror_flag
4808 fi
4809 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
4810 $as_echo "$ac_cv_prog_cc_g" >&6; }
4811 if test "$ac_test_CFLAGS" = set; then
4812 CFLAGS=$ac_save_CFLAGS
4813 elif test $ac_cv_prog_cc_g = yes; then
4814 if test "$GCC" = yes; then
4815 CFLAGS="-g -O2"
4816 else
4817 CFLAGS="-g"
4818 fi
4819 else
4820 if test "$GCC" = yes; then
4821 CFLAGS="-O2"
4822 else
4823 CFLAGS=
4824 fi
4825 fi
4826 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
4827 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
4828 if ${ac_cv_prog_cc_c89+:} false; then :
4829 $as_echo_n "(cached) " >&6
4830 else
4831 ac_cv_prog_cc_c89=no
4832 ac_save_CC=$CC
4833 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4834 /* end confdefs.h. */
4835 #include <stdarg.h>
4836 #include <stdio.h>
4837 struct stat;
4838 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
4839 struct buf { int x; };
4840 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4841 static char *e (p, i)
4842 char **p;
4843 int i;
4844 {
4845 return p[i];
4846 }
4847 static char *f (char * (*g) (char **, int), char **p, ...)
4848 {
4849 char *s;
4850 va_list v;
4851 va_start (v,p);
4852 s = g (p, va_arg (v,int));
4853 va_end (v);
4854 return s;
4855 }
4856
4857 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
4858 function prototypes and stuff, but not '\xHH' hex character constants.
4859 These don't provoke an error unfortunately, instead are silently treated
4860 as 'x'. The following induces an error, until -std is added to get
4861 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
4862 array size at least. It's necessary to write '\x00'==0 to get something
4863 that's true only with -std. */
4864 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
4865
4866 /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
4867 inside strings and character constants. */
4868 #define FOO(x) 'x'
4869 int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
4870
4871 int test (int i, double x);
4872 struct s1 {int (*f) (int a);};
4873 struct s2 {int (*f) (double a);};
4874 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4875 int argc;
4876 char **argv;
4877 int
4878 main ()
4879 {
4880 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
4881 ;
4882 return 0;
4883 }
4884 _ACEOF
4885 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
4886 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4887 do
4888 CC="$ac_save_CC $ac_arg"
4889 if ac_fn_c_try_compile "$LINENO"; then :
4890 ac_cv_prog_cc_c89=$ac_arg
4891 fi
4892 rm -f core conftest.err conftest.$ac_objext
4893 test "x$ac_cv_prog_cc_c89" != "xno" && break
4894 done
4895 rm -f conftest.$ac_ext
4896 CC=$ac_save_CC
4897
4898 fi
4899 # AC_CACHE_VAL
4900 case "x$ac_cv_prog_cc_c89" in
4901 x)
4902 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4903 $as_echo "none needed" >&6; } ;;
4904 xno)
4905 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4906 $as_echo "unsupported" >&6; } ;;
4907 *)
4908 CC="$CC $ac_cv_prog_cc_c89"
4909 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
4910 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
4911 esac
4912 if test "x$ac_cv_prog_cc_c89" != xno; then :
4913
4914 fi
4915
4916 ac_ext=c
4917 ac_cpp='$CPP $CPPFLAGS'
4918 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4919 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4920 ac_compiler_gnu=$ac_cv_c_compiler_gnu
4921
4922 ac_ext=c
4923 ac_cpp='$CPP $CPPFLAGS'
4924 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4925 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4926 ac_compiler_gnu=$ac_cv_c_compiler_gnu
4927 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
4928 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
4929 if ${am_cv_prog_cc_c_o+:} false; then :
4930 $as_echo_n "(cached) " >&6
4931 else
4932 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4933 /* end confdefs.h. */
4934
4935 int
4936 main ()
4937 {
4938
4939 ;
4940 return 0;
4941 }
4942 _ACEOF
4943 # Make sure it works both with $CC and with simple cc.
4944 # Following AC_PROG_CC_C_O, we do the test twice because some
4945 # compilers refuse to overwrite an existing .o file with -o,
4946 # though they will create one.
4947 am_cv_prog_cc_c_o=yes
4948 for am_i in 1 2; do
4949 if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
4950 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
4951 ac_status=$?
4952 echo "$as_me:$LINENO: \$? = $ac_status" >&5
4953 (exit $ac_status); } \
4954 && test -f conftest2.$ac_objext; then
4955 : OK
4956 else
4957 am_cv_prog_cc_c_o=no
4958 break
4959 fi
4960 done
4961 rm -f core conftest*
4962 unset am_i
4963 fi
4964 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
4965 $as_echo "$am_cv_prog_cc_c_o" >&6; }
4966 if test "$am_cv_prog_cc_c_o" != yes; then
4967 # Losing compiler, so override with the script.
4968 # FIXME: It is wrong to rewrite CC.
4969 # But if we don't then we get into trouble of one sort or another.
4970 # A longer-term fix would be to have automake use am__CC in this case,
4971 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
4972 CC="$am_aux_dir/compile $CC"
4973 fi
4974 ac_ext=c
4975 ac_cpp='$CPP $CPPFLAGS'
4976 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4977 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4978 ac_compiler_gnu=$ac_cv_c_compiler_gnu
4979
4980
4981 depcc="$CC" am_compiler_list=
4982
4983 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
4984 $as_echo_n "checking dependency style of $depcc... " >&6; }
4985 if ${am_cv_CC_dependencies_compiler_type+:} false; then :
4986 $as_echo_n "(cached) " >&6
4987 else
4988 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
4989 # We make a subdir and do the tests there. Otherwise we can end up
4990 # making bogus files that we don't know about and never remove. For
4991 # instance it was reported that on HP-UX the gcc test will end up
4992 # making a dummy file named 'D' -- because '-MD' means "put the output
4993 # in D".
4994 rm -rf conftest.dir
4995 mkdir conftest.dir
4996 # Copy depcomp to subdir because otherwise we won't find it if we're
4997 # using a relative directory.
4998 cp "$am_depcomp" conftest.dir
4999 cd conftest.dir
5000 # We will build objects and dependencies in a subdirectory because
5001 # it helps to detect inapplicable dependency modes. For instance
5002 # both Tru64's cc and ICC support -MD to output dependencies as a
5003 # side effect of compilation, but ICC will put the dependencies in
5004 # the current directory while Tru64 will put them in the object
5005 # directory.
5006 mkdir sub
5007
5008 am_cv_CC_dependencies_compiler_type=none
5009 if test "$am_compiler_list" = ""; then
5010 am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
5011 fi
5012 am__universal=false
5013 case " $depcc " in #(
5014 *\ -arch\ *\ -arch\ *) am__universal=true ;;
5015 esac
5016
5017 for depmode in $am_compiler_list; do
5018 # Setup a source with many dependencies, because some compilers
5019 # like to wrap large dependency lists on column 80 (with \), and
5020 # we should not choose a depcomp mode which is confused by this.
5021 #
5022 # We need to recreate these files for each test, as the compiler may
5023 # overwrite some of them when testing with obscure command lines.
5024 # This happens at least with the AIX C compiler.
5025 : > sub/conftest.c
5026 for i in 1 2 3 4 5 6; do
5027 echo '#include "conftst'$i'.h"' >> sub/conftest.c
5028 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
5029 # Solaris 10 /bin/sh.
5030 echo '/* dummy */' > sub/conftst$i.h
5031 done
5032 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
5033
5034 # We check with '-c' and '-o' for the sake of the "dashmstdout"
5035 # mode. It turns out that the SunPro C++ compiler does not properly
5036 # handle '-M -o', and we need to detect this. Also, some Intel
5037 # versions had trouble with output in subdirs.
5038 am__obj=sub/conftest.${OBJEXT-o}
5039 am__minus_obj="-o $am__obj"
5040 case $depmode in
5041 gcc)
5042 # This depmode causes a compiler race in universal mode.
5043 test "$am__universal" = false || continue
5044 ;;
5045 nosideeffect)
5046 # After this tag, mechanisms are not by side-effect, so they'll
5047 # only be used when explicitly requested.
5048 if test "x$enable_dependency_tracking" = xyes; then
5049 continue
5050 else
5051 break
5052 fi
5053 ;;
5054 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
5055 # This compiler won't grok '-c -o', but also, the minuso test has
5056 # not run yet. These depmodes are late enough in the game, and
5057 # so weak that their functioning should not be impacted.
5058 am__obj=conftest.${OBJEXT-o}
5059 am__minus_obj=
5060 ;;
5061 none) break ;;
5062 esac
5063 if depmode=$depmode \
5064 source=sub/conftest.c object=$am__obj \
5065 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
5066 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
5067 >/dev/null 2>conftest.err &&
5068 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
5069 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
5070 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
5071 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
5072 # icc doesn't choke on unknown options, it will just issue warnings
5073 # or remarks (even with -Werror). So we grep stderr for any message
5074 # that says an option was ignored or not supported.
5075 # When given -MP, icc 7.0 and 7.1 complain thusly:
5076 # icc: Command line warning: ignoring option '-M'; no argument required
5077 # The diagnosis changed in icc 8.0:
5078 # icc: Command line remark: option '-MP' not supported
5079 if (grep 'ignoring option' conftest.err ||
5080 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
5081 am_cv_CC_dependencies_compiler_type=$depmode
5082 break
5083 fi
5084 fi
5085 done
5086
5087 cd ..
5088 rm -rf conftest.dir
5089 else
5090 am_cv_CC_dependencies_compiler_type=none
5091 fi
5092
5093 fi
5094 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
5095 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
5096 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
5097
5098 if
5099 test "x$enable_dependency_tracking" != xno \
5100 && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
5101 am__fastdepCC_TRUE=
5102 am__fastdepCC_FALSE='#'
5103 else
5104 am__fastdepCC_TRUE='#'
5105 am__fastdepCC_FALSE=
5106 fi
5107
5108
5109 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
5110 $as_echo_n "checking whether ln -s works... " >&6; }
5111 LN_S=$as_ln_s
5112 if test "$LN_S" = "ln -s"; then
5113 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5114 $as_echo "yes" >&6; }
5115 else
5116 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
5117 $as_echo "no, using $LN_S" >&6; }
5118 fi
5119
5120
5121 # Check whether --enable-largefile was given.
5122 if test "${enable_largefile+set}" = set; then :
5123 enableval=$enable_largefile;
5124 fi
5125
5126 if test "$enable_largefile" != no; then
5127
5128 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
5129 $as_echo_n "checking for special C compiler options needed for large files... " >&6; }
5130 if ${ac_cv_sys_largefile_CC+:} false; then :
5131 $as_echo_n "(cached) " >&6
5132 else
5133 ac_cv_sys_largefile_CC=no
5134 if test "$GCC" != yes; then
5135 ac_save_CC=$CC
5136 while :; do
5137 # IRIX 6.2 and later do not support large files by default,
5138 # so use the C compiler's -n32 option if that helps.
5139 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5140 /* end confdefs.h. */
5141 #include <sys/types.h>
5142 /* Check that off_t can represent 2**63 - 1 correctly.
5143 We can't simply define LARGE_OFF_T to be 9223372036854775807,
5144 since some C++ compilers masquerading as C compilers
5145 incorrectly reject 9223372036854775807. */
5146 #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
5147 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
5148 && LARGE_OFF_T % 2147483647 == 1)
5149 ? 1 : -1];
5150 int
5151 main ()
5152 {
5153
5154 ;
5155 return 0;
5156 }
5157 _ACEOF
5158 if ac_fn_c_try_compile "$LINENO"; then :
5159 break
5160 fi
5161 rm -f core conftest.err conftest.$ac_objext
5162 CC="$CC -n32"
5163 if ac_fn_c_try_compile "$LINENO"; then :
5164 ac_cv_sys_largefile_CC=' -n32'; break
5165 fi
5166 rm -f core conftest.err conftest.$ac_objext
5167 break
5168 done
5169 CC=$ac_save_CC
5170 rm -f conftest.$ac_ext
5171 fi
5172 fi
5173 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
5174 $as_echo "$ac_cv_sys_largefile_CC" >&6; }
5175 if test "$ac_cv_sys_largefile_CC" != no; then
5176 CC=$CC$ac_cv_sys_largefile_CC
5177 fi
5178
5179 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
5180 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
5181 if ${ac_cv_sys_file_offset_bits+:} false; then :
5182 $as_echo_n "(cached) " >&6
5183 else
5184 while :; do
5185 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5186 /* end confdefs.h. */
5187 #include <sys/types.h>
5188 /* Check that off_t can represent 2**63 - 1 correctly.
5189 We can't simply define LARGE_OFF_T to be 9223372036854775807,
5190 since some C++ compilers masquerading as C compilers
5191 incorrectly reject 9223372036854775807. */
5192 #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
5193 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
5194 && LARGE_OFF_T % 2147483647 == 1)
5195 ? 1 : -1];
5196 int
5197 main ()
5198 {
5199
5200 ;
5201 return 0;
5202 }
5203 _ACEOF
5204 if ac_fn_c_try_compile "$LINENO"; then :
5205 ac_cv_sys_file_offset_bits=no; break
5206 fi
5207 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5208 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5209 /* end confdefs.h. */
5210 #define _FILE_OFFSET_BITS 64
5211 #include <sys/types.h>
5212 /* Check that off_t can represent 2**63 - 1 correctly.
5213 We can't simply define LARGE_OFF_T to be 9223372036854775807,
5214 since some C++ compilers masquerading as C compilers
5215 incorrectly reject 9223372036854775807. */
5216 #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
5217 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
5218 && LARGE_OFF_T % 2147483647 == 1)
5219 ? 1 : -1];
5220 int
5221 main ()
5222 {
5223
5224 ;
5225 return 0;
5226 }
5227 _ACEOF
5228 if ac_fn_c_try_compile "$LINENO"; then :
5229 ac_cv_sys_file_offset_bits=64; break
5230 fi
5231 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5232 ac_cv_sys_file_offset_bits=unknown
5233 break
5234 done
5235 fi
5236 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
5237 $as_echo "$ac_cv_sys_file_offset_bits" >&6; }
5238 case $ac_cv_sys_file_offset_bits in #(
5239 no | unknown) ;;
5240 *)
5241 cat >>confdefs.h <<_ACEOF
5242 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
5243 _ACEOF
5244 ;;
5245 esac
5246 rm -rf conftest*
5247 if test $ac_cv_sys_file_offset_bits = unknown; then
5248 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
5249 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
5250 if ${ac_cv_sys_large_files+:} false; then :
5251 $as_echo_n "(cached) " >&6
5252 else
5253 while :; do
5254 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5255 /* end confdefs.h. */
5256 #include <sys/types.h>
5257 /* Check that off_t can represent 2**63 - 1 correctly.
5258 We can't simply define LARGE_OFF_T to be 9223372036854775807,
5259 since some C++ compilers masquerading as C compilers
5260 incorrectly reject 9223372036854775807. */
5261 #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
5262 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
5263 && LARGE_OFF_T % 2147483647 == 1)
5264 ? 1 : -1];
5265 int
5266 main ()
5267 {
5268
5269 ;
5270 return 0;
5271 }
5272 _ACEOF
5273 if ac_fn_c_try_compile "$LINENO"; then :
5274 ac_cv_sys_large_files=no; break
5275 fi
5276 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5277 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5278 /* end confdefs.h. */
5279 #define _LARGE_FILES 1
5280 #include <sys/types.h>
5281 /* Check that off_t can represent 2**63 - 1 correctly.
5282 We can't simply define LARGE_OFF_T to be 9223372036854775807,
5283 since some C++ compilers masquerading as C compilers
5284 incorrectly reject 9223372036854775807. */
5285 #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
5286 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
5287 && LARGE_OFF_T % 2147483647 == 1)
5288 ? 1 : -1];
5289 int
5290 main ()
5291 {
5292
5293 ;
5294 return 0;
5295 }
5296 _ACEOF
5297 if ac_fn_c_try_compile "$LINENO"; then :
5298 ac_cv_sys_large_files=1; break
5299 fi
5300 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5301 ac_cv_sys_large_files=unknown
5302 break
5303 done
5304 fi
5305 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
5306 $as_echo "$ac_cv_sys_large_files" >&6; }
5307 case $ac_cv_sys_large_files in #(
5308 no | unknown) ;;
5309 *)
5310 cat >>confdefs.h <<_ACEOF
5311 #define _LARGE_FILES $ac_cv_sys_large_files
5312 _ACEOF
5313 ;;
5314 esac
5315 rm -rf conftest*
5316 fi
5317
5318
5319 fi
5320
5321
44425322 for ac_header in \
44435323 err.h \
44445324 linux/fd.h \
44455325 linux/hdreg.h \
44465326 linux/version.h \
5327 linux/loop.h \
44475328 sys/disk.h \
44485329 sys/disklabel.h \
44495330 sys/ioccom.h \
44775358 done
44785359
44795360
5361 for ac_func in vasprintf
5362 do :
5363 ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf"
5364 if test "x$ac_cv_func_vasprintf" = xyes; then :
5365 cat >>confdefs.h <<_ACEOF
5366 #define HAVE_VASPRINTF 1
5367 _ACEOF
5368
5369 fi
5370 done
5371
5372
44805373 ac_fn_c_check_decl "$LINENO" "getmntent" "ac_cv_have_decl_getmntent" "#include <mntent.h>
44815374 "
44825375 if test "x$ac_cv_have_decl_getmntent" = xyes; then :
45025395 _ACEOF
45035396
45045397
4505
4506 # Check whether --with-udev was given.
4507 if test "${with_udev+set}" = set; then :
4508 withval=$with_udev;
4509 fi
4510
4511 if test "x$with_udev" != "xno"; then
4512
4513
4514
4515
4516
4517
4518
4519 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
4520 if test -n "$ac_tool_prefix"; then
4521 # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4522 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4523 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4524 $as_echo_n "checking for $ac_word... " >&6; }
4525 if ${ac_cv_path_PKG_CONFIG+:} false; then :
5398 # optional iconv support
5399
5400 # Check whether --with-iconv was given.
5401 if test "${with_iconv+set}" = set; then :
5402 withval=$with_iconv;
5403 fi
5404
5405 if test "x$with_iconv" != "xno"; then
5406 # Make sure we can run config.sub.
5407 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
5408 as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
5409
5410 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
5411 $as_echo_n "checking build system type... " >&6; }
5412 if ${ac_cv_build+:} false; then :
45265413 $as_echo_n "(cached) " >&6
45275414 else
4528 case $PKG_CONFIG in
4529 [\\/]* | ?:[\\/]*)
4530 ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5415 ac_build_alias=$build_alias
5416 test "x$ac_build_alias" = x &&
5417 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
5418 test "x$ac_build_alias" = x &&
5419 as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
5420 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
5421 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
5422
5423 fi
5424 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
5425 $as_echo "$ac_cv_build" >&6; }
5426 case $ac_cv_build in
5427 *-*-*) ;;
5428 *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
5429 esac
5430 build=$ac_cv_build
5431 ac_save_IFS=$IFS; IFS='-'
5432 set x $ac_cv_build
5433 shift
5434 build_cpu=$1
5435 build_vendor=$2
5436 shift; shift
5437 # Remember, the first character of IFS is used to create $*,
5438 # except with old shells:
5439 build_os=$*
5440 IFS=$ac_save_IFS
5441 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
5442
5443
5444 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
5445 $as_echo_n "checking host system type... " >&6; }
5446 if ${ac_cv_host+:} false; then :
5447 $as_echo_n "(cached) " >&6
5448 else
5449 if test "x$host_alias" = x; then
5450 ac_cv_host=$ac_cv_build
5451 else
5452 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
5453 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
5454 fi
5455
5456 fi
5457 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
5458 $as_echo "$ac_cv_host" >&6; }
5459 case $ac_cv_host in
5460 *-*-*) ;;
5461 *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
5462 esac
5463 host=$ac_cv_host
5464 ac_save_IFS=$IFS; IFS='-'
5465 set x $ac_cv_host
5466 shift
5467 host_cpu=$1
5468 host_vendor=$2
5469 shift; shift
5470 # Remember, the first character of IFS is used to create $*,
5471 # except with old shells:
5472 host_os=$*
5473 IFS=$ac_save_IFS
5474 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
5475
5476
5477
5478 if test "X$prefix" = "XNONE"; then
5479 acl_final_prefix="$ac_default_prefix"
5480 else
5481 acl_final_prefix="$prefix"
5482 fi
5483 if test "X$exec_prefix" = "XNONE"; then
5484 acl_final_exec_prefix='${prefix}'
5485 else
5486 acl_final_exec_prefix="$exec_prefix"
5487 fi
5488 acl_save_prefix="$prefix"
5489 prefix="$acl_final_prefix"
5490 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
5491 prefix="$acl_save_prefix"
5492
5493
5494
5495 # Check whether --with-gnu-ld was given.
5496 if test "${with_gnu_ld+set}" = set; then :
5497 withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
5498 else
5499 with_gnu_ld=no
5500 fi
5501
5502 # Prepare PATH_SEPARATOR.
5503 # The user is always right.
5504 if test "${PATH_SEPARATOR+set}" != set; then
5505 # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
5506 # contains only /bin. Note that ksh looks also at the FPATH variable,
5507 # so we have to set that as well for the test.
5508 PATH_SEPARATOR=:
5509 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
5510 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
5511 || PATH_SEPARATOR=';'
5512 }
5513 fi
5514
5515 ac_prog=ld
5516 if test "$GCC" = yes; then
5517 # Check if gcc -print-prog-name=ld gives a path.
5518 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
5519 $as_echo_n "checking for ld used by $CC... " >&6; }
5520 case $host in
5521 *-*-mingw*)
5522 # gcc leaves a trailing carriage return which upsets mingw
5523 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
5524 *)
5525 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
5526 esac
5527 case $ac_prog in
5528 # Accept absolute paths.
5529 [\\/]* | ?:[\\/]*)
5530 re_direlt='/[^/][^/]*/\.\./'
5531 # Canonicalize the pathname of ld
5532 ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
5533 while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
5534 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
5535 done
5536 test -z "$LD" && LD="$ac_prog"
5537 ;;
5538 "")
5539 # If it fails, then pretend we aren't using GCC.
5540 ac_prog=ld
5541 ;;
5542 *)
5543 # If it is relative, then search for the first ld in PATH.
5544 with_gnu_ld=unknown
5545 ;;
5546 esac
5547 elif test "$with_gnu_ld" = yes; then
5548 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
5549 $as_echo_n "checking for GNU ld... " >&6; }
5550 else
5551 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
5552 $as_echo_n "checking for non-GNU ld... " >&6; }
5553 fi
5554 if ${acl_cv_path_LD+:} false; then :
5555 $as_echo_n "(cached) " >&6
5556 else
5557 if test -z "$LD"; then
5558 acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
5559 for ac_dir in $PATH; do
5560 IFS="$acl_save_ifs"
5561 test -z "$ac_dir" && ac_dir=.
5562 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
5563 acl_cv_path_LD="$ac_dir/$ac_prog"
5564 # Check to see if the program is GNU ld. I'd rather use --version,
5565 # but apparently some variants of GNU ld only accept -v.
5566 # Break only if it was the GNU/non-GNU ld that we prefer.
5567 case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
5568 *GNU* | *'with BFD'*)
5569 test "$with_gnu_ld" != no && break
5570 ;;
5571 *)
5572 test "$with_gnu_ld" != yes && break
5573 ;;
5574 esac
5575 fi
5576 done
5577 IFS="$acl_save_ifs"
5578 else
5579 acl_cv_path_LD="$LD" # Let the user override the test with a path.
5580 fi
5581 fi
5582
5583 LD="$acl_cv_path_LD"
5584 if test -n "$LD"; then
5585 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
5586 $as_echo "$LD" >&6; }
5587 else
5588 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5589 $as_echo "no" >&6; }
5590 fi
5591 test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
5592 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
5593 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
5594 if ${acl_cv_prog_gnu_ld+:} false; then :
5595 $as_echo_n "(cached) " >&6
5596 else
5597 # I'd rather use --version here, but apparently some GNU lds only accept -v.
5598 case `$LD -v 2>&1 </dev/null` in
5599 *GNU* | *'with BFD'*)
5600 acl_cv_prog_gnu_ld=yes
45315601 ;;
4532 *)
4533 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4534 for as_dir in $PATH
4535 do
4536 IFS=$as_save_IFS
4537 test -z "$as_dir" && as_dir=.
4538 for ac_exec_ext in '' $ac_executable_extensions; do
4539 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4540 ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
4541 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4542 break 2
4543 fi
4544 done
4545 done
4546 IFS=$as_save_IFS
4547
5602 *)
5603 acl_cv_prog_gnu_ld=no
45485604 ;;
45495605 esac
45505606 fi
4551 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4552 if test -n "$PKG_CONFIG"; then
4553 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
4554 $as_echo "$PKG_CONFIG" >&6; }
4555 else
4556 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4557 $as_echo "no" >&6; }
4558 fi
4559
4560
4561 fi
4562 if test -z "$ac_cv_path_PKG_CONFIG"; then
4563 ac_pt_PKG_CONFIG=$PKG_CONFIG
4564 # Extract the first word of "pkg-config", so it can be a program name with args.
4565 set dummy pkg-config; ac_word=$2
4566 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4567 $as_echo_n "checking for $ac_word... " >&6; }
4568 if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
5607 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5
5608 $as_echo "$acl_cv_prog_gnu_ld" >&6; }
5609 with_gnu_ld=$acl_cv_prog_gnu_ld
5610
5611
5612
5613
5614 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5
5615 $as_echo_n "checking for shared library run path origin... " >&6; }
5616 if ${acl_cv_rpath+:} false; then :
45695617 $as_echo_n "(cached) " >&6
45705618 else
4571 case $ac_pt_PKG_CONFIG in
4572 [\\/]* | ?:[\\/]*)
4573 ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4574 ;;
4575 *)
4576 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4577 for as_dir in $PATH
4578 do
4579 IFS=$as_save_IFS
4580 test -z "$as_dir" && as_dir=.
4581 for ac_exec_ext in '' $ac_executable_extensions; do
4582 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4583 ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
4584 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4585 break 2
5619
5620 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
5621 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
5622 . ./conftest.sh
5623 rm -f ./conftest.sh
5624 acl_cv_rpath=done
5625
5626 fi
5627 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5
5628 $as_echo "$acl_cv_rpath" >&6; }
5629 wl="$acl_cv_wl"
5630 acl_libext="$acl_cv_libext"
5631 acl_shlibext="$acl_cv_shlibext"
5632 acl_libname_spec="$acl_cv_libname_spec"
5633 acl_library_names_spec="$acl_cv_library_names_spec"
5634 acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
5635 acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
5636 acl_hardcode_direct="$acl_cv_hardcode_direct"
5637 acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
5638 # Check whether --enable-rpath was given.
5639 if test "${enable_rpath+set}" = set; then :
5640 enableval=$enable_rpath; :
5641 else
5642 enable_rpath=yes
5643 fi
5644
5645
5646
5647
5648 acl_libdirstem=lib
5649 acl_libdirstem2=
5650 case "$host_os" in
5651 solaris*)
5652 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5
5653 $as_echo_n "checking for 64-bit host... " >&6; }
5654 if ${gl_cv_solaris_64bit+:} false; then :
5655 $as_echo_n "(cached) " >&6
5656 else
5657 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5658 /* end confdefs.h. */
5659
5660 #ifdef _LP64
5661 sixtyfour bits
5662 #endif
5663
5664 _ACEOF
5665 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5666 $EGREP "sixtyfour bits" >/dev/null 2>&1; then :
5667 gl_cv_solaris_64bit=yes
5668 else
5669 gl_cv_solaris_64bit=no
5670 fi
5671 rm -f conftest*
5672
5673
5674 fi
5675 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5
5676 $as_echo "$gl_cv_solaris_64bit" >&6; }
5677 if test $gl_cv_solaris_64bit = yes; then
5678 acl_libdirstem=lib/64
5679 case "$host_cpu" in
5680 sparc*) acl_libdirstem2=lib/sparcv9 ;;
5681 i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
5682 esac
5683 fi
5684 ;;
5685 *)
5686 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
5687 if test -n "$searchpath"; then
5688 acl_save_IFS="${IFS= }"; IFS=":"
5689 for searchdir in $searchpath; do
5690 if test -d "$searchdir"; then
5691 case "$searchdir" in
5692 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
5693 */../ | */.. )
5694 # Better ignore directories of this form. They are misleading.
5695 ;;
5696 *) searchdir=`cd "$searchdir" && pwd`
5697 case "$searchdir" in
5698 */lib64 ) acl_libdirstem=lib64 ;;
5699 esac ;;
5700 esac
5701 fi
5702 done
5703 IFS="$acl_save_IFS"
5704 fi
5705 ;;
5706 esac
5707 test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720 use_additional=yes
5721
5722 acl_save_prefix="$prefix"
5723 prefix="$acl_final_prefix"
5724 acl_save_exec_prefix="$exec_prefix"
5725 exec_prefix="$acl_final_exec_prefix"
5726
5727 eval additional_includedir=\"$includedir\"
5728 eval additional_libdir=\"$libdir\"
5729
5730 exec_prefix="$acl_save_exec_prefix"
5731 prefix="$acl_save_prefix"
5732
5733
5734 # Check whether --with-libiconv-prefix was given.
5735 if test "${with_libiconv_prefix+set}" = set; then :
5736 withval=$with_libiconv_prefix;
5737 if test "X$withval" = "Xno"; then
5738 use_additional=no
5739 else
5740 if test "X$withval" = "X"; then
5741
5742 acl_save_prefix="$prefix"
5743 prefix="$acl_final_prefix"
5744 acl_save_exec_prefix="$exec_prefix"
5745 exec_prefix="$acl_final_exec_prefix"
5746
5747 eval additional_includedir=\"$includedir\"
5748 eval additional_libdir=\"$libdir\"
5749
5750 exec_prefix="$acl_save_exec_prefix"
5751 prefix="$acl_save_prefix"
5752
5753 else
5754 additional_includedir="$withval/include"
5755 additional_libdir="$withval/$acl_libdirstem"
5756 if test "$acl_libdirstem2" != "$acl_libdirstem" \
5757 && ! test -d "$withval/$acl_libdirstem"; then
5758 additional_libdir="$withval/$acl_libdirstem2"
5759 fi
5760 fi
5761 fi
5762
5763 fi
5764
5765 LIBICONV=
5766 LTLIBICONV=
5767 INCICONV=
5768 LIBICONV_PREFIX=
5769 HAVE_LIBICONV=
5770 rpathdirs=
5771 ltrpathdirs=
5772 names_already_handled=
5773 names_next_round='iconv '
5774 while test -n "$names_next_round"; do
5775 names_this_round="$names_next_round"
5776 names_next_round=
5777 for name in $names_this_round; do
5778 already_handled=
5779 for n in $names_already_handled; do
5780 if test "$n" = "$name"; then
5781 already_handled=yes
5782 break
5783 fi
5784 done
5785 if test -z "$already_handled"; then
5786 names_already_handled="$names_already_handled $name"
5787 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
5788 eval value=\"\$HAVE_LIB$uppername\"
5789 if test -n "$value"; then
5790 if test "$value" = yes; then
5791 eval value=\"\$LIB$uppername\"
5792 test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value"
5793 eval value=\"\$LTLIB$uppername\"
5794 test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value"
5795 else
5796 :
5797 fi
5798 else
5799 found_dir=
5800 found_la=
5801 found_so=
5802 found_a=
5803 eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
5804 if test -n "$acl_shlibext"; then
5805 shrext=".$acl_shlibext" # typically: shrext=.so
5806 else
5807 shrext=
5808 fi
5809 if test $use_additional = yes; then
5810 dir="$additional_libdir"
5811 if test -n "$acl_shlibext"; then
5812 if test -f "$dir/$libname$shrext"; then
5813 found_dir="$dir"
5814 found_so="$dir/$libname$shrext"
5815 else
5816 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
5817 ver=`(cd "$dir" && \
5818 for f in "$libname$shrext".*; do echo "$f"; done \
5819 | sed -e "s,^$libname$shrext\\\\.,," \
5820 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
5821 | sed 1q ) 2>/dev/null`
5822 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
5823 found_dir="$dir"
5824 found_so="$dir/$libname$shrext.$ver"
5825 fi
5826 else
5827 eval library_names=\"$acl_library_names_spec\"
5828 for f in $library_names; do
5829 if test -f "$dir/$f"; then
5830 found_dir="$dir"
5831 found_so="$dir/$f"
5832 break
5833 fi
5834 done
5835 fi
5836 fi
5837 fi
5838 if test "X$found_dir" = "X"; then
5839 if test -f "$dir/$libname.$acl_libext"; then
5840 found_dir="$dir"
5841 found_a="$dir/$libname.$acl_libext"
5842 fi
5843 fi
5844 if test "X$found_dir" != "X"; then
5845 if test -f "$dir/$libname.la"; then
5846 found_la="$dir/$libname.la"
5847 fi
5848 fi
5849 fi
5850 if test "X$found_dir" = "X"; then
5851 for x in $LDFLAGS $LTLIBICONV; do
5852
5853 acl_save_prefix="$prefix"
5854 prefix="$acl_final_prefix"
5855 acl_save_exec_prefix="$exec_prefix"
5856 exec_prefix="$acl_final_exec_prefix"
5857 eval x=\"$x\"
5858 exec_prefix="$acl_save_exec_prefix"
5859 prefix="$acl_save_prefix"
5860
5861 case "$x" in
5862 -L*)
5863 dir=`echo "X$x" | sed -e 's/^X-L//'`
5864 if test -n "$acl_shlibext"; then
5865 if test -f "$dir/$libname$shrext"; then
5866 found_dir="$dir"
5867 found_so="$dir/$libname$shrext"
5868 else
5869 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
5870 ver=`(cd "$dir" && \
5871 for f in "$libname$shrext".*; do echo "$f"; done \
5872 | sed -e "s,^$libname$shrext\\\\.,," \
5873 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
5874 | sed 1q ) 2>/dev/null`
5875 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
5876 found_dir="$dir"
5877 found_so="$dir/$libname$shrext.$ver"
5878 fi
5879 else
5880 eval library_names=\"$acl_library_names_spec\"
5881 for f in $library_names; do
5882 if test -f "$dir/$f"; then
5883 found_dir="$dir"
5884 found_so="$dir/$f"
5885 break
5886 fi
5887 done
5888 fi
5889 fi
5890 fi
5891 if test "X$found_dir" = "X"; then
5892 if test -f "$dir/$libname.$acl_libext"; then
5893 found_dir="$dir"
5894 found_a="$dir/$libname.$acl_libext"
5895 fi
5896 fi
5897 if test "X$found_dir" != "X"; then
5898 if test -f "$dir/$libname.la"; then
5899 found_la="$dir/$libname.la"
5900 fi
5901 fi
5902 ;;
5903 esac
5904 if test "X$found_dir" != "X"; then
5905 break
5906 fi
5907 done
5908 fi
5909 if test "X$found_dir" != "X"; then
5910 LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name"
5911 if test "X$found_so" != "X"; then
5912 if test "$enable_rpath" = no \
5913 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
5914 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
5915 LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
5916 else
5917 haveit=
5918 for x in $ltrpathdirs; do
5919 if test "X$x" = "X$found_dir"; then
5920 haveit=yes
5921 break
5922 fi
5923 done
5924 if test -z "$haveit"; then
5925 ltrpathdirs="$ltrpathdirs $found_dir"
5926 fi
5927 if test "$acl_hardcode_direct" = yes; then
5928 LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
5929 else
5930 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
5931 LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
5932 haveit=
5933 for x in $rpathdirs; do
5934 if test "X$x" = "X$found_dir"; then
5935 haveit=yes
5936 break
5937 fi
5938 done
5939 if test -z "$haveit"; then
5940 rpathdirs="$rpathdirs $found_dir"
5941 fi
5942 else
5943 haveit=
5944 for x in $LDFLAGS $LIBICONV; do
5945
5946 acl_save_prefix="$prefix"
5947 prefix="$acl_final_prefix"
5948 acl_save_exec_prefix="$exec_prefix"
5949 exec_prefix="$acl_final_exec_prefix"
5950 eval x=\"$x\"
5951 exec_prefix="$acl_save_exec_prefix"
5952 prefix="$acl_save_prefix"
5953
5954 if test "X$x" = "X-L$found_dir"; then
5955 haveit=yes
5956 break
5957 fi
5958 done
5959 if test -z "$haveit"; then
5960 LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir"
5961 fi
5962 if test "$acl_hardcode_minus_L" != no; then
5963 LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
5964 else
5965 LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
5966 fi
5967 fi
5968 fi
5969 fi
5970 else
5971 if test "X$found_a" != "X"; then
5972 LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a"
5973 else
5974 LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name"
5975 fi
5976 fi
5977 additional_includedir=
5978 case "$found_dir" in
5979 */$acl_libdirstem | */$acl_libdirstem/)
5980 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
5981 if test "$name" = 'iconv'; then
5982 LIBICONV_PREFIX="$basedir"
5983 fi
5984 additional_includedir="$basedir/include"
5985 ;;
5986 */$acl_libdirstem2 | */$acl_libdirstem2/)
5987 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
5988 if test "$name" = 'iconv'; then
5989 LIBICONV_PREFIX="$basedir"
5990 fi
5991 additional_includedir="$basedir/include"
5992 ;;
5993 esac
5994 if test "X$additional_includedir" != "X"; then
5995 if test "X$additional_includedir" != "X/usr/include"; then
5996 haveit=
5997 if test "X$additional_includedir" = "X/usr/local/include"; then
5998 if test -n "$GCC"; then
5999 case $host_os in
6000 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
6001 esac
6002 fi
6003 fi
6004 if test -z "$haveit"; then
6005 for x in $CPPFLAGS $INCICONV; do
6006
6007 acl_save_prefix="$prefix"
6008 prefix="$acl_final_prefix"
6009 acl_save_exec_prefix="$exec_prefix"
6010 exec_prefix="$acl_final_exec_prefix"
6011 eval x=\"$x\"
6012 exec_prefix="$acl_save_exec_prefix"
6013 prefix="$acl_save_prefix"
6014
6015 if test "X$x" = "X-I$additional_includedir"; then
6016 haveit=yes
6017 break
6018 fi
6019 done
6020 if test -z "$haveit"; then
6021 if test -d "$additional_includedir"; then
6022 INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir"
6023 fi
6024 fi
6025 fi
6026 fi
6027 fi
6028 if test -n "$found_la"; then
6029 save_libdir="$libdir"
6030 case "$found_la" in
6031 */* | *\\*) . "$found_la" ;;
6032 *) . "./$found_la" ;;
6033 esac
6034 libdir="$save_libdir"
6035 for dep in $dependency_libs; do
6036 case "$dep" in
6037 -L*)
6038 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
6039 if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
6040 && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
6041 haveit=
6042 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
6043 || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
6044 if test -n "$GCC"; then
6045 case $host_os in
6046 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
6047 esac
6048 fi
6049 fi
6050 if test -z "$haveit"; then
6051 haveit=
6052 for x in $LDFLAGS $LIBICONV; do
6053
6054 acl_save_prefix="$prefix"
6055 prefix="$acl_final_prefix"
6056 acl_save_exec_prefix="$exec_prefix"
6057 exec_prefix="$acl_final_exec_prefix"
6058 eval x=\"$x\"
6059 exec_prefix="$acl_save_exec_prefix"
6060 prefix="$acl_save_prefix"
6061
6062 if test "X$x" = "X-L$additional_libdir"; then
6063 haveit=yes
6064 break
6065 fi
6066 done
6067 if test -z "$haveit"; then
6068 if test -d "$additional_libdir"; then
6069 LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir"
6070 fi
6071 fi
6072 haveit=
6073 for x in $LDFLAGS $LTLIBICONV; do
6074
6075 acl_save_prefix="$prefix"
6076 prefix="$acl_final_prefix"
6077 acl_save_exec_prefix="$exec_prefix"
6078 exec_prefix="$acl_final_exec_prefix"
6079 eval x=\"$x\"
6080 exec_prefix="$acl_save_exec_prefix"
6081 prefix="$acl_save_prefix"
6082
6083 if test "X$x" = "X-L$additional_libdir"; then
6084 haveit=yes
6085 break
6086 fi
6087 done
6088 if test -z "$haveit"; then
6089 if test -d "$additional_libdir"; then
6090 LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir"
6091 fi
6092 fi
6093 fi
6094 fi
6095 ;;
6096 -R*)
6097 dir=`echo "X$dep" | sed -e 's/^X-R//'`
6098 if test "$enable_rpath" != no; then
6099 haveit=
6100 for x in $rpathdirs; do
6101 if test "X$x" = "X$dir"; then
6102 haveit=yes
6103 break
6104 fi
6105 done
6106 if test -z "$haveit"; then
6107 rpathdirs="$rpathdirs $dir"
6108 fi
6109 haveit=
6110 for x in $ltrpathdirs; do
6111 if test "X$x" = "X$dir"; then
6112 haveit=yes
6113 break
6114 fi
6115 done
6116 if test -z "$haveit"; then
6117 ltrpathdirs="$ltrpathdirs $dir"
6118 fi
6119 fi
6120 ;;
6121 -l*)
6122 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
6123 ;;
6124 *.la)
6125 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
6126 ;;
6127 *)
6128 LIBICONV="${LIBICONV}${LIBICONV:+ }$dep"
6129 LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep"
6130 ;;
6131 esac
6132 done
6133 fi
6134 else
6135 LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
6136 LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name"
6137 fi
6138 fi
6139 fi
6140 done
6141 done
6142 if test "X$rpathdirs" != "X"; then
6143 if test -n "$acl_hardcode_libdir_separator"; then
6144 alldirs=
6145 for found_dir in $rpathdirs; do
6146 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
6147 done
6148 acl_save_libdir="$libdir"
6149 libdir="$alldirs"
6150 eval flag=\"$acl_hardcode_libdir_flag_spec\"
6151 libdir="$acl_save_libdir"
6152 LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
6153 else
6154 for found_dir in $rpathdirs; do
6155 acl_save_libdir="$libdir"
6156 libdir="$found_dir"
6157 eval flag=\"$acl_hardcode_libdir_flag_spec\"
6158 libdir="$acl_save_libdir"
6159 LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
6160 done
6161 fi
45866162 fi
4587 done
6163 if test "X$ltrpathdirs" != "X"; then
6164 for found_dir in $ltrpathdirs; do
6165 LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir"
6166 done
6167 fi
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180 am_save_CPPFLAGS="$CPPFLAGS"
6181
6182 for element in $INCICONV; do
6183 haveit=
6184 for x in $CPPFLAGS; do
6185
6186 acl_save_prefix="$prefix"
6187 prefix="$acl_final_prefix"
6188 acl_save_exec_prefix="$exec_prefix"
6189 exec_prefix="$acl_final_exec_prefix"
6190 eval x=\"$x\"
6191 exec_prefix="$acl_save_exec_prefix"
6192 prefix="$acl_save_prefix"
6193
6194 if test "X$x" = "X$element"; then
6195 haveit=yes
6196 break
6197 fi
6198 done
6199 if test -z "$haveit"; then
6200 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
6201 fi
45886202 done
4589 IFS=$as_save_IFS
4590
4591 ;;
4592 esac
4593 fi
4594 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4595 if test -n "$ac_pt_PKG_CONFIG"; then
4596 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
4597 $as_echo "$ac_pt_PKG_CONFIG" >&6; }
4598 else
4599 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4600 $as_echo "no" >&6; }
4601 fi
4602
4603 if test "x$ac_pt_PKG_CONFIG" = x; then
4604 PKG_CONFIG=""
4605 else
4606 case $cross_compiling:$ac_tool_warned in
4607 yes:)
4608 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4609 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4610 ac_tool_warned=yes ;;
4611 esac
4612 PKG_CONFIG=$ac_pt_PKG_CONFIG
4613 fi
4614 else
4615 PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4616 fi
4617
4618 fi
4619 if test -n "$PKG_CONFIG"; then
4620 _pkg_min_version=0.9.0
4621 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
4622 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
4623 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
4624 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4625 $as_echo "yes" >&6; }
4626 else
4627 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4628 $as_echo "no" >&6; }
4629 PKG_CONFIG=""
4630 fi
4631 fi
4632
4633 pkg_failed=no
4634 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UDEV" >&5
4635 $as_echo_n "checking for UDEV... " >&6; }
4636
4637 if test -n "$UDEV_CFLAGS"; then
4638 pkg_cv_UDEV_CFLAGS="$UDEV_CFLAGS"
4639 elif test -n "$PKG_CONFIG"; then
4640 if test -n "$PKG_CONFIG" && \
4641 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev\""; } >&5
4642 ($PKG_CONFIG --exists --print-errors "libudev") 2>&5
4643 ac_status=$?
4644 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4645 test $ac_status = 0; }; then
4646 pkg_cv_UDEV_CFLAGS=`$PKG_CONFIG --cflags "libudev" 2>/dev/null`
4647 test "x$?" != "x0" && pkg_failed=yes
4648 else
4649 pkg_failed=yes
4650 fi
4651 else
4652 pkg_failed=untried
4653 fi
4654 if test -n "$UDEV_LIBS"; then
4655 pkg_cv_UDEV_LIBS="$UDEV_LIBS"
4656 elif test -n "$PKG_CONFIG"; then
4657 if test -n "$PKG_CONFIG" && \
4658 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev\""; } >&5
4659 ($PKG_CONFIG --exists --print-errors "libudev") 2>&5
4660 ac_status=$?
4661 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4662 test $ac_status = 0; }; then
4663 pkg_cv_UDEV_LIBS=`$PKG_CONFIG --libs "libudev" 2>/dev/null`
4664 test "x$?" != "x0" && pkg_failed=yes
4665 else
4666 pkg_failed=yes
4667 fi
4668 else
4669 pkg_failed=untried
4670 fi
4671
4672
4673
4674 if test $pkg_failed = yes; then
4675 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4676 $as_echo "no" >&6; }
4677
4678 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
4679 _pkg_short_errors_supported=yes
4680 else
4681 _pkg_short_errors_supported=no
4682 fi
4683 if test $_pkg_short_errors_supported = yes; then
4684 UDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libudev" 2>&1`
4685 else
4686 UDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libudev" 2>&1`
4687 fi
4688 # Put the nasty error message in config.log where it belongs
4689 echo "$UDEV_PKG_ERRORS" >&5
4690
4691 true
4692 elif test $pkg_failed = untried; then
4693 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4694 $as_echo "no" >&6; }
4695 true
4696 else
4697 UDEV_CFLAGS=$pkg_cv_UDEV_CFLAGS
4698 UDEV_LIBS=$pkg_cv_UDEV_LIBS
4699 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4700 $as_echo "yes" >&6; }
4701 $as_echo "#define HAVE_UDEV 1" >>confdefs.h
4702
4703 fi
4704 fi
4705
4706 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing iconv_open" >&5
4707 $as_echo_n "checking for library containing iconv_open... " >&6; }
4708 if ${ac_cv_search_iconv_open+:} false; then :
6203
6204
6205 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5
6206 $as_echo_n "checking for iconv... " >&6; }
6207 if ${am_cv_func_iconv+:} false; then :
47096208 $as_echo_n "(cached) " >&6
47106209 else
4711 ac_func_search_save_LIBS=$LIBS
4712 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6210
6211 am_cv_func_iconv="no, consider installing GNU libiconv"
6212 am_cv_lib_iconv=no
6213 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47136214 /* end confdefs.h. */
47146215
4715 /* Override any GCC internal prototype to avoid an error.
4716 Use char because int might match the return type of a GCC
4717 builtin and then its argument prototype would still apply. */
4718 #ifdef __cplusplus
4719 extern "C"
4720 #endif
4721 char iconv_open ();
6216 #include <stdlib.h>
6217 #include <iconv.h>
6218
47226219 int
47236220 main ()
47246221 {
4725 return iconv_open ();
6222 iconv_t cd = iconv_open("","");
6223 iconv(cd,NULL,NULL,NULL,NULL);
6224 iconv_close(cd);
47266225 ;
47276226 return 0;
47286227 }
47296228 _ACEOF
4730 for ac_lib in '' iconv; do
4731 if test -z "$ac_lib"; then
4732 ac_res="none required"
6229 if ac_fn_c_try_link "$LINENO"; then :
6230 am_cv_func_iconv=yes
6231 fi
6232 rm -f core conftest.err conftest.$ac_objext \
6233 conftest$ac_exeext conftest.$ac_ext
6234 if test "$am_cv_func_iconv" != yes; then
6235 am_save_LIBS="$LIBS"
6236 LIBS="$LIBS $LIBICONV"
6237 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6238 /* end confdefs.h. */
6239
6240 #include <stdlib.h>
6241 #include <iconv.h>
6242
6243 int
6244 main ()
6245 {
6246 iconv_t cd = iconv_open("","");
6247 iconv(cd,NULL,NULL,NULL,NULL);
6248 iconv_close(cd);
6249 ;
6250 return 0;
6251 }
6252 _ACEOF
6253 if ac_fn_c_try_link "$LINENO"; then :
6254 am_cv_lib_iconv=yes
6255 am_cv_func_iconv=yes
6256 fi
6257 rm -f core conftest.err conftest.$ac_objext \
6258 conftest$ac_exeext conftest.$ac_ext
6259 LIBS="$am_save_LIBS"
6260 fi
6261
6262 fi
6263 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5
6264 $as_echo "$am_cv_func_iconv" >&6; }
6265 if test "$am_cv_func_iconv" = yes; then
6266 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5
6267 $as_echo_n "checking for working iconv... " >&6; }
6268 if ${am_cv_func_iconv_works+:} false; then :
6269 $as_echo_n "(cached) " >&6
6270 else
6271
6272 am_save_LIBS="$LIBS"
6273 if test $am_cv_lib_iconv = yes; then
6274 LIBS="$LIBS $LIBICONV"
6275 fi
6276 am_cv_func_iconv_works=no
6277 for ac_iconv_const in '' 'const'; do
6278 if test "$cross_compiling" = yes; then :
6279 case "$host_os" in
6280 aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
6281 *) am_cv_func_iconv_works="guessing yes" ;;
6282 esac
6283 else
6284 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6285 /* end confdefs.h. */
6286
6287 #include <iconv.h>
6288 #include <string.h>
6289
6290 #ifndef ICONV_CONST
6291 # define ICONV_CONST $ac_iconv_const
6292 #endif
6293
6294 int
6295 main ()
6296 {
6297 int result = 0;
6298 /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
6299 returns. */
6300 {
6301 iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
6302 if (cd_utf8_to_88591 != (iconv_t)(-1))
6303 {
6304 static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
6305 char buf[10];
6306 ICONV_CONST char *inptr = input;
6307 size_t inbytesleft = strlen (input);
6308 char *outptr = buf;
6309 size_t outbytesleft = sizeof (buf);
6310 size_t res = iconv (cd_utf8_to_88591,
6311 &inptr, &inbytesleft,
6312 &outptr, &outbytesleft);
6313 if (res == 0)
6314 result |= 1;
6315 iconv_close (cd_utf8_to_88591);
6316 }
6317 }
6318 /* Test against Solaris 10 bug: Failures are not distinguishable from
6319 successful returns. */
6320 {
6321 iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
6322 if (cd_ascii_to_88591 != (iconv_t)(-1))
6323 {
6324 static ICONV_CONST char input[] = "\263";
6325 char buf[10];
6326 ICONV_CONST char *inptr = input;
6327 size_t inbytesleft = strlen (input);
6328 char *outptr = buf;
6329 size_t outbytesleft = sizeof (buf);
6330 size_t res = iconv (cd_ascii_to_88591,
6331 &inptr, &inbytesleft,
6332 &outptr, &outbytesleft);
6333 if (res == 0)
6334 result |= 2;
6335 iconv_close (cd_ascii_to_88591);
6336 }
6337 }
6338 /* Test against AIX 6.1..7.1 bug: Buffer overrun. */
6339 {
6340 iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
6341 if (cd_88591_to_utf8 != (iconv_t)(-1))
6342 {
6343 static ICONV_CONST char input[] = "\304";
6344 static char buf[2] = { (char)0xDE, (char)0xAD };
6345 ICONV_CONST char *inptr = input;
6346 size_t inbytesleft = 1;
6347 char *outptr = buf;
6348 size_t outbytesleft = 1;
6349 size_t res = iconv (cd_88591_to_utf8,
6350 &inptr, &inbytesleft,
6351 &outptr, &outbytesleft);
6352 if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
6353 result |= 4;
6354 iconv_close (cd_88591_to_utf8);
6355 }
6356 }
6357 #if 0 /* This bug could be worked around by the caller. */
6358 /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
6359 {
6360 iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
6361 if (cd_88591_to_utf8 != (iconv_t)(-1))
6362 {
6363 static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
6364 char buf[50];
6365 ICONV_CONST char *inptr = input;
6366 size_t inbytesleft = strlen (input);
6367 char *outptr = buf;
6368 size_t outbytesleft = sizeof (buf);
6369 size_t res = iconv (cd_88591_to_utf8,
6370 &inptr, &inbytesleft,
6371 &outptr, &outbytesleft);
6372 if ((int)res > 0)
6373 result |= 8;
6374 iconv_close (cd_88591_to_utf8);
6375 }
6376 }
6377 #endif
6378 /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
6379 provided. */
6380 if (/* Try standardized names. */
6381 iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
6382 /* Try IRIX, OSF/1 names. */
6383 && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
6384 /* Try AIX names. */
6385 && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
6386 /* Try HP-UX names. */
6387 && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
6388 result |= 16;
6389 return result;
6390
6391 ;
6392 return 0;
6393 }
6394 _ACEOF
6395 if ac_fn_c_try_run "$LINENO"; then :
6396 am_cv_func_iconv_works=yes
6397 fi
6398 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
6399 conftest.$ac_objext conftest.beam conftest.$ac_ext
6400 fi
6401
6402 test "$am_cv_func_iconv_works" = no || break
6403 done
6404 LIBS="$am_save_LIBS"
6405
6406 fi
6407 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5
6408 $as_echo "$am_cv_func_iconv_works" >&6; }
6409 case "$am_cv_func_iconv_works" in
6410 *no) am_func_iconv=no am_cv_lib_iconv=no ;;
6411 *) am_func_iconv=yes ;;
6412 esac
47336413 else
4734 ac_res=-l$ac_lib
4735 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
6414 am_func_iconv=no am_cv_lib_iconv=no
47366415 fi
4737 if ac_fn_c_try_link "$LINENO"; then :
4738 ac_cv_search_iconv_open=$ac_res
4739 fi
4740 rm -f core conftest.err conftest.$ac_objext \
4741 conftest$ac_exeext
4742 if ${ac_cv_search_iconv_open+:} false; then :
4743 break
4744 fi
4745 done
4746 if ${ac_cv_search_iconv_open+:} false; then :
4747
4748 else
4749 ac_cv_search_iconv_open=no
4750 fi
4751 rm conftest.$ac_ext
4752 LIBS=$ac_func_search_save_LIBS
4753 fi
4754 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_iconv_open" >&5
4755 $as_echo "$ac_cv_search_iconv_open" >&6; }
4756 ac_res=$ac_cv_search_iconv_open
4757 if test "$ac_res" != no; then :
4758 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
4759
4760 fi
4761
6416 if test "$am_func_iconv" = yes; then
6417
6418 $as_echo "#define HAVE_ICONV 1" >>confdefs.h
6419
6420 fi
6421 if test "$am_cv_lib_iconv" = yes; then
6422 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5
6423 $as_echo_n "checking how to link with libiconv... " >&6; }
6424 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5
6425 $as_echo "$LIBICONV" >&6; }
6426 else
6427 CPPFLAGS="$am_save_CPPFLAGS"
6428 LIBICONV=
6429 LTLIBICONV=
6430 fi
6431
6432
6433
6434 if test "$am_cv_func_iconv" = yes; then
6435 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5
6436 $as_echo_n "checking for iconv declaration... " >&6; }
6437 if ${am_cv_proto_iconv+:} false; then :
6438 $as_echo_n "(cached) " >&6
6439 else
6440
6441 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6442 /* end confdefs.h. */
6443
6444 #include <stdlib.h>
6445 #include <iconv.h>
6446 extern
6447 #ifdef __cplusplus
6448 "C"
6449 #endif
6450 #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
6451 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
6452 #else
6453 size_t iconv();
6454 #endif
6455
6456 int
6457 main ()
6458 {
6459
6460 ;
6461 return 0;
6462 }
6463 _ACEOF
6464 if ac_fn_c_try_compile "$LINENO"; then :
6465 am_cv_proto_iconv_arg1=""
6466 else
6467 am_cv_proto_iconv_arg1="const"
6468 fi
6469 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6470 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
6471 fi
6472
6473 am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
6474 { $as_echo "$as_me:${as_lineno-$LINENO}: result:
6475 $am_cv_proto_iconv" >&5
6476 $as_echo "
6477 $am_cv_proto_iconv" >&6; }
6478
6479 cat >>confdefs.h <<_ACEOF
6480 #define ICONV_CONST $am_cv_proto_iconv_arg1
6481 _ACEOF
6482
6483
6484 fi
6485
6486 fi
47626487
47636488 # xxd (distributed with vim) is used in the testsuite
47646489 # Extract the first word of "xxd", so it can be a program name with args.
49856710 as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
49866711 Usually this means the macro was only invoked conditionally." "$LINENO" 5
49876712 fi
6713 if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
6714 as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
6715 Usually this means the macro was only invoked conditionally." "$LINENO" 5
6716 fi
49886717 if test -z "${AUTOMAKE_TEST_COMPAT_TRUE}" && test -z "${AUTOMAKE_TEST_COMPAT_FALSE}"; then
49896718 as_fn_error $? "conditional \"AUTOMAKE_TEST_COMPAT\" was never defined.
49906719 Usually this means the macro was only invoked conditionally." "$LINENO" 5
53867115 # report actual input values of CONFIG_FILES etc. instead of their
53877116 # values after options handling.
53887117 ac_log="
5389 This file was extended by dosfstools $as_me 4.1, which was
7118 This file was extended by dosfstools $as_me 4.2, which was
53907119 generated by GNU Autoconf 2.69. Invocation command line was
53917120
53927121 CONFIG_FILES = $CONFIG_FILES
54437172 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
54447173 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
54457174 ac_cs_version="\\
5446 dosfstools config.status 4.1
7175 dosfstools config.status 4.2
54477176 configured by $0, generated by GNU Autoconf 2.69,
54487177 with options \\"\$ac_cs_config\\"
54497178
55517280 #
55527281 # INIT-COMMANDS
55537282 #
5554 AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
7283 AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
55557284
55567285 _ACEOF
55577286
60037732 # Older Autoconf quotes --file arguments for eval, but not when files
60047733 # are listed without --file. Let's play safe and only enable the eval
60057734 # if we detect the quoting.
6006 case $CONFIG_FILES in
6007 *\'*) eval set x "$CONFIG_FILES" ;;
6008 *) set x $CONFIG_FILES ;;
6009 esac
7735 # TODO: see whether this extra hack can be removed once we start
7736 # requiring Autoconf 2.70 or later.
7737 case $CONFIG_FILES in #(
7738 *\'*) :
7739 eval set x "$CONFIG_FILES" ;; #(
7740 *) :
7741 set x $CONFIG_FILES ;; #(
7742 *) :
7743 ;;
7744 esac
60107745 shift
6011 for mf
7746 # Used to flag and report bootstrapping failures.
7747 am_rc=0
7748 for am_mf
60127749 do
60137750 # Strip MF so we end up with the name of the file.
6014 mf=`echo "$mf" | sed -e 's/:.*$//'`
6015 # Check whether this is an Automake generated Makefile or not.
6016 # We used to match only the files named 'Makefile.in', but
6017 # some people rename them; so instead we look at the file content.
6018 # Grep'ing the first line is not enough: some people post-process
6019 # each Makefile.in and add a new line on top of each file to say so.
6020 # Grep'ing the whole file is not good either: AIX grep has a line
7751 am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
7752 # Check whether this is an Automake generated Makefile which includes
7753 # dependency-tracking related rules and includes.
7754 # Grep'ing the whole file directly is not great: AIX grep has a line
60217755 # limit of 2048, but all sed's we know have understand at least 4000.
6022 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
6023 dirpart=`$as_dirname -- "$mf" ||
6024 $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
6025 X"$mf" : 'X\(//\)[^/]' \| \
6026 X"$mf" : 'X\(//\)$' \| \
6027 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
6028 $as_echo X"$mf" |
7756 sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
7757 || continue
7758 am_dirpart=`$as_dirname -- "$am_mf" ||
7759 $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
7760 X"$am_mf" : 'X\(//\)[^/]' \| \
7761 X"$am_mf" : 'X\(//\)$' \| \
7762 X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
7763 $as_echo X"$am_mf" |
60297764 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
60307765 s//\1/
60317766 q
60437778 q
60447779 }
60457780 s/.*/./; q'`
6046 else
6047 continue
6048 fi
6049 # Extract the definition of DEPDIR, am__include, and am__quote
6050 # from the Makefile without running 'make'.
6051 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
6052 test -z "$DEPDIR" && continue
6053 am__include=`sed -n 's/^am__include = //p' < "$mf"`
6054 test -z "$am__include" && continue
6055 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
6056 # Find all dependency output files, they are included files with
6057 # $(DEPDIR) in their names. We invoke sed twice because it is the
6058 # simplest approach to changing $(DEPDIR) to its actual value in the
6059 # expansion.
6060 for file in `sed -n "
6061 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
6062 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
6063 # Make sure the directory exists.
6064 test -f "$dirpart/$file" && continue
6065 fdir=`$as_dirname -- "$file" ||
6066 $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
6067 X"$file" : 'X\(//\)[^/]' \| \
6068 X"$file" : 'X\(//\)$' \| \
6069 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
6070 $as_echo X"$file" |
6071 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
7781 am_filepart=`$as_basename -- "$am_mf" ||
7782 $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
7783 X"$am_mf" : 'X\(//\)$' \| \
7784 X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
7785 $as_echo X/"$am_mf" |
7786 sed '/^.*\/\([^/][^/]*\)\/*$/{
60727787 s//\1/
60737788 q
60747789 }
6075 /^X\(\/\/\)[^/].*/{
7790 /^X\/\(\/\/\)$/{
60767791 s//\1/
60777792 q
60787793 }
6079 /^X\(\/\/\)$/{
6080 s//\1/
6081 q
6082 }
6083 /^X\(\/\).*/{
7794 /^X\/\(\/\).*/{
60847795 s//\1/
60857796 q
60867797 }
60877798 s/.*/./; q'`
6088 as_dir=$dirpart/$fdir; as_fn_mkdir_p
6089 # echo "creating $dirpart/$file"
6090 echo '# dummy' > "$dirpart/$file"
6091 done
7799 { echo "$as_me:$LINENO: cd "$am_dirpart" \
7800 && sed -e '/# am--include-marker/d' "$am_filepart" \
7801 | $MAKE -f - am--depfiles" >&5
7802 (cd "$am_dirpart" \
7803 && sed -e '/# am--include-marker/d' "$am_filepart" \
7804 | $MAKE -f - am--depfiles) >&5 2>&5
7805 ac_status=$?
7806 echo "$as_me:$LINENO: \$? = $ac_status" >&5
7807 (exit $ac_status); } || am_rc=$?
60927808 done
7809 if test $am_rc -ne 0; then
7810 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
7811 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
7812 as_fn_error $? "Something went wrong bootstrapping makefile fragments
7813 for automatic dependency tracking. Try re-running configure with the
7814 '--disable-dependency-tracking' option to at least be able to build
7815 the package (albeit without support for automatic dependency tracking).
7816 See \`config.log' for more details" "$LINENO" 5; }
7817 fi
7818 { am_dirpart=; unset am_dirpart;}
7819 { am_filepart=; unset am_filepart;}
7820 { am_mf=; unset am_mf;}
7821 { am_rc=; unset am_rc;}
7822 rm -f conftest-deps.mk
60937823 }
60947824 ;;
60957825
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.1])
17 AC_SUBST([RELEASE_DATE], [2017-01-24])
16 AC_INIT([dosfstools], [4.2])
17 AC_SUBST([RELEASE_DATE], [2021-01-31])
1818 AM_INIT_AUTOMAKE([1.11 foreign subdir-objects parallel-tests])
1919
2020 AC_ARG_ENABLE([compat-symlinks],
2828 [symlinks=false])
2929 AM_CONDITIONAL([COMPAT_SYMLINKS], [test x$symlinks = xtrue])
3030
31 AC_ARG_ENABLE([atari-check],
32 [AS_HELP_STRING([--enable-atari-check],
33 [enable legacy check to let tools switch to Atari mode
34 when they detect they are running on 68k Atari
35 hardware (Linux only)])],
36 [case "${enableval}" in
37 yes) AC_SUBST(CHECKATARI, [1])
38 AC_DEFINE(CONF_CHECK_ATARI) ;;
39 no) AC_SUBST(CHECKATARI, [0]) ;;
40 *) AC_MSG_ERROR([bad value ${enableval} for --enable-atari-check]) ;;
41 esac],
42 [AC_SUBST(CHECKATARI, [0])])
43
44 AC_USE_SYSTEM_EXTENSIONS
3145
3246 AC_PROG_CC
3347 AC_PROG_LN_S
3953 linux/fd.h \
4054 linux/hdreg.h \
4155 linux/version.h \
56 linux/loop.h \
4257 sys/disk.h \
4358 sys/disklabel.h \
4459 sys/ioccom.h \
4863
4964 AC_CHECK_HEADERS([endian.h sys/endian.h libkern/OSByteOrder.h])
5065
66 AC_CHECK_FUNCS([vasprintf])
67
5168 AC_CHECK_DECLS([getmntent], [], [], [[#include <mntent.h>]])
5269 AC_CHECK_DECLS([getmntinfo], [], [], [[#include <sys/mount.h>]])
5370
54 AC_ARG_WITH([udev], AS_HELP_STRING([--without-udev], [build without libudev support]))
55 if test "x$with_udev" != "xno"; then
56 PKG_CHECK_MODULES([UDEV], [libudev],
57 [AC_DEFINE([HAVE_UDEV], [1])],
58 [true])
71 # optional iconv support
72 AC_ARG_WITH([iconv], AS_HELP_STRING([--without-iconv], [build without iconv support]))
73 if test "x$with_iconv" != "xno"; then
74 AM_ICONV
5975 fi
60
61 AC_SEARCH_LIBS(iconv_open, iconv)
6276
6377 # xxd (distributed with vim) is used in the testsuite
6478 AC_CHECK_PROG([XXD_FOUND], [xxd], [yes])
00 #! /bin/sh
11 # depcomp - compile a program generating dependencies as side-effects
22
3 scriptversion=2013-05-30.07; # UTC
4
5 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
3 scriptversion=2018-03-07.03; # UTC
4
5 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
66
77 # This program is free software; you can redistribute it and/or modify
88 # it under the terms of the GNU General Public License as published by
1515 # GNU General Public License for more details.
1616
1717 # 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/>.
18 # along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
2020 # As a special exception to the GNU General Public License, if you
2121 # distribute this file as part of a program that contains a
782782 # Local Variables:
783783 # mode: shell-script
784784 # sh-indentation: 2
785 # eval: (add-hook 'write-file-hooks 'time-stamp)
785 # eval: (add-hook 'before-save-hook 'time-stamp)
786786 # time-stamp-start: "scriptversion="
787787 # time-stamp-format: "%:y-%02m-%02d.%02H"
788 # time-stamp-time-zone: "UTC"
788 # time-stamp-time-zone: "UTC0"
789789 # time-stamp-end: "; # UTC"
790790 # End:
00 #!/bin/sh
11 # install - install a program, script, or datafile
22
3 scriptversion=2011-11-20.07; # UTC
3 scriptversion=2018-03-11.20; # UTC
44
55 # This originates from X11R5 (mit/util/scripts/install.sh), which was
66 # later released in X11R6 (xc/config/util/install.sh) with the
4040 # This script is compatible with the BSD install script, but was written
4141 # from scratch.
4242
43 tab=' '
4344 nl='
4445 '
45 IFS=" "" $nl"
46
47 # set DOITPROG to echo to test this script
48
49 # Don't use :- since 4.3BSD and earlier shells don't like it.
46 IFS=" $tab$nl"
47
48 # Set DOITPROG to "echo" to test this script.
49
5050 doit=${DOITPROG-}
51 if test -z "$doit"; then
52 doit_exec=exec
53 else
54 doit_exec=$doit
55 fi
51 doit_exec=${doit:-exec}
5652
5753 # Put in absolute file names if you don't have them in your path;
5854 # or use environment vars.
6763 rmprog=${RMPROG-rm}
6864 stripprog=${STRIPPROG-strip}
6965
70 posix_glob='?'
71 initialize_posix_glob='
72 test "$posix_glob" != "?" || {
73 if (set -f) 2>/dev/null; then
74 posix_glob=
75 else
76 posix_glob=:
77 fi
78 }
79 '
80
8166 posix_mkdir=
8267
8368 # Desired mode of installed file.
9681 dst_arg=
9782
9883 copy_on_change=false
99 no_target_directory=
84 is_target_a_directory=possibly
10085
10186 usage="\
10287 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
136121 -d) dir_arg=true;;
137122
138123 -g) chgrpcmd="$chgrpprog $2"
139 shift;;
124 shift;;
140125
141126 --help) echo "$usage"; exit $?;;
142127
143128 -m) mode=$2
144 case $mode in
145 *' '* | *' '* | *'
146 '* | *'*'* | *'?'* | *'['*)
147 echo "$0: invalid mode: $mode" >&2
148 exit 1;;
149 esac
150 shift;;
129 case $mode in
130 *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
131 echo "$0: invalid mode: $mode" >&2
132 exit 1;;
133 esac
134 shift;;
151135
152136 -o) chowncmd="$chownprog $2"
153 shift;;
137 shift;;
154138
155139 -s) stripcmd=$stripprog;;
156140
157 -t) dst_arg=$2
158 # Protect names problematic for 'test' and other utilities.
159 case $dst_arg in
160 -* | [=\(\)!]) dst_arg=./$dst_arg;;
161 esac
162 shift;;
163
164 -T) no_target_directory=true;;
141 -t)
142 is_target_a_directory=always
143 dst_arg=$2
144 # Protect names problematic for 'test' and other utilities.
145 case $dst_arg in
146 -* | [=\(\)!]) dst_arg=./$dst_arg;;
147 esac
148 shift;;
149
150 -T) is_target_a_directory=never;;
165151
166152 --version) echo "$0 $scriptversion"; exit $?;;
167153
168 --) shift
169 break;;
170
171 -*) echo "$0: invalid option: $1" >&2
172 exit 1;;
154 --) shift
155 break;;
156
157 -*) echo "$0: invalid option: $1" >&2
158 exit 1;;
173159
174160 *) break;;
175161 esac
176162 shift
177163 done
164
165 # We allow the use of options -d and -T together, by making -d
166 # take the precedence; this is for compatibility with GNU install.
167
168 if test -n "$dir_arg"; then
169 if test -n "$dst_arg"; then
170 echo "$0: target directory not allowed when installing a directory." >&2
171 exit 1
172 fi
173 fi
178174
179175 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
180176 # When -d is used, all remaining arguments are directories to create.
207203 fi
208204
209205 if test -z "$dir_arg"; then
206 if test $# -gt 1 || test "$is_target_a_directory" = always; then
207 if test ! -d "$dst_arg"; then
208 echo "$0: $dst_arg: Is not a directory." >&2
209 exit 1
210 fi
211 fi
212 fi
213
214 if test -z "$dir_arg"; then
210215 do_exit='(exit $ret); exit $ret'
211216 trap "ret=129; $do_exit" 1
212217 trap "ret=130; $do_exit" 2
222227
223228 *[0-7])
224229 if test -z "$stripcmd"; then
225 u_plus_rw=
230 u_plus_rw=
226231 else
227 u_plus_rw='% 200'
232 u_plus_rw='% 200'
228233 fi
229234 cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
230235 *)
231236 if test -z "$stripcmd"; then
232 u_plus_rw=
237 u_plus_rw=
233238 else
234 u_plus_rw=,u+rw
239 u_plus_rw=,u+rw
235240 fi
236241 cp_umask=$mode$u_plus_rw;;
237242 esac
265270 fi
266271 dst=$dst_arg
267272
268 # If destination is a directory, append the input filename; won't work
269 # if double slashes aren't ignored.
273 # If destination is a directory, append the input filename.
270274 if test -d "$dst"; then
271 if test -n "$no_target_directory"; then
272 echo "$0: $dst_arg: Is a directory" >&2
273 exit 1
275 if test "$is_target_a_directory" = never; then
276 echo "$0: $dst_arg: Is a directory" >&2
277 exit 1
274278 fi
275279 dstdir=$dst
276 dst=$dstdir/`basename "$src"`
280 dstbase=`basename "$src"`
281 case $dst in
282 */) dst=$dst$dstbase;;
283 *) dst=$dst/$dstbase;;
284 esac
277285 dstdir_status=0
278286 else
279 # Prefer dirname, but fall back on a substitute if dirname fails.
280 dstdir=`
281 (dirname "$dst") 2>/dev/null ||
282 expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
283 X"$dst" : 'X\(//\)[^/]' \| \
284 X"$dst" : 'X\(//\)$' \| \
285 X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
286 echo X"$dst" |
287 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
288 s//\1/
289 q
290 }
291 /^X\(\/\/\)[^/].*/{
292 s//\1/
293 q
294 }
295 /^X\(\/\/\)$/{
296 s//\1/
297 q
298 }
299 /^X\(\/\).*/{
300 s//\1/
301 q
302 }
303 s/.*/./; q'
304 `
305
287 dstdir=`dirname "$dst"`
306288 test -d "$dstdir"
307289 dstdir_status=$?
308290 fi
309291 fi
310292
293 case $dstdir in
294 */) dstdirslash=$dstdir;;
295 *) dstdirslash=$dstdir/;;
296 esac
297
311298 obsolete_mkdir_used=false
312299
313300 if test $dstdir_status != 0; then
314301 case $posix_mkdir in
315302 '')
316 # Create intermediate dirs using mode 755 as modified by the umask.
317 # This is like FreeBSD 'install' as of 1997-10-28.
318 umask=`umask`
319 case $stripcmd.$umask in
320 # Optimize common cases.
321 *[2367][2367]) mkdir_umask=$umask;;
322 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
323
324 *[0-7])
325 mkdir_umask=`expr $umask + 22 \
326 - $umask % 100 % 40 + $umask % 20 \
327 - $umask % 10 % 4 + $umask % 2
328 `;;
329 *) mkdir_umask=$umask,go-w;;
330 esac
331
332 # With -d, create the new directory with the user-specified mode.
333 # Otherwise, rely on $mkdir_umask.
334 if test -n "$dir_arg"; then
335 mkdir_mode=-m$mode
336 else
337 mkdir_mode=
338 fi
339
340 posix_mkdir=false
341 case $umask in
342 *[123567][0-7][0-7])
343 # POSIX mkdir -p sets u+wx bits regardless of umask, which
344 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
345 ;;
346 *)
347 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
348 trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
349
350 if (umask $mkdir_umask &&
351 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
352 then
353 if test -z "$dir_arg" || {
354 # Check for POSIX incompatibilities with -m.
355 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
356 # other-writable bit of parent directory when it shouldn't.
357 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
358 ls_ld_tmpdir=`ls -ld "$tmpdir"`
359 case $ls_ld_tmpdir in
360 d????-?r-*) different_mode=700;;
361 d????-?--*) different_mode=755;;
362 *) false;;
363 esac &&
364 $mkdirprog -m$different_mode -p -- "$tmpdir" && {
365 ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
366 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
367 }
368 }
369 then posix_mkdir=:
370 fi
371 rmdir "$tmpdir/d" "$tmpdir"
372 else
373 # Remove any dirs left behind by ancient mkdir implementations.
374 rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
375 fi
376 trap '' 0;;
377 esac;;
303 # Create intermediate dirs using mode 755 as modified by the umask.
304 # This is like FreeBSD 'install' as of 1997-10-28.
305 umask=`umask`
306 case $stripcmd.$umask in
307 # Optimize common cases.
308 *[2367][2367]) mkdir_umask=$umask;;
309 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
310
311 *[0-7])
312 mkdir_umask=`expr $umask + 22 \
313 - $umask % 100 % 40 + $umask % 20 \
314 - $umask % 10 % 4 + $umask % 2
315 `;;
316 *) mkdir_umask=$umask,go-w;;
317 esac
318
319 # With -d, create the new directory with the user-specified mode.
320 # Otherwise, rely on $mkdir_umask.
321 if test -n "$dir_arg"; then
322 mkdir_mode=-m$mode
323 else
324 mkdir_mode=
325 fi
326
327 posix_mkdir=false
328 case $umask in
329 *[123567][0-7][0-7])
330 # POSIX mkdir -p sets u+wx bits regardless of umask, which
331 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
332 ;;
333 *)
334 # Note that $RANDOM variable is not portable (e.g. dash); Use it
335 # here however when possible just to lower collision chance.
336 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
337
338 trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
339
340 # Because "mkdir -p" follows existing symlinks and we likely work
341 # directly in world-writeable /tmp, make sure that the '$tmpdir'
342 # directory is successfully created first before we actually test
343 # 'mkdir -p' feature.
344 if (umask $mkdir_umask &&
345 $mkdirprog $mkdir_mode "$tmpdir" &&
346 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
347 then
348 if test -z "$dir_arg" || {
349 # Check for POSIX incompatibilities with -m.
350 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
351 # other-writable bit of parent directory when it shouldn't.
352 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
353 test_tmpdir="$tmpdir/a"
354 ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
355 case $ls_ld_tmpdir in
356 d????-?r-*) different_mode=700;;
357 d????-?--*) different_mode=755;;
358 *) false;;
359 esac &&
360 $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
361 ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
362 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
363 }
364 }
365 then posix_mkdir=:
366 fi
367 rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
368 else
369 # Remove any dirs left behind by ancient mkdir implementations.
370 rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
371 fi
372 trap '' 0;;
373 esac;;
378374 esac
379375
380376 if
381377 $posix_mkdir && (
382 umask $mkdir_umask &&
383 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
378 umask $mkdir_umask &&
379 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
384380 )
385381 then :
386382 else
390386 # directory the slow way, step by step, checking for races as we go.
391387
392388 case $dstdir in
393 /*) prefix='/';;
394 [-=\(\)!]*) prefix='./';;
395 *) prefix='';;
389 /*) prefix='/';;
390 [-=\(\)!]*) prefix='./';;
391 *) prefix='';;
396392 esac
397
398 eval "$initialize_posix_glob"
399393
400394 oIFS=$IFS
401395 IFS=/
402 $posix_glob set -f
396 set -f
403397 set fnord $dstdir
404398 shift
405 $posix_glob set +f
399 set +f
406400 IFS=$oIFS
407401
408402 prefixes=
409403
410404 for d
411405 do
412 test X"$d" = X && continue
413
414 prefix=$prefix$d
415 if test -d "$prefix"; then
416 prefixes=
417 else
418 if $posix_mkdir; then
419 (umask=$mkdir_umask &&
420 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
421 # Don't fail if two instances are running concurrently.
422 test -d "$prefix" || exit 1
423 else
424 case $prefix in
425 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
426 *) qprefix=$prefix;;
427 esac
428 prefixes="$prefixes '$qprefix'"
429 fi
430 fi
431 prefix=$prefix/
406 test X"$d" = X && continue
407
408 prefix=$prefix$d
409 if test -d "$prefix"; then
410 prefixes=
411 else
412 if $posix_mkdir; then
413 (umask=$mkdir_umask &&
414 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
415 # Don't fail if two instances are running concurrently.
416 test -d "$prefix" || exit 1
417 else
418 case $prefix in
419 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
420 *) qprefix=$prefix;;
421 esac
422 prefixes="$prefixes '$qprefix'"
423 fi
424 fi
425 prefix=$prefix/
432426 done
433427
434428 if test -n "$prefixes"; then
435 # Don't fail if two instances are running concurrently.
436 (umask $mkdir_umask &&
437 eval "\$doit_exec \$mkdirprog $prefixes") ||
438 test -d "$dstdir" || exit 1
439 obsolete_mkdir_used=true
429 # Don't fail if two instances are running concurrently.
430 (umask $mkdir_umask &&
431 eval "\$doit_exec \$mkdirprog $prefixes") ||
432 test -d "$dstdir" || exit 1
433 obsolete_mkdir_used=true
440434 fi
441435 fi
442436 fi
449443 else
450444
451445 # Make a couple of temp file names in the proper directory.
452 dsttmp=$dstdir/_inst.$$_
453 rmtmp=$dstdir/_rm.$$_
446 dsttmp=${dstdirslash}_inst.$$_
447 rmtmp=${dstdirslash}_rm.$$_
454448
455449 # Trap to clean up those temp files at exit.
456450 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
471465
472466 # If -C, don't bother to copy if it wouldn't change the file.
473467 if $copy_on_change &&
474 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
475 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
476
477 eval "$initialize_posix_glob" &&
478 $posix_glob set -f &&
468 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
469 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
470 set -f &&
479471 set X $old && old=:$2:$4:$5:$6 &&
480472 set X $new && new=:$2:$4:$5:$6 &&
481 $posix_glob set +f &&
482
473 set +f &&
483474 test "$old" = "$new" &&
484475 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
485476 then
492483 # to itself, or perhaps because mv is so ancient that it does not
493484 # support -f.
494485 {
495 # Now remove or move aside any old file at destination location.
496 # We try this two ways since rm can't unlink itself on some
497 # systems and the destination file might be busy for other
498 # reasons. In this case, the final cleanup might fail but the new
499 # file should still install successfully.
500 {
501 test ! -f "$dst" ||
502 $doit $rmcmd -f "$dst" 2>/dev/null ||
503 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
504 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
505 } ||
506 { echo "$0: cannot unlink or rename $dst" >&2
507 (exit 1); exit 1
508 }
509 } &&
510
511 # Now rename the file to the real destination.
512 $doit $mvcmd "$dsttmp" "$dst"
486 # Now remove or move aside any old file at destination location.
487 # We try this two ways since rm can't unlink itself on some
488 # systems and the destination file might be busy for other
489 # reasons. In this case, the final cleanup might fail but the new
490 # file should still install successfully.
491 {
492 test ! -f "$dst" ||
493 $doit $rmcmd -f "$dst" 2>/dev/null ||
494 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
495 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
496 } ||
497 { echo "$0: cannot unlink or rename $dst" >&2
498 (exit 1); exit 1
499 }
500 } &&
501
502 # Now rename the file to the real destination.
503 $doit $mvcmd "$dsttmp" "$dst"
513504 }
514505 fi || exit 1
515506
518509 done
519510
520511 # Local variables:
521 # eval: (add-hook 'write-file-hooks 'time-stamp)
512 # eval: (add-hook 'before-save-hook 'time-stamp)
522513 # time-stamp-start: "scriptversion="
523514 # time-stamp-format: "%:y-%02m-%02d.%02H"
524 # time-stamp-time-zone: "UTC"
515 # time-stamp-time-zone: "UTC0"
525516 # time-stamp-end: "; # UTC"
526517 # End:
0 # Makefile.in generated by automake 1.15 from Makefile.am.
0 # Makefile.in generated by automake 1.16.1 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2014 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2018 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
100100 NORMAL_UNINSTALL = :
101101 PRE_UNINSTALL = :
102102 POST_UNINSTALL = :
103 build_triplet = @build@
104 host_triplet = @host@
103105 subdir = manpages
104106 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
105107 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
173175 CC = @CC@
174176 CCDEPMODE = @CCDEPMODE@
175177 CFLAGS = @CFLAGS@
178 CHECKATARI = @CHECKATARI@
176179 CPP = @CPP@
177180 CPPFLAGS = @CPPFLAGS@
178181 CYGPATH_W = @CYGPATH_W@
190193 INSTALL_SCRIPT = @INSTALL_SCRIPT@
191194 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
192195 LDFLAGS = @LDFLAGS@
196 LIBICONV = @LIBICONV@
193197 LIBOBJS = @LIBOBJS@
194198 LIBS = @LIBS@
195199 LN_S = @LN_S@
200 LTLIBICONV = @LTLIBICONV@
196201 LTLIBOBJS = @LTLIBOBJS@
197202 MAKEINFO = @MAKEINFO@
198203 MKDIR_P = @MKDIR_P@
205210 PACKAGE_URL = @PACKAGE_URL@
206211 PACKAGE_VERSION = @PACKAGE_VERSION@
207212 PATH_SEPARATOR = @PATH_SEPARATOR@
208 PKG_CONFIG = @PKG_CONFIG@
209 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
210 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
211213 RELEASE_DATE = @RELEASE_DATE@
212214 SET_MAKE = @SET_MAKE@
213215 SHELL = @SHELL@
214216 STRIP = @STRIP@
215 UDEV_CFLAGS = @UDEV_CFLAGS@
216 UDEV_LIBS = @UDEV_LIBS@
217217 VERSION = @VERSION@
218218 XXD_FOUND = @XXD_FOUND@
219219 abs_builddir = @abs_builddir@
227227 am__tar = @am__tar@
228228 am__untar = @am__untar@
229229 bindir = @bindir@
230 build = @build@
230231 build_alias = @build_alias@
232 build_cpu = @build_cpu@
233 build_os = @build_os@
234 build_vendor = @build_vendor@
231235 builddir = @builddir@
232236 datadir = @datadir@
233237 datarootdir = @datarootdir@
234238 docdir = @docdir@
235239 dvidir = @dvidir@
236240 exec_prefix = @exec_prefix@
241 host = @host@
237242 host_alias = @host_alias@
243 host_cpu = @host_cpu@
244 host_os = @host_os@
245 host_vendor = @host_vendor@
238246 htmldir = @htmldir@
239247 includedir = @includedir@
240248 infodir = @infodir@
280288 *config.status*) \
281289 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
282290 *) \
283 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
284 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
291 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
292 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
285293 esac;
286294
287295 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
348356 cscope cscopelist:
349357
350358
351 distdir: $(DISTFILES)
359 distdir: $(BUILT_SOURCES)
360 $(MAKE) $(AM_MAKEFLAGS) distdir-am
361
362 distdir-am: $(DISTFILES)
352363 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
353364 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
354365 list='$(DISTFILES)'; \
00 .\" fatlabel.8 - manpage for fatlabel
11 .\"
22 .\" Copyright (C) 2006-2014 Daniel Baumann <daniel@debian.org>
3 .\" Copyright (C) 2017 Andreas Bombe <aeb@debian.org>
4 .\" Copyright (C) 2017-2021 Pali Rohár <pali.rohar@gmail.com>
35 .\"
46 .\" This program is free software: you can redistribute it and/or modify
57 .\" it under the terms of the GNU General Public License as published by
1820 .\" can be found in /usr/share/common-licenses/GPL-3 file.
1921 .\"
2022 .\"
21 .TH FATLABEL 8 2015\-04\-16 "dosfstools @PACKAGE_VERSION@"
23 .TH FATLABEL 8 @RELEASE_DATE@ "dosfstools @PACKAGE_VERSION@"
2224 .SH NAME
23 \fBfatlabel\fR \- set or get MS\-DOS filesystem label
25 fatlabel \- set or get MS-DOS filesystem label or volume ID
2426 .\" ----------------------------------------------------------------------------
2527 .SH SYNOPSIS
26 \fBfatlabel\fR \fIDEVICE\fR [\fILABEL\fR]
28 \fBfatlabel\fP [\fIOPTIONS\fP] \fIDEVICE\fP [\fINEW\fP]
2729 .\" ----------------------------------------------------------------------------
2830 .SH DESCRIPTION
29 \fBfatlabel\fR set or gets a MS\-DOS filesystem label from a given device.
31 \fBfatlabel\fP will display or change the volume label or volume ID on the
32 MS-DOS filesystem located on \fIDEVICE\fP.
33 By default it works in label mode.
34 It can be switched to volume ID mode with the option \fB\-i\fP or
35 \fB\-\-volume\-id\fP.
3036 .PP
31 If \fILABEL\fR is omitted, then the label name of the specified device is
32 written on the standard output.
33 A label can't be longer than 11 bytes.
37 If \fINEW\fP is omitted, then the existing label or volume ID is written to the
38 standard output.
39 A label can't be longer than 11 bytes and should be in all upper case for best
40 compatibility.
41 An empty string or a label consisting only of white space is not allowed.
42 A volume ID must be given as a hexadecimal number (no leading "0x" or
43 similar) and must fit into 32 bits.
3444 .\" ----------------------------------------------------------------------------
3545 .SH OPTIONS
36 .IP "\fB\-h\fR, \fB\-\-help\fR" 4
37 Displays a help message.
38 .IP "\fB\-V\fR, \fB\-\-version\fR" 4
39 Shows version.
46 .IP "\fB\-i\fP, \fB\-\-volume\-id\fP" 4
47 Switch to volume ID mode.
48 .IP "\fB\-r\fP, \fB\-\-reset\fP" 4
49 Remove label in label mode or generate new ID in volume ID mode.
50 .IP "\fB-c\fP \fIPAGE\fP, \fB\-\-codepage\fP=\fIPAGE\fP" 4
51 Use DOS codepage \fIPAGE\fP to encode/decode label.
52 By default codepage 850 is used.
53 .IP "\fB\-h\fP, \fB\-\-help\fP" 4
54 Display a help message and terminate.
55 .IP "\fB\-V\fP, \fB\-\-version\fP" 4
56 Show version number and terminate.
57 .\" ----------------------------------------------------------------------------
58 .SH COMPATIBILITY and BUGS
59 For historic reasons FAT label is stored in two different locations: in the boot
60 sector and as a special volume label entry in the root directory.
61 MS-DOS 5.00, MS-DOS 6.22, MS-DOS 7.10, Windows 98, Windows XP and also
62 Windows 10 read FAT label only from the root directory.
63 Absence of the volume label in the root directory is interpreted as empty or
64 none label, even if boot sector contains some valid label.
65
66 When Windows XP or Windows 10 system changes a FAT label it stores it only in
67 the root directory \(em letting boot sector unchanged.
68 Which leads to problems when a label is removed on Windows.
69 Old label is still stored in the boot sector but is removed from the root
70 directory.
71
72 \fBdosfslabel\fP prior to the version 3.0.7 operated only with FAT labels stored
73 in the boot sector, completely ignoring a volume label in the root directory.
74
75 \fBdosfslabel\fP in versions 3.0.7\(en3.0.15 reads FAT labels from the root
76 directory and in case of absence, it fallbacks to a label stored in the boot
77 sector.
78 Change operation resulted in updating a label in the boot sector and
79 \fIsometimes\fP also in the root directory due to the bug.
80 That bug was fixed in \fBdosfslabel\fP version 3.0.16 and since this version
81 \fBdosfslabel\fP updates label in both location.
82
83 Since version 4.2, \fBfatlabel\fP reads a FAT label only from the root directory
84 (like MS-DOS and Windows systems), but changes a FAT label in both locations.
85 In version 4.2 was fixed handling of empty labels and labels which starts with a
86 byte 0xE5.
87 Also in this version was added support for non-ASCII labels according to the
88 specified DOS codepage and were added checks if a new label is valid.
89
90 It is strongly suggested to not use \fBdosfslabel\fP prior to version 3.0.16.
91 .\" ----------------------------------------------------------------------------
92 .SH DOS CODEPAGES
93 MS-DOS and Windows systems use DOS (OEM) codepage for encoding and decoding FAT
94 label.
95 In Windows systems DOS codepage is global for all running applications and
96 cannot be configured explicitly.
97 It is set implicitly by option \fILanguage for non-Unicode programs\fP available
98 in \fIRegional and Language Options\fP via \fIControl Panel\fP.
99 Default DOS codepage for fatlabel is 850.
100 See following mapping table between DOS codepage and Language for non-Unicode
101 programs:
102 .TS
103 tab(:);
104 c lx.
105 \fBCodepage\fP:\fBLanguage\fP
106 437:T{
107 English (India), English (Malaysia), English (Republic of the Philippines),
108 English (Singapore), English (South Africa), English (United States),
109 English (Zimbabwe), Filipino, Hausa, Igbo, Inuktitut, Kinyarwanda, Kiswahili,
110 Yoruba
111 T}
112 720:Arabic, Dari, Persian, Urdu, Uyghur
113 737:Greek
114 775:Estonian, Latvian, Lithuanian
115 850:T{
116 Afrikaans, Alsatian, Basque, Breton, Catalan, Corsican, Danish, Dutch,
117 English (Australia), English (Belize), English (Canada), English (Caribbean),
118 English (Ireland), English (Jamaica), English (New Zealand),
119 English (Trinidad and Tobago), English (United Kingdom), Faroese, Finnish,
120 French, Frisian, Galician, German, Greenlandic, Icelandic, Indonesian, Irish,
121 isiXhosa, isiZulu, Italian, K'iche, Lower Sorbian, Luxembourgish, Malay,
122 Mapudungun, Mohawk, Norwegian, Occitan, Portuguese, Quechua, Romansh, Sami,
123 Scottish Gaelic, Sesotho sa Leboa, Setswana, Spanish, Swedish, Tamazight,
124 Upper Sorbian, Welsh, Wolof
125 T}
126 852:T{
127 Albanian, Bosnian (Latin), Croatian, Czech, Hungarian, Polish, Romanian,
128 Serbian (Latin), Slovak, Slovenian, Turkmen
129 T}
130 855:Bosnian (Cyrillic), Serbian (Cyrillic)
131 857:Azeri (Latin), Turkish, Uzbek (Latin)
132 862:Hebrew
133 866:T{
134 Azeri (Cyrillic), Bashkir, Belarusian, Bulgarian, Kyrgyz, Macedonian, Mongolian,
135 Russian, Tajik, Tatar, Ukrainian, Uzbek (Cyrillic), Yakut
136 T}
137 874:Thai
138 932:Japanese
139 936:Chinese (Simplified)
140 949:Korean
141 950:Chinese (Traditional)
142 1258:Vietnamese
143 .TE
40144 .\" ----------------------------------------------------------------------------
41145 .SH SEE ALSO
42 \fBfsck.fat\fR(8)
43 .br
44 \fBmkfs.fat\fR(8)
146 .BR fsck.fat (8),
147 .BR mkfs.fat (8)
45148 .\" ----------------------------------------------------------------------------
46149 .SH HOMEPAGE
47 The home for the \fBdosfstools\fR project is its
150 The home for the \fBdosfstools\fP project is its
48151 .UR https://github.com/dosfstools/dosfstools
49152 GitHub project page
50153 .UE .
51154 .\" ----------------------------------------------------------------------------
52155 .SH AUTHORS
53 \fBdosfstools\fR were written by
156 \fBdosfstools\fP were written by
54157 .MT werner.almesberger@\:lrc.di.epfl.ch
55158 Werner Almesberger
56159 .ME ,
58161 Roman Hodek
59162 .ME ,
60163 and others.
61 The current maintainer is
164 Current maintainers are
62165 .MT aeb@\:debian.org
63166 Andreas Bombe
167 .ME
168 and
169 .MT pali.rohar@\:gmail.com
170 Pali Rohár
64171 .ME .
00 .\" fsck.fat.8 - manpage for fsck.fat
11 .\"
22 .\" Copyright (C) 2006-2014 Daniel Baumann <daniel@debian.org>
3 .\" Copyright (C) 2018-2021 Pali Rohár <pali.rohar@gmail.com>
34 .\"
45 .\" This program is free software: you can redistribute it and/or modify
56 .\" it under the terms of the GNU General Public License as published by
1819 .\" can be found in /usr/share/common-licenses/GPL-3 file.
1920 .\"
2021 .\"
21 .TH FSCK.FAT 8 2015\-04\-16 "dosfstools @PACKAGE_VERSION@"
22 .TH FSCK.FAT 8 @RELEASE_DATE@ "dosfstools @PACKAGE_VERSION@"
2223 .SH NAME
23 \fBfsck.fat\fR \- check and repair MS\-DOS filesystems
24 fsck.fat \- check and repair MS-DOS FAT filesystems
2425 .\" ----------------------------------------------------------------------------
2526 .SH SYNOPSIS
26 \fBfsck.fat\fR [\fIOPTIONS\fR] \fIDEVICE\fR
27 \fBfsck.fat\fP [\fIOPTIONS\fP] \fIDEVICE\fP
2728 .\" ----------------------------------------------------------------------------
2829 .SH DESCRIPTION
29 \fBfsck.fat\fR verifies the consistency of MS\-DOS filesystems and optionally
30 \fBfsck.fat\fP verifies the consistency of MS-DOS filesystems and optionally
3031 tries to repair them.
3132 .PP
3233 The following filesystem problems can be corrected (in this order):
33 .IP "*" 4
34 .IP "\(bu" 4
3435 FAT contains invalid cluster numbers.
3536 Cluster is changed to EOF.
36 .IP "*" 4
37 .IP "\(bu" 4
3738 File's cluster chain contains a loop.
3839 The loop is broken.
39 .IP "*" 4
40 .IP "\(bu" 4
4041 Bad clusters (read errors).
4142 The clusters are marked bad and they are removed from files owning them.
4243 This check is optional.
43 .IP "*" 4
44 .IP "\(bu" 4
4445 Directories with a large number of bad entries (probably corrupt).
4546 The directory can be deleted.
46 .IP "*" 4
47 Files . and .. are non\-directories.
47 .IP "\(bu" 4
48 Files . and .. are non-directories.
4849 They can be deleted or renamed.
49 .IP "*" 4
50 .IP "\(bu" 4
5051 Directories . and .. in root directory.
5152 They are deleted.
52 .IP "*" 4
53 .IP "\(bu" 4
5354 Bad filenames.
5455 They can be renamed.
55 .IP "*" 4
56 .IP "\(bu" 4
5657 Duplicate directory entries.
5758 They can be deleted or renamed.
58 .IP "*" 4
59 Directories with non\-zero size field.
59 .IP "\(bu" 4
60 Directories with non-zero size field.
6061 Size is set to zero.
61 .IP "*" 4
62 .IP "\(bu" 4
6263 Directory . does not point to parent directory.
6364 The start pointer is adjusted.
64 .IP "*" 4
65 .IP "\(bu" 4
6566 Directory .. does not point to parent of parent directory.
6667 The start pointer is adjusted.
67 .IP "*" 4
68 .IP "\(bu" 4
69 \&. and .. are not the two first entries in a non-root directory.
70 The entries are created, moving occupied slots if necessary.
71 .IP "\(bu" 4
6872 Start cluster number of a file is invalid.
6973 The file is truncated.
70 .IP "*" 4
74 .IP "\(bu" 4
7175 File contains bad or free clusters.
7276 The file is truncated.
73 .IP "*" 4
77 .IP "\(bu" 4
7478 File's cluster chain is longer than indicated by the size fields.
7579 The file is truncated.
76 .IP "*" 4
80 .IP "\(bu" 4
7781 Two or more files share the same cluster(s).
7882 All but one of the files are truncated.
7983 If the file being truncated is a directory file that has already been read, the
8084 filesystem check is restarted after truncation.
81 .IP "*" 4
85 .IP "\(bu" 4
8286 File's cluster chain is shorter than indicated by the size fields.
8387 The file is truncated.
84 .IP "*" 4
88 .IP "\(bu" 4
89 Volume label in root directory or label in boot sector is invalid.
90 Invalid labels are removed.
91 .IP "\(bu" 4
92 Volume label in root directory and label in boot sector are different.
93 Volume label from root directory is copied to boot sector.
94 .IP "\(bu" 4
8595 Clusters are marked as used but are not owned by a file.
8696 They are marked as free.
8797 .PP
8898 Additionally, the following problems are detected, but not repaired:
89 .IP "*" 4
99 .IP "\(bu" 4
90100 Invalid parameters in boot sector
91 .IP "*" 4
92 Absence of . and .. entries in non\-root directories
93 .PP
94 When \fBfsck.fat\fR checks a filesystem, it accumulates all changes in memory
101 .PP
102 When \fBfsck.fat\fP checks a filesystem, it accumulates all changes in memory
95103 and performs them only after all checks are complete.
96 This can be disabled with the \fB\-w\fR option.
104 This can be disabled with the \fB\-w\fP option.
105 .PP
106 Two different variants of the FAT filesystem are supported.
107 Standard is the FAT12, FAT16 and FAT32 filesystems as defined by Microsoft and
108 widely used on hard disks and removable media like USB sticks and SD cards.
109 The other is the legacy Atari variant used on Atari ST.
110 .PP
111 There are some minor differences in Atari format:
112 Some boot sector fields are interpreted slightly different, and the special FAT
113 entries for end-of-file and bad cluster can be different.
114 Under MS-DOS 0xfff8 is used for EOF and Atari employs 0xffff by default, but
115 both systems recognize all values from 0xfff8\(en0xffff as end-of-file.
116 MS-DOS uses only 0xfff7 for bad clusters, where on Atari values 0xfff0\(en0xfff7
117 are for this purpose (but the standard value is still 0xfff7).
97118 .\" ----------------------------------------------------------------------------
98119 .SH OPTIONS
99 .IP "\fB\-a\fR" 4
120 .IP "\fB\-a\fP" 4
100121 Automatically repair the filesystem.
101122 No user intervention is necessary.
102123 Whenever there is more than one method to solve a problem, the least
103124 destructive approach is used.
104 .IP "\fB\-A\fR" 4
105 Use Atari variation of the MS\-DOS filesystem.
106 This is default if \fBfsck.fat\fR is run on an Atari, then this option turns
107 off Atari format.
108 There are some minor differences in Atari format:
109 Some boot sector fields are interpreted slightly different, and the special FAT
110 entries for end\-of\-file and bad cluster can be different.
111 Under MS\-DOS 0xfff8 is used for EOF and Atari employs 0xffff by default, but
112 both systems recognize all values from 0xfff8...0xffff as end\-of\-file.
113 MS\-DOS uses only 0xfff7 for bad clusters, where on Atari values 0xfff0...0xfff7
114 are for this purpose (but the standard value is still 0xfff7).
115 .IP "\fB-b\fR" 4
125 .IP "\fB\-A\fP" 4
126 Select using the Atari variation of the FAT filesystem if that isn't active
127 already, otherwise select standard FAT filesystem.
128 This is selected by default if \fBmkfs.fat\fP is run on 68k Atari Linux.
129 .IP "\fB-b\fP" 4
116130 Make read-only boot sector check.
117 .IP "\fB-c\fR \fIPAGE\fR" 4
118 Use DOS codepage \fIPAGE\fR to decode short file names.
119 By default codepage 437 is used.
120 .IP "\fB\-d\fR \fIPATH\fR" 4
131 .IP "\fB-c\fP \fIPAGE\fP" 4
132 Use DOS codepage \fIPAGE\fP to decode short file names.
133 By default codepage 850 is used.
134 .IP "\fB\-d\fP \fIPATH\fP" 4
121135 Delete the specified file.
122136 If more than one file with that name exist, the first one is deleted.
123137 This option can be given more than once.
124 .IP "\fB\-f\fR" 4
138 .IP "\fB\-f\fP" 4
125139 Salvage unused cluster chains to files.
126140 By default, unused clusters are added to the free disk space except in auto mode
127 (\fB\-a\fR).
128 .IP "\fB\-l\fR" 4
141 (\fB\-a\fP).
142 .IP "\fB\-F\fP \fINUM\fP" 4
143 Specify FAT table \fINUM\fP for filesystem access.
144 By default value \fI0\fP is assumed and then the first uncorrupted FAT table is
145 chosen.
146 Uncorrupted means that FAT table has valid first cluster.
147 If default value \fI0\fP is used and all FAT tables are corrupted then
148 \fBfsck.fat\fP gives up and does not try to repair FAT filesystem.
149 If non-zero \fINUM\fP value is specified then \fBfsck.fat\fP uses FAT table
150 \fINUM\fP for repairing FAT filesystem.
151 If FAT table \fINUM\fP has corrupted first cluster then \fBfsck.fat\fP will
152 repair it.
153 In any case, if FAT filesystem has more FAT tables then repaired content of
154 chosen FAT table is copied to other FAT tables.
155 To repair corrupted first cluster it is required to call \fBfsck.fat\fP with
156 non-zero \fINUM\fP value.
157 .IP "\fB\-l\fP" 4
129158 List path names of files being processed.
130 .IP "\fB\-n\fR" 4
131 No\-operation mode: non\-interactively check for errors, but don't write
159 .IP "\fB\-n\fP" 4
160 No-operation mode: non-interactively check for errors, but don't write
132161 anything to the filesystem.
133 .IP "\fB\-p\fR" 4
134 Same as \fB\-a\fR, for compatibility with other *fsck.
135 .IP "\fB\-r\fR" 4
162 .IP "\fB\-p\fP" 4
163 Same as \fB\-a\fP, for compatibility with other *fsck.
164 .IP "\fB\-r\fP" 4
136165 Interactively repair the filesystem.
137166 The user is asked for advice whenever there is more than one approach to fix an
138167 inconsistency.
139168 This is the default mode and the option is only retained for backwards
140169 compatibility.
141 .IP "\fB\-t\fR" 4
170 .IP "\fB\-S\fP" 4
171 Consider short (8.3) file names with spaces in the middle to be invalid, like
172 previous versions of this program did.
173 While such file names are not forbidden by the FAT specification, and were never
174 treated as errors by Microsoft file system checking tools, many DOS programs are
175 unable to handle files with such names.
176 Using this option can make them accessible to these programs.
177 .IP "" 4
178 Short file names which \fIstart\fP with a space are considered invalid
179 regardless of this option's setting.
180 .IP "" 4
181 Previous versions of this program exceptionally treated \fIEA DATA. SF\fP and
182 \fIWP ROOT. SF\fP as valid short names; using this option does not preserve
183 that exception.
184 .IP "\fB\-t\fP" 4
142185 Mark unreadable clusters as bad.
143 .IP "\fB\-u\fR \fIPATH\fR" 4
186 .IP "\fB\-u\fP \fIPATH\fP" 4
144187 Try to undelete the specified file.
145 \fBfsck.fat\fR tries to allocate a chain of contiguous unallocated clusters
188 \fBfsck.fat\fP tries to allocate a chain of contiguous unallocated clusters
146189 beginning with the start cluster of the undeleted file.
147190 This option can be given more than once.
148 .IP "\fB\-v\fR" 4
191 .IP "\fB\-U\fP" 4
192 Consider lowercase volume and boot label as invalid and allow only uppercase
193 characters.
194 Such labels are forbidden by the FAT specification, but they are widely used
195 by Linux tools.
196 Moreover MS-DOS and Windows systems do not have problems to read them.
197 Therefore volume and boot labels with lowercase characters are by default
198 permitted.
199 .IP "\fB\-v\fP" 4
149200 Verbose mode.
150201 Generates slightly more output.
151 .IP "\fB\-V\fR" 4
202 .IP "\fB\-V\fP" 4
152203 Perform a verification pass.
153204 The filesystem check is repeated after the first run.
154205 The second pass should never report any fixable errors.
155206 It may take considerably longer than the first pass, because the first pass may
156207 have generated long list of modifications that have to be scanned for each disk
157208 read.
158 .IP "\fB\-w\fR" 4
209 .IP "\fB\-\-variant\fP \fITYPE\fP" 4
210 Create a filesystem of variant \fITYPE\fP.
211 Acceptable values are \fIstandard\fP and \fIatari\fP (in any combination of
212 upper/lower case).
213 See above under DESCRIPTION for the differences.
214 .IP "\fB\-w\fP" 4
159215 Write changes to disk immediately.
160 .IP "\fB\-y\fR" 4
161 Same as \fB\-a\fR (automatically repair filesystem) for compatibility with other
216 .IP "\fB\-y\fP" 4
217 Same as \fB\-a\fP (automatically repair filesystem) for compatibility with other
162218 fsck tools.
219 .IP "\fB\-\-help\fP" 4
220 Display help message describing usage and options then exit.
163221 .\" ----------------------------------------------------------------------------
164222 .SH "EXIT STATUS"
165223 .IP "0" 4
166224 No recoverable errors have been detected.
167225 .IP "1" 4
168 Recoverable errors have been detected or \fBfsck.fat\fR has discovered an
226 Recoverable errors have been detected or \fBfsck.fat\fP has discovered an
169227 internal inconsistency.
170228 .IP "2" 4
171229 Usage error.
172 \fBfsck.fat\fR did not access the filesystem.
230 \fBfsck.fat\fP did not access the filesystem.
173231 .\" ----------------------------------------------------------------------------
174232 .SH FILES
175 .IP "fsck0000.rec, fsck0001.rec, ..." 4
176 When recovering from a corrupted filesystem, \fBfsck.fat\fR dumps recovered data
177 into files named 'fsckNNNN.rec' in the top level directory of the filesystem.
233 .IP "\fIfsck0000.rec\fP, \fIfsck0001.rec\fP, ..." 4
234 When recovering from a corrupted filesystem, \fBfsck.fat\fP dumps recovered data
235 into files named \fIfsckNNNN.rec\fP in the top level directory of the filesystem.
178236 .\" ----------------------------------------------------------------------------
179237 .SH BUGS
180 Does not create . and .. files where necessary.
238 .IP "\(bu" 4
181239 Does not remove entirely empty directories.
240 .IP "\(bu" 4
182241 Should give more diagnostic messages.
242 .IP "\(bu" 4
183243 Undeleting files should use a more sophisticated algorithm.
184244 .\" ----------------------------------------------------------------------------
185245 .SH SEE ALSO
186 \fBfatlabel\fR(8)
187 .br
188 \fBmkfs.fat\fR(8)
246 .BR fatlabel (8),
247 .BR mkfs.fat (8)
189248 .\" ----------------------------------------------------------------------------
190249 .SH HOMEPAGE
191 The home for the \fBdosfstools\fR project is its
250 The home for the \fBdosfstools\fP project is its
192251 .UR https://github.com/dosfstools/dosfstools
193252 GitHub project page
194253 .UE .
195254 .\" ----------------------------------------------------------------------------
196255 .SH AUTHORS
197 \fBdosfstools\fR were written by
256 \fBdosfstools\fP were written by
198257 .MT werner.almesberger@\:lrc.di.epfl.ch
199258 Werner Almesberger
200259 .ME ,
202261 Roman Hodek
203262 .ME ,
204263 and others.
205 The current maintainer is
264 Current maintainers are
206265 .MT aeb@\:debian.org
207266 Andreas Bombe
267 .ME
268 and
269 .MT pali.rohar@\:gmail.com
270 Pali Rohár
208271 .ME .
11 .\"
22 .\" Copyright (C) 2006-2014 Daniel Baumann <daniel@debian.org>
33 .\" Copyright (C) 2016 Andreas Bombe <aeb@debian.org>
4 .\" Copyright (C) 2018-2021 Pali Rohár <pali.rohar@gmail.com>
45 .\"
56 .\" This program is free software: you can redistribute it and/or modify
67 .\" it under the terms of the GNU General Public License as published by
1920 .\" can be found in /usr/share/common-licenses/GPL-3 file.
2021 .\"
2122 .\"
22 .TH MKFS.FAT 8 2016\-01\-25 "dosfstools @PACKAGE_VERSION@"
23 .TH MKFS.FAT 8 @RELEASE_DATE@ "dosfstools @PACKAGE_VERSION@"
2324 .SH NAME
24 \fBmkfs.fat\fR \- create an MS-DOS filesystem under Linux
25 mkfs.fat \- create an MS-DOS FAT filesystem
2526 .\" ----------------------------------------------------------------------------
2627 .SH SYNOPSIS
27 \fBmkfs.fat\fR [\fIOPTIONS\fR] \fIDEVICE\fR [\fIBLOCK-COUNT\fR]
28 \fBmkfs.fat\fP [\fIOPTIONS\fP] \fIDEVICE\fP [\fIBLOCK-COUNT\fP]
2829 .\" ----------------------------------------------------------------------------
2930 .SH DESCRIPTION
30 \fBmkfs.fat\fR is used to create an MS-DOS filesystem under Linux on a device
31 (usually a disk partition).
32 \fIDEVICE\fR is the special file corresponding to the device (e.g. /dev/sdXX).
33 \fIBLOCK-COUNT\fR is the number of blocks on the device.
34 If omitted, \fBmkfs.fat\fR automatically determines the filesystem size.
31 \fBmkfs.fat\fP is used to create a FAT filesystem on a device or in an image
32 file.
33 \fIDEVICE\fP is the special file corresponding to the device (e.g. /dev/sdXX) or
34 the image file (which does not need to exist when the option \fB-C\fP is given).
35 \fIBLOCK-COUNT\fP is the number of blocks on the device and size of one block is
36 always 1024 bytes, independently of the sector size or the cluster size.
37 Therefore \fIBLOCK-COUNT\fP specifies size of filesystem in KiB unit and not in
38 the number of sectors (like for all other \fBmkfs.fat\fP options).
39 If omitted, \fBmkfs.fat\fP automatically chooses a filesystem size to fill the
40 available space.
41 .PP
42 Two different variants of the FAT filesystem are supported.
43 Standard is the FAT12, FAT16 and FAT32 filesystems as defined by Microsoft and
44 widely used on hard disks and removable media like USB sticks and SD cards.
45 The other is the legacy Atari variant used on Atari ST.
46 .PP
47 In Atari mode, if not directed otherwise by the user, \fBmkfs.fat\fP will
48 always use 2 sectors per cluster, since GEMDOS doesn't like other values very
49 much.
50 It will also obey the maximum number of sectors GEMDOS can handle.
51 Larger filesystems are managed by raising the logical sector size.
52 An Atari-compatible serial number for the filesystem is generated, and a 12 bit
53 FAT is used only for filesystems that have one of the usual floppy sizes (720k,
54 1.2M, 1.44M, 2.88M), a 16 bit FAT otherwise.
55 This can be overridden with the \fB\-F\fP option.
56 Some PC-specific boot sector fields aren't written, and a boot message (option
57 \fB\-m\fP) is ignored.
3558 .\" ----------------------------------------------------------------------------
3659 .SH OPTIONS
37 .IP "\fB\-a\fR" 4
38 Normally, for any filesystem except very small ones, \fBmkfs.fat\fR will align
60 .IP "\fB\-a\fP" 4
61 Normally, for any filesystem except very small ones, \fBmkfs.fat\fP will align
3962 all the data structures to cluster size, to make sure that as long as the
4063 partition is properly aligned, so will all the data structures in the
4164 filesystem.
4265 This option disables alignment; this may provide a handful of additional
4366 clusters of storage at the expense of a significant performance degradation on
4467 RAIDs, flash media or large-sector hard disks.
45 .IP "\fB \-A\fR" 4
46 Use Atari variation of the MS-DOS filesystem.
47 This is default if \fBmkfs.fat\fR is run on an Atari, then this option turns off
48 Atari format.
49 There are some differences when using Atari format:
50 If not directed otherwise by the user, \fBmkfs.fat\fR will always use 2 sectors
51 per cluster, since GEMDOS doesn't like other values very much.
52 It will also obey the maximum number of sectors GEMDOS can handle.
53 Larger filesystems are managed by raising the logical sector size.
54 Under Atari format, an Atari-compatible serial number for the filesystem is
55 generated, and a 12 bit FAT is used only for filesystems that have one of the
56 usual floppy sizes (720k, 1.2M, 1.44M, 2.88M), a 16 bit FAT otherwise.
57 This can be overridden with the \fB\-F\fR option.
58 Some PC-specific boot sector fields aren't written, and a boot message (option
59 \fB\-m\fR) is ignored.
60 .IP "\fB\-b\fR \fISECTOR-OF-BACKUP\fR" 4
68 .IP "\fB\-A\fP" 4
69 Select using the Atari variation of the FAT filesystem if that isn't active
70 already, otherwise select standard FAT filesystem.
71 This is selected by default if \fBmkfs.fat\fP is run on 68k Atari Linux.
72 .IP "\fB\-b\fP \fISECTOR-OF-BACKUP\fP" 4
6173 Selects the location of the backup boot sector for FAT32.
6274 Default depends on number of reserved sectors, but usually is sector 6.
75 If there is a free space available after the backup boot sector then backup of
76 the FAT32 info sector is put after the backup boot sector, usually at sector 7.
6377 The backup must be within the range of reserved sectors.
78 Value 0 completely disables creating of backup boot and info FAT32 sectors.
6479 .IP "\fB\-c" 4
6580 Check the device for bad blocks before creating the filesystem.
66 .IP "\fB\-C\fR" 4
67 Create the file given as \fIDEVICE\fR on the command line, and write the
81 .IP "\fB\-C\fP" 4
82 Create the file given as \fIDEVICE\fP on the command line, and write the
6883 to-be-created filesystem to it.
6984 This can be used to create the new filesystem in a file instead of on a real
70 device, and to avoid using \fBdd\fR in advance to create a file of appropriate
85 device, and to avoid using \fBdd\fP in advance to create a file of appropriate
7186 size.
72 With this option, the \fIBLOCK-COUNT\fR must be given, because otherwise the
87 With this option, the \fIBLOCK-COUNT\fP must be given, because otherwise the
7388 intended size of the filesystem wouldn't be known.
7489 The file created is a sparse file, which actually only contains the meta-data
7590 areas (boot sector, FATs, and root directory).
7792 have the correct size.
7893 The resulting file can be copied later to a floppy disk or other device, or
7994 mounted through a loop device.
80 .IP "\fB\-D\fR \fIDRIVE-NUMBER\fR" 4
95 .IP "\fB\-D\fP \fIDRIVE-NUMBER\fP" 4
8196 Specify the BIOS drive number to be stored in the FAT boot sector.
82 This value is usually 0x80 for hard disks and 0x00 for floppy devices or
83 partitions to be used for floppy emulation.
84 .IP "\fB\-f\fR \fINUMBER-OF-FATS\fR" 4
97 For hard disks and removable medias it is usually 0x80\(en0xFF (0x80 is first
98 hard disk C:, 0x81 is second hard disk D:, ...), for floppy devices or
99 partitions to be used for floppy emulation it is 0x00\(en0x7F (0x00 is first
100 floppy A:, 0x01 is second floppy B:).
101 .IP "\fB\-f\fP \fINUMBER-OF-FATS\fP" 4
85102 Specify the number of file allocation tables in the filesystem.
86103 The default is 2.
87 .IP "\fB\-F\fR \fIFAT-SIZE\fR" 4
104 .IP "\fB\-F\fP \fIFAT-SIZE\fP" 4
88105 Specifies the type of file allocation tables used (12, 16 or 32 bit).
89 If nothing is specified, \fBmkfs.fat\fR will automatically select between 12, 16
106 If nothing is specified, \fBmkfs.fat\fP will automatically select between 12, 16
90107 and 32 bit, whatever fits better for the filesystem size.
91 .IP "\fB\-h\fR \fINUMBER-OF-HIDDEN-SECTORS\fR" 4
92 Select the number of hidden sectors in the volume.
93 Apparently some digital cameras get indigestion if you feed them a CF card
94 without such hidden sectors, this option allows you to satisfy them.
95 .IP "\fB\-i\fR \fIVOLUME-ID\fR" 4
96 Sets the volume ID of the newly created filesystem; \fIVOLUME-ID\fR is a 32-bit
108 .IP "\fB\-g\fP \fIHEADS\fP/\fISECTORS-PER-TRACK\fP" 4
109 Specify \fIHEADS\fP and \fISECTORS-PER-TRACK\fP numbers which represents
110 disk geometry of \fIDEVICE\fP.
111 Both numbers are stored into the FAT boot sector.
112 Number \fISECTORS-PER-TRACK\fP is used also for aligning the total count of FAT
113 sectors.
114 By default disk geometry is read from \fIDEVICE\fP itself.
115 If it is not available then \fILBA-Assist Translation\fP and translation table
116 from the \fISD Card Part 2 File System Specification\fP based on total number
117 of disk sectors is used.
118 .IP "\fB\-h\fP \fINUMBER-OF-HIDDEN-SECTORS\fP" 4
119 Specify the number of so-called \fIhidden sectors\fP, as stored in the FAT boot
120 sector: this number represents the beginning sector of the partition containing
121 the file system.
122 Normally this is an offset (in sectors) relative to the start of the disk,
123 although for MBR logical volumes contained in an extended partition of type 0x05
124 (a non-LBA extended partition), a quirk in the MS-DOS implementation of FAT
125 requires it to be relative to the partition's immediate containing Extended Boot
126 Record.
127 Boot code and other software handling FAT volumes may also rely on this field
128 being set up correctly; most modern FAT implementations will ignore it.
129 By default, if the \fIDEVICE\fP is a partition block device, \fBmkfs.fat\fP uses
130 the partition offset relative to disk start.
131 Otherwise, \fBmkfs.fat\fP assumes zero.
132 Use this option to override this behaviour.
133 .IP "\fB\-i\fP \fIVOLUME-ID\fP" 4
134 Sets the volume ID of the newly created filesystem; \fIVOLUME-ID\fP is a 32-bit
97135 hexadecimal number (for example, 2e24ec82).
98136 The default is a number which depends on the filesystem creation time.
99 .IP "\fB\-I\fR" 4
100 It is typical for fixed disk devices to be partitioned so, by default, you are
101 not permitted to create a filesystem across the entire device.
102 \fBmkfs.fat\fR will complain and tell you that it refuses to work.
137 .IP "\fB\-I\fP" 4
138 Ignore and disable safety checks.
139 By default \fBmkfs.fat\fP refuses to create a filesystem on a device with
140 partitions or virtual mapping.
141 \fBmkfs.fat\fP will complain and tell you that it refuses to work.
103142 This is different when using MO disks.
104143 One doesn't always need partitions on MO disks.
105144 The filesystem can go directly to the whole disk.
106 Under other OSes this is known as the 'superfloppy' format.
107 This switch will force \fBmkfs.fat\fR to work properly.
108 .IP "\fB\-l\fR \fIFILENAME\fR" 4
109 Read the bad blocks list from \fIFILENAME\fR.
110 .IP "\fB\-m\fR \fIMESSAGE-FILE\fR" 4
145 Under other OSes this is known as the \fIsuperfloppy\fP format.
146 This switch will force \fBmkfs.fat\fP to work properly.
147 .IP "\fB\-l\fP \fIFILENAME\fP" 4
148 Read the bad blocks list from \fIFILENAME\fP.
149 .IP "\fB\-m\fP \fIMESSAGE-FILE\fP" 4
111150 Sets the message the user receives on attempts to boot this filesystem without
112151 having properly installed an operating system.
113152 The message file must not exceed 418 bytes once line feeds have been converted
114153 to carriage return-line feed combinations, and tabs have been expanded.
115154 If the filename is a hyphen (-), the text is taken from standard input.
116 .IP "\fB\-M\fR \fIFAT-MEDIA-TYPE\fR" 4
155 .IP "\fB\-M\fP \fIFAT-MEDIA-TYPE\fP" 4
117156 Specify the media type to be stored in the FAT boot sector.
118157 This value is usually 0xF8 for hard disks and is 0xF0 or a value from 0xF9 to
119158 0xFF for floppies or partitions to be used for floppy emulation.
120 .IP "\fB\-n\fR \fIVOLUME-NAME\fR" 4
159 .IP "\fB\-\-mbr\fP[=\fIy\fP|\fIyes\fP|\fIn\fP|\fIno\fP|\fIa\fP|\fIauto\fP]" 4
160 Fill (fake) MBR table with disk signature one partition which starts at sector
161 0 (includes MBR itself) and spans whole disk device.
162 It is needed only for non-removable disks used on Microsoft Windows systems and
163 only when formatting whole unpartitioned disk.
164 Location of the disk signature and partition table overlaps with the end of the
165 first FAT sector (boot code location), therefore there is no additional space
166 usage.
167 Default is \fIauto\fP mode in which \fBmkfs.fat\fP put MBR table only for
168 non-removable disks when formatting whole unpartitioned disk.
169 .IP "\fB\-n\fP \fIVOLUME-NAME\fP" 4
121170 Sets the volume name (label) of the filesystem.
122171 The volume name can be up to 11 characters long.
172 Supplying an empty string, a string consisting only of white space or the
173 string "NO NAME" as \fIVOLUME-NAME\fP has the same effect as not giving the
174 \fB\-n\fP option.
123175 The default is no label.
124 .IP "\fB\-r\fR \fIROOT-DIR-ENTRIES\fR" 4
125 Select the number of entries available in the root directory.
176 .IP "\fB\-\-codepage\fP=\fIPAGE\fP" 4
177 Use DOS codepage \fIPAGE\fP to encode label.
178 By default codepage 850 is used.
179 .IP "\fB\-r\fP \fIROOT-DIR-ENTRIES\fP" 4
180 Select the minimal number of entries available in the root directory.
126181 The default is 112 or 224 for floppies and 512 for hard disks.
127 .IP "\fB\-R\fR \fINUMBER-OF-RESERVED-SECTORS\fR" 4
128 Select the number of reserved sectors.
182 Note that this is minimal number and it may be increased by \fBmkfs.fat\fP
183 due to alignment of structures.
184 See also \fBmkfs.fat\fP option \fB\-a\fP.
185 .IP "\fB\-R\fP \fINUMBER-OF-RESERVED-SECTORS\fP" 4
186 Select the minimal number of reserved sectors.
129187 With FAT32 format at least 2 reserved sectors are needed, the default is 32.
130188 Otherwise the default is 1 (only the boot sector).
131 .IP "\fB\-s\fR \fISECTORS-PER-CLUSTER\fR" 4
189 Note that this is minimal number and it may be increased by \fBmkfs.fat\fP
190 due to alignment of structures.
191 See also \fBmkfs.fat\fP option \fB\-a\fP.
192 .IP "\fB\-s\fP \fISECTORS-PER-CLUSTER\fP" 4
132193 Specify the number of disk sectors per cluster.
133194 Must be a power of 2, i.e. 1, 2, 4, 8, ... 128.
134 .IP "\fB\-S\fR \fILOGICAL-SECTOR-SIZE\fR" 4
195 .IP "\fB\-S\fP \fILOGICAL-SECTOR-SIZE\fP" 4
135196 Specify the number of bytes per logical sector.
136197 Must be a power of 2 and greater than or equal to 512, i.e. 512, 1024, 2048,
137198 4096, 8192, 16384, or 32768.
138199 Values larger than 4096 are not conforming to the FAT file system specification
139200 and may not work everywhere.
140 .IP "\fB\-v\fR" 4
201 .IP "\fB\-v\fP" 4
141202 Verbose execution.
142 .IP "\fB\-\-invariant\fR" 4
203 .IP "\fB\-\-offset\fP \fISECTOR\fP" 4
204 Write the filesystem at a specific sector into the device file.
205 This is useful for creating a filesystem in a partitioned disk image without
206 having to set up a loop device.
207 .IP "\fB\-\-variant\fP \fITYPE\fP" 4
208 Create a filesystem of variant \fITYPE\fP.
209 Acceptable values are \fIstandard\fP and \fIatari\fP (in any combination of
210 upper/lower case).
211 See above under DESCRIPTION for the differences.
212 .IP "\fB\-\-help\fP" 4
213 Display option summary and exit.
214 .IP "\fB\-\-invariant\fP" 4
143215 Use constants for normally randomly generated or time based data such as
144216 volume ID and creation time.
145 Multiple runs of \fBmkfs.fat\fR on the same device create identical results
217 Multiple runs of \fBmkfs.fat\fP on the same device create identical results
146218 with this option.
147 Its main purpose is testing \fBmkfs.fat\fR.
148 .IP "\fB\-\-help\fR" 4
149 Display option summary and exit.
219 Its main purpose is testing \fBmkfs.fat\fP.
150220 .\" ----------------------------------------------------------------------------
151221 .SH BUGS
152 \fBmkfs.fat\fR can not create boot-able filesystems.
222 \fBmkfs.fat\fP can not create boot-able filesystems.
153223 This isn't as easy as you might think at first glance for various reasons and
154224 has been discussed a lot already.
155 \fBmkfs.fat\fR simply will not support it ;)
225 \fBmkfs.fat\fP simply will not support it ;)
156226 .\" ----------------------------------------------------------------------------
157227 .SH SEE ALSO
158 \fBfatlabel\fR(8)
159 .br
160 \fBfsck.fat\fR(8)
228 .BR fatlabel (8),
229 .BR fsck.fat (8)
161230 .\" ----------------------------------------------------------------------------
162231 .SH HOMEPAGE
163 The home for the \fBdosfstools\fR project is its
232 The home for the \fBdosfstools\fP project is its
164233 .UR https://github.com/dosfstools/dosfstools
165234 GitHub project page
166235 .UE .
167236 .\" ----------------------------------------------------------------------------
168237 .SH AUTHORS
169 \fBdosfstools\fR were written by
238 \fBdosfstools\fP were written by
170239 .MT werner.almesberger@\:lrc.di.epfl.ch
171240 Werner Almesberger
172241 .ME ,
174243 Roman Hodek
175244 .ME ,
176245 and others.
177 The current maintainer is
246 Current maintainers are
178247 .MT aeb@\:debian.org
179248 Andreas Bombe
249 .ME
250 and
251 .MT pali.rohar@\:gmail.com
252 Pali Rohár
180253 .ME .
00 #! /bin/sh
11 # Common wrapper for a few potentially missing GNU programs.
22
3 scriptversion=2013-10-28.13; # UTC
4
5 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
3 scriptversion=2018-03-07.03; # UTC
4
5 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
66 # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
77
88 # This program is free software; you can redistribute it and/or modify
1616 # GNU General Public License for more details.
1717
1818 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 # along with this program. If not, see <https://www.gnu.org/licenses/>.
2020
2121 # As a special exception to the GNU General Public License, if you
2222 # distribute this file as part of a program that contains a
100100 exit $st
101101 fi
102102
103 perl_URL=http://www.perl.org/
104 flex_URL=http://flex.sourceforge.net/
105 gnu_software_URL=http://www.gnu.org/software
103 perl_URL=https://www.perl.org/
104 flex_URL=https://github.com/westes/flex
105 gnu_software_URL=https://www.gnu.org/software
106106
107107 program_details ()
108108 {
206206 exit $st
207207
208208 # Local variables:
209 # eval: (add-hook 'write-file-hooks 'time-stamp)
209 # eval: (add-hook 'before-save-hook 'time-stamp)
210210 # time-stamp-start: "scriptversion="
211211 # time-stamp-format: "%:y-%02m-%02d.%02H"
212 # time-stamp-time-zone: "UTC"
212 # time-stamp-time-zone: "UTC0"
213213 # time-stamp-end: "; # UTC"
214214 # End:
1818
1919 sbin_PROGRAMS = fsck.fat mkfs.fat fatlabel
2020 noinst_PROGRAMS = testdevinfo
21 EXTRA_DIST = blkdev/README
2122
22 fscklabel_common_sources = boot.c boot.h check.c check.h common.c common.h \
23 fat.c fat.h file.c file.h io.c io.h lfn.c lfn.h \
24 charconv.c charconv.h msdos_fs.h \
23 charconv_common_sources = charconv.c charconv.h
24 charconv_common_ldadd = $(LIBICONV)
25 fscklabel_common_sources = boot.c boot.h common.c common.h \
26 fat.c fat.h io.c io.h msdos_fs.h \
27 $(charconv_common_sources) \
2528 fsck.fat.h endian_compat.h
26 fsck_fat_SOURCES = fsck.fat.c $(fscklabel_common_sources)
29 fsck_fat_SOURCES = check.c check.h file.c file.h fsck.fat.c \
30 lfn.c lfn.h \
31 $(fscklabel_common_sources)
32 fsck_fat_LDADD = $(charconv_common_ldadd)
2733 fatlabel_SOURCES = fatlabel.c $(fscklabel_common_sources)
34 fatlabel_LDADD = $(charconv_common_ldadd)
2835
29 mkfs_common_sources = device_info.c device_info.h \
30 blkdev/blkdev.c blkdev/blkdev.h \
31 endian_compat.h \
32 blkdev/linux_version.c blkdev/linux_version.h
33 mkfs_fat_SOURCES = mkfs.fat.c msdos_fs.h $(mkfs_common_sources)
36 devinfo_common_sources = device_info.c device_info.h \
37 blkdev/blkdev.c blkdev/blkdev.h \
38 blkdev/linux_version.c blkdev/linux_version.h
39 mkfs_fat_SOURCES = mkfs.fat.c msdos_fs.h common.c common.h endian_compat.h \
40 $(charconv_common_sources) $(devinfo_common_sources)
3441 mkfs_fat_CPPFLAGS = -I$(srcdir)/blkdev
35 mkfs_fat_CFLAGS = $(AM_CFLAGS) $(UDEV_CFLAGS)
36 mkfs_fat_LDADD = $(UDEV_LIBS)
42 mkfs_fat_CFLAGS = $(AM_CFLAGS)
43 mkfs_fat_LDADD = $(charconv_common_ldadd)
3744
38 testdevinfo_SOURCES = testdevinfo.c $(mkfs_common_sources)
45 testdevinfo_SOURCES = testdevinfo.c $(devinfo_common_sources)
3946 testdevinfo_CPPFLAGS = -I$(srcdir)/blkdev
40 testdevinfo_CFLAGS = $(AM_CFLAGS) $(UDEV_CFLAGS)
41 testdevinfo_LDADD = $(UDEV_LIBS)
47 testdevinfo_CFLAGS = $(AM_CFLAGS)
4248
4349
4450 if COMPAT_SYMLINKS
0 # Makefile.in generated by automake 1.15 from Makefile.am.
0 # Makefile.in generated by automake 1.16.1 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2014 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2018 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
101101 NORMAL_UNINSTALL = :
102102 PRE_UNINSTALL = :
103103 POST_UNINSTALL = :
104 build_triplet = @build@
105 host_triplet = @host@
104106 sbin_PROGRAMS = fsck.fat$(EXEEXT) mkfs.fat$(EXEEXT) fatlabel$(EXEEXT)
105107 noinst_PROGRAMS = testdevinfo$(EXEEXT)
106108 subdir = src
114116 CONFIG_CLEAN_VPATH_FILES =
115117 am__installdirs = "$(DESTDIR)$(sbindir)"
116118 PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS)
117 am__objects_1 = boot.$(OBJEXT) check.$(OBJEXT) common.$(OBJEXT) \
118 fat.$(OBJEXT) file.$(OBJEXT) io.$(OBJEXT) lfn.$(OBJEXT) \
119 charconv.$(OBJEXT)
120 am_fatlabel_OBJECTS = fatlabel.$(OBJEXT) $(am__objects_1)
119 am__objects_1 = charconv.$(OBJEXT)
120 am__objects_2 = boot.$(OBJEXT) common.$(OBJEXT) fat.$(OBJEXT) \
121 io.$(OBJEXT) $(am__objects_1)
122 am_fatlabel_OBJECTS = fatlabel.$(OBJEXT) $(am__objects_2)
121123 fatlabel_OBJECTS = $(am_fatlabel_OBJECTS)
122 fatlabel_LDADD = $(LDADD)
123 am_fsck_fat_OBJECTS = fsck.fat.$(OBJEXT) $(am__objects_1)
124 am__DEPENDENCIES_1 =
125 am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
126 fatlabel_DEPENDENCIES = $(am__DEPENDENCIES_2)
127 am_fsck_fat_OBJECTS = check.$(OBJEXT) file.$(OBJEXT) \
128 fsck.fat.$(OBJEXT) lfn.$(OBJEXT) $(am__objects_2)
124129 fsck_fat_OBJECTS = $(am_fsck_fat_OBJECTS)
125 fsck_fat_LDADD = $(LDADD)
130 fsck_fat_DEPENDENCIES = $(am__DEPENDENCIES_2)
131 am__objects_3 = mkfs_fat-charconv.$(OBJEXT)
126132 am__dirstamp = $(am__leading_dot)dirstamp
127 am__objects_2 = mkfs_fat-device_info.$(OBJEXT) \
133 am__objects_4 = mkfs_fat-device_info.$(OBJEXT) \
128134 blkdev/mkfs_fat-blkdev.$(OBJEXT) \
129135 blkdev/mkfs_fat-linux_version.$(OBJEXT)
130 am_mkfs_fat_OBJECTS = mkfs_fat-mkfs.fat.$(OBJEXT) $(am__objects_2)
136 am_mkfs_fat_OBJECTS = mkfs_fat-mkfs.fat.$(OBJEXT) \
137 mkfs_fat-common.$(OBJEXT) $(am__objects_3) $(am__objects_4)
131138 mkfs_fat_OBJECTS = $(am_mkfs_fat_OBJECTS)
132 am__DEPENDENCIES_1 =
133 mkfs_fat_DEPENDENCIES = $(am__DEPENDENCIES_1)
139 mkfs_fat_DEPENDENCIES = $(am__DEPENDENCIES_2)
134140 mkfs_fat_LINK = $(CCLD) $(mkfs_fat_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
135141 $(LDFLAGS) -o $@
136 am__objects_3 = testdevinfo-device_info.$(OBJEXT) \
142 am__objects_5 = testdevinfo-device_info.$(OBJEXT) \
137143 blkdev/testdevinfo-blkdev.$(OBJEXT) \
138144 blkdev/testdevinfo-linux_version.$(OBJEXT)
139145 am_testdevinfo_OBJECTS = testdevinfo-testdevinfo.$(OBJEXT) \
140 $(am__objects_3)
146 $(am__objects_5)
141147 testdevinfo_OBJECTS = $(am_testdevinfo_OBJECTS)
142 testdevinfo_DEPENDENCIES = $(am__DEPENDENCIES_1)
148 testdevinfo_LDADD = $(LDADD)
143149 testdevinfo_LINK = $(CCLD) $(testdevinfo_CFLAGS) $(CFLAGS) \
144150 $(AM_LDFLAGS) $(LDFLAGS) -o $@
145151 AM_V_P = $(am__v_P_@AM_V@)
156162 am__v_at_1 =
157163 DEFAULT_INCLUDES = -I.@am__isrc@
158164 depcomp = $(SHELL) $(top_srcdir)/depcomp
159 am__depfiles_maybe = depfiles
165 am__maybe_remake_depfiles = depfiles
166 am__depfiles_remade = ./$(DEPDIR)/boot.Po ./$(DEPDIR)/charconv.Po \
167 ./$(DEPDIR)/check.Po ./$(DEPDIR)/common.Po ./$(DEPDIR)/fat.Po \
168 ./$(DEPDIR)/fatlabel.Po ./$(DEPDIR)/file.Po \
169 ./$(DEPDIR)/fsck.fat.Po ./$(DEPDIR)/io.Po ./$(DEPDIR)/lfn.Po \
170 ./$(DEPDIR)/mkfs_fat-charconv.Po \
171 ./$(DEPDIR)/mkfs_fat-common.Po \
172 ./$(DEPDIR)/mkfs_fat-device_info.Po \
173 ./$(DEPDIR)/mkfs_fat-mkfs.fat.Po \
174 ./$(DEPDIR)/testdevinfo-device_info.Po \
175 ./$(DEPDIR)/testdevinfo-testdevinfo.Po \
176 blkdev/$(DEPDIR)/mkfs_fat-blkdev.Po \
177 blkdev/$(DEPDIR)/mkfs_fat-linux_version.Po \
178 blkdev/$(DEPDIR)/testdevinfo-blkdev.Po \
179 blkdev/$(DEPDIR)/testdevinfo-linux_version.Po
160180 am__mv = mv -f
161181 AM_V_lt = $(am__v_lt_@AM_V@)
162182 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
215235 CC = @CC@
216236 CCDEPMODE = @CCDEPMODE@
217237 CFLAGS = @CFLAGS@
238 CHECKATARI = @CHECKATARI@
218239 CPP = @CPP@
219240 CPPFLAGS = @CPPFLAGS@
220241 CYGPATH_W = @CYGPATH_W@
232253 INSTALL_SCRIPT = @INSTALL_SCRIPT@
233254 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
234255 LDFLAGS = @LDFLAGS@
256 LIBICONV = @LIBICONV@
235257 LIBOBJS = @LIBOBJS@
236258 LIBS = @LIBS@
237259 LN_S = @LN_S@
260 LTLIBICONV = @LTLIBICONV@
238261 LTLIBOBJS = @LTLIBOBJS@
239262 MAKEINFO = @MAKEINFO@
240263 MKDIR_P = @MKDIR_P@
247270 PACKAGE_URL = @PACKAGE_URL@
248271 PACKAGE_VERSION = @PACKAGE_VERSION@
249272 PATH_SEPARATOR = @PATH_SEPARATOR@
250 PKG_CONFIG = @PKG_CONFIG@
251 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
252 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
253273 RELEASE_DATE = @RELEASE_DATE@
254274 SET_MAKE = @SET_MAKE@
255275 SHELL = @SHELL@
256276 STRIP = @STRIP@
257 UDEV_CFLAGS = @UDEV_CFLAGS@
258 UDEV_LIBS = @UDEV_LIBS@
259277 VERSION = @VERSION@
260278 XXD_FOUND = @XXD_FOUND@
261279 abs_builddir = @abs_builddir@
269287 am__tar = @am__tar@
270288 am__untar = @am__untar@
271289 bindir = @bindir@
290 build = @build@
272291 build_alias = @build_alias@
292 build_cpu = @build_cpu@
293 build_os = @build_os@
294 build_vendor = @build_vendor@
273295 builddir = @builddir@
274296 datadir = @datadir@
275297 datarootdir = @datarootdir@
276298 docdir = @docdir@
277299 dvidir = @dvidir@
278300 exec_prefix = @exec_prefix@
301 host = @host@
279302 host_alias = @host_alias@
303 host_cpu = @host_cpu@
304 host_os = @host_os@
305 host_vendor = @host_vendor@
280306 htmldir = @htmldir@
281307 includedir = @includedir@
282308 infodir = @infodir@
304330 AM_CFLAGS = -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers \
305331 -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings
306332
307 fscklabel_common_sources = boot.c boot.h check.c check.h common.c common.h \
308 fat.c fat.h file.c file.h io.c io.h lfn.c lfn.h \
309 charconv.c charconv.h msdos_fs.h \
333 EXTRA_DIST = blkdev/README
334 charconv_common_sources = charconv.c charconv.h
335 charconv_common_ldadd = $(LIBICONV)
336 fscklabel_common_sources = boot.c boot.h common.c common.h \
337 fat.c fat.h io.c io.h msdos_fs.h \
338 $(charconv_common_sources) \
310339 fsck.fat.h endian_compat.h
311340
312 fsck_fat_SOURCES = fsck.fat.c $(fscklabel_common_sources)
341 fsck_fat_SOURCES = check.c check.h file.c file.h fsck.fat.c \
342 lfn.c lfn.h \
343 $(fscklabel_common_sources)
344
345 fsck_fat_LDADD = $(charconv_common_ldadd)
313346 fatlabel_SOURCES = fatlabel.c $(fscklabel_common_sources)
314 mkfs_common_sources = device_info.c device_info.h \
315 blkdev/blkdev.c blkdev/blkdev.h \
316 endian_compat.h \
317 blkdev/linux_version.c blkdev/linux_version.h
318
319 mkfs_fat_SOURCES = mkfs.fat.c msdos_fs.h $(mkfs_common_sources)
347 fatlabel_LDADD = $(charconv_common_ldadd)
348 devinfo_common_sources = device_info.c device_info.h \
349 blkdev/blkdev.c blkdev/blkdev.h \
350 blkdev/linux_version.c blkdev/linux_version.h
351
352 mkfs_fat_SOURCES = mkfs.fat.c msdos_fs.h common.c common.h endian_compat.h \
353 $(charconv_common_sources) $(devinfo_common_sources)
354
320355 mkfs_fat_CPPFLAGS = -I$(srcdir)/blkdev
321 mkfs_fat_CFLAGS = $(AM_CFLAGS) $(UDEV_CFLAGS)
322 mkfs_fat_LDADD = $(UDEV_LIBS)
323 testdevinfo_SOURCES = testdevinfo.c $(mkfs_common_sources)
356 mkfs_fat_CFLAGS = $(AM_CFLAGS)
357 mkfs_fat_LDADD = $(charconv_common_ldadd)
358 testdevinfo_SOURCES = testdevinfo.c $(devinfo_common_sources)
324359 testdevinfo_CPPFLAGS = -I$(srcdir)/blkdev
325 testdevinfo_CFLAGS = $(AM_CFLAGS) $(UDEV_CFLAGS)
326 testdevinfo_LDADD = $(UDEV_LIBS)
360 testdevinfo_CFLAGS = $(AM_CFLAGS)
327361 all: all-am
328362
329363 .SUFFIXES:
345379 *config.status*) \
346380 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
347381 *) \
348 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
349 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
382 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
383 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
350384 esac;
351385
352386 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
442476 distclean-compile:
443477 -rm -f *.tab.c
444478
445 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/boot.Po@am__quote@
446 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/charconv.Po@am__quote@
447 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check.Po@am__quote@
448 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@
449 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fat.Po@am__quote@
450 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fatlabel.Po@am__quote@
451 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@
452 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsck.fat.Po@am__quote@
453 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io.Po@am__quote@
454 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lfn.Po@am__quote@
455 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfs_fat-device_info.Po@am__quote@
456 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfs_fat-mkfs.fat.Po@am__quote@
457 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdevinfo-device_info.Po@am__quote@
458 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdevinfo-testdevinfo.Po@am__quote@
459 @AMDEP_TRUE@@am__include@ @am__quote@blkdev/$(DEPDIR)/mkfs_fat-blkdev.Po@am__quote@
460 @AMDEP_TRUE@@am__include@ @am__quote@blkdev/$(DEPDIR)/mkfs_fat-linux_version.Po@am__quote@
461 @AMDEP_TRUE@@am__include@ @am__quote@blkdev/$(DEPDIR)/testdevinfo-blkdev.Po@am__quote@
462 @AMDEP_TRUE@@am__include@ @am__quote@blkdev/$(DEPDIR)/testdevinfo-linux_version.Po@am__quote@
479 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/boot.Po@am__quote@ # am--include-marker
480 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/charconv.Po@am__quote@ # am--include-marker
481 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check.Po@am__quote@ # am--include-marker
482 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@ # am--include-marker
483 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fat.Po@am__quote@ # am--include-marker
484 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fatlabel.Po@am__quote@ # am--include-marker
485 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@ # am--include-marker
486 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsck.fat.Po@am__quote@ # am--include-marker
487 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io.Po@am__quote@ # am--include-marker
488 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lfn.Po@am__quote@ # am--include-marker
489 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfs_fat-charconv.Po@am__quote@ # am--include-marker
490 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfs_fat-common.Po@am__quote@ # am--include-marker
491 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfs_fat-device_info.Po@am__quote@ # am--include-marker
492 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfs_fat-mkfs.fat.Po@am__quote@ # am--include-marker
493 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdevinfo-device_info.Po@am__quote@ # am--include-marker
494 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdevinfo-testdevinfo.Po@am__quote@ # am--include-marker
495 @AMDEP_TRUE@@am__include@ @am__quote@blkdev/$(DEPDIR)/mkfs_fat-blkdev.Po@am__quote@ # am--include-marker
496 @AMDEP_TRUE@@am__include@ @am__quote@blkdev/$(DEPDIR)/mkfs_fat-linux_version.Po@am__quote@ # am--include-marker
497 @AMDEP_TRUE@@am__include@ @am__quote@blkdev/$(DEPDIR)/testdevinfo-blkdev.Po@am__quote@ # am--include-marker
498 @AMDEP_TRUE@@am__include@ @am__quote@blkdev/$(DEPDIR)/testdevinfo-linux_version.Po@am__quote@ # am--include-marker
499
500 $(am__depfiles_remade):
501 @$(MKDIR_P) $(@D)
502 @echo '# dummy' >$@-t && $(am__mv) $@-t $@
503
504 am--depfiles: $(am__depfiles_remade)
463505
464506 .c.o:
465507 @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
490532 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mkfs.fat.c' object='mkfs_fat-mkfs.fat.obj' libtool=no @AMDEPBACKSLASH@
491533 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
492534 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o mkfs_fat-mkfs.fat.obj `if test -f 'mkfs.fat.c'; then $(CYGPATH_W) 'mkfs.fat.c'; else $(CYGPATH_W) '$(srcdir)/mkfs.fat.c'; fi`
535
536 mkfs_fat-common.o: common.c
537 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT mkfs_fat-common.o -MD -MP -MF $(DEPDIR)/mkfs_fat-common.Tpo -c -o mkfs_fat-common.o `test -f 'common.c' || echo '$(srcdir)/'`common.c
538 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mkfs_fat-common.Tpo $(DEPDIR)/mkfs_fat-common.Po
539 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='common.c' object='mkfs_fat-common.o' libtool=no @AMDEPBACKSLASH@
540 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
541 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o mkfs_fat-common.o `test -f 'common.c' || echo '$(srcdir)/'`common.c
542
543 mkfs_fat-common.obj: common.c
544 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT mkfs_fat-common.obj -MD -MP -MF $(DEPDIR)/mkfs_fat-common.Tpo -c -o mkfs_fat-common.obj `if test -f 'common.c'; then $(CYGPATH_W) 'common.c'; else $(CYGPATH_W) '$(srcdir)/common.c'; fi`
545 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mkfs_fat-common.Tpo $(DEPDIR)/mkfs_fat-common.Po
546 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='common.c' object='mkfs_fat-common.obj' libtool=no @AMDEPBACKSLASH@
547 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
548 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o mkfs_fat-common.obj `if test -f 'common.c'; then $(CYGPATH_W) 'common.c'; else $(CYGPATH_W) '$(srcdir)/common.c'; fi`
549
550 mkfs_fat-charconv.o: charconv.c
551 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT mkfs_fat-charconv.o -MD -MP -MF $(DEPDIR)/mkfs_fat-charconv.Tpo -c -o mkfs_fat-charconv.o `test -f 'charconv.c' || echo '$(srcdir)/'`charconv.c
552 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mkfs_fat-charconv.Tpo $(DEPDIR)/mkfs_fat-charconv.Po
553 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='charconv.c' object='mkfs_fat-charconv.o' libtool=no @AMDEPBACKSLASH@
554 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
555 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o mkfs_fat-charconv.o `test -f 'charconv.c' || echo '$(srcdir)/'`charconv.c
556
557 mkfs_fat-charconv.obj: charconv.c
558 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT mkfs_fat-charconv.obj -MD -MP -MF $(DEPDIR)/mkfs_fat-charconv.Tpo -c -o mkfs_fat-charconv.obj `if test -f 'charconv.c'; then $(CYGPATH_W) 'charconv.c'; else $(CYGPATH_W) '$(srcdir)/charconv.c'; fi`
559 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mkfs_fat-charconv.Tpo $(DEPDIR)/mkfs_fat-charconv.Po
560 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='charconv.c' object='mkfs_fat-charconv.obj' libtool=no @AMDEPBACKSLASH@
561 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
562 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o mkfs_fat-charconv.obj `if test -f 'charconv.c'; then $(CYGPATH_W) 'charconv.c'; else $(CYGPATH_W) '$(srcdir)/charconv.c'; fi`
493563
494564 mkfs_fat-device_info.o: device_info.c
495565 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT mkfs_fat-device_info.o -MD -MP -MF $(DEPDIR)/mkfs_fat-device_info.Tpo -c -o mkfs_fat-device_info.o `test -f 'device_info.c' || echo '$(srcdir)/'`device_info.c
641711 distclean-tags:
642712 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
643713
644 distdir: $(DISTFILES)
714 distdir: $(BUILT_SOURCES)
715 $(MAKE) $(AM_MAKEFLAGS) distdir-am
716
717 distdir-am: $(DISTFILES)
645718 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
646719 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
647720 list='$(DISTFILES)'; \
718791 mostlyclean-am
719792
720793 distclean: distclean-am
721 -rm -rf ./$(DEPDIR) blkdev/$(DEPDIR)
794 -rm -f ./$(DEPDIR)/boot.Po
795 -rm -f ./$(DEPDIR)/charconv.Po
796 -rm -f ./$(DEPDIR)/check.Po
797 -rm -f ./$(DEPDIR)/common.Po
798 -rm -f ./$(DEPDIR)/fat.Po
799 -rm -f ./$(DEPDIR)/fatlabel.Po
800 -rm -f ./$(DEPDIR)/file.Po
801 -rm -f ./$(DEPDIR)/fsck.fat.Po
802 -rm -f ./$(DEPDIR)/io.Po
803 -rm -f ./$(DEPDIR)/lfn.Po
804 -rm -f ./$(DEPDIR)/mkfs_fat-charconv.Po
805 -rm -f ./$(DEPDIR)/mkfs_fat-common.Po
806 -rm -f ./$(DEPDIR)/mkfs_fat-device_info.Po
807 -rm -f ./$(DEPDIR)/mkfs_fat-mkfs.fat.Po
808 -rm -f ./$(DEPDIR)/testdevinfo-device_info.Po
809 -rm -f ./$(DEPDIR)/testdevinfo-testdevinfo.Po
810 -rm -f blkdev/$(DEPDIR)/mkfs_fat-blkdev.Po
811 -rm -f blkdev/$(DEPDIR)/mkfs_fat-linux_version.Po
812 -rm -f blkdev/$(DEPDIR)/testdevinfo-blkdev.Po
813 -rm -f blkdev/$(DEPDIR)/testdevinfo-linux_version.Po
722814 -rm -f Makefile
723815 distclean-am: clean-am distclean-compile distclean-generic \
724816 distclean-tags
765857 installcheck-am:
766858
767859 maintainer-clean: maintainer-clean-am
768 -rm -rf ./$(DEPDIR) blkdev/$(DEPDIR)
860 -rm -f ./$(DEPDIR)/boot.Po
861 -rm -f ./$(DEPDIR)/charconv.Po
862 -rm -f ./$(DEPDIR)/check.Po
863 -rm -f ./$(DEPDIR)/common.Po
864 -rm -f ./$(DEPDIR)/fat.Po
865 -rm -f ./$(DEPDIR)/fatlabel.Po
866 -rm -f ./$(DEPDIR)/file.Po
867 -rm -f ./$(DEPDIR)/fsck.fat.Po
868 -rm -f ./$(DEPDIR)/io.Po
869 -rm -f ./$(DEPDIR)/lfn.Po
870 -rm -f ./$(DEPDIR)/mkfs_fat-charconv.Po
871 -rm -f ./$(DEPDIR)/mkfs_fat-common.Po
872 -rm -f ./$(DEPDIR)/mkfs_fat-device_info.Po
873 -rm -f ./$(DEPDIR)/mkfs_fat-mkfs.fat.Po
874 -rm -f ./$(DEPDIR)/testdevinfo-device_info.Po
875 -rm -f ./$(DEPDIR)/testdevinfo-testdevinfo.Po
876 -rm -f blkdev/$(DEPDIR)/mkfs_fat-blkdev.Po
877 -rm -f blkdev/$(DEPDIR)/mkfs_fat-linux_version.Po
878 -rm -f blkdev/$(DEPDIR)/testdevinfo-blkdev.Po
879 -rm -f blkdev/$(DEPDIR)/testdevinfo-linux_version.Po
769880 -rm -f Makefile
770881 maintainer-clean-am: distclean-am maintainer-clean-generic
771882
786897 $(MAKE) $(AM_MAKEFLAGS) uninstall-hook
787898 .MAKE: install-am install-exec-am install-strip uninstall-am
788899
789 .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
790 clean-noinstPROGRAMS clean-sbinPROGRAMS cscopelist-am ctags \
791 ctags-am distclean distclean-compile distclean-generic \
792 distclean-tags distdir dvi dvi-am html html-am info info-am \
793 install install-am install-data install-data-am install-dvi \
794 install-dvi-am install-exec install-exec-am install-exec-hook \
795 install-html install-html-am install-info install-info-am \
796 install-man install-pdf install-pdf-am install-ps \
797 install-ps-am install-sbinPROGRAMS install-strip installcheck \
798 installcheck-am installdirs maintainer-clean \
799 maintainer-clean-generic mostlyclean mostlyclean-compile \
800 mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
801 uninstall-am uninstall-hook uninstall-sbinPROGRAMS
900 .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
901 clean-generic clean-noinstPROGRAMS clean-sbinPROGRAMS \
902 cscopelist-am ctags ctags-am distclean distclean-compile \
903 distclean-generic distclean-tags distdir dvi dvi-am html \
904 html-am info info-am install install-am install-data \
905 install-data-am install-dvi install-dvi-am install-exec \
906 install-exec-am install-exec-hook install-html install-html-am \
907 install-info install-info-am install-man install-pdf \
908 install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \
909 install-strip installcheck installcheck-am installdirs \
910 maintainer-clean maintainer-clean-generic mostlyclean \
911 mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
912 tags tags-am uninstall uninstall-am uninstall-hook \
913 uninstall-sbinPROGRAMS
802914
803915 .PRECIOUS: Makefile
804916
0 The source files blkdev.[ch] and linux_version.[ch] have been taken from
1 util-linux (git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git)
2 git revision 42f536ee8.
66 #include <sys/types.h>
77 #include <sys/stat.h>
88 #include <sys/ioctl.h>
9 #include <sys/sysmacros.h>
910 #include <unistd.h>
1011 #include <stdint.h>
12 #include <stdio.h>
13 #include <limits.h>
1114
1215 #ifdef HAVE_LINUX_HDREG_H
1316 #include <linux/hdreg.h>
316319 /*
317320 * Get start offset of partition
318321 */
319 int blkdev_get_start(int fd, unsigned int *s)
320 {
322 int blkdev_get_start(int fd, dev_t rdev, unsigned long long *s)
323 {
324 #ifdef __linux__
325 {
326 char path[PATH_MAX];
327 FILE *file;
328 int ret;
329
330 snprintf(path, sizeof(path), "/sys/dev/block/%d:%d/start", major(rdev), minor(rdev));
331 file = fopen(path, "r");
332 if (file) {
333 ret = fscanf(file, "%llu", s);
334 fclose(file);
335 if (ret == 1)
336 return 0;
337 }
338 }
339 #endif
340
321341 #ifdef HDIO_GETGEO
342 {
322343 struct hd_geometry geometry;
323344
324345 if (ioctl(fd, HDIO_GETGEO, &geometry) == 0) {
325346 *s = geometry.start;
326347 return 0;
327348 }
328 #endif
329
349 }
350 #endif
351
352 (void)rdev; /* prevent unused parameter warning */
330353 (void)fd; /* prevent unused parameter warning */
331354 *s = 0;
332355 return -1;
121121 int blkdev_get_geometry(int fd, unsigned int *h, unsigned int *s);
122122
123123 /* get partition devices start offset */
124 int blkdev_get_start(int fd, unsigned int *s);
124 int blkdev_get_start(int fd, dev_t rdev, unsigned long long *s);
125125
126126 /* SCSI device types. Copied almost as-is from kernel header.
127127 * http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/scsi/scsi.h */
22 Copyright (C) 1993 Werner Almesberger <werner.almesberger@lrc.di.epfl.ch>
33 Copyright (C) 1998 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
44 Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
5 Copyright (C) 2015 Andreas Bombe <aeb@debian.org>
5 Copyright (C) 2015-2017 Andreas Bombe <aeb@debian.org>
6 Copyright (C) 2018-2021 Pali Rohár <pali.rohar@gmail.com>
67
78 This program is free software: you can redistribute it and/or modify
89 it under the terms of the GNU General Public License as published by
2425 /* FAT32, VFAT, Atari format support, and various fixes additions May 1998
2526 * by Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de> */
2627
28 #include <limits.h>
2729 #include <stdio.h>
2830 #include <stdint.h>
2931 #include <string.h>
3739 #include "io.h"
3840 #include "boot.h"
3941 #include "check.h"
42 #include "charconv.h"
4043
4144 #define ROUND_TO_MULTIPLE(n,m) ((n) && (m) ? (n)+(m)-1-((n)-1)%(m) : 0)
4245 /* don't divide by zero */
4447 /* cut-over cluster counts for FAT12 and FAT16 */
4548 #define FAT12_THRESHOLD 4085
4649 #define FAT16_THRESHOLD 65525
50
51 off_t alloc_rootdir_entry(DOS_FS * fs, DIR_ENT * de, const char *pattern, int gen_name)
52 {
53 static int curr_num = 0;
54 off_t offset;
55
56 if (fs->root_cluster) {
57 DIR_ENT d2;
58 int i = 0, got = 0;
59 uint32_t clu_num, prev = 0;
60 off_t offset2;
61
62 clu_num = fs->root_cluster;
63 offset = cluster_start(fs, clu_num);
64 while (clu_num > 0 && clu_num != -1) {
65 fs_read(offset, sizeof(DIR_ENT), &d2);
66 if (IS_FREE(d2.name) && d2.attr != VFAT_LN_ATTR) {
67 got = 1;
68 break;
69 }
70 i += sizeof(DIR_ENT);
71 offset += sizeof(DIR_ENT);
72 if ((i % fs->cluster_size) == 0) {
73 prev = clu_num;
74 if ((clu_num = next_cluster(fs, clu_num)) == 0 || clu_num == -1)
75 break;
76 offset = cluster_start(fs, clu_num);
77 }
78 }
79 if (!got) {
80 /* no free slot, need to extend root dir: alloc next free cluster
81 * after previous one */
82 if (!prev)
83 die("Root directory has no cluster allocated!");
84 for (clu_num = prev + 1; clu_num != prev; clu_num++) {
85 FAT_ENTRY entry;
86
87 if (clu_num >= fs->data_clusters + 2)
88 clu_num = 2;
89 get_fat(&entry, fs->fat, clu_num, fs);
90 if (!entry.value)
91 break;
92 }
93 if (clu_num == prev)
94 die("Root directory full and no free cluster");
95 set_fat(fs, prev, clu_num);
96 set_fat(fs, clu_num, -1);
97 set_owner(fs, clu_num, get_owner(fs, fs->root_cluster));
98 /* clear new cluster */
99 memset(&d2, 0, sizeof(d2));
100 offset = cluster_start(fs, clu_num);
101 for (i = 0; i < fs->cluster_size; i += sizeof(DIR_ENT))
102 fs_write(offset + i, sizeof(d2), &d2);
103 }
104 memset(de, 0, sizeof(DIR_ENT));
105 if (gen_name) {
106 while (1) {
107 char expanded[12];
108 sprintf(expanded, pattern, curr_num);
109 memcpy(de->name, expanded, MSDOS_NAME);
110 clu_num = fs->root_cluster;
111 i = 0;
112 offset2 = cluster_start(fs, clu_num);
113 while (clu_num > 0 && clu_num != -1) {
114 fs_read(offset2, sizeof(DIR_ENT), &d2);
115 if (offset2 != offset &&
116 !strncmp((const char *)d2.name, (const char *)de->name,
117 MSDOS_NAME))
118 break;
119 i += sizeof(DIR_ENT);
120 offset2 += sizeof(DIR_ENT);
121 if ((i % fs->cluster_size) == 0) {
122 if ((clu_num = next_cluster(fs, clu_num)) == 0 ||
123 clu_num == -1)
124 break;
125 offset2 = cluster_start(fs, clu_num);
126 }
127 }
128 if (clu_num == 0 || clu_num == -1)
129 break;
130 if (++curr_num >= 10000)
131 die("Unable to create unique name");
132 }
133 } else {
134 memcpy(de->name, pattern, MSDOS_NAME);
135 }
136 } else {
137 DIR_ENT *root;
138 int next_free = 0, scan;
139
140 root = alloc(fs->root_entries * sizeof(DIR_ENT));
141 fs_read(fs->root_start, fs->root_entries * sizeof(DIR_ENT), root);
142
143 while (next_free < fs->root_entries)
144 if (IS_FREE(root[next_free].name) &&
145 root[next_free].attr != VFAT_LN_ATTR)
146 break;
147 else
148 next_free++;
149 if (next_free == fs->root_entries)
150 die("Root directory is full.");
151 offset = fs->root_start + next_free * sizeof(DIR_ENT);
152 memset(de, 0, sizeof(DIR_ENT));
153 if (gen_name) {
154 while (1) {
155 char expanded[12];
156 sprintf(expanded, pattern, curr_num);
157 memcpy(de->name, expanded, MSDOS_NAME);
158 for (scan = 0; scan < fs->root_entries; scan++)
159 if (scan != next_free &&
160 !strncmp((const char *)root[scan].name,
161 (const char *)de->name, MSDOS_NAME))
162 break;
163 if (scan == fs->root_entries)
164 break;
165 if (++curr_num >= 10000)
166 die("Unable to create unique name");
167 }
168 } else {
169 memcpy(de->name, pattern, MSDOS_NAME);
170 }
171 free(root);
172 }
173 ++n_files;
174 return offset;
175 }
47176
48177 static struct {
49178 uint8_t media;
102231 (unsigned long long)fs->fat_start,
103232 (unsigned long long)fs->fat_start / lss);
104233 printf("%10d FATs, %d bit entries\n", b->fats, fs->fat_bits);
105 printf("%10lld bytes per FAT (= %llu sectors)\n", (long long)fs->fat_size,
106 (long long)fs->fat_size / lss);
234 printf("%10u bytes per FAT (= %u sectors)\n", fs->fat_size,
235 fs->fat_size / lss);
107236 if (!fs->root_cluster) {
108237 printf("Root directory starts at byte %llu (sector %llu)\n",
109238 (unsigned long long)fs->root_start,
139268 printf("And there is no space for creating one!\n");
140269 return;
141270 }
142 if (interactive)
143 printf("1) Create one\n2) Do without a backup\n");
144 else
145 printf(" Auto-creating backup boot block.\n");
146 if (!interactive || get_key("12", "?") == '1') {
271 if (get_choice(1, " Auto-creating backup boot block.",
272 2,
273 1, "Create one",
274 2, "Do without a backup") == 1) {
147275 unsigned int bbs;
148276 /* The usual place for the backup boot sector is sector 6. Choose
149277 * that or the last reserved sector. */
170298 /* there are any differences */
171299 uint8_t *p, *q;
172300 int i, pos, first = 1;
173 char buf[20];
301 char buf[32];
174302
175303 printf("There are differences between boot sector and its backup.\n");
176304 printf("This is mostly harmless. Differences: (offset:original/backup)\n ");
189317 }
190318 printf("\n");
191319
192 if (interactive)
193 printf("1) Copy original to backup\n"
194 "2) Copy backup to original\n" "3) No action\n");
195 else
196 printf(" Not automatically fixing this.\n");
197 switch (interactive ? get_key("123", "?") : '3') {
198 case '1':
320 switch (get_choice(3, " Not automatically fixing this.",
321 3,
322 1, "Copy original to backup",
323 2, "Copy backup to original",
324 3, "No action")) {
325 case 1:
199326 fs_write(fs->backupboot_start, sizeof(*b), b);
200327 break;
201 case '2':
328 case 2:
202329 fs_write(0, sizeof(b2), &b2);
203330 break;
204331 default:
207334 }
208335 }
209336
210 static void init_fsinfo(struct info_sector *i)
211 {
212 memset(i, 0, sizeof (struct info_sector));
337 static void init_fsinfo_except_reserved(struct info_sector *i)
338 {
213339 i->magic = htole32(0x41615252);
214340 i->signature = htole32(0x61417272);
215341 i->free_clusters = htole32(-1);
223349
224350 if (!b->info_sector) {
225351 printf("No FSINFO sector\n");
226 if (interactive)
227 printf("1) Create one\n2) Do without FSINFO\n");
228 else
229 printf(" Not automatically creating it.\n");
230 if (interactive && get_key("12", "?") == '1') {
352 if (get_choice(2, " Not automatically creating it.",
353 2,
354 1, "Create one",
355 2, "Do without FSINFO") == 1) {
231356 /* search for a free reserved sector (not boot sector and not
232357 * backup boot sector) */
233358 uint32_t s;
235360 if (s != le16toh(b->backup_boot))
236361 break;
237362 if (s > 0 && s < le16toh(b->reserved)) {
238 init_fsinfo(&i);
363 memset(&i, 0, sizeof (struct info_sector));
364 init_fsinfo_except_reserved(&i);
239365 fs_write((off_t)s * lss, sizeof(i), &i);
240366 b->info_sector = htole16(s);
241367 fs_write(offsetof(struct boot_sector, info_sector),
271397 printf(" Offset %llu: 0x%08x != expected 0x%08x\n",
272398 (unsigned long long)offsetof(struct info_sector, boot_sign),
273399 le32toh(i.boot_sign), 0xaa550000);
274 if (interactive)
275 printf("1) Correct\n2) Don't correct (FSINFO invalid then)\n");
276 else
277 printf(" Auto-correcting it.\n");
278 if (!interactive || get_key("12", "?") == '1') {
279 init_fsinfo(&i);
400 if (get_choice(1, " Auto-correcting it.",
401 2,
402 1, "Correct",
403 2, "Don't correct (FSINFO invalid then)") == 1) {
404 init_fsinfo_except_reserved(&i);
280405 fs_write(fs->fsinfo_start, sizeof(i), &i);
281406 } else
282407 fs->fsinfo_start = 0;
286411 fs->free_clusters = le32toh(i.free_clusters);
287412 }
288413
289 static char print_fat_dirty_state(void)
290 {
291 printf("Dirty bit is set. Fs was not properly unmounted and"
292 " some data may be corrupt.\n");
293
294 if (interactive) {
295 printf("1) Remove dirty bit\n" "2) No action\n");
296 return get_key("12", "?");
297 } else
298 printf(" Automatically removing dirty bit.\n");
299 return '1';
300 }
301
302 static void check_fat_state_bit(DOS_FS * fs, void *b)
303 {
304 if (fs->fat_bits == 32) {
305 struct boot_sector *b32 = b;
306
307 if (b32->reserved3 & FAT_STATE_DIRTY) {
308 printf("0x41: ");
309 if (print_fat_dirty_state() == '1') {
310 b32->reserved3 &= ~FAT_STATE_DIRTY;
311 fs_write(0, sizeof(*b32), b32);
312 }
313 }
314 } else {
315 struct boot_sector_16 *b16 = b;
316
317 if (b16->reserved2 & FAT_STATE_DIRTY) {
318 printf("0x25: ");
319 if (print_fat_dirty_state() == '1') {
320 b16->reserved2 &= ~FAT_STATE_DIRTY;
321 fs_write(0, sizeof(*b16), b16);
322 }
323 }
324 }
325 }
326
327414 void read_boot(DOS_FS * fs)
328415 {
329416 struct boot_sector b;
330417 unsigned total_sectors;
331418 unsigned int logical_sector_size, sectors;
332 off_t fat_length;
419 long long fat_length;
333420 unsigned total_fat_entries;
334421 off_t data_size;
422 long long position;
335423
336424 fs_read(0, sizeof(b), &b);
337425 logical_sector_size = GET_UNALIGNED_W(b.sector_size);
342430 /* if the platform needs special handling of unaligned multibyte accesses */
343431 /* but such handling isn't being provided. See GET_UNALIGNED_W() above. */
344432 if (logical_sector_size & (SECTOR_SIZE - 1))
345 die("Logical sector size (%d bytes) is not a multiple of the physical "
433 die("Logical sector size (%u bytes) is not a multiple of the physical "
346434 "sector size.", logical_sector_size);
347435
348436 fs->cluster_size = b.cluster_size * logical_sector_size;
356444 if (verbose)
357445 printf("Checking we can access the last sector of the filesystem\n");
358446 /* Can't access last odd sector anyway, so round down */
359 fs_test((off_t)((total_sectors & ~1) - 1) * logical_sector_size,
360 logical_sector_size);
447 position = (long long)((total_sectors & ~1) - 1) * logical_sector_size;
448 if (position > OFF_MAX)
449 die("Filesystem is too large.");
450 if (!fs_test(position, logical_sector_size))
451 die("Failed to read sector %u.", (total_sectors & ~1) - 1);
361452
362453 fat_length = le16toh(b.fat_length) ?
363454 le16toh(b.fat_length) : le32toh(b.fat32_length);
365456 die("FAT size is zero.");
366457
367458 fs->fat_start = (off_t)le16toh(b.reserved) * logical_sector_size;
368 fs->root_start = ((off_t)le16toh(b.reserved) + b.fats * fat_length) *
459 position = (le16toh(b.reserved) + b.fats * fat_length) *
369460 logical_sector_size;
461 if (position > OFF_MAX)
462 die("Filesystem is too large.");
463 fs->root_start = position;
370464 fs->root_entries = GET_UNALIGNED_W(b.dir_entries);
371 fs->data_start = fs->root_start + ROUND_TO_MULTIPLE(fs->root_entries <<
372 MSDOS_DIR_BITS,
373 logical_sector_size);
374
375 data_size = (off_t)total_sectors * logical_sector_size - fs->data_start;
465 position = (long long)fs->root_start +
466 ROUND_TO_MULTIPLE(fs->root_entries << MSDOS_DIR_BITS,
467 logical_sector_size);
468 if (position > OFF_MAX)
469 die("Filesystem is too large.");
470 fs->data_start = position;
471 position = (long long)total_sectors * logical_sector_size - fs->data_start;
472 if (position > OFF_MAX)
473 die("Filesystem is too large.");
474 data_size = position;
376475 if (data_size < fs->cluster_size)
377476 die("Filesystem has no space for any data clusters");
378477
389488 * (root_entries != 0), we handle the root dir the old way. Give a
390489 * warning, but convertig to a root dir in a cluster chain seems
391490 * to complex for now... */
392 printf("Warning: FAT32 root dir not in cluster chain! "
491 fprintf(stderr, "Warning: FAT32 root dir not in cluster chain! "
393492 "Compatibility mode...\n");
394493 else if (!fs->root_cluster && !fs->root_entries)
395494 die("No root directory!");
396495 else if (fs->root_cluster && fs->root_entries)
397 printf("Warning: FAT32 root dir is in a cluster chain, but "
496 fprintf(stderr, "Warning: FAT32 root dir is in a cluster chain, but "
398497 "a separate root dir\n"
399498 " area is defined. Cannot fix this easily.\n");
400499 if (fs->data_clusters < FAT16_THRESHOLD)
401 printf("Warning: Filesystem is FAT32 according to fat_length "
500 fprintf(stderr, "Warning: Filesystem is FAT32 according to fat_length "
402501 "and fat32_length fields,\n"
403502 " but has only %lu clusters, less than the required "
404503 "minimum of %d.\n"
405504 " This may lead to problems on some systems.\n",
406505 (unsigned long)fs->data_clusters, FAT16_THRESHOLD);
407506
408 check_fat_state_bit(fs, &b);
409507 fs->backupboot_start = le16toh(b.backup_boot) * logical_sector_size;
410508 check_backup_boot(fs, &b, logical_sector_size);
411509
417515 if (fs->data_clusters >= FAT16_THRESHOLD)
418516 die("Too many clusters (%lu) for FAT16 filesystem.",
419517 (unsigned long)fs->data_clusters);
420 check_fat_state_bit(fs, &b);
421518 } else {
422519 /* On Atari, things are more difficult: GEMDOS always uses 12bit FATs
423520 * on floppies, and always 16 bit on harddisks. */
432529 }
433530 /* On FAT32, the high 4 bits of a FAT entry are reserved */
434531 fs->eff_fat_bits = (fs->fat_bits == 32) ? 28 : fs->fat_bits;
435 fs->fat_size = fat_length * logical_sector_size;
436
437 fs->label = calloc(12, sizeof(uint8_t));
532 position = fat_length * logical_sector_size;
533 if (position > OFF_MAX)
534 die("Filesystem is too large.");
535 fs->fat_size = position;
536
537 fs->label[0] = 0;
438538 if (fs->fat_bits == 12 || fs->fat_bits == 16) {
439539 struct boot_sector_16 *b16 = (struct boot_sector_16 *)&b;
440 if (b16->extended_sig == 0x29)
540 if (b16->extended_sig == 0x29) {
441541 memmove(fs->label, b16->label, 11);
442 else
443 fs->label = NULL;
542 fs->serial = b16->serial;
543 }
444544 } else if (fs->fat_bits == 32) {
445 if (b.extended_sig == 0x29)
545 if (b.extended_sig == 0x29) {
446546 memmove(fs->label, &b.label, 11);
447 else
448 fs->label = NULL;
449 }
450
451 total_fat_entries = (uint64_t)fs->fat_size * 8 / fs->fat_bits;
547 fs->serial = b.serial;
548 }
549 }
550
551 position = (long long)fs->fat_size * 8 / fs->fat_bits;
552 if (position > UINT_MAX)
553 die("FAT has space for too many entries (%lld).", (long long)position);
554 total_fat_entries = position;
452555 if (fs->data_clusters > total_fat_entries - 2)
453556 die("Filesystem has %u clusters but only space for %u FAT entries.",
454557 fs->data_clusters, total_fat_entries - 2);
469572 dump_boot(fs, &b, logical_sector_size);
470573 }
471574
472 static void write_boot_label(DOS_FS * fs, char *label)
575 static void write_boot_label_or_serial(int label_mode, DOS_FS * fs,
576 const char *label, uint32_t serial)
473577 {
474578 if (fs->fat_bits == 12 || fs->fat_bits == 16) {
475579 struct boot_sector_16 b16;
478582 if (b16.extended_sig != 0x29) {
479583 b16.extended_sig = 0x29;
480584 b16.serial = 0;
585 memmove(b16.label, "NO NAME ", 11);
481586 memmove(b16.fs_type, fs->fat_bits == 12 ? "FAT12 " : "FAT16 ",
482587 8);
483588 }
484 memmove(b16.label, label, 11);
589
590 if (label_mode)
591 memmove(b16.label, label, 11);
592 else
593 b16.serial = serial;
594
485595 fs_write(0, sizeof(b16), &b16);
486596 } else if (fs->fat_bits == 32) {
487597 struct boot_sector b;
490600 if (b.extended_sig != 0x29) {
491601 b.extended_sig = 0x29;
492602 b.serial = 0;
603 memmove(b.label, "NO NAME ", 11);
493604 memmove(b.fs_type, "FAT32 ", 8);
494605 }
495 memmove(b.label, label, 11);
606
607 if (label_mode)
608 memmove(b.label, label, 11);
609 else
610 b.serial = serial;
611
496612 fs_write(0, sizeof(b), &b);
497613 if (fs->backupboot_start)
498614 fs_write(fs->backupboot_start, sizeof(b), &b);
499615 }
616 }
617
618 void write_boot_label(DOS_FS * fs, const char *label)
619 {
620 write_boot_label_or_serial(1, fs, label, 0);
621 }
622
623 void write_serial(DOS_FS * fs, uint32_t serial)
624 {
625 write_boot_label_or_serial(0, fs, NULL, serial);
500626 }
501627
502628 off_t find_volume_de(DOS_FS * fs, DIR_ENT * de)
512638 offset = cluster_start(fs, cluster);
513639 for (i = 0; i * sizeof(DIR_ENT) < fs->cluster_size; i++) {
514640 fs_read(offset, sizeof(DIR_ENT), de);
515 if (de->attr != VFAT_LN_ATTR && de->attr & ATTR_VOLUME)
641
642 /* no point in scanning after end of directory marker */
643 if (!de->name[0])
644 return 0;
645
646 if (!IS_FREE(de->name) &&
647 de->attr != VFAT_LN_ATTR && de->attr & ATTR_VOLUME)
516648 return offset;
517649 offset += sizeof(DIR_ENT);
518650 }
521653 for (i = 0; i < fs->root_entries; i++) {
522654 offset = fs->root_start + i * sizeof(DIR_ENT);
523655 fs_read(offset, sizeof(DIR_ENT), de);
524 if (de->attr != VFAT_LN_ATTR && de->attr & ATTR_VOLUME)
656
657 /* no point in scanning after end of directory marker */
658 if (!de->name[0])
659 return 0;
660
661 if (!IS_FREE(de->name) &&
662 de->attr != VFAT_LN_ATTR && de->attr & ATTR_VOLUME)
525663 return offset;
526664 }
527665 }
529667 return 0;
530668 }
531669
532 static void write_volume_label(DOS_FS * fs, char *label)
533 {
534 time_t now = time(NULL);
535 struct tm *mtime = localtime(&now);
670 void write_volume_label(DOS_FS * fs, char *label)
671 {
672 time_t now;
673 struct tm *mtime;
536674 off_t offset;
537675 int created;
538676 DIR_ENT de;
543681 created = 1;
544682 offset = alloc_rootdir_entry(fs, &de, label, 0);
545683 }
684
546685 memcpy(de.name, label, 11);
547 de.time = htole16((unsigned short)((mtime->tm_sec >> 1) +
548 (mtime->tm_min << 5) +
549 (mtime->tm_hour << 11)));
550 de.date = htole16((unsigned short)(mtime->tm_mday +
551 ((mtime->tm_mon + 1) << 5) +
552 ((mtime->tm_year - 80) << 9)));
686 if (de.name[0] == 0xe5)
687 de.name[0] = 0x05;
688
689 now = time(NULL);
690 mtime = (now != (time_t)-1) ? localtime(&now) : NULL;
691 if (mtime && mtime->tm_year >= 80 && mtime->tm_year <= 207) {
692 de.time = htole16((unsigned short)((mtime->tm_sec >> 1) +
693 (mtime->tm_min << 5) +
694 (mtime->tm_hour << 11)));
695 de.date = htole16((unsigned short)(mtime->tm_mday +
696 ((mtime->tm_mon + 1) << 5) +
697 ((mtime->tm_year - 80) << 9)));
698 } else {
699 /* fallback to 1.1.1980 00:00:00 */
700 de.time = htole16(0);
701 de.date = htole16(1 + (1 << 5));
702 }
553703 if (created) {
554704 de.attr = ATTR_VOLUME;
555705 de.ctime_ms = 0;
574724 write_boot_label(fs, label);
575725 write_volume_label(fs, label);
576726 }
727
728 void remove_label(DOS_FS *fs)
729 {
730 off_t offset;
731 DIR_ENT de;
732
733 write_boot_label(fs, "NO NAME ");
734
735 offset = find_volume_de(fs, &de);
736 if (offset) {
737 /* mark entry as deleted */
738 de.name[0] = 0xe5;
739 /* remove ATTR_VOLUME for compatibility with older fatlabel version
740 * which ignores above deletion mark for entries with ATTR_VOLUME */
741 de.attr = 0;
742 fs_write(offset, sizeof(DIR_ENT), &de);
743 }
744 }
745
746 const char *pretty_label(const char *label)
747 {
748 static char buffer[256];
749 char *p;
750 int i;
751 int last;
752
753 for (last = 10; last >= 0; last--) {
754 if (label[last] != ' ')
755 break;
756 }
757
758 p = buffer;
759 for (i = 0; i <= last && label[i] && p < buffer + sizeof(buffer) - 1; ++i) {
760 if (!dos_char_to_printable(&p, label[i], buffer + sizeof(buffer) - 1 - p))
761 *p++ = '_';
762 }
763 *p = 0;
764
765 return buffer;
766 }
11
22 Copyright (C) 1993 Werner Almesberger <werner.almesberger@lrc.di.epfl.ch>
33 Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
4 Copyright (C) 2017 Andreas Bombe <aeb@debian.org>
45
56 This program is free software: you can redistribute it and/or modify
67 it under the terms of the GNU General Public License as published by
2223 #ifndef _BOOT_H
2324 #define _BOOT_H
2425
26 #include <stdint.h>
27
2528 void read_boot(DOS_FS * fs);
2629 void write_label(DOS_FS * fs, char *label);
30 void write_boot_label(DOS_FS * fs, const char *label);
31 void write_volume_label(DOS_FS * fs, char *label);
32 void remove_label(DOS_FS *fs);
33 void write_serial(DOS_FS * fs, uint32_t serial);
2734 off_t find_volume_de(DOS_FS * fs, DIR_ENT * de);
35 const char *pretty_label(const char *label);
2836
2937 /* Reads the boot sector from the currently open device and initializes *FS */
3038
39
40 off_t alloc_rootdir_entry(DOS_FS * fs, DIR_ENT * de, const char *pattern, int gen_name);
41
42 /* Allocate a free slot in the root directory for a new file. If gen_name is
43 true, the file name is constructed after 'pattern', which must include a %d
44 type format for printf and expand to exactly 11 characters. The name
45 actually used is written into the 'de' structure, the rest of *de is cleared.
46 The offset returned is to where in the filesystem the entry belongs. */
47
3148 #endif
0 /* charconv.c
1
2 Copyright (C) 2010 Alexander Korolkov <alexander.korolkov@gmail.com>
3 Copyright (C) 2018-2020 Pali Rohár <pali.rohar@gmail.com>
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 The complete text of the GNU General Public License
19 can be found in /usr/share/common-licenses/GPL-3 file.
20 */
21
022 #include "charconv.h"
1 #include <iconv.h>
223 #include <langinfo.h>
324 #include <locale.h>
425 #include <stdio.h>
5
6 static iconv_t iconv_init_codepage(int codepage)
7 {
8 iconv_t result;
9 char codepage_name[16];
26 #include <stdlib.h>
27 #include <string.h>
28 #include <errno.h>
29 #include <wchar.h>
30
31 #ifdef HAVE_ICONV
32 #include <iconv.h>
33 #endif
34
35 /* CP850 table for 0x80-0xFF range from:
36 * http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP850.TXT
37 */
38 static const wchar_t cp850_table[128] = {
39 0x00c7, 0x00fc, 0x00e9, 0x00e2, 0x00e4, 0x00e0, 0x00e5, 0x00e7,
40 0x00ea, 0x00eb, 0x00e8, 0x00ef, 0x00ee, 0x00ec, 0x00c4, 0x00c5,
41 0x00c9, 0x00e6, 0x00c6, 0x00f4, 0x00f6, 0x00f2, 0x00fb, 0x00f9,
42 0x00ff, 0x00d6, 0x00dc, 0x00f8, 0x00a3, 0x00d8, 0x00d7, 0x0192,
43 0x00e1, 0x00ed, 0x00f3, 0x00fa, 0x00f1, 0x00d1, 0x00aa, 0x00ba,
44 0x00bf, 0x00ae, 0x00ac, 0x00bd, 0x00bc, 0x00a1, 0x00ab, 0x00bb,
45 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00c1, 0x00c2, 0x00c0,
46 0x00a9, 0x2563, 0x2551, 0x2557, 0x255d, 0x00a2, 0x00a5, 0x2510,
47 0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0x00e3, 0x00c3,
48 0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x00a4,
49 0x00f0, 0x00d0, 0x00ca, 0x00cb, 0x00c8, 0x0131, 0x00cd, 0x00ce,
50 0x00cf, 0x2518, 0x250c, 0x2588, 0x2584, 0x00a6, 0x00cc, 0x2580,
51 0x00d3, 0x00df, 0x00d4, 0x00d2, 0x00f5, 0x00d5, 0x00b5, 0x00fe,
52 0x00de, 0x00da, 0x00db, 0x00d9, 0x00fd, 0x00dd, 0x00af, 0x00b4,
53 0x00ad, 0x00b1, 0x2017, 0x00be, 0x00b6, 0x00a7, 0x00f7, 0x00b8,
54 0x00b0, 0x00a8, 0x00b7, 0x00b9, 0x00b3, 0x00b2, 0x25a0, 0x00a0,
55 };
56
57 /* CP850 translit table to 7bit ASCII for 0x80-0xFF range */
58 static const char *const cp850_translit_table[128] = {
59 "C", "u", "e", "a", "a", "a", "a", "c",
60 "e", "e", "e", "i", "i", "i", "A", "A",
61 "E", "ae", "AE", "o", "o", "o", "u", "u",
62 "y", "O", "U", "o", "GBP", "O", "x", "f",
63 "a", "i", "o", "u", "n", "N", "a", "o",
64 "?", "(R)", "!", " 1/2 ", " 1/4 ", "!", "<<", ">>",
65 "?", "?", "?", "|", "+", "A", "A", "A",
66 "(C)", "?", "?", "?", "?", "c", "JPY", "+",
67 "+", "+", "+", "+", "-", "+", "a", "A",
68 "?", "?", "?", "?", "?", "?", "?", "?",
69 "d", "D", "E", "E", "E", "i", "I", "I",
70 "I", "+", "+", "?", "?", "|", "I", "?",
71 "O", "ss", "O", "O", "o", "O", "u", "th",
72 "TH", "U", "U", "U", "y", "Y", "?", "'",
73 "-", "+-", "?", " 3/4 ", "?", "?", "/", ",",
74 "?", "?", ".", "1", "3", "2", "?", " ",
75 };
76
77 static int wchar_string_to_cp850_string(char *out, const wchar_t *in, unsigned int out_size)
78 {
79 unsigned i, j;
80 for (i = 0; i < out_size-1 && in[i]; ++i) {
81 if (in[i] > 0 && in[i] < 0x80) {
82 out[i] = in[i];
83 continue;
84 }
85 for (j = 0; j < 0x80; ++j) {
86 if (in[i] == cp850_table[j]) {
87 out[i] = (0x80 | j);
88 break;
89 }
90 }
91 if (j == 0x80) {
92 fprintf(stderr, "Cannot convert input character 0x%04x to 'CP850': %s\n", (unsigned int)in[i], strerror(EILSEQ));
93 return 0;
94 }
95 }
96 if (in[i]) {
97 fprintf(stderr, "Cannot convert input string to 'CP850': String is too long\n");
98 return 0;
99 }
100 out[i] = 0;
101 return 1;
102 }
103
104 static int cp850_string_to_wchar_string(wchar_t *out, const char *in, unsigned int out_size)
105 {
106 unsigned i;
107 for (i = 0; i < out_size-1 && i < 11 && in[i]; ++i) {
108 out[i] = (in[i] & 0x80) ? cp850_table[in[i] & 0x7F] : in[i];
109 }
110 if (i < 11 && in[i]) {
111 fprintf(stderr, "Cannot convert input string to 'CP850': String is too long\n");
112 return 0;
113 }
114 out[i] = L'\0';
115 return 1;
116 }
117
118 static int cp850_char_to_printable(char **p, unsigned char c, unsigned int out_size)
119 {
120 size_t ret;
121 wchar_t wcs[2];
122 wcs[0] = (c & 0x80) ? cp850_table[c & 0x7F] : c;
123 wcs[1] = 0;
124 ret = wcstombs(*p, wcs, out_size);
125 if (ret == 0)
126 return 0;
127 if (ret != (size_t)-1)
128 *p += ret;
129 else if (!(c & 0x80))
130 *(*p++) = c;
131 else {
132 ret = strlen(cp850_translit_table[c & 0x7F]);
133 if (ret > out_size)
134 return 0;
135 memcpy(*p, cp850_translit_table[c & 0x7F], ret);
136 *p += ret;
137 }
138 return 1;
139 }
140
141 static int local_string_to_cp850_string(char *out, const char *in, unsigned int out_size)
142 {
143 int ret;
144 wchar_t *wcs;
145 if (strlen(in) >= out_size) {
146 fprintf(stderr, "Cannot convert input string '%s' to 'CP850': String is too long\n", in);
147 return 0;
148 }
149 wcs = calloc(out_size, sizeof(wchar_t));
150 if (!wcs) {
151 fprintf(stderr, "Cannot convert input string '%s' to 'CP850': %s\n", in, strerror(ENOMEM));
152 return 0;
153 }
154 if (mbstowcs(wcs, in, out_size) == (size_t)-1) {
155 fprintf(stderr, "Cannot convert input string '%s' to 'CP850': %s\n", in, strerror(errno));
156 free(wcs);
157 return 0;
158 }
159 ret = wchar_string_to_cp850_string(out, wcs, out_size);
160 free(wcs);
161 return ret;
162 }
163
164 #ifdef HAVE_ICONV
165
166 static int iconv_init_codepage(int codepage, const char *local, iconv_t *to_local, iconv_t *from_local)
167 {
168 char codepage_name[32];
169 snprintf(codepage_name, sizeof(codepage_name), "CP%d//TRANSLIT", codepage);
170 *to_local = iconv_open(local, codepage_name);
171 if (*to_local == (iconv_t) - 1) {
172 snprintf(codepage_name, sizeof(codepage_name), "CP%d", codepage);
173 *to_local = iconv_open(local, codepage_name);
174 }
175 if (*to_local == (iconv_t) - 1)
176 fprintf(stderr, "Cannot initialize conversion from codepage %d to %s: %s\n", codepage, local, strerror(errno));
10177 snprintf(codepage_name, sizeof(codepage_name), "CP%d", codepage);
11 result = iconv_open(nl_langinfo(CODESET), codepage_name);
12 if (result == (iconv_t) - 1)
13 perror(codepage_name);
14 return result;
178 *from_local = iconv_open(codepage_name, local);
179 if (*from_local == (iconv_t) - 1)
180 fprintf(stderr, "Cannot initialize conversion from %s to codepage %d: %s\n", local, codepage, strerror(errno));
181 return (*to_local != (iconv_t)-1 && *from_local != (iconv_t)-1) ? 1 : 0;
15182 }
16183
17184 static iconv_t dos_to_local;
185 static iconv_t local_to_dos;
186 static iconv_t dos_to_wchar;
187 static iconv_t wchar_to_dos;
188 static int used_codepage;
189 static int internal_cp850;
18190
19191 /*
20192 * Initialize conversion from codepage.
21193 * codepage = -1 means default codepage.
22 * Returns 0 on success, non-zero on failure
194 * Returns non-zero on success, 0 on failure
23195 */
24196 static int init_conversion(int codepage)
25197 {
28200 initialized = 1;
29201 if (codepage < 0)
30202 codepage = DEFAULT_DOS_CODEPAGE;
31 setlocale(LC_ALL, ""); /* initialize locale */
32 dos_to_local = iconv_init_codepage(codepage);
33 if (dos_to_local == (iconv_t) - 1 && codepage != DEFAULT_DOS_CODEPAGE) {
34 printf("Trying to set fallback DOS codepage %d\n",
35 DEFAULT_DOS_CODEPAGE);
36 dos_to_local = iconv_init_codepage(DEFAULT_DOS_CODEPAGE);
37 if (dos_to_local == (iconv_t) - 1)
38 initialized = 0; /* no conversion available */
203 setlocale(LC_CTYPE, ""); /* initialize locale for CODESET */
204 if (!iconv_init_codepage(codepage, nl_langinfo(CODESET), &dos_to_local, &local_to_dos))
205 initialized = 0;
206 if (initialized && !iconv_init_codepage(codepage, "WCHAR_T", &dos_to_wchar, &wchar_to_dos))
207 initialized = 0;
208 if (!initialized && codepage == 850) {
209 fprintf(stderr, "Using internal CP850 conversion table\n");
210 internal_cp850 = 1; /* use internal CP850 conversion table */
211 initialized = 1;
39212 }
213 if (initialized)
214 used_codepage = codepage;
40215 }
41216 return initialized;
42217 }
46221 return init_conversion(codepage);
47222 }
48223
49 int dos_char_to_printable(char **p, unsigned char c)
224 int dos_char_to_printable(char **p, unsigned char c, unsigned int out_size)
50225 {
51226 char in[1] = { c };
52 char *pin = in;
227 ICONV_CONST char *pin = in;
53228 size_t bytes_in = 1;
54 size_t bytes_out = 4;
229 size_t bytes_out = out_size;
55230 if (!init_conversion(-1))
56231 return 0;
57 return iconv(dos_to_local, &pin, &bytes_in, p, &bytes_out) != -1;
58 }
232 if (internal_cp850)
233 return cp850_char_to_printable(p, c, out_size);
234 return iconv(dos_to_local, &pin, &bytes_in, p, &bytes_out) != (size_t)-1;
235 }
236
237 int local_string_to_dos_string(char *out, char *in, unsigned int out_size)
238 {
239 ICONV_CONST char *pin = in;
240 char *pout = out;
241 size_t bytes_in = strlen(in);
242 size_t bytes_out = out_size-1;
243 size_t ret;
244 if (!init_conversion(-1))
245 return 0;
246 if (internal_cp850)
247 return local_string_to_cp850_string(out, in, out_size);
248 ret = iconv(local_to_dos, &pin, &bytes_in, &pout, &bytes_out);
249 if (ret == (size_t)-1) {
250 if (errno == E2BIG)
251 fprintf(stderr, "Cannot convert input string '%s' to 'CP%d': String is too long\n",
252 in, used_codepage);
253 else
254 fprintf(stderr, "Cannot convert input sequence '\\x%.02hhX' from codeset '%s' to 'CP%d': %s\n",
255 *pin, nl_langinfo(CODESET), used_codepage, strerror(errno));
256 iconv(local_to_dos, NULL, NULL, &pout, &bytes_out);
257 return 0;
258 } else {
259 ret = iconv(local_to_dos, NULL, NULL, &pout, &bytes_out);
260 if (ret == (size_t)-1) {
261 fprintf(stderr, "Cannot convert input string '%s' to 'CP%d': String is too long\n",
262 in, used_codepage);
263 return 0;
264 }
265 }
266 out[out_size-1-bytes_out] = 0;
267 return 1;
268 }
269
270 int dos_string_to_wchar_string(wchar_t *out, char *in, unsigned int out_size)
271 {
272 ICONV_CONST char *pin = in;
273 char *pout = (char *)out;
274 size_t bytes_in = strnlen(in, 11);
275 size_t bytes_out = out_size-sizeof(wchar_t);
276 size_t ret;
277 if (!init_conversion(-1))
278 return 0;
279 if (internal_cp850)
280 return cp850_string_to_wchar_string(out, in, out_size);
281 ret = iconv(dos_to_wchar, &pin, &bytes_in, &pout, &bytes_out);
282 if (ret == (size_t)-1) {
283 if (errno == E2BIG)
284 fprintf(stderr, "Cannot convert input string from 'CP%d': String is too long\n",
285 used_codepage);
286 else
287 fprintf(stderr, "Cannot convert input sequence '\\x%.02hhX' from 'CP%d': %s\n",
288 *pin, used_codepage, strerror(errno));
289 iconv(dos_to_wchar, NULL, NULL, &pout, &bytes_out);
290 return 0;
291 } else {
292 ret = iconv(dos_to_wchar, NULL, NULL, &pout, &bytes_out);
293 if (ret == (size_t)-1) {
294 fprintf(stderr, "Cannot convert input string from 'CP%d': String is too long\n",
295 used_codepage);
296 return 0;
297 }
298 }
299 out[(out_size-sizeof(wchar_t)-bytes_out)/sizeof(wchar_t)] = L'\0';
300 return 1;
301 }
302
303 int wchar_string_to_dos_string(char *out, wchar_t *in, unsigned int out_size)
304 {
305 ICONV_CONST char *pin = (char *)in;
306 char *pout = out;
307 size_t bytes_in = wcslen(in)*sizeof(wchar_t);
308 size_t bytes_out = out_size-1;
309 size_t ret;
310 if (!init_conversion(-1))
311 return 0;
312 if (internal_cp850)
313 return wchar_string_to_cp850_string(out, in, out_size);
314 ret = iconv(wchar_to_dos, &pin, &bytes_in, &pout, &bytes_out);
315 if (ret == (size_t)-1) {
316 if (errno == E2BIG)
317 fprintf(stderr, "Cannot convert input string '%ls' to 'CP%d': String is too long\n",
318 in, used_codepage);
319 else
320 fprintf(stderr, "Cannot convert input character '%lc' to 'CP%d': %s\n",
321 (wint_t)*(wchar_t *)pin, used_codepage, strerror(errno));
322 iconv(wchar_to_dos, NULL, NULL, &pout, &bytes_out);
323 return 0;
324 } else {
325 ret = iconv(wchar_to_dos, NULL, NULL, &pout, &bytes_out);
326 if (ret == (size_t)-1) {
327 fprintf(stderr, "Cannot convert input string '%ls' to 'CP%d': String is too long\n",
328 in, used_codepage);
329 return 0;
330 }
331 }
332 out[out_size-1-bytes_out] = 0;
333 return 1;
334 }
335
336 #else
337
338 int set_dos_codepage(int codepage)
339 {
340 static int initialized = -1;
341 if (initialized < 0) {
342 setlocale(LC_CTYPE, ""); /* initialize locale for wide character functions */
343 if (codepage < 0)
344 codepage = DEFAULT_DOS_CODEPAGE;
345 initialized = (codepage == 850) ? 1 : 0;
346 if (!initialized)
347 fprintf(stderr, "Cannot initialize unsupported codepage %d, only codepage 850 is supported\n", codepage);
348 }
349 return initialized;
350 }
351
352 int dos_char_to_printable(char **p, unsigned char c, unsigned int out_size)
353 {
354 return cp850_char_to_printable(p, c, out_size);
355 }
356
357 int local_string_to_dos_string(char *out, char *in, unsigned int out_size)
358 {
359 return local_string_to_cp850_string(out, in, out_size);
360 }
361
362 int dos_string_to_wchar_string(wchar_t *out, char *in, unsigned int out_size)
363 {
364 return cp850_string_to_wchar_string(out, in, out_size);
365 }
366
367 int wchar_string_to_dos_string(char *out, wchar_t *in, unsigned int out_size)
368 {
369 return wchar_string_to_cp850_string(out, in, out_size);
370 }
371
372 #endif
0 /* charconv.h
1
2 Copyright (C) 2010 Alexander Korolkov <alexander.korolkov@gmail.com>
3 Copyright (C) 2018-2020 Pali Rohár <pali.rohar@gmail.com>
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 The complete text of the GNU General Public License
19 can be found in /usr/share/common-licenses/GPL-3 file.
20 */
21
022 #ifndef _CHARCONV_H
123 #define _CHARCONV_H
224
3 #define DEFAULT_DOS_CODEPAGE 437
25 #include <stddef.h>
26
27 #define DEFAULT_DOS_CODEPAGE 850
428
529 int set_dos_codepage(int codepage);
6 int dos_char_to_printable(char **p, unsigned char c);
30 int dos_char_to_printable(char **p, unsigned char c, unsigned int out_size);
31 int local_string_to_dos_string(char *out, char *in, unsigned int out_size);
32 int dos_string_to_wchar_string(wchar_t *out, char *in, unsigned int out_size);
33 int wchar_string_to_dos_string(char *out, wchar_t *in, unsigned int out_size);
734
835 #endif
33 Copyright (C) 1998 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
44 Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
55 Copyright (C) 2015 Andreas Bombe <aeb@debian.org>
6 Copyright (C) 2017-2021 Pali Rohár <pali.rohar@gmail.com>
67
78 This program is free software: you can redistribute it and/or modify
89 it under the terms of the GNU General Public License as published by
2829 #include <stdlib.h>
2930 #include <string.h>
3031 #include <time.h>
32 #include <errno.h>
33 #include <ctype.h>
34 #include <wctype.h>
3135
3236 #include "common.h"
3337 #include "fsck.fat.h"
3640 #include "file.h"
3741 #include "lfn.h"
3842 #include "check.h"
43 #include "boot.h"
44 #include "charconv.h"
3945
4046
4147 /* the longest path on the filesystem that can be handled by path_name() */
4652 /* get start field of a dir entry */
4753 #define FSTART(p,fs) \
4854 ((uint32_t)le16toh(p->dir_ent.start) | \
49 (fs->fat_bits == 32 ? le16toh(p->dir_ent.starthi) << 16 : 0))
55 (fs->fat_bits == 32 ? (uint32_t)le16toh(p->dir_ent.starthi) << 16 : 0))
5056
5157 #define MODIFY(p,i,v) \
5258 do { \
7884 } \
7985 } while(0)
8086
81 off_t alloc_rootdir_entry(DOS_FS * fs, DIR_ENT * de, const char *pattern, int gen_name)
82 {
83 static int curr_num = 0;
84 off_t offset;
85
86 if (fs->root_cluster) {
87 DIR_ENT d2;
88 int i = 0, got = 0;
89 uint32_t clu_num, prev = 0;
90 off_t offset2;
91
92 clu_num = fs->root_cluster;
93 offset = cluster_start(fs, clu_num);
94 while (clu_num > 0 && clu_num != -1) {
95 fs_read(offset, sizeof(DIR_ENT), &d2);
96 if (IS_FREE(d2.name) && d2.attr != VFAT_LN_ATTR) {
97 got = 1;
98 break;
99 }
100 i += sizeof(DIR_ENT);
101 offset += sizeof(DIR_ENT);
102 if ((i % fs->cluster_size) == 0) {
103 prev = clu_num;
104 if ((clu_num = next_cluster(fs, clu_num)) == 0 || clu_num == -1)
105 break;
106 offset = cluster_start(fs, clu_num);
107 }
108 }
109 if (!got) {
110 /* no free slot, need to extend root dir: alloc next free cluster
111 * after previous one */
112 if (!prev)
113 die("Root directory has no cluster allocated!");
114 for (clu_num = prev + 1; clu_num != prev; clu_num++) {
115 FAT_ENTRY entry;
116
117 if (clu_num >= fs->data_clusters + 2)
118 clu_num = 2;
119 get_fat(&entry, fs->fat, clu_num, fs);
120 if (!entry.value)
121 break;
122 }
123 if (clu_num == prev)
124 die("Root directory full and no free cluster");
125 set_fat(fs, prev, clu_num);
126 set_fat(fs, clu_num, -1);
127 set_owner(fs, clu_num, get_owner(fs, fs->root_cluster));
128 /* clear new cluster */
129 memset(&d2, 0, sizeof(d2));
130 offset = cluster_start(fs, clu_num);
131 for (i = 0; i < fs->cluster_size; i += sizeof(DIR_ENT))
132 fs_write(offset + i, sizeof(d2), &d2);
133 }
134 memset(de, 0, sizeof(DIR_ENT));
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)
159 break;
160 if (++curr_num >= 10000)
161 die("Unable to create unique name");
162 }
163 } else {
164 memcpy(de->name, pattern, MSDOS_NAME);
165 }
166 } else {
167 DIR_ENT *root;
168 int next_free = 0, scan;
169
170 root = alloc(fs->root_entries * sizeof(DIR_ENT));
171 fs_read(fs->root_start, fs->root_entries * sizeof(DIR_ENT), root);
172
173 while (next_free < fs->root_entries)
174 if (IS_FREE(root[next_free].name) &&
175 root[next_free].attr != VFAT_LN_ATTR)
176 break;
177 else
178 next_free++;
179 if (next_free == fs->root_entries)
180 die("Root directory is full.");
181 offset = fs->root_start + next_free * sizeof(DIR_ENT);
182 memset(de, 0, sizeof(DIR_ENT));
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)
194 break;
195 if (++curr_num >= 10000)
196 die("Unable to create unique name");
197 }
198 } else {
199 memcpy(de->name, pattern, MSDOS_NAME);
200 }
201 free(root);
202 }
203 ++n_files;
204 return offset;
205 }
206
20787 /**
20888 * Construct a full path (starting with '/') for the specified dentry,
20989 * relative to the partition. All components are "long" names where possible.
233113 return path;
234114 }
235115
236 static const int day_n[] =
237 { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 0, 0, 0, 0 };
238 /* Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec */
239
240 /* Convert a MS-DOS time/date pair to a UNIX date (seconds since 1 1 70). */
241
242 static time_t date_dos2unix(unsigned short time, unsigned short date)
243 {
244 int month, year;
245 time_t secs;
246
247 month = ((date >> 5) & 15) - 1;
248 if (month < 0) {
249 /* make sure that nothing bad happens if the month bits were zero */
250 month = 0;
251 }
252 year = date >> 9;
253 secs =
254 (time & 31) * 2 + 60 * ((time >> 5) & 63) + (time >> 11) * 3600 +
255 86400 * ((date & 31) - 1 + day_n[month] + (year / 4) + year * 365 -
256 ((year & 3) == 0 && month < 2 ? 1 : 0) + 3653);
257 /* days since 1.1.70 plus 80's leap day */
258 return secs;
259 }
116 static const char *month_str[] =
117 { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
260118
261119 static char *file_stat(DOS_FILE * file)
262120 {
263121 static char temp[100];
264 struct tm *tm;
265 char tmp[100];
266 time_t date;
267
268 date =
269 date_dos2unix(le16toh(file->dir_ent.time), le16toh(file->dir_ent.date));
270 tm = localtime(&date);
271 strftime(tmp, 99, "%H:%M:%S %b %d %Y", tm);
272 sprintf(temp, " Size %u bytes, date %s", le32toh(file->dir_ent.size), tmp);
122 unsigned int hours, minutes, secs, day, month, year;
123 unsigned short time, date;
124
125 time = le16toh(file->dir_ent.time);
126 date = le16toh(file->dir_ent.date);
127 year = 1980 + (date >> 9);
128 month = ((date >> 5) & 15);
129 if (month < 1) month = 1;
130 else if (month > 12) month = 12;
131 day = (date & 31);
132 if (day < 1) day = 1;
133 hours = (time >> 11);
134 if (hours > 23) hours = 23;
135 minutes = ((time >> 5) & 63);
136 if (minutes > 59) minutes = 59;
137 secs = (time & 31) * 2;
138 if (secs > 59) secs = 59;
139 sprintf(temp, " Size %u bytes, date %02u:%02u:%02u %s %02u %4u",
140 le32toh(file->dir_ent.size), hours, minutes, secs, month_str[month-1], day, year);
273141 return temp;
274142 }
275143
276144 static int bad_name(DOS_FILE * file)
277145 {
278146 int i, spc, suspicious = 0;
279 const char *bad_chars = atari_format ? "*?\\/:" : "*?<>|\"\\/:";
147 const char *bad_chars = atari_format ? "*?\\/:" : "*?<>|\"\\/:.";
280148 const unsigned char *name = file->dir_ent.name;
281149 const unsigned char *ext = name + 8;
282150
283 /* Do not complain about (and auto-correct) the extended attribute files
284 * of OS/2. */
285 if (strncmp((const char *)name, "EA DATA SF", 11) == 0 ||
286 strncmp((const char *)name, "WP ROOT SF", 11) == 0)
151 /* do not check synthetic FAT32 root entry */
152 if (!file->offset)
287153 return 0;
288154
289155 /* check if we have neither a long filename nor a short name */
297163 return 0;
298164
299165 for (i = 0; i < MSDOS_NAME; i++) {
300 if (name[i] < ' ' || name[i] == 0x7f)
166 if ((name[i] < ' ' && !(i == 0 && name[0] == 0x05)) || name[i] == 0x7f)
301167 return 1;
302168 if (name[i] > 0x7f)
303169 ++suspicious;
305171 return 1;
306172 }
307173
308 spc = 0;
309 for (i = 0; i < 8; i++) {
310 if (name[i] == ' ')
311 spc = 1;
312 else if (spc)
313 /* non-space after a space not allowed, space terminates the name
314 * part */
315 return 1;
316 }
317
318 spc = 0;
319 for (i = 0; i < 3; i++) {
320 if (ext[i] == ' ')
321 spc = 1;
322 else if (spc)
323 /* non-space after a space not allowed, space terminates the ext
324 * part */
325 return 1;
174 if (name[0] == ' ')
175 return 1;
176
177 if (no_spaces_in_sfns) {
178 spc = 0;
179 for (i = 0; i < 8; i++) {
180 if (name[i] == ' ')
181 spc = 1;
182 else if (spc)
183 /* non-space after a space not allowed, space terminates the name
184 * part */
185 return 1;
186 }
187
188 spc = 0;
189 for (i = 0; i < 3; i++) {
190 if (ext[i] == ' ')
191 spc = 1;
192 else if (spc)
193 /* non-space after a space not allowed, space terminates the ext
194 * part */
195 return 1;
196 }
326197 }
327198
328199 /* Under GEMDOS, chars >= 128 are never allowed. */
354225
355226 static void drop_file(DOS_FS * fs, DOS_FILE * file)
356227 {
357 uint32_t cluster;
228 (void) fs;
358229
359230 MODIFY(file, name[0], DELETED_FLAG);
360231 if (file->lfn)
361232 lfn_remove(file->lfn_offset, file->offset);
362 for (cluster = FSTART(file, fs); cluster > 0 && cluster <
363 fs->data_clusters + 2; cluster = next_cluster(fs, cluster))
364 set_owner(fs, cluster, NULL);
365233 --n_files;
366234 }
367235
388256 DOS_FILE *first, *walk;
389257 uint32_t number;
390258
391 if (!file->offset)
259 if (!file->offset) {
260 printf("Cannot rename FAT32 root dir\n");
392261 return; /* cannot rename FAT32 root dir */
262 }
393263 first = file->parent ? file->parent->first : root;
394264 number = 0;
395265 while (1) {
413283 } else {
414284 fs_write(file->offset, MSDOS_NAME, file->dir_ent.name);
415285 }
416 if (file->lfn)
417 lfn_fix_checksum(file->lfn_offset, file->offset,
418 (const char *)file->dir_ent.name);
286 if (file->lfn) {
287 lfn_remove(file->lfn_offset, file->offset);
288 file->lfn = NULL;
289 }
419290 return;
420291 }
421292 number++;
436307 return; /* cannot rename FAT32 root dir */
437308 }
438309 while (1) {
439 printf("New name: ");
440 fflush(stdout);
441 if (fgets((char *)name, 45, stdin)) {
310 if (get_line("New name", (char *)name, 45)) {
442311 if ((here = (unsigned char *)strchr((const char *)name, '\n')))
443312 *here = 0;
444313 for (walk = (unsigned char *)strrchr((const char *)name, 0);
456325 } else {
457326 fs_write(file->offset, MSDOS_NAME, file->dir_ent.name);
458327 }
459 if (file->lfn)
460 lfn_fix_checksum(file->lfn_offset, file->offset,
461 (const char *)file->dir_ent.name);
328 if (file->lfn) {
329 lfn_remove(file->lfn_offset, file->offset);
330 file->lfn = NULL;
331 }
462332 return;
463333 }
464334 }
465335 }
466336 }
467337
468 static int handle_dot(DOS_FS * fs, DOS_FILE * file, int dots)
469 {
470 const char *name;
471
472 name =
473 strncmp((const char *)file->dir_ent.name, MSDOS_DOT,
474 MSDOS_NAME) ? ".." : ".";
475 if (!(file->dir_ent.attr & ATTR_DIR)) {
476 printf("%s\n Is a non-directory.\n", path_name(file));
477 if (interactive)
478 printf("1) Drop it\n2) Auto-rename\n3) Rename\n"
479 "4) Convert to directory\n");
480 else
481 printf(" Auto-renaming it.\n");
482 switch (interactive ? get_key("1234", "?") : '2') {
483 case '1':
484 drop_file(fs, file);
485 return 1;
486 case '2':
487 auto_rename(file);
488 printf(" Renamed to %s\n", file_name(file->dir_ent.name));
489 return 0;
490 case '3':
491 rename_file(file);
492 return 0;
493 case '4':
494 MODIFY(file, size, htole32(0));
495 MODIFY(file, attr, file->dir_ent.attr | ATTR_DIR);
496 break;
497 }
498 }
499 if (!dots) {
500 printf("Root contains directory \"%s\". Dropping it.\n", name);
501 drop_file(fs, file);
502 return 1;
503 }
338 static uint32_t scan_free_entry(DOS_FS * fs, DOS_FILE * this)
339 {
340 uint32_t clu_num, offset;
341 int i;
342 DIR_ENT de;
343
344 i = 2 * sizeof(DIR_ENT); /* Skip '.' and '..' slots */
345 clu_num = FSTART(this, fs);
346 while (clu_num > 0 && clu_num != -1) {
347 offset = cluster_start(fs, clu_num) + (i % fs->cluster_size);
348 fs_read(offset, sizeof(DIR_ENT), &de);
349 if (IS_FREE(de.name))
350 return offset;
351 i += sizeof(DIR_ENT);
352 if (!(i % fs->cluster_size))
353 if ((clu_num = next_cluster(fs, clu_num)) == 0 || clu_num == -1)
354 break;
355 }
356
357 return 0;
358 }
359
360 static int handle_dot(DOS_FS * fs, DOS_FILE * file, int dotdot)
361 {
362 const char *name, *ent;
363 uint32_t new_offset, start;
364
365 if (dotdot) {
366 name = "..";
367 ent = MSDOS_DOTDOT;
368 if (!file->parent->parent) {
369 start = 0;
370 } else {
371 start = FSTART(file->parent->parent, fs);
372 if (start == fs->root_cluster)
373 start = 0;
374 }
375 } else {
376 name = ".";
377 ent = MSDOS_DOT;
378 start = FSTART(file->parent, fs);
379 }
380
381 if (!(file->dir_ent.attr & ATTR_DIR) || (FSTART(file, fs) != start) ||
382 strncmp((const char *)(file->dir_ent.name), ent, MSDOS_NAME)) {
383
384 if (IS_FREE(file->dir_ent.name)) {
385 printf("%s\n Expected a valid '%s' entry in the %s slot, found free entry.\n",
386 path_name(file->parent), name, dotdot ? "second" : "first");
387 switch (get_choice(1, " Creating.",
388 2,
389 1, "Create entry",
390 2, "Drop parent")) {
391 case 1:
392 goto conjure;
393 case 2:
394 drop_file(fs, file->parent);
395 return 1;
396 }
397 }
398
399 if (!strncmp((const char *)(file->dir_ent.name), ent, MSDOS_NAME)) {
400 printf("%s\n Invalid '%s' entry in the %s slot. Fixing.\n",
401 path_name(file->parent), name, dotdot ? "second" : "first");
402 MODIFY_START(file, start, fs);
403 MODIFY(file, attr, ATTR_DIR);
404 } else {
405 printf("%s\n Expected a valid '%s' entry in this slot.\n",
406 path_name(file), name);
407 switch (get_choice(3, " Moving entry down.",
408 3,
409 1, "Drop entry",
410 2, "Drop parent",
411 3, "Move entry down")) {
412 case 1:
413 drop_file(fs, file);
414 goto conjure;
415 case 2:
416 drop_file(fs, file->parent);
417 return 1;
418 case 3:
419 new_offset = scan_free_entry(fs, file->parent);
420 if (!new_offset) {
421 printf("No free entry found.\n");
422 return 0;
423 }
424
425 fs_write(new_offset, sizeof(file->dir_ent), &file->dir_ent);
426 goto conjure;
427 }
428 }
429 }
430 if (file->dir_ent.lcase & FAT_NO_83NAME) {
431 /* Some versions of mtools write these directory entries with random data in
432 this field. */
433 printf("%s\n Is a dot with no 8.3 name flag set, clearing.\n", path_name(file));
434 file->dir_ent.lcase &= ~FAT_NO_83NAME;
435 MODIFY(file, lcase, file->dir_ent.lcase);
436 }
437
438 return 0;
439
440 conjure:
441 memset(&file->dir_ent, 0, sizeof(DIR_ENT));
442 memcpy(file->dir_ent.name, ent, MSDOS_NAME);
443 fs_write(file->offset, sizeof(file->dir_ent), &file->dir_ent);
444 MODIFY_START(file, start, fs);
445 MODIFY(file, attr, ATTR_DIR);
504446 return 0;
505447 }
506448
508450 {
509451 DOS_FILE *owner;
510452 int restart;
511 uint32_t expect, curr, this, clusters, prev, walk, clusters2;
453 uint32_t parent, grandp, curr, this, clusters, prev, walk, clusters2;
454
455 if (IS_FREE(file->dir_ent.name))
456 return 0;
512457
513458 if (file->dir_ent.attr & ATTR_DIR) {
514459 if (le32toh(file->dir_ent.size)) {
516461 path_name(file));
517462 MODIFY(file, size, htole32(0));
518463 }
519 if (file->parent
520 && !strncmp((const char *)file->dir_ent.name, MSDOS_DOT,
521 MSDOS_NAME)) {
522 expect = FSTART(file->parent, fs);
523 if (FSTART(file, fs) != expect) {
524 printf("%s\n Start (%lu) does not point to parent (%lu)\n",
525 path_name(file), (unsigned long)FSTART(file, fs), (long)expect);
526 MODIFY_START(file, expect, fs);
527 }
528 return 0;
529 }
530 if (file->parent
531 && !strncmp((const char *)file->dir_ent.name, MSDOS_DOTDOT,
532 MSDOS_NAME)) {
533 expect =
534 file->parent->parent ? FSTART(file->parent->parent, fs) : 0;
535 if (fs->root_cluster && expect == fs->root_cluster)
536 expect = 0;
537 if (FSTART(file, fs) != expect) {
538 printf("%s\n Start (%lu) does not point to .. (%lu)\n",
539 path_name(file), (unsigned long)FSTART(file, fs), (unsigned long)expect);
540 MODIFY_START(file, expect, fs);
541 }
542 return 0;
543 }
544464 if (FSTART(file, fs) == 0) {
545465 printf("%s\n Start does point to root directory. Deleting dir. \n",
546466 path_name(file));
547467 MODIFY(file, name[0], DELETED_FLAG);
548468 return 0;
469 }
470 if (file->parent) {
471 parent = FSTART(file->parent, fs);
472 grandp = file->parent->parent ? FSTART(file->parent->parent, fs) : 0;
473 if (fs->root_cluster && grandp == fs->root_cluster)
474 grandp = 0;
475
476 if (FSTART(file, fs) == parent) {
477 printf("%s\n Start does point to containing directory. Deleting entry.\n",
478 path_name(file));
479 MODIFY(file, name[0], DELETED_FLAG);
480 MODIFY_START(file, 0, fs);
481 return 0;
482 }
483 if (FSTART(file, fs) == grandp) {
484 printf("%s\n Start does point to containing directory's parent. Deleting entry.\n",
485 path_name(file));
486 MODIFY(file, name[0], DELETED_FLAG);
487 MODIFY_START(file, 0, fs);
488 return 0;
489 }
549490 }
550491 }
551492 if (FSTART(file, fs) == 1) {
584525 break;
585526 }
586527 if (!(file->dir_ent.attr & ATTR_DIR) && le32toh(file->dir_ent.size) <=
587 (uint64_t)clusters * fs->cluster_size) {
528 clusters * fs->cluster_size) {
588529 printf
589 ("%s\n File size is %u bytes, cluster chain length is > %llu "
530 ("%s\n File size is %u bytes, cluster chain length is > %u "
590531 "bytes.\n Truncating file to %u bytes.\n", path_name(file),
591532 le32toh(file->dir_ent.size),
592 (unsigned long long)clusters * fs->cluster_size,
533 (unsigned)clusters * fs->cluster_size,
593534 le32toh(file->dir_ent.size));
594535 truncate_file(fs, file, clusters);
595536 break;
603544 next_cluster(fs, walk))
604545 if (walk == curr)
605546 break;
606 else
547 else {
548 if ((unsigned long long)clusters2 * fs->cluster_size >= UINT32_MAX)
549 die("Internal error: File size is larger than 2^32-1");
607550 clusters2++;
551 }
608552 restart = file->dir_ent.attr & ATTR_DIR;
609553 if (!owner->offset) {
610 printf(" Truncating second to %llu bytes because first "
554 printf(" Truncating second to %u bytes because first "
611555 "is FAT32 root dir.\n",
612 (unsigned long long)clusters * fs->cluster_size);
556 (unsigned)clusters * fs->cluster_size);
613557 do_trunc = 2;
614558 } else if (!file->offset) {
615 printf(" Truncating first to %llu bytes because second "
559 printf(" Truncating first to %u bytes because second "
616560 "is FAT32 root dir.\n",
617 (unsigned long long)clusters2 * fs->cluster_size);
561 (unsigned)clusters2 * fs->cluster_size);
618562 do_trunc = 1;
619 } else if (interactive)
620 printf("1) Truncate first to %llu bytes%s\n"
621 "2) Truncate second to %llu bytes\n",
622 (unsigned long long)clusters2 * fs->cluster_size,
623 restart ? " and restart" : "",
624 (unsigned long long)clusters * fs->cluster_size);
625 else
626 printf(" Truncating second to %llu bytes.\n",
627 (unsigned long long)clusters * fs->cluster_size);
628 if (do_trunc != 2
629 && (do_trunc == 1
630 || (interactive && get_key("12", "?") == '1'))) {
563 } else {
564 char *trunc_first_string;
565 char *trunc_second_string;
566 char *noninteractive_string;
567
568 xasprintf(&trunc_first_string,
569 "Truncate first to %u bytes%s",
570 (unsigned)clusters2 * fs->cluster_size,
571 restart ? " and restart" : "");
572 xasprintf(&trunc_second_string,
573 "Truncate second to %u bytes",
574 (unsigned)clusters * fs->cluster_size);
575 xasprintf(&noninteractive_string,
576 " Truncating second to %u bytes.",
577 (unsigned)clusters * fs->cluster_size);
578
579 do_trunc = get_choice(2, noninteractive_string,
580 2,
581 1, trunc_first_string,
582 2, trunc_second_string);
583
584 free(trunc_first_string);
585 free(trunc_second_string);
586 free(noninteractive_string);
587 }
588
589 if (do_trunc == 1) {
631590 prev = 0;
632591 clusters = 0;
633592 for (this = FSTART(owner, fs); this > 0 && this != -1; this =
637596 set_fat(fs, prev, -1);
638597 else
639598 MODIFY_START(owner, 0, fs);
640 MODIFY(owner, size,
641 htole32((uint64_t)clusters *
642 fs->cluster_size));
599 MODIFY(owner, size, htole32(clusters * fs->cluster_size));
643600 if (restart)
644601 return 1;
645602 while (this > 0 && this != -1) {
649606 this = curr;
650607 break;
651608 }
609 if ((unsigned long long)clusters * fs->cluster_size >= UINT32_MAX)
610 die("Internal error: File size is larger than 2^32-1");
652611 clusters++;
653612 prev = this;
654613 }
664623 }
665624 }
666625 set_owner(fs, curr, file);
626 if ((unsigned long long)clusters * fs->cluster_size >= UINT32_MAX)
627 die("Internal error: File size is larger than 2^32-1");
667628 clusters++;
668629 prev = curr;
669630 }
670631 if (!(file->dir_ent.attr & ATTR_DIR) && le32toh(file->dir_ent.size) >
671 (uint64_t)clusters * fs->cluster_size) {
632 clusters * fs->cluster_size) {
672633 printf
673 ("%s\n File size is %u bytes, cluster chain length is %llu bytes."
674 "\n Truncating file to %llu bytes.\n", path_name(file),
634 ("%s\n File size is %u bytes, cluster chain length is %u bytes."
635 "\n Truncating file to %u bytes.\n", path_name(file),
675636 le32toh(file->dir_ent.size),
676 (unsigned long long)clusters * fs->cluster_size,
677 (unsigned long long)clusters * fs->cluster_size);
637 (unsigned)clusters * fs->cluster_size,
638 (unsigned)clusters * fs->cluster_size);
678639 MODIFY(file, size,
679 htole32((uint64_t)clusters * fs->cluster_size));
640 htole32(clusters * fs->cluster_size));
680641 }
681642 return 0;
682643 }
694655 static int check_dir(DOS_FS * fs, DOS_FILE ** root, int dots)
695656 {
696657 DOS_FILE *parent, **walk, **scan;
697 int dot, dotdot, skip, redo;
658 int skip, redo;
698659 int good, bad;
699660
700661 if (!*root)
711672 path_name(parent), bad, good + bad);
712673 if (!dots)
713674 printf(" Not dropping root directory.\n");
714 else if (!interactive)
715 printf(" Not dropping it in auto-mode.\n");
716 else if (get_key("yn", "Drop directory ? (y/n)") == 'y') {
675 else if (get_choice(2, " Not dropping it in auto-mode.",
676 2,
677 1, "Drop directory",
678 2, "Keep directory") == 1) {
717679 truncate_file(fs, parent, 0);
718680 MODIFY(parent, name[0], DELETED_FLAG);
719681 /* buglet: deleted directory stays in the list. */
720682 return 1;
721683 }
722684 }
723 dot = dotdot = redo = 0;
685 redo = 0;
724686 walk = root;
725687 while (*walk) {
726 if (!strncmp
727 ((const char *)((*walk)->dir_ent.name), MSDOS_DOT, MSDOS_NAME)
728 || !strncmp((const char *)((*walk)->dir_ent.name), MSDOS_DOTDOT,
729 MSDOS_NAME)) {
730 if (handle_dot(fs, *walk, dots)) {
731 *walk = (*walk)->next;
732 continue;
733 }
734 if (!strncmp
735 ((const char *)((*walk)->dir_ent.name), MSDOS_DOT, MSDOS_NAME))
736 dot++;
737 else
738 dotdot++;
739 }
740688 if (!((*walk)->dir_ent.attr & ATTR_VOLUME) && bad_name(*walk)) {
741689 puts(path_name(*walk));
742690 printf(" Bad short file name (%s).\n",
743691 file_name((*walk)->dir_ent.name));
744 if (interactive)
745 printf("1) Drop file\n2) Rename file\n3) Auto-rename\n"
746 "4) Keep it\n");
747 else
748 printf(" Auto-renaming it.\n");
749 switch (interactive ? get_key("1234", "?") : '3') {
750 case '1':
692 switch (get_choice(3, " Auto-renaming it.",
693 4,
694 1, "Drop file",
695 2, "Rename file",
696 3, "Auto-rename",
697 4, "Keep it")) {
698 case 1:
751699 drop_file(fs, *walk);
752700 walk = &(*walk)->next;
753701 continue;
754 case '2':
702 case 2:
755703 rename_file(*walk);
756704 redo = 1;
757705 break;
758 case '3':
706 case 3:
759707 auto_rename(*walk);
760708 printf(" Renamed to %s\n", file_name((*walk)->dir_ent.name));
761709 break;
762 case '4':
710 case 4:
763711 break;
764712 }
765713 }
774722 printf("%s\n Duplicate directory entry.\n First %s\n",
775723 path_name(*walk), file_stat(*walk));
776724 printf(" Second %s\n", file_stat(*scan));
777 if (interactive)
778 printf
779 ("1) Drop first\n2) Drop second\n3) Rename first\n"
780 "4) Rename second\n5) Auto-rename first\n"
781 "6) Auto-rename second\n");
782 else
783 printf(" Auto-renaming second.\n");
784 switch (interactive ? get_key("123456", "?") : '6') {
785 case '1':
725 switch (get_choice(6, " Auto-renaming second.",
726 6,
727 1, "Drop first",
728 2, "Drop second",
729 3, "Rename first",
730 4, "Rename second",
731 5, "Auto-rename first",
732 6, "Auto-rename second")) {
733 case 1:
786734 drop_file(fs, *walk);
787735 *walk = (*walk)->next;
788736 skip = 1;
789737 break;
790 case '2':
738 case 2:
791739 drop_file(fs, *scan);
792740 *scan = (*scan)->next;
793741 continue;
794 case '3':
742 case 3:
795743 rename_file(*walk);
796744 printf(" Renamed to %s\n", path_name(*walk));
797745 redo = 1;
798746 break;
799 case '4':
747 case 4:
800748 rename_file(*scan);
801749 printf(" Renamed to %s\n", path_name(*walk));
802750 redo = 1;
803751 break;
804 case '5':
752 case 5:
805753 auto_rename(*walk);
806754 printf(" Renamed to %s\n",
807755 file_name((*walk)->dir_ent.name));
808756 break;
809 case '6':
757 case 6:
810758 auto_rename(*scan);
811759 printf(" Renamed to %s\n",
812760 file_name((*scan)->dir_ent.name));
822770 walk = &(*walk)->next;
823771 else {
824772 walk = root;
825 dot = dotdot = redo = 0;
826 }
827 }
828 if (dots && !dot)
829 printf("%s\n \".\" is missing. Can't fix this yet.\n",
830 path_name(parent));
831 if (dots && !dotdot)
832 printf("%s\n \"..\" is missing. Can't fix this yet.\n",
833 path_name(parent));
773 redo = 0;
774 }
775 }
834776 return 0;
835777 }
836778
1002944 printf(" (%s)", file_name(new->dir_ent.name)); /* (8.3) */
1003945 printf("\n");
1004946 }
1005 /* Don't include root directory, '.', or '..' in the total file count */
1006 if (offset &&
1007 strncmp((const char *)de.name, MSDOS_DOT, MSDOS_NAME) != 0 &&
1008 strncmp((const char *)de.name, MSDOS_DOTDOT, MSDOS_NAME) != 0)
947 /* Don't include root directory in the total file count */
948 if (offset)
1009949 ++n_files;
1010950 test_file(fs, new, test); /* Bad cluster check */
1011951 }
1022962 i = 0;
1023963 clu_num = FSTART(this, fs);
1024964 new_dir();
965 if (clu_num != 0 && clu_num != -1 && this->offset) {
966 DOS_FILE file;
967
968 file.lfn = NULL;
969 file.lfn_offset = 0;
970 file.next = NULL;
971 file.parent = this;
972 file.first = NULL;
973
974 file.offset = cluster_start(fs, clu_num) + (i % fs->cluster_size);
975 fs_read(file.offset, sizeof(DIR_ENT), &file.dir_ent);
976 if (handle_dot(fs, &file, 0))
977 return 1;
978 i += sizeof(DIR_ENT);
979
980 file.offset = cluster_start(fs, clu_num) + (i % fs->cluster_size);
981 fs_read(file.offset, sizeof(DIR_ENT), &file.dir_ent);
982 if (handle_dot(fs, &file, 1))
983 return 1;
984 i += sizeof(DIR_ENT);
985 }
1025986 while (clu_num > 0 && clu_num != -1) {
1026987 add_file(fs, &chain, this,
1027988 cluster_start(fs, clu_num) + (i % fs->cluster_size), cp);
10531014 DOS_FILE *walk;
10541015
10551016 for (walk = parent ? parent->first : root; walk; walk = walk->next)
1056 if (walk->dir_ent.attr & ATTR_DIR)
1057 if (strncmp((const char *)walk->dir_ent.name, MSDOS_DOT, MSDOS_NAME)
1058 && strncmp((const char *)walk->dir_ent.name, MSDOS_DOTDOT,
1059 MSDOS_NAME))
1060 if (scan_dir(fs, walk, file_cd(cp, (char *)walk->dir_ent.name)))
1061 return 1;
1017 if (!IS_FREE(walk->dir_ent.name) && (walk->dir_ent.attr & ATTR_DIR))
1018 if (scan_dir(fs, walk, file_cd(cp, (char *)walk->dir_ent.name)))
1019 return 1;
10621020 return 0;
10631021 }
10641022
10911049 return 1;
10921050 return subdirs(fs, NULL, &fp_root);
10931051 }
1052
1053 static char print_fat_dirty_state(void)
1054 {
1055 printf("Dirty bit is set. Fs was not properly unmounted and"
1056 " some data may be corrupt.\n");
1057
1058 return get_choice(1, " Automatically removing dirty bit.",
1059 2,
1060 1, "Remove dirty bit",
1061 2, "No action");
1062 }
1063
1064 void check_dirty_bits(DOS_FS * fs)
1065 {
1066 if (fs->fat_bits == 32) {
1067 struct boot_sector b32;
1068 FAT_ENTRY fat32_flags;
1069
1070 get_fat(&fat32_flags, fs->fat, 1, fs);
1071 fs_read(0, sizeof(b32), &b32);
1072
1073 if ((b32.boot_flags & FAT_STATE_DIRTY) || !(fat32_flags.value & FAT32_FLAG_CLEAN_SHUTDOWN)) {
1074 if (print_fat_dirty_state() == 1) {
1075 if (b32.boot_flags & FAT_STATE_DIRTY) {
1076 b32.boot_flags &= ~FAT_STATE_DIRTY;
1077 fs_write(0, sizeof(b32), &b32);
1078 }
1079 if (!(fat32_flags.value & FAT32_FLAG_CLEAN_SHUTDOWN)) {
1080 uint32_t *new_flags_ptr = (uint32_t *)(fs->fat + 4);
1081 *new_flags_ptr = htole32(fat32_flags.value | FAT32_FLAG_CLEAN_SHUTDOWN | (fat32_flags.reserved << 28));
1082 fs_write(fs->fat_start + 4, 4, new_flags_ptr);
1083 if (fs->nfats > 1)
1084 fs_write(fs->fat_start + 4 + fs->fat_size, 4, new_flags_ptr);
1085 }
1086 }
1087 }
1088 } else {
1089 struct boot_sector_16 b16;
1090 FAT_ENTRY fat16_flags;
1091 int fat16_is_dirty = 0;
1092
1093 fs_read(0, sizeof(b16), &b16);
1094
1095 if (fs->fat_bits == 16) {
1096 get_fat(&fat16_flags, fs->fat, 1, fs);
1097 fat16_is_dirty = !(fat16_flags.value & FAT16_FLAG_CLEAN_SHUTDOWN);
1098 }
1099
1100 if ((b16.boot_flags & FAT_STATE_DIRTY) || fat16_is_dirty) {
1101 if (print_fat_dirty_state() == 1) {
1102 if (b16.boot_flags & FAT_STATE_DIRTY) {
1103 b16.boot_flags &= ~FAT_STATE_DIRTY;
1104 fs_write(0, sizeof(b16), &b16);
1105 }
1106 if (fat16_is_dirty) {
1107 uint16_t *new_flags_ptr = (uint16_t *)(fs->fat + 2);
1108 *new_flags_ptr = htole16(fat16_flags.value | FAT16_FLAG_CLEAN_SHUTDOWN);
1109 fs_write(fs->fat_start + 2, 2, new_flags_ptr);
1110 if (fs->nfats > 1)
1111 fs_write(fs->fat_start + 2 + fs->fat_size, 2, new_flags_ptr);
1112 }
1113 }
1114 }
1115 }
1116 }
1117
1118 static void get_new_label(char doslabel[12])
1119 {
1120 char newlabel[256];
1121 size_t len;
1122 char *p;
1123 int ret;
1124 int i;
1125
1126 while (1) {
1127 if (get_line("New label", newlabel, sizeof(newlabel))) {
1128 if ((p = strchr(newlabel, '\n')))
1129 *p = 0;
1130
1131 len = mbstowcs(NULL, newlabel, 0);
1132 if (len != (size_t)-1 && len > 11) {
1133 printf("Label can be no longer than 11 characters\n");
1134 continue;
1135 }
1136
1137 if (!local_string_to_dos_string(doslabel, newlabel, 12)) {
1138 printf("Error when processing label\n");
1139 continue;
1140 }
1141
1142 for (i = strlen(doslabel); i < 11; ++i)
1143 doslabel[i] = ' ';
1144 doslabel[11] = 0;
1145
1146 ret = validate_volume_label(doslabel);
1147 if ((ret && only_uppercase_label) || (ret & ~0x1)) {
1148 printf("New label is invalid\n");
1149 continue;
1150 } else if (ret & 0x1) {
1151 printf("Warning: lowercase labels might not work properly on some systems\n");
1152 }
1153
1154 break;
1155 }
1156 }
1157 }
1158
1159 static int check_boot_label(DOS_FS *fs)
1160 {
1161 char doslabel[12];
1162 wchar_t wlabel[12];
1163 int ret;
1164 int i;
1165
1166 ret = validate_volume_label(fs->label);
1167 if (ret & ~0x1) {
1168 printf("Label '%s' stored in boot sector is not valid.\n", pretty_label(fs->label));
1169 switch (get_choice(1, " Auto-removing label from boot sector.",
1170 2,
1171 1, "Remove invalid label from boot sector",
1172 2, "Enter new label")) {
1173 case 1:
1174 write_boot_label(fs, "NO NAME ");
1175 memcpy(fs->label, "NO NAME ", 11);
1176 return 1;
1177 case 2:
1178 get_new_label(doslabel);
1179 write_boot_label(fs, doslabel);
1180 memcpy(fs->label, doslabel, 11);
1181 return 1;
1182 }
1183 } else if ((ret & 0x1) && only_uppercase_label) {
1184 printf("Label '%s' stored in boot sector contains lowercase characters.\n", pretty_label(fs->label));
1185 switch (get_choice(1, " Auto-changing lowercase characters to uppercase",
1186 3,
1187 1, "Change lowercase characters to uppercase",
1188 2, "Remove invalid label",
1189 2, "Set new label")) {
1190 case 1:
1191 if (!dos_string_to_wchar_string(wlabel, fs->label, sizeof(wlabel)))
1192 die("Cannot change lowercase characters to uppercase.");
1193 for (i = 0; i < 11; ++i)
1194 wlabel[i] = towupper(wlabel[i]);
1195 if (!wchar_string_to_dos_string(doslabel, wlabel, sizeof(doslabel)))
1196 die("Cannot change lowercase characters to uppercase.");
1197 write_boot_label(fs, doslabel);
1198 memcpy(fs->label, doslabel, 11);
1199 return 1;
1200 case 2:
1201 write_boot_label(fs, "NO NAME ");
1202 memcpy(fs->label, "NO NAME ", 11);
1203 return 1;
1204 case 3:
1205 get_new_label(doslabel);
1206 write_boot_label(fs, doslabel);
1207 memcpy(fs->label, doslabel, 11);
1208 return 1;
1209 }
1210 }
1211
1212 return 0;
1213 }
1214
1215 void check_label(DOS_FS *fs)
1216 {
1217 DIR_ENT de;
1218 off_t offset;
1219 char buffer[256];
1220 char doslabel[12];
1221 wchar_t wlabel[12];
1222 int ret;
1223 int i;
1224
1225 offset = find_volume_de(fs, &de);
1226
1227 if (offset == 0 && memcmp(fs->label, "NO NAME ", 11) != 0)
1228 check_boot_label(fs);
1229
1230 if (offset == 0 && memcmp(fs->label, "NO NAME ", 11) != 0) {
1231 printf("Label in boot sector is '%s', but there is no volume label in root directory.\n", pretty_label(fs->label));
1232 switch (get_choice(1, " Auto-removing label from boot sector.",
1233 2,
1234 1, "Remove label from boot sector",
1235 2, "Copy label from boot sector to root directory")) {
1236 case 1:
1237 write_boot_label(fs, "NO NAME ");
1238 memcpy(fs->label, "NO NAME ", 11);
1239 break;
1240 case 2:
1241 write_volume_label(fs, fs->label);
1242 offset = find_volume_de(fs, &de);
1243 break;
1244 }
1245 }
1246
1247 if (offset != 0) {
1248 memcpy(doslabel, de.name, 11);
1249 if (doslabel[0] == 0x05)
1250 doslabel[0] = 0xe5;
1251 ret = validate_volume_label(doslabel);
1252 if (ret & ~0x1) {
1253 printf("Volume label '%s' stored in root directory is not valid.\n", pretty_label(doslabel));
1254 switch (get_choice(1, " Auto-removing label.",
1255 2,
1256 1, "Remove invalid label",
1257 2, "Set new label")) {
1258 case 1:
1259 remove_label(fs);
1260 memcpy(fs->label, "NO NAME ", 11);
1261 offset = 0;
1262 break;
1263 case 2:
1264 get_new_label(doslabel);
1265 write_label(fs, doslabel);
1266 memcpy(fs->label, doslabel, 11);
1267 break;
1268 }
1269 } else if ((ret & 0x1) && only_uppercase_label) {
1270 printf("Volume label '%s' stored in root directory contains lowercase characters.\n", pretty_label(doslabel));
1271 switch (get_choice(1, " Auto-changing lowercase characters to uppercase",
1272 3,
1273 1, "Change lowercase characters to uppercase",
1274 2, "Remove invalid label",
1275 2, "Set new label")) {
1276 case 1:
1277 if (!dos_string_to_wchar_string(wlabel, doslabel, sizeof(wlabel)))
1278 die("Cannot change lowercase characters to uppercase.");
1279 for (i = 0; i < 11; ++i)
1280 wlabel[i] = towupper(wlabel[i]);
1281 if (!wchar_string_to_dos_string(doslabel, wlabel, sizeof(doslabel)))
1282 die("Cannot change lowercase characters to uppercase.");
1283 write_label(fs, doslabel);
1284 memcpy(fs->label, doslabel, 11);
1285 break;
1286 case 2:
1287 remove_label(fs);
1288 memcpy(fs->label, "NO NAME ", 11);
1289 offset = 0;
1290 break;
1291 case 3:
1292 get_new_label(doslabel);
1293 write_label(fs, doslabel);
1294 memcpy(fs->label, doslabel, 11);
1295 break;
1296 }
1297 }
1298 }
1299
1300 again:
1301
1302 if (offset != 0 && memcmp(fs->label, "NO NAME ", 11) == 0 && memcmp(doslabel, "NO NAME ", 11) != 0) {
1303 printf("There is no label in boot sector, but there is volume label '%s' stored in root directory\n", pretty_label(doslabel));
1304 switch (get_choice(1, " Auto-copying volume label from root directory to boot sector.",
1305 2,
1306 1, "Copy volume label from root directory to boot sector",
1307 2, "Remove volume label from root directory")) {
1308 case 1:
1309 write_boot_label(fs, doslabel);
1310 memcpy(fs->label, doslabel, 11);
1311 break;
1312 case 2:
1313 remove_label(fs);
1314 offset = 0;
1315 break;
1316 }
1317 }
1318
1319 if (offset != 0 && memcmp(fs->label, "NO NAME ", 11) != 0 && memcmp(fs->label, doslabel, 11) != 0) {
1320 strncpy(buffer, pretty_label(doslabel), sizeof(buffer)-1);
1321 buffer[sizeof(buffer)-1] = 0;
1322 printf("Volume label '%s' stored in root directory and label '%s' stored in boot sector and different.\n", buffer, pretty_label(fs->label));
1323 switch (get_choice(1, " Auto-copying volume label from root directory to boot sector.",
1324 2,
1325 1, "Copy volume label from root directory to boot sector",
1326 2, "Copy label from boot sector to root directory")) {
1327 case 1:
1328 write_boot_label(fs, doslabel);
1329 memcpy(fs->label, doslabel, 11);
1330 break;
1331 case 2:
1332 ret = check_boot_label(fs);
1333 if (ret)
1334 goto again;
1335 write_volume_label(fs, fs->label);
1336 offset = find_volume_de(fs, &de);
1337 /* NOTE: doslabel is not updated */
1338 break;
1339 }
1340 }
1341 }
2222 #ifndef _CHECK_H
2323 #define _CHECK_H
2424
25 off_t alloc_rootdir_entry(DOS_FS * fs, DIR_ENT * de, const char *pattern, int gen_name);
26
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. */
25 void check_dirty_bits(DOS_FS * fs);
3226
3327 int scan_root(DOS_FS * fs);
3428
3630 for all the details. Returns a non-zero integer if the filesystem has to
3731 be checked again. */
3832
33
34 void check_label(DOS_FS * fs);
35
36 /* Checks the volume label from the root directory entry that is valid and
37 * matches the label stored in boot sector. */
38
3939 #endif
22 Copyright (C) 1993 Werner Almesberger <werner.almesberger@lrc.di.epfl.ch>
33 Copyright (C) 1998 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
44 Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
5 Copyright (C) 2018 Pali Rohár <pali.rohar@gmail.com>
56
67 This program is free software: you can redistribute it and/or modify
78 it under the terms of the GNU General Public License as published by
2829 #include <string.h>
2930 #include <stdarg.h>
3031 #include <errno.h>
32 #include <wctype.h>
33 #include <termios.h>
34 #include <sys/time.h>
35 #include <unistd.h>
3136
3237 #include "common.h"
38 #include "charconv.h"
39
40
41 int interactive;
42 int write_immed;
43 int atari_format;
44 const char *program_name;
45
3346
3447 typedef struct _link {
3548 void *data;
3952 void die(const char *msg, ...)
4053 {
4154 va_list args;
55
56 if (program_name)
57 fprintf(stderr, "%s: ", program_name);
4258
4359 va_start(args, msg);
4460 vfprintf(stderr, msg, args);
5167 {
5268 va_list args;
5369
70 if (program_name)
71 fprintf(stderr, "%s: ", program_name);
72
5473 va_start(args, msg);
5574 vfprintf(stderr, msg, args);
5675 va_end(args);
95114 return a < b ? a : b;
96115 }
97116
98 char get_key(const char *valid, const char *prompt)
99 {
100 int ch, okay;
101
117
118 #ifndef HAVE_VASPRINTF
119 static int vasprintf(char **strp, const char *fmt, va_list va)
120 {
121 int length;
122 va_list vacopy;
123
124 va_copy(vacopy, va);
125
126 length = vsnprintf(NULL, 0, fmt, vacopy);
127 if (length < 0)
128 return length;
129
130 *strp = malloc(length + 1);
131 if (!*strp) {
132 errno = ENOMEM;
133 return -1;
134 }
135
136 return vsnprintf(*strp, length + 1, fmt, va);
137 }
138 #endif
139
140 int xasprintf(char **strp, const char *fmt, ...)
141 {
142 va_list va;
143 int retval;
144
145 va_start(va, fmt);
146 retval = vasprintf(strp, fmt, va);
147 va_end(va);
148
149 if (retval < 0)
150 pdie("asprintf");
151
152 return retval;
153 }
154
155
156 int get_choice(int noninteractive_result, const char *noninteractive_msg,
157 int choices, ...)
158 {
159 int choice_values[9];
160 const char *choice_strings[9];
161 int choice;
162 int quit_choice;
163 int print_choices, print_full_choices;
164 va_list va;
165 int i;
166 static int inhibit_quit_choice;
167
168 if (!interactive) {
169 printf("%s\n", noninteractive_msg);
170 return noninteractive_result;
171 }
172
173 if (choices < 2 || choices > 9)
174 die("internal error: invalid number %u of choices in get_choice()",
175 choices);
176
177 va_start(va, choices);
178 for (i = 0; i < choices; i++) {
179 choice_values[i] = va_arg(va, int);
180 choice_strings[i] = va_arg(va, const char *);
181 }
182 va_end(va);
183
184 print_choices = 1;
185 print_full_choices = 0;
102186 while (1) {
103 if (prompt)
104 printf("%s ", prompt);
187 if (print_choices) {
188 print_choices = 0;
189 for (i = 0; i < choices; i++)
190 printf("%d) %s\n", i + 1, choice_strings[i]);
191
192 if (print_full_choices) {
193 printf("?) List all choices\n");
194 printf("q) Quit fsck\n");
195 }
196 }
197
198 printf("[%.*s?%s]? ", choices, "123456789", inhibit_quit_choice ? "" : "q");
105199 fflush(stdout);
106 while (ch = getchar(), ch == ' ' || ch == '\t') ;
107 if (ch == EOF)
200
201 do {
202 choice = getchar();
203 } while (choice == '\n'); /* filter out enter presses */
204
205 if (choice == EOF)
108206 exit(1);
109 if (!strchr(valid, okay = ch))
110 okay = 0;
111 while (ch = getchar(), ch != '\n' && ch != EOF) ;
112 if (ch == EOF)
113 exit(1);
114 if (okay)
115 return okay;
116 printf("Invalid input.\n");
117 }
118 }
207
208 printf("%c\n", choice);
209
210 if (choice > '0' && choice <= '0' + choices)
211 break;
212
213 if (choice == '?') {
214 print_choices = 1;
215 print_full_choices = 1;
216 }
217
218 if (!inhibit_quit_choice && (choice == 'q' || choice == 'Q')) {
219 if (!write_immed)
220 printf("No changes have been written to the filesystem yet. If you choose\n"
221 "to quit, it will be left in the same state it was in before you\n"
222 "started this program.\n");
223 else
224 printf("fsck is running in immediate write mode. All changes so far have\n"
225 "already been written and can not be undone now. If you choose to\n"
226 "quit now, these changes will stay in place.\n");
227
228 inhibit_quit_choice = 1;
229 quit_choice = get_choice(1, "This is never non-interactive.",
230 2,
231 1, "Quit now",
232 2, "Continue");
233 inhibit_quit_choice = 0;
234
235 if (quit_choice == 1)
236 exit(0);
237 }
238 }
239
240 return choice_values[choice - '1'];
241 }
242
243
244 char *get_line(const char *prompt, char *dest, size_t length)
245 {
246 struct termios tio, tio_orig;
247 int tio_fail;
248 char *retval;
249
250 tio_fail = tcgetattr(0, &tio_orig);
251 if (!tio_fail) {
252 tio = tio_orig;
253 tio.c_lflag |= ICANON | ECHO;
254 tcsetattr(0, TCSAFLUSH, &tio);
255 }
256
257 printf("%s: ", prompt);
258 fflush(stdout);
259
260 retval = fgets(dest, length, stdin);
261
262 if (!tio_fail)
263 tcsetattr(0, TCSAFLUSH, &tio_orig);
264 return retval;
265 }
266
267
268 /*
269 * ++roman: On m68k, check if this is an Atari; if yes, turn on Atari variant
270 * of MS-DOS filesystem by default.
271 */
272 void check_atari(void)
273 {
274 #if defined(__mc68000__) && defined(__linux__) && defined(CONF_CHECK_ATARI)
275 FILE *f;
276 char line[128], *p;
277
278 if (!(f = fopen("/proc/hardware", "r"))) {
279 perror("/proc/hardware");
280 return;
281 }
282
283 while (fgets(line, sizeof(line), f)) {
284 if (strncmp(line, "Model:", 6) == 0) {
285 p = line + 6;
286 p += strspn(p, " \t");
287 if (strncmp(p, "Atari ", 6) == 0)
288 atari_format = 1;
289 break;
290 }
291 }
292 fclose(f);
293 #endif
294 }
295
296
297 uint32_t generate_volume_id(void)
298 {
299 struct timeval now;
300
301 if (gettimeofday(&now, NULL) != 0 || now.tv_sec == (time_t)-1 || now.tv_sec < 0) {
302 srand(getpid());
303 /* rand() returns int from [0,RAND_MAX], therefore only 31 bits */
304 return (((uint32_t)(rand() & 0xFFFF)) << 16) | ((uint32_t)(rand() & 0xFFFF));
305 }
306
307 /* volume ID = current time, fudged for more uniqueness */
308 return ((uint32_t)now.tv_sec << 20) | (uint32_t)now.tv_usec;
309 }
310
311 /*
312 * Validate volume label
313 *
314 * @param[in] doslabel Label stored according to current DOS codepage
315 *
316 * @return bitmask of errors
317 * 0x01 - lowercase character
318 * 0x02 - character below 0x20
319 * 0x04 - character in disallowed set
320 * 0x08 - empty or space-only label
321 * 0x10 - space at beginning
322 */
323 int validate_volume_label(char *doslabel)
324 {
325 int i;
326 int ret = 0;
327 wchar_t wlabel[12];
328
329 if (dos_string_to_wchar_string(wlabel, doslabel, sizeof(wlabel))) {
330 for (i = 0; wlabel[i]; i++) {
331 /* FAT specification: Lower case characters are not allowed in DIR_Name
332 (what these characters are is country specific)
333 Original label is stored in DOS OEM code page, so islower() function
334 cannot be used. Therefore convert original label to locale independent
335 wchar_t* and then use iswlower() function for it.
336 */
337 if (iswlower(wlabel[i])) {
338 ret |= 0x01;
339 break;
340 }
341 }
342 }
343
344 /* According to FAT specification those bytes (after conversion to DOS OEM
345 code page) are not allowed.
346 */
347 for (i = 0; i < 11; i++) {
348 if (doslabel[i] < 0x20)
349 ret |= 0x02;
350 if (doslabel[i] == 0x22 ||
351 (doslabel[i] >= 0x2A && doslabel[i] <= 0x2C) ||
352 doslabel[i] == 0x2E ||
353 doslabel[i] == 0x2F ||
354 (doslabel[i] >= 0x3A && doslabel[i] <= 0x3F) ||
355 (doslabel[i] >= 0x5B && doslabel[i] <= 0x5D) ||
356 doslabel[i] == 0x7C)
357 ret |= 0x04;
358 }
359
360 if (memcmp(doslabel, " ", 11) == 0)
361 ret |= 0x08;
362
363 if (doslabel[0] == ' ')
364 ret |= 0x10;
365
366 return ret;
367 }
2121
2222 #ifndef _COMMON_H
2323 #define _COMMON_H
24
25 #include <sys/types.h>
26
27 #include <limits.h>
28 #include <stdint.h>
29
30 #ifndef OFF_MAX
31 #define OFF_MAX (off_t)((1ULL << (sizeof(off_t) * CHAR_BIT - 1)) - 1)
32 #endif
33
34 extern int interactive;
35 extern int write_immed;
36 extern int atari_format; /* Use Atari variation of MS-DOS FS format */
37
38 /* program_name used for printing messages; no name will be printed when it is
39 * left as NULL */
40 extern const char *program_name;
2441
2542 void die(const char *msg, ...)
2643 __attribute((noreturn, format(printf, 1, 2)));
4966
5067 /* Returns the smaller integer value of a and b. */
5168
52 char get_key(const char *valid, const char *prompt);
69 int xasprintf(char **strp, const char *fmt, ...)
70 __attribute((format(printf, 2, 3)));
5371
54 /* Displays PROMPT and waits for user input. Only characters in VALID are
55 accepted. Terminates the program on EOF. Returns the character. */
72 /* Runs asprintf() and terminates the program if it fails. */
73
74 int get_choice(int noninteractive_result, const char *noninteractive_msg,
75 int choices, ...);
76
77 /*
78 * Display a numbered list of choices and accept user input to select one. If
79 * interactive is false, it will instead print noninteractive_msg and return
80 * noninteractive_result. The number of options must be given in choices and
81 * must be more than one and less then ten.
82 *
83 * The variable arguments are choices times <int val, const char *desc>, where
84 * val is the value that is returned when the user selects this option and desc
85 * is the string describing this option.
86 */
87
88 char *get_line(const char *prompt, char *dest, size_t length);
89
90 /*
91 * Display prompt and read a line, placing it in dest with at most length-1
92 * characters plus a null byte. This behaves like printing a prompt and fgets()
93 * afterwards with the addition of temporarily enabling canonical input mode
94 * with echo if needed.
95 */
96
97 void check_atari(void);
98
99 /*
100 * ++roman: On m68k Linux, check if this is an Atari; if yes, turn on Atari
101 * variant of MS-DOS filesystem by default.
102 */
103
104 uint32_t generate_volume_id(void);
105
106 /*
107 * Generate a 32 bit volume ID
108 */
109
110 int validate_volume_label(char *doslabel);
111
112 /*
113 * Validate volume label
114 */
56115
57116 #endif
00 /* device_info.c - Collect device information for mkfs.fat
11
22 Copyright (C) 2015 Andreas Bombe <aeb@debian.org>
3 Copyright (C) 2018 Pali Rohár <pali.rohar@gmail.com>
34
45 This program is free software: you can redistribute it and/or modify
56 it under the terms of the GNU General Public License as published by
2223 #include <sys/types.h>
2324 #include <sys/stat.h>
2425 #include <sys/ioctl.h>
25
26 #ifdef HAVE_UDEV
27 #include <libudev.h>
26 #include <sys/sysmacros.h>
27
28 #ifdef HAVE_LINUX_LOOP_H
29 #include <linux/loop.h>
2830 #endif
2931
3032 #if HAVE_DECL_GETMNTENT
4345 #include <stdio.h>
4446 #include <string.h>
4547 #include <stdlib.h>
48 #include <errno.h>
4649
4750 #include "blkdev.h"
4851 #include "device_info.h"
5558 .geom_heads = -1,
5659 .geom_sectors = -1,
5760 .geom_start = -1,
61 .geom_size = -1,
5862 .sector_size = -1,
5963 .size = -1,
6064 };
7276 }
7377
7478
75 static void get_block_geometry(struct device_info *info, int fd)
76 {
77 unsigned int heads, sectors, start;
79 static void get_block_geometry(struct device_info *info, int fd, dev_t rdev)
80 {
81 unsigned int heads, sectors;
82 unsigned long long start;
7883
7984 if (!blkdev_get_geometry(fd, &heads, &sectors)
8085 && heads && sectors) {
8287 info->geom_sectors = sectors;
8388 }
8489
85 if (!blkdev_get_start(fd, &start))
90 if (!blkdev_get_start(fd, rdev, &start))
8691 info->geom_start = start;
8792 }
8893
96101 }
97102
98103
99 static int udev_fill_info(struct device_info *info, struct stat *stat);
100
101 #ifdef HAVE_UDEV
102 static int udev_fill_info(struct device_info *info, struct stat *stat)
103 {
104 struct udev *ctx;
105 struct udev_device *dev, *parent;
106 struct udev_enumerate *uenum;
107 const char *attr;
108 char holders_path[PATH_MAX + 1];
109 DIR *holders_dir;
110 struct dirent *dir_entry;
111 unsigned long number;
112 char *endptr;
113
114 if (device_info_verbose >= 3)
115 printf("udev_fill_info()\n");
116
117 ctx = udev_new();
118 if (!ctx) {
119 if (device_info_verbose)
120 printf("no udev library context\n");
121 return -1;
122 }
123
124 dev = udev_device_new_from_devnum(ctx, 'b', stat->st_rdev);
125 if (!dev) {
126 if (device_info_verbose)
127 printf("no udev context\n");
128 udev_unref(ctx);
129 return -1;
130 }
131
132 /*
133 * first, look for for dependent devices (partitions or virtual mappings on
134 * this device)
135 */
136 if (device_info_verbose >= 3)
137 printf("looking for dependent devices\n");
138
139 uenum = udev_enumerate_new(ctx);
140 if (uenum) {
141 struct udev_list_entry *entry;
142 if (udev_enumerate_add_match_parent(uenum, dev) >= 0 &&
143 udev_enumerate_scan_devices(uenum) >= 0) {
144 entry = udev_enumerate_get_list_entry(uenum);
145 if (entry) {
146 /*
147 * the list of children includes the parent device, so make
148 * sure that has_children is -1 to end up with the correct
149 * count
150 */
151 info->has_children = -1;
152
153 while (entry) {
154 if (device_info_verbose >= 2)
155 printf("child-or-self: %s\n", udev_list_entry_get_name(entry));
156 entry = udev_list_entry_get_next(entry);
157 info->has_children++;
158 }
159 } else
160 info->has_children = 0;
161 }
162 udev_enumerate_unref(uenum);
163 }
164
165 /* see if the holders directory in sysfs exists and has entries */
166 if (device_info_verbose >= 2)
167 printf("syspath: %s\n", udev_device_get_syspath(dev));
168 if (info->has_children < 1 || device_info_verbose >= 3) {
169 snprintf(holders_path, PATH_MAX, "%s/holders",
170 udev_device_get_syspath(dev));
171 holders_path[PATH_MAX] = 0;
172
173 if (info->has_children < 0)
174 info->has_children = 0;
175
176 holders_dir = opendir(holders_path);
177 if (holders_dir) {
178 dir_entry = readdir(holders_dir);
179 while (dir_entry) {
180 if (dir_entry->d_reclen && dir_entry->d_name[0] != '.') {
181 if (device_info_verbose >= 2)
182 printf("holder: %s\n", dir_entry->d_name);
183
184 info->has_children++;
185
186 /* look up and print every holder when very verbose */
187 if (device_info_verbose < 3)
188 break;
189 }
190 dir_entry = readdir(holders_dir);
191 }
192
193 closedir(holders_dir);
194 }
195 }
196
197 /*
198 * block devices on real hardware have either other block devices
199 * (in the case of partitions) or the actual hardware as parent
200 */
201 parent = udev_device_get_parent(dev);
202
203 if (!parent) {
204 if (device_info_verbose >= 3)
205 printf("no parent found, therefore virtual device\n");
206 info->type = TYPE_VIRTUAL;
207 info->partition = 0;
208 udev_device_unref(dev);
209 return 0;
210 }
211
212 attr = udev_device_get_sysattr_value(dev, "removable");
213 if (device_info_verbose >= 3) {
214 if (attr)
215 printf("attribute \"removable\" is \"%s\"\n", attr);
216 else
217 printf("attribute \"removable\" not found\n");
218 }
219 if (attr && !strcmp(attr, "1"))
220 info->type = TYPE_REMOVABLE;
221 else
222 info->type = TYPE_FIXED;
223
224 attr = udev_device_get_sysattr_value(dev, "partition");
225 if (attr) {
226 if (device_info_verbose >= 3)
227 printf("attribute \"partition\" is \"%s\"\n", attr);
228
229 number = strtoul(attr, &endptr, 10);
230 if (!*endptr)
231 info->partition = number;
232 } else {
233 printf("attribute \"partition\" not found\n");
234 if (info->type != TYPE_VIRTUAL && parent) {
235 /* partitions have other block devices as parent */
236 attr = udev_device_get_subsystem(parent);
237 if (attr) {
238 if (device_info_verbose >= 3)
239 printf("parent subsystem is \"%s\"\n", attr);
240
241 if (!strcmp(attr, "block"))
242 /* we don't know the partition number, use 1 */
243 info->partition = 1;
244 else
245 info->partition = 0;
246 }
247 }
248 }
249
250 udev_device_unref(dev);
251 udev_unref(ctx);
252 return 0;
253 }
254 #else /* HAVE_UDEV */
255 static int udev_fill_info(struct device_info *info, struct stat *stat)
256 {
257 /* prevent "unused parameter" warning */
258 (void)stat;
259 (void)info;
260
261 return -1;
104 #ifdef __linux__
105 static void get_block_linux_info(struct device_info *info, int devfd, dev_t rdev)
106 {
107 struct stat st;
108 char path[PATH_MAX];
109 int fd;
110 int blockfd;
111 FILE *file;
112 DIR *dir;
113 struct dirent *d;
114 int maj;
115 int min;
116 long long start;
117 int removable;
118
119 #ifdef HAVE_LINUX_LOOP_H
120 struct loop_info64 lo;
121 #endif
122
123 maj = major(rdev);
124 min = minor(rdev);
125
126 snprintf(path, sizeof(path), "/sys/dev/block/%d:%d", maj, min);
127 blockfd = open(path, O_RDONLY | O_DIRECTORY);
128 if (blockfd < 0)
129 return;
130
131 /* Check if device is partition */
132 fd = openat(blockfd, "partition", O_RDONLY);
133 if (fd >= 0) {
134 file = fdopen(fd, "r");
135 if (file) {
136 if (fscanf(file, "%d", &info->partition) != 1 || info->partition == 0)
137 info->partition = -1;
138 fclose(file);
139 } else {
140 close(fd);
141 }
142 /* Read total number of sectors of the disk */
143 fd = openat(blockfd, "../size", O_RDONLY);
144 if (fd >= 0) {
145 file = fdopen(fd, "r");
146 if (file) {
147 if (fscanf(file, "%lld", &info->geom_size) != 1 || info->geom_size == 0)
148 info->geom_size = -1;
149 fclose(file);
150 } else {
151 close(fd);
152 }
153 }
154 } else if (errno == ENOENT && info->geom_start <= 0) {
155 info->partition = 0;
156 if (info->size > 0 && info->sector_size > 0)
157 info->geom_size = info->size / info->sector_size;
158 }
159
160 /* Check if device has partition subdevice and therefore has children */
161 fd = dup(blockfd);
162 if (fd >= 0) {
163 dir = fdopendir(fd);
164 if (dir) {
165 info->has_children = 0;
166 errno = 0;
167 while ((d = readdir(dir))) {
168 if (strcmp(d->d_name, ".") == 0 || strcmp(d->d_name, "..") == 0)
169 continue;
170 if (d->d_type != DT_DIR && d->d_type != DT_UNKNOWN)
171 continue;
172 snprintf(path, sizeof(path), "%s/partition", d->d_name);
173 if (fstatat(blockfd, path, &st, 0) == 0) {
174 if (S_ISREG(st.st_mode)) {
175 start = -1;
176 snprintf(path, sizeof(path), "%s/start", d->d_name);
177 fd = openat(blockfd, path, O_RDONLY);
178 if (fd >= 0) {
179 file = fdopen(fd, "r");
180 if (file) {
181 if (fscanf(file, "%lld", &start) != 1)
182 start = -1;
183 fclose(file);
184 } else {
185 close(fd);
186 }
187 }
188 /* If subdevice starts at zero offset then it is whole device, so it is not a child */
189 if (start != 0) {
190 info->has_children = 1;
191 break;
192 }
193 }
194 } else if (errno != ENOENT) {
195 info->has_children = -1;
196 }
197 errno = 0;
198 }
199 if (errno != 0 && info->has_children == 0)
200 info->has_children = -1;
201 closedir(dir);
202 } else {
203 close(fd);
204 }
205 }
206
207 /* Check if device has holders and therefore has children */
208 if (info->has_children <= 0) {
209 fd = openat(blockfd, "holders", O_RDONLY | O_DIRECTORY);
210 if (fd >= 0) {
211 dir = fdopendir(fd);
212 if (dir) {
213 while ((d = readdir(dir))) {
214 if (strcmp(d->d_name, ".") == 0 || strcmp(d->d_name, "..") == 0)
215 continue;
216 info->has_children = 1;
217 break;
218 }
219 closedir(dir);
220 } else {
221 close(fd);
222 }
223 }
224 }
225
226 /* Check if device is slave of another device and therefore is virtual */
227 fd = openat(blockfd, "slaves", O_RDONLY | O_DIRECTORY);
228 if (fd >= 0) {
229 dir = fdopendir(fd);
230 if (dir) {
231 while ((d = readdir(dir))) {
232 if (strcmp(d->d_name, ".") == 0 || strcmp(d->d_name, "..") == 0)
233 continue;
234 info->type = TYPE_VIRTUAL;
235 break;
236 }
237 closedir(dir);
238 } else {
239 close(fd);
240 }
241 }
242
243 #ifdef HAVE_LINUX_LOOP_H
244 /* Check if device is loop and detect if is based from regular file or is virtual */
245 if (info->type == TYPE_UNKNOWN && info->partition == 0 && ioctl(devfd, LOOP_GET_STATUS64, &lo) == 0) {
246 if (lo.lo_offset == 0 && lo.lo_sizelimit == 0 && lo.lo_encrypt_type == LO_CRYPT_NONE &&
247 stat((char *)lo.lo_file_name, &st) == 0 && S_ISREG(st.st_mode) &&
248 st.st_dev == lo.lo_device && st.st_ino == lo.lo_inode && st.st_size == info->size)
249 info->type = TYPE_FILE;
250 else
251 info->type = TYPE_VIRTUAL;
252 }
253 #endif
254
255 /* Device is neither loop nor virtual, so is either removable or fixed */
256 if (info->type == TYPE_UNKNOWN) {
257 removable = 0;
258 fd = openat(blockfd, "removable", O_RDONLY);
259 if (fd >= 0) {
260 file = fdopen(fd, "r");
261 if (file) {
262 if (fscanf(file, "%d", &removable) != 1)
263 removable = 0;
264 fclose(file);
265 } else {
266 close(fd);
267 }
268 }
269
270 if (removable)
271 info->type = TYPE_REMOVABLE;
272 else
273 info->type = TYPE_FIXED;
274 }
275
276 close(blockfd);
262277 }
263278 #endif
264279
291306 }
292307
293308 get_block_device_size(info, fd);
294 get_block_geometry(info, fd);
309 get_block_geometry(info, fd, stat.st_rdev);
295310 get_sector_size(info, fd);
296311
297 /* use udev information if available */
298 udev_fill_info(info, &stat);
312 #ifdef __linux__
313 get_block_linux_info(info, fd, stat.st_rdev);
314 #endif
299315
300316 return 0;
301317 }
3333 */
3434 int geom_heads;
3535 int geom_sectors;
36 long geom_start;
36 long long geom_start;
37 long long geom_size;
3738
3839 /*
3940 * detected sector size or -1 if unknown
22 Copyright (C) 1993 Werner Almesberger <werner.almesberger@lrc.di.epfl.ch>
33 Copyright (C) 1998 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
44 Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
5 Copyright (C) 2021 Pali Rohár <pali.rohar@gmail.com>
56
67 This program is free software: you can redistribute it and/or modify
78 it under the terms of the GNU General Public License as published by
3132 #include "common.h"
3233 #include "fsck.fat.h"
3334 #include "io.h"
35 #include "boot.h"
3436 #include "check.h"
3537 #include "fat.h"
3638
7476 }
7577 }
7678
77 /**
78 * Build a bookkeeping structure from the partition's FAT table.
79 * If the partition has multiple FATs and they don't agree, try to pick a winner,
80 * and queue a command to overwrite the loser.
81 * One error that is fixed here is a cluster that links to something out of range.
82 *
83 * @param[inout] fs Information about the filesystem
84 */
85 void read_fat(DOS_FS * fs)
86 {
87 int eff_size, alloc_size;
88 uint32_t i;
89 void *first, *second = NULL;
90 int first_ok, second_ok;
91 uint32_t total_num_clusters;
92
93 /* Clean up from previous pass */
79 void release_fat(DOS_FS * fs)
80 {
9481 if (fs->fat)
9582 free(fs->fat);
9683 if (fs->cluster_owner)
9784 free(fs->cluster_owner);
9885 fs->fat = NULL;
9986 fs->cluster_owner = NULL;
87 }
88
89 static void fix_first_cluster(DOS_FS * fs, void * first_cluster)
90 {
91 struct boot_sector b;
92
93 fs_read(0, sizeof(b), &b);
94
95 printf("Fixing first cluster in FAT.\n");
96 if (fs->fat_bits == 12)
97 *(uint16_t *)first_cluster = htole16((le16toh(*(uint16_t *)first_cluster) & 0xf000) | FAT_EXTD(fs) | b.media);
98 else if (fs->fat_bits == 16)
99 *(uint16_t *)first_cluster = htole16(FAT_EXTD(fs) | b.media);
100 else
101 *(uint32_t *)first_cluster = htole32(FAT_EXTD(fs) | b.media);
102 }
103
104 /**
105 * Build a bookkeeping structure from the partition's FAT table.
106 * If the partition has multiple FATs and they don't agree, try to pick a winner,
107 * and queue a command to overwrite the loser.
108 * One error that is fixed here is a cluster that links to something out of range.
109 *
110 * @param[inout] fs Information about the filesystem
111 * @param[in] mode 0 - read-only, 1 - read-write (no repair), 2 - repair
112 */
113 void read_fat(DOS_FS * fs, int mode)
114 {
115 int eff_size, alloc_size;
116 uint32_t i;
117 void *first, *second = NULL;
118 int first_ok, second_ok = 0;
119 FAT_ENTRY first_media, second_media;
120 uint32_t total_num_clusters;
121
122 if (fat_table > fs->nfats)
123 die("Requested FAT table %ld does not exist.", fat_table);
124 if (fat_table > 2)
125 die("Reading FAT table greather than 2 is implemented yet.");
126
127 /* Clean up from previous pass */
128 release_fat(fs);
100129
101130 total_num_clusters = fs->data_clusters + 2;
102131 eff_size = (total_num_clusters * fs->fat_bits + 7) / 8ULL;
110139
111140 first = alloc(alloc_size);
112141 fs_read(fs->fat_start, eff_size, first);
142 get_fat(&first_media, first, 0, fs);
143 first_ok = (first_media.value & FAT_EXTD(fs)) == FAT_EXTD(fs);
113144 if (fs->nfats > 1) {
114145 second = alloc(alloc_size);
115146 fs_read(fs->fat_start + fs->fat_size, eff_size, second);
116 }
117 if (second && memcmp(first, second, eff_size) != 0) {
118 FAT_ENTRY first_media, second_media;
119 get_fat(&first_media, first, 0, fs);
120147 get_fat(&second_media, second, 0, fs);
121 first_ok = (first_media.value & FAT_EXTD(fs)) == FAT_EXTD(fs);
122148 second_ok = (second_media.value & FAT_EXTD(fs)) == FAT_EXTD(fs);
149 }
150 if (mode != 0 && fat_table == 0) {
151 if (!first_ok && second && !second_ok)
152 die("Both FATs appear to be corrupt. Giving up. Run fsck.fat with non-zero -F option.");
153 if (!first_ok && !second)
154 die("First FAT appears to be corrupt and second FAT does not exist. Giving up. Run fsck.fat with -F 1 option.");
155 }
156 if (mode == 0 && !first_ok && second && second_ok) {
157 /* In read-only mode if first FAT is corrupted and second is OK then use second FAT */
158 void *first_backup = first;
159 first = second;
160 second = first_backup;
161 }
162 if (mode != 0 && fat_table == 0 && second && memcmp(first, second, eff_size) != 0) {
163 if (mode != 2)
164 die("FATs differ, please run fsck.fat");
123165 if (first_ok && !second_ok) {
124166 printf("FATs differ - using first FAT.\n");
125167 fs_write(fs->fat_start + fs->fat_size, eff_size, first);
126 }
127 if (!first_ok && second_ok) {
168 } else if (!first_ok && second_ok) {
128169 printf("FATs differ - using second FAT.\n");
129170 fs_write(fs->fat_start, eff_size, second);
130171 memcpy(first, second, eff_size);
131 }
132 if (first_ok && second_ok) {
133 if (interactive) {
134 printf("FATs differ but appear to be intact. Use which FAT ?\n"
135 "1) Use first FAT\n2) Use second FAT\n");
136 if (get_key("12", "?") == '1') {
137 fs_write(fs->fat_start + fs->fat_size, eff_size, first);
138 } else {
139 fs_write(fs->fat_start, eff_size, second);
140 memcpy(first, second, eff_size);
172 } else {
173 if (first_ok && second_ok)
174 printf("FATs differ but appear to be intact.\n");
175 else
176 printf("FATs differ and both appear to be corrupt.\n");
177 if (get_choice(1, " Using first FAT.",
178 2,
179 1, "Use first FAT",
180 2, "Use second FAT") == 1) {
181 if (!first_ok) {
182 fix_first_cluster(fs, first);
183 fs_write(fs->fat_start, (fs->fat_bits + 7) / 8, first);
141184 }
185 fs_write(fs->fat_start + fs->fat_size, eff_size, first);
142186 } else {
143 printf("FATs differ but appear to be intact. Using first "
144 "FAT.\n");
145 fs_write(fs->fat_start + fs->fat_size, eff_size, first);
187 if (!second_ok) {
188 fix_first_cluster(fs, second);
189 fs_write(fs->fat_start + fs->fat_size, (fs->fat_bits + 7) / 8, second);
190 }
191 fs_write(fs->fat_start, eff_size, second);
192 memcpy(first, second, eff_size);
146193 }
147194 }
148 if (!first_ok && !second_ok) {
149 printf("Both FATs appear to be corrupt. Giving up.\n");
150 exit(1);
151 }
195 }
196 if (mode != 0 && fat_table != 0) {
197 if (fat_table == 1) {
198 printf("Using first FAT.\n");
199 if (!first_ok) {
200 fix_first_cluster(fs, first);
201 fs_write(fs->fat_start, (fs->fat_bits + 7) / 8, first);
202 }
203 if (second && memcmp(first, second, eff_size) != 0)
204 fs_write(fs->fat_start + fs->fat_size, eff_size, first);
205 } else if (fat_table == 2) {
206 printf("Using second FAT.\n");
207 if (!second_ok) {
208 fix_first_cluster(fs, second);
209 fs_write(fs->fat_start + fs->fat_size, (fs->fat_bits + 7) / 8, second);
210 }
211 if (memcmp(first, second, eff_size) != 0) {
212 fs_write(fs->fat_start, eff_size, second);
213 memcpy(first, second, eff_size);
214 }
215 }
152216 }
153217 if (second) {
154218 free(second);
157221
158222 fs->cluster_owner = alloc(total_num_clusters * sizeof(DOS_FILE *));
159223 memset(fs->cluster_owner, 0, (total_num_clusters * sizeof(DOS_FILE *)));
224
225 if (mode == 0)
226 return;
160227
161228 /* Truncate any cluster chains that link to something out of range */
162229 for (i = 2; i < fs->data_clusters + 2; i++) {
163230 FAT_ENTRY curEntry;
164231 get_fat(&curEntry, fs->fat, i, fs);
165232 if (curEntry.value == 1) {
233 if (mode != 2)
234 die("Cluster %ld out of range (1), please run fsck.fat",
235 (long)(i - 2));
166236 printf("Cluster %ld out of range (1). Setting to EOF.\n",
167237 (long)(i - 2));
168238 set_fat(fs, i, -1);
169239 }
170240 if (curEntry.value >= fs->data_clusters + 2 &&
171241 (curEntry.value < FAT_MIN_BAD(fs))) {
242 if (mode != 2)
243 die("Cluster %ld out of range (%ld > %ld), please run fsck.fat",
244 (long)(i - 2), (long)curEntry.value,
245 (long)(fs->data_clusters + 2 - 1));
172246 printf("Cluster %ld out of range (%ld > %ld). Setting to EOF.\n",
173247 (long)(i - 2), (long)curEntry.value,
174248 (long)(fs->data_clusters + 2 - 1));
292366
293367 off_t cluster_start(DOS_FS * fs, uint32_t cluster)
294368 {
295 return fs->data_start + ((off_t)cluster - 2) * (uint64_t)fs->cluster_size;
369 /* TODO: check overflow */
370 return fs->data_start + ((off_t)cluster - 2) * (unsigned long long)fs->cluster_size;
296371 }
297372
298373 /**
545620 if (free != fs->free_clusters) {
546621 printf("Free cluster summary wrong (%ld vs. really %ld)\n",
547622 (long)fs->free_clusters, (long)free);
548 if (interactive)
549 printf("1) Correct\n2) Don't correct\n");
550 else
551 printf(" Auto-correcting.\n");
552 if (!interactive || get_key("12", "?") == '1')
623 if (get_choice(1, " Auto-correcting.",
624 2,
625 1, "Correct",
626 2, "Don't correct") == 1)
553627 do_set = 1;
554628 }
555629 } else {
556630 printf("Free cluster summary uninitialized (should be %ld)\n", (long)free);
557631 if (rw) {
558 if (interactive)
559 printf("1) Set it\n2) Leave it uninitialized\n");
560 else
561 printf(" Auto-setting.\n");
562 if (!interactive || get_key("12", "?") == '1')
632 if (get_choice(1, " Auto-setting.",
633 2,
634 1, "Set it",
635 2, "Leave it uninitialized") == 1)
563636 do_set = 1;
564637 }
565638 }
2222 #ifndef _FAT_H
2323 #define _FAT_H
2424
25 void read_fat(DOS_FS * fs);
25 void read_fat(DOS_FS * fs, int mode);
2626
2727 /* Loads the FAT of the filesystem described by FS. Initializes the FAT,
2828 replaces broken FATs and rejects invalid cluster entries. */
29
30 void release_fat(DOS_FS * fs);
31
32 /* Release the FAT of the filesystem described by FS and free allocated memory.
33 Call it after finish work with FAT. */
2934
3035 void get_fat(FAT_ENTRY * entry, void *fat, uint32_t cluster, DOS_FS * fs);
3136
33 Copyright (C) 1998 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
44 Copyright (C) 2007 Red Hat, Inc.
55 Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
6 Copyright (C) 2015 Andreas Bombe <aeb@debian.org>
6 Copyright (C) 2015-2017 Andreas Bombe <aeb@debian.org>
7 Copyright (C) 2017-2018 Pali Rohár <pali.rohar@gmail.com>
78
89 This program is free software: you can redistribute it and/or modify
910 it under the terms of the GNU General Public License as published by
2425
2526 #include "version.h"
2627
28 #include <stdbool.h>
29 #include <errno.h>
2730 #include <stdio.h>
2831 #include <stdlib.h>
2932 #include <string.h>
3033 #include <stdlib.h>
34 #include <limits.h>
3135 #include <unistd.h>
3236 #include <getopt.h>
3337 #include <ctype.h>
3943 #include "fat.h"
4044 #include "file.h"
4145 #include "check.h"
42
43 int interactive = 0, rw = 0, list = 0, test = 0, verbose = 0, write_immed = 0;
44 int atari_format = 0;
46 #include "charconv.h"
47
48 int rw = 0, list = 0, test = 0, verbose = 0, no_spaces_in_sfns = 0;
49 long fat_table = 0;
4550 unsigned n_files = 0;
4651 void *mem_queue = NULL;
4752
48 static void usage(int error)
53
54 static void handle_label(bool change, bool reset, const char *device, char *newlabel)
55 {
56 DOS_FS fs = { 0 };
57 off_t offset;
58 DIR_ENT de;
59
60 char label[12] = { 0 };
61 size_t len;
62 int ret;
63 int i;
64
65 if (change) {
66 len = mbstowcs(NULL, newlabel, 0);
67 if (len != (size_t)-1 && len > 11) {
68 fprintf(stderr,
69 "fatlabel: labels can be no longer than 11 characters\n");
70 exit(1);
71 }
72
73 if (!local_string_to_dos_string(label, newlabel, 12)) {
74 fprintf(stderr,
75 "fatlabel: error when processing label\n");
76 exit(1);
77 }
78
79 for (i = strlen(label); i < 11; ++i)
80 label[i] = ' ';
81 label[11] = 0;
82
83 ret = validate_volume_label(label);
84 if (ret & 0x1) {
85 fprintf(stderr,
86 "fatlabel: warning - lowercase labels might not work properly on some systems\n");
87 }
88 if (ret & 0x2) {
89 fprintf(stderr,
90 "fatlabel: labels with characters below 0x20 are not allowed\n");
91 exit(1);
92 }
93 if (ret & 0x4) {
94 fprintf(stderr,
95 "fatlabel: labels with characters *?.,;:/\\|+=<>[]\" are not allowed\n");
96 exit(1);
97 }
98 if (ret & 0x08) {
99 fprintf(stderr,
100 "fatlabel: labels can't be empty or white space only\n");
101 exit(1);
102 }
103 if (ret & 0x10) {
104 fprintf(stderr,
105 "fatlabel: labels can't start with a space character\n");
106 exit(1);
107 }
108 }
109
110 fs_open(device, rw);
111 read_boot(&fs);
112
113 if (!change && !reset) {
114 if (fs.fat_bits == 32)
115 read_fat(&fs, 0);
116
117 offset = find_volume_de(&fs, &de);
118 if (offset != 0) {
119 if (de.name[0] == 0x05)
120 de.name[0] = 0xe5;
121 printf("%s\n", pretty_label((char *)de.name));
122 }
123
124 if (fs.fat_bits == 32)
125 release_fat(&fs);
126
127 exit(0);
128 }
129
130 if (fs.fat_bits == 32)
131 read_fat(&fs, 1);
132
133 if (!reset)
134 write_label(&fs, label);
135 else
136 remove_label(&fs);
137
138 if (fs.fat_bits == 32)
139 release_fat(&fs);
140 }
141
142
143 static void handle_volid(bool change, bool reset, const char *device, const char *newserial)
144 {
145 DOS_FS fs = { 0 };
146 char *tmp;
147 long long conversion;
148 uint32_t serial = 0;
149
150 if (change) {
151 errno = 0;
152 conversion = strtoll(newserial, &tmp, 16);
153
154 if (!*newserial || isspace(*newserial) || *tmp || conversion < 0) {
155 fprintf(stderr, "fatlabel: volume ID must be a hexadecimal number\n");
156 exit(1);
157 }
158 if (conversion > UINT32_MAX) {
159 fprintf(stderr, "fatlabel: given volume ID does not fit in 32 bit\n");
160 exit(1);
161 }
162 if (errno) {
163 fprintf(stderr, "fatlabel: parsing volume ID failed (%s)\n", strerror(errno));
164 exit(1);
165 }
166
167 serial = conversion;
168 }
169
170 if (reset)
171 serial = generate_volume_id();
172
173 fs_open(device, rw);
174 read_boot(&fs);
175 if (!change && !reset) {
176 printf("%08x\n", fs.serial);
177 exit(0);
178 }
179
180 write_serial(&fs, serial);
181 }
182
183
184 static void usage(int error, int usage_only)
49185 {
50186 FILE *f = error ? stderr : stdout;
51187 int status = error ? 1 : 0;
52188
53 fprintf(f, "usage: fatlabel device [label]\n");
189 fprintf(f, "Usage: fatlabel [OPTIONS] DEVICE [NEW]\n");
190 if (usage_only)
191 exit(status);
192
193 fprintf(f, "Change the FAT filesystem label or serial on DEVICE to NEW or display the\n");
194 fprintf(f, "existing label or serial if NEW is not given.\n");
195 fprintf(f, "\n");
196 fprintf(f, "Options:\n");
197 fprintf(f, " -i, --volume-id Work on serial number instead of label\n");
198 fprintf(f, " -r, --reset Remove label or generate new serial number\n");
199 fprintf(f, " -c N, --codepage=N use DOS codepage N to encode/decode label (default: %d)\n", DEFAULT_DOS_CODEPAGE);
200 fprintf(f, " -V, --version Show version number and terminate\n");
201 fprintf(f, " -h, --help Print this message and terminate\n");
54202 exit(status);
55203 }
56204
57 /*
58 * ++roman: On m68k, check if this is an Atari; if yes, turn on Atari variant
59 * of MS-DOS filesystem by default.
60 */
61 static void check_atari(void)
62 {
63 #ifdef __mc68000__
64 FILE *f;
65 char line[128], *p;
66
67 if (!(f = fopen("/proc/hardware", "r"))) {
68 perror("/proc/hardware");
69 return;
70 }
71
72 while (fgets(line, sizeof(line), f)) {
73 if (strncmp(line, "Model:", 6) == 0) {
74 p = line + 6;
75 p += strspn(p, " \t");
76 if (strncmp(p, "Atari ", 6) == 0)
77 atari_format = 1;
78 break;
79 }
80 }
81 fclose(f);
82 #endif
83 }
84205
85206 int main(int argc, char *argv[])
86207 {
87 DOS_FS fs = { 0 };
88 rw = 0;
89
90 int i;
91
208 const struct option long_options[] = {
209 {"volume-id", no_argument, NULL, 'i'},
210 {"reset", no_argument, NULL, 'r'},
211 {"codepage", required_argument, NULL, 'c'},
212 {"version", no_argument, NULL, 'V'},
213 {"help", no_argument, NULL, 'h'},
214 {0,}
215 };
216 bool change;
217 bool reset = false;
218 bool volid_mode = false;
92219 char *device = NULL;
93 char label[12] = { 0 };
94
95 off_t offset;
96 DIR_ENT de;
220 char *new = NULL;
221 char *tmp;
222 long codepage;
223 int c;
97224
98225 check_atari();
99226
100 if (argc < 2 || argc > 3)
101 usage(1);
102
103 if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help"))
104 usage(0);
105 else if (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version")) {
106 printf("fatlabel " VERSION " (" VERSION_DATE ")\n");
107 exit(0);
108 }
109
110 device = argv[1];
111 if (argc == 3) {
112 strncpy(label, argv[2], 11);
113 if (strlen(argv[2]) > 11) {
114 fprintf(stderr,
115 "fatlabel: labels can be no longer than 11 characters\n");
116 exit(1);
117 }
118 for (i = 0; label[i] && i < 11; i++)
119 /* don't know if here should be more strict !uppercase(label[i]) */
120 if (islower(label[i])) {
227 while ((c = getopt_long(argc, argv, "irc:Vh", long_options, NULL)) != -1) {
228 switch (c) {
229 case 'i':
230 volid_mode = 1;
231 break;
232
233 case 'r':
234 reset = true;
235 break;
236
237 case 'c':
238 errno = 0;
239 codepage = strtol(optarg, &tmp, 10);
240 if (!*optarg || isspace(*optarg) || *tmp || errno || codepage < 0 || codepage > INT_MAX) {
241 fprintf(stderr, "Invalid codepage : %s\n", optarg);
242 usage(1, 0);
243 }
244 if (!set_dos_codepage(codepage))
245 usage(1, 0);
246 break;
247
248 case 'V':
249 printf("fatlabel " VERSION " (" VERSION_DATE ")\n");
250 exit(0);
251 break;
252
253 case 'h':
254 usage(0, 0);
255 break;
256
257 case '?':
258 usage(1, 0);
259 exit(1);
260
261 default:
121262 fprintf(stderr,
122 "fatlabel: warning - lowercase labels might not work properly with DOS or Windows\n");
123 break;
124 }
263 "Internal error: getopt_long() returned unexpected value %d\n", c);
264 exit(2);
265 }
266 }
267
268 if (!set_dos_codepage(-1)) /* set default codepage if none was given in command line */
269 exit(1);
270
271 if (optind == argc - 2) {
272 change = true;
273 } else if (optind == argc - 1) {
274 change = false;
275 } else {
276 usage(1, 1);
277 }
278
279 if (change || reset)
125280 rw = 1;
126 }
127
128 fs_open(device, rw);
129 read_boot(&fs);
130 if (fs.fat_bits == 32)
131 read_fat(&fs);
132 if (!rw) {
133 offset = find_volume_de(&fs, &de);
134 if (offset == 0)
135 fprintf(stdout, "%s\n", fs.label);
136 else
137 fprintf(stdout, "%.8s%.3s\n", de.name, de.name + 8);
138 exit(0);
139 }
140
141 write_label(&fs, label);
281
282 if (change && reset) {
283 fprintf(stderr, "fatlabel: giving new value with --reset not allowed\n");
284 exit(1);
285 }
286
287 device = argv[optind++];
288 if (change)
289 new = argv[optind];
290
291 if (!volid_mode)
292 handle_label(change, reset, device, new);
293 else
294 handle_volid(change, reset, device, new);
295
142296 fs_close(rw);
143297 return 0;
144298 }
22 Copyright (C) 1993 Werner Almesberger <werner.almesberger@lrc.di.epfl.ch>
33 Copyright (C) 1998 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
44 Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
5 Copyright (C) 2020 Pali Rohár <pali.rohar@gmail.com>
56
67 This program is free software: you can redistribute it and/or modify
78 it under the terms of the GNU General Public License as published by
3637
3738 FDSC *fp_root = NULL;
3839
39 static void put_char(char **p, unsigned char c)
40 {
41 if (dos_char_to_printable(p, c))
40 static void put_char(char **p, unsigned char c, unsigned int out_size)
41 {
42 if (dos_char_to_printable(p, c, out_size))
4243 return;
43 if ((c >= ' ' && c < 0x7f) || c >= 0xa0)
44 if (out_size >= 1 && c >= ' ' && c < 0x7f)
4445 *(*p)++ = c;
45 else {
46 else if (out_size >= 4) {
4647 *(*p)++ = '\\';
4748 *(*p)++ = '0' + (c >> 6);
4849 *(*p)++ = '0' + ((c >> 3) & 7);
6061 */
6162 char *file_name(unsigned char *fixed)
6263 {
63 static char path[MSDOS_NAME * 4 + 2];
64 static char path[256];
6465 char *p;
6566 int i, j;
6667
6768 p = path;
68 for (i = j = 0; i < 8; i++)
69 i = j = 0;
70 if (fixed[0] == 0x05) {
71 put_char(&p, 0xe5, path + sizeof(path) - 1 - p);
72 ++i;
73 ++j;
74 }
75 for (; i < 8; i++)
6976 if (fixed[i] != ' ') {
7077 while (j++ < i)
7178 *p++ = ' ';
72 put_char(&p, fixed[i]);
79 put_char(&p, fixed[i], path + sizeof(path) - 1 - p);
7380 }
7481 if (strncmp((const char *)(fixed + 8), " ", 3)) {
7582 *p++ = '.';
7784 if (fixed[i + 8] != ' ') {
7885 while (j++ < i)
7986 *p++ = ' ';
80 put_char(&p, fixed[i + 8]);
87 put_char(&p, fixed[i + 8], path + sizeof(path) - 1 - p);
8188 }
8289 }
8390 *p = 0;
125132 if (islower(c))
126133 c = toupper(c);
127134 if (size) {
128 *fixed++ = c;
135 if (size == 8 && c == 0xE5)
136 *fixed++ = 0x05;
137 else
138 *fixed++ = c;
129139 size--;
130140 }
131141 name++;
22 Copyright (C) 1993 Werner Almesberger <werner.almesberger@lrc.di.epfl.ch>
33 Copyright (C) 1998 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
44 Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
5 Copyright (C) 2018-2021 Pali Rohár <pali.rohar@gmail.com>
56
67 This program is free software: you can redistribute it and/or modify
78 it under the terms of the GNU General Public License as published by
2930 #include <stdlib.h>
3031 #include <string.h>
3132 #include <stdlib.h>
33 #include <errno.h>
34 #include <ctype.h>
35 #include <limits.h>
3236 #include <unistd.h>
37 #include <termios.h>
3338 #include <getopt.h>
3439
3540 #include "common.h"
4146 #include "check.h"
4247 #include "charconv.h"
4348
44 int interactive = 0, rw = 0, list = 0, test = 0, verbose = 0, write_immed = 0;
45 int atari_format = 0, boot_only = 0;
49 int rw = 0, list = 0, test = 0, verbose = 0;
50 long fat_table = 0;
51 int no_spaces_in_sfns = 0;
52 int only_uppercase_label = 0;
53 int boot_only = 0;
4654 unsigned n_files = 0;
4755 void *mem_queue = NULL;
4856
49 static void usage(char *name)
57 static struct termios original_termios;
58
59
60 static void restore_termios(void)
5061 {
51 fprintf(stderr, "usage: %s [-aAbflrtvVwy] [-d path -d ...] "
52 "[-u path -u ...]\n%15sdevice\n", name, "");
53 fprintf(stderr, " -a automatically repair the filesystem\n");
54 fprintf(stderr, " -A toggle Atari filesystem format\n");
55 fprintf(stderr, " -b make read-only boot sector check\n");
56 fprintf(stderr,
57 " -c N use DOS codepage N to decode short file names (default: %d)\n",
62 tcsetattr(0, TCSAFLUSH, &original_termios);
63 }
64
65
66 static void usage(char *name, int exitval)
67 {
68 fprintf(stderr, "Usage: %s [OPTIONS] DEVICE\n", name);
69 fprintf(stderr, "Check FAT filesystem on DEVICE for errors.\n");
70 fprintf(stderr, "\n");
71 fprintf(stderr, "Options:\n");
72 fprintf(stderr, " -a automatically repair the filesystem\n");
73 fprintf(stderr, " -A toggle Atari variant of the FAT filesystem\n");
74 fprintf(stderr, " -b make read-only boot sector check\n");
75 fprintf(stderr, " -c N use DOS codepage N to decode short file names (default: %d)\n",
5876 DEFAULT_DOS_CODEPAGE);
59 fprintf(stderr, " -d path drop that file\n");
60 fprintf(stderr, " -f salvage unused chains to files\n");
61 fprintf(stderr, " -l list path names\n");
62 fprintf(stderr,
63 " -n no-op, check non-interactively without changing\n");
64 fprintf(stderr, " -p same as -a, for compat with other *fsck\n");
65 fprintf(stderr, " -r interactively repair the filesystem (default)\n");
66 fprintf(stderr, " -t test for bad clusters\n");
67 fprintf(stderr, " -u path try to undelete that (non-directory) file\n");
68 fprintf(stderr, " -v verbose mode\n");
69 fprintf(stderr, " -V perform a verification pass\n");
70 fprintf(stderr, " -w write changes to disk immediately\n");
71 fprintf(stderr, " -y same as -a, for compat with other *fsck\n");
72 exit(2);
73 }
74
75 /*
76 * ++roman: On m68k, check if this is an Atari; if yes, turn on Atari variant
77 * of MS-DOS filesystem by default.
78 */
79 static void check_atari(void)
80 {
81 #ifdef __mc68000__
82 FILE *f;
83 char line[128], *p;
84
85 if (!(f = fopen("/proc/hardware", "r"))) {
86 perror("/proc/hardware");
87 return;
88 }
89
90 while (fgets(line, sizeof(line), f)) {
91 if (strncmp(line, "Model:", 6) == 0) {
92 p = line + 6;
93 p += strspn(p, " \t");
94 if (strncmp(p, "Atari ", 6) == 0)
95 atari_format = 1;
96 break;
97 }
98 }
99 fclose(f);
100 #endif
77 fprintf(stderr, " -d PATH drop file with name PATH (can be given multiple times)\n");
78 fprintf(stderr, " -f salvage unused chains to files\n");
79 fprintf(stderr, " -F NUM specify FAT table NUM used for filesystem access\n");
80 fprintf(stderr, " -l list path names\n");
81 fprintf(stderr, " -n no-op, check non-interactively without changing\n");
82 fprintf(stderr, " -p same as -a, for compat with other *fsck\n");
83 fprintf(stderr, " -r interactively repair the filesystem (default)\n");
84 fprintf(stderr, " -S disallow spaces in the middle of short file names\n");
85 fprintf(stderr, " -t test for bad clusters\n");
86 fprintf(stderr, " -u PATH try to undelete (non-directory) file that was named PATH (can be\n");
87 fprintf(stderr, " given multiple times)\n");
88 fprintf(stderr, " -U allow only uppercase characters in volume and boot label\n");
89 fprintf(stderr, " -v verbose mode\n");
90 fprintf(stderr, " -V perform a verification pass\n");
91 fprintf(stderr, " --variant=TYPE handle variant TYPE of the filesystem\n");
92 fprintf(stderr, " -w write changes to disk immediately\n");
93 fprintf(stderr, " -y same as -a, for compat with other *fsck\n");
94 fprintf(stderr, " --help print this message\n");
95 exit(exitval);
10196 }
10297
10398 int main(int argc, char **argv)
105100 DOS_FS fs;
106101 int salvage_files, verify, c;
107102 uint32_t free_clusters = 0;
103 struct termios tio;
104 char *tmp;
105 long codepage;
106
107 enum {OPT_HELP=1000, OPT_VARIANT};
108 const struct option long_options[] = {
109 {"variant", required_argument, NULL, OPT_VARIANT},
110 {"help", no_argument, NULL, OPT_HELP},
111 {0,}
112 };
113
114 if (!tcgetattr(0, &original_termios)) {
115 tio = original_termios;
116 tio.c_lflag &= ~(ICANON | ECHO);
117 tcsetattr(0, TCSAFLUSH, &tio);
118 atexit(restore_termios);
119 }
108120
109121 memset(&fs, 0, sizeof(fs));
110122 salvage_files = verify = 0;
111123 rw = interactive = 1;
112124 check_atari();
113125
114 while ((c = getopt(argc, argv, "Aac:d:bflnprtu:vVwy")) != -1)
126 while ((c = getopt_long(argc, argv, "Aac:d:bfF:lnprStu:UvVwy",
127 long_options, NULL)) != -1)
115128 switch (c) {
116129 case 'A': /* toggle Atari format */
117130 atari_format = !atari_format;
129142 boot_only = 1;
130143 break;
131144 case 'c':
132 set_dos_codepage(atoi(optarg));
145 errno = 0;
146 codepage = strtol(optarg, &tmp, 10);
147 if (!*optarg || isspace(*optarg) || *tmp || errno || codepage < 0 || codepage > INT_MAX) {
148 fprintf(stderr, "Invalid codepage : %s\n", optarg);
149 usage(argv[0], 2);
150 }
151 if (!set_dos_codepage(codepage))
152 usage(argv[0], 2);
133153 break;
134154 case 'd':
135155 file_add(optarg, fdt_drop);
136156 break;
137157 case 'f':
138158 salvage_files = 1;
159 break;
160 case 'F':
161 errno = 0;
162 fat_table = strtol(optarg, &tmp, 10);
163 if (!*optarg || isspace(*optarg) || *tmp || errno || fat_table < 0 || fat_table > 255) {
164 fprintf(stderr, "Invalid FAT table : %s\n", optarg);
165 usage(argv[0], 2);
166 }
139167 break;
140168 case 'l':
141169 list = 1;
148176 rw = 1;
149177 interactive = 1;
150178 break;
179 case 'S':
180 no_spaces_in_sfns = 1;
181 break;
151182 case 't':
152183 test = 1;
153184 break;
154185 case 'u':
155186 file_add(optarg, fdt_undelete);
156187 break;
188 case 'U':
189 only_uppercase_label = 1;
190 break;
157191 case 'v':
158192 verbose = 1;
159193 break;
160194 case 'V':
161195 verify = 1;
162196 break;
197 case OPT_VARIANT:
198 if (!strcasecmp(optarg, "standard")) {
199 atari_format = 0;
200 } else if (!strcasecmp(optarg, "atari")) {
201 atari_format = 1;
202 } else {
203 fprintf(stderr, "Unknown variant: %s\n", optarg);
204 usage(argv[0], 2);
205 }
206 break;
163207 case 'w':
164208 write_immed = 1;
165209 break;
210 case OPT_HELP:
211 usage(argv[0], 0);
212 break;
213 case '?':
214 usage(argv[0], 2);
215 break;
166216 default:
167 usage(argv[0]);
217 fprintf(stderr,
218 "Internal error: getopt_long() returned unexpected value %d\n", c);
219 exit(3);
168220 }
169 set_dos_codepage(-1); /* set default codepage if none was given in command line */
221 if (!set_dos_codepage(-1)) /* set default codepage if none was given in command line */
222 exit(2);
170223 if ((test || write_immed) && !rw) {
171224 fprintf(stderr, "-t and -w can not be used in read only mode\n");
172225 exit(2);
173226 }
174227 if (optind != argc - 1)
175 usage(argv[0]);
228 usage(argv[0], 2);
176229
177230 printf("fsck.fat " VERSION " (" VERSION_DATE ")\n");
178231 fs_open(argv[optind], rw);
183236
184237 if (verify)
185238 printf("Starting check/repair pass.\n");
186 while (read_fat(&fs), scan_root(&fs))
239 while (read_fat(&fs, 2), scan_root(&fs))
187240 qfree(&mem_queue);
241 check_label(&fs);
188242 if (test)
189243 fix_bad(&fs);
190244 if (salvage_files)
191245 reclaim_file(&fs);
192246 else
193247 reclaim_free(&fs);
248 if (!atari_format)
249 check_dirty_bits(&fs);
194250 free_clusters = update_free(&fs);
195251 file_unused();
196252 qfree(&mem_queue);
197253 if (verify) {
198254 n_files = 0;
199255 printf("Starting verification pass.\n");
200 read_fat(&fs);
256 read_fat(&fs, 2);
201257 scan_root(&fs);
258 check_label(&fs);
202259 reclaim_free(&fs);
260 if (!atari_format)
261 check_dirty_bits(&fs);
203262 qfree(&mem_queue);
204263 }
264 release_fat(&fs);
205265
206266 exit:
207 if (fs_changed()) {
267 if (!write_immed && fs_changed()) {
208268 if (rw) {
269 printf("\n*** Filesystem was changed ***\n");
209270 if (interactive)
210 rw = get_key("yn", "Perform changes ? (y/n)") == 'y';
211 else
212 printf("Performing changes.\n");
271 printf("The changes have not yet been written, you can still choose to leave the\n"
272 "filesystem unmodified:\n");
273
274 rw = get_choice(1, "Writing changes.",
275 2,
276 1, "Write changes",
277 2, "Leave filesystem unchanged") == 1;
213278 } else
214 printf("Leaving filesystem unchanged.\n");
279 printf("\nLeaving filesystem unchanged.\n");
215280 }
216281
217282 if (!boot_only)
3838 #define VFAT_LN_ATTR (ATTR_RO | ATTR_HIDDEN | ATTR_SYS | ATTR_VOLUME)
3939
4040 #define FAT_STATE_DIRTY 0x01
41 #define FAT_NEED_SURFACE_TEST 0x02
42
43 #define FAT16_FLAG_HARDDISK_ERROR 0x4000
44 #define FAT16_FLAG_CLEAN_SHUTDOWN 0x8000
45
46 #define FAT32_FLAG_HARDDISK_ERROR 0x4000000
47 #define FAT32_FLAG_CLEAN_SHUTDOWN 0x8000000
4148
4249 /* ++roman: Use own definition of boot sector structure -- the kernel headers'
4350 * name for it is msdos_boot_sector in 2.0 and fat_boot_sector in 2.1 ... */
6875 uint8_t reserved2[12]; /* Unused */
6976
7077 uint8_t drive_number; /* Logical Drive Number */
71 uint8_t reserved3; /* Unused */
78 uint8_t boot_flags; /* bit 0: dirty, bit 1: need surface test */
7279
7380 uint8_t extended_sig; /* Extended Signature (0x29) */
7481 uint32_t serial; /* Serial number */
97104 uint32_t total_sect; /* number of sectors (if sectors == 0) */
98105
99106 uint8_t drive_number; /* Logical Drive Number */
100 uint8_t reserved2; /* Unused */
107 uint8_t boot_flags; /* bit 0: dirty, bit 1: need surface test */
101108
102109 uint8_t extended_sig; /* Extended Signature (0x29) */
103110 uint32_t serial; /* Serial number */
149156 typedef struct {
150157 int nfats;
151158 off_t fat_start;
152 off_t fat_size; /* unit is bytes */
159 unsigned int fat_size; /* unit is bytes */
153160 unsigned int fat_bits; /* size of a FAT entry */
154161 unsigned int eff_fat_bits; /* # of used bits in a FAT entry */
155162 uint32_t root_cluster; /* 0 for old-style root dir */
163170 off_t backupboot_start; /* 0 if not present */
164171 unsigned char *fat;
165172 DOS_FILE **cluster_owner;
166 char *label;
173 uint32_t serial;
174 char label[11];
167175 } DOS_FS;
168176
169 extern int interactive, rw, list, verbose, test, write_immed;
170 extern int atari_format;
177 extern int rw, list, verbose, test, no_spaces_in_sfns;
178 extern long fat_table;
179 extern int only_uppercase_label;
171180 extern unsigned n_files;
172181 extern void *mem_queue;
173182
5555 static int fd, did_change = 0;
5656
5757
58 void fs_open(char *path, int rw)
58 void fs_open(const char *path, int rw)
5959 {
6060 if ((fd = open(path, rw ? O_RDWR : O_RDONLY)) < 0) {
6161 perror("open");
2828
2929 #include <fcntl.h> /* for off_t */
3030
31 void fs_open(char *path, int rw);
31 void fs_open(const char *path, int rw);
3232
3333 /* Opens the filesystem PATH. If RW is zero, the filesystem is opened
3434 read-only, otherwise, it is opened read-write. */
7272
7373 /* for maxlen param */
7474 #define UNTIL_0 INT_MAX
75
76 /* Convert name part in 'lfn' from unicode to ASCII */
77 #define CNV_THIS_PART(lfn) \
78 ({ \
79 unsigned char __part_uni[CHARS_PER_LFN*2]; \
80 copy_lfn_part( __part_uni, lfn ); \
81 cnv_unicode( __part_uni, CHARS_PER_LFN, 0 ); \
82 })
8375
8476 /* Convert name parts collected so far (from previous slots) from unicode to
8577 * ASCII */
154146 memcpy(dst + 22, lfn->name11_12, 4);
155147 }
156148
149 /* Convert name part in 'lfn' from unicode to ASCII */
150 static inline char *cnv_this_part(LFN_ENT *lfn)
151 {
152 unsigned char part_uni[CHARS_PER_LFN * 2];
153 copy_lfn_part(part_uni, lfn);
154 return cnv_unicode(part_uni, CHARS_PER_LFN, 0);
155 }
156
157157 static void clear_lfn_slots(int start, int end)
158158 {
159159 int i;
221221 * display the name) */
222222 printf("A new long file name starts within an old one.\n");
223223 if (slot == lfn_slot && lfn->alias_checksum == lfn_checksum) {
224 char *part1 = CNV_THIS_PART(lfn);
224 char *part1 = cnv_this_part(lfn);
225225 char *part2 = CNV_PARTS_SO_FAR();
226226 printf(" It could be that the LFN start bit is wrong here\n"
227227 " if \"%s\" seems to match \"%s\".\n", part1, part2);
229229 free(part2);
230230 can_clear = 1;
231231 }
232 if (interactive) {
233 printf("1: Delete previous LFN\n2: Leave it as it is.\n");
234 if (can_clear)
235 printf("3: Clear start bit and concatenate LFNs\n");
236 } else
237 printf(" Not auto-correcting this.\n");
238 if (interactive) {
239 switch (get_key(can_clear ? "123" : "12", "?")) {
240 case '1':
241 clear_lfn_slots(0, lfn_parts - 1);
242 lfn_reset();
243 break;
244 case '2':
245 break;
246 case '3':
247 lfn->id &= ~LFN_ID_START;
248 fs_write(dir_offset + offsetof(LFN_ENT, id),
249 sizeof(lfn->id), &lfn->id);
250 break;
251 }
232 switch (get_choice(2, " Not auto-correcting this.",
233 can_clear ? 3 : 2,
234 1, "Delete previous LFN",
235 2, "Leave it as it is",
236 3, "Clear start bit and concatenate LFNs")) {
237 case 1:
238 clear_lfn_slots(0, lfn_parts - 1);
239 lfn_reset();
240 break;
241 case 2:
242 break;
243 case 3:
244 lfn->id &= ~LFN_ID_START;
245 fs_write(dir_offset + offsetof(LFN_ENT, id),
246 sizeof(lfn->id), &lfn->id);
247 break;
252248 }
253249 }
254250 lfn_slot = slot;
261257 /* Causes: 1) start bit got lost, 2) Previous slot with start bit got
262258 * lost */
263259 /* Fixes: 1) delete LFN, 2) set start bit */
264 char *part = CNV_THIS_PART(lfn);
260 char *part = cnv_this_part(lfn);
265261 printf("Long filename fragment \"%s\" found outside a LFN "
266262 "sequence.\n (Maybe the start bit is missing on the "
267263 "last fragment)\n", part);
268264 free(part);
269 if (interactive) {
270 printf("1: Delete fragment\n2: Leave it as it is.\n"
271 "3: Set start bit\n");
272 } else
273 printf(" Not auto-correcting this.\n");
274 switch (interactive ? get_key("123", "?") : '2') {
275 case '1':
265 switch (get_choice(2, " Not auto-correcting this.",
266 3,
267 1, "Delete fragment",
268 2, "Leave it as it is",
269 3, "Set start bit")) {
270 case 1:
276271 if (!lfn_offsets)
277272 lfn_offsets = alloc(sizeof(off_t));
278273 lfn_offsets[0] = dir_offset;
279274 clear_lfn_slots(0, 0);
280275 lfn_reset();
281276 return;
282 case '2':
277 case 2:
283278 lfn_reset();
284279 return;
285 case '3':
280 case 3:
286281 lfn->id |= LFN_ID_START;
287282 fs_write(dir_offset + offsetof(LFN_ENT, id),
288283 sizeof(lfn->id), &lfn->id);
303298 printf("Unexpected long filename sequence number "
304299 "(%d vs. expected %d).\n", slot, lfn_slot);
305300 if (lfn->alias_checksum == lfn_checksum && lfn_slot > 0) {
306 char *part1 = CNV_THIS_PART(lfn);
301 char *part1 = cnv_this_part(lfn);
307302 char *part2 = CNV_PARTS_SO_FAR();
308303 printf(" It could be that just the number is wrong\n"
309304 " if \"%s\" seems to match \"%s\".\n", part1, part2);
311306 free(part2);
312307 can_fix = 1;
313308 }
314 if (interactive) {
315 printf
316 ("1: Delete LFN\n2: Leave it as it is (and ignore LFN so far)\n");
317 if (can_fix)
318 printf("3: Correct sequence number\n");
319 } else
320 printf(" Not auto-correcting this.\n");
321 switch (interactive ? get_key(can_fix ? "123" : "12", "?") : '2') {
322 case '1':
309 switch (get_choice(2, " Not auto-correcting this.",
310 can_fix ? 3 : 2,
311 1, "Delete LFN",
312 2, "Leave it as it is (and ignore LFN so far)",
313 3, "Correct sequence number")) {
314 case 1:
323315 if (!lfn_offsets) {
324316 lfn_offsets = alloc(sizeof(off_t));
325317 lfn_parts = 0;
328320 clear_lfn_slots(0, lfn_parts - 1);
329321 lfn_reset();
330322 return;
331 case '2':
323 case 2:
332324 lfn_reset();
333325 return;
334 case '3':
326 case 3:
335327 lfn->id = (lfn->id & ~LFN_ID_SLOTMASK) | lfn_slot;
336328 fs_write(dir_offset + offsetof(LFN_ENT, id),
337329 sizeof(lfn->id), &lfn->id);
346338 printf("Checksum in long filename part wrong "
347339 "(%02x vs. expected %02x).\n",
348340 lfn->alias_checksum, lfn_checksum);
349 if (interactive) {
350 printf("1: Delete LFN\n2: Leave it as it is.\n"
351 "3: Correct checksum\n");
352 } else
353 printf(" Not auto-correcting this.\n");
354 if (interactive) {
355 switch (get_key("123", "?")) {
356 case '1':
357 lfn_offsets[lfn_parts++] = dir_offset;
358 clear_lfn_slots(0, lfn_parts - 1);
359 lfn_reset();
360 return;
361 case '2':
362 break;
363 case '3':
364 lfn->alias_checksum = lfn_checksum;
365 fs_write(dir_offset + offsetof(LFN_ENT, alias_checksum),
366 sizeof(lfn->alias_checksum), &lfn->alias_checksum);
367 break;
368 }
341 switch (get_choice(2, " Not auto-correcting this.",
342 3,
343 1, "Delete LFN",
344 2, "Leave it as it is",
345 3, "Correct checksum")) {
346 case 1:
347 lfn_offsets[lfn_parts++] = dir_offset;
348 clear_lfn_slots(0, lfn_parts - 1);
349 lfn_reset();
350 return;
351 case 2:
352 break;
353 case 3:
354 lfn->alias_checksum = lfn_checksum;
355 fs_write(dir_offset + offsetof(LFN_ENT, alias_checksum),
356 sizeof(lfn->alias_checksum), &lfn->alias_checksum);
357 break;
369358 }
370359 }
371360
381370 if (lfn->reserved != 0) {
382371 printf("Reserved field in VFAT long filename slot is not 0 "
383372 "(but 0x%02x).\n", lfn->reserved);
384 if (interactive)
385 printf("1: Fix.\n2: Leave it.\n");
386 else
387 printf("Auto-setting to 0.\n");
388 if (!interactive || get_key("12", "?") == '1') {
373 if (get_choice(1, "Auto-setting to 0.",
374 2,
375 1, "Fix",
376 2, "Leave it") == 1) {
389377 lfn->reserved = 0;
390378 fs_write(dir_offset + offsetof(LFN_ENT, reserved),
391379 sizeof(lfn->reserved), &lfn->reserved);
394382 if (lfn->start != htole16(0)) {
395383 printf("Start cluster field in VFAT long filename slot is not 0 "
396384 "(but 0x%04x).\n", lfn->start);
397 if (interactive)
398 printf("1: Fix.\n2: Leave it.\n");
399 else
400 printf("Auto-setting to 0.\n");
401 if (!interactive || get_key("12", "?") == '1') {
385 if (get_choice(1, "Auto-setting to 0.",
386 2,
387 1, "Fix",
388 2, "Leave it") == 1) {
402389 lfn->start = htole16(0);
403390 fs_write(dir_offset + offsetof(LFN_ENT, start),
404391 sizeof(lfn->start), &lfn->start);
435422 * 3) renumber entries and truncate name */
436423 char *long_name = CNV_PARTS_SO_FAR();
437424 char *short_name = file_name(de->name);
425 char *fix_num_string;
426 int choice;
427
438428 printf("Unfinished long file name \"%s\".\n"
439429 " (Start may have been overwritten by %s)\n",
440430 long_name, short_name);
441431 free(long_name);
442 if (interactive) {
443 printf("1: Delete LFN\n2: Leave it as it is.\n"
444 "3: Fix numbering (truncates long name and attaches "
445 "it to short name %s)\n", short_name);
446 } else
447 printf(" Not auto-correcting this.\n");
448 switch (interactive ? get_key("123", "?") : '2') {
449 case '1':
432
433 xasprintf(&fix_num_string,
434 "Fix numbering (truncates long name and attaches "
435 "it to short name %s)", short_name);
436 choice = get_choice(2, " Not auto-correcting this.",
437 3,
438 1, "Delete LFN",
439 2, "Leave it as it is",
440 3, fix_num_string);
441 free(fix_num_string);
442
443 switch (choice) {
444 case 1:
450445 clear_lfn_slots(0, lfn_parts - 1);
451446 lfn_reset();
452447 return NULL;
453 case '2':
448 case 2:
454449 lfn_reset();
455450 return NULL;
456 case '3':
451 case 3:
457452 for (i = 0; i < lfn_parts; ++i) {
458453 uint8_t id = (lfn_parts - i) | (i == 0 ? LFN_ID_START : 0);
459454 fs_write(lfn_offsets[i] + offsetof(LFN_ENT, id),
473468 /* Fixes: 1) Fix checksum in LFN entries */
474469 char *long_name = CNV_PARTS_SO_FAR();
475470 char *short_name = file_name(de->name);
471 char *fix_check_string;
472 int choice;
473
476474 printf("Wrong checksum for long file name \"%s\".\n"
477475 " (Short name %s may have changed without updating the long name)\n",
478476 long_name, short_name);
479477 free(long_name);
480 if (interactive) {
481 printf("1: Delete LFN\n2: Leave it as it is.\n"
482 "3: Fix checksum (attaches to short name %s)\n", short_name);
483 } else
484 printf(" Not auto-correcting this.\n");
485 if (interactive) {
486 switch (get_key("123", "?")) {
487 case '1':
488 clear_lfn_slots(0, lfn_parts - 1);
489 lfn_reset();
490 return NULL;
491 case '2':
492 lfn_reset();
493 return NULL;
494 case '3':
495 for (i = 0; i < lfn_parts; ++i) {
496 fs_write(lfn_offsets[i] + offsetof(LFN_ENT, alias_checksum),
497 sizeof(sum), &sum);
498 }
499 break;
478
479 xasprintf(&fix_check_string,
480 "Fix checksum (attaches to short name %s)", short_name);
481 choice = get_choice(9, " Not auto-correcting this.",
482 3,
483 1, "Delete LFN",
484 2, "Leave it as it is",
485 3, fix_check_string);
486 free(fix_check_string);
487
488 switch (choice) {
489 case 1:
490 clear_lfn_slots(0, lfn_parts - 1);
491 lfn_reset();
492 return NULL;
493 case 2:
494 lfn_reset();
495 return NULL;
496 case 3:
497 for (i = 0; i < lfn_parts; ++i) {
498 fs_write(lfn_offsets[i] + offsetof(LFN_ENT, alias_checksum),
499 sizeof(sum), &sum);
500500 }
501 break;
501502 }
502503 }
503504
517518 long_name = CNV_PARTS_SO_FAR();
518519 printf("Orphaned long file name part \"%s\"\n", long_name);
519520 free(long_name);
520 if (interactive)
521 printf("1: Delete.\n2: Leave it.\n");
522 else
523 printf(" Auto-deleting.\n");
524 if (!interactive || get_key("12", "?") == '1') {
521 if (get_choice(1, " Auto-deleting.",
522 2,
523 1, "Delete",
524 2, "Leave it") == 1) {
525525 clear_lfn_slots(0, lfn_parts - 1);
526526 }
527527 lfn_reset();
66 Copyright (C) 1998-2005 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
77 Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
88 Copyright (C) 2015-2016 Andreas Bombe <aeb@debian.org>
9 Copyright (C) 2018 Pali Rohár <pali.rohar@gmail.com>
910
1011 This program is free software: you can redistribute it and/or modify
1112 it under the terms of the GNU General Public License as published by
5152 #include <string.h>
5253 #include <stdio.h>
5354 #include <stdlib.h>
55 #include <limits.h>
5456 #include <sys/types.h>
5557 #include <sys/stat.h>
5658 #include <sys/time.h>
6264 #include <getopt.h>
6365 #include "endian_compat.h"
6466
67 #include "common.h"
6568 #include "msdos_fs.h"
6669 #include "device_info.h"
70 #include "charconv.h"
6771
6872
6973 /* Constant definitions */
8084
8185 /* Macro definitions */
8286
83 /* Report a failure message and return a failure error code */
84
85 #define die( str ) fatal_error( "%s: " str "\n" )
86
8787 /* Mark a cluster in the FAT as bad */
8888
8989 #define mark_sector_bad( sector ) mark_FAT_sector( sector, FAT_BAD )
106106
107107 #define BOOT_SIGN 0xAA55 /* Boot sector magic number */
108108
109 #define MAX_CLUST_12 ((1 << 12) - 16)
110 #define MAX_CLUST_16 ((1 << 16) - 16)
111 #define MIN_CLUST_32 65529
109 /* According to Microsoft FAT specification (fatgen103.doc) disk with
110 * 4085 clusters (or more) is FAT16, but Microsoft Windows FAT driver
111 * fastfat.sys detects disk with less then 4087 clusters as FAT12.
112 * Linux FAT drivers msdos.ko and vfat.ko detect disk with at least
113 * 4085 clusters as FAT16, therefore for compatibility reasons with
114 * both systems disallow formatting disks to 4085 or 4086 clusters. */
115 #define MAX_CLUST_12 4084
116 #define MIN_CLUST_16 4087
117
118 /* According to Microsoft FAT specification (fatgen103.doc) disk with
119 * 65525 clusters (or more) is FAT32, but Microsoft Windows FAT driver
120 * fastfat.sys, Linux FAT drivers msdos.ko and vfat.ko detect disk as
121 * FAT32 when Sectors Per FAT (fat_length) is set to zero. And not by
122 * number of clusters. Still there is cluster upper limit for FAT16. */
123 #define MAX_CLUST_16 65524
124 #define MIN_CLUST_32 65525
125
112126 /* M$ says the high 4 bits of a FAT32 FAT entry are reserved and don't belong
113127 * to the cluster number. So the max. cluster# is based on 2^28 */
114 #define MAX_CLUST_32 ((1 << 28) - 16)
115
116 #define FAT12_THRESHOLD 4085
128 #define MAX_CLUST_32 268435446
117129
118130 #define OLDGEMDOS_MAX_SECTORS 32765
119131 #define GEMDOS_MAX_SECTORS 65531
127139
128140 struct msdos_volume_info {
129141 uint8_t drive_number; /* BIOS drive number */
130 uint8_t RESERVED; /* Unused */
142 uint8_t boot_flags; /* bit 0: dirty, bit 1: need surface test */
131143 uint8_t ext_boot_sign; /* 0x29 if fields below exist (DOS 3.3+) */
132144 uint8_t volume_id[4]; /* Volume ID number */
133145 uint8_t volume_label[11]; /* Volume label */
179191 uint32_t next_cluster; /* Most recently allocated cluster.
180192 * Unused under Linux. */
181193 uint32_t reserved2[4];
182 };
194 } __attribute__ ((packed));
183195
184196 /* The "boot code" we put into the filesystem... it writes a message and
185 tells the user to try again */
197 tells the user to try again. This "boot code" is in the public domain. */
186198
187199 unsigned char dummy_boot_jump[3] = { 0xeb, 0x3c, 0x90 };
188200
213225
214226 #define MESSAGE_OFFSET 29 /* Offset of message in above code */
215227
228 static char initial_volume_name[] = NO_NAME; /* Initial volume name, make sure that is writable */
229
216230 /* Global variables - the root of all evil :-) - see these and weep! */
217231
218 static const char *program_name = "mkfs.fat"; /* Name of the program */
219232 static char *device_name = NULL; /* Name of the device on which to create the filesystem */
220 static int atari_format = 0; /* Use Atari variation of MS-DOS FS format */
221233 static int check = FALSE; /* Default to no readablity checking */
222234 static int verbose = 0; /* Default to verbose mode off */
223235 static long volume_id; /* Volume ID number */
224 static time_t create_time; /* Creation time */
225 static char volume_name[] = NO_NAME; /* Volume name */
226 static uint64_t blocks; /* Number of blocks in filesystem */
236 static time_t create_time = -1; /* Creation time */
237 static char *volume_name = initial_volume_name; /* Volume name */
238 static unsigned long long blocks; /* Number of blocks in filesystem */
227239 static unsigned sector_size = 512; /* Size of a logical sector */
228240 static int sector_size_set = 0; /* User selected sector size */
229241 static int backup_boot = 0; /* Sector# of backup boot sector */
242 static int backup_boot_set = 0; /* User selected backup boot sector */
243 static int info_sector = 0; /* Sector# of FAT32 info sector */
230244 static int reserved_sectors = 0; /* Number of reserved sectors */
231245 static int badblocks = 0; /* Number of bad blocks in the filesystem */
232246 static int nr_fats = 2; /* Default number of FATs to produce */
233247 static int size_fat = 0; /* Size in bits of FAT entries */
234248 static int size_fat_by_user = 0; /* 1 if FAT size user selected */
235249 static int dev = -1; /* FS block device file handle */
236 static int ignore_full_disk = 0; /* Ignore warning about 'full' disk devices */
250 static off_t part_sector = 0; /* partition offset in sector */
251 static int ignore_safety_checks = 0; /* Ignore safety checks */
237252 static off_t currently_testing = 0; /* Block currently being tested (if autodetect bad blocks) */
238253 static struct msdos_boot_sector bs; /* Boot sector data */
239254 static int start_data_sector; /* Sector number for the start of the data area */
241256 static unsigned char *fat; /* File allocation table */
242257 static unsigned alloced_fat_length; /* # of FAT sectors we can keep in memory */
243258 static unsigned fat_entries; /* total entries in FAT table (including reserved) */
244 static unsigned char *info_sector; /* FAT32 info sector */
259 static unsigned char *info_sector_buffer; /* FAT32 info sector */
245260 static struct msdos_dir_entry *root_dir; /* Root directory */
246261 static int size_root_dir; /* Size of the root directory in bytes */
247262 static uint32_t num_sectors; /* Total number of sectors in device */
248263 static int sectors_per_cluster = 0; /* Number of sectors per disk cluster */
249264 static int root_dir_entries = 0; /* Number of root directory entries */
265 static int root_dir_entries_set = 0; /* User selected root directory size */
250266 static char *blank_sector; /* Blank sector - all zeros */
251 static int hidden_sectors = 0; /* Number of hidden sectors */
267 static unsigned hidden_sectors = 0; /* Number of hidden sectors */
252268 static int hidden_sectors_by_user = 0; /* -h option invoked */
253269 static int drive_number_option = 0; /* drive number */
254270 static int drive_number_by_user = 0; /* drive number option invoked */
259275 static int invariant = 0; /* Whether to set normally randomized or
260276 current time based values to
261277 constants */
278 static int fill_mbr_partition = -1; /* Whether to fill MBR partition table or not */
262279
263280 /* Function prototype definitions */
264281
265 static void fatal_error(const char *fmt_string) __attribute__ ((noreturn));
266282 static void mark_FAT_cluster(int cluster, unsigned int value);
267283 static void mark_FAT_sector(int sector, unsigned int value);
268284 static long do_check(char *buffer, int try, off_t current_block);
275291 static void write_tables(void);
276292
277293 /* The function implementations */
278
279 /* Handle the reporting of fatal errors. Volatile to let gcc know that this doesn't return */
280
281 static void fatal_error(const char *fmt_string)
282 {
283 fprintf(stderr, fmt_string, program_name, device_name);
284 exit(1); /* The error exit code is 1! */
285 }
286294
287295 /* Mark the specified cluster as having a particular value */
288296
346354 {
347355 long got;
348356
349 if (lseek(dev, current_block * BLOCK_SIZE, SEEK_SET) /* Seek to the correct location */
357 if (lseek(dev, part_sector * sector_size + current_block * BLOCK_SIZE, SEEK_SET) /* Seek to the correct location */
350358 !=current_block * BLOCK_SIZE)
351359 die("seek failed during testing for blocks");
352360
398406 try = TEST_BUFFER_BLOCKS;
399407 while (currently_testing < blocks) {
400408 if (currently_testing + try > blocks)
401 try = blocks - currently_testing;
409 try = blocks - currently_testing; /* TODO: check overflow */
402410 got = do_check(blkbuf, try, currently_testing);
403411 currently_testing += got;
404412 if (got == try) {
426434 {
427435 int i;
428436 FILE *listfile;
429 long blockno;
437 long long blockno;
430438 char *line = NULL;
431439 size_t linesize = 0;
432440 int lineno = 0;
448456 }
449457
450458 errno = 0;
451 blockno = strtol(line, &end, 10);
452
453 if (errno) {
459 blockno = strtoll(line, &end, 10);
460
461 if (errno || blockno < 0) {
454462 fprintf(stderr,
455463 "While converting bad block number in line %d: %s\n",
456464 lineno, strerror(errno));
475483
476484 /* Mark all of the sectors in the block as bad */
477485 for (i = 0; i < SECTORS_PER_BLOCK; i++) {
478 unsigned long sector = blockno * SECTORS_PER_BLOCK + i;
486 unsigned long long sector = blockno * SECTORS_PER_BLOCK + i;
479487
480488 if (sector < start_data_sector) {
481 fprintf(stderr, "Block number %ld is before data area\n",
489 fprintf(stderr, "Block number %lld is before data area\n",
482490 blockno);
483491 die("Error in bad blocks file");
484492 }
485493
486494 if (sector >= num_sectors) {
487 fprintf(stderr, "Block number %ld is behind end of filesystem\n",
495 fprintf(stderr, "Block number %lld is behind end of filesystem\n",
488496 blockno);
489497 die("Error in bad blocks file");
490498 }
505513 static void check_mount(char *device_name)
506514 {
507515 if (is_device_mounted(device_name))
508 die("%s contains a mounted filesystem.");
516 die("%s contains a mounted filesystem.", device_name);
509517 }
510518
511519 /* Establish the geometry and media parameters for the device */
512520
513521 static void establish_params(struct device_info *info)
514522 {
515 unsigned int sec_per_track = 63;
516 unsigned int heads = 255;
523 unsigned int sec_per_track;
524 unsigned int heads;
517525 unsigned int media = 0xf8;
518526 unsigned int cluster_size = 4; /* starting point for FAT12 and FAT16 */
519527 int def_root_dir_entries = 512;
520528
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 if (info->geom_heads > 0) {
530 heads = info->geom_heads;
531 sec_per_track = info->geom_sectors;
532 } else {
533 unsigned long long int total_sectors;
534
535 if (info->geom_size > 0)
536 total_sectors = info->geom_size;
537 else if (info->sector_size > 0)
538 total_sectors = info->size / info->sector_size;
539 else
540 total_sectors = info->size / sector_size;
541
542 if (total_sectors <= 524288) {
543 /* For capacity below the 256MB (with 512b sectors) use CHS Recommendation from SD Card Part 2 File System Specification */
544 heads = total_sectors <= 32768 ? 2 :
545 total_sectors <= 65536 ? 4 :
546 total_sectors <= 262144 ? 8 : 16;
547 sec_per_track = total_sectors <= 4096 ? 16 : 32;
548 } else {
549 /* Use LBA-Assist Translation for calculating CHS when disk geometry is not available */
550 heads = total_sectors <= 16*63*1024 ? 16 :
551 total_sectors <= 32*63*1024 ? 32 :
552 total_sectors <= 64*63*1024 ? 64 :
553 total_sectors <= 128*63*1024 ? 128 : 255;
554 sec_per_track = 63;
555 }
529556 }
530557
531558 if (info->type != TYPE_FIXED) {
587614 * fs size <= 16G: 8k clusters
588615 * fs size <= 32G: 16k clusters
589616 * fs size > 32G: 32k clusters
590 *
591 * This only works correctly for 512 byte sectors!
592617 */
593 uint32_t sz_mb = info->size / (1024 * 1024);
594 cluster_size =
595 sz_mb > 32 * 1024 ? 64 : sz_mb > 16 * 1024 ? 32 : sz_mb >
596 8 * 1024 ? 16 : sz_mb > 260 ? 8 : 1;
597 }
598
599 if (info->geom_heads > 0) {
600 heads = info->geom_heads;
601 sec_per_track = info->geom_sectors;
602 }
603
604 if (!hidden_sectors_by_user && info->geom_start >= 0)
605 hidden_sectors = htole32(info->geom_start);
618 unsigned long long int sectors = info->size / sector_size;
619 cluster_size = sectors > 32*1024*1024*2 ? 64 :
620 sectors > 16*1024*1024*2 ? 32 :
621 sectors > 8*1024*1024*2 ? 16 :
622 sectors > 260*1024*2 ? 8 : 1;
623 }
624
625 if (!hidden_sectors_by_user && info->geom_start >= 0 && info->geom_start + part_sector <= UINT32_MAX)
626 hidden_sectors = info->geom_start + part_sector;
606627
607628 if (!root_dir_entries)
608629 root_dir_entries = def_root_dir_entries;
609630
610 bs.secs_track = htole16(sec_per_track);
611 bs.heads = htole16(heads);
631 if (!bs.secs_track)
632 bs.secs_track = htole16(sec_per_track);
633 if (!bs.heads)
634 bs.heads = htole16(heads);
612635 bs.media = media;
613636 bs.cluster_size = cluster_size;
614637 }
633656 struct tm *ctime;
634657 struct msdos_volume_info *vi =
635658 (size_fat == 32 ? &bs.fat32.vi : &bs.oldfat.vi);
659 char label[12] = { 0 };
660 size_t len;
661 int ret;
662 int i;
636663
637664 if (atari_format) {
638665 /* On Atari, the first few bytes of the boot sector are assigned
659686 if (size_fat == 32) {
660687 /* Under FAT32, the root dir is in a cluster chain, and this is
661688 * signalled by bs.dir_entries being 0. */
689 if (root_dir_entries_set)
690 fprintf(stderr, "Warning: root directory entries specified with -r have no effect on FAT32\n");
662691 root_dir_entries = 0;
663692 }
664693
673702 vi->volume_id[3] = (unsigned char)(volume_id >> 24);
674703 }
675704
705 len = mbstowcs(NULL, volume_name, 0);
706 if (len != (size_t)-1 && len > 11)
707 die("Label can be no longer than 11 characters");
708
709 if (!local_string_to_dos_string(label, volume_name, 12))
710 die("Error when processing label");
711
712 for (i = strlen(label); i < 11; ++i)
713 label[i] = ' ';
714 label[11] = 0;
715
716 if (memcmp(label, " ", MSDOS_NAME) == 0)
717 memcpy(label, NO_NAME, MSDOS_NAME);
718
719 ret = validate_volume_label(label);
720 if (ret & 0x1)
721 fprintf(stderr,
722 "mkfs.fat: Warning: lowercase labels might not work properly on some systems\n");
723 if (ret & 0x2)
724 die("Labels with characters below 0x20 are not allowed\n");
725 if (ret & 0x4)
726 die("Labels with characters *?.,;:/\\|+=<>[]\" are not allowed\n");
727 if (ret & 0x10)
728 die("Label can't start with a space character");
729
676730 if (!atari_format) {
677 memcpy(vi->volume_label, volume_name, 11);
731 memcpy(vi->volume_label, label, 11);
678732
679733 memcpy(bs.boot_jump, dummy_boot_jump, 3);
680734 /* Patch in the correct offset to the boot code */
726780 UINT32_MAX) {
727781 printf("Warning: target too large, space at end will be left unused\n");
728782 num_sectors = UINT32_MAX;
729 blocks = (uint64_t)UINT32_MAX * sector_size / BLOCK_SIZE;
783 blocks = (unsigned long long)UINT32_MAX * sector_size / BLOCK_SIZE;
730784 } else {
731785 num_sectors =
732786 (long long)(blocks * BLOCK_SIZE / sector_size) + orphaned_sectors;
787 }
788
789 if (align_structures) {
790 /* Align number of sectors to be multiple of sectors per track, needed by DOS and mtools */
791 num_sectors = num_sectors / le16toh(bs.secs_track) * le16toh(bs.secs_track);
733792 }
734793
735794 if (!atari_format) {
780839 maxclust12 = (fatlength12 * 2 * sector_size) / 3;
781840 if (maxclust12 > MAX_CLUST_12)
782841 maxclust12 = MAX_CLUST_12;
783 if (verbose >= 2)
784 printf("FAT12: #clu=%u, fatlen=%u, maxclu=%u, limit=%u\n",
842 if (verbose >= 2 && (size_fat == 0 || size_fat == 12))
843 printf("Trying FAT12: #clu=%u, fatlen=%u, maxclu=%u, limit=%u\n",
785844 clust12, fatlength12, maxclust12, MAX_CLUST_12);
786 if (clust12 > maxclust12 - 2) {
845 if (clust12 > maxclust12) {
787846 clust12 = 0;
788 if (verbose >= 2)
789 printf("FAT12: too much clusters\n");
847 if (verbose >= 2 && (size_fat == 0 || size_fat == 12))
848 printf("Trying FAT12: too much clusters\n");
790849 }
791850
792851 clust16 = ((long long)fatdata1216 * sector_size + nr_fats * 4) /
800859 maxclust16 = (fatlength16 * sector_size) / 2;
801860 if (maxclust16 > MAX_CLUST_16)
802861 maxclust16 = MAX_CLUST_16;
803 if (verbose >= 2)
804 printf("FAT16: #clu=%u, fatlen=%u, maxclu=%u, limit=%u\n",
805 clust16, fatlength16, maxclust16, MAX_CLUST_16);
806 if (clust16 > maxclust16 - 2) {
807 if (verbose >= 2)
808 printf("FAT16: too much clusters\n");
862 if (verbose >= 2 && (size_fat == 0 || size_fat == 16))
863 printf("Trying FAT16: #clu=%u, fatlen=%u, maxclu=%u, limit=%u/%u\n",
864 clust16, fatlength16, maxclust16, MIN_CLUST_16, MAX_CLUST_16);
865 if (clust16 > maxclust16) {
866 if (verbose >= 2 && (size_fat == 0 || size_fat == 16))
867 printf("Trying FAT16: too much clusters\n");
809868 clust16 = 0;
810869 }
811 /* The < 4078 avoids that the filesystem will be misdetected as having a
870 /* This avoids that the filesystem will be misdetected as having a
812871 * 12 bit FAT. */
813 if (clust16 < FAT12_THRESHOLD
814 && !(size_fat_by_user && size_fat == 16)) {
815 if (verbose >= 2)
816 printf("FAT16: would be misdetected as FAT12\n");
872 if (clust16 && clust16 < MIN_CLUST_16) {
873 if (verbose >= 2 && (size_fat == 0 || size_fat == 16))
874 printf("Trying FAT16: not enough clusters, would be misdetected as FAT12\n");
817875 clust16 = 0;
818876 }
819877
828886 maxclust32 = (fatlength32 * sector_size) / 4;
829887 if (maxclust32 > MAX_CLUST_32)
830888 maxclust32 = MAX_CLUST_32;
889 if (verbose >= 2 && (size_fat == 0 || size_fat == 32))
890 printf("Trying FAT32: #clu=%u, fatlen=%u, maxclu=%u, limit=%u/%u\n",
891 clust32, fatlength32, maxclust32, MIN_CLUST_32, MAX_CLUST_32);
892 if (clust32 > maxclust32) {
893 if (verbose >= 2 && (size_fat == 0 || size_fat == 32))
894 printf("Trying FAT32: too much clusters\n");
895 clust32 = 0;
896 }
897 /* When explicitely asked, allow to create FAT32 with less then MIN_CLUST_32 */
831898 if (clust32 && clust32 < MIN_CLUST_32
832899 && !(size_fat_by_user && size_fat == 32)) {
900 if (verbose >= 2 && (size_fat == 0 || size_fat == 32))
901 printf("Trying FAT32: not enough clusters\n");
833902 clust32 = 0;
834 if (verbose >= 2)
835 printf("FAT32: not enough clusters (%d)\n", MIN_CLUST_32);
836 }
837 if (verbose >= 2)
838 printf("FAT32: #clu=%u, fatlen=%u, maxclu=%u, limit=%u\n",
839 clust32, fatlength32, maxclust32, MAX_CLUST_32);
840 if (clust32 > maxclust32) {
841 clust32 = 0;
842 if (verbose >= 2)
843 printf("FAT32: too much clusters\n");
844903 }
845904
846905 if ((clust12 && (size_fat == 0 || size_fat == 12)) ||
852911 } while (bs.cluster_size && bs.cluster_size <= maxclustsize);
853912
854913 /* Use the optimal FAT size if not specified;
855 * FAT32 is (not yet) choosen automatically */
914 * establish_params() will have already set size_fat to 32 if it is not
915 * specified and the filesystem size is over a specific threshold */
856916 if (!size_fat) {
857917 size_fat = (clust16 > clust12) ? 16 : 12;
858918 if (verbose >= 2)
868928 break;
869929
870930 case 16:
871 if (clust16 < FAT12_THRESHOLD) {
872 if (size_fat_by_user) {
873 fprintf(stderr, "WARNING: Not enough clusters for a "
874 "16 bit FAT! The filesystem will be\n"
875 "misinterpreted as having a 12 bit FAT without "
876 "mount option \"fat=16\".\n");
877 } else {
878 fprintf(stderr, "This filesystem has an unfortunate size. "
879 "A 12 bit FAT cannot provide\n"
880 "enough clusters, but a 16 bit FAT takes up a little "
881 "bit more space so that\n"
882 "the total number of clusters becomes less than the "
883 "threshold value for\n"
884 "distinction between 12 and 16 bit FATs.\n");
885 die("Make the filesystem a bit smaller manually.");
886 }
887 }
888931 cluster_count = clust16;
889932 fat_length = fatlength16;
890933 bs.fat_length = htole16(fatlength16);
893936
894937 case 32:
895938 if (clust32 < MIN_CLUST_32)
896 fprintf(stderr,
897 "WARNING: Not enough clusters for a 32 bit FAT!\n");
939 fprintf(stderr, "WARNING: Number of clusters for 32 bit FAT is less then suggested minimum.\n");
898940 cluster_count = clust32;
899941 fat_length = fatlength32;
900942 bs.fat_length = htole16(0);
9991041 }
10001042 }
10011043
1044 if (fill_mbr_partition) {
1045 uint8_t *partition;
1046 uint8_t *disk_sig_ptr;
1047 uint32_t disk_sig;
1048 uint8_t buf[512];
1049 int fd;
1050
1051 if (verbose)
1052 printf("Adding MBR table\n");
1053
1054 if (size_fat == 32)
1055 disk_sig_ptr = bs.fat32.boot_code + BOOTCODE_FAT32_SIZE - 16*4 - 6;
1056 else
1057 disk_sig_ptr = bs.oldfat.boot_code + BOOTCODE_SIZE - 16*4 - 6;
1058
1059 if (*(disk_sig_ptr-1)) {
1060 printf("Warning: message too long; truncated\n");
1061 *(disk_sig_ptr-1) = 0;
1062 }
1063
1064 disk_sig = 0;
1065 memset(disk_sig_ptr, 0, 16*4 + 6);
1066
1067 /* Try to read existing 32 bit disk signature */
1068 fd = open(device_name, O_RDONLY);
1069 if (fd >= 0) {
1070 if (read(fd, buf, sizeof(buf)) == sizeof(buf) && buf[510] == 0x55 && buf[511] == 0xAA)
1071 disk_sig = (uint32_t)buf[440] | ((uint32_t)buf[441] << 8) | ((uint32_t)buf[442] << 16) | ((uint32_t)buf[443] << 24);
1072 close(fd);
1073 }
1074
1075 /* If is not available then generate random 32 bit disk signature */
1076 if (invariant)
1077 disk_sig = volume_id;
1078 else if (!disk_sig)
1079 disk_sig = generate_volume_id();
1080
1081 disk_sig_ptr[0] = (disk_sig >> 0) & 0xFF;
1082 disk_sig_ptr[1] = (disk_sig >> 8) & 0xFF;
1083 disk_sig_ptr[2] = (disk_sig >> 16) & 0xFF;
1084 disk_sig_ptr[3] = (disk_sig >> 24) & 0xFF;
1085
1086 partition = disk_sig_ptr + 6;
1087
1088 /* Active flag */
1089 partition[0] = 0x80;
1090
1091 /* CHS address of the first sector */
1092 partition[1] = 0;
1093 partition[2] = 1;
1094 partition[3] = 0;
1095
1096 /* Partition type */
1097 if (le16toh(bs.heads) > 254 || le16toh(bs.secs_track) > 63) { /* CHS values are out of range for MBR, use LBA */
1098 if (size_fat != 32)
1099 partition[4] = 0x0E; /* BIG FAT16 (LBA) */
1100 else
1101 partition[4] = 0x0C; /* FAT32 (LBA) */
1102 } else if (size_fat == 12 && num_sectors < 65536)
1103 partition[4] = 0x01; /* FAT12 (CHS) */
1104 else if (size_fat == 16 && num_sectors < 65536)
1105 partition[4] = 0x04; /* FAT16 (CHS) */
1106 else if (size_fat != 32 && num_sectors < le16toh(bs.secs_track) * le16toh(bs.heads) * 1024)
1107 partition[4] = 0x06; /* BIG FAT16 or FAT12 (CHS) */
1108 else if (size_fat != 32)
1109 partition[4] = 0x0E; /* BIG FAT16 (LBA) */
1110 else
1111 partition[4] = 0x0C; /* FAT32 (LBA) */
1112
1113 /* CHS address of the last sector */
1114 if (le16toh(bs.heads) > 254 || le16toh(bs.secs_track) > 63 || num_sectors >= le16toh(bs.secs_track) * le16toh(bs.heads) * 1024) {
1115 /* If CHS address is too large use tuple (1023, 254, 63) */
1116 partition[5] = 254;
1117 partition[6] = 255;
1118 partition[7] = 255;
1119 } else {
1120 partition[5] = (num_sectors / le16toh(bs.secs_track)) % le16toh(bs.heads);
1121 partition[6] = ((1 + num_sectors % le16toh(bs.secs_track)) & 63) | (((num_sectors / (le16toh(bs.heads) * le16toh(bs.secs_track))) >> 8) * 64);
1122 partition[7] = (num_sectors / (le16toh(bs.heads) * le16toh(bs.secs_track))) & 255;
1123 }
1124
1125 /* LBA of the first sector */
1126 partition[ 8] = 0;
1127 partition[ 9] = 0;
1128 partition[10] = 0;
1129 partition[11] = 0;
1130
1131 /* Number of sectors */
1132 partition[12] = (num_sectors >> 0) & 0xFF;
1133 partition[13] = (num_sectors >> 8) & 0xFF;
1134 partition[14] = (num_sectors >> 16) & 0xFF;
1135 partition[15] = (num_sectors >> 24) & 0xFF;
1136 }
1137
10021138 bs.sector_size[0] = (char)(sector_size & 0x00ff);
10031139 bs.sector_size[1] = (char)((sector_size & 0xff00) >> 8);
10041140
10111147 bs.fat32.version[0] = 0;
10121148 bs.fat32.version[1] = 0;
10131149 bs.fat32.root_cluster = htole32(2);
1014 bs.fat32.info_sector = htole16(1);
1015 if (!backup_boot)
1016 backup_boot = (reserved_sectors >= 7) ? 6 :
1017 (reserved_sectors >= 2) ? reserved_sectors - 1 : 0;
1018 else {
1019 if (backup_boot == 1)
1020 die("Backup boot sector must be after sector 1");
1150 if (!info_sector)
1151 info_sector = 1;
1152 bs.fat32.info_sector = htole16(info_sector);
1153 if (!backup_boot_set)
1154 backup_boot = (reserved_sectors >= 7 && info_sector != 6) ? 6 :
1155 (reserved_sectors >= 3 + info_sector &&
1156 info_sector != reserved_sectors - 2 &&
1157 info_sector != reserved_sectors - 1) ? reserved_sectors - 2 :
1158 (reserved_sectors >= 3 && info_sector != reserved_sectors - 1) ?
1159 reserved_sectors - 1 : 0;
1160 if (backup_boot) {
1161 if (backup_boot == info_sector)
1162 die("Backup boot sector must not be same as info sector (%d)", info_sector);
10211163 else if (backup_boot >= reserved_sectors)
10221164 die("Backup boot sector must be a reserved sector");
10231165 }
10521194
10531195 if (!cluster_count) {
10541196 if (sectors_per_cluster) /* If yes, die if we'd spec'd sectors per cluster */
1055 die("Too many clusters for filesystem - try more sectors per cluster");
1197 die("Not enough or too many clusters for filesystem - try less or more sectors per cluster");
10561198 else
1057 die("Attempting to create a too large filesystem");
1199 die("Attempting to create a too small or a too large filesystem");
10581200 }
10591201 fat_entries = cluster_count + 2;
10601202
10751217 (le16toh(bs.secs_track) != 1) ? "s" : "");
10761218 printf("hidden sectors 0x%04x;\n", hidden_sectors);
10771219 printf("logical sector size is %d,\n", sector_size);
1078 printf("using 0x%02x media descriptor, with %d sectors;\n",
1079 (int)(bs.media), num_sectors);
1220 printf("using 0x%02x media descriptor, with %u sectors;\n",
1221 (int)(bs.media), (unsigned)num_sectors);
10801222 printf("drive number 0x%02x;\n", (int) (vi->drive_number));
10811223 printf("filesystem has %d %d-bit FAT%s and %d sector%s per cluster.\n",
10821224 (int)(bs.fats), size_fat, (bs.fats != 1) ? "s" : "",
10981240 }
10991241 printf("Volume ID is %08lx, ", volume_id &
11001242 (atari_format ? 0x00ffffff : 0xffffffff));
1101 if (strcmp(volume_name, NO_NAME))
1243 if (memcmp(label, NO_NAME, MSDOS_NAME))
11021244 printf("volume label %s.\n", volume_name);
11031245 else
11041246 printf("no volume label.\n");
11371279 }
11381280
11391281 memset(root_dir, 0, size_root_dir);
1140 if (memcmp(volume_name, NO_NAME, MSDOS_NAME)) {
1282 if (memcmp(label, NO_NAME, MSDOS_NAME)) {
11411283 struct msdos_dir_entry *de = &root_dir[0];
1142 memcpy(de->name, volume_name, MSDOS_NAME);
1284 memcpy(de->name, label, MSDOS_NAME);
1285 if (de->name[0] == 0xe5)
1286 de->name[0] = 0x05;
11431287 de->attr = ATTR_VOLUME;
1144 if (!invariant)
1288 if (create_time != (time_t)-1) {
1289 if (!invariant)
11451290 ctime = localtime(&create_time);
1146 else
1291 else
11471292 ctime = gmtime(&create_time);
1148 de->time = htole16((unsigned short)((ctime->tm_sec >> 1) +
1149 (ctime->tm_min << 5) +
1150 (ctime->tm_hour << 11)));
1151 de->date =
1152 htole16((unsigned short)(ctime->tm_mday +
1153 ((ctime->tm_mon + 1) << 5) +
1154 ((ctime->tm_year - 80) << 9)));
1293 } else {
1294 ctime = NULL;
1295 }
1296 if (ctime && ctime->tm_year >= 80 && ctime->tm_year <= 207) {
1297 de->time = htole16((unsigned short)((ctime->tm_sec >> 1) +
1298 (ctime->tm_min << 5) +
1299 (ctime->tm_hour << 11)));
1300 de->date = htole16((unsigned short)(ctime->tm_mday +
1301 ((ctime->tm_mon + 1) << 5) +
1302 ((ctime->tm_year - 80) << 9)));
1303 } else {
1304 /* fallback to 1.1.1980 00:00:00 */
1305 de->time = htole16(0);
1306 de->date = htole16(1 + (1 << 5));
1307 }
11551308 de->ctime_cs = 0;
11561309 de->ctime = de->time;
11571310 de->cdate = de->date;
11651318 /* For FAT32, create an info sector */
11661319 struct fat32_fsinfo *info;
11671320
1168 if (!(info_sector = malloc(sector_size)))
1321 if (!(info_sector_buffer = malloc(sector_size)))
11691322 die("Out of memory");
1170 memset(info_sector, 0, sector_size);
1323 memset(info_sector_buffer, 0, sector_size);
11711324 /* fsinfo structure is at offset 0x1e0 in info sector by observation */
1172 info = (struct fat32_fsinfo *)(info_sector + 0x1e0);
1325 info = (struct fat32_fsinfo *)(info_sector_buffer + 0x1e0);
11731326
11741327 /* Info sector magic */
1175 info_sector[0] = 'R';
1176 info_sector[1] = 'R';
1177 info_sector[2] = 'a';
1178 info_sector[3] = 'A';
1328 info_sector_buffer[0] = 'R';
1329 info_sector_buffer[1] = 'R';
1330 info_sector_buffer[2] = 'a';
1331 info_sector_buffer[3] = 'A';
11791332
11801333 /* Magic for fsinfo structure */
11811334 info->signature = htole32(0x61417272);
11841337 info->next_cluster = htole32(2);
11851338
11861339 /* Info sector also must have boot sign */
1187 *(uint16_t *) (info_sector + 0x1fe) = htole16(BOOT_SIGN);
1340 *(uint16_t *) (info_sector_buffer + 0x1fe) = htole16(BOOT_SIGN);
11881341 }
11891342
11901343 if (!(blank_sector = malloc(sector_size)))
11971350 #define error(str) \
11981351 do { \
11991352 free (fat); \
1200 if (info_sector) free (info_sector); \
1353 free (info_sector_buffer); \
12011354 free (root_dir); \
12021355 die (str); \
12031356 } while(0)
12051358 #define seekto(pos,errstr) \
12061359 do { \
12071360 off_t __pos = (pos); \
1208 if (lseek (dev, __pos, SEEK_SET) != __pos) \
1361 if (lseek (dev, part_sector * sector_size + __pos, SEEK_SET) != part_sector * sector_size + __pos) \
12091362 error ("seek to " errstr " failed whilst writing tables"); \
12101363 } while(0)
12111364
12341387 /* on FAT32, write the info sector and backup boot sector */
12351388 if (size_fat == 32) {
12361389 seekto(le16toh(bs.fat32.info_sector) * sector_size, "info sector");
1237 writebuf(info_sector, 512, "info sector");
1390 writebuf(info_sector_buffer, 512, "info sector");
12381391 if (backup_boot != 0) {
12391392 seekto(backup_boot * sector_size, "backup boot sector");
12401393 writebuf((char *)&bs, sizeof(struct msdos_boot_sector),
12411394 "backup boot sector");
1395 if (backup_boot + le16toh(bs.fat32.info_sector) != le16toh(bs.fat32.info_sector) &&
1396 backup_boot + le16toh(bs.fat32.info_sector) < reserved_sectors) {
1397 seekto((backup_boot + le16toh(bs.fat32.info_sector)) * sector_size, "backup info sector");
1398 writebuf(info_sector_buffer, 512, "backup info sector");
1399 }
12421400 }
12431401 }
12441402 /* seek to start of FATS and write them all */
12561414
12571415 if (blank_sector)
12581416 free(blank_sector);
1259 if (info_sector)
1260 free(info_sector);
1417 free(info_sector_buffer);
12611418 free(root_dir); /* Free up the root directory space from setup_tables */
12621419 free(fat); /* Free up the fat table space reserved during setup_tables */
12631420 }
12641421
12651422 /* Report the command usage and exit with the given error code */
12661423
1267 static void usage(int exitval)
1424 static void usage(const char *name, int exitval)
12681425 {
1269 fprintf(stderr, "\
1270 Usage: mkfs.fat [-a][-A][-c][-C][-v][-I][-l bad-block-file][-b backup-boot-sector]\n\
1271 [-m boot-msg-file][-n volume-name][-i volume-id]\n\
1272 [-s sectors-per-cluster][-S logical-sector-size][-f number-of-FATs]\n\
1273 [-h hidden-sectors][-F fat-size][-r root-dir-entries][-R reserved-sectors]\n\
1274 [-M FAT-media-byte][-D drive_number]\n\
1275 [--invariant]\n\
1276 [--help]\n\
1277 /dev/name [blocks]\n");
1426 fprintf(stderr, "Usage: %s [OPTIONS] TARGET [BLOCKS]\n", name);
1427 fprintf(stderr, "Create FAT filesystem in TARGET, which can be a block device or file. Use only\n");
1428 fprintf(stderr, "up to BLOCKS 1024 byte blocks if specified. With the -C option, file TARGET will be\n");
1429 fprintf(stderr, "created with a size of 1024 bytes times BLOCKS, which must be specified.\n");
1430 fprintf(stderr, "\n");
1431 fprintf(stderr, "Options:\n");
1432 fprintf(stderr, " -a Disable alignment of data structures\n");
1433 fprintf(stderr, " -A Toggle Atari variant of the filesystem\n");
1434 fprintf(stderr, " -b SECTOR Select SECTOR as location of the FAT32 backup boot sector\n");
1435 fprintf(stderr, " -c Check device for bad blocks before creating the filesystem\n");
1436 fprintf(stderr, " -C Create file TARGET then create filesystem in it\n");
1437 fprintf(stderr, " -D NUMBER Write BIOS drive number NUMBER to boot sector\n");
1438 fprintf(stderr, " -f COUNT Create COUNT file allocation tables\n");
1439 fprintf(stderr, " -F SIZE Select FAT size SIZE (12, 16 or 32)\n");
1440 fprintf(stderr, " -g GEOM Select disk geometry: heads/sectors_per_track\n");
1441 fprintf(stderr, " -h NUMBER Write hidden sectors NUMBER to boot sector\n");
1442 fprintf(stderr, " -i VOLID Set volume ID to VOLID (a 32 bit hexadecimal number)\n");
1443 fprintf(stderr, " -I Ignore and disable safety checks\n");
1444 fprintf(stderr, " -l FILENAME Read bad blocks list from FILENAME\n");
1445 fprintf(stderr, " -m FILENAME Replace default error message in boot block with contents of FILENAME\n");
1446 fprintf(stderr, " -M TYPE Set media type in boot sector to TYPE\n");
1447 fprintf(stderr, " --mbr[=y|n|a] Fill (fake) MBR table with one partition which spans whole disk\n");
1448 fprintf(stderr, " -n LABEL Set volume name to LABEL (up to 11 characters long)\n");
1449 fprintf(stderr, " --codepage=N use DOS codepage N to encode label (default: %d)\n", DEFAULT_DOS_CODEPAGE);
1450 fprintf(stderr, " -r COUNT Make room for at least COUNT entries in the root directory\n");
1451 fprintf(stderr, " -R COUNT Set minimal number of reserved sectors to COUNT\n");
1452 fprintf(stderr, " -s COUNT Set number of sectors per cluster to COUNT\n");
1453 fprintf(stderr, " -S SIZE Select a sector size of SIZE (a power of two, at least 512)\n");
1454 fprintf(stderr, " -v Verbose execution\n");
1455 fprintf(stderr, " --variant=TYPE Select variant TYPE of filesystem (standard or Atari)\n");
1456 fprintf(stderr, "\n");
1457 fprintf(stderr, " --invariant Use constants for randomly generated or time based values\n");
1458 fprintf(stderr, " --offset=SECTOR Write the filesystem at a specific sector into the device file.\n");
1459 fprintf(stderr, " --help Show this help message and exit\n");
12781460 exit(exitval);
1279 }
1280
1281 /*
1282 * ++roman: On m68k, check if this is an Atari; if yes, turn on Atari variant
1283 * of MS-DOS filesystem by default.
1284 */
1285 static void check_atari(void)
1286 {
1287 #ifdef __mc68000__
1288 FILE *f;
1289 char line[128], *p;
1290
1291 if (!(f = fopen("/proc/hardware", "r"))) {
1292 perror("/proc/hardware");
1293 return;
1294 }
1295
1296 while (fgets(line, sizeof(line), f)) {
1297 if (strncmp(line, "Model:", 6) == 0) {
1298 p = line + 6;
1299 p += strspn(p, " \t");
1300 if (strncmp(p, "Atari ", 6) == 0)
1301 atari_format = 1;
1302 break;
1303 }
1304 }
1305 fclose(f);
1306 #endif
13071461 }
13081462
13091463 /* The "main" entry point into the utility - we pick up the options and attempt to process them in some sort of sensible
13181472 struct device_info devinfo;
13191473 int i = 0, pos, ch;
13201474 int create = 0;
1321 uint64_t cblocks = 0;
1475 unsigned long long cblocks = 0;
13221476 int blocks_specified = 0;
13231477 struct timeval create_timeval;
1324
1325 enum {OPT_HELP=1000, OPT_INVARIANT,};
1478 long long conversion;
1479
1480 enum {OPT_HELP=1000, OPT_INVARIANT, OPT_MBR, OPT_VARIANT, OPT_CODEPAGE, OPT_OFFSET};
13261481 const struct option long_options[] = {
1327 {"help", no_argument, NULL, OPT_HELP},
1328 {"invariant", no_argument, NULL, OPT_INVARIANT},
1482 {"codepage", required_argument, NULL, OPT_CODEPAGE},
1483 {"invariant", no_argument, NULL, OPT_INVARIANT},
1484 {"mbr", optional_argument, NULL, OPT_MBR},
1485 {"variant", required_argument, NULL, OPT_VARIANT},
1486 {"offset", required_argument, NULL, OPT_OFFSET},
1487 {"help", no_argument, NULL, OPT_HELP},
13291488 {0,}
13301489 };
13311490
1491 program_name = "mkfs.fat";
13321492 if (argc && *argv) { /* What's the program name? */
13331493 char *p;
13341494 program_name = *argv;
13361496 program_name = p + 1;
13371497 }
13381498
1339 gettimeofday(&create_timeval, NULL);
1340 create_time = create_timeval.tv_sec;
1341 volume_id = (uint32_t) ((create_timeval.tv_sec << 20) | create_timeval.tv_usec); /* Default volume ID = creation time, fudged for more uniqueness */
1499 if (gettimeofday(&create_timeval, NULL) == 0 && create_timeval.tv_sec != (time_t)-1)
1500 create_time = create_timeval.tv_sec;
1501 volume_id = generate_volume_id();
13421502 check_atari();
13431503
13441504 printf("mkfs.fat " VERSION " (" VERSION_DATE ")\n");
13451505
1346 while ((c = getopt_long(argc, argv, "aAb:cCf:D:F:Ii:l:m:M:n:r:R:s:S:h:v",
1506 while ((c = getopt_long(argc, argv, "aAb:cCf:D:F:g:Ii:l:m:M:n:r:R:s:S:h:v",
13471507 long_options, NULL)) != -1)
13481508 /* Scan the command line for options */
13491509 switch (c) {
13561516 break;
13571517
13581518 case 'b': /* b : location of backup boot sector */
1359 backup_boot = (int)strtol(optarg, &tmp, 0);
1360 if (*tmp || backup_boot < 2 || backup_boot > 0xffff) {
1519 errno = 0;
1520 conversion = strtol(optarg, &tmp, 0);
1521 if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 0 || conversion > 0xffff) {
13611522 printf("Bad location for backup boot sector : %s\n", optarg);
1362 usage(1);
1363 }
1523 usage(argv[0], 1);
1524 }
1525 backup_boot = conversion;
1526 backup_boot_set = 1;
13641527 break;
13651528
13661529 case 'c': /* c : Check FS as we build it */
13731536 break;
13741537
13751538 case 'D': /* D : Choose Drive Number */
1376 drive_number_option = (int) strtol (optarg, &tmp, 0);
1377 if (*tmp || (drive_number_option != 0 && drive_number_option != 0x80)) {
1378 printf ("Drive number must be 0 or 0x80: %s\n", optarg);
1379 usage(1);
1380 }
1539 errno = 0;
1540 conversion = strtol(optarg, &tmp, 0);
1541 if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 0x00 || conversion > 0xFF) {
1542 printf ("Bad drive number: %s\n", optarg);
1543 usage(argv[0], 1);
1544 }
1545 drive_number_option = conversion;
13811546 drive_number_by_user=1;
13821547 break;
13831548
13841549 case 'f': /* f : Choose number of FATs */
1385 nr_fats = (int)strtol(optarg, &tmp, 0);
1386 if (*tmp || nr_fats < 1 || nr_fats > 4) {
1550 errno = 0;
1551 conversion = strtol(optarg, &tmp, 0);
1552 if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 1 || conversion > 4) {
13871553 printf("Bad number of FATs : %s\n", optarg);
1388 usage(1);
1389 }
1554 usage(argv[0], 1);
1555 }
1556 nr_fats = conversion;
13901557 break;
13911558
13921559 case 'F': /* F : Choose FAT size */
1393 size_fat = (int)strtol(optarg, &tmp, 0);
1394 if (*tmp || (size_fat != 12 && size_fat != 16 && size_fat != 32)) {
1560 errno = 0;
1561 conversion = strtol(optarg, &tmp, 0);
1562 if (!*optarg || isspace(*optarg) || *tmp || errno || (conversion != 12 && conversion != 16 && conversion != 32)) {
13951563 printf("Bad FAT type : %s\n", optarg);
1396 usage(1);
1397 }
1564 usage(argv[0], 1);
1565 }
1566 size_fat = conversion;
13981567 size_fat_by_user = 1;
13991568 break;
14001569
1570 case 'g': /* g : geometry: heads and sectors per track */
1571 errno = 0;
1572 conversion = strtol(optarg, &tmp, 0);
1573 if (!*optarg || isspace(*optarg) || tmp[0] != '/' || !tmp[1] || isspace(tmp[1]) || errno || conversion <= 0 || conversion > UINT16_MAX) {
1574 printf("Bad format of geometry : %s\n", optarg);
1575 usage(argv[0], 1);
1576 }
1577 bs.heads = htole16(conversion);
1578 conversion = strtol(tmp+1, &tmp, 0);
1579 if (*tmp || errno || conversion <= 0 || conversion > UINT16_MAX) {
1580 printf("Bad format of geometry : %s\n", optarg);
1581 usage(argv[0], 1);
1582 }
1583 bs.secs_track = htole16(conversion);
1584 break;
1585
14011586 case 'h': /* h : number of hidden sectors */
1402 hidden_sectors = (int)strtol(optarg, &tmp, 0);
1403 if (*tmp || hidden_sectors < 0) {
1587 errno = 0;
1588 conversion = strtoll(optarg, &tmp, 0);
1589 if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 0 || conversion > UINT32_MAX) {
14041590 printf("Bad number of hidden sectors : %s\n", optarg);
1405 usage(1);
1406 }
1591 usage(argv[0], 1);
1592 }
1593 hidden_sectors = conversion;
14071594 hidden_sectors_by_user = 1;
14081595 break;
14091596
14101597 case 'I':
1411 ignore_full_disk = 1;
1598 ignore_safety_checks = 1;
14121599 break;
14131600
14141601 case 'i': /* i : specify volume ID */
1415 volume_id = strtoul(optarg, &tmp, 16);
1416 if (*tmp) {
1602 errno = 0;
1603 conversion = strtoll(optarg, &tmp, 16);
1604
1605 if (!*optarg || isspace(*optarg) || *tmp || conversion < 0) {
14171606 printf("Volume ID must be a hexadecimal number\n");
1418 usage(1);
1419 }
1607 usage(argv[0], 1);
1608 }
1609 if (conversion > UINT32_MAX) {
1610 printf("Volume ID does not fit in 32 bit\n");
1611 usage(argv[0], 1);
1612 }
1613 if (errno) {
1614 printf("Parsing volume ID failed (%s)\n", strerror(errno));
1615 usage(argv[0], 1);
1616 }
1617
1618 volume_id = conversion;
14201619 break;
14211620
14221621 case 'l': /* l : Bad block filename */
14851684 break;
14861685
14871686 case 'M': /* M : FAT Media byte */
1488 fat_media_byte = (int)strtol(optarg, &tmp, 0);
1489 if (*tmp) {
1687 errno = 0;
1688 conversion = strtol(optarg, &tmp, 0);
1689 if (!*optarg || isspace(*optarg) || *tmp || errno) {
14901690 printf("Bad number for media descriptor : %s\n", optarg);
1491 usage(1);
1492 }
1493 if (fat_media_byte != 0xf0 && (fat_media_byte < 0xf8 || fat_media_byte > 0xff)) {
1691 usage(argv[0], 1);
1692 }
1693 if (conversion != 0xf0 && (conversion < 0xf8 || conversion > 0xff)) {
14941694 printf("FAT Media byte must either be between 0xF8 and 0xFF or be 0xF0 : %s\n", optarg);
1495 usage(1);
1496 }
1695 usage(argv[0], 1);
1696 }
1697 fat_media_byte = conversion;
14971698 break;
14981699
14991700 case 'n': /* n : Volume name */
1500 sprintf(volume_name, "%-11.11s", optarg);
1501 for (i = 0; volume_name[i] && i < 11; i++)
1502 /* don't know if here should be more strict !uppercase(label[i]) */
1503 if (islower(volume_name[i])) {
1504 fprintf(stderr,
1505 "mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows\n");
1506 break;
1507 }
1508
1701 volume_name = optarg;
1702 break;
1703
1704 case OPT_CODEPAGE: /* --codepage : Code page */
1705 errno = 0;
1706 conversion = strtol(optarg, &tmp, 10);
1707 if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 0 || conversion > INT_MAX) {
1708 fprintf(stderr, "Invalid codepage : %s\n", optarg);
1709 usage(argv[0], 1);
1710 }
1711 if (!set_dos_codepage(conversion))
1712 usage(argv[0], 1);
15091713 break;
15101714
15111715 case 'r': /* r : Root directory entries */
1512 root_dir_entries = (int)strtol(optarg, &tmp, 0);
1513 if (*tmp || root_dir_entries < 16 || root_dir_entries > 32768) {
1716 errno = 0;
1717 conversion = strtol(optarg, &tmp, 0);
1718 if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 16 || conversion > 32768) {
15141719 printf("Bad number of root directory entries : %s\n", optarg);
1515 usage(1);
1516 }
1720 usage(argv[0], 1);
1721 }
1722 root_dir_entries = conversion;
1723 root_dir_entries_set = 1;
15171724 break;
15181725
15191726 case 'R': /* R : number of reserved sectors */
1520 reserved_sectors = (int)strtol(optarg, &tmp, 0);
1521 if (*tmp || reserved_sectors < 1 || reserved_sectors > 0xffff) {
1727 errno = 0;
1728 conversion = strtol(optarg, &tmp, 0);
1729 if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 1 || conversion > 0xffff) {
15221730 printf("Bad number of reserved sectors : %s\n", optarg);
1523 usage(1);
1524 }
1731 usage(argv[0], 1);
1732 }
1733 reserved_sectors = conversion;
15251734 break;
15261735
15271736 case 's': /* s : Sectors per cluster */
1528 sectors_per_cluster = (int)strtol(optarg, &tmp, 0);
1529 if (*tmp || (sectors_per_cluster != 1 && sectors_per_cluster != 2
1530 && sectors_per_cluster != 4 && sectors_per_cluster != 8
1531 && sectors_per_cluster != 16
1532 && sectors_per_cluster != 32
1533 && sectors_per_cluster != 64
1534 && sectors_per_cluster != 128)) {
1737 errno = 0;
1738 conversion = strtol(optarg, &tmp, 0);
1739 if (!*optarg || isspace(*optarg) || *tmp || errno || (conversion != 1 && conversion != 2
1740 && conversion != 4 && conversion != 8 && conversion != 16
1741 && conversion != 32 && conversion != 64 && conversion != 128)) {
15351742 printf("Bad number of sectors per cluster : %s\n", optarg);
1536 usage(1);
1537 }
1743 usage(argv[0], 1);
1744 }
1745 sectors_per_cluster = conversion;
15381746 break;
15391747
15401748 case 'S': /* S : Sector size */
1541 sector_size = (int)strtol(optarg, &tmp, 0);
1542 if (*tmp || (sector_size != 512 && sector_size != 1024 &&
1543 sector_size != 2048 && sector_size != 4096 &&
1544 sector_size != 8192 && sector_size != 16384 &&
1545 sector_size != 32768)) {
1749 errno = 0;
1750 conversion = strtol(optarg, &tmp, 0);
1751 if (!*optarg || isspace(*optarg) || *tmp || errno || (conversion != 512 && conversion != 1024 &&
1752 conversion != 2048 && conversion != 4096 && conversion != 8192 &&
1753 conversion != 16384 && conversion != 32768)) {
15461754 printf("Bad logical sector size : %s\n", optarg);
1547 usage(1);
1548 }
1755 usage(argv[0], 1);
1756 }
1757 sector_size = conversion;
15491758 sector_size_set = 1;
15501759 break;
15511760
15541763 break;
15551764
15561765 case OPT_HELP:
1557 usage(0);
1766 usage(argv[0], 0);
15581767 break;
15591768
15601769 case OPT_INVARIANT:
15631772 create_time = 1426325213;
15641773 break;
15651774
1775 case OPT_MBR:
1776 if (!optarg || !strcasecmp(optarg, "y") || !strcasecmp(optarg, "yes"))
1777 fill_mbr_partition = 1;
1778 else if (!strcasecmp(optarg, "n") || !strcasecmp(optarg, "no"))
1779 fill_mbr_partition = 0;
1780 else if (!strcasecmp(optarg, "a") || !strcasecmp(optarg, "auto"))
1781 fill_mbr_partition = -1;
1782 else {
1783 printf("Unknown option for --mbr: '%s'\n", optarg);
1784 usage(argv[0], 1);
1785 }
1786 break;
1787
1788 case OPT_VARIANT:
1789 if (!strcasecmp(optarg, "standard")) {
1790 atari_format = 0;
1791 } else if (!strcasecmp(optarg, "atari")) {
1792 atari_format = 1;
1793 } else {
1794 printf("Unknown variant: %s\n", optarg);
1795 usage(argv[0], 1);
1796 }
1797 break;
1798
1799 case OPT_OFFSET:
1800 errno = 0;
1801 conversion = strtoll(optarg, &tmp, 0);
1802 if (!*optarg || isspace(*optarg) || *tmp || errno) {
1803 printf("Bad number for offset : %s\n", optarg);
1804 usage(argv[0], 1);
1805 }
1806
1807 if (conversion < 0 || conversion > OFF_MAX) {
1808 printf("FAT offset must be between 0 and %lld: %s\n", (long long) OFF_MAX, optarg);
1809 usage(argv[0], 1);
1810 }
1811
1812 part_sector = (off_t) conversion;
1813 break;
1814
1815 case '?':
1816 usage(argv[0], 1);
1817 exit(1);
1818
15661819 default:
1567 printf("Unknown option: %c\n", c);
1568 usage(1);
1569 }
1820 fprintf(stderr,
1821 "Internal error: getopt_long() returned unexpected value %d\n", c);
1822 exit(2);
1823 }
1824
1825 if (!set_dos_codepage(-1)) /* set default codepage if none was given in command line */
1826 exit(1);
15701827
15711828 if (optind == argc || !argv[optind]) {
15721829 printf("No device specified.\n");
1573 usage(1);
1830 usage(argv[0], 1);
15741831 }
15751832
15761833 device_name = argv[optind++];
15771834
15781835 if (optind != argc) {
15791836 blocks_specified = 1;
1580 blocks = strtoull(argv[optind], &tmp, 0);
1581
1582 if (*tmp) {
1837 errno = 0;
1838 conversion = strtoll(argv[optind], &tmp, 0);
1839
1840 if (!*argv[optind] || isspace(*argv[optind]) || *tmp || errno || conversion < 0) {
15831841 printf("Bad block count : %s\n", argv[optind]);
1584 usage(1);
1585 }
1842 usage(argv[0], 1);
1843 }
1844 blocks = conversion;
15861845
15871846 optind++;
15881847 }
15891848
15901849 if (optind != argc) {
15911850 fprintf(stderr, "Excess arguments on command line\n");
1592 usage(1);
1851 usage(argv[0], 1);
15931852 }
15941853
15951854 if (create && !blocks_specified)
16111870 dev = open(device_name, O_EXCL | O_RDWR | O_CREAT, 0666);
16121871 if (dev < 0) {
16131872 if (errno == EEXIST)
1614 die("file %s already exists");
1873 die("file %s already exists", device_name);
16151874 else
1616 die("unable to create %s");
1875 die("unable to create %s", device_name);
16171876 }
16181877 /* expand to desired size */
1619 if (ftruncate(dev, blocks * BLOCK_SIZE))
1620 die("unable to resize %s");
1878 if (ftruncate(dev, part_sector * sector_size + blocks * BLOCK_SIZE)) /* TODO: check overflow */
1879 die("unable to resize %s", device_name);
16211880 }
16221881
16231882 if (get_device_info(dev, &devinfo) < 0)
1624 die("error collecting information about %s");
1883 die("error collecting information about %s", device_name);
16251884
16261885 if (devinfo.size <= 0)
1627 die("unable to discover size of %s");
1886 die("unable to discover size of %s", device_name);
16281887
16291888 if (devinfo.sector_size > 0) {
16301889 if (sector_size_set) {
16381897 sector_size = devinfo.sector_size;
16391898 sector_size_set = 1;
16401899 }
1900
1901 if (devinfo.size <= part_sector * sector_size)
1902 die("The device %s size %llu is less then the offset %llu",
1903 device_name, devinfo.size, (unsigned long long) part_sector * sector_size);
16411904 }
16421905
16431906 if (sector_size > 4096)
16451908 "Warning: sector size %d > 4096 is non-standard, filesystem may not be usable\n",
16461909 sector_size);
16471910
1648 cblocks = devinfo.size / BLOCK_SIZE;
1649 orphaned_sectors = (devinfo.size % BLOCK_SIZE) / sector_size;
1911 cblocks = (devinfo.size - part_sector * sector_size) / BLOCK_SIZE;
1912 orphaned_sectors = ((devinfo.size - part_sector * sector_size) % BLOCK_SIZE) / sector_size;
16501913
16511914 if (blocks_specified) {
16521915 if (blocks != cblocks) {
16531916 fprintf(stderr, "Warning: block count mismatch: ");
16541917 fprintf(stderr, "found %llu but assuming %llu.\n",
1655 (unsigned long long)cblocks, (unsigned long long)blocks);
1918 cblocks, blocks);
16561919 }
16571920 } else {
16581921 blocks = cblocks;
16611924 /*
16621925 * Ignore any 'full' fixed disk devices, if -I is not given.
16631926 */
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)");
1927 if (!ignore_safety_checks && devinfo.has_children > 0)
1928 die("Partitions or virtual mappings on device '%s', not making filesystem (use -I to override)",
1929 device_name);
1930
1931 /*
1932 * On non-removable fixed disk devices we need to create (fake) MBR partition
1933 * table so disk would be correctly recognized on MS Windows systems.
1934 */
1935 if (fill_mbr_partition == -1) {
1936 if (devinfo.type == TYPE_FIXED && devinfo.partition == 0)
1937 fill_mbr_partition = 1;
1938 else
1939 fill_mbr_partition = 0;
1940 }
16701941
16711942 establish_params(&devinfo);
16721943 /* Establish the media parameters */
16801951
16811952 write_tables(); /* Write the filesystem tables away! */
16821953
1954 /* Let's make sure to sync the block device. Otherwise, if we operate on a loop device and people issue
1955 * "losetup -d" right after this command finishes our in-flight writes might never hit the disk */
1956 if (fsync(dev) < 0)
1957 pdie("unable to synchronize %s", device_name);
1958
16831959 exit(0); /* Terminate with no errors! */
16841960 }
3131 return 1;
3232 }
3333
34 fd = open(argv[1], O_RDONLY);
34 fd = open(argv[1], O_RDONLY | O_NONBLOCK);
3535 if (fd < 0) {
3636 perror("open device");
3737 return 1;
4141 get_device_info(fd, &info);
4242 close(fd);
4343
44 printf("\nfound information:\n");
44 printf("found information:\n");
4545
4646 printf("device type: ");
4747 switch (info.type) {
106106 if (info.geom_start < 0)
107107 printf("unknown\n");
108108 else
109 printf("%ld\n", info.geom_start);
109 printf("%lld\n", info.geom_start);
110
111 printf("total disk sectors: ");
112 if (info.geom_size < 0)
113 printf("unknown\n");
114 else
115 printf("%lld\n", info.geom_size);
110116
111117 printf("sector size: ");
112118 if (info.sector_size < 0)
00 #! /bin/sh
11 # test-driver - basic testsuite driver script.
22
3 scriptversion=2013-07-13.22; # UTC
3 scriptversion=2018-03-07.03; # UTC
44
5 # Copyright (C) 2011-2014 Free Software Foundation, Inc.
5 # Copyright (C) 2011-2018 Free Software Foundation, Inc.
66 #
77 # This program is free software; you can redistribute it and/or modify
88 # it under the terms of the GNU General Public License as published by
1515 # GNU General Public License for more details.
1616 #
1717 # 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/>.
18 # along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
2020 # As a special exception to the GNU General Public License, if you
2121 # distribute this file as part of a program that contains a
139139 # Local Variables:
140140 # mode: shell-script
141141 # sh-indentation: 2
142 # eval: (add-hook 'write-file-hooks 'time-stamp)
142 # eval: (add-hook 'before-save-hook 'time-stamp)
143143 # time-stamp-start: "scriptversion="
144144 # time-stamp-format: "%:y-%02m-%02d.%02H"
145 # time-stamp-time-zone: "UTC"
145 # time-stamp-time-zone: "UTC0"
146146 # time-stamp-end: "; # UTC"
147147 # End:
66 TESTS = referenceFAT12.mkfs \
77 referenceFAT16.mkfs \
88 referenceFAT32.mkfs \
9 referenceFAT32mbr.mkfs \
10 mkfs-fat32_2_res_sects.mkfs \
11 mkfs-fat32_4K.mkfs \
912 check-bad_names.fsck \
13 check-fat12_first_cluster.fsck \
14 check-fat16_first_cluster.fsck \
15 check-fat32_first_cluster.fsck \
16 check-fat16_dos_cln_shut.fsck \
17 check-fat32_dos_cln_shut.fsck \
1018 check-chain_to_free_cluster.fsck \
1119 check-chain_too_long.fsck \
1220 check-chain_to_other_file.fsck \
1321 check-circular_chain.fsck \
1422 check-duplicate_names.fsck \
15 check-dot_entries.fsck
23 check-dot_entries.fsck \
24 check-huge.fsck \
25 check-label-different.fsck \
26 check-label-only-boot.fsck \
27 check-label-only-root.fsck \
28 label-fat32_mkdosfs_label1_dosfslabel_empty.label \
29 label-fat32_mkdosfs_label1_dosfslabel_label2.label \
30 label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.label \
31 label-fat32_mkdosfs_label1_mlabel_erase.label \
32 label-fat32_mkdosfs_label1_mlabel_NO_NAME.label \
33 label-fat32_mkdosfs_label1_xp_erase.label \
34 label-fat32_mkdosfs_label1_xp_label2.label \
35 label-fat32_mkdosfs_label1.label \
36 label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.label \
37 label-fat32_mkdosfs_none_dosfslabel_label1.label \
38 label-fat32_mkdosfs_none_dosfslabel_NO_NAME.label \
39 label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.label \
40 label-fat32_mkdosfs_none_xp_label1.label \
41 label-fat32_mkdosfs_none.label \
42 label-fat32_xp_label1.label \
43 label-fat32_xp_none_dosfslabel_label1.label \
44 label-fat32_xp_none_mlabel_label1.label \
45 label-fat32_xp_none.label
1646
17 XFAIL_TESTS = check-dot_entries.fsck
1847
19 TEST_EXTENSIONS = .mkfs .fsck
48 XFAIL_TESTS = check-huge.fsck
49
50 TEST_EXTENSIONS = .mkfs .fsck .label
2051 MKFS_LOG_COMPILER = $(srcdir)/test-mkfs
2152 FSCK_LOG_COMPILER = $(srcdir)/test-fsck
53 LABEL_LOG_COMPILER = $(srcdir)/test-label
2254
23 dist_check_DATA = test-mkfs test-fsck \
55 dist_check_DATA = test-mkfs test-fsck test-label \
2456 referenceFAT12.mkfs \
2557 referenceFAT12.xxd \
2658 referenceFAT16.mkfs \
2759 referenceFAT16.xxd \
2860 referenceFAT32.mkfs \
2961 referenceFAT32.xxd \
62 referenceFAT32mbr.mkfs \
63 referenceFAT32mbr.xxd \
64 mkfs-fat32_2_res_sects.mkfs \
65 mkfs-fat32_2_res_sects.xxd \
66 mkfs-fat32_4K.mkfs \
67 mkfs-fat32_4K.xxd \
3068 check-bad_names.fsck \
69 check-bad_names.xxd \
70 check-fat12_first_cluster.fsck \
71 check-fat12_first_cluster.args \
72 check-fat12_first_cluster.xxd \
73 check-fat16_first_cluster.fsck \
74 check-fat16_first_cluster.args \
75 check-fat16_first_cluster.xxd \
76 check-fat32_first_cluster.fsck \
77 check-fat32_first_cluster.args \
78 check-fat32_first_cluster.xxd \
79 check-fat16_dos_cln_shut.fsck \
80 check-fat16_dos_cln_shut.xxd \
81 check-fat32_dos_cln_shut.fsck \
82 check-fat32_dos_cln_shut.xxd \
3183 check-chain_to_free_cluster.fsck \
84 check-chain_to_free_cluster.xxd \
3285 check-chain_too_long.fsck \
86 check-chain_too_long.xxd \
3387 check-chain_to_other_file.fsck \
88 check-chain_to_other_file.xxd \
3489 check-circular_chain.fsck \
90 check-circular_chain.xxd \
3591 check-duplicate_names.fsck \
36 check-dot_entries.fsck
92 check-duplicate_names.xxd \
93 check-dot_entries.fsck \
94 check-dot_entries.xxd \
95 check-huge.fsck \
96 check-label-different.fsck \
97 check-label-different.xxd \
98 check-label-only-boot.fsck \
99 check-label-only-boot.xxd \
100 check-label-only-root.fsck \
101 check-label-only-root.xxd \
102 label-fat32_mkdosfs_label1_dosfslabel_empty.label \
103 label-fat32_mkdosfs_label1_dosfslabel_empty.xxd \
104 label-fat32_mkdosfs_label1_dosfslabel_label2.label \
105 label-fat32_mkdosfs_label1_dosfslabel_label2.xxd \
106 label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.label \
107 label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.xxd \
108 label-fat32_mkdosfs_label1_mlabel_erase.label \
109 label-fat32_mkdosfs_label1_mlabel_erase.xxd \
110 label-fat32_mkdosfs_label1_mlabel_NO_NAME.label \
111 label-fat32_mkdosfs_label1_mlabel_NO_NAME.xxd \
112 label-fat32_mkdosfs_label1_xp_erase.label \
113 label-fat32_mkdosfs_label1_xp_erase.xxd \
114 label-fat32_mkdosfs_label1_xp_label2.label \
115 label-fat32_mkdosfs_label1_xp_label2.xxd \
116 label-fat32_mkdosfs_label1.label \
117 label-fat32_mkdosfs_label1.xxd \
118 label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.label \
119 label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.xxd \
120 label-fat32_mkdosfs_none_dosfslabel_label1.label \
121 label-fat32_mkdosfs_none_dosfslabel_label1.xxd \
122 label-fat32_mkdosfs_none_dosfslabel_NO_NAME.label \
123 label-fat32_mkdosfs_none_dosfslabel_NO_NAME.xxd \
124 label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.label \
125 label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.xxd \
126 label-fat32_mkdosfs_none_xp_label1.label \
127 label-fat32_mkdosfs_none_xp_label1.xxd \
128 label-fat32_mkdosfs_none.label \
129 label-fat32_mkdosfs_none.xxd \
130 label-fat32_xp_label1.label \
131 label-fat32_xp_label1.xxd \
132 label-fat32_xp_none_dosfslabel_label1.label \
133 label-fat32_xp_none_dosfslabel_label1.xxd \
134 label-fat32_xp_none_mlabel_label1.label \
135 label-fat32_xp_none_mlabel_label1.xxd \
136 label-fat32_xp_none.label \
137 label-fat32_xp_none.xxd
0 # Makefile.in generated by automake 1.15 from Makefile.am.
0 # Makefile.in generated by automake 1.16.1 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2014 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2018 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
8484 NORMAL_UNINSTALL = :
8585 PRE_UNINSTALL = :
8686 POST_UNINSTALL = :
87 build_triplet = @build@
88 host_triplet = @host@
8789 subdir = tests
8890 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
8991 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
315317 *) \
316318 b='$*';; \
317319 esac
318 TEST_LOGS = $(am__test_logs3:.fsck.log=.log)
320 am__test_logs4 = $(am__test_logs3:.fsck.log=.log)
319321 FSCK_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
320322 FSCK_LOG_COMPILE = $(FSCK_LOG_COMPILER) $(AM_FSCK_LOG_FLAGS) \
321323 $(FSCK_LOG_FLAGS)
324 TEST_LOGS = $(am__test_logs4:.label.log=.log)
325 LABEL_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
326 LABEL_LOG_COMPILE = $(LABEL_LOG_COMPILER) $(AM_LABEL_LOG_FLAGS) \
327 $(LABEL_LOG_FLAGS)
322328 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/test-driver
323329 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
324330 ACLOCAL = @ACLOCAL@
331337 CC = @CC@
332338 CCDEPMODE = @CCDEPMODE@
333339 CFLAGS = @CFLAGS@
340 CHECKATARI = @CHECKATARI@
334341 CPP = @CPP@
335342 CPPFLAGS = @CPPFLAGS@
336343 CYGPATH_W = @CYGPATH_W@
348355 INSTALL_SCRIPT = @INSTALL_SCRIPT@
349356 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
350357 LDFLAGS = @LDFLAGS@
358 LIBICONV = @LIBICONV@
351359 LIBOBJS = @LIBOBJS@
352360 LIBS = @LIBS@
353361 LN_S = @LN_S@
362 LTLIBICONV = @LTLIBICONV@
354363 LTLIBOBJS = @LTLIBOBJS@
355364 MAKEINFO = @MAKEINFO@
356365 MKDIR_P = @MKDIR_P@
363372 PACKAGE_URL = @PACKAGE_URL@
364373 PACKAGE_VERSION = @PACKAGE_VERSION@
365374 PATH_SEPARATOR = @PATH_SEPARATOR@
366 PKG_CONFIG = @PKG_CONFIG@
367 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
368 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
369375 RELEASE_DATE = @RELEASE_DATE@
370376 SET_MAKE = @SET_MAKE@
371377 SHELL = @SHELL@
372378 STRIP = @STRIP@
373 UDEV_CFLAGS = @UDEV_CFLAGS@
374 UDEV_LIBS = @UDEV_LIBS@
375379 VERSION = @VERSION@
376380 XXD_FOUND = @XXD_FOUND@
377381 abs_builddir = @abs_builddir@
385389 am__tar = @am__tar@
386390 am__untar = @am__untar@
387391 bindir = @bindir@
392 build = @build@
388393 build_alias = @build_alias@
394 build_cpu = @build_cpu@
395 build_os = @build_os@
396 build_vendor = @build_vendor@
389397 builddir = @builddir@
390398 datadir = @datadir@
391399 datarootdir = @datarootdir@
392400 docdir = @docdir@
393401 dvidir = @dvidir@
394402 exec_prefix = @exec_prefix@
403 host = @host@
395404 host_alias = @host_alias@
405 host_cpu = @host_cpu@
406 host_os = @host_os@
407 host_vendor = @host_vendor@
396408 htmldir = @htmldir@
397409 includedir = @includedir@
398410 infodir = @infodir@
422434 TESTS = referenceFAT12.mkfs \
423435 referenceFAT16.mkfs \
424436 referenceFAT32.mkfs \
437 referenceFAT32mbr.mkfs \
438 mkfs-fat32_2_res_sects.mkfs \
439 mkfs-fat32_4K.mkfs \
425440 check-bad_names.fsck \
441 check-fat12_first_cluster.fsck \
442 check-fat16_first_cluster.fsck \
443 check-fat32_first_cluster.fsck \
444 check-fat16_dos_cln_shut.fsck \
445 check-fat32_dos_cln_shut.fsck \
426446 check-chain_to_free_cluster.fsck \
427447 check-chain_too_long.fsck \
428448 check-chain_to_other_file.fsck \
429449 check-circular_chain.fsck \
430450 check-duplicate_names.fsck \
431 check-dot_entries.fsck
432
433 XFAIL_TESTS = check-dot_entries.fsck
434 TEST_EXTENSIONS = .mkfs .fsck
451 check-dot_entries.fsck \
452 check-huge.fsck \
453 check-label-different.fsck \
454 check-label-only-boot.fsck \
455 check-label-only-root.fsck \
456 label-fat32_mkdosfs_label1_dosfslabel_empty.label \
457 label-fat32_mkdosfs_label1_dosfslabel_label2.label \
458 label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.label \
459 label-fat32_mkdosfs_label1_mlabel_erase.label \
460 label-fat32_mkdosfs_label1_mlabel_NO_NAME.label \
461 label-fat32_mkdosfs_label1_xp_erase.label \
462 label-fat32_mkdosfs_label1_xp_label2.label \
463 label-fat32_mkdosfs_label1.label \
464 label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.label \
465 label-fat32_mkdosfs_none_dosfslabel_label1.label \
466 label-fat32_mkdosfs_none_dosfslabel_NO_NAME.label \
467 label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.label \
468 label-fat32_mkdosfs_none_xp_label1.label \
469 label-fat32_mkdosfs_none.label \
470 label-fat32_xp_label1.label \
471 label-fat32_xp_none_dosfslabel_label1.label \
472 label-fat32_xp_none_mlabel_label1.label \
473 label-fat32_xp_none.label
474
475 XFAIL_TESTS = check-huge.fsck
476 TEST_EXTENSIONS = .mkfs .fsck .label
435477 MKFS_LOG_COMPILER = $(srcdir)/test-mkfs
436478 FSCK_LOG_COMPILER = $(srcdir)/test-fsck
437 dist_check_DATA = test-mkfs test-fsck \
479 LABEL_LOG_COMPILER = $(srcdir)/test-label
480 dist_check_DATA = test-mkfs test-fsck test-label \
438481 referenceFAT12.mkfs \
439482 referenceFAT12.xxd \
440483 referenceFAT16.mkfs \
441484 referenceFAT16.xxd \
442485 referenceFAT32.mkfs \
443486 referenceFAT32.xxd \
487 referenceFAT32mbr.mkfs \
488 referenceFAT32mbr.xxd \
489 mkfs-fat32_2_res_sects.mkfs \
490 mkfs-fat32_2_res_sects.xxd \
491 mkfs-fat32_4K.mkfs \
492 mkfs-fat32_4K.xxd \
444493 check-bad_names.fsck \
494 check-bad_names.xxd \
495 check-fat12_first_cluster.fsck \
496 check-fat12_first_cluster.args \
497 check-fat12_first_cluster.xxd \
498 check-fat16_first_cluster.fsck \
499 check-fat16_first_cluster.args \
500 check-fat16_first_cluster.xxd \
501 check-fat32_first_cluster.fsck \
502 check-fat32_first_cluster.args \
503 check-fat32_first_cluster.xxd \
504 check-fat16_dos_cln_shut.fsck \
505 check-fat16_dos_cln_shut.xxd \
506 check-fat32_dos_cln_shut.fsck \
507 check-fat32_dos_cln_shut.xxd \
445508 check-chain_to_free_cluster.fsck \
509 check-chain_to_free_cluster.xxd \
446510 check-chain_too_long.fsck \
511 check-chain_too_long.xxd \
447512 check-chain_to_other_file.fsck \
513 check-chain_to_other_file.xxd \
448514 check-circular_chain.fsck \
515 check-circular_chain.xxd \
449516 check-duplicate_names.fsck \
450 check-dot_entries.fsck
517 check-duplicate_names.xxd \
518 check-dot_entries.fsck \
519 check-dot_entries.xxd \
520 check-huge.fsck \
521 check-label-different.fsck \
522 check-label-different.xxd \
523 check-label-only-boot.fsck \
524 check-label-only-boot.xxd \
525 check-label-only-root.fsck \
526 check-label-only-root.xxd \
527 label-fat32_mkdosfs_label1_dosfslabel_empty.label \
528 label-fat32_mkdosfs_label1_dosfslabel_empty.xxd \
529 label-fat32_mkdosfs_label1_dosfslabel_label2.label \
530 label-fat32_mkdosfs_label1_dosfslabel_label2.xxd \
531 label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.label \
532 label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.xxd \
533 label-fat32_mkdosfs_label1_mlabel_erase.label \
534 label-fat32_mkdosfs_label1_mlabel_erase.xxd \
535 label-fat32_mkdosfs_label1_mlabel_NO_NAME.label \
536 label-fat32_mkdosfs_label1_mlabel_NO_NAME.xxd \
537 label-fat32_mkdosfs_label1_xp_erase.label \
538 label-fat32_mkdosfs_label1_xp_erase.xxd \
539 label-fat32_mkdosfs_label1_xp_label2.label \
540 label-fat32_mkdosfs_label1_xp_label2.xxd \
541 label-fat32_mkdosfs_label1.label \
542 label-fat32_mkdosfs_label1.xxd \
543 label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.label \
544 label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.xxd \
545 label-fat32_mkdosfs_none_dosfslabel_label1.label \
546 label-fat32_mkdosfs_none_dosfslabel_label1.xxd \
547 label-fat32_mkdosfs_none_dosfslabel_NO_NAME.label \
548 label-fat32_mkdosfs_none_dosfslabel_NO_NAME.xxd \
549 label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.label \
550 label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.xxd \
551 label-fat32_mkdosfs_none_xp_label1.label \
552 label-fat32_mkdosfs_none_xp_label1.xxd \
553 label-fat32_mkdosfs_none.label \
554 label-fat32_mkdosfs_none.xxd \
555 label-fat32_xp_label1.label \
556 label-fat32_xp_label1.xxd \
557 label-fat32_xp_none_dosfslabel_label1.label \
558 label-fat32_xp_none_dosfslabel_label1.xxd \
559 label-fat32_xp_none_mlabel_label1.label \
560 label-fat32_xp_none_mlabel_label1.xxd \
561 label-fat32_xp_none.label \
562 label-fat32_xp_none.xxd
451563
452564 all: all-am
453565
454566 .SUFFIXES:
455 .SUFFIXES: .fsck .fsck$(EXEEXT) .log .mkfs .mkfs$(EXEEXT) .trs
567 .SUFFIXES: .fsck .fsck$(EXEEXT) .label .label$(EXEEXT) .log .mkfs .mkfs$(EXEEXT) .trs
456568 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
457569 @for dep in $?; do \
458570 case '$(am__configure_deps)' in \
470582 *config.status*) \
471583 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
472584 *) \
473 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
474 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
585 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
586 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
475587 esac;
476588
477589 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
609721 fi; \
610722 $$success || exit 1
611723
612 check-TESTS:
724 check-TESTS: $(dist_check_DATA)
613725 @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
614726 @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
615727 @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
658770 @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
659771 @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_FSCK_LOG_DRIVER_FLAGS) $(FSCK_LOG_DRIVER_FLAGS) -- $(FSCK_LOG_COMPILE) \
660772 @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
661
662 distdir: $(DISTFILES)
773 .label.log:
774 @p='$<'; \
775 $(am__set_b); \
776 $(am__check_pre) $(LABEL_LOG_DRIVER) --test-name "$$f" \
777 --log-file $$b.log --trs-file $$b.trs \
778 $(am__common_driver_flags) $(AM_LABEL_LOG_DRIVER_FLAGS) $(LABEL_LOG_DRIVER_FLAGS) -- $(LABEL_LOG_COMPILE) \
779 "$$tst" $(AM_TESTS_FD_REDIRECT)
780 @am__EXEEXT_TRUE@.label$(EXEEXT).log:
781 @am__EXEEXT_TRUE@ @p='$<'; \
782 @am__EXEEXT_TRUE@ $(am__set_b); \
783 @am__EXEEXT_TRUE@ $(am__check_pre) $(LABEL_LOG_DRIVER) --test-name "$$f" \
784 @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
785 @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_LABEL_LOG_DRIVER_FLAGS) $(LABEL_LOG_DRIVER_FLAGS) -- $(LABEL_LOG_COMPILE) \
786 @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
787
788 distdir: $(BUILT_SOURCES)
789 $(MAKE) $(AM_MAKEFLAGS) distdir-am
790
791 distdir-am: $(DISTFILES)
663792 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
664793 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
665794 list='$(DISTFILES)'; \
2222 *
2323 00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
2424 00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
25 00041020: 4e41 4d20 3120 2020 4249 4e20 0000 cca0 NAM 1 BIN ....
25 00041020: 2041 4d45 3120 2020 4249 4e20 0000 cca0 AME1 BIN ....
2626 00041030: 6249 6249 0000 cca0 6249 0000 0000 0000 bIbI....bI......
27 00041040: 4e41 4d45 3220 2020 4220 4e20 0000 cea0 NAME2 B N ....
27 00041040: 2020 2020 2020 2020 2020 2020 0000 cea0 ....
2828 00041050: 6249 6249 0000 cea0 6249 0000 0000 0000 bIbI....bI......
2929 00041060: 4e41 4d45 3320 2020 4249 4e20 0064 cfa0 NAME3 BIN .d..
3030 00041070: 6249 6249 0000 cfa0 6249 0000 0000 0000 bIbI....bI......
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: 4653 434b 3030 3030 3030 3020 0000 cca0 FSCK0000000 ....
26 00041030: 6249 6249 0000 cca0 6249 0000 0000 0000 bIbI....bI......
27 00041040: 4653 434b 3030 3030 3030 3120 0000 cea0 FSCK0000001 ....
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: 4653 434b 3030 3030 3030 3220 0000 09a1 FSCK0000002 ....
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 f8ff 0000 0000 0000 0000 ................
18 00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
19 *
20 00021000: f8ff ffff 0000 f8ff 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 f8ff ff0f ffff ff0f 0800 0000 ................
45 00004020: 0d00 0000 0a00 0000 ffff ff0f 0c00 0000 ................
46 00004030: f8ff ff0f 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 f8ff ff0f ffff ff0f 0800 0000 ................
51 000fe020: 0d00 0000 0a00 0000 ffff ff0f 0c00 0000 ................
52 000fe030: f8ff ff0f 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 0030 0000 1I1I...v1I...0..
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 0020 0000 1I1I...v1I... ..
63 001f8080: 4653 434b 3030 3030 5245 4300 0000 0000 FSCK0000REC.....
64 001f8090: 0000 0000 0000 0000 0000 0600 0010 0000 ................
65 001f80a0: 4653 434b 3030 3031 5245 4300 0000 0000 FSCK0001REC.....
66 001f80b0: 0000 0000 0000 0000 0000 0900 0020 0000 ............. ..
67 001f80c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
68 *
69 001f9000: 7465 7374 2063 6c75 7374 6572 2031 0a00 test cluster 1..
70 001f9010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
71 *
72 001fa000: 7465 7374 2063 6c75 7374 6572 2032 0a00 test cluster 2..
73 001fa010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
74 *
75 001fb000: 7465 7374 2063 6c75 7374 6572 2033 0a00 test cluster 3..
76 001fb010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
77 *
78 001fc000: 7465 7374 2063 6c75 7374 6572 2034 0a00 test cluster 4..
79 001fc010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
80 *
81 001fd000: 7465 7374 2063 6c75 7374 6572 2031 0a00 test cluster 1..
82 001fd010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
83 *
84 001fe000: 7465 7374 2063 6c75 7374 6572 2032 0a00 test cluster 2..
85 001fe010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
86 *
87 001ff000: 7465 7374 2063 6c75 7374 6572 2033 0a00 test cluster 3..
88 001ff010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
89 *
90 00200000: 7465 7374 2063 6c75 7374 6572 2034 0a00 test cluster 4..
91 00200010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
92 *
93 00201000: 7465 7374 2063 6c75 7374 6572 2031 0a00 test cluster 1..
94 00201010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
95 *
96 00202000: 7465 7374 2063 6c75 7374 6572 2032 0a00 test cluster 2..
97 00202010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
98 *
99 00203000: 7465 7374 2063 6c75 7374 6572 2033 0a00 test cluster 3..
100 00203010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
101 *
102 00204000: 7465 7374 2063 6c75 7374 6572 2034 0a00 test cluster 4..
103 00204010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
104 *
105 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 f8ff 0000 0000 0000 0000 ................
18 00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
19 *
20 00021000: f8ff ffff 0000 f8ff 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 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 f8ff ffff 0000 ................
18 00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
19 *
20 00021000: f8ff ffff 0000 0400 0500 f8ff 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 0030 0000 ,I,I..o.,I...0..
27 00041040: 4653 434b 3030 3030 5245 4300 0000 0000 FSCK0000REC.....
28 00041050: 0000 0000 0000 0000 0000 0600 0010 0000 ................
29 00041060: 0000 0000 0000 0000 0000 0000 0000 0000 ................
30 *
31 00046000: 7465 7374 2063 6c75 7374 6572 2031 0a00 test cluster 1..
32 00046010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
33 *
34 00047000: 7465 7374 2063 6c75 7374 6572 2032 0a00 test cluster 2..
35 00047010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
36 *
37 00048000: 7465 7374 2063 6c75 7374 6572 2033 0a00 test cluster 3..
38 00048010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
39 *
40 00049000: 7465 7374 2063 6c75 7374 6572 2034 0a00 test cluster 4..
41 00049010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
42 *
43 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: 2e20 2020 2020 2020 2020 2010 0000 0000 . .....
30 00046010: 0000 0000 0000 0000 0000 0300 0000 0000 ................
31 00046020: 2e2e 2020 2020 2020 2020 2010 0000 0000 .. .....
32 00046030: 0000 0000 0000 0000 0000 0000 0000 0000 ................
33 00046040: e553 434b 3030 3030 3030 3010 0000 e611 .SCK0000000.....
34 00046050: 2749 2749 0000 e611 2749 0000 0000 0000 'I'I....'I......
35 00046060: e553 434b 3030 3030 3030 3110 0000 e611 .SCK0000001.....
36 00046070: 2749 2749 0000 e611 2749 0000 0000 0000 'I'I....'I......
37 00046080: 5445 5354 3120 2020 5458 5420 0064 2012 TEST1 TXT .d .
38 00046090: 2749 2749 0000 2012 2749 0400 0700 0000 'I'I.. .'I......
39 000460a0: 5445 5354 3220 2020 5458 5420 0064 2012 TEST2 TXT .d .
40 000460b0: 2749 2749 0000 2012 2749 0500 0700 0000 'I'I.. .'I......
41 000460c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
42 *
43 00047000: 7465 7374 2031 0a00 0000 0000 0000 0000 test 1..........
44 00047010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
45 *
46 00048000: 7465 7374 2032 0a00 0000 0000 0000 0000 test 2..........
47 00048010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
48 *
49 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: 4653 434b 3030 3030 3030 3020 0000 e95a FSCK0000000 ...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 00000000: eb3c 906d 6b66 732e 6661 7400 0204 0100 .<.mkfs.fat.....
1 00000010: 0200 02a0 07f8 0200 1000 0200 0000 0000 ................
2 00000020: 0000 0000 8000 2917 99fd 524e 4f20 4e41 ......)...RNO NA
3 00000030: 4d45 2020 2020 4641 5431 3220 2020 0e1f ME 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: 00f0 ff00 0000 0000 0000 0000 0000 0000 ................
16 00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
17 *
18 00000600: 00f0 ff00 0000 0000 0000 0000 0000 0000 ................
19 00000610: 0000 0000 0000 0000 0000 0000 0000 0000 ................
20 *
21 000f4230: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb3c 906d 6b66 732e 6661 7400 0204 0100 .<.mkfs.fat.....
1 00000010: 0200 02a0 07f8 0200 1000 0200 0000 0000 ................
2 00000020: 0000 0000 8000 2917 99fd 524e 4f20 4e41 ......)...RNO NA
3 00000030: 4d45 2020 2020 4641 5431 3220 2020 0e1f ME 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: f8ff ff00 0000 0000 0000 0000 0000 0000 ................
16 00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
17 *
18 00000600: f8ff ff00 0000 0000 0000 0000 0000 0000 ................
19 00000610: 0000 0000 0000 0000 0000 0000 0000 0000 ................
20 *
21 000f4230: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb3c 906d 6b66 732e 6661 7400 0204 0400 .<.mkfs.fat.....
1 00000010: 0200 0240 4cf8 1400 2000 0200 0000 0000 ...@L... .......
2 00000020: 0000 0000 8000 290f 1821 544e 4f20 4e41 ......)..!TNO NA
3 00000030: 4d45 2020 2020 4641 5431 3620 2020 0e1f ME 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 00000800: f8ff ff7f 0000 0000 0000 0000 0000 0000 ................
18 00000810: 0000 0000 0000 0000 0000 0000 0000 0000 ................
19 *
20 00003000: f8ff ff7f 0000 0000 0000 0000 0000 0000 ................
21 00003010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
22 *
23 00989670: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb3c 906d 6b66 732e 6661 7400 0204 0400 .<.mkfs.fat.....
1 00000010: 0200 0240 4cf8 1400 2000 0200 0000 0000 ...@L... .......
2 00000020: 0000 0000 8000 290f 1821 544e 4f20 4e41 ......)..!TNO NA
3 00000030: 4d45 2020 2020 4641 5431 3620 2020 0e1f ME 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 00000800: f8ff ffff 0000 0000 0000 0000 0000 0000 ................
18 00000810: 0000 0000 0000 0000 0000 0000 0000 0000 ................
19 *
20 00003000: f8ff ffff 0000 0000 0000 0000 0000 0000 ................
21 00003010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
22 *
23 00989670: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb3c 906d 6b66 732e 6661 7400 0204 0400 .<.mkfs.fat.....
1 00000010: 0200 0240 4cf8 1400 2000 0200 0000 0000 ...@L... .......
2 00000020: 0000 0000 8000 290f 1821 544e 4f20 4e41 ......)..!TNO NA
3 00000030: 4d45 2020 2020 4641 5431 3620 2020 0e1f ME 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 00000800: 0000 ffff 0000 0000 0000 0000 0000 0000 ................
18 00000810: 0000 0000 0000 0000 0000 0000 0000 0000 ................
19 *
20 00003000: 0000 ffff 0000 0000 0000 0000 0000 0000 ................
21 00003010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
22 *
23 00989670: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb3c 906d 6b66 732e 6661 7400 0204 0400 .<.mkfs.fat.....
1 00000010: 0200 0240 4cf8 1400 2000 0200 0000 0000 ...@L... .......
2 00000020: 0000 0000 8000 290f 1821 544e 4f20 4e41 ......)..!TNO NA
3 00000030: 4d45 2020 2020 4641 5431 3620 2020 0e1f ME 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 00000800: f8ff ffff 0000 0000 0000 0000 0000 0000 ................
18 00000810: 0000 0000 0000 0000 0000 0000 0000 0000 ................
19 *
20 00003000: f8ff ffff 0000 0000 0000 0000 0000 0000 ................
21 00003010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
22 *
23 00989670: 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 4000 0000 0000 ........?.@.....
2 00000020: f8ff 1f00 0008 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020 ..).JJ.NO NAME
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 fafd 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 4000 0000 0000 ........?.@.....
26 00000c20: f8ff 1f00 0008 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020 ..).JJ.NO NAME
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: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
42 00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
43 *
44 00000fe0: 0000 0000 7272 4161 fafd 0300 0200 0000 ....rrAa........
45 00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
46 00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
47 *
48 00004000: f8ff ff0f ffff ff07 f8ff ff0f 0000 0000 ................
49 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
50 *
51 00104000: f8ff ff0f ffff ff07 f8ff ff0f 0000 0000 ................
52 00104010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
53 *
54 3ffffff0: 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 4000 0000 0000 ........?.@.....
2 00000020: f8ff 1f00 0008 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020 ..).JJ.NO NAME
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 fafd 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 4000 0000 0000 ........?.@.....
26 00000c20: f8ff 1f00 0008 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020 ..).JJ.NO NAME
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: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
42 00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
43 *
44 00000fe0: 0000 0000 7272 4161 fafd 0300 0200 0000 ....rrAa........
45 00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
46 00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
47 *
48 00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
49 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
50 *
51 00104000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
52 00104010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
53 *
54 3ffffff0: 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 4000 0000 0000 ........?.@.....
2 00000020: f8ff 1f00 0008 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020 ..).JJ.NO NAME
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 fafd 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 4000 0000 0000 ........?.@.....
26 00000c20: f8ff 1f00 0008 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020 ..).JJ.NO NAME
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: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
42 00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
43 *
44 00000fe0: 0000 0000 7272 4161 fafd 0300 0200 0000 ....rrAa........
45 00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
46 00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
47 *
48 00004000: 0000 0000 ffff ff0f f8ff ff0f 0000 0000 ................
49 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
50 *
51 00104000: 0000 0000 ffff ff0f f8ff ff0f 0000 0000 ................
52 00104010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
53 *
54 3ffffff0: 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 4000 0000 0000 ........?.@.....
2 00000020: f8ff 1f00 0008 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020 ..).JJ.NO NAME
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 fafd 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 4000 0000 0000 ........?.@.....
26 00000c20: f8ff 1f00 0008 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020 ..).JJ.NO NAME
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: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
42 00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
43 *
44 00000fe0: 0000 0000 7272 4161 fafd 0300 0200 0000 ....rrAa........
45 00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
46 00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
47 *
48 00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
49 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
50 *
51 00104000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
52 00104010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
53 *
54 3ffffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 906d 6b66 732e 6661 7400 0201 2000 .X.mkfs.fat... .
1 00000010: 0100 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
2 00000020: 2100 000a 0000 0002 0000 0000 0200 0000 !...............
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 8000 2986 8e80 974e 4f20 4e41 4d45 2020 ..)....NO NAME
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 9b21 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 0201 2000 .X.mkfs.fat... .
25 00000c10: 0100 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
26 00000c20: 2100 000a 0000 0002 0000 0000 0200 0000 !...............
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 8000 2986 8e80 974e 4f20 4e41 4d45 2020 ..)....NO NAME
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 064ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
1 00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 298c afb8 e66c 6162 656c 3120 2020 ..)....label1
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 cf03 0100 0300 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 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
25 00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
26 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 0000 298c afb8 e66c 6162 656c 3120 2020 ..)....label1
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 ffff f8ff ff0f 0000 0000 ................
44 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
45 *
46 00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
47 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
48 *
49 00086000: 4c41 4245 4c32 2020 2020 2008 0000 0000 LABEL2 .....
50 00086010: 0000 0000 0000 37ab 4b4b 0000 0000 0000 ......7.KK......
51 00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
52 *
53 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
1 00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 298c afb8 e64c 4142 454c 3220 2020 ..)....LABEL2
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 cf03 0100 0300 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 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
25 00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
26 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 0000 298c afb8 e64c 4142 454c 3220 2020 ..)....LABEL2
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 ffff f8ff ff0f 0000 0000 ................
44 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
45 *
46 00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
47 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
48 *
49 00086000: 4c41 4245 4c32 2020 2020 2008 0000 0000 LABEL2 .....
50 00086010: 0000 0000 0000 37ab 4b4b 0000 0000 0000 ......7.KK......
51 00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
52 *
53 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
1 00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 2966 bab4 926c 6162 656c 3120 2020 ..)f...label1
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 cf03 0100 0300 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 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
25 00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
26 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 0000 2966 bab4 926c 6162 656c 3120 2020 ..)f...label1
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 ffff f8ff ff0f 0000 0000 ................
44 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
45 *
46 00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
47 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
48 *
49 00086000: e561 6265 6c31 2020 2020 2008 0000 7bb0 .abel1 ...{.
50 00086010: 4b4b 4b4b 0000 7bb0 4b4b 0000 0000 0000 KKKK..{.KK......
51 00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
52 *
53 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
1 00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 2966 bab4 924e 4f20 4e41 4d45 2020 ..)f...NO NAME
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 cf03 0100 0300 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 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
25 00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
26 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 0000 2966 bab4 924e 4f20 4e41 4d45 2020 ..)f...NO NAME
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 ffff f8ff ff0f 0000 0000 ................
44 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
45 *
46 00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
47 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
48 *
49 00086000: e561 6265 6c31 2020 2020 2008 0000 7bb0 .abel1 ...{.
50 00086010: 4b4b 4b4b 0000 7bb0 4b4b 0000 0000 0000 KKKK..{.KK......
51 00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
52 *
53 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
1 00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 2904 9320 a44e 4f20 4e41 4d45 2020 ..).. .NO NAME
5 00000050: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
6 00000060: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
7 00000070: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
8 00000080: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
9 00000090: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
10 000000a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
11 000000b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
12 000000c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
13 000000d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
14 000000e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
15 000000f0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
16 00000100: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
17 00000110: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
18 00000120: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
19 00000130: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
20 00000140: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
21 00000150: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
22 00000160: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
23 00000170: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
24 00000180: 0000 0000 0000 0000 0000 0000 0000 0000 ................
25 00000190: 0000 0000 0000 0000 0000 0000 0000 0000 ................
26 000001a0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
27 000001b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
28 000001c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
29 000001d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
30 000001e0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
31 000001f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
32 00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
33 00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
34 *
35 000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000 ....rrAa........
36 000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
37 00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
38 *
39 000005f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
40 00000600: 0000 0000 0000 0000 0000 0000 0000 0000 ................
41 *
42 00000c00: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
43 00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
44 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
45 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
46 00000c40: 0000 2904 9320 a44e 4f20 4e41 4d45 2020 ..).. .NO NAME
47 00000c50: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
48 00000c60: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
49 00000c70: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
50 00000c80: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
51 00000c90: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
52 00000ca0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
53 00000cb0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
54 00000cc0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
55 00000cd0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
56 00000ce0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
57 00000cf0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
58 00000d00: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
59 00000d10: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
60 00000d20: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
61 00000d30: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
62 00000d40: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
63 00000d50: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
64 00000d60: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
65 00000d70: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
66 00000d80: 0000 0000 0000 0000 0000 0000 0000 0000 ................
67 00000d90: 0000 0000 0000 0000 0000 0000 0000 0000 ................
68 00000da0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
69 00000db0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
70 00000dc0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
71 00000dd0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
72 00000de0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
73 00000df0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
74 00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
75 00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
76 *
77 00000fe0: 0000 0000 7272 4161 ffff ffff 0200 0000 ....rrAa........
78 00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
79 00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
80 *
81 000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
82 00001200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
83 *
84 00001800: 660f b646 1066 8b4e 2466 f7e1 6603 461c f..F.f.N$f..f.F.
85 00001810: 660f b756 0e66 03c2 6689 46fc 66c7 46f4 f..V.f..f.F.f.F.
86 00001820: ffff ffff 668b 462c 6683 f802 0f82 a6fc ....f.F,f.......
87 00001830: 663d f8ff ff0f 0f83 9cfc 6650 6683 e802 f=........fPf...
88 00001840: 660f b65e 0d8b f366 f7e3 6603 46fc bb00 f..^...f..f.F...
89 00001850: 828b fbb9 0100 e887 fc38 2d74 1eb1 0b56 .........8-t...V
90 00001860: be70 7df3 a65e 741b 03f9 83c7 153b fb72 .p}..^t......;.r
91 00001870: e84e 75da 6658 e865 0072 bf83 c404 e955 .Nu.fX.e.r.....U
92 00001880: fc00 2083 c404 8b75 098b 7d0f 8bc6 66c1 .. ....u..}...f.
93 00001890: e010 8bc7 6683 f802 0f82 3afc 663d f8ff ....f.....:.f=..
94 000018a0: ff0f 0f83 30fc 6650 6683 e802 660f b64e ....0.fPf...f..N
95 000018b0: 0d66 f7e1 6603 46fc bb00 0006 8e06 8180 .f..f.F.........
96 000018c0: e81d fc07 6658 c1eb 0401 1e81 80e8 0e00 ....fX..........
97 000018d0: 0f83 0200 72d0 8a56 40ea 0000 0020 66c1 ....r..V@.... f.
98 000018e0: e002 e811 0026 668b 0166 25ff ffff 0f66 .....&f..f%....f
99 000018f0: 3df8 ffff 0fc3 bf00 7e66 0fb7 4e0b 6633 =.......~f..N.f3
100 00001900: d266 f7f1 663b 46f4 743a 6689 46f4 6603 .f..f;F.t:f.F.f.
101 00001910: 461c 660f b74e 0e66 03c1 660f b75e 2883 F.f..N.f..f..^(.
102 00001920: e30f 7416 3a5e 100f 83ab fb52 668b c866 ..t.:^.....Rf..f
103 00001930: 8b46 2466 f7e3 6603 c15a 528b dfb9 0100 .F$f..f..ZR.....
104 00001940: e89d fb5a 8bda c300 0000 0000 0000 0000 ...Z............
105 00001950: 0000 0000 0000 0000 0000 0000 0000 0000 ................
106 *
107 000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
108 00001a00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
109 *
110 00004000: f8ff ff0f ffff ffff ffff ff0f 0000 0000 ................
111 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
112 *
113 00045000: f8ff ff0f ffff ffff ffff ff0f 0000 0000 ................
114 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
115 *
116 00086000: 4c41 4245 4c31 2020 2020 2008 0000 0000 LABEL1 .....
117 00086010: 0000 0000 0000 eab5 4b4b 0000 0000 0000 ........KK......
118 00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
119 *
120 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
1 00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 2904 9320 a44c 4142 454c 3120 2020 ..).. .LABEL1
5 00000050: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
6 00000060: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
7 00000070: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
8 00000080: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
9 00000090: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
10 000000a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
11 000000b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
12 000000c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
13 000000d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
14 000000e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
15 000000f0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
16 00000100: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
17 00000110: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
18 00000120: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
19 00000130: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
20 00000140: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
21 00000150: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
22 00000160: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
23 00000170: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
24 00000180: 0000 0000 0000 0000 0000 0000 0000 0000 ................
25 00000190: 0000 0000 0000 0000 0000 0000 0000 0000 ................
26 000001a0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
27 000001b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
28 000001c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
29 000001d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
30 000001e0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
31 000001f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
32 00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
33 00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
34 *
35 000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000 ....rrAa........
36 000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
37 00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
38 *
39 000005f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
40 00000600: 0000 0000 0000 0000 0000 0000 0000 0000 ................
41 *
42 00000c00: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
43 00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
44 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
45 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
46 00000c40: 0000 2904 9320 a44c 4142 454c 3120 2020 ..).. .LABEL1
47 00000c50: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
48 00000c60: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
49 00000c70: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
50 00000c80: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
51 00000c90: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
52 00000ca0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
53 00000cb0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
54 00000cc0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
55 00000cd0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
56 00000ce0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
57 00000cf0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
58 00000d00: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
59 00000d10: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
60 00000d20: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
61 00000d30: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
62 00000d40: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
63 00000d50: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
64 00000d60: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
65 00000d70: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
66 00000d80: 0000 0000 0000 0000 0000 0000 0000 0000 ................
67 00000d90: 0000 0000 0000 0000 0000 0000 0000 0000 ................
68 00000da0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
69 00000db0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
70 00000dc0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
71 00000dd0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
72 00000de0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
73 00000df0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
74 00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
75 00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
76 *
77 00000fe0: 0000 0000 7272 4161 ffff ffff 0200 0000 ....rrAa........
78 00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
79 00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
80 *
81 000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
82 00001200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
83 *
84 00001800: 660f b646 1066 8b4e 2466 f7e1 6603 461c f..F.f.N$f..f.F.
85 00001810: 660f b756 0e66 03c2 6689 46fc 66c7 46f4 f..V.f..f.F.f.F.
86 00001820: ffff ffff 668b 462c 6683 f802 0f82 a6fc ....f.F,f.......
87 00001830: 663d f8ff ff0f 0f83 9cfc 6650 6683 e802 f=........fPf...
88 00001840: 660f b65e 0d8b f366 f7e3 6603 46fc bb00 f..^...f..f.F...
89 00001850: 828b fbb9 0100 e887 fc38 2d74 1eb1 0b56 .........8-t...V
90 00001860: be70 7df3 a65e 741b 03f9 83c7 153b fb72 .p}..^t......;.r
91 00001870: e84e 75da 6658 e865 0072 bf83 c404 e955 .Nu.fX.e.r.....U
92 00001880: fc00 2083 c404 8b75 098b 7d0f 8bc6 66c1 .. ....u..}...f.
93 00001890: e010 8bc7 6683 f802 0f82 3afc 663d f8ff ....f.....:.f=..
94 000018a0: ff0f 0f83 30fc 6650 6683 e802 660f b64e ....0.fPf...f..N
95 000018b0: 0d66 f7e1 6603 46fc bb00 0006 8e06 8180 .f..f.F.........
96 000018c0: e81d fc07 6658 c1eb 0401 1e81 80e8 0e00 ....fX..........
97 000018d0: 0f83 0200 72d0 8a56 40ea 0000 0020 66c1 ....r..V@.... f.
98 000018e0: e002 e811 0026 668b 0166 25ff ffff 0f66 .....&f..f%....f
99 000018f0: 3df8 ffff 0fc3 bf00 7e66 0fb7 4e0b 6633 =.......~f..N.f3
100 00001900: d266 f7f1 663b 46f4 743a 6689 46f4 6603 .f..f;F.t:f.F.f.
101 00001910: 461c 660f b74e 0e66 03c1 660f b75e 2883 F.f..N.f..f..^(.
102 00001920: e30f 7416 3a5e 100f 83ab fb52 668b c866 ..t.:^.....Rf..f
103 00001930: 8b46 2466 f7e3 6603 c15a 528b dfb9 0100 .F$f..f..ZR.....
104 00001940: e89d fb5a 8bda c300 0000 0000 0000 0000 ...Z............
105 00001950: 0000 0000 0000 0000 0000 0000 0000 0000 ................
106 *
107 000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
108 00001a00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
109 *
110 00004000: f8ff ff0f ffff ffff ffff ff0f 0000 0000 ................
111 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
112 *
113 00045000: f8ff ff0f ffff ffff ffff ff0f 0000 0000 ................
114 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
115 *
116 00086000: 4c41 4245 4c31 2020 2020 2008 0000 0000 LABEL1 .....
117 00086010: 0000 0000 0000 eab5 4b4b 0000 0000 0000 ........KK......
118 00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
119 *
120 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
1 00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 2966 bab4 926c 6162 656c 3120 2020 ..)f...label1
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 cf03 0100 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 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
25 00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
26 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 0000 2966 bab4 926c 6162 656c 3120 2020 ..)f...label1
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 00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
47 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
48 *
49 00086000: 6c61 6265 6c31 2020 2020 2008 0000 7bb0 label1 ...{.
50 00086010: 4b4b 4b4b 0000 7bb0 4b4b 0000 0000 0000 KKKK..{.KK......
51 00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
52 *
53 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
1 00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 2966 bab4 924e 4f20 4e41 4d45 2020 ..)f...NO NAME
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 cf03 0100 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 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
25 00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
26 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 0000 2966 bab4 924e 4f20 4e41 4d45 2020 ..)f...NO NAME
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 00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
47 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
48 *
49 00086000: 4e4f 204e 414d 4520 2020 2008 0000 7bb0 NO NAME ...{.
50 00086010: 4b4b 4b4b 0000 05b4 4b4b 0000 0000 0000 KKKK....KK......
51 00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
52 *
53 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
1 00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 2966 bab4 9220 2020 2020 2020 2020 ..)f...
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 cf03 0100 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 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
25 00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
26 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 0000 2966 bab4 9220 2020 2020 2020 2020 ..)f...
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 00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
47 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
48 *
49 00086000: 2020 2020 2020 2020 2020 2008 0000 7bb0 ...{.
50 00086010: 4b4b 4b4b 0000 65b4 4b4b 0000 0000 0000 KKKK..e.KK......
51 00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
52 *
53 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
1 00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 2966 bab4 926c 6162 656c 3220 2020 ..)f...label2
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 cf03 0100 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 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
25 00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
26 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 0000 2966 bab4 926c 6162 656c 3220 2020 ..)f...label2
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 00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
47 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
48 *
49 00086000: 6c61 6265 6c32 2020 2020 2008 0000 7bb0 label2 ...{.
50 00086010: 4b4b 4b4b 0000 b6b0 4b4b 0000 0000 0000 KKKK....KK......
51 00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
52 *
53 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
1 00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 2966 bab4 924e 4f20 4e41 4d45 2020 ..)f...NO NAME
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 cf03 0100 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 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
25 00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
26 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 0000 2966 bab4 924e 4f20 4e41 4d45 2020 ..)f...NO NAME
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: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
42 00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
43 *
44 00000fe0: 0000 0000 7272 4161 cf03 0100 0200 0000 ....rrAa........
45 00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
46 00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
47 *
48 00001800: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
49 00001810: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
50 00001820: 0008 0100 0802 0000 0000 0000 0200 0000 ................
51 00001830: 0100 0600 0000 0000 0000 0000 0000 0000 ................
52 00001840: 0000 2966 bab4 926c 6162 656c 3120 2020 ..)f...label1
53 00001850: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
54 00001860: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
55 00001870: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
56 00001880: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
57 00001890: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
58 000018a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
59 000018b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
60 000018c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
61 000018d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
62 000018e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
63 *
64 000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
65 00001a00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
66 *
67 00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
68 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
69 *
70 00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
71 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
72 *
73 00086000: 4e4f 204e 414d 4520 2020 2008 0000 91b5 NO NAME .....
74 00086010: 4b4b 4b4b 0000 91b5 4b4b 0000 0000 0000 KKKK....KK......
75 00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
76 *
77 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
1 00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 2966 bab4 924e 4f20 4e41 4d45 2020 ..)f...NO NAME
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 cf03 0100 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 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
25 00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
26 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 0000 2966 bab4 924e 4f20 4e41 4d45 2020 ..)f...NO NAME
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: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
42 00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
43 *
44 00000fe0: 0000 0000 7272 4161 cf03 0100 0200 0000 ....rrAa........
45 00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
46 00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
47 *
48 00001800: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
49 00001810: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
50 00001820: 0008 0100 0802 0000 0000 0000 0200 0000 ................
51 00001830: 0100 0600 0000 0000 0000 0000 0000 0000 ................
52 00001840: 0000 2966 bab4 926c 6162 656c 3120 2020 ..)f...label1
53 00001850: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
54 00001860: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
55 00001870: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
56 00001880: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
57 00001890: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
58 000018a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
59 000018b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
60 000018c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
61 000018d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
62 000018e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
63 *
64 000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
65 00001a00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
66 *
67 00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
68 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
69 *
70 00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
71 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
72 *
73 00086000: e561 6265 6c31 2020 2020 2000 0000 7bb0 .abel1 ...{.
74 00086010: 4b4b 4b4b 0000 7bb0 4b4b 0000 0000 0000 KKKK..{.KK......
75 00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
76 *
77 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
1 00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 2966 bab4 926c 6162 656c 3120 2020 ..)f...label1
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 cf03 0100 0300 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 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
25 00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
26 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 0000 2966 bab4 926c 6162 656c 3120 2020 ..)f...label1
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 ffff f8ff ff0f 0000 0000 ................
44 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
45 *
46 00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
47 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
48 *
49 00086000: e561 6265 6c31 2020 2020 2008 0000 7bb0 .abel1 ...{.
50 00086010: 4b4b 4b4b 0000 7bb0 4b4b 0000 0000 0000 KKKK..{.KK......
51 00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
52 *
53 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
1 00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 2966 bab4 926c 6162 656c 3120 2020 ..)f...label1
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 cf03 0100 0300 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 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
25 00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
26 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 0000 2966 bab4 926c 6162 656c 3120 2020 ..)f...label1
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 ffff f8ff ff0f 0000 0000 ................
44 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
45 *
46 00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
47 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
48 *
49 00086000: 4c41 4245 4c32 2020 2020 2008 0000 0000 LABEL2 .....
50 00086010: 0000 0000 0000 62b3 4b4b 0000 0000 0000 ......b.KK......
51 00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
52 *
53 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
1 00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 298c afb8 e620 2020 2020 2020 2020 ..)....
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 cf03 0100 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 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
25 00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
26 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 0000 298c afb8 e620 2020 2020 2020 2020 ..)....
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 00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
47 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
48 *
49 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
1 00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 298c afb8 e64e 4f20 4e41 4d45 2020 ..)....NO NAME
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 cf03 0100 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 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
25 00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
26 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 0000 298c afb8 e64e 4f20 4e41 4d45 2020 ..)....NO NAME
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 00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
47 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
48 *
49 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
1 00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 298c afb8 e66c 6162 656c 3120 2020 ..)....label1
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 cf03 0100 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 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
25 00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
26 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 0000 298c afb8 e66c 6162 656c 3120 2020 ..)....label1
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 00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
47 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
48 *
49 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
1 00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 298c afb8 e66c 6162 656c 3120 2020 ..)....label1
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 cf03 0100 0300 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 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
25 00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
26 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 0000 298c afb8 e66c 6162 656c 3120 2020 ..)....label1
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 ffff f8ff ff0f 0000 0000 ................
44 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
45 *
46 00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
47 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
48 *
49 00086000: 4c41 4245 4c32 2020 2020 2008 0000 0000 LABEL2 .....
50 00086010: 0000 0000 0000 37ab 4b4b 0000 0000 0000 ......7.KK......
51 00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
52 *
53 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
1 00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 298c afb8 e620 2020 2020 2020 2020 ..)....
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 cf03 0100 0300 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 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
25 00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
26 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 0000 298c afb8 e620 2020 2020 2020 2020 ..)....
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 ffff f8ff ff0f 0000 0000 ................
44 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
45 *
46 00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
47 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
48 *
49 00086000: 4c41 4245 4c31 2020 2020 2008 0000 0000 LABEL1 .....
50 00086010: 0000 0000 0000 68aa 4b4b 0000 0000 0000 ......h.KK......
51 00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
52 *
53 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
1 00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 298c afb8 e66c 6162 656c 3220 2020 ..)....label2
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 cf03 0100 0300 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 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
25 00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
26 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
27 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
28 00000c40: 0000 298c afb8 e66c 6162 656c 3220 2020 ..)....label2
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 ffff f8ff ff0f 0000 0000 ................
44 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
45 *
46 00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
47 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
48 *
49 00086000: 6c61 6265 6c32 2020 2020 2008 0000 0000 label2 .....
50 00086010: 0000 0000 0000 93aa 4b4b 0000 0000 0000 ........KK......
51 00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
52 *
53 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
1 00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 2904 9320 a44e 4f20 4e41 4d45 2020 ..).. .NO NAME
5 00000050: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
6 00000060: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
7 00000070: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
8 00000080: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
9 00000090: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
10 000000a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
11 000000b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
12 000000c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
13 000000d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
14 000000e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
15 000000f0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
16 00000100: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
17 00000110: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
18 00000120: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
19 00000130: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
20 00000140: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
21 00000150: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
22 00000160: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
23 00000170: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
24 00000180: 0000 0000 0000 0000 0000 0000 0000 0000 ................
25 00000190: 0000 0000 0000 0000 0000 0000 0000 0000 ................
26 000001a0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
27 000001b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
28 000001c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
29 000001d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
30 000001e0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
31 000001f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
32 00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
33 00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
34 *
35 000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000 ....rrAa........
36 000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
37 00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
38 *
39 000005f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
40 00000600: 0000 0000 0000 0000 0000 0000 0000 0000 ................
41 *
42 00000c00: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
43 00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
44 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
45 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
46 00000c40: 0000 2904 9320 a44e 4f20 4e41 4d45 2020 ..).. .NO NAME
47 00000c50: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
48 00000c60: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
49 00000c70: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
50 00000c80: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
51 00000c90: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
52 00000ca0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
53 00000cb0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
54 00000cc0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
55 00000cd0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
56 00000ce0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
57 00000cf0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
58 00000d00: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
59 00000d10: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
60 00000d20: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
61 00000d30: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
62 00000d40: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
63 00000d50: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
64 00000d60: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
65 00000d70: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
66 00000d80: 0000 0000 0000 0000 0000 0000 0000 0000 ................
67 00000d90: 0000 0000 0000 0000 0000 0000 0000 0000 ................
68 00000da0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
69 00000db0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
70 00000dc0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
71 00000dd0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
72 00000de0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
73 00000df0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
74 00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
75 00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
76 *
77 00000fe0: 0000 0000 7272 4161 ffff ffff 0200 0000 ....rrAa........
78 00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
79 00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
80 *
81 000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
82 00001200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
83 *
84 00001800: 660f b646 1066 8b4e 2466 f7e1 6603 461c f..F.f.N$f..f.F.
85 00001810: 660f b756 0e66 03c2 6689 46fc 66c7 46f4 f..V.f..f.F.f.F.
86 00001820: ffff ffff 668b 462c 6683 f802 0f82 a6fc ....f.F,f.......
87 00001830: 663d f8ff ff0f 0f83 9cfc 6650 6683 e802 f=........fPf...
88 00001840: 660f b65e 0d8b f366 f7e3 6603 46fc bb00 f..^...f..f.F...
89 00001850: 828b fbb9 0100 e887 fc38 2d74 1eb1 0b56 .........8-t...V
90 00001860: be70 7df3 a65e 741b 03f9 83c7 153b fb72 .p}..^t......;.r
91 00001870: e84e 75da 6658 e865 0072 bf83 c404 e955 .Nu.fX.e.r.....U
92 00001880: fc00 2083 c404 8b75 098b 7d0f 8bc6 66c1 .. ....u..}...f.
93 00001890: e010 8bc7 6683 f802 0f82 3afc 663d f8ff ....f.....:.f=..
94 000018a0: ff0f 0f83 30fc 6650 6683 e802 660f b64e ....0.fPf...f..N
95 000018b0: 0d66 f7e1 6603 46fc bb00 0006 8e06 8180 .f..f.F.........
96 000018c0: e81d fc07 6658 c1eb 0401 1e81 80e8 0e00 ....fX..........
97 000018d0: 0f83 0200 72d0 8a56 40ea 0000 0020 66c1 ....r..V@.... f.
98 000018e0: e002 e811 0026 668b 0166 25ff ffff 0f66 .....&f..f%....f
99 000018f0: 3df8 ffff 0fc3 bf00 7e66 0fb7 4e0b 6633 =.......~f..N.f3
100 00001900: d266 f7f1 663b 46f4 743a 6689 46f4 6603 .f..f;F.t:f.F.f.
101 00001910: 461c 660f b74e 0e66 03c1 660f b75e 2883 F.f..N.f..f..^(.
102 00001920: e30f 7416 3a5e 100f 83ab fb52 668b c866 ..t.:^.....Rf..f
103 00001930: 8b46 2466 f7e3 6603 c15a 528b dfb9 0100 .F$f..f..ZR.....
104 00001940: e89d fb5a 8bda c300 0000 0000 0000 0000 ...Z............
105 00001950: 0000 0000 0000 0000 0000 0000 0000 0000 ................
106 *
107 000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
108 00001a00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
109 *
110 00004000: f8ff ff0f ffff ffff ffff ff0f 0000 0000 ................
111 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
112 *
113 00045000: f8ff ff0f ffff ffff ffff ff0f 0000 0000 ................
114 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
115 *
116 00086000: 4c41 4245 4c31 2020 2020 2008 0000 0000 LABEL1 .....
117 00086010: 0000 0000 0000 eab5 4b4b 0000 0000 0000 ........KK......
118 00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
119 *
120 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
1 00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 2994 dcb6 544e 4f20 4e41 4d45 2020 ..)...TNO NAME
5 00000050: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
6 00000060: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
7 00000070: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
8 00000080: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
9 00000090: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
10 000000a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
11 000000b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
12 000000c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
13 000000d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
14 000000e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
15 000000f0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
16 00000100: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
17 00000110: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
18 00000120: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
19 00000130: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
20 00000140: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
21 00000150: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
22 00000160: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
23 00000170: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
24 00000180: 0000 0000 0000 0000 0000 0000 0000 0000 ................
25 00000190: 0000 0000 0000 0000 0000 0000 0000 0000 ................
26 000001a0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
27 000001b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
28 000001c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
29 000001d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
30 000001e0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
31 000001f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
32 00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
33 00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
34 *
35 000003e0: 0000 0000 7272 4161 ffff ffff 0200 0000 ....rrAa........
36 000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
37 00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
38 *
39 000005f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
40 00000600: 0000 0000 0000 0000 0000 0000 0000 0000 ................
41 *
42 00000c00: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
43 00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
44 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
45 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
46 00000c40: 0000 2994 dcb6 544e 4f20 4e41 4d45 2020 ..)...TNO NAME
47 00000c50: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
48 00000c60: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
49 00000c70: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
50 00000c80: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
51 00000c90: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
52 00000ca0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
53 00000cb0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
54 00000cc0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
55 00000cd0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
56 00000ce0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
57 00000cf0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
58 00000d00: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
59 00000d10: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
60 00000d20: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
61 00000d30: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
62 00000d40: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
63 00000d50: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
64 00000d60: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
65 00000d70: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
66 00000d80: 0000 0000 0000 0000 0000 0000 0000 0000 ................
67 00000d90: 0000 0000 0000 0000 0000 0000 0000 0000 ................
68 00000da0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
69 00000db0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
70 00000dc0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
71 00000dd0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
72 00000de0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
73 00000df0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
74 00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
75 00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
76 *
77 00000fe0: 0000 0000 7272 4161 ffff ffff 0200 0000 ....rrAa........
78 00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
79 00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
80 *
81 000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
82 00001200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
83 *
84 00001800: 660f b646 1066 8b4e 2466 f7e1 6603 461c f..F.f.N$f..f.F.
85 00001810: 660f b756 0e66 03c2 6689 46fc 66c7 46f4 f..V.f..f.F.f.F.
86 00001820: ffff ffff 668b 462c 6683 f802 0f82 a6fc ....f.F,f.......
87 00001830: 663d f8ff ff0f 0f83 9cfc 6650 6683 e802 f=........fPf...
88 00001840: 660f b65e 0d8b f366 f7e3 6603 46fc bb00 f..^...f..f.F...
89 00001850: 828b fbb9 0100 e887 fc38 2d74 1eb1 0b56 .........8-t...V
90 00001860: be70 7df3 a65e 741b 03f9 83c7 153b fb72 .p}..^t......;.r
91 00001870: e84e 75da 6658 e865 0072 bf83 c404 e955 .Nu.fX.e.r.....U
92 00001880: fc00 2083 c404 8b75 098b 7d0f 8bc6 66c1 .. ....u..}...f.
93 00001890: e010 8bc7 6683 f802 0f82 3afc 663d f8ff ....f.....:.f=..
94 000018a0: ff0f 0f83 30fc 6650 6683 e802 660f b64e ....0.fPf...f..N
95 000018b0: 0d66 f7e1 6603 46fc bb00 0006 8e06 8180 .f..f.F.........
96 000018c0: e81d fc07 6658 c1eb 0401 1e81 80e8 0e00 ....fX..........
97 000018d0: 0f83 0200 72d0 8a56 40ea 0000 0020 66c1 ....r..V@.... f.
98 000018e0: e002 e811 0026 668b 0166 25ff ffff 0f66 .....&f..f%....f
99 000018f0: 3df8 ffff 0fc3 bf00 7e66 0fb7 4e0b 6633 =.......~f..N.f3
100 00001900: d266 f7f1 663b 46f4 743a 6689 46f4 6603 .f..f;F.t:f.F.f.
101 00001910: 461c 660f b74e 0e66 03c1 660f b75e 2883 F.f..N.f..f..^(.
102 00001920: e30f 7416 3a5e 100f 83ab fb52 668b c866 ..t.:^.....Rf..f
103 00001930: 8b46 2466 f7e3 6603 c15a 528b dfb9 0100 .F$f..f..ZR.....
104 00001940: e89d fb5a 8bda c300 0000 0000 0000 0000 ...Z............
105 00001950: 0000 0000 0000 0000 0000 0000 0000 0000 ................
106 *
107 000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
108 00001a00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
109 *
110 00004000: f8ff ff0f ffff ff0f ffff ff0f 0000 0000 ................
111 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
112 *
113 00045000: f8ff ff0f ffff ff0f ffff ff0f 0000 0000 ................
114 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
115 *
116 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
1 00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 2994 dcb6 546c 6162 656c 3120 2020 ..)...Tlabel1
5 00000050: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
6 00000060: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
7 00000070: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
8 00000080: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
9 00000090: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
10 000000a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
11 000000b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
12 000000c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
13 000000d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
14 000000e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
15 000000f0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
16 00000100: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
17 00000110: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
18 00000120: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
19 00000130: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
20 00000140: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
21 00000150: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
22 00000160: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
23 00000170: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
24 00000180: 0000 0000 0000 0000 0000 0000 0000 0000 ................
25 00000190: 0000 0000 0000 0000 0000 0000 0000 0000 ................
26 000001a0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
27 000001b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
28 000001c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
29 000001d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
30 000001e0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
31 000001f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
32 00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
33 00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
34 *
35 000003e0: 0000 0000 7272 4161 ffff ffff 0200 0000 ....rrAa........
36 000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
37 00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
38 *
39 000005f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
40 00000600: 0000 0000 0000 0000 0000 0000 0000 0000 ................
41 *
42 00000c00: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
43 00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
44 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
45 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
46 00000c40: 0000 2994 dcb6 546c 6162 656c 3120 2020 ..)...Tlabel1
47 00000c50: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
48 00000c60: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
49 00000c70: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
50 00000c80: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
51 00000c90: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
52 00000ca0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
53 00000cb0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
54 00000cc0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
55 00000cd0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
56 00000ce0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
57 00000cf0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
58 00000d00: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
59 00000d10: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
60 00000d20: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
61 00000d30: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
62 00000d40: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
63 00000d50: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
64 00000d60: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
65 00000d70: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
66 00000d80: 0000 0000 0000 0000 0000 0000 0000 0000 ................
67 00000d90: 0000 0000 0000 0000 0000 0000 0000 0000 ................
68 00000da0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
69 00000db0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
70 00000dc0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
71 00000dd0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
72 00000de0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
73 00000df0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
74 00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
75 00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
76 *
77 00000fe0: 0000 0000 7272 4161 ffff ffff 0200 0000 ....rrAa........
78 00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
79 00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
80 *
81 000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
82 00001200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
83 *
84 00001800: 660f b646 1066 8b4e 2466 f7e1 6603 461c f..F.f.N$f..f.F.
85 00001810: 660f b756 0e66 03c2 6689 46fc 66c7 46f4 f..V.f..f.F.f.F.
86 00001820: ffff ffff 668b 462c 6683 f802 0f82 a6fc ....f.F,f.......
87 00001830: 663d f8ff ff0f 0f83 9cfc 6650 6683 e802 f=........fPf...
88 00001840: 660f b65e 0d8b f366 f7e3 6603 46fc bb00 f..^...f..f.F...
89 00001850: 828b fbb9 0100 e887 fc38 2d74 1eb1 0b56 .........8-t...V
90 00001860: be70 7df3 a65e 741b 03f9 83c7 153b fb72 .p}..^t......;.r
91 00001870: e84e 75da 6658 e865 0072 bf83 c404 e955 .Nu.fX.e.r.....U
92 00001880: fc00 2083 c404 8b75 098b 7d0f 8bc6 66c1 .. ....u..}...f.
93 00001890: e010 8bc7 6683 f802 0f82 3afc 663d f8ff ....f.....:.f=..
94 000018a0: ff0f 0f83 30fc 6650 6683 e802 660f b64e ....0.fPf...f..N
95 000018b0: 0d66 f7e1 6603 46fc bb00 0006 8e06 8180 .f..f.F.........
96 000018c0: e81d fc07 6658 c1eb 0401 1e81 80e8 0e00 ....fX..........
97 000018d0: 0f83 0200 72d0 8a56 40ea 0000 0020 66c1 ....r..V@.... f.
98 000018e0: e002 e811 0026 668b 0166 25ff ffff 0f66 .....&f..f%....f
99 000018f0: 3df8 ffff 0fc3 bf00 7e66 0fb7 4e0b 6633 =.......~f..N.f3
100 00001900: d266 f7f1 663b 46f4 743a 6689 46f4 6603 .f..f;F.t:f.F.f.
101 00001910: 461c 660f b74e 0e66 03c1 660f b75e 2883 F.f..N.f..f..^(.
102 00001920: e30f 7416 3a5e 100f 83ab fb52 668b c866 ..t.:^.....Rf..f
103 00001930: 8b46 2466 f7e3 6603 c15a 528b dfb9 0100 .F$f..f..ZR.....
104 00001940: e89d fb5a 8bda c300 0000 0000 0000 0000 ...Z............
105 00001950: 0000 0000 0000 0000 0000 0000 0000 0000 ................
106 *
107 000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
108 00001a00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
109 *
110 00004000: f8ff ff0f ffff ff0f ffff ff0f 0000 0000 ................
111 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
112 *
113 00045000: f8ff ff0f ffff ff0f ffff ff0f 0000 0000 ................
114 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
115 *
116 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 00000000: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
1 00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
2 00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 0000 2994 dcb6 544c 4142 454c 3120 2020 ..)...TLABEL1
5 00000050: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
6 00000060: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
7 00000070: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
8 00000080: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
9 00000090: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
10 000000a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
11 000000b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
12 000000c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
13 000000d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
14 000000e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
15 000000f0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
16 00000100: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
17 00000110: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
18 00000120: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
19 00000130: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
20 00000140: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
21 00000150: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
22 00000160: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
23 00000170: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
24 00000180: 0000 0000 0000 0000 0000 0000 0000 0000 ................
25 00000190: 0000 0000 0000 0000 0000 0000 0000 0000 ................
26 000001a0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
27 000001b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
28 000001c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
29 000001d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
30 000001e0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
31 000001f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
32 00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
33 00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
34 *
35 000003e0: 0000 0000 7272 4161 ffff ffff 0200 0000 ....rrAa........
36 000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
37 00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
38 *
39 000005f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
40 00000600: 0000 0000 0000 0000 0000 0000 0000 0000 ................
41 *
42 00000c00: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
43 00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
44 00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
45 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
46 00000c40: 0000 2994 dcb6 544c 4142 454c 3120 2020 ..)...TLABEL1
47 00000c50: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
48 00000c60: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
49 00000c70: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
50 00000c80: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
51 00000c90: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
52 00000ca0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
53 00000cb0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
54 00000cc0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
55 00000cd0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
56 00000ce0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
57 00000cf0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
58 00000d00: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
59 00000d10: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
60 00000d20: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
61 00000d30: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
62 00000d40: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
63 00000d50: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
64 00000d60: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
65 00000d70: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
66 00000d80: 0000 0000 0000 0000 0000 0000 0000 0000 ................
67 00000d90: 0000 0000 0000 0000 0000 0000 0000 0000 ................
68 00000da0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
69 00000db0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
70 00000dc0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
71 00000dd0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
72 00000de0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
73 00000df0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
74 00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
75 00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
76 *
77 00000fe0: 0000 0000 7272 4161 ffff ffff 0200 0000 ....rrAa........
78 00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
79 00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
80 *
81 000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
82 00001200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
83 *
84 00001800: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
85 00001810: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
86 00001820: 0008 0100 0802 0000 0000 0000 0200 0000 ................
87 00001830: 0100 0600 0000 0000 0000 0000 0000 0000 ................
88 00001840: 0000 2994 dcb6 544e 4f20 4e41 4d45 2020 ..)...TNO NAME
89 00001850: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
90 00001860: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
91 00001870: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
92 00001880: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
93 00001890: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
94 000018a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
95 000018b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
96 000018c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
97 000018d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
98 000018e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
99 000018f0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
100 00001900: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
101 00001910: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
102 00001920: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
103 00001930: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
104 00001940: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
105 00001950: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
106 00001960: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
107 00001970: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
108 00001980: 0000 0000 0000 0000 0000 0000 0000 0000 ................
109 00001990: 0000 0000 0000 0000 0000 0000 0000 0000 ................
110 000019a0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
111 000019b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
112 000019c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
113 000019d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
114 000019e0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
115 000019f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
116 00001a00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
117 00001a10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
118 *
119 00001be0: 0000 0000 7272 4161 ffff ffff 0200 0000 ....rrAa........
120 00001bf0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
121 00001c00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
122 *
123 00004000: f8ff ff0f ffff ff0f ffff ff0f 0000 0000 ................
124 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
125 *
126 00045000: f8ff ff0f ffff ff0f ffff ff0f 0000 0000 ................
127 00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
128 *
129 00086000: 4c41 4245 4c31 2020 2020 2008 0000 f3b6 LABEL1 .....
130 00086010: 4b4b 4b4b 0000 f3b6 4b4b 0000 0000 0000 KKKK....KK......
131 00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
132 *
133 020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 ARGS="-n TESTFAT32 -a -R 2"
1 SIZE=1024000
2 CMP_LIMIT=10M
0 00000000: eb58 906d 6b66 732e 6661 7400 0208 0200 .X.mkfs.fat.....
1 00000010: 0200 0000 00f8 0000 3f00 2000 0000 0000 ........?. .....
2 00000020: 0040 1f00 cd07 0000 0000 0000 0200 0000 .@..............
3 00000030: 0100 0000 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 0be6 0300 0200 0000 ....rrAa........
21 000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
22 00000400: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
23 00000410: 0000 0000 0000 0000 0000 0000 0000 0000 ................
24 *
25 000f9e00: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
26 000f9e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
27 *
28 001f3800: 5445 5354 4641 5433 3220 2008 0000 5a4b TESTFAT32 ...ZK
29 001f3810: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
30 001f3820: 0000 0000 0000 0000 0000 0000 0000 0000 ................
31 *
32 3e7ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 ARGS="-n TEST4K -S 4096"
1 SIZE=614400
2 CMP_LIMIT=10M
0 00000000: eb58 906d 6b66 732e 6661 7400 1001 2000 .X.mkfs.fat... .
1 00000010: 0200 0000 00f8 0000 2000 0800 0000 0000 ........ .......
2 00000020: 0058 0200 9600 0000 0000 0000 0200 0000 .X..............
3 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
4 00000040: 8000 29cd ab34 1254 4553 5434 4b20 2020 ..)..4.TEST4K
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: 0000 0000 0000 0000 0000 0000 0000 0000 ................
18 *
19 00001000: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
20 00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
21 *
22 000011e0: 0000 0000 7272 4161 b356 0200 0200 0000 ....rrAa.V......
23 000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
24 00001200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
25 *
26 00006000: eb58 906d 6b66 732e 6661 7400 1001 2000 .X.mkfs.fat... .
27 00006010: 0200 0000 00f8 0000 2000 0800 0000 0000 ........ .......
28 00006020: 0058 0200 9600 0000 0000 0000 0200 0000 .X..............
29 00006030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
30 00006040: 8000 29cd ab34 1254 4553 5434 4b20 2020 ..)..4.TEST4K
31 00006050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
32 00006060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
33 00006070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
34 00006080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
35 00006090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
36 000060a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
37 000060b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
38 000060c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
39 000060d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
40 000060e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
41 *
42 000061f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
43 00006200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
44 *
45 00007000: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
46 00007010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
47 *
48 000071e0: 0000 0000 7272 4161 b356 0200 0200 0000 ....rrAa.V......
49 000071f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
50 00007200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
51 *
52 00020000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
53 00020010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
54 *
55 000b6000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
56 000b6010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
57 *
58 0014c000: 5445 5354 344b 2020 2020 2008 0000 5a4b TEST4K ...ZK
59 0014c010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
60 0014c020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
61 *
62 257ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
1 00000010: 0200 0200 00f8 0001 2000 4000 0000 0000 ........ .@.....
1 00000010: 0200 0200 00f8 0001 2000 1000 0000 0000 ........ .......
22 00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
33 00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
44 00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00 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 .@..............
1 00000010: 0200 0000 00f8 0000 3f00 2000 0000 0000 ........?. .....
2 00000020: c53f 1f00 d007 0000 0000 0000 0200 0000 .?..............
33 00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
44 00000040: 8000 29cd ab34 1254 4553 5446 4154 3332 ..)..4.TESTFAT32
55 00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
1717 00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
1818 00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
1919 *
20 000003e0: 0000 0000 7272 4161 07e6 0300 0200 0000 ....rrAa........
20 000003e0: 0000 0000 7272 4161 ffe5 0300 0200 0000 ....rrAa........
2121 000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
2222 00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
2323 *
2424 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 .@..............
25 00000c10: 0200 0000 00f8 0000 3f00 2000 0000 0000 ........?. .....
26 00000c20: c53f 1f00 d007 0000 0000 0000 0200 0000 .?..............
2727 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
2828 00000c40: 8000 29cd ab34 1254 4553 5446 4154 3332 ..)..4.TESTFAT32
2929 00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
3838 00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
3939 *
4040 00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
41 00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
41 00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
42 00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
43 *
44 00000fe0: 0000 0000 7272 4161 ffe5 0300 0200 0000 ....rrAa........
45 00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
46 00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
4247 *
4348 00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
4449 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0 ARGS="-n TESTFAT32 --mbr"
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 2000 0000 0000 ........?. .....
2 00000020: c53f 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 000001b0: 0000 0000 0000 0000 cdab 3412 0000 8000 ..........4.....
17 000001c0: 0100 0c1b c1f7 0000 0000 c53f 1f00 0000 ...........?....
18 000001d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
19 000001e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
20 000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
21 00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
22 00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
23 *
24 000003e0: 0000 0000 7272 4161 ffe5 0300 0200 0000 ....rrAa........
25 000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
26 00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
27 *
28 00000c00: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
29 00000c10: 0200 0000 00f8 0000 3f00 2000 0000 0000 ........?. .....
30 00000c20: c53f 1f00 d007 0000 0000 0000 0200 0000 .?..............
31 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
32 00000c40: 8000 29cd ab34 1254 4553 5446 4154 3332 ..)..4.TESTFAT32
33 00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
34 00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
35 00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
36 00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
37 00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
38 00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
39 00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
40 00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
41 00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
42 00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
43 *
44 00000db0: 0000 0000 0000 0000 cdab 3412 0000 8000 ..........4.....
45 00000dc0: 0100 0c1b c1f7 0000 0000 c53f 1f00 0000 ...........?....
46 00000dd0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
47 00000de0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
48 00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
49 00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
50 00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
51 *
52 00000fe0: 0000 0000 7272 4161 ffe5 0300 0200 0000 ....rrAa........
53 00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
54 00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
55 *
56 00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
57 00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
58 *
59 000fe000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
60 000fe010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
61 *
62 001f8000: 5445 5354 4641 5433 3220 2008 0000 5a4b TESTFAT32 ...ZK
63 001f8010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
64 001f8020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
65 *
66 3e7ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
2323
2424
2525 run_fsck () {
26 "../src/fsck.fat" "$@"
26 $RUN "../src/fsck.fat" "$@"
2727 }
2828
2929
4040 fi
4141
4242
43 if [ -f "$testname.args" ]; then
44 ARGS=$(cat "$testname.args")
45 else
46 ARGS=
47 fi
48
4349 echo "Test $testname"
4450
4551 # make sure there aren't files remaining from earlier run
46 rm -f "${testname}.img"
52 rm -f "${testname}.img" "${testname}.refimg"
4753
4854 xxd -r "${srcdir}/${testname}.fsck" "${testname}.img" || exit 99
4955
5056
5157 echo "First fsck run to check and fix error..."
52 run_fsck -a "${testname}.img"
58 run_fsck -a $ARGS "${testname}.img"
5359 success=$?
5460 if [ $success -eq 0 ]; then
5561 echo "*** Error was not detected by fsck."
6167
6268 if [ $success -ne 0 ]; then
6369 echo "*** Error was not fixed by fsck."
70 else
71 echo "Comparing..."
72 xxd -r "${srcdir}/${testname}.xxd" "${testname}.refimg" || exit 99
73 cmp "${testname}.img" "${testname}.refimg"
74 success=$?
75
76 if [ $success -eq 2 ]; then
77 # cmp reported error
78 exit 99
79 fi
6480 fi
6581 fi
6682
6783
68 rm -f "${testname}.img"
84 rm -f "${testname}.img" "${testname}.refimg"
6985 exit $success
0 #!/bin/sh
1 # Copyright (C) 2018 Pali Rohár <pali.rohar@gmail.com>
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.label file as its sole argument. It must
18 # be a label of the corresponding hex dump file testname.xxd that can be
19 # converted to a file system image with xxd.
20
21
22 run_label () {
23 $RUN "../src/fatlabel" "$@"
24 }
25
26
27 if [ $# -ne 1 ]; then
28 echo "$0 called with wrong number of arguments"
29 exit 99
30 fi
31 testname=$(basename "$1" .label)
32
33
34 if [ "$XXD_FOUND" != "yes" ]; then
35 echo "xxd not available, required by test"
36 exit 77 # report test skipped
37 fi
38
39
40 echo "Test $testname"
41
42 # make sure there aren't files remaining from earlier run
43 rm -f "${testname}.img" "${testname}.out"
44
45 xxd -r "${srcdir}/${testname}.xxd" "${testname}.img" || exit 99
46 run_label "${testname}.img" 1> "${testname}.out" 2> "${testname}.err" || exit 99
47
48
49 echo "Comparing..."
50 diff "${testname}.out" "${srcdir}/${testname}.label"
51 success=$?
52
53
54 echo "Error output:"
55 cat "${testname}.err"
56 if [ "$CHECK_ERRORS" = "1" ] && [ -s "${testname}.err" ]; then
57 success=2
58 fi
59
60
61 rm -f "${testname}.img" "${testname}.out" "${testname}.err"
62 exit $success
2323
2424
2525 run_mkfs () {
26 "../src/mkfs.fat" "$@"
26 $RUN "../src/mkfs.fat" "$@"
2727 }
2828
2929 run_fsck () {
30 "../src/fsck.fat" "$@"
30 $RUN "../src/fsck.fat" "$@"
3131 }
3232
3333
6262 cmp $limitarg "${testname}.out" "${testname}.refimg"
6363 success=$?
6464
65 echo
66 echo "Testing fsck..."
67 run_fsck -n "${testname}.out"
68 success_fsck=$?
69
6570 if [ $success -eq 0 ]; then
66 echo
67 echo "Testing fsck..."
68 run_fsck -n "${testname}.out"
69 success=$?
71 success=$success_fsck
7072 fi
7173
7274 rm -f "${testname}.out" "${testname}.refimg"