dosfstools-4.2/ 0000755 0001750 0001750 00000000000 14005523537 010563 5 0000000 0000000 dosfstools-4.2/test-driver 0000755 0001750 0001750 00000011042 14005523525 012674 0000000 0000000 #! /bin/sh
# test-driver - basic testsuite driver script.
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 2011-2018 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to or send patches to
# .
# Make unconditional expansion of undefined variables an error. This
# helps a lot in preventing typo-related bugs.
set -u
usage_error ()
{
echo "$0: $*" >&2
print_usage >&2
exit 2
}
print_usage ()
{
cat <$log_file 2>&1
estatus=$?
if test $enable_hard_errors = no && test $estatus -eq 99; then
tweaked_estatus=1
else
tweaked_estatus=$estatus
fi
case $tweaked_estatus:$expect_failure in
0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
0:*) col=$grn res=PASS recheck=no gcopy=no;;
77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
*:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
*:*) col=$red res=FAIL recheck=yes gcopy=yes;;
esac
# Report the test outcome and exit status in the logs, so that one can
# know whether the test passed or failed simply by looking at the '.log'
# file, without the need of also peaking into the corresponding '.trs'
# file (automake bug#11814).
echo "$res $test_name (exit status: $estatus)" >>$log_file
# Report outcome to console.
echo "${col}${res}${std}: $test_name"
# Register the test result, and other relevant metadata.
echo ":test-result: $res" > $trs_file
echo ":global-test-result: $res" >> $trs_file
echo ":recheck: $recheck" >> $trs_file
echo ":copy-in-global-log: $gcopy" >> $trs_file
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
dosfstools-4.2/tests/ 0000755 0001750 0001750 00000000000 14005523537 011725 5 0000000 0000000 dosfstools-4.2/tests/Makefile.in 0000644 0001750 0001750 00000100326 14005523525 013711 0000000 0000000 # Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = tests
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(dist_check_DATA) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__tty_colors_dummy = \
mgn= red= grn= lgn= blu= brg= std=; \
am__color_tests=no
am__tty_colors = { \
$(am__tty_colors_dummy); \
if test "X$(AM_COLOR_TESTS)" = Xno; then \
am__color_tests=no; \
elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
am__color_tests=yes; \
elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
am__color_tests=yes; \
fi; \
if test $$am__color_tests = yes; then \
red='[0;31m'; \
grn='[0;32m'; \
lgn='[1;32m'; \
blu='[1;34m'; \
mgn='[0;35m'; \
brg='[1m'; \
std='[m'; \
fi; \
}
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__recheck_rx = ^[ ]*:recheck:[ ]*
am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
# A command that, given a newline-separated list of test names on the
# standard input, print the name of the tests that are to be re-run
# upon "make recheck".
am__list_recheck_tests = $(AWK) '{ \
recheck = 1; \
while ((rc = (getline line < ($$0 ".trs"))) != 0) \
{ \
if (rc < 0) \
{ \
if ((getline line2 < ($$0 ".log")) < 0) \
recheck = 0; \
break; \
} \
else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
{ \
recheck = 0; \
break; \
} \
else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
{ \
break; \
} \
}; \
if (recheck) \
print $$0; \
close ($$0 ".trs"); \
close ($$0 ".log"); \
}'
# A command that, given a newline-separated list of test names on the
# standard input, create the global log from their .trs and .log files.
am__create_global_log = $(AWK) ' \
function fatal(msg) \
{ \
print "fatal: making $@: " msg | "cat >&2"; \
exit 1; \
} \
function rst_section(header) \
{ \
print header; \
len = length(header); \
for (i = 1; i <= len; i = i + 1) \
printf "="; \
printf "\n\n"; \
} \
{ \
copy_in_global_log = 1; \
global_test_result = "RUN"; \
while ((rc = (getline line < ($$0 ".trs"))) != 0) \
{ \
if (rc < 0) \
fatal("failed to read from " $$0 ".trs"); \
if (line ~ /$(am__global_test_result_rx)/) \
{ \
sub("$(am__global_test_result_rx)", "", line); \
sub("[ ]*$$", "", line); \
global_test_result = line; \
} \
else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
copy_in_global_log = 0; \
}; \
if (copy_in_global_log) \
{ \
rst_section(global_test_result ": " $$0); \
while ((rc = (getline line < ($$0 ".log"))) != 0) \
{ \
if (rc < 0) \
fatal("failed to read from " $$0 ".log"); \
print line; \
}; \
printf "\n"; \
}; \
close ($$0 ".trs"); \
close ($$0 ".log"); \
}'
# Restructured Text title.
am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
# Solaris 10 'make', and several other traditional 'make' implementations,
# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
# by disabling -e (using the XSI extension "set +e") if it's set.
am__sh_e_setup = case $$- in *e*) set +e;; esac
# Default flags passed to test drivers.
am__common_driver_flags = \
--color-tests "$$am__color_tests" \
--enable-hard-errors "$$am__enable_hard_errors" \
--expect-failure "$$am__expect_failure"
# To be inserted before the command running the test. Creates the
# directory for the log if needed. Stores in $dir the directory
# containing $f, in $tst the test, in $log the log. Executes the
# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
# will run the test scripts (or their associated LOG_COMPILER, if
# thy have one).
am__check_pre = \
$(am__sh_e_setup); \
$(am__vpath_adj_setup) $(am__vpath_adj) \
$(am__tty_colors); \
srcdir=$(srcdir); export srcdir; \
case "$@" in \
*/*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
*) am__odir=.;; \
esac; \
test "x$$am__odir" = x"." || test -d "$$am__odir" \
|| $(MKDIR_P) "$$am__odir" || exit $$?; \
if test -f "./$$f"; then dir=./; \
elif test -f "$$f"; then dir=; \
else dir="$(srcdir)/"; fi; \
tst=$$dir$$f; log='$@'; \
if test -n '$(DISABLE_HARD_ERRORS)'; then \
am__enable_hard_errors=no; \
else \
am__enable_hard_errors=yes; \
fi; \
case " $(XFAIL_TESTS) " in \
*[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
am__expect_failure=yes;; \
*) \
am__expect_failure=no;; \
esac; \
$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
# A shell command to get the names of the tests scripts with any registered
# extension removed (i.e., equivalently, the names of the test logs, with
# the '.log' extension removed). The result is saved in the shell variable
# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
# since that might cause problem with VPATH rewrites for suffix-less tests.
# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
am__set_TESTS_bases = \
bases='$(TEST_LOGS)'; \
bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
bases=`echo $$bases`
RECHECK_LOGS = $(TEST_LOGS)
AM_RECURSIVE_TARGETS = check recheck
TEST_SUITE_LOG = test-suite.log
am__test_logs1 = $(TESTS:=.log)
am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
am__test_logs3 = $(am__test_logs2:.mkfs.log=.log)
MKFS_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
MKFS_LOG_COMPILE = $(MKFS_LOG_COMPILER) $(AM_MKFS_LOG_FLAGS) \
$(MKFS_LOG_FLAGS)
am__set_b = \
case '$@' in \
*/*) \
case '$*' in \
*/*) b='$*';; \
*) b=`echo '$@' | sed 's/\.log$$//'`; \
esac;; \
*) \
b='$*';; \
esac
am__test_logs4 = $(am__test_logs3:.fsck.log=.log)
FSCK_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
FSCK_LOG_COMPILE = $(FSCK_LOG_COMPILER) $(AM_FSCK_LOG_FLAGS) \
$(FSCK_LOG_FLAGS)
TEST_LOGS = $(am__test_logs4:.label.log=.log)
LABEL_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
LABEL_LOG_COMPILE = $(LABEL_LOG_COMPILER) $(AM_LABEL_LOG_FLAGS) \
$(LABEL_LOG_FLAGS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/test-driver
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHECKATARI = @CHECKATARI@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RELEASE_DATE = @RELEASE_DATE@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
XXD_FOUND = @XXD_FOUND@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_TESTS_ENVIRONMENT = XXD_FOUND=@XXD_FOUND@; export XXD_FOUND;
@AUTOMAKE_TEST_COMPAT_TRUE@TESTS_ENVIRONMENT = $(AM_TESTS_ENVIRONMENT)
TESTS = referenceFAT12.mkfs \
referenceFAT16.mkfs \
referenceFAT32.mkfs \
referenceFAT32mbr.mkfs \
mkfs-fat32_2_res_sects.mkfs \
mkfs-fat32_4K.mkfs \
check-bad_names.fsck \
check-fat12_first_cluster.fsck \
check-fat16_first_cluster.fsck \
check-fat32_first_cluster.fsck \
check-fat16_dos_cln_shut.fsck \
check-fat32_dos_cln_shut.fsck \
check-chain_to_free_cluster.fsck \
check-chain_too_long.fsck \
check-chain_to_other_file.fsck \
check-circular_chain.fsck \
check-duplicate_names.fsck \
check-dot_entries.fsck \
check-huge.fsck \
check-label-different.fsck \
check-label-only-boot.fsck \
check-label-only-root.fsck \
label-fat32_mkdosfs_label1_dosfslabel_empty.label \
label-fat32_mkdosfs_label1_dosfslabel_label2.label \
label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.label \
label-fat32_mkdosfs_label1_mlabel_erase.label \
label-fat32_mkdosfs_label1_mlabel_NO_NAME.label \
label-fat32_mkdosfs_label1_xp_erase.label \
label-fat32_mkdosfs_label1_xp_label2.label \
label-fat32_mkdosfs_label1.label \
label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.label \
label-fat32_mkdosfs_none_dosfslabel_label1.label \
label-fat32_mkdosfs_none_dosfslabel_NO_NAME.label \
label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.label \
label-fat32_mkdosfs_none_xp_label1.label \
label-fat32_mkdosfs_none.label \
label-fat32_xp_label1.label \
label-fat32_xp_none_dosfslabel_label1.label \
label-fat32_xp_none_mlabel_label1.label \
label-fat32_xp_none.label
XFAIL_TESTS = check-huge.fsck
TEST_EXTENSIONS = .mkfs .fsck .label
MKFS_LOG_COMPILER = $(srcdir)/test-mkfs
FSCK_LOG_COMPILER = $(srcdir)/test-fsck
LABEL_LOG_COMPILER = $(srcdir)/test-label
dist_check_DATA = test-mkfs test-fsck test-label \
referenceFAT12.mkfs \
referenceFAT12.xxd \
referenceFAT16.mkfs \
referenceFAT16.xxd \
referenceFAT32.mkfs \
referenceFAT32.xxd \
referenceFAT32mbr.mkfs \
referenceFAT32mbr.xxd \
mkfs-fat32_2_res_sects.mkfs \
mkfs-fat32_2_res_sects.xxd \
mkfs-fat32_4K.mkfs \
mkfs-fat32_4K.xxd \
check-bad_names.fsck \
check-bad_names.xxd \
check-fat12_first_cluster.fsck \
check-fat12_first_cluster.args \
check-fat12_first_cluster.xxd \
check-fat16_first_cluster.fsck \
check-fat16_first_cluster.args \
check-fat16_first_cluster.xxd \
check-fat32_first_cluster.fsck \
check-fat32_first_cluster.args \
check-fat32_first_cluster.xxd \
check-fat16_dos_cln_shut.fsck \
check-fat16_dos_cln_shut.xxd \
check-fat32_dos_cln_shut.fsck \
check-fat32_dos_cln_shut.xxd \
check-chain_to_free_cluster.fsck \
check-chain_to_free_cluster.xxd \
check-chain_too_long.fsck \
check-chain_too_long.xxd \
check-chain_to_other_file.fsck \
check-chain_to_other_file.xxd \
check-circular_chain.fsck \
check-circular_chain.xxd \
check-duplicate_names.fsck \
check-duplicate_names.xxd \
check-dot_entries.fsck \
check-dot_entries.xxd \
check-huge.fsck \
check-label-different.fsck \
check-label-different.xxd \
check-label-only-boot.fsck \
check-label-only-boot.xxd \
check-label-only-root.fsck \
check-label-only-root.xxd \
label-fat32_mkdosfs_label1_dosfslabel_empty.label \
label-fat32_mkdosfs_label1_dosfslabel_empty.xxd \
label-fat32_mkdosfs_label1_dosfslabel_label2.label \
label-fat32_mkdosfs_label1_dosfslabel_label2.xxd \
label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.label \
label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.xxd \
label-fat32_mkdosfs_label1_mlabel_erase.label \
label-fat32_mkdosfs_label1_mlabel_erase.xxd \
label-fat32_mkdosfs_label1_mlabel_NO_NAME.label \
label-fat32_mkdosfs_label1_mlabel_NO_NAME.xxd \
label-fat32_mkdosfs_label1_xp_erase.label \
label-fat32_mkdosfs_label1_xp_erase.xxd \
label-fat32_mkdosfs_label1_xp_label2.label \
label-fat32_mkdosfs_label1_xp_label2.xxd \
label-fat32_mkdosfs_label1.label \
label-fat32_mkdosfs_label1.xxd \
label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.label \
label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.xxd \
label-fat32_mkdosfs_none_dosfslabel_label1.label \
label-fat32_mkdosfs_none_dosfslabel_label1.xxd \
label-fat32_mkdosfs_none_dosfslabel_NO_NAME.label \
label-fat32_mkdosfs_none_dosfslabel_NO_NAME.xxd \
label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.label \
label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.xxd \
label-fat32_mkdosfs_none_xp_label1.label \
label-fat32_mkdosfs_none_xp_label1.xxd \
label-fat32_mkdosfs_none.label \
label-fat32_mkdosfs_none.xxd \
label-fat32_xp_label1.label \
label-fat32_xp_label1.xxd \
label-fat32_xp_none_dosfslabel_label1.label \
label-fat32_xp_none_dosfslabel_label1.xxd \
label-fat32_xp_none_mlabel_label1.label \
label-fat32_xp_none_mlabel_label1.xxd \
label-fat32_xp_none.label \
label-fat32_xp_none.xxd
all: all-am
.SUFFIXES:
.SUFFIXES: .fsck .fsck$(EXEEXT) .label .label$(EXEEXT) .log .mkfs .mkfs$(EXEEXT) .trs
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign tests/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
tags TAGS:
ctags CTAGS:
cscope cscopelist:
# Recover from deleted '.trs' file; this should ensure that
# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
# to avoid problems with "make -n".
.log.trs:
rm -f $< $@
$(MAKE) $(AM_MAKEFLAGS) $<
# Leading 'am--fnord' is there to ensure the list of targets does not
# expand to empty, as could happen e.g. with make check TESTS=''.
am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
am--force-recheck:
@:
$(TEST_SUITE_LOG): $(TEST_LOGS)
@$(am__set_TESTS_bases); \
am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
redo_bases=`for i in $$bases; do \
am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
done`; \
if test -n "$$redo_bases"; then \
redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
if $(am__make_dryrun); then :; else \
rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
fi; \
fi; \
if test -n "$$am__remaking_logs"; then \
echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
"recursion detected" >&2; \
elif test -n "$$redo_logs"; then \
am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
fi; \
if $(am__make_dryrun); then :; else \
st=0; \
errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
for i in $$redo_bases; do \
test -f $$i.trs && test -r $$i.trs \
|| { echo "$$errmsg $$i.trs" >&2; st=1; }; \
test -f $$i.log && test -r $$i.log \
|| { echo "$$errmsg $$i.log" >&2; st=1; }; \
done; \
test $$st -eq 0 || exit 1; \
fi
@$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
ws='[ ]'; \
results=`for b in $$bases; do echo $$b.trs; done`; \
test -n "$$results" || results=/dev/null; \
all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
if test `expr $$fail + $$xpass + $$error` -eq 0; then \
success=true; \
else \
success=false; \
fi; \
br='==================='; br=$$br$$br$$br$$br; \
result_count () \
{ \
if test x"$$1" = x"--maybe-color"; then \
maybe_colorize=yes; \
elif test x"$$1" = x"--no-color"; then \
maybe_colorize=no; \
else \
echo "$@: invalid 'result_count' usage" >&2; exit 4; \
fi; \
shift; \
desc=$$1 count=$$2; \
if test $$maybe_colorize = yes && test $$count -gt 0; then \
color_start=$$3 color_end=$$std; \
else \
color_start= color_end=; \
fi; \
echo "$${color_start}# $$desc $$count$${color_end}"; \
}; \
create_testsuite_report () \
{ \
result_count $$1 "TOTAL:" $$all "$$brg"; \
result_count $$1 "PASS: " $$pass "$$grn"; \
result_count $$1 "SKIP: " $$skip "$$blu"; \
result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
result_count $$1 "FAIL: " $$fail "$$red"; \
result_count $$1 "XPASS:" $$xpass "$$red"; \
result_count $$1 "ERROR:" $$error "$$mgn"; \
}; \
{ \
echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
$(am__rst_title); \
create_testsuite_report --no-color; \
echo; \
echo ".. contents:: :depth: 2"; \
echo; \
for b in $$bases; do echo $$b; done \
| $(am__create_global_log); \
} >$(TEST_SUITE_LOG).tmp || exit 1; \
mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
if $$success; then \
col="$$grn"; \
else \
col="$$red"; \
test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
fi; \
echo "$${col}$$br$${std}"; \
echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
echo "$${col}$$br$${std}"; \
create_testsuite_report --maybe-color; \
echo "$$col$$br$$std"; \
if $$success; then :; else \
echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
if test -n "$(PACKAGE_BUGREPORT)"; then \
echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
fi; \
echo "$$col$$br$$std"; \
fi; \
$$success || exit 1
check-TESTS: $(dist_check_DATA)
@list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
@list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@set +e; $(am__set_TESTS_bases); \
log_list=`for i in $$bases; do echo $$i.log; done`; \
trs_list=`for i in $$bases; do echo $$i.trs; done`; \
log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
exit $$?;
recheck: all $(dist_check_DATA)
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@set +e; $(am__set_TESTS_bases); \
bases=`for i in $$bases; do echo $$i; done \
| $(am__list_recheck_tests)` || exit 1; \
log_list=`for i in $$bases; do echo $$i.log; done`; \
log_list=`echo $$log_list`; \
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
am__force_recheck=am--force-recheck \
TEST_LOGS="$$log_list"; \
exit $$?
.mkfs.log:
@p='$<'; \
$(am__set_b); \
$(am__check_pre) $(MKFS_LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_MKFS_LOG_DRIVER_FLAGS) $(MKFS_LOG_DRIVER_FLAGS) -- $(MKFS_LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
@am__EXEEXT_TRUE@.mkfs$(EXEEXT).log:
@am__EXEEXT_TRUE@ @p='$<'; \
@am__EXEEXT_TRUE@ $(am__set_b); \
@am__EXEEXT_TRUE@ $(am__check_pre) $(MKFS_LOG_DRIVER) --test-name "$$f" \
@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_MKFS_LOG_DRIVER_FLAGS) $(MKFS_LOG_DRIVER_FLAGS) -- $(MKFS_LOG_COMPILE) \
@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
.fsck.log:
@p='$<'; \
$(am__set_b); \
$(am__check_pre) $(FSCK_LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_FSCK_LOG_DRIVER_FLAGS) $(FSCK_LOG_DRIVER_FLAGS) -- $(FSCK_LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
@am__EXEEXT_TRUE@.fsck$(EXEEXT).log:
@am__EXEEXT_TRUE@ @p='$<'; \
@am__EXEEXT_TRUE@ $(am__set_b); \
@am__EXEEXT_TRUE@ $(am__check_pre) $(FSCK_LOG_DRIVER) --test-name "$$f" \
@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_FSCK_LOG_DRIVER_FLAGS) $(FSCK_LOG_DRIVER_FLAGS) -- $(FSCK_LOG_COMPILE) \
@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
.label.log:
@p='$<'; \
$(am__set_b); \
$(am__check_pre) $(LABEL_LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LABEL_LOG_DRIVER_FLAGS) $(LABEL_LOG_DRIVER_FLAGS) -- $(LABEL_LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
@am__EXEEXT_TRUE@.label$(EXEEXT).log:
@am__EXEEXT_TRUE@ @p='$<'; \
@am__EXEEXT_TRUE@ $(am__set_b); \
@am__EXEEXT_TRUE@ $(am__check_pre) $(LABEL_LOG_DRIVER) --test-name "$$f" \
@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_LABEL_LOG_DRIVER_FLAGS) $(LABEL_LOG_DRIVER_FLAGS) -- $(LABEL_LOG_COMPILE) \
@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(dist_check_DATA)
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
-test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
-test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
-test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: check-am install-am install-strip
.PHONY: all all-am check check-TESTS check-am clean clean-generic \
cscopelist-am ctags-am distclean distclean-generic distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am recheck tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
dosfstools-4.2/tests/label-fat32_xp_none.xxd 0000644 0001750 0001750 00000016200 14005523510 016102 0000000 0000000 00000000: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 2994 dcb6 544e 4f20 4e41 4d45 2020 ..)...TNO NAME
00000050: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
00000060: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
00000070: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
00000080: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
00000090: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
000000a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
000000b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
000000c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
000000d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
000000e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
000000f0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
00000100: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
00000110: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
00000120: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
00000130: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
00000140: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
00000150: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
00000160: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
00000170: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
00000180: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000190: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000001a0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
000001b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
000001c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
000001d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
000001e0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
000001f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 ffff ffff 0200 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000005f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000600: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 2994 dcb6 544e 4f20 4e41 4d45 2020 ..)...TNO NAME
00000c50: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
00000c60: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
00000c70: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
00000c80: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
00000c90: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
00000ca0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
00000cb0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
00000cc0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
00000cd0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
00000ce0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
00000cf0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
00000d00: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
00000d10: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
00000d20: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
00000d30: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
00000d40: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
00000d50: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
00000d60: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
00000d70: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
00000d80: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000d90: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000da0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
00000db0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
00000dc0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
00000dd0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
00000de0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
00000df0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000fe0: 0000 0000 7272 4161 ffff ffff 0200 0000 ....rrAa........
00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001800: 660f b646 1066 8b4e 2466 f7e1 6603 461c f..F.f.N$f..f.F.
00001810: 660f b756 0e66 03c2 6689 46fc 66c7 46f4 f..V.f..f.F.f.F.
00001820: ffff ffff 668b 462c 6683 f802 0f82 a6fc ....f.F,f.......
00001830: 663d f8ff ff0f 0f83 9cfc 6650 6683 e802 f=........fPf...
00001840: 660f b65e 0d8b f366 f7e3 6603 46fc bb00 f..^...f..f.F...
00001850: 828b fbb9 0100 e887 fc38 2d74 1eb1 0b56 .........8-t...V
00001860: be70 7df3 a65e 741b 03f9 83c7 153b fb72 .p}..^t......;.r
00001870: e84e 75da 6658 e865 0072 bf83 c404 e955 .Nu.fX.e.r.....U
00001880: fc00 2083 c404 8b75 098b 7d0f 8bc6 66c1 .. ....u..}...f.
00001890: e010 8bc7 6683 f802 0f82 3afc 663d f8ff ....f.....:.f=..
000018a0: ff0f 0f83 30fc 6650 6683 e802 660f b64e ....0.fPf...f..N
000018b0: 0d66 f7e1 6603 46fc bb00 0006 8e06 8180 .f..f.F.........
000018c0: e81d fc07 6658 c1eb 0401 1e81 80e8 0e00 ....fX..........
000018d0: 0f83 0200 72d0 8a56 40ea 0000 0020 66c1 ....r..V@.... f.
000018e0: e002 e811 0026 668b 0166 25ff ffff 0f66 .....&f..f%....f
000018f0: 3df8 ffff 0fc3 bf00 7e66 0fb7 4e0b 6633 =.......~f..N.f3
00001900: d266 f7f1 663b 46f4 743a 6689 46f4 6603 .f..f;F.t:f.F.f.
00001910: 461c 660f b74e 0e66 03c1 660f b75e 2883 F.f..N.f..f..^(.
00001920: e30f 7416 3a5e 100f 83ab fb52 668b c866 ..t.:^.....Rf..f
00001930: 8b46 2466 f7e3 6603 c15a 528b dfb9 0100 .F$f..f..ZR.....
00001940: e89d fb5a 8bda c300 0000 0000 0000 0000 ...Z............
00001950: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001a00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ff0f ffff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ff0f ffff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/label-fat32_xp_none.label 0000644 0001750 0001750 00000000000 14005523510 016345 0000000 0000000 dosfstools-4.2/tests/label-fat32_xp_none_mlabel_label1.xxd 0000644 0001750 0001750 00000020302 14005523510 020634 0000000 0000000 00000000: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 2994 dcb6 544c 4142 454c 3120 2020 ..)...TLABEL1
00000050: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
00000060: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
00000070: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
00000080: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
00000090: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
000000a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
000000b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
000000c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
000000d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
000000e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
000000f0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
00000100: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
00000110: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
00000120: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
00000130: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
00000140: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
00000150: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
00000160: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
00000170: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
00000180: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000190: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000001a0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
000001b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
000001c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
000001d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
000001e0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
000001f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 ffff ffff 0200 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000005f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000600: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 2994 dcb6 544c 4142 454c 3120 2020 ..)...TLABEL1
00000c50: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
00000c60: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
00000c70: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
00000c80: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
00000c90: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
00000ca0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
00000cb0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
00000cc0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
00000cd0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
00000ce0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
00000cf0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
00000d00: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
00000d10: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
00000d20: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
00000d30: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
00000d40: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
00000d50: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
00000d60: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
00000d70: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
00000d80: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000d90: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000da0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
00000db0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
00000dc0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
00000dd0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
00000de0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
00000df0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000fe0: 0000 0000 7272 4161 ffff ffff 0200 0000 ....rrAa........
00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001800: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
00001810: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
00001820: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00001830: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00001840: 0000 2994 dcb6 544e 4f20 4e41 4d45 2020 ..)...TNO NAME
00001850: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
00001860: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
00001870: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
00001880: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
00001890: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
000018a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
000018b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
000018c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
000018d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
000018e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
000018f0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
00001900: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
00001910: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
00001920: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
00001930: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
00001940: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
00001950: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
00001960: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
00001970: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
00001980: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00001990: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000019a0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
000019b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
000019c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
000019d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
000019e0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
000019f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
00001a00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00001a10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001be0: 0000 0000 7272 4161 ffff ffff 0200 0000 ....rrAa........
00001bf0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001c00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ff0f ffff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ff0f ffff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00086000: 4c41 4245 4c31 2020 2020 2008 0000 f3b6 LABEL1 .....
00086010: 4b4b 4b4b 0000 f3b6 4b4b 0000 0000 0000 KKKK....KK......
00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/label-fat32_xp_none_mlabel_label1.label 0000644 0001750 0001750 00000000007 14005523510 021110 0000000 0000000 LABEL1
dosfstools-4.2/tests/label-fat32_xp_none_dosfslabel_label1.xxd 0000644 0001750 0001750 00000016200 14005523510 021520 0000000 0000000 00000000: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 2994 dcb6 546c 6162 656c 3120 2020 ..)...Tlabel1
00000050: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
00000060: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
00000070: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
00000080: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
00000090: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
000000a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
000000b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
000000c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
000000d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
000000e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
000000f0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
00000100: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
00000110: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
00000120: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
00000130: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
00000140: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
00000150: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
00000160: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
00000170: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
00000180: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000190: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000001a0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
000001b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
000001c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
000001d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
000001e0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
000001f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 ffff ffff 0200 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000005f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000600: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 2994 dcb6 546c 6162 656c 3120 2020 ..)...Tlabel1
00000c50: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
00000c60: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
00000c70: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
00000c80: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
00000c90: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
00000ca0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
00000cb0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
00000cc0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
00000cd0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
00000ce0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
00000cf0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
00000d00: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
00000d10: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
00000d20: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
00000d30: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
00000d40: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
00000d50: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
00000d60: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
00000d70: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
00000d80: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000d90: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000da0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
00000db0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
00000dc0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
00000dd0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
00000de0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
00000df0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000fe0: 0000 0000 7272 4161 ffff ffff 0200 0000 ....rrAa........
00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001800: 660f b646 1066 8b4e 2466 f7e1 6603 461c f..F.f.N$f..f.F.
00001810: 660f b756 0e66 03c2 6689 46fc 66c7 46f4 f..V.f..f.F.f.F.
00001820: ffff ffff 668b 462c 6683 f802 0f82 a6fc ....f.F,f.......
00001830: 663d f8ff ff0f 0f83 9cfc 6650 6683 e802 f=........fPf...
00001840: 660f b65e 0d8b f366 f7e3 6603 46fc bb00 f..^...f..f.F...
00001850: 828b fbb9 0100 e887 fc38 2d74 1eb1 0b56 .........8-t...V
00001860: be70 7df3 a65e 741b 03f9 83c7 153b fb72 .p}..^t......;.r
00001870: e84e 75da 6658 e865 0072 bf83 c404 e955 .Nu.fX.e.r.....U
00001880: fc00 2083 c404 8b75 098b 7d0f 8bc6 66c1 .. ....u..}...f.
00001890: e010 8bc7 6683 f802 0f82 3afc 663d f8ff ....f.....:.f=..
000018a0: ff0f 0f83 30fc 6650 6683 e802 660f b64e ....0.fPf...f..N
000018b0: 0d66 f7e1 6603 46fc bb00 0006 8e06 8180 .f..f.F.........
000018c0: e81d fc07 6658 c1eb 0401 1e81 80e8 0e00 ....fX..........
000018d0: 0f83 0200 72d0 8a56 40ea 0000 0020 66c1 ....r..V@.... f.
000018e0: e002 e811 0026 668b 0166 25ff ffff 0f66 .....&f..f%....f
000018f0: 3df8 ffff 0fc3 bf00 7e66 0fb7 4e0b 6633 =.......~f..N.f3
00001900: d266 f7f1 663b 46f4 743a 6689 46f4 6603 .f..f;F.t:f.F.f.
00001910: 461c 660f b74e 0e66 03c1 660f b75e 2883 F.f..N.f..f..^(.
00001920: e30f 7416 3a5e 100f 83ab fb52 668b c866 ..t.:^.....Rf..f
00001930: 8b46 2466 f7e3 6603 c15a 528b dfb9 0100 .F$f..f..ZR.....
00001940: e89d fb5a 8bda c300 0000 0000 0000 0000 ...Z............
00001950: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001a00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ff0f ffff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ff0f ffff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/label-fat32_xp_none_dosfslabel_label1.label 0000644 0001750 0001750 00000000000 14005523510 021763 0000000 0000000 dosfstools-4.2/tests/label-fat32_xp_label1.xxd 0000644 0001750 0001750 00000016516 14005523510 016315 0000000 0000000 00000000: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 2904 9320 a44e 4f20 4e41 4d45 2020 ..).. .NO NAME
00000050: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
00000060: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
00000070: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
00000080: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
00000090: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
000000a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
000000b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
000000c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
000000d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
000000e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
000000f0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
00000100: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
00000110: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
00000120: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
00000130: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
00000140: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
00000150: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
00000160: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
00000170: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
00000180: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000190: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000001a0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
000001b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
000001c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
000001d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
000001e0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
000001f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000005f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000600: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 2904 9320 a44e 4f20 4e41 4d45 2020 ..).. .NO NAME
00000c50: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
00000c60: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
00000c70: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
00000c80: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
00000c90: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
00000ca0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
00000cb0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
00000cc0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
00000cd0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
00000ce0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
00000cf0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
00000d00: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
00000d10: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
00000d20: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
00000d30: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
00000d40: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
00000d50: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
00000d60: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
00000d70: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
00000d80: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000d90: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000da0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
00000db0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
00000dc0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
00000dd0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
00000de0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
00000df0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000fe0: 0000 0000 7272 4161 ffff ffff 0200 0000 ....rrAa........
00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001800: 660f b646 1066 8b4e 2466 f7e1 6603 461c f..F.f.N$f..f.F.
00001810: 660f b756 0e66 03c2 6689 46fc 66c7 46f4 f..V.f..f.F.f.F.
00001820: ffff ffff 668b 462c 6683 f802 0f82 a6fc ....f.F,f.......
00001830: 663d f8ff ff0f 0f83 9cfc 6650 6683 e802 f=........fPf...
00001840: 660f b65e 0d8b f366 f7e3 6603 46fc bb00 f..^...f..f.F...
00001850: 828b fbb9 0100 e887 fc38 2d74 1eb1 0b56 .........8-t...V
00001860: be70 7df3 a65e 741b 03f9 83c7 153b fb72 .p}..^t......;.r
00001870: e84e 75da 6658 e865 0072 bf83 c404 e955 .Nu.fX.e.r.....U
00001880: fc00 2083 c404 8b75 098b 7d0f 8bc6 66c1 .. ....u..}...f.
00001890: e010 8bc7 6683 f802 0f82 3afc 663d f8ff ....f.....:.f=..
000018a0: ff0f 0f83 30fc 6650 6683 e802 660f b64e ....0.fPf...f..N
000018b0: 0d66 f7e1 6603 46fc bb00 0006 8e06 8180 .f..f.F.........
000018c0: e81d fc07 6658 c1eb 0401 1e81 80e8 0e00 ....fX..........
000018d0: 0f83 0200 72d0 8a56 40ea 0000 0020 66c1 ....r..V@.... f.
000018e0: e002 e811 0026 668b 0166 25ff ffff 0f66 .....&f..f%....f
000018f0: 3df8 ffff 0fc3 bf00 7e66 0fb7 4e0b 6633 =.......~f..N.f3
00001900: d266 f7f1 663b 46f4 743a 6689 46f4 6603 .f..f;F.t:f.F.f.
00001910: 461c 660f b74e 0e66 03c1 660f b75e 2883 F.f..N.f..f..^(.
00001920: e30f 7416 3a5e 100f 83ab fb52 668b c866 ..t.:^.....Rf..f
00001930: 8b46 2466 f7e3 6603 c15a 528b dfb9 0100 .F$f..f..ZR.....
00001940: e89d fb5a 8bda c300 0000 0000 0000 0000 ...Z............
00001950: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001a00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ffff ffff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ffff ffff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00086000: 4c41 4245 4c31 2020 2020 2008 0000 0000 LABEL1 .....
00086010: 0000 0000 0000 eab5 4b4b 0000 0000 0000 ........KK......
00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/label-fat32_xp_label1.label 0000644 0001750 0001750 00000000007 14005523510 016555 0000000 0000000 LABEL1
dosfstools-4.2/tests/label-fat32_mkdosfs_none.xxd 0000644 0001750 0001750 00000005572 14005523510 017133 0000000 0000000 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 298c afb8 e620 2020 2020 2020 2020 ..)....
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0200 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 298c afb8 e620 2020 2020 2020 2020 ..)....
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/label-fat32_mkdosfs_none.label 0000644 0001750 0001750 00000000000 14005523510 017364 0000000 0000000 dosfstools-4.2/tests/label-fat32_mkdosfs_none_xp_label1.xxd 0000644 0001750 0001750 00000006110 14005523510 021047 0000000 0000000 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 298c afb8 e620 2020 2020 2020 2020 ..)....
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 298c afb8 e620 2020 2020 2020 2020 ..)....
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00086000: 4c41 4245 4c31 2020 2020 2008 0000 0000 LABEL1 .....
00086010: 0000 0000 0000 68aa 4b4b 0000 0000 0000 ......h.KK......
00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/label-fat32_mkdosfs_none_xp_label1.label 0000644 0001750 0001750 00000000007 14005523510 021322 0000000 0000000 LABEL1
dosfstools-4.2/tests/label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.xxd 0000644 0001750 0001750 00000006110 14005523510 024466 0000000 0000000 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 298c afb8 e66c 6162 656c 3220 2020 ..)....label2
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 298c afb8 e66c 6162 656c 3220 2020 ..)....label2
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00086000: 6c61 6265 6c32 2020 2020 2008 0000 0000 label2 .....
00086010: 0000 0000 0000 93aa 4b4b 0000 0000 0000 ........KK......
00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.label 0000644 0001750 0001750 00000000007 14005523510 024741 0000000 0000000 label2
dosfstools-4.2/tests/label-fat32_mkdosfs_none_dosfslabel_NO_NAME.xxd 0000644 0001750 0001750 00000005572 14005523510 022525 0000000 0000000 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 298c afb8 e64e 4f20 4e41 4d45 2020 ..)....NO NAME
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0200 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 298c afb8 e64e 4f20 4e41 4d45 2020 ..)....NO NAME
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/label-fat32_mkdosfs_none_dosfslabel_NO_NAME.label 0000644 0001750 0001750 00000000000 14005523510 022756 0000000 0000000 dosfstools-4.2/tests/label-fat32_mkdosfs_none_dosfslabel_label1.xxd 0000644 0001750 0001750 00000005572 14005523510 022551 0000000 0000000 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 298c afb8 e66c 6162 656c 3120 2020 ..)....label1
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0200 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 298c afb8 e66c 6162 656c 3120 2020 ..)....label1
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/label-fat32_mkdosfs_none_dosfslabel_label1.label 0000644 0001750 0001750 00000000000 14005523510 023002 0000000 0000000 dosfstools-4.2/tests/label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.xxd 0000644 0001750 0001750 00000006110 14005523510 024466 0000000 0000000 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 298c afb8 e66c 6162 656c 3120 2020 ..)....label1
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 298c afb8 e66c 6162 656c 3120 2020 ..)....label1
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00086000: 4c41 4245 4c32 2020 2020 2008 0000 0000 LABEL2 .....
00086010: 0000 0000 0000 37ab 4b4b 0000 0000 0000 ......7.KK......
00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.label 0000644 0001750 0001750 00000000007 14005523510 024741 0000000 0000000 LABEL2
dosfstools-4.2/tests/label-fat32_mkdosfs_label1.xxd 0000644 0001750 0001750 00000006110 14005523510 017321 0000000 0000000 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 2966 bab4 926c 6162 656c 3120 2020 ..)f...label1
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0200 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 2966 bab4 926c 6162 656c 3120 2020 ..)f...label1
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00086000: 6c61 6265 6c31 2020 2020 2008 0000 7bb0 label1 ...{.
00086010: 4b4b 4b4b 0000 7bb0 4b4b 0000 0000 0000 KKKK..{.KK......
00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/label-fat32_mkdosfs_label1.label 0000644 0001750 0001750 00000000007 14005523510 017574 0000000 0000000 label1
dosfstools-4.2/tests/label-fat32_mkdosfs_label1_xp_label2.xxd 0000644 0001750 0001750 00000006110 14005523510 021251 0000000 0000000 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 2966 bab4 926c 6162 656c 3120 2020 ..)f...label1
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 2966 bab4 926c 6162 656c 3120 2020 ..)f...label1
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00086000: 4c41 4245 4c32 2020 2020 2008 0000 0000 LABEL2 .....
00086010: 0000 0000 0000 62b3 4b4b 0000 0000 0000 ......b.KK......
00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/label-fat32_mkdosfs_label1_xp_label2.label 0000644 0001750 0001750 00000000007 14005523510 021524 0000000 0000000 LABEL2
dosfstools-4.2/tests/label-fat32_mkdosfs_label1_xp_erase.xxd 0000644 0001750 0001750 00000006110 14005523510 021207 0000000 0000000 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 2966 bab4 926c 6162 656c 3120 2020 ..)f...label1
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 2966 bab4 926c 6162 656c 3120 2020 ..)f...label1
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00086000: e561 6265 6c31 2020 2020 2008 0000 7bb0 .abel1 ...{.
00086010: 4b4b 4b4b 0000 7bb0 4b4b 0000 0000 0000 KKKK..{.KK......
00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/label-fat32_mkdosfs_label1_xp_erase.label 0000644 0001750 0001750 00000000000 14005523510 021453 0000000 0000000 dosfstools-4.2/tests/label-fat32_mkdosfs_label1_mlabel_NO_NAME.xxd 0000644 0001750 0001750 00000010742 14005523510 022037 0000000 0000000 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 2966 bab4 924e 4f20 4e41 4d45 2020 ..)f...NO NAME
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0200 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 2966 bab4 924e 4f20 4e41 4d45 2020 ..)f...NO NAME
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000fe0: 0000 0000 7272 4161 cf03 0100 0200 0000 ....rrAa........
00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001800: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00001810: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00001820: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00001830: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00001840: 0000 2966 bab4 926c 6162 656c 3120 2020 ..)f...label1
00001850: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00001860: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00001870: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00001880: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00001890: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000018a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000018b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000018c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000018d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000018e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001a00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00086000: 4e4f 204e 414d 4520 2020 2008 0000 91b5 NO NAME .....
00086010: 4b4b 4b4b 0000 91b5 4b4b 0000 0000 0000 KKKK....KK......
00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/label-fat32_mkdosfs_label1_mlabel_NO_NAME.label 0000644 0001750 0001750 00000000010 14005523510 022276 0000000 0000000 NO NAME
dosfstools-4.2/tests/label-fat32_mkdosfs_label1_mlabel_erase.xxd 0000644 0001750 0001750 00000010742 14005523510 022022 0000000 0000000 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 2966 bab4 924e 4f20 4e41 4d45 2020 ..)f...NO NAME
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0200 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 2966 bab4 924e 4f20 4e41 4d45 2020 ..)f...NO NAME
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000fe0: 0000 0000 7272 4161 cf03 0100 0200 0000 ....rrAa........
00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001800: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00001810: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00001820: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00001830: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00001840: 0000 2966 bab4 926c 6162 656c 3120 2020 ..)f...label1
00001850: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00001860: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00001870: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00001880: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00001890: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000018a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000018b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000018c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000018d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000018e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001a00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00086000: e561 6265 6c31 2020 2020 2000 0000 7bb0 .abel1 ...{.
00086010: 4b4b 4b4b 0000 7bb0 4b4b 0000 0000 0000 KKKK..{.KK......
00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/label-fat32_mkdosfs_label1_mlabel_erase.label 0000644 0001750 0001750 00000000000 14005523510 022260 0000000 0000000 dosfstools-4.2/tests/label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.xxd 0000644 0001750 0001750 00000006110 14005523510 022713 0000000 0000000 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 2966 bab4 924e 4f20 4e41 4d45 2020 ..)f...NO NAME
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0200 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 2966 bab4 924e 4f20 4e41 4d45 2020 ..)f...NO NAME
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00086000: 4e4f 204e 414d 4520 2020 2008 0000 7bb0 NO NAME ...{.
00086010: 4b4b 4b4b 0000 05b4 4b4b 0000 0000 0000 KKKK....KK......
00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.label 0000644 0001750 0001750 00000000010 14005523510 023160 0000000 0000000 NO NAME
dosfstools-4.2/tests/label-fat32_mkdosfs_label1_dosfslabel_label2.xxd 0000644 0001750 0001750 00000006110 14005523510 022740 0000000 0000000 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 2966 bab4 926c 6162 656c 3220 2020 ..)f...label2
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0200 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 2966 bab4 926c 6162 656c 3220 2020 ..)f...label2
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00086000: 6c61 6265 6c32 2020 2020 2008 0000 7bb0 label2 ...{.
00086010: 4b4b 4b4b 0000 b6b0 4b4b 0000 0000 0000 KKKK....KK......
00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/label-fat32_mkdosfs_label1_dosfslabel_label2.label 0000644 0001750 0001750 00000000007 14005523510 023213 0000000 0000000 label2
dosfstools-4.2/tests/label-fat32_mkdosfs_label1_dosfslabel_empty.xxd 0000644 0001750 0001750 00000006110 14005523510 022735 0000000 0000000 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 2966 bab4 9220 2020 2020 2020 2020 ..)f...
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0200 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 2966 bab4 9220 2020 2020 2020 2020 ..)f...
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00086000: 2020 2020 2020 2020 2020 2008 0000 7bb0 ...{.
00086010: 4b4b 4b4b 0000 65b4 4b4b 0000 0000 0000 KKKK..e.KK......
00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/label-fat32_mkdosfs_label1_dosfslabel_empty.label 0000644 0001750 0001750 00000000001 14005523510 023202 0000000 0000000
dosfstools-4.2/tests/check-label-only-root.xxd 0000644 0001750 0001750 00000016516 14005523510 016464 0000000 0000000 00000000: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 2904 9320 a44c 4142 454c 3120 2020 ..).. .LABEL1
00000050: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
00000060: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
00000070: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
00000080: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
00000090: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
000000a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
000000b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
000000c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
000000d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
000000e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
000000f0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
00000100: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
00000110: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
00000120: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
00000130: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
00000140: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
00000150: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
00000160: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
00000170: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
00000180: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000190: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000001a0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
000001b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
000001c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
000001d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
000001e0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
000001f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000005f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000600: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 2904 9320 a44c 4142 454c 3120 2020 ..).. .LABEL1
00000c50: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
00000c60: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
00000c70: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
00000c80: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
00000c90: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
00000ca0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
00000cb0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
00000cc0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
00000cd0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
00000ce0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
00000cf0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
00000d00: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
00000d10: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
00000d20: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
00000d30: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
00000d40: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
00000d50: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
00000d60: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
00000d70: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
00000d80: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000d90: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000da0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
00000db0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
00000dc0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
00000dd0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
00000de0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
00000df0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000fe0: 0000 0000 7272 4161 ffff ffff 0200 0000 ....rrAa........
00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001800: 660f b646 1066 8b4e 2466 f7e1 6603 461c f..F.f.N$f..f.F.
00001810: 660f b756 0e66 03c2 6689 46fc 66c7 46f4 f..V.f..f.F.f.F.
00001820: ffff ffff 668b 462c 6683 f802 0f82 a6fc ....f.F,f.......
00001830: 663d f8ff ff0f 0f83 9cfc 6650 6683 e802 f=........fPf...
00001840: 660f b65e 0d8b f366 f7e3 6603 46fc bb00 f..^...f..f.F...
00001850: 828b fbb9 0100 e887 fc38 2d74 1eb1 0b56 .........8-t...V
00001860: be70 7df3 a65e 741b 03f9 83c7 153b fb72 .p}..^t......;.r
00001870: e84e 75da 6658 e865 0072 bf83 c404 e955 .Nu.fX.e.r.....U
00001880: fc00 2083 c404 8b75 098b 7d0f 8bc6 66c1 .. ....u..}...f.
00001890: e010 8bc7 6683 f802 0f82 3afc 663d f8ff ....f.....:.f=..
000018a0: ff0f 0f83 30fc 6650 6683 e802 660f b64e ....0.fPf...f..N
000018b0: 0d66 f7e1 6603 46fc bb00 0006 8e06 8180 .f..f.F.........
000018c0: e81d fc07 6658 c1eb 0401 1e81 80e8 0e00 ....fX..........
000018d0: 0f83 0200 72d0 8a56 40ea 0000 0020 66c1 ....r..V@.... f.
000018e0: e002 e811 0026 668b 0166 25ff ffff 0f66 .....&f..f%....f
000018f0: 3df8 ffff 0fc3 bf00 7e66 0fb7 4e0b 6633 =.......~f..N.f3
00001900: d266 f7f1 663b 46f4 743a 6689 46f4 6603 .f..f;F.t:f.F.f.
00001910: 461c 660f b74e 0e66 03c1 660f b75e 2883 F.f..N.f..f..^(.
00001920: e30f 7416 3a5e 100f 83ab fb52 668b c866 ..t.:^.....Rf..f
00001930: 8b46 2466 f7e3 6603 c15a 528b dfb9 0100 .F$f..f..ZR.....
00001940: e89d fb5a 8bda c300 0000 0000 0000 0000 ...Z............
00001950: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001a00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ffff ffff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ffff ffff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00086000: 4c41 4245 4c31 2020 2020 2008 0000 0000 LABEL1 .....
00086010: 0000 0000 0000 eab5 4b4b 0000 0000 0000 ........KK......
00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-label-only-root.fsck 0000644 0001750 0001750 00000016516 14005523510 016607 0000000 0000000 00000000: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 2904 9320 a44e 4f20 4e41 4d45 2020 ..).. .NO NAME
00000050: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
00000060: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
00000070: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
00000080: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
00000090: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
000000a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
000000b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
000000c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
000000d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
000000e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
000000f0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
00000100: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
00000110: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
00000120: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
00000130: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
00000140: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
00000150: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
00000160: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
00000170: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
00000180: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000190: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000001a0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
000001b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
000001c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
000001d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
000001e0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
000001f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000005f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000600: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 904d 5344 4f53 352e 3000 0201 2000 .X.MSDOS5.0... .
00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 2904 9320 a44e 4f20 4e41 4d45 2020 ..).. .NO NAME
00000c50: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4 FAT32 3.....
00000c60: 7b8e c18e d9bd 007c 884e 028a 5640 b408 {......|.N..V@..
00000c70: cd13 7305 b9ff ff8a f166 0fb6 c640 660f ..s......f...@f.
00000c80: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7 ....?.......Af..
00000c90: c966 f7e1 6689 46f8 837e 1600 7538 837e .f..f.F..~..u8.~
00000ca0: 2a00 7732 668b 461c 6683 c00c bb00 80b9 *.w2f.F.f.......
00000cb0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac ...+..H...}.}...
00000cc0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb ..t.<.t.........
00000cd0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19 ...}....}.......
00000ce0: 6660 663b 46f8 0f82 4a00 666a 0066 5006 f`f;F...J.fj.fP.
00000cf0: 5366 6810 0001 0080 7e02 000f 8520 00b4 Sfh.....~.... ..
00000d00: 41bb aa55 8a56 40cd 130f 821c 0081 fb55 A..U.V@........U
00000d10: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4 .............F..
00000d20: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658 B.V@......fXfXfX
00000d30: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe fX.*f3.f..N.f...
00000d40: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a ...f..f....v....
00000d50: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661 V@............fa
00000d60: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3 ..T.....f@I..q..
00000d70: 4e54 4c44 5220 2020 2020 2000 0000 0000 NTLDR .....
00000d80: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000d90: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000da0: 0000 0000 0000 0000 0000 0000 0d0a 5265 ..............Re
00000db0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74 move disks or ot
00000dc0: 6865 7220 6d65 6469 612e ff0d 0a44 6973 her media....Dis
00000dd0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320 k error...Press
00000de0: 616e 7920 6b65 7920 746f 2072 6573 7461 any key to resta
00000df0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa rt............U.
00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000fe0: 0000 0000 7272 4161 ffff ffff 0200 0000 ....rrAa........
00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001800: 660f b646 1066 8b4e 2466 f7e1 6603 461c f..F.f.N$f..f.F.
00001810: 660f b756 0e66 03c2 6689 46fc 66c7 46f4 f..V.f..f.F.f.F.
00001820: ffff ffff 668b 462c 6683 f802 0f82 a6fc ....f.F,f.......
00001830: 663d f8ff ff0f 0f83 9cfc 6650 6683 e802 f=........fPf...
00001840: 660f b65e 0d8b f366 f7e3 6603 46fc bb00 f..^...f..f.F...
00001850: 828b fbb9 0100 e887 fc38 2d74 1eb1 0b56 .........8-t...V
00001860: be70 7df3 a65e 741b 03f9 83c7 153b fb72 .p}..^t......;.r
00001870: e84e 75da 6658 e865 0072 bf83 c404 e955 .Nu.fX.e.r.....U
00001880: fc00 2083 c404 8b75 098b 7d0f 8bc6 66c1 .. ....u..}...f.
00001890: e010 8bc7 6683 f802 0f82 3afc 663d f8ff ....f.....:.f=..
000018a0: ff0f 0f83 30fc 6650 6683 e802 660f b64e ....0.fPf...f..N
000018b0: 0d66 f7e1 6603 46fc bb00 0006 8e06 8180 .f..f.F.........
000018c0: e81d fc07 6658 c1eb 0401 1e81 80e8 0e00 ....fX..........
000018d0: 0f83 0200 72d0 8a56 40ea 0000 0020 66c1 ....r..V@.... f.
000018e0: e002 e811 0026 668b 0166 25ff ffff 0f66 .....&f..f%....f
000018f0: 3df8 ffff 0fc3 bf00 7e66 0fb7 4e0b 6633 =.......~f..N.f3
00001900: d266 f7f1 663b 46f4 743a 6689 46f4 6603 .f..f;F.t:f.F.f.
00001910: 461c 660f b74e 0e66 03c1 660f b75e 2883 F.f..N.f..f..^(.
00001920: e30f 7416 3a5e 100f 83ab fb52 668b c866 ..t.:^.....Rf..f
00001930: 8b46 2466 f7e3 6603 c15a 528b dfb9 0100 .F$f..f..ZR.....
00001940: e89d fb5a 8bda c300 0000 0000 0000 0000 ...Z............
00001950: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001a00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ffff ffff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ffff ffff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00086000: 4c41 4245 4c31 2020 2020 2008 0000 0000 LABEL1 .....
00086010: 0000 0000 0000 eab5 4b4b 0000 0000 0000 ........KK......
00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-label-only-boot.xxd 0000644 0001750 0001750 00000006110 14005523510 016431 0000000 0000000 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 2966 bab4 924e 4f20 4e41 4d45 2020 ..)f...NO NAME
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 2966 bab4 924e 4f20 4e41 4d45 2020 ..)f...NO NAME
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00086000: e561 6265 6c31 2020 2020 2008 0000 7bb0 .abel1 ...{.
00086010: 4b4b 4b4b 0000 7bb0 4b4b 0000 0000 0000 KKKK..{.KK......
00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-label-only-boot.fsck 0000644 0001750 0001750 00000006110 14005523510 016554 0000000 0000000 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 2966 bab4 926c 6162 656c 3120 2020 ..)f...label1
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 2966 bab4 926c 6162 656c 3120 2020 ..)f...label1
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00086000: e561 6265 6c31 2020 2020 2008 0000 7bb0 .abel1 ...{.
00086010: 4b4b 4b4b 0000 7bb0 4b4b 0000 0000 0000 KKKK..{.KK......
00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-label-different.xxd 0000644 0001750 0001750 00000006110 14005523510 016455 0000000 0000000 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 298c afb8 e64c 4142 454c 3220 2020 ..)....LABEL2
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 298c afb8 e64c 4142 454c 3220 2020 ..)....LABEL2
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00086000: 4c41 4245 4c32 2020 2020 2008 0000 0000 LABEL2 .....
00086010: 0000 0000 0000 37ab 4b4b 0000 0000 0000 ......7.KK......
00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-label-different.fsck 0000644 0001750 0001750 00000006110 14005523510 016600 0000000 0000000 00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000010: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000020: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 298c afb8 e66c 6162 656c 3120 2020 ..)....label1
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000 .X.mkdosfs.... .
00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000c20: 0008 0100 0802 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 0000 298c afb8 e66c 6162 656c 3120 2020 ..)....label1
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000 ................
00045010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00086000: 4c41 4245 4c32 2020 2020 2008 0000 0000 LABEL2 .....
00086010: 0000 0000 0000 37ab 4b4b 0000 0000 0000 ......7.KK......
00086020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-huge.fsck 0000644 0001750 0001750 00000005360 14005523510 014513 0000000 0000000 00000000: eb58 906d 6b66 732e 6661 7400 0201 2000 .X.mkfs.fat... .
00000010: 0100 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000020: 2100 000a 0000 0002 0000 0000 0200 0000 !...............
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 8000 2986 8e80 974e 4f20 4e41 4d45 2020 ..)....NO NAME
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 9b21 0300 0200 0000 ....rrAa.!......
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b66 732e 6661 7400 0201 2000 .X.mkfs.fat... .
00000c10: 0100 0000 00f8 0000 2000 4000 0000 0000 ........ .@.....
00000c20: 2100 000a 0000 0002 0000 0000 0200 0000 !...............
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 8000 2986 8e80 974e 4f20 4e41 4d45 2020 ..)....NO NAME
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
064ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-dot_entries.xxd 0000644 0001750 0001750 00000005470 14005523510 015761 0000000 0000000 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
00000010: 0200 0200 00f8 0001 2000 4000 0000 0000 ........ .@.....
00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001000: f8ff ffff 0000 ffff ffff ffff 0000 0000 ................
00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00021000: f8ff ffff 0000 ffff ffff ffff 0000 0000 ................
00021010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
00041020: 4449 5220 2020 2020 2020 2010 0064 2012 DIR ..d .
00041030: 2749 2749 0000 2012 2749 0300 0000 0000 'I'I.. .'I......
00041040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00046000: 2e20 2020 2020 2020 2020 2010 0000 0000 . .....
00046010: 0000 0000 0000 0000 0000 0300 0000 0000 ................
00046020: 2e2e 2020 2020 2020 2020 2010 0000 0000 .. .....
00046030: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00046040: e553 434b 3030 3030 3030 3010 0000 e611 .SCK0000000.....
00046050: 2749 2749 0000 e611 2749 0000 0000 0000 'I'I....'I......
00046060: e553 434b 3030 3030 3030 3110 0000 e611 .SCK0000001.....
00046070: 2749 2749 0000 e611 2749 0000 0000 0000 'I'I....'I......
00046080: 5445 5354 3120 2020 5458 5420 0064 2012 TEST1 TXT .d .
00046090: 2749 2749 0000 2012 2749 0400 0700 0000 'I'I.. .'I......
000460a0: 5445 5354 3220 2020 5458 5420 0064 2012 TEST2 TXT .d .
000460b0: 2749 2749 0000 2012 2749 0500 0700 0000 'I'I.. .'I......
000460c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00047000: 7465 7374 2031 0a00 0000 0000 0000 0000 test 1..........
00047010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00048000: 7465 7374 2032 0a00 0000 0000 0000 0000 test 2..........
00048010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-dot_entries.fsck 0000644 0001750 0001750 00000005050 14005523510 016076 0000000 0000000 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
00000010: 0200 0200 00f8 0001 2000 4000 0000 0000 ........ .@.....
00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001000: f8ff ffff 0000 ffff ffff ffff 0000 0000 ................
00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00021000: f8ff ffff 0000 ffff ffff ffff 0000 0000 ................
00021010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
00041020: 4449 5220 2020 2020 2020 2010 0064 2012 DIR ..d .
00041030: 2749 2749 0000 2012 2749 0300 0000 0000 'I'I.. .'I......
00041040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00046000: 5445 5354 3120 2020 5458 5420 0064 2012 TEST1 TXT .d .
00046010: 2749 2749 0000 2012 2749 0400 0700 0000 'I'I.. .'I......
00046020: 5445 5354 3220 2020 5458 5420 0064 2012 TEST2 TXT .d .
00046030: 2749 2749 0000 2012 2749 0500 0700 0000 'I'I.. .'I......
00046040: 2e2e 2020 2020 2020 2020 2010 0000 e611 .. .....
00046050: 2749 2749 0000 e611 2749 0000 0000 0000 'I'I....'I......
00046060: 2e20 2020 2020 2020 2020 2010 0000 e611 . .....
00046070: 2749 2749 0000 e611 2749 0300 0000 0000 'I'I....'I......
00046080: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00047000: 7465 7374 2031 0a00 0000 0000 0000 0000 test 1..........
00047010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00048000: 7465 7374 2032 0a00 0000 0000 0000 0000 test 2..........
00048010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-duplicate_names.xxd 0000644 0001750 0001750 00000004112 14005523510 016567 0000000 0000000 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
00000010: 0200 0200 00f8 0001 2000 4000 0000 0000 ........ .@.....
00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001000: f8ff ffff 0000 ffff ffff 0000 0000 0000 ................
00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00021000: f8ff ffff 0000 ffff ffff 0000 0000 0000 ................
00021010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
00041020: 5445 5354 2020 2020 5458 5420 0000 e95a TEST TXT ...Z
00041030: 2749 2749 0000 e95a 2749 0300 0700 0000 'I'I...Z'I......
00041040: 4653 434b 3030 3030 3030 3020 0000 e95a FSCK0000000 ...Z
00041050: 2749 2749 0000 e95a 2749 0400 0700 0000 'I'I...Z'I......
00041060: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00046000: 7465 7374 2031 0a00 0000 0000 0000 0000 test 1..........
00046010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00047000: 7465 7374 2032 0a00 0000 0000 0000 0000 test 2..........
00047010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-duplicate_names.fsck 0000644 0001750 0001750 00000004112 14005523510 016712 0000000 0000000 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
00000010: 0200 0200 00f8 0001 2000 4000 0000 0000 ........ .@.....
00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001000: f8ff ffff 0000 ffff ffff 0000 0000 0000 ................
00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00021000: f8ff ffff 0000 ffff ffff 0000 0000 0000 ................
00021010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
00041020: 5445 5354 2020 2020 5458 5420 0000 e95a TEST TXT ...Z
00041030: 2749 2749 0000 e95a 2749 0300 0700 0000 'I'I...Z'I......
00041040: 5445 5354 2020 2020 5458 5420 0000 e95a TEST TXT ...Z
00041050: 2749 2749 0000 e95a 2749 0400 0700 0000 'I'I...Z'I......
00041060: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00046000: 7465 7374 2031 0a00 0000 0000 0000 0000 test 1..........
00046010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00047000: 7465 7374 2032 0a00 0000 0000 0000 0000 test 2..........
00047010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-circular_chain.xxd 0000644 0001750 0001750 00000004536 14005523510 016412 0000000 0000000 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
00000010: 0200 0200 00f8 0001 2000 4000 0000 0000 ........ .@.....
00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001000: f8ff ffff 0000 0400 0500 f8ff ffff 0000 ................
00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00021000: f8ff ffff 0000 0400 0500 f8ff ffff 0000 ................
00021010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
00041020: 5445 5354 3443 4c53 5458 5420 0000 6f8d TEST4CLSTXT ..o.
00041030: 2c49 2c49 0000 6f8d 2c49 0300 0030 0000 ,I,I..o.,I...0..
00041040: 4653 434b 3030 3030 5245 4300 0000 0000 FSCK0000REC.....
00041050: 0000 0000 0000 0000 0000 0600 0010 0000 ................
00041060: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00046000: 7465 7374 2063 6c75 7374 6572 2031 0a00 test cluster 1..
00046010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00047000: 7465 7374 2063 6c75 7374 6572 2032 0a00 test cluster 2..
00047010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00048000: 7465 7374 2063 6c75 7374 6572 2033 0a00 test cluster 3..
00048010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00049000: 7465 7374 2063 6c75 7374 6572 2034 0a00 test cluster 4..
00049010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-circular_chain.fsck 0000644 0001750 0001750 00000004326 14005523510 016532 0000000 0000000 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
00000010: 0200 0200 00f8 0001 2000 4000 0000 0000 ........ .@.....
00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001000: f8ff ffff 0000 0400 0500 0400 ffff 0000 ................
00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00021000: f8ff ffff 0000 0400 0500 0400 ffff 0000 ................
00021010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
00041020: 5445 5354 3443 4c53 5458 5420 0000 6f8d TEST4CLSTXT ..o.
00041030: 2c49 2c49 0000 6f8d 2c49 0300 0040 0000 ,I,I..o.,I...@..
00041040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00046000: 7465 7374 2063 6c75 7374 6572 2031 0a00 test cluster 1..
00046010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00047000: 7465 7374 2063 6c75 7374 6572 2032 0a00 test cluster 2..
00047010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00048000: 7465 7374 2063 6c75 7374 6572 2033 0a00 test cluster 3..
00048010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00049000: 7465 7374 2063 6c75 7374 6572 2034 0a00 test cluster 4..
00049010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-chain_to_other_file.xxd 0000644 0001750 0001750 00000013400 14005523510 017416 0000000 0000000 00000000: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
00000020: 0040 1f00 d007 0000 0000 0000 0200 0000 .@..............
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 8000 29cd ab34 1254 4553 5446 4154 3332 ..)..4.TESTFAT32
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 fbe5 0300 0e00 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
00000c20: 0040 1f00 d007 0000 0000 0000 0200 0000 .@..............
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 8000 29cd ab34 1254 4553 5446 4154 3332 ..)..4.TESTFAT32
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ff0f f8ff ff0f 0400 0000 ................
00004010: 0500 0000 f8ff ff0f ffff ff0f 0800 0000 ................
00004020: 0d00 0000 0a00 0000 ffff ff0f 0c00 0000 ................
00004030: f8ff ff0f 0e00 0000 ffff ff0f 0000 0000 ................
00004040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000fe000: f8ff ff0f ffff ff0f f8ff ff0f 0400 0000 ................
000fe010: 0500 0000 f8ff ff0f ffff ff0f 0800 0000 ................
000fe020: 0d00 0000 0a00 0000 ffff ff0f 0c00 0000 ................
000fe030: f8ff ff0f 0e00 0000 ffff ff0f 0000 0000 ................
000fe040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
001f8000: 5445 5354 4641 5433 3220 2008 0000 5a4b TESTFAT32 ...ZK
001f8010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
001f8020: 5445 5354 524f 4f54 5458 5420 0064 1076 TESTROOTTXT .d.v
001f8030: 3149 3149 0000 1076 3149 0300 0030 0000 1I1I...v1I...0..
001f8040: 5445 5354 3120 2020 5458 5420 0064 1476 TEST1 TXT .d.v
001f8050: 3149 3149 0000 1476 3149 0700 0040 0000 1I1I...v1I...@..
001f8060: 5445 5354 3220 2020 5458 5420 0064 1576 TEST2 TXT .d.v
001f8070: 3149 3149 0000 1576 3149 0b00 0020 0000 1I1I...v1I... ..
001f8080: 4653 434b 3030 3030 5245 4300 0000 0000 FSCK0000REC.....
001f8090: 0000 0000 0000 0000 0000 0600 0010 0000 ................
001f80a0: 4653 434b 3030 3031 5245 4300 0000 0000 FSCK0001REC.....
001f80b0: 0000 0000 0000 0000 0000 0900 0020 0000 ............. ..
001f80c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
001f9000: 7465 7374 2063 6c75 7374 6572 2031 0a00 test cluster 1..
001f9010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
001fa000: 7465 7374 2063 6c75 7374 6572 2032 0a00 test cluster 2..
001fa010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
001fb000: 7465 7374 2063 6c75 7374 6572 2033 0a00 test cluster 3..
001fb010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
001fc000: 7465 7374 2063 6c75 7374 6572 2034 0a00 test cluster 4..
001fc010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
001fd000: 7465 7374 2063 6c75 7374 6572 2031 0a00 test cluster 1..
001fd010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
001fe000: 7465 7374 2063 6c75 7374 6572 2032 0a00 test cluster 2..
001fe010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
001ff000: 7465 7374 2063 6c75 7374 6572 2033 0a00 test cluster 3..
001ff010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00200000: 7465 7374 2063 6c75 7374 6572 2034 0a00 test cluster 4..
00200010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00201000: 7465 7374 2063 6c75 7374 6572 2031 0a00 test cluster 1..
00201010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00202000: 7465 7374 2063 6c75 7374 6572 2032 0a00 test cluster 2..
00202010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00203000: 7465 7374 2063 6c75 7374 6572 2033 0a00 test cluster 3..
00203010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00204000: 7465 7374 2063 6c75 7374 6572 2034 0a00 test cluster 4..
00204010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
3e7ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-chain_to_other_file.fsck 0000644 0001750 0001750 00000012760 14005523510 017551 0000000 0000000 00000000: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
00000020: 0040 1f00 d007 0000 0000 0000 0200 0000 .@..............
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 8000 29cd ab34 1254 4553 5446 4154 3332 ..)..4.TESTFAT32
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 fbe5 0300 0e00 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000 ........?.......
00000c20: 0040 1f00 d007 0000 0000 0000 0200 0000 .@..............
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 8000 29cd ab34 1254 4553 5446 4154 3332 ..)..4.TESTFAT32
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ff0f f8ff ff0f 0400 0000 ................
00004010: 0500 0000 0200 0000 ffff ff0f 0800 0000 ................
00004020: 0d00 0000 0a00 0000 ffff ff0f 0c00 0000 ................
00004030: 0d00 0000 0e00 0000 ffff ff0f 0000 0000 ................
00004040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000fe000: f8ff ff0f ffff ff0f f8ff ff0f 0400 0000 ................
000fe010: 0500 0000 0200 0000 ffff ff0f 0800 0000 ................
000fe020: 0d00 0000 0a00 0000 ffff ff0f 0c00 0000 ................
000fe030: 0d00 0000 0e00 0000 ffff ff0f 0000 0000 ................
000fe040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
001f8000: 5445 5354 4641 5433 3220 2008 0000 5a4b TESTFAT32 ...ZK
001f8010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
001f8020: 5445 5354 524f 4f54 5458 5420 0064 1076 TESTROOTTXT .d.v
001f8030: 3149 3149 0000 1076 3149 0300 0040 0000 1I1I...v1I...@..
001f8040: 5445 5354 3120 2020 5458 5420 0064 1476 TEST1 TXT .d.v
001f8050: 3149 3149 0000 1476 3149 0700 0040 0000 1I1I...v1I...@..
001f8060: 5445 5354 3220 2020 5458 5420 0064 1576 TEST2 TXT .d.v
001f8070: 3149 3149 0000 1576 3149 0b00 0040 0000 1I1I...v1I...@..
001f8080: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
001f9000: 7465 7374 2063 6c75 7374 6572 2031 0a00 test cluster 1..
001f9010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
001fa000: 7465 7374 2063 6c75 7374 6572 2032 0a00 test cluster 2..
001fa010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
001fb000: 7465 7374 2063 6c75 7374 6572 2033 0a00 test cluster 3..
001fb010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
001fc000: 7465 7374 2063 6c75 7374 6572 2034 0a00 test cluster 4..
001fc010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
001fd000: 7465 7374 2063 6c75 7374 6572 2031 0a00 test cluster 1..
001fd010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
001fe000: 7465 7374 2063 6c75 7374 6572 2032 0a00 test cluster 2..
001fe010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
001ff000: 7465 7374 2063 6c75 7374 6572 2033 0a00 test cluster 3..
001ff010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00200000: 7465 7374 2063 6c75 7374 6572 2034 0a00 test cluster 4..
00200010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00201000: 7465 7374 2063 6c75 7374 6572 2031 0a00 test cluster 1..
00201010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00202000: 7465 7374 2063 6c75 7374 6572 2032 0a00 test cluster 2..
00202010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00203000: 7465 7374 2063 6c75 7374 6572 2033 0a00 test cluster 3..
00203010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00204000: 7465 7374 2063 6c75 7374 6572 2034 0a00 test cluster 4..
00204010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
3e7ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-chain_too_long.xxd 0000644 0001750 0001750 00000003702 14005523510 016420 0000000 0000000 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
00000010: 0200 0200 00f8 0001 2000 4000 0000 0000 ........ .@.....
00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001000: f8ff ffff 0000 f8ff 0000 0000 0000 0000 ................
00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00021000: f8ff ffff 0000 f8ff 0000 0000 0000 0000 ................
00021010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
00041020: 5445 5354 2020 2020 5458 5420 0000 e95a TEST TXT ...Z
00041030: 2749 2749 0000 e95a 2749 0300 0700 0000 'I'I...Z'I......
00041040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00046000: 7465 7374 2031 0a00 0000 0000 0000 0000 test 1..........
00046010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00047000: 7465 7374 2032 0a00 0000 0000 0000 0000 test 2..........
00047010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-chain_too_long.fsck 0000644 0001750 0001750 00000003702 14005523510 016543 0000000 0000000 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
00000010: 0200 0200 00f8 0001 2000 4000 0000 0000 ........ .@.....
00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001000: f8ff ffff 0000 0400 ffff 0000 0000 0000 ................
00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00021000: f8ff ffff 0000 0400 ffff 0000 0000 0000 ................
00021010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
00041020: 5445 5354 2020 2020 5458 5420 0000 e95a TEST TXT ...Z
00041030: 2749 2749 0000 e95a 2749 0300 0700 0000 'I'I...Z'I......
00041040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00046000: 7465 7374 2031 0a00 0000 0000 0000 0000 test 1..........
00046010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00047000: 7465 7374 2032 0a00 0000 0000 0000 0000 test 2..........
00047010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-chain_to_free_cluster.xxd 0000644 0001750 0001750 00000003470 14005523510 017766 0000000 0000000 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
00000010: 0200 0200 00f8 0001 2000 4000 0000 0000 ........ .@.....
00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001000: f8ff ffff 0000 f8ff 0000 0000 0000 0000 ................
00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00021000: f8ff ffff 0000 f8ff 0000 0000 0000 0000 ................
00021010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
00041020: 5445 5354 2020 2020 5458 5420 0064 6a1b TEST TXT .dj.
00041030: 2749 2749 0000 6a1b 2749 0300 0500 0000 'I'I..j.'I......
00041040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00046000: 7465 7374 0a00 0000 0000 0000 0000 0000 test............
00046010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-chain_to_free_cluster.fsck 0000644 0001750 0001750 00000003470 14005523510 020111 0000000 0000000 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
00000010: 0200 0200 00f8 0001 2000 4000 0000 0000 ........ .@.....
00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001000: f8ff ffff 0000 0004 0000 0000 0000 0000 ................
00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00021000: f8ff ffff 0000 0004 0000 0000 0000 0000 ................
00021010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
00041020: 5445 5354 2020 2020 5458 5420 0064 6a1b TEST TXT .dj.
00041030: 2749 2749 0000 6a1b 2749 0300 0500 0000 'I'I..j.'I......
00041040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00046000: 7465 7374 0a00 0000 0000 0000 0000 0000 test............
00046010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-fat32_dos_cln_shut.xxd 0000644 0001750 0001750 00000006214 14005523510 017122 0000000 0000000 00000000: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
00000010: 0200 0000 00f8 0000 3f00 4000 0000 0000 ........?.@.....
00000020: f8ff 1f00 0008 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020 ..).JJ.NO NAME
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 fafd 0300 0200 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
00000c10: 0200 0000 00f8 0000 3f00 4000 0000 0000 ........?.@.....
00000c20: f8ff 1f00 0008 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020 ..).JJ.NO NAME
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000fe0: 0000 0000 7272 4161 fafd 0300 0200 0000 ....rrAa........
00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00104000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00104010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
3ffffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-fat32_dos_cln_shut.fsck 0000644 0001750 0001750 00000006214 14005523510 017245 0000000 0000000 00000000: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
00000010: 0200 0000 00f8 0000 3f00 4000 0000 0000 ........?.@.....
00000020: f8ff 1f00 0008 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020 ..).JJ.NO NAME
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 fafd 0300 0200 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
00000c10: 0200 0000 00f8 0000 3f00 4000 0000 0000 ........?.@.....
00000c20: f8ff 1f00 0008 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020 ..).JJ.NO NAME
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000fe0: 0000 0000 7272 4161 fafd 0300 0200 0000 ....rrAa........
00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ff07 f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00104000: f8ff ff0f ffff ff07 f8ff ff0f 0000 0000 ................
00104010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
3ffffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-fat16_dos_cln_shut.xxd 0000644 0001750 0001750 00000002530 14005523510 017121 0000000 0000000 00000000: eb3c 906d 6b66 732e 6661 7400 0204 0400 .<.mkfs.fat.....
00000010: 0200 0240 4cf8 1400 2000 0200 0000 0000 ...@L... .......
00000020: 0000 0000 8000 290f 1821 544e 4f20 4e41 ......)..!TNO NA
00000030: 4d45 2020 2020 4641 5431 3620 2020 0e1f ME FAT16 ..
00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000800: f8ff ffff 0000 0000 0000 0000 0000 0000 ................
00000810: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00003000: f8ff ffff 0000 0000 0000 0000 0000 0000 ................
00003010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00989670: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-fat16_dos_cln_shut.fsck 0000644 0001750 0001750 00000002530 14005523510 017244 0000000 0000000 00000000: eb3c 906d 6b66 732e 6661 7400 0204 0400 .<.mkfs.fat.....
00000010: 0200 0240 4cf8 1400 2000 0200 0000 0000 ...@L... .......
00000020: 0000 0000 8000 290f 1821 544e 4f20 4e41 ......)..!TNO NA
00000030: 4d45 2020 2020 4641 5431 3620 2020 0e1f ME FAT16 ..
00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000800: f8ff ff7f 0000 0000 0000 0000 0000 0000 ................
00000810: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00003000: f8ff ff7f 0000 0000 0000 0000 0000 0000 ................
00003010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00989670: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-fat32_first_cluster.xxd 0000644 0001750 0001750 00000006214 14005523510 017326 0000000 0000000 00000000: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
00000010: 0200 0000 00f8 0000 3f00 4000 0000 0000 ........?.@.....
00000020: f8ff 1f00 0008 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020 ..).JJ.NO NAME
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 fafd 0300 0200 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
00000c10: 0200 0000 00f8 0000 3f00 4000 0000 0000 ........?.@.....
00000c20: f8ff 1f00 0008 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020 ..).JJ.NO NAME
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000fe0: 0000 0000 7272 4161 fafd 0300 0200 0000 ....rrAa........
00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00104000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00104010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
3ffffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-fat32_first_cluster.args 0000644 0001750 0001750 00000000005 14005523510 017447 0000000 0000000 -F 1
dosfstools-4.2/tests/check-fat32_first_cluster.fsck 0000644 0001750 0001750 00000006214 14005523510 017451 0000000 0000000 00000000: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
00000010: 0200 0000 00f8 0000 3f00 4000 0000 0000 ........?.@.....
00000020: f8ff 1f00 0008 0000 0000 0000 0200 0000 ................
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020 ..).JJ.NO NAME
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 fafd 0300 0200 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
00000c10: 0200 0000 00f8 0000 3f00 4000 0000 0000 ........?.@.....
00000c20: f8ff 1f00 0008 0000 0000 0000 0200 0000 ................
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020 ..).JJ.NO NAME
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000fe0: 0000 0000 7272 4161 fafd 0300 0200 0000 ....rrAa........
00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: 0000 0000 ffff ff0f f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00104000: 0000 0000 ffff ff0f f8ff ff0f 0000 0000 ................
00104010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
3ffffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-fat16_first_cluster.xxd 0000644 0001750 0001750 00000002530 14005523510 017325 0000000 0000000 00000000: eb3c 906d 6b66 732e 6661 7400 0204 0400 .<.mkfs.fat.....
00000010: 0200 0240 4cf8 1400 2000 0200 0000 0000 ...@L... .......
00000020: 0000 0000 8000 290f 1821 544e 4f20 4e41 ......)..!TNO NA
00000030: 4d45 2020 2020 4641 5431 3620 2020 0e1f ME FAT16 ..
00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000800: f8ff ffff 0000 0000 0000 0000 0000 0000 ................
00000810: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00003000: f8ff ffff 0000 0000 0000 0000 0000 0000 ................
00003010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00989670: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-fat16_first_cluster.args 0000644 0001750 0001750 00000000005 14005523510 017451 0000000 0000000 -F 1
dosfstools-4.2/tests/check-fat16_first_cluster.fsck 0000644 0001750 0001750 00000002530 14005523510 017450 0000000 0000000 00000000: eb3c 906d 6b66 732e 6661 7400 0204 0400 .<.mkfs.fat.....
00000010: 0200 0240 4cf8 1400 2000 0200 0000 0000 ...@L... .......
00000020: 0000 0000 8000 290f 1821 544e 4f20 4e41 ......)..!TNO NA
00000030: 4d45 2020 2020 4641 5431 3620 2020 0e1f ME FAT16 ..
00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000800: 0000 ffff 0000 0000 0000 0000 0000 0000 ................
00000810: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00003000: 0000 ffff 0000 0000 0000 0000 0000 0000 ................
00003010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00989670: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-fat12_first_cluster.xxd 0000644 0001750 0001750 00000002422 14005523510 017321 0000000 0000000 00000000: eb3c 906d 6b66 732e 6661 7400 0204 0100 .<.mkfs.fat.....
00000010: 0200 02a0 07f8 0200 1000 0200 0000 0000 ................
00000020: 0000 0000 8000 2917 99fd 524e 4f20 4e41 ......)...RNO NA
00000030: 4d45 2020 2020 4641 5431 3220 2020 0e1f ME FAT12 ..
00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: f8ff ff00 0000 0000 0000 0000 0000 0000 ................
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000600: f8ff ff00 0000 0000 0000 0000 0000 0000 ................
00000610: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000f4230: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-fat12_first_cluster.args 0000644 0001750 0001750 00000000005 14005523510 017445 0000000 0000000 -F 1
dosfstools-4.2/tests/check-fat12_first_cluster.fsck 0000644 0001750 0001750 00000002422 14005523510 017444 0000000 0000000 00000000: eb3c 906d 6b66 732e 6661 7400 0204 0100 .<.mkfs.fat.....
00000010: 0200 02a0 07f8 0200 1000 0200 0000 0000 ................
00000020: 0000 0000 8000 2917 99fd 524e 4f20 4e41 ......)...RNO NA
00000030: 4d45 2020 2020 4641 5431 3220 2020 0e1f ME FAT12 ..
00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 00f0 ff00 0000 0000 0000 0000 0000 0000 ................
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000600: 00f0 ff00 0000 0000 0000 0000 0000 0000 ................
00000610: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000f4230: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-bad_names.xxd 0000644 0001750 0001750 00000004106 14005523510 015346 0000000 0000000 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
00000010: 0200 0200 00f8 0001 2000 4000 0000 0000 ........ .@.....
00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001000: f8ff ffff 0000 0000 0000 0000 0000 0000 ................
00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00021000: f8ff ffff 0000 0000 0000 0000 0000 0000 ................
00021010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
00041020: 4653 434b 3030 3030 3030 3020 0000 cca0 FSCK0000000 ....
00041030: 6249 6249 0000 cca0 6249 0000 0000 0000 bIbI....bI......
00041040: 4653 434b 3030 3030 3030 3120 0000 cea0 FSCK0000001 ....
00041050: 6249 6249 0000 cea0 6249 0000 0000 0000 bIbI....bI......
00041060: 4e41 4d45 3320 2020 4249 4e20 0064 cfa0 NAME3 BIN .d..
00041070: 6249 6249 0000 cfa0 6249 0000 0000 0000 bIbI....bI......
00041080: 4653 434b 3030 3030 3030 3220 0000 09a1 FSCK0000002 ....
00041090: 6249 6249 0000 09a1 6249 0000 0000 0000 bIbI....bI......
000410a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/check-bad_names.fsck 0000644 0001750 0001750 00000004106 14005523510 015471 0000000 0000000 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
00000010: 0200 0200 00f8 0001 2000 4000 0000 0000 ........ .@.....
00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001000: f8ff ffff 0000 0000 0000 0000 0000 0000 ................
00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00021000: f8ff ffff 0000 0000 0000 0000 0000 0000 ................
00021010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
00041020: 2041 4d45 3120 2020 4249 4e20 0000 cca0 AME1 BIN ....
00041030: 6249 6249 0000 cca0 6249 0000 0000 0000 bIbI....bI......
00041040: 2020 2020 2020 2020 2020 2020 0000 cea0 ....
00041050: 6249 6249 0000 cea0 6249 0000 0000 0000 bIbI....bI......
00041060: 4e41 4d45 3320 2020 4249 4e20 0064 cfa0 NAME3 BIN .d..
00041070: 6249 6249 0000 cfa0 6249 0000 0000 0000 bIbI....bI......
00041080: 4e3e 4d45 3420 2020 4249 4e20 0000 09a1 N>ME4 BIN ....
00041090: 6249 6249 0000 09a1 6249 0000 0000 0000 bIbI....bI......
000410a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/mkfs-fat32_4K.xxd 0000644 0001750 0001750 00000006746 14005523510 014611 0000000 0000000 00000000: eb58 906d 6b66 732e 6661 7400 1001 2000 .X.mkfs.fat... .
00000010: 0200 0000 00f8 0000 2000 0800 0000 0000 ........ .......
00000020: 0058 0200 9600 0000 0000 0000 0200 0000 .X..............
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 8000 29cd ab34 1254 4553 5434 4b20 2020 ..)..4.TEST4K
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001000: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000011e0: 0000 0000 7272 4161 b356 0200 0200 0000 ....rrAa.V......
000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00006000: eb58 906d 6b66 732e 6661 7400 1001 2000 .X.mkfs.fat... .
00006010: 0200 0000 00f8 0000 2000 0800 0000 0000 ........ .......
00006020: 0058 0200 9600 0000 0000 0000 0200 0000 .X..............
00006030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00006040: 8000 29cd ab34 1254 4553 5434 4b20 2020 ..)..4.TEST4K
00006050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00006060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00006070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00006080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00006090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000060a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000060b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000060c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000060d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000060e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000061f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00006200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00007000: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00007010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000071e0: 0000 0000 7272 4161 b356 0200 0200 0000 ....rrAa.V......
000071f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00007200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00020000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00020010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000b6000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
000b6010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
0014c000: 5445 5354 344b 2020 2020 2008 0000 5a4b TEST4K ...ZK
0014c010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
0014c020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
257ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/mkfs-fat32_4K.mkfs 0000644 0001750 0001750 00000000063 14005523510 014730 0000000 0000000 ARGS="-n TEST4K -S 4096"
SIZE=614400
CMP_LIMIT=10M
dosfstools-4.2/tests/mkfs-fat32_2_res_sects.xxd 0000644 0001750 0001750 00000003572 14005523510 016540 0000000 0000000 00000000: eb58 906d 6b66 732e 6661 7400 0208 0200 .X.mkfs.fat.....
00000010: 0200 0000 00f8 0000 3f00 2000 0000 0000 ........?. .....
00000020: 0040 1f00 cd07 0000 0000 0000 0200 0000 .@..............
00000030: 0100 0000 0000 0000 0000 0000 0000 0000 ................
00000040: 8000 29cd ab34 1254 4553 5446 4154 3332 ..)..4.TESTFAT32
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 0be6 0300 0200 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00000410: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000f9e00: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
000f9e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
001f3800: 5445 5354 4641 5433 3220 2008 0000 5a4b TESTFAT32 ...ZK
001f3810: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
001f3820: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
3e7ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/mkfs-fat32_2_res_sects.mkfs 0000644 0001750 0001750 00000000067 14005523510 016671 0000000 0000000 ARGS="-n TESTFAT32 -a -R 2"
SIZE=1024000
CMP_LIMIT=10M
dosfstools-4.2/tests/referenceFAT32mbr.xxd 0000644 0001750 0001750 00000007572 14005523510 015533 0000000 0000000 00000000: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
00000010: 0200 0000 00f8 0000 3f00 2000 0000 0000 ........?. .....
00000020: c53f 1f00 d007 0000 0000 0000 0200 0000 .?..............
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 8000 29cd ab34 1254 4553 5446 4154 3332 ..)..4.TESTFAT32
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001b0: 0000 0000 0000 0000 cdab 3412 0000 8000 ..........4.....
000001c0: 0100 0c1b c1f7 0000 0000 c53f 1f00 0000 ...........?....
000001d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000001e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 ffe5 0300 0200 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
00000c10: 0200 0000 00f8 0000 3f00 2000 0000 0000 ........?. .....
00000c20: c53f 1f00 d007 0000 0000 0000 0200 0000 .?..............
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 8000 29cd ab34 1254 4553 5446 4154 3332 ..)..4.TESTFAT32
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000db0: 0000 0000 0000 0000 cdab 3412 0000 8000 ..........4.....
00000dc0: 0100 0c1b c1f7 0000 0000 c53f 1f00 0000 ...........?....
00000dd0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000de0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000fe0: 0000 0000 7272 4161 ffe5 0300 0200 0000 ....rrAa........
00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000fe000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
000fe010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
001f8000: 5445 5354 4641 5433 3220 2008 0000 5a4b TESTFAT32 ...ZK
001f8010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
001f8020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
3e7ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/referenceFAT32mbr.mkfs 0000644 0001750 0001750 00000000065 14005523510 015656 0000000 0000000 ARGS="-n TESTFAT32 --mbr"
SIZE=1024000
CMP_LIMIT=10M
dosfstools-4.2/tests/referenceFAT32.xxd 0000644 0001750 0001750 00000006532 14005523510 015025 0000000 0000000 00000000: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
00000010: 0200 0000 00f8 0000 3f00 2000 0000 0000 ........?. .....
00000020: c53f 1f00 d007 0000 0000 0000 0200 0000 .?..............
00000030: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000040: 8000 29cd ab34 1254 4553 5446 4154 3332 ..)..4.TESTFAT32
00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000003e0: 0000 0000 7272 4161 ffe5 0300 0200 0000 ....rrAa........
000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000400: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000c00: eb58 906d 6b66 732e 6661 7400 0208 2000 .X.mkfs.fat... .
00000c10: 0200 0000 00f8 0000 3f00 2000 0000 0000 ........?. .....
00000c20: c53f 1f00 d007 0000 0000 0000 0200 0000 .?..............
00000c30: 0100 0600 0000 0000 0000 0000 0000 0000 ................
00000c40: 8000 29cd ab34 1254 4553 5446 4154 3332 ..)..4.TESTFAT32
00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac FAT32 ...w|.
00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032 ".t.V.......^..2
00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e .......This is n
00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469 ot a bootable di
00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365 sk. Please inse
00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c rt a bootable fl
00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320 oppy and..press
00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061 any key to try a
00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000 gain ... .......
00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000e00: 5252 6141 0000 0000 0000 0000 0000 0000 RRaA............
00000e10: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000fe0: 0000 0000 7272 4161 ffe5 0300 0200 0000 ....rrAa........
00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00001000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
00004010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000fe000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000 ................
000fe010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
001f8000: 5445 5354 4641 5433 3220 2008 0000 5a4b TESTFAT32 ...ZK
001f8010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
001f8020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
3e7ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/referenceFAT32.mkfs 0000644 0001750 0001750 00000000057 14005523510 015156 0000000 0000000 ARGS="-n TESTFAT32"
SIZE=1024000
CMP_LIMIT=10M
dosfstools-4.2/tests/referenceFAT16.xxd 0000644 0001750 0001750 00000003046 14005523510 015024 0000000 0000000 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800 .<.mkfs.fat.....
00000010: 0200 0200 00f8 0001 2000 1000 0000 0000 ........ .......
00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446 ......)..4.TESTF
00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f AT16 FAT16 ..
00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001000: f8ff ffff 0000 0000 0000 0000 0000 0000 ................
00001010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00021000: f8ff ffff 0000 0000 0000 0000 0000 0000 ................
00021010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b TESTFAT16 ...ZK
00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
00041020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/referenceFAT16.mkfs 0000644 0001750 0001750 00000000055 14005523510 015156 0000000 0000000 ARGS="-n TESTFAT16"
SIZE=256000
CMP_LIMIT=1M
dosfstools-4.2/tests/referenceFAT12.xxd 0000644 0001750 0001750 00000002740 14005523510 015020 0000000 0000000 00000000: eb3c 906d 6b66 732e 6661 7400 0201 0100 .<.mkfs.fat.....
00000010: 02e0 0040 0bf0 0900 1200 0200 0000 0000 ...@............
00000020: 0000 0000 0000 29cd ab34 1254 4553 5446 ......)..4.TESTF
00000030: 4154 3132 2020 4641 5431 3220 2020 0e1f AT12 FAT12 ..
00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10 .[|.".t.V.......
00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320 ^..2.......This
00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c is not a bootabl
00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520 e disk. Please
00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c insert a bootabl
00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072 e floppy and..pr
000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074 ess any key to t
000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00 ry again ... ...
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U.
00000200: f0ff ff00 0000 0000 0000 0000 0000 0000 ................
00000210: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00001400: f0ff ff00 0000 0000 0000 0000 0000 0000 ................
00001410: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00002600: 5445 5354 4641 5431 3220 2008 0000 5a4b TESTFAT12 ...ZK
00002610: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000 nFnF..ZKnF......
00002620: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00167ff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
dosfstools-4.2/tests/referenceFAT12.mkfs 0000644 0001750 0001750 00000000051 14005523510 015146 0000000 0000000 ARGS="-n TESTFAT12"
SIZE=1440
CMP_LIMIT=
dosfstools-4.2/tests/test-label 0000755 0001750 0001750 00000003310 14005523510 013613 0000000 0000000 #!/bin/sh
# Copyright (C) 2018 Pali Rohár
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
#
#
# This script expects a testname.label file as its sole argument. It must
# be a label of the corresponding hex dump file testname.xxd that can be
# converted to a file system image with xxd.
run_label () {
$RUN "../src/fatlabel" "$@"
}
if [ $# -ne 1 ]; then
echo "$0 called with wrong number of arguments"
exit 99
fi
testname=$(basename "$1" .label)
if [ "$XXD_FOUND" != "yes" ]; then
echo "xxd not available, required by test"
exit 77 # report test skipped
fi
echo "Test $testname"
# make sure there aren't files remaining from earlier run
rm -f "${testname}.img" "${testname}.out"
xxd -r "${srcdir}/${testname}.xxd" "${testname}.img" || exit 99
run_label "${testname}.img" 1> "${testname}.out" 2> "${testname}.err" || exit 99
echo "Comparing..."
diff "${testname}.out" "${srcdir}/${testname}.label"
success=$?
echo "Error output:"
cat "${testname}.err"
if [ "$CHECK_ERRORS" = "1" ] && [ -s "${testname}.err" ]; then
success=2
fi
rm -f "${testname}.img" "${testname}.out" "${testname}.err"
exit $success
dosfstools-4.2/tests/test-fsck 0000755 0001750 0001750 00000004422 14005523510 013467 0000000 0000000 #!/bin/sh
# Copyright (C) 2016 Andreas Bombe
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
#
#
# This script expects a testname.fsck file as its sole argument. It must
# be a hex dump that can be converted to a filesystem image with xxd.
# fsck.fat is run on that image to attempt to fix the problem and then
# it is run a second time to determine if the problem has been fixed.
# The test fails if the first run does not detect an error or if the
# second run still detects an error.
run_fsck () {
$RUN "../src/fsck.fat" "$@"
}
if [ $# -ne 1 ]; then
echo "$0 called with wrong number of arguments"
exit 99
fi
testname=$(basename "$1" .fsck)
if [ "$XXD_FOUND" != "yes" ]; then
echo "xxd not available, required by test"
exit 77 # report test skipped
fi
if [ -f "$testname.args" ]; then
ARGS=$(cat "$testname.args")
else
ARGS=
fi
echo "Test $testname"
# make sure there aren't files remaining from earlier run
rm -f "${testname}.img" "${testname}.refimg"
xxd -r "${srcdir}/${testname}.fsck" "${testname}.img" || exit 99
echo "First fsck run to check and fix error..."
run_fsck -a $ARGS "${testname}.img"
success=$?
if [ $success -eq 0 ]; then
echo "*** Error was not detected by fsck."
success=100
elif [ $success -eq 1 ]; then
echo "Second fsck run to check if error was fixed..."
run_fsck -n "${testname}.img"
success=$?
if [ $success -ne 0 ]; then
echo "*** Error was not fixed by fsck."
else
echo "Comparing..."
xxd -r "${srcdir}/${testname}.xxd" "${testname}.refimg" || exit 99
cmp "${testname}.img" "${testname}.refimg"
success=$?
if [ $success -eq 2 ]; then
# cmp reported error
exit 99
fi
fi
fi
rm -f "${testname}.img" "${testname}.refimg"
exit $success
dosfstools-4.2/tests/test-mkfs 0000755 0001750 0001750 00000004172 14005523510 013503 0000000 0000000 #!/bin/sh
# Copyright (C) 2016 Andreas Bombe
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
#
#
# This script expects a testname.mkfs file as its sole argument. It must
# be a shell snippet setting the variables ARGS, SIZE and CMP_LIMIT. ARGS and
# SIZE are used in the mkfs invocation and the result is compared against a
# reference image generated from the hexdump in testname.xxd. The comparison
# is stopped after CMP_LIMIT since freshly build FAT filesystems are just
# zeros after the initial info sectors, FATs and root directory.
run_mkfs () {
$RUN "../src/mkfs.fat" "$@"
}
run_fsck () {
$RUN "../src/fsck.fat" "$@"
}
if [ $# -ne 1 ]; then
echo "$0 called with wrong number of arguments"
exit 99
fi
testname=$(basename "$1" .mkfs)
if [ "$XXD_FOUND" != "yes" ]; then
echo "xxd not available, required by test"
exit 77 # report test skipped
fi
. "$1" || exit 99
echo "Test $testname"
# make sure there aren't files remaining from earlier run
rm -f "${testname}.out" "${testname}.refimg"
xxd -r "${srcdir}/${testname}.xxd" "${testname}.refimg" || exit 99
run_mkfs -C -v --invariant $ARGS "${testname}.out" $SIZE || exit 99
echo
echo "Comparing..."
limitarg=
if [ -n "$CMP_LIMIT" ]; then
limitarg="--bytes=$CMP_LIMIT"
fi
cmp $limitarg "${testname}.out" "${testname}.refimg"
success=$?
echo
echo "Testing fsck..."
run_fsck -n "${testname}.out"
success_fsck=$?
if [ $success -eq 0 ]; then
success=$success_fsck
fi
rm -f "${testname}.out" "${testname}.refimg"
if [ $success -eq 2 ]; then
# cmp reported error
exit 99
fi
exit $success
dosfstools-4.2/tests/Makefile.am 0000644 0001750 0001750 00000014333 14005523510 013674 0000000 0000000 AM_TESTS_ENVIRONMENT = XXD_FOUND=@XXD_FOUND@; export XXD_FOUND;
if AUTOMAKE_TEST_COMPAT
TESTS_ENVIRONMENT = $(AM_TESTS_ENVIRONMENT)
endif
TESTS = referenceFAT12.mkfs \
referenceFAT16.mkfs \
referenceFAT32.mkfs \
referenceFAT32mbr.mkfs \
mkfs-fat32_2_res_sects.mkfs \
mkfs-fat32_4K.mkfs \
check-bad_names.fsck \
check-fat12_first_cluster.fsck \
check-fat16_first_cluster.fsck \
check-fat32_first_cluster.fsck \
check-fat16_dos_cln_shut.fsck \
check-fat32_dos_cln_shut.fsck \
check-chain_to_free_cluster.fsck \
check-chain_too_long.fsck \
check-chain_to_other_file.fsck \
check-circular_chain.fsck \
check-duplicate_names.fsck \
check-dot_entries.fsck \
check-huge.fsck \
check-label-different.fsck \
check-label-only-boot.fsck \
check-label-only-root.fsck \
label-fat32_mkdosfs_label1_dosfslabel_empty.label \
label-fat32_mkdosfs_label1_dosfslabel_label2.label \
label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.label \
label-fat32_mkdosfs_label1_mlabel_erase.label \
label-fat32_mkdosfs_label1_mlabel_NO_NAME.label \
label-fat32_mkdosfs_label1_xp_erase.label \
label-fat32_mkdosfs_label1_xp_label2.label \
label-fat32_mkdosfs_label1.label \
label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.label \
label-fat32_mkdosfs_none_dosfslabel_label1.label \
label-fat32_mkdosfs_none_dosfslabel_NO_NAME.label \
label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.label \
label-fat32_mkdosfs_none_xp_label1.label \
label-fat32_mkdosfs_none.label \
label-fat32_xp_label1.label \
label-fat32_xp_none_dosfslabel_label1.label \
label-fat32_xp_none_mlabel_label1.label \
label-fat32_xp_none.label
XFAIL_TESTS = check-huge.fsck
TEST_EXTENSIONS = .mkfs .fsck .label
MKFS_LOG_COMPILER = $(srcdir)/test-mkfs
FSCK_LOG_COMPILER = $(srcdir)/test-fsck
LABEL_LOG_COMPILER = $(srcdir)/test-label
dist_check_DATA = test-mkfs test-fsck test-label \
referenceFAT12.mkfs \
referenceFAT12.xxd \
referenceFAT16.mkfs \
referenceFAT16.xxd \
referenceFAT32.mkfs \
referenceFAT32.xxd \
referenceFAT32mbr.mkfs \
referenceFAT32mbr.xxd \
mkfs-fat32_2_res_sects.mkfs \
mkfs-fat32_2_res_sects.xxd \
mkfs-fat32_4K.mkfs \
mkfs-fat32_4K.xxd \
check-bad_names.fsck \
check-bad_names.xxd \
check-fat12_first_cluster.fsck \
check-fat12_first_cluster.args \
check-fat12_first_cluster.xxd \
check-fat16_first_cluster.fsck \
check-fat16_first_cluster.args \
check-fat16_first_cluster.xxd \
check-fat32_first_cluster.fsck \
check-fat32_first_cluster.args \
check-fat32_first_cluster.xxd \
check-fat16_dos_cln_shut.fsck \
check-fat16_dos_cln_shut.xxd \
check-fat32_dos_cln_shut.fsck \
check-fat32_dos_cln_shut.xxd \
check-chain_to_free_cluster.fsck \
check-chain_to_free_cluster.xxd \
check-chain_too_long.fsck \
check-chain_too_long.xxd \
check-chain_to_other_file.fsck \
check-chain_to_other_file.xxd \
check-circular_chain.fsck \
check-circular_chain.xxd \
check-duplicate_names.fsck \
check-duplicate_names.xxd \
check-dot_entries.fsck \
check-dot_entries.xxd \
check-huge.fsck \
check-label-different.fsck \
check-label-different.xxd \
check-label-only-boot.fsck \
check-label-only-boot.xxd \
check-label-only-root.fsck \
check-label-only-root.xxd \
label-fat32_mkdosfs_label1_dosfslabel_empty.label \
label-fat32_mkdosfs_label1_dosfslabel_empty.xxd \
label-fat32_mkdosfs_label1_dosfslabel_label2.label \
label-fat32_mkdosfs_label1_dosfslabel_label2.xxd \
label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.label \
label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.xxd \
label-fat32_mkdosfs_label1_mlabel_erase.label \
label-fat32_mkdosfs_label1_mlabel_erase.xxd \
label-fat32_mkdosfs_label1_mlabel_NO_NAME.label \
label-fat32_mkdosfs_label1_mlabel_NO_NAME.xxd \
label-fat32_mkdosfs_label1_xp_erase.label \
label-fat32_mkdosfs_label1_xp_erase.xxd \
label-fat32_mkdosfs_label1_xp_label2.label \
label-fat32_mkdosfs_label1_xp_label2.xxd \
label-fat32_mkdosfs_label1.label \
label-fat32_mkdosfs_label1.xxd \
label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.label \
label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.xxd \
label-fat32_mkdosfs_none_dosfslabel_label1.label \
label-fat32_mkdosfs_none_dosfslabel_label1.xxd \
label-fat32_mkdosfs_none_dosfslabel_NO_NAME.label \
label-fat32_mkdosfs_none_dosfslabel_NO_NAME.xxd \
label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.label \
label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.xxd \
label-fat32_mkdosfs_none_xp_label1.label \
label-fat32_mkdosfs_none_xp_label1.xxd \
label-fat32_mkdosfs_none.label \
label-fat32_mkdosfs_none.xxd \
label-fat32_xp_label1.label \
label-fat32_xp_label1.xxd \
label-fat32_xp_none_dosfslabel_label1.label \
label-fat32_xp_none_dosfslabel_label1.xxd \
label-fat32_xp_none_mlabel_label1.label \
label-fat32_xp_none_mlabel_label1.xxd \
label-fat32_xp_none.label \
label-fat32_xp_none.xxd
dosfstools-4.2/manpages/ 0000755 0001750 0001750 00000000000 14005523537 012356 5 0000000 0000000 dosfstools-4.2/manpages/mkfs.fat.8.in 0000644 0001750 0001750 00000030534 14005523510 014501 0000000 0000000 .\" mkfs.fat.8 - manpage for fs.fatck
.\"
.\" Copyright (C) 2006-2014 Daniel Baumann
.\" Copyright (C) 2016 Andreas Bombe
.\" Copyright (C) 2018-2021 Pali Rohár
.\"
.\" This program is free software: you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation, either version 3 of the License, or
.\" (at your option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with this program. If not, see .
.\"
.\" The complete text of the GNU General Public License
.\" can be found in /usr/share/common-licenses/GPL-3 file.
.\"
.\"
.TH MKFS.FAT 8 @RELEASE_DATE@ "dosfstools @PACKAGE_VERSION@"
.SH NAME
mkfs.fat \- create an MS-DOS FAT filesystem
.\" ----------------------------------------------------------------------------
.SH SYNOPSIS
\fBmkfs.fat\fP [\fIOPTIONS\fP] \fIDEVICE\fP [\fIBLOCK-COUNT\fP]
.\" ----------------------------------------------------------------------------
.SH DESCRIPTION
\fBmkfs.fat\fP is used to create a FAT filesystem on a device or in an image
file.
\fIDEVICE\fP is the special file corresponding to the device (e.g. /dev/sdXX) or
the image file (which does not need to exist when the option \fB-C\fP is given).
\fIBLOCK-COUNT\fP is the number of blocks on the device and size of one block is
always 1024 bytes, independently of the sector size or the cluster size.
Therefore \fIBLOCK-COUNT\fP specifies size of filesystem in KiB unit and not in
the number of sectors (like for all other \fBmkfs.fat\fP options).
If omitted, \fBmkfs.fat\fP automatically chooses a filesystem size to fill the
available space.
.PP
Two different variants of the FAT filesystem are supported.
Standard is the FAT12, FAT16 and FAT32 filesystems as defined by Microsoft and
widely used on hard disks and removable media like USB sticks and SD cards.
The other is the legacy Atari variant used on Atari ST.
.PP
In Atari mode, if not directed otherwise by the user, \fBmkfs.fat\fP will
always use 2 sectors per cluster, since GEMDOS doesn't like other values very
much.
It will also obey the maximum number of sectors GEMDOS can handle.
Larger filesystems are managed by raising the logical sector size.
An Atari-compatible serial number for the filesystem is generated, and a 12 bit
FAT is used only for filesystems that have one of the usual floppy sizes (720k,
1.2M, 1.44M, 2.88M), a 16 bit FAT otherwise.
This can be overridden with the \fB\-F\fP option.
Some PC-specific boot sector fields aren't written, and a boot message (option
\fB\-m\fP) is ignored.
.\" ----------------------------------------------------------------------------
.SH OPTIONS
.IP "\fB\-a\fP" 4
Normally, for any filesystem except very small ones, \fBmkfs.fat\fP will align
all the data structures to cluster size, to make sure that as long as the
partition is properly aligned, so will all the data structures in the
filesystem.
This option disables alignment; this may provide a handful of additional
clusters of storage at the expense of a significant performance degradation on
RAIDs, flash media or large-sector hard disks.
.IP "\fB\-A\fP" 4
Select using the Atari variation of the FAT filesystem if that isn't active
already, otherwise select standard FAT filesystem.
This is selected by default if \fBmkfs.fat\fP is run on 68k Atari Linux.
.IP "\fB\-b\fP \fISECTOR-OF-BACKUP\fP" 4
Selects the location of the backup boot sector for FAT32.
Default depends on number of reserved sectors, but usually is sector 6.
If there is a free space available after the backup boot sector then backup of
the FAT32 info sector is put after the backup boot sector, usually at sector 7.
The backup must be within the range of reserved sectors.
Value 0 completely disables creating of backup boot and info FAT32 sectors.
.IP "\fB\-c" 4
Check the device for bad blocks before creating the filesystem.
.IP "\fB\-C\fP" 4
Create the file given as \fIDEVICE\fP on the command line, and write the
to-be-created filesystem to it.
This can be used to create the new filesystem in a file instead of on a real
device, and to avoid using \fBdd\fP in advance to create a file of appropriate
size.
With this option, the \fIBLOCK-COUNT\fP must be given, because otherwise the
intended size of the filesystem wouldn't be known.
The file created is a sparse file, which actually only contains the meta-data
areas (boot sector, FATs, and root directory).
The data portions won't be stored on the disk, but the file nevertheless will
have the correct size.
The resulting file can be copied later to a floppy disk or other device, or
mounted through a loop device.
.IP "\fB\-D\fP \fIDRIVE-NUMBER\fP" 4
Specify the BIOS drive number to be stored in the FAT boot sector.
For hard disks and removable medias it is usually 0x80\(en0xFF (0x80 is first
hard disk C:, 0x81 is second hard disk D:, ...), for floppy devices or
partitions to be used for floppy emulation it is 0x00\(en0x7F (0x00 is first
floppy A:, 0x01 is second floppy B:).
.IP "\fB\-f\fP \fINUMBER-OF-FATS\fP" 4
Specify the number of file allocation tables in the filesystem.
The default is 2.
.IP "\fB\-F\fP \fIFAT-SIZE\fP" 4
Specifies the type of file allocation tables used (12, 16 or 32 bit).
If nothing is specified, \fBmkfs.fat\fP will automatically select between 12, 16
and 32 bit, whatever fits better for the filesystem size.
.IP "\fB\-g\fP \fIHEADS\fP/\fISECTORS-PER-TRACK\fP" 4
Specify \fIHEADS\fP and \fISECTORS-PER-TRACK\fP numbers which represents
disk geometry of \fIDEVICE\fP.
Both numbers are stored into the FAT boot sector.
Number \fISECTORS-PER-TRACK\fP is used also for aligning the total count of FAT
sectors.
By default disk geometry is read from \fIDEVICE\fP itself.
If it is not available then \fILBA-Assist Translation\fP and translation table
from the \fISD Card Part 2 File System Specification\fP based on total number
of disk sectors is used.
.IP "\fB\-h\fP \fINUMBER-OF-HIDDEN-SECTORS\fP" 4
Specify the number of so-called \fIhidden sectors\fP, as stored in the FAT boot
sector: this number represents the beginning sector of the partition containing
the file system.
Normally this is an offset (in sectors) relative to the start of the disk,
although for MBR logical volumes contained in an extended partition of type 0x05
(a non-LBA extended partition), a quirk in the MS-DOS implementation of FAT
requires it to be relative to the partition's immediate containing Extended Boot
Record.
Boot code and other software handling FAT volumes may also rely on this field
being set up correctly; most modern FAT implementations will ignore it.
By default, if the \fIDEVICE\fP is a partition block device, \fBmkfs.fat\fP uses
the partition offset relative to disk start.
Otherwise, \fBmkfs.fat\fP assumes zero.
Use this option to override this behaviour.
.IP "\fB\-i\fP \fIVOLUME-ID\fP" 4
Sets the volume ID of the newly created filesystem; \fIVOLUME-ID\fP is a 32-bit
hexadecimal number (for example, 2e24ec82).
The default is a number which depends on the filesystem creation time.
.IP "\fB\-I\fP" 4
Ignore and disable safety checks.
By default \fBmkfs.fat\fP refuses to create a filesystem on a device with
partitions or virtual mapping.
\fBmkfs.fat\fP will complain and tell you that it refuses to work.
This is different when using MO disks.
One doesn't always need partitions on MO disks.
The filesystem can go directly to the whole disk.
Under other OSes this is known as the \fIsuperfloppy\fP format.
This switch will force \fBmkfs.fat\fP to work properly.
.IP "\fB\-l\fP \fIFILENAME\fP" 4
Read the bad blocks list from \fIFILENAME\fP.
.IP "\fB\-m\fP \fIMESSAGE-FILE\fP" 4
Sets the message the user receives on attempts to boot this filesystem without
having properly installed an operating system.
The message file must not exceed 418 bytes once line feeds have been converted
to carriage return-line feed combinations, and tabs have been expanded.
If the filename is a hyphen (-), the text is taken from standard input.
.IP "\fB\-M\fP \fIFAT-MEDIA-TYPE\fP" 4
Specify the media type to be stored in the FAT boot sector.
This value is usually 0xF8 for hard disks and is 0xF0 or a value from 0xF9 to
0xFF for floppies or partitions to be used for floppy emulation.
.IP "\fB\-\-mbr\fP[=\fIy\fP|\fIyes\fP|\fIn\fP|\fIno\fP|\fIa\fP|\fIauto\fP]" 4
Fill (fake) MBR table with disk signature one partition which starts at sector
0 (includes MBR itself) and spans whole disk device.
It is needed only for non-removable disks used on Microsoft Windows systems and
only when formatting whole unpartitioned disk.
Location of the disk signature and partition table overlaps with the end of the
first FAT sector (boot code location), therefore there is no additional space
usage.
Default is \fIauto\fP mode in which \fBmkfs.fat\fP put MBR table only for
non-removable disks when formatting whole unpartitioned disk.
.IP "\fB\-n\fP \fIVOLUME-NAME\fP" 4
Sets the volume name (label) of the filesystem.
The volume name can be up to 11 characters long.
Supplying an empty string, a string consisting only of white space or the
string "NO NAME" as \fIVOLUME-NAME\fP has the same effect as not giving the
\fB\-n\fP option.
The default is no label.
.IP "\fB\-\-codepage\fP=\fIPAGE\fP" 4
Use DOS codepage \fIPAGE\fP to encode label.
By default codepage 850 is used.
.IP "\fB\-r\fP \fIROOT-DIR-ENTRIES\fP" 4
Select the minimal number of entries available in the root directory.
The default is 112 or 224 for floppies and 512 for hard disks.
Note that this is minimal number and it may be increased by \fBmkfs.fat\fP
due to alignment of structures.
See also \fBmkfs.fat\fP option \fB\-a\fP.
.IP "\fB\-R\fP \fINUMBER-OF-RESERVED-SECTORS\fP" 4
Select the minimal number of reserved sectors.
With FAT32 format at least 2 reserved sectors are needed, the default is 32.
Otherwise the default is 1 (only the boot sector).
Note that this is minimal number and it may be increased by \fBmkfs.fat\fP
due to alignment of structures.
See also \fBmkfs.fat\fP option \fB\-a\fP.
.IP "\fB\-s\fP \fISECTORS-PER-CLUSTER\fP" 4
Specify the number of disk sectors per cluster.
Must be a power of 2, i.e. 1, 2, 4, 8, ... 128.
.IP "\fB\-S\fP \fILOGICAL-SECTOR-SIZE\fP" 4
Specify the number of bytes per logical sector.
Must be a power of 2 and greater than or equal to 512, i.e. 512, 1024, 2048,
4096, 8192, 16384, or 32768.
Values larger than 4096 are not conforming to the FAT file system specification
and may not work everywhere.
.IP "\fB\-v\fP" 4
Verbose execution.
.IP "\fB\-\-offset\fP \fISECTOR\fP" 4
Write the filesystem at a specific sector into the device file.
This is useful for creating a filesystem in a partitioned disk image without
having to set up a loop device.
.IP "\fB\-\-variant\fP \fITYPE\fP" 4
Create a filesystem of variant \fITYPE\fP.
Acceptable values are \fIstandard\fP and \fIatari\fP (in any combination of
upper/lower case).
See above under DESCRIPTION for the differences.
.IP "\fB\-\-help\fP" 4
Display option summary and exit.
.IP "\fB\-\-invariant\fP" 4
Use constants for normally randomly generated or time based data such as
volume ID and creation time.
Multiple runs of \fBmkfs.fat\fP on the same device create identical results
with this option.
Its main purpose is testing \fBmkfs.fat\fP.
.\" ----------------------------------------------------------------------------
.SH BUGS
\fBmkfs.fat\fP can not create boot-able filesystems.
This isn't as easy as you might think at first glance for various reasons and
has been discussed a lot already.
\fBmkfs.fat\fP simply will not support it ;)
.\" ----------------------------------------------------------------------------
.SH SEE ALSO
.BR fatlabel (8),
.BR fsck.fat (8)
.\" ----------------------------------------------------------------------------
.SH HOMEPAGE
The home for the \fBdosfstools\fP project is its
.UR https://github.com/dosfstools/dosfstools
GitHub project page
.UE .
.\" ----------------------------------------------------------------------------
.SH AUTHORS
\fBdosfstools\fP were written by
.MT werner.almesberger@\:lrc.di.epfl.ch
Werner Almesberger
.ME ,
.MT Roman.Hodek@\:informatik.\:uni-erlangen.de
Roman Hodek
.ME ,
and others.
Current maintainers are
.MT aeb@\:debian.org
Andreas Bombe
.ME
and
.MT pali.rohar@\:gmail.com
Pali Rohár
.ME .
dosfstools-4.2/manpages/fsck.fat.8.in 0000644 0001750 0001750 00000024627 14005523510 014475 0000000 0000000 .\" fsck.fat.8 - manpage for fsck.fat
.\"
.\" Copyright (C) 2006-2014 Daniel Baumann
.\" Copyright (C) 2018-2021 Pali Rohár
.\"
.\" This program is free software: you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation, either version 3 of the License, or
.\" (at your option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with this program. If not, see .
.\"
.\" The complete text of the GNU General Public License
.\" can be found in /usr/share/common-licenses/GPL-3 file.
.\"
.\"
.TH FSCK.FAT 8 @RELEASE_DATE@ "dosfstools @PACKAGE_VERSION@"
.SH NAME
fsck.fat \- check and repair MS-DOS FAT filesystems
.\" ----------------------------------------------------------------------------
.SH SYNOPSIS
\fBfsck.fat\fP [\fIOPTIONS\fP] \fIDEVICE\fP
.\" ----------------------------------------------------------------------------
.SH DESCRIPTION
\fBfsck.fat\fP verifies the consistency of MS-DOS filesystems and optionally
tries to repair them.
.PP
The following filesystem problems can be corrected (in this order):
.IP "\(bu" 4
FAT contains invalid cluster numbers.
Cluster is changed to EOF.
.IP "\(bu" 4
File's cluster chain contains a loop.
The loop is broken.
.IP "\(bu" 4
Bad clusters (read errors).
The clusters are marked bad and they are removed from files owning them.
This check is optional.
.IP "\(bu" 4
Directories with a large number of bad entries (probably corrupt).
The directory can be deleted.
.IP "\(bu" 4
Files . and .. are non-directories.
They can be deleted or renamed.
.IP "\(bu" 4
Directories . and .. in root directory.
They are deleted.
.IP "\(bu" 4
Bad filenames.
They can be renamed.
.IP "\(bu" 4
Duplicate directory entries.
They can be deleted or renamed.
.IP "\(bu" 4
Directories with non-zero size field.
Size is set to zero.
.IP "\(bu" 4
Directory . does not point to parent directory.
The start pointer is adjusted.
.IP "\(bu" 4
Directory .. does not point to parent of parent directory.
The start pointer is adjusted.
.IP "\(bu" 4
\&. and .. are not the two first entries in a non-root directory.
The entries are created, moving occupied slots if necessary.
.IP "\(bu" 4
Start cluster number of a file is invalid.
The file is truncated.
.IP "\(bu" 4
File contains bad or free clusters.
The file is truncated.
.IP "\(bu" 4
File's cluster chain is longer than indicated by the size fields.
The file is truncated.
.IP "\(bu" 4
Two or more files share the same cluster(s).
All but one of the files are truncated.
If the file being truncated is a directory file that has already been read, the
filesystem check is restarted after truncation.
.IP "\(bu" 4
File's cluster chain is shorter than indicated by the size fields.
The file is truncated.
.IP "\(bu" 4
Volume label in root directory or label in boot sector is invalid.
Invalid labels are removed.
.IP "\(bu" 4
Volume label in root directory and label in boot sector are different.
Volume label from root directory is copied to boot sector.
.IP "\(bu" 4
Clusters are marked as used but are not owned by a file.
They are marked as free.
.PP
Additionally, the following problems are detected, but not repaired:
.IP "\(bu" 4
Invalid parameters in boot sector
.PP
When \fBfsck.fat\fP checks a filesystem, it accumulates all changes in memory
and performs them only after all checks are complete.
This can be disabled with the \fB\-w\fP option.
.PP
Two different variants of the FAT filesystem are supported.
Standard is the FAT12, FAT16 and FAT32 filesystems as defined by Microsoft and
widely used on hard disks and removable media like USB sticks and SD cards.
The other is the legacy Atari variant used on Atari ST.
.PP
There are some minor differences in Atari format:
Some boot sector fields are interpreted slightly different, and the special FAT
entries for end-of-file and bad cluster can be different.
Under MS-DOS 0xfff8 is used for EOF and Atari employs 0xffff by default, but
both systems recognize all values from 0xfff8\(en0xffff as end-of-file.
MS-DOS uses only 0xfff7 for bad clusters, where on Atari values 0xfff0\(en0xfff7
are for this purpose (but the standard value is still 0xfff7).
.\" ----------------------------------------------------------------------------
.SH OPTIONS
.IP "\fB\-a\fP" 4
Automatically repair the filesystem.
No user intervention is necessary.
Whenever there is more than one method to solve a problem, the least
destructive approach is used.
.IP "\fB\-A\fP" 4
Select using the Atari variation of the FAT filesystem if that isn't active
already, otherwise select standard FAT filesystem.
This is selected by default if \fBmkfs.fat\fP is run on 68k Atari Linux.
.IP "\fB-b\fP" 4
Make read-only boot sector check.
.IP "\fB-c\fP \fIPAGE\fP" 4
Use DOS codepage \fIPAGE\fP to decode short file names.
By default codepage 850 is used.
.IP "\fB\-d\fP \fIPATH\fP" 4
Delete the specified file.
If more than one file with that name exist, the first one is deleted.
This option can be given more than once.
.IP "\fB\-f\fP" 4
Salvage unused cluster chains to files.
By default, unused clusters are added to the free disk space except in auto mode
(\fB\-a\fP).
.IP "\fB\-F\fP \fINUM\fP" 4
Specify FAT table \fINUM\fP for filesystem access.
By default value \fI0\fP is assumed and then the first uncorrupted FAT table is
chosen.
Uncorrupted means that FAT table has valid first cluster.
If default value \fI0\fP is used and all FAT tables are corrupted then
\fBfsck.fat\fP gives up and does not try to repair FAT filesystem.
If non-zero \fINUM\fP value is specified then \fBfsck.fat\fP uses FAT table
\fINUM\fP for repairing FAT filesystem.
If FAT table \fINUM\fP has corrupted first cluster then \fBfsck.fat\fP will
repair it.
In any case, if FAT filesystem has more FAT tables then repaired content of
chosen FAT table is copied to other FAT tables.
To repair corrupted first cluster it is required to call \fBfsck.fat\fP with
non-zero \fINUM\fP value.
.IP "\fB\-l\fP" 4
List path names of files being processed.
.IP "\fB\-n\fP" 4
No-operation mode: non-interactively check for errors, but don't write
anything to the filesystem.
.IP "\fB\-p\fP" 4
Same as \fB\-a\fP, for compatibility with other *fsck.
.IP "\fB\-r\fP" 4
Interactively repair the filesystem.
The user is asked for advice whenever there is more than one approach to fix an
inconsistency.
This is the default mode and the option is only retained for backwards
compatibility.
.IP "\fB\-S\fP" 4
Consider short (8.3) file names with spaces in the middle to be invalid, like
previous versions of this program did.
While such file names are not forbidden by the FAT specification, and were never
treated as errors by Microsoft file system checking tools, many DOS programs are
unable to handle files with such names.
Using this option can make them accessible to these programs.
.IP "" 4
Short file names which \fIstart\fP with a space are considered invalid
regardless of this option's setting.
.IP "" 4
Previous versions of this program exceptionally treated \fIEA DATA. SF\fP and
\fIWP ROOT. SF\fP as valid short names; using this option does not preserve
that exception.
.IP "\fB\-t\fP" 4
Mark unreadable clusters as bad.
.IP "\fB\-u\fP \fIPATH\fP" 4
Try to undelete the specified file.
\fBfsck.fat\fP tries to allocate a chain of contiguous unallocated clusters
beginning with the start cluster of the undeleted file.
This option can be given more than once.
.IP "\fB\-U\fP" 4
Consider lowercase volume and boot label as invalid and allow only uppercase
characters.
Such labels are forbidden by the FAT specification, but they are widely used
by Linux tools.
Moreover MS-DOS and Windows systems do not have problems to read them.
Therefore volume and boot labels with lowercase characters are by default
permitted.
.IP "\fB\-v\fP" 4
Verbose mode.
Generates slightly more output.
.IP "\fB\-V\fP" 4
Perform a verification pass.
The filesystem check is repeated after the first run.
The second pass should never report any fixable errors.
It may take considerably longer than the first pass, because the first pass may
have generated long list of modifications that have to be scanned for each disk
read.
.IP "\fB\-\-variant\fP \fITYPE\fP" 4
Create a filesystem of variant \fITYPE\fP.
Acceptable values are \fIstandard\fP and \fIatari\fP (in any combination of
upper/lower case).
See above under DESCRIPTION for the differences.
.IP "\fB\-w\fP" 4
Write changes to disk immediately.
.IP "\fB\-y\fP" 4
Same as \fB\-a\fP (automatically repair filesystem) for compatibility with other
fsck tools.
.IP "\fB\-\-help\fP" 4
Display help message describing usage and options then exit.
.\" ----------------------------------------------------------------------------
.SH "EXIT STATUS"
.IP "0" 4
No recoverable errors have been detected.
.IP "1" 4
Recoverable errors have been detected or \fBfsck.fat\fP has discovered an
internal inconsistency.
.IP "2" 4
Usage error.
\fBfsck.fat\fP did not access the filesystem.
.\" ----------------------------------------------------------------------------
.SH FILES
.IP "\fIfsck0000.rec\fP, \fIfsck0001.rec\fP, ..." 4
When recovering from a corrupted filesystem, \fBfsck.fat\fP dumps recovered data
into files named \fIfsckNNNN.rec\fP in the top level directory of the filesystem.
.\" ----------------------------------------------------------------------------
.SH BUGS
.IP "\(bu" 4
Does not remove entirely empty directories.
.IP "\(bu" 4
Should give more diagnostic messages.
.IP "\(bu" 4
Undeleting files should use a more sophisticated algorithm.
.\" ----------------------------------------------------------------------------
.SH SEE ALSO
.BR fatlabel (8),
.BR mkfs.fat (8)
.\" ----------------------------------------------------------------------------
.SH HOMEPAGE
The home for the \fBdosfstools\fP project is its
.UR https://github.com/dosfstools/dosfstools
GitHub project page
.UE .
.\" ----------------------------------------------------------------------------
.SH AUTHORS
\fBdosfstools\fP were written by
.MT werner.almesberger@\:lrc.di.epfl.ch
Werner Almesberger
.ME ,
.MT Roman.Hodek@\:informatik.\:uni-erlangen.de
Roman Hodek
.ME ,
and others.
Current maintainers are
.MT aeb@\:debian.org
Andreas Bombe
.ME
and
.MT pali.rohar@\:gmail.com
Pali Rohár
.ME .
dosfstools-4.2/manpages/fatlabel.8.in 0000644 0001750 0001750 00000015775 14005523510 014554 0000000 0000000 .\" fatlabel.8 - manpage for fatlabel
.\"
.\" Copyright (C) 2006-2014 Daniel Baumann
.\" Copyright (C) 2017 Andreas Bombe
.\" Copyright (C) 2017-2021 Pali Rohár
.\"
.\" This program is free software: you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation, either version 3 of the License, or
.\" (at your option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with this program. If not, see .
.\"
.\" The complete text of the GNU General Public License
.\" can be found in /usr/share/common-licenses/GPL-3 file.
.\"
.\"
.TH FATLABEL 8 @RELEASE_DATE@ "dosfstools @PACKAGE_VERSION@"
.SH NAME
fatlabel \- set or get MS-DOS filesystem label or volume ID
.\" ----------------------------------------------------------------------------
.SH SYNOPSIS
\fBfatlabel\fP [\fIOPTIONS\fP] \fIDEVICE\fP [\fINEW\fP]
.\" ----------------------------------------------------------------------------
.SH DESCRIPTION
\fBfatlabel\fP will display or change the volume label or volume ID on the
MS-DOS filesystem located on \fIDEVICE\fP.
By default it works in label mode.
It can be switched to volume ID mode with the option \fB\-i\fP or
\fB\-\-volume\-id\fP.
.PP
If \fINEW\fP is omitted, then the existing label or volume ID is written to the
standard output.
A label can't be longer than 11 bytes and should be in all upper case for best
compatibility.
An empty string or a label consisting only of white space is not allowed.
A volume ID must be given as a hexadecimal number (no leading "0x" or
similar) and must fit into 32 bits.
.\" ----------------------------------------------------------------------------
.SH OPTIONS
.IP "\fB\-i\fP, \fB\-\-volume\-id\fP" 4
Switch to volume ID mode.
.IP "\fB\-r\fP, \fB\-\-reset\fP" 4
Remove label in label mode or generate new ID in volume ID mode.
.IP "\fB-c\fP \fIPAGE\fP, \fB\-\-codepage\fP=\fIPAGE\fP" 4
Use DOS codepage \fIPAGE\fP to encode/decode label.
By default codepage 850 is used.
.IP "\fB\-h\fP, \fB\-\-help\fP" 4
Display a help message and terminate.
.IP "\fB\-V\fP, \fB\-\-version\fP" 4
Show version number and terminate.
.\" ----------------------------------------------------------------------------
.SH COMPATIBILITY and BUGS
For historic reasons FAT label is stored in two different locations: in the boot
sector and as a special volume label entry in the root directory.
MS-DOS 5.00, MS-DOS 6.22, MS-DOS 7.10, Windows 98, Windows XP and also
Windows 10 read FAT label only from the root directory.
Absence of the volume label in the root directory is interpreted as empty or
none label, even if boot sector contains some valid label.
When Windows XP or Windows 10 system changes a FAT label it stores it only in
the root directory \(em letting boot sector unchanged.
Which leads to problems when a label is removed on Windows.
Old label is still stored in the boot sector but is removed from the root
directory.
\fBdosfslabel\fP prior to the version 3.0.7 operated only with FAT labels stored
in the boot sector, completely ignoring a volume label in the root directory.
\fBdosfslabel\fP in versions 3.0.7\(en3.0.15 reads FAT labels from the root
directory and in case of absence, it fallbacks to a label stored in the boot
sector.
Change operation resulted in updating a label in the boot sector and
\fIsometimes\fP also in the root directory due to the bug.
That bug was fixed in \fBdosfslabel\fP version 3.0.16 and since this version
\fBdosfslabel\fP updates label in both location.
Since version 4.2, \fBfatlabel\fP reads a FAT label only from the root directory
(like MS-DOS and Windows systems), but changes a FAT label in both locations.
In version 4.2 was fixed handling of empty labels and labels which starts with a
byte 0xE5.
Also in this version was added support for non-ASCII labels according to the
specified DOS codepage and were added checks if a new label is valid.
It is strongly suggested to not use \fBdosfslabel\fP prior to version 3.0.16.
.\" ----------------------------------------------------------------------------
.SH DOS CODEPAGES
MS-DOS and Windows systems use DOS (OEM) codepage for encoding and decoding FAT
label.
In Windows systems DOS codepage is global for all running applications and
cannot be configured explicitly.
It is set implicitly by option \fILanguage for non-Unicode programs\fP available
in \fIRegional and Language Options\fP via \fIControl Panel\fP.
Default DOS codepage for fatlabel is 850.
See following mapping table between DOS codepage and Language for non-Unicode
programs:
.TS
tab(:);
c lx.
\fBCodepage\fP:\fBLanguage\fP
437:T{
English (India), English (Malaysia), English (Republic of the Philippines),
English (Singapore), English (South Africa), English (United States),
English (Zimbabwe), Filipino, Hausa, Igbo, Inuktitut, Kinyarwanda, Kiswahili,
Yoruba
T}
720:Arabic, Dari, Persian, Urdu, Uyghur
737:Greek
775:Estonian, Latvian, Lithuanian
850:T{
Afrikaans, Alsatian, Basque, Breton, Catalan, Corsican, Danish, Dutch,
English (Australia), English (Belize), English (Canada), English (Caribbean),
English (Ireland), English (Jamaica), English (New Zealand),
English (Trinidad and Tobago), English (United Kingdom), Faroese, Finnish,
French, Frisian, Galician, German, Greenlandic, Icelandic, Indonesian, Irish,
isiXhosa, isiZulu, Italian, K'iche, Lower Sorbian, Luxembourgish, Malay,
Mapudungun, Mohawk, Norwegian, Occitan, Portuguese, Quechua, Romansh, Sami,
Scottish Gaelic, Sesotho sa Leboa, Setswana, Spanish, Swedish, Tamazight,
Upper Sorbian, Welsh, Wolof
T}
852:T{
Albanian, Bosnian (Latin), Croatian, Czech, Hungarian, Polish, Romanian,
Serbian (Latin), Slovak, Slovenian, Turkmen
T}
855:Bosnian (Cyrillic), Serbian (Cyrillic)
857:Azeri (Latin), Turkish, Uzbek (Latin)
862:Hebrew
866:T{
Azeri (Cyrillic), Bashkir, Belarusian, Bulgarian, Kyrgyz, Macedonian, Mongolian,
Russian, Tajik, Tatar, Ukrainian, Uzbek (Cyrillic), Yakut
T}
874:Thai
932:Japanese
936:Chinese (Simplified)
949:Korean
950:Chinese (Traditional)
1258:Vietnamese
.TE
.\" ----------------------------------------------------------------------------
.SH SEE ALSO
.BR fsck.fat (8),
.BR mkfs.fat (8)
.\" ----------------------------------------------------------------------------
.SH HOMEPAGE
The home for the \fBdosfstools\fP project is its
.UR https://github.com/dosfstools/dosfstools
GitHub project page
.UE .
.\" ----------------------------------------------------------------------------
.SH AUTHORS
\fBdosfstools\fP were written by
.MT werner.almesberger@\:lrc.di.epfl.ch
Werner Almesberger
.ME ,
.MT Roman.Hodek@\:informatik.\:uni-erlangen.de
Roman Hodek
.ME ,
and others.
Current maintainers are
.MT aeb@\:debian.org
Andreas Bombe
.ME
and
.MT pali.rohar@\:gmail.com
Pali Rohár
.ME .
dosfstools-4.2/manpages/Makefile.in 0000644 0001750 0001750 00000041447 14005523525 014352 0000000 0000000 # Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# dosfstools manpages/Makefile.am
# Copyright (C) 2015 Andreas Bombe
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = manpages
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES = mkfs.fat.8 fsck.fat.8 fatlabel.8
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
man8dir = $(mandir)/man8
am__installdirs = "$(DESTDIR)$(man8dir)"
NROFF = nroff
MANS = $(man_MANS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/fatlabel.8.in \
$(srcdir)/fsck.fat.8.in $(srcdir)/mkfs.fat.8.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHECKATARI = @CHECKATARI@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RELEASE_DATE = @RELEASE_DATE@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
XXD_FOUND = @XXD_FOUND@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
man_MANS = fsck.fat.8 mkfs.fat.8 fatlabel.8
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign manpages/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign manpages/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mkfs.fat.8: $(top_builddir)/config.status $(srcdir)/mkfs.fat.8.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
fsck.fat.8: $(top_builddir)/config.status $(srcdir)/fsck.fat.8.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
fatlabel.8: $(top_builddir)/config.status $(srcdir)/fatlabel.8.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
install-man8: $(man_MANS)
@$(NORMAL_INSTALL)
@list1=''; \
list2='$(man_MANS)'; \
test -n "$(man8dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \
{ for i in $$list1; do echo "$$i"; done; \
if test -n "$$list2"; then \
for i in $$list2; do echo "$$i"; done \
| sed -n '/\.8[a-z]*$$/p'; \
fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
done; }
uninstall-man8:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man8dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.8[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir)
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(MANS)
installdirs:
for dir in "$(DESTDIR)$(man8dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
@COMPAT_SYMLINKS_FALSE@install-data-hook:
@COMPAT_SYMLINKS_FALSE@uninstall-hook:
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-man
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) install-data-hook
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man: install-man8
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-man
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) uninstall-hook
uninstall-man: uninstall-man8
.MAKE: install-am install-data-am install-strip uninstall-am
.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
ctags-am distclean distclean-generic distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-data-hook install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-man8 \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \
uninstall-am uninstall-hook uninstall-man uninstall-man8
.PRECIOUS: Makefile
@COMPAT_SYMLINKS_TRUE@install-data-hook:
@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f fatlabel.8 dosfslabel.8
@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f fsck.fat.8 dosfsck.8
@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f fsck.fat.8 fsck.msdos.8
@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f fsck.fat.8 fsck.vfat.8
@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f mkfs.fat.8 mkdosfs.8
@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f mkfs.fat.8 mkfs.msdos.8
@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f mkfs.fat.8 mkfs.vfat.8
@COMPAT_SYMLINKS_TRUE@uninstall-hook:
@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(mandir)/man8/dosfslabel.8
@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(mandir)/man8/dosfsck.8
@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(mandir)/man8/fsck.msdos.8
@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(mandir)/man8/fsck.vfat.8
@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(mandir)/man8/mkdosfs.8
@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(mandir)/man8/mkfs.msdos.8
@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(mandir)/man8/mkfs.vfat.8
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
dosfstools-4.2/manpages/Makefile.am 0000644 0001750 0001750 00000003077 14005523510 014330 0000000 0000000 # dosfstools manpages/Makefile.am
# Copyright (C) 2015 Andreas Bombe
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
man_MANS = fsck.fat.8 mkfs.fat.8 fatlabel.8
if COMPAT_SYMLINKS
install-data-hook:
cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f fatlabel.8 dosfslabel.8
cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f fsck.fat.8 dosfsck.8
cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f fsck.fat.8 fsck.msdos.8
cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f fsck.fat.8 fsck.vfat.8
cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f mkfs.fat.8 mkdosfs.8
cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f mkfs.fat.8 mkfs.msdos.8
cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f mkfs.fat.8 mkfs.vfat.8
uninstall-hook:
$(RM) $(DESTDIR)$(mandir)/man8/dosfslabel.8
$(RM) $(DESTDIR)$(mandir)/man8/dosfsck.8
$(RM) $(DESTDIR)$(mandir)/man8/fsck.msdos.8
$(RM) $(DESTDIR)$(mandir)/man8/fsck.vfat.8
$(RM) $(DESTDIR)$(mandir)/man8/mkdosfs.8
$(RM) $(DESTDIR)$(mandir)/man8/mkfs.msdos.8
$(RM) $(DESTDIR)$(mandir)/man8/mkfs.vfat.8
endif
dosfstools-4.2/depcomp 0000755 0001750 0001750 00000056020 14005523525 012060 0000000 0000000 #! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva .
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to .
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# Get the directory component of the given path, and save it in the
# global variables '$dir'. Note that this directory component will
# be either empty or ending with a '/' character. This is deliberate.
set_dir_from ()
{
case $1 in
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
*) dir=;;
esac
}
# Get the suffix-stripped basename of the given path, and save it the
# global variable '$base'.
set_base_from ()
{
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
# If no dependency file was actually created by the compiler invocation,
# we still have to create a dummy depfile, to avoid errors with the
# Makefile "include basename.Plo" scheme.
make_dummy_depfile ()
{
echo "#dummy" > "$depfile"
}
# Factor out some common post-processing of the generated depfile.
# Requires the auxiliary global variable '$tmpdepfile' to be set.
aix_post_process_depfile ()
{
# If the compiler actually managed to produce a dependency file,
# post-process it.
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependency.h'.
# Do two passes, one to just change these to
# $object: dependency.h
# and one to simply output
# dependency.h:
# which is needed to avoid the deleted-header problem.
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
} > "$depfile"
rm -f "$tmpdepfile"
else
make_dummy_depfile
fi
}
# A tabulation character.
tab=' '
# A newline character.
nl='
'
# Character ranges might be problematic outside the C locale.
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Avoid interferences from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The second -e expression handles DOS-style file names with drive
# letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
aix_post_process_depfile
;;
tcc)
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
# FIXME: That version still under development at the moment of writing.
# Make that this statement remains true also for stable, released
# versions.
# It will wrap lines (doesn't matter whether long or short) with a
# trailing '\', as in:
#
# foo.o : \
# foo.c \
# foo.h \
#
# It will put a trailing '\' even on the last line, and will use leading
# spaces rather than leading tabs (at least since its commit 0394caf7
# "Emit spaces for -MD").
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
# We have to change lines of the first kind to '$object: \'.
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
# And for each line of the second kind, we have to emit a 'dep.h:'
# dummy dependency, to avoid the deleted-header problem.
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
set_dir_from "$object"
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
set_base_from "$source"
tmpdepfile=$base.d
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir=$base.d-lock
trap "
echo '$0: caught signal, cleaning up...' >&2
rmdir '$lockdir'
exit 1
" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0; do
# mkdir is a portable test-and-set.
if mkdir "$lockdir" 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rmdir "$lockdir"
break
else
# If the lock is being held by a different process, wait
# until the winning process is done or we timeout.
while test -d "$lockdir" && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
# Libtool generates 2 separate objects for the 2 libraries. These
# two compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir$base.o.d # libtool 1.5
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
# Same post-processing that is required for AIX mode.
aix_post_process_depfile
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this sed invocation
# correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process the last invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed '1,2d' "$tmpdepfile" \
| tr ' ' "$nl" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E \
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
| sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
dosfstools-4.2/src/ 0000755 0001750 0001750 00000000000 14005523537 011352 5 0000000 0000000 dosfstools-4.2/src/testdevinfo.c 0000644 0001750 0001750 00000005367 14005523510 013772 0000000 0000000 /* testdevinfo - Display device info findings for debugging
Copyright (C) 2015 Andreas Bombe
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
#include
#include
#include
#include "device_info.h"
int main(int argc, char **argv)
{
struct device_info info;
int fd;
if (argc != 2) {
printf("Usage: testdevinfo FILENAME\n");
return 1;
}
fd = open(argv[1], O_RDONLY | O_NONBLOCK);
if (fd < 0) {
perror("open device");
return 1;
}
device_info_verbose = 100;
get_device_info(fd, &info);
close(fd);
printf("found information:\n");
printf("device type: ");
switch (info.type) {
case TYPE_UNKNOWN:
printf("unknown\n");
break;
case TYPE_BAD:
printf("unusable\n");
break;
case TYPE_FILE:
printf("image file\n");
break;
case TYPE_VIRTUAL:
printf("virtual\n");
break;
case TYPE_REMOVABLE:
printf("removable\n");
break;
case TYPE_FIXED:
printf("fixed\n");
break;
default:
printf("internal error! invalid value\n");
break;
}
printf("is partition: ");
if (info.partition < 0)
printf("unknown\n");
else if (info.partition == 0)
printf("no, full disk\n");
else
printf("number %d\n", info.partition);
printf("has children: ");
if (info.has_children < 0)
printf("unknown\n");
else if (info.has_children == 0)
printf("no\n");
else
printf("yes\n");
printf("heads: ");
if (info.geom_heads < 0)
printf("unknown\n");
else
printf("%d\n", info.geom_heads);
printf("sectors: ");
if (info.geom_sectors < 0)
printf("unknown\n");
else
printf("%d\n", info.geom_sectors);
printf("start: ");
if (info.geom_start < 0)
printf("unknown\n");
else
printf("%lld\n", info.geom_start);
printf("total disk sectors: ");
if (info.geom_size < 0)
printf("unknown\n");
else
printf("%lld\n", info.geom_size);
printf("sector size: ");
if (info.sector_size < 0)
printf("unknown\n");
else
printf("%d\n", info.sector_size);
printf("size: ");
if (info.size < 0)
printf("unknown\n");
else
printf("%lld\n", info.size);
return 0;
}
dosfstools-4.2/src/device_info.h 0000644 0001750 0001750 00000002372 14005523510 013710 0000000 0000000 #ifndef DEVICE_INFO_H
#define DEVICE_INFO_H
enum device_type {
TYPE_UNKNOWN, /* type could not be determined */
TYPE_BAD, /* neither file nor block device */
TYPE_FILE, /* image file rather than device */
TYPE_VIRTUAL, /* block devices like LVM or RAID volumes */
TYPE_REMOVABLE, /* removable disk device */
TYPE_FIXED /* fixed disk device */
};
struct device_info {
enum device_type type;
/*
* partition number if detected
* 0 = whole disk device (including unpartitioned image file)
* -1 = could not be determined
*/
int partition;
/*
* whether partitions or device mapper devices or any other kind of
* children use this device
* 1 = yes
* 0 = no
* -1 = could not be determined
*/
int has_children;
/*
* detected geometry, or -1 if unknown
*/
int geom_heads;
int geom_sectors;
long long geom_start;
long long geom_size;
/*
* detected sector size or -1 if unknown
*/
int sector_size;
/*
* size in bytes, or -1 if unknown
*/
long long size;
};
extern int device_info_verbose;
int get_device_info(int fd, struct device_info *info);
int is_device_mounted(const char *path);
#endif
dosfstools-4.2/src/device_info.c 0000644 0001750 0001750 00000022427 14005523510 013706 0000000 0000000 /* device_info.c - Collect device information for mkfs.fat
Copyright (C) 2015 Andreas Bombe
Copyright (C) 2018 Pali Rohár
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
#include
#include
#include
#include
#include
#include
#include
#ifdef HAVE_LINUX_LOOP_H
#include
#endif
#if HAVE_DECL_GETMNTENT
#include
#include
#endif
#if HAVE_DECL_GETMNTINFO
#include
#include
#include
#endif
#include
#include
#include
#include
#include
#include
#include "blkdev.h"
#include "device_info.h"
static const struct device_info device_info_clueless = {
.type = TYPE_UNKNOWN,
.partition = -1,
.has_children = -1,
.geom_heads = -1,
.geom_sectors = -1,
.geom_start = -1,
.geom_size = -1,
.sector_size = -1,
.size = -1,
};
int device_info_verbose;
static void get_block_device_size(struct device_info *info, int fd)
{
unsigned long long bytes;
if (!blkdev_get_size(fd, &bytes) && bytes != 0)
info->size = bytes;
}
static void get_block_geometry(struct device_info *info, int fd, dev_t rdev)
{
unsigned int heads, sectors;
unsigned long long start;
if (!blkdev_get_geometry(fd, &heads, §ors)
&& heads && sectors) {
info->geom_heads = heads;
info->geom_sectors = sectors;
}
if (!blkdev_get_start(fd, rdev, &start))
info->geom_start = start;
}
static void get_sector_size(struct device_info *info, int fd)
{
int size;
if (!blkdev_get_sector_size(fd, &size))
info->sector_size = size;
}
#ifdef __linux__
static void get_block_linux_info(struct device_info *info, int devfd, dev_t rdev)
{
struct stat st;
char path[PATH_MAX];
int fd;
int blockfd;
FILE *file;
DIR *dir;
struct dirent *d;
int maj;
int min;
long long start;
int removable;
#ifdef HAVE_LINUX_LOOP_H
struct loop_info64 lo;
#endif
maj = major(rdev);
min = minor(rdev);
snprintf(path, sizeof(path), "/sys/dev/block/%d:%d", maj, min);
blockfd = open(path, O_RDONLY | O_DIRECTORY);
if (blockfd < 0)
return;
/* Check if device is partition */
fd = openat(blockfd, "partition", O_RDONLY);
if (fd >= 0) {
file = fdopen(fd, "r");
if (file) {
if (fscanf(file, "%d", &info->partition) != 1 || info->partition == 0)
info->partition = -1;
fclose(file);
} else {
close(fd);
}
/* Read total number of sectors of the disk */
fd = openat(blockfd, "../size", O_RDONLY);
if (fd >= 0) {
file = fdopen(fd, "r");
if (file) {
if (fscanf(file, "%lld", &info->geom_size) != 1 || info->geom_size == 0)
info->geom_size = -1;
fclose(file);
} else {
close(fd);
}
}
} else if (errno == ENOENT && info->geom_start <= 0) {
info->partition = 0;
if (info->size > 0 && info->sector_size > 0)
info->geom_size = info->size / info->sector_size;
}
/* Check if device has partition subdevice and therefore has children */
fd = dup(blockfd);
if (fd >= 0) {
dir = fdopendir(fd);
if (dir) {
info->has_children = 0;
errno = 0;
while ((d = readdir(dir))) {
if (strcmp(d->d_name, ".") == 0 || strcmp(d->d_name, "..") == 0)
continue;
if (d->d_type != DT_DIR && d->d_type != DT_UNKNOWN)
continue;
snprintf(path, sizeof(path), "%s/partition", d->d_name);
if (fstatat(blockfd, path, &st, 0) == 0) {
if (S_ISREG(st.st_mode)) {
start = -1;
snprintf(path, sizeof(path), "%s/start", d->d_name);
fd = openat(blockfd, path, O_RDONLY);
if (fd >= 0) {
file = fdopen(fd, "r");
if (file) {
if (fscanf(file, "%lld", &start) != 1)
start = -1;
fclose(file);
} else {
close(fd);
}
}
/* If subdevice starts at zero offset then it is whole device, so it is not a child */
if (start != 0) {
info->has_children = 1;
break;
}
}
} else if (errno != ENOENT) {
info->has_children = -1;
}
errno = 0;
}
if (errno != 0 && info->has_children == 0)
info->has_children = -1;
closedir(dir);
} else {
close(fd);
}
}
/* Check if device has holders and therefore has children */
if (info->has_children <= 0) {
fd = openat(blockfd, "holders", O_RDONLY | O_DIRECTORY);
if (fd >= 0) {
dir = fdopendir(fd);
if (dir) {
while ((d = readdir(dir))) {
if (strcmp(d->d_name, ".") == 0 || strcmp(d->d_name, "..") == 0)
continue;
info->has_children = 1;
break;
}
closedir(dir);
} else {
close(fd);
}
}
}
/* Check if device is slave of another device and therefore is virtual */
fd = openat(blockfd, "slaves", O_RDONLY | O_DIRECTORY);
if (fd >= 0) {
dir = fdopendir(fd);
if (dir) {
while ((d = readdir(dir))) {
if (strcmp(d->d_name, ".") == 0 || strcmp(d->d_name, "..") == 0)
continue;
info->type = TYPE_VIRTUAL;
break;
}
closedir(dir);
} else {
close(fd);
}
}
#ifdef HAVE_LINUX_LOOP_H
/* Check if device is loop and detect if is based from regular file or is virtual */
if (info->type == TYPE_UNKNOWN && info->partition == 0 && ioctl(devfd, LOOP_GET_STATUS64, &lo) == 0) {
if (lo.lo_offset == 0 && lo.lo_sizelimit == 0 && lo.lo_encrypt_type == LO_CRYPT_NONE &&
stat((char *)lo.lo_file_name, &st) == 0 && S_ISREG(st.st_mode) &&
st.st_dev == lo.lo_device && st.st_ino == lo.lo_inode && st.st_size == info->size)
info->type = TYPE_FILE;
else
info->type = TYPE_VIRTUAL;
}
#endif
/* Device is neither loop nor virtual, so is either removable or fixed */
if (info->type == TYPE_UNKNOWN) {
removable = 0;
fd = openat(blockfd, "removable", O_RDONLY);
if (fd >= 0) {
file = fdopen(fd, "r");
if (file) {
if (fscanf(file, "%d", &removable) != 1)
removable = 0;
fclose(file);
} else {
close(fd);
}
}
if (removable)
info->type = TYPE_REMOVABLE;
else
info->type = TYPE_FIXED;
}
close(blockfd);
}
#endif
int get_device_info(int fd, struct device_info *info)
{
struct stat stat;
int ret;
*info = device_info_clueless;
ret = fstat(fd, &stat);
if (ret < 0) {
perror("fstat on target failed");
return -1;
}
if (S_ISREG(stat.st_mode)) {
/* there is nothing more to discover for an image file */
info->type = TYPE_FILE;
info->partition = 0;
info->size = stat.st_size;
return 0;
}
if (!S_ISBLK(stat.st_mode)) {
/* neither regular file nor block device? not usable */
info->type = TYPE_BAD;
return 0;
}
get_block_device_size(info, fd);
get_block_geometry(info, fd, stat.st_rdev);
get_sector_size(info, fd);
#ifdef __linux__
get_block_linux_info(info, fd, stat.st_rdev);
#endif
return 0;
}
int is_device_mounted(const char *path)
{
#if HAVE_DECL_GETMNTENT
FILE *f;
struct mntent *mnt;
if ((f = setmntent(_PATH_MOUNTED, "r")) == NULL)
return 0;
while ((mnt = getmntent(f)) != NULL)
if (strcmp(path, mnt->mnt_fsname) == 0)
return 1;
endmntent(f);
return 0;
#endif
#if HAVE_DECL_GETMNTINFO
struct statfs *stat;
int count, i;
count = getmntinfo(&stat, 0);
for (i = 0; i < count; i++)
if (!strcmp(path, stat[i].f_mntfromname))
return 1;
return 0;
#endif
(void)path; /* prevent unused parameter warning */
return 0;
}
dosfstools-4.2/src/mkfs.fat.c 0000644 0001750 0001750 00000204453 14005523510 013146 0000000 0000000 /* mkfs.fat.c - utility to create FAT/MS-DOS filesystems
Copyright (C) 1991 Linus Torvalds
Copyright (C) 1992-1993 Remy Card
Copyright (C) 1993-1994 David Hudson
Copyright (C) 1998 H. Peter Anvin
Copyright (C) 1998-2005 Roman Hodek
Copyright (C) 2008-2014 Daniel Baumann
Copyright (C) 2015-2016 Andreas Bombe
Copyright (C) 2018 Pali Rohár
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
/* Description: Utility to allow an MS-DOS filesystem to be created
under Linux. A lot of the basic structure of this program has been
borrowed from Remy Card's "mke2fs" code.
As far as possible the aim here is to make the "mkfs.fat" command
look almost identical to the other Linux filesystem make utilties,
eg bad blocks are still specified as blocks, not sectors, but when
it comes down to it, DOS is tied to the idea of a sector (512 bytes
as a rule), and not the block. For example the boot block does not
occupy a full cluster.
Fixes/additions May 1998 by Roman Hodek
:
- Atari format support
- New options -A, -S, -C
- Support for filesystems > 2GB
- FAT32 support */
/* Include the header files */
#include "version.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "endian_compat.h"
#include "common.h"
#include "msdos_fs.h"
#include "device_info.h"
#include "charconv.h"
/* Constant definitions */
#define TRUE 1 /* Boolean constants */
#define FALSE 0
#define TEST_BUFFER_BLOCKS 16
#define BLOCK_SIZE 1024
#define HARD_SECTOR_SIZE 512
#define SECTORS_PER_BLOCK ( BLOCK_SIZE / HARD_SECTOR_SIZE )
#define NO_NAME "NO NAME "
/* Macro definitions */
/* Mark a cluster in the FAT as bad */
#define mark_sector_bad( sector ) mark_FAT_sector( sector, FAT_BAD )
/* Compute ceil(a/b) */
static inline int cdiv(int a, int b)
{
return (a + b - 1) / b;
}
/* FAT values */
#define FAT_EOF (atari_format ? 0x0fffffff : 0x0ffffff8)
#define FAT_BAD 0x0ffffff7
#define MSDOS_EXT_SIGN 0x29 /* extended boot sector signature */
#define MSDOS_FAT12_SIGN "FAT12 " /* FAT12 filesystem signature */
#define MSDOS_FAT16_SIGN "FAT16 " /* FAT16 filesystem signature */
#define MSDOS_FAT32_SIGN "FAT32 " /* FAT32 filesystem signature */
#define BOOT_SIGN 0xAA55 /* Boot sector magic number */
/* According to Microsoft FAT specification (fatgen103.doc) disk with
* 4085 clusters (or more) is FAT16, but Microsoft Windows FAT driver
* fastfat.sys detects disk with less then 4087 clusters as FAT12.
* Linux FAT drivers msdos.ko and vfat.ko detect disk with at least
* 4085 clusters as FAT16, therefore for compatibility reasons with
* both systems disallow formatting disks to 4085 or 4086 clusters. */
#define MAX_CLUST_12 4084
#define MIN_CLUST_16 4087
/* According to Microsoft FAT specification (fatgen103.doc) disk with
* 65525 clusters (or more) is FAT32, but Microsoft Windows FAT driver
* fastfat.sys, Linux FAT drivers msdos.ko and vfat.ko detect disk as
* FAT32 when Sectors Per FAT (fat_length) is set to zero. And not by
* number of clusters. Still there is cluster upper limit for FAT16. */
#define MAX_CLUST_16 65524
#define MIN_CLUST_32 65525
/* M$ says the high 4 bits of a FAT32 FAT entry are reserved and don't belong
* to the cluster number. So the max. cluster# is based on 2^28 */
#define MAX_CLUST_32 268435446
#define OLDGEMDOS_MAX_SECTORS 32765
#define GEMDOS_MAX_SECTORS 65531
#define GEMDOS_MAX_SECTOR_SIZE (16*1024)
#define BOOTCODE_SIZE 448
#define BOOTCODE_FAT32_SIZE 420
/* __attribute__ ((packed)) is used on all structures to make gcc ignore any
* alignments */
struct msdos_volume_info {
uint8_t drive_number; /* BIOS drive number */
uint8_t boot_flags; /* bit 0: dirty, bit 1: need surface test */
uint8_t ext_boot_sign; /* 0x29 if fields below exist (DOS 3.3+) */
uint8_t volume_id[4]; /* Volume ID number */
uint8_t volume_label[11]; /* Volume label */
uint8_t fs_type[8]; /* Typically FAT12 or FAT16 */
} __attribute__ ((packed));
struct msdos_boot_sector {
uint8_t boot_jump[3]; /* Boot strap short or near jump */
uint8_t system_id[8]; /* Name - can be used to special case
partition manager volumes */
uint8_t sector_size[2]; /* bytes per logical sector */
uint8_t cluster_size; /* sectors/cluster */
uint16_t reserved; /* reserved sectors */
uint8_t fats; /* number of FATs */
uint8_t dir_entries[2]; /* root directory entries */
uint8_t sectors[2]; /* number of sectors */
uint8_t media; /* media code (unused) */
uint16_t fat_length; /* sectors/FAT */
uint16_t secs_track; /* sectors per track */
uint16_t heads; /* number of heads */
uint32_t hidden; /* hidden sectors (unused) */
uint32_t total_sect; /* number of sectors (if sectors == 0) */
union {
struct {
struct msdos_volume_info vi;
uint8_t boot_code[BOOTCODE_SIZE];
} __attribute__ ((packed)) _oldfat;
struct {
uint32_t fat32_length; /* sectors/FAT */
uint16_t flags; /* bit 8: fat mirroring, low 4: active fat */
uint8_t version[2]; /* major, minor filesystem version */
uint32_t root_cluster; /* first cluster in root directory */
uint16_t info_sector; /* filesystem info sector */
uint16_t backup_boot; /* backup boot sector */
uint16_t reserved2[6]; /* Unused */
struct msdos_volume_info vi;
uint8_t boot_code[BOOTCODE_FAT32_SIZE];
} __attribute__ ((packed)) _fat32;
} __attribute__ ((packed)) fstype;
uint16_t boot_sign;
} __attribute__ ((packed));
#define fat32 fstype._fat32
#define oldfat fstype._oldfat
struct fat32_fsinfo {
uint32_t reserved1; /* Nothing as far as I can tell */
uint32_t signature; /* 0x61417272L */
uint32_t free_clusters; /* Free cluster count. -1 if unknown */
uint32_t next_cluster; /* Most recently allocated cluster.
* Unused under Linux. */
uint32_t reserved2[4];
} __attribute__ ((packed));
/* The "boot code" we put into the filesystem... it writes a message and
tells the user to try again. This "boot code" is in the public domain. */
unsigned char dummy_boot_jump[3] = { 0xeb, 0x3c, 0x90 };
unsigned char dummy_boot_jump_m68k[2] = { 0x60, 0x1c };
#define MSG_OFFSET_OFFSET 3
char dummy_boot_code[BOOTCODE_SIZE] = "\x0e" /* push cs */
"\x1f" /* pop ds */
"\xbe\x5b\x7c" /* mov si, offset message_txt */
/* write_msg: */
"\xac" /* lodsb */
"\x22\xc0" /* and al, al */
"\x74\x0b" /* jz key_press */
"\x56" /* push si */
"\xb4\x0e" /* mov ah, 0eh */
"\xbb\x07\x00" /* mov bx, 0007h */
"\xcd\x10" /* int 10h */
"\x5e" /* pop si */
"\xeb\xf0" /* jmp write_msg */
/* key_press: */
"\x32\xe4" /* xor ah, ah */
"\xcd\x16" /* int 16h */
"\xcd\x19" /* int 19h */
"\xeb\xfe" /* foo: jmp foo */
/* message_txt: */
"This is not a bootable disk. Please insert a bootable floppy and\r\n"
"press any key to try again ... \r\n";
#define MESSAGE_OFFSET 29 /* Offset of message in above code */
static char initial_volume_name[] = NO_NAME; /* Initial volume name, make sure that is writable */
/* Global variables - the root of all evil :-) - see these and weep! */
static char *device_name = NULL; /* Name of the device on which to create the filesystem */
static int check = FALSE; /* Default to no readablity checking */
static int verbose = 0; /* Default to verbose mode off */
static long volume_id; /* Volume ID number */
static time_t create_time = -1; /* Creation time */
static char *volume_name = initial_volume_name; /* Volume name */
static unsigned long long blocks; /* Number of blocks in filesystem */
static unsigned sector_size = 512; /* Size of a logical sector */
static int sector_size_set = 0; /* User selected sector size */
static int backup_boot = 0; /* Sector# of backup boot sector */
static int backup_boot_set = 0; /* User selected backup boot sector */
static int info_sector = 0; /* Sector# of FAT32 info sector */
static int reserved_sectors = 0; /* Number of reserved sectors */
static int badblocks = 0; /* Number of bad blocks in the filesystem */
static int nr_fats = 2; /* Default number of FATs to produce */
static int size_fat = 0; /* Size in bits of FAT entries */
static int size_fat_by_user = 0; /* 1 if FAT size user selected */
static int dev = -1; /* FS block device file handle */
static off_t part_sector = 0; /* partition offset in sector */
static int ignore_safety_checks = 0; /* Ignore safety checks */
static off_t currently_testing = 0; /* Block currently being tested (if autodetect bad blocks) */
static struct msdos_boot_sector bs; /* Boot sector data */
static int start_data_sector; /* Sector number for the start of the data area */
static int start_data_block; /* Block number for the start of the data area */
static unsigned char *fat; /* File allocation table */
static unsigned alloced_fat_length; /* # of FAT sectors we can keep in memory */
static unsigned fat_entries; /* total entries in FAT table (including reserved) */
static unsigned char *info_sector_buffer; /* FAT32 info sector */
static struct msdos_dir_entry *root_dir; /* Root directory */
static int size_root_dir; /* Size of the root directory in bytes */
static uint32_t num_sectors; /* Total number of sectors in device */
static int sectors_per_cluster = 0; /* Number of sectors per disk cluster */
static int root_dir_entries = 0; /* Number of root directory entries */
static int root_dir_entries_set = 0; /* User selected root directory size */
static char *blank_sector; /* Blank sector - all zeros */
static unsigned hidden_sectors = 0; /* Number of hidden sectors */
static int hidden_sectors_by_user = 0; /* -h option invoked */
static int drive_number_option = 0; /* drive number */
static int drive_number_by_user = 0; /* drive number option invoked */
static int fat_media_byte = 0; /* media byte in header and starting FAT */
static int malloc_entire_fat = FALSE; /* Whether we should malloc() the entire FAT or not */
static int align_structures = TRUE; /* Whether to enforce alignment */
static int orphaned_sectors = 0; /* Sectors that exist in the last block of filesystem */
static int invariant = 0; /* Whether to set normally randomized or
current time based values to
constants */
static int fill_mbr_partition = -1; /* Whether to fill MBR partition table or not */
/* Function prototype definitions */
static void mark_FAT_cluster(int cluster, unsigned int value);
static void mark_FAT_sector(int sector, unsigned int value);
static long do_check(char *buffer, int try, off_t current_block);
static void alarm_intr(int alnum);
static void check_blocks(void);
static void get_list_blocks(char *filename);
static void check_mount(char *device_name);
static void establish_params(struct device_info *info);
static void setup_tables(void);
static void write_tables(void);
/* The function implementations */
/* Mark the specified cluster as having a particular value */
static void mark_FAT_cluster(int cluster, unsigned int value)
{
if (cluster < 0 || cluster >= fat_entries)
die("Internal error: out of range cluster number in mark_FAT_cluster");
switch (size_fat) {
case 12:
value &= 0x0fff;
if (((cluster * 3) & 0x1) == 0) {
fat[3 * cluster / 2] = (unsigned char)(value & 0x00ff);
fat[(3 * cluster / 2) + 1] =
(unsigned char)((fat[(3 * cluster / 2) + 1] & 0x00f0)
| ((value & 0x0f00) >> 8));
} else {
fat[3 * cluster / 2] =
(unsigned char)((fat[3 * cluster / 2] & 0x000f) |
((value & 0x000f) << 4));
fat[(3 * cluster / 2) + 1] = (unsigned char)((value & 0x0ff0) >> 4);
}
break;
case 16:
value &= 0xffff;
fat[2 * cluster] = (unsigned char)(value & 0x00ff);
fat[(2 * cluster) + 1] = (unsigned char)(value >> 8);
break;
case 32:
value &= 0xfffffff;
fat[4 * cluster] = (unsigned char)(value & 0x000000ff);
fat[(4 * cluster) + 1] = (unsigned char)((value & 0x0000ff00) >> 8);
fat[(4 * cluster) + 2] = (unsigned char)((value & 0x00ff0000) >> 16);
fat[(4 * cluster) + 3] = (unsigned char)((value & 0xff000000) >> 24);
break;
default:
die("Bad FAT size (not 12, 16, or 32)");
}
}
/* Mark a specified sector as having a particular value in it's FAT entry */
static void mark_FAT_sector(int sector, unsigned int value)
{
int cluster = (sector - start_data_sector) / (int)(bs.cluster_size) /
(sector_size / HARD_SECTOR_SIZE) + 2;
if (sector < start_data_sector || sector >= num_sectors)
die("Internal error: out of range sector number in mark_FAT_sector");
mark_FAT_cluster(cluster, value);
}
/* Perform a test on a block. Return the number of blocks that could be read successfully */
static long do_check(char *buffer, int try, off_t current_block)
{
long got;
if (lseek(dev, part_sector * sector_size + current_block * BLOCK_SIZE, SEEK_SET) /* Seek to the correct location */
!=current_block * BLOCK_SIZE)
die("seek failed during testing for blocks");
got = read(dev, buffer, try * BLOCK_SIZE); /* Try reading! */
if (got < 0)
got = 0;
if (got & (BLOCK_SIZE - 1))
printf("Unexpected values in do_check: probably bugs\n");
got /= BLOCK_SIZE;
return got;
}
/* Alarm clock handler - display the status of the quest for bad blocks! Then retrigger the alarm for five senconds
later (so we can come here again) */
static void alarm_intr(int alnum)
{
(void)alnum;
if (currently_testing >= blocks)
return;
signal(SIGALRM, alarm_intr);
alarm(5);
if (!currently_testing)
return;
printf("%lld... ", (unsigned long long)currently_testing);
fflush(stdout);
}
static void check_blocks(void)
{
int try, got;
int i;
static char blkbuf[BLOCK_SIZE * TEST_BUFFER_BLOCKS];
if (verbose) {
printf("Searching for bad blocks ");
fflush(stdout);
}
currently_testing = 0;
if (verbose) {
signal(SIGALRM, alarm_intr);
alarm(5);
}
try = TEST_BUFFER_BLOCKS;
while (currently_testing < blocks) {
if (currently_testing + try > blocks)
try = blocks - currently_testing; /* TODO: check overflow */
got = do_check(blkbuf, try, currently_testing);
currently_testing += got;
if (got == try) {
try = TEST_BUFFER_BLOCKS;
continue;
} else
try = 1;
if (currently_testing < start_data_block)
die("bad blocks before data-area: cannot make fs");
for (i = 0; i < SECTORS_PER_BLOCK; i++) /* Mark all of the sectors in the block as bad */
mark_sector_bad(currently_testing * SECTORS_PER_BLOCK + i);
badblocks++;
currently_testing++;
}
if (verbose)
printf("\n");
if (badblocks)
printf("%d bad block%s\n", badblocks, (badblocks > 1) ? "s" : "");
}
static void get_list_blocks(char *filename)
{
int i;
FILE *listfile;
long long blockno;
char *line = NULL;
size_t linesize = 0;
int lineno = 0;
char *end, *check;
listfile = fopen(filename, "r");
if (listfile == (FILE *) NULL)
die("Can't open file of bad blocks");
while (1) {
lineno++;
ssize_t length = getline(&line, &linesize, listfile);
if (length < 0) {
if (errno == 0) /* end of file */
break;
perror("getline");
die("Error while reading bad blocks file");
}
errno = 0;
blockno = strtoll(line, &end, 10);
if (errno || blockno < 0) {
fprintf(stderr,
"While converting bad block number in line %d: %s\n",
lineno, strerror(errno));
die("Error in bad blocks file");
}
check = end;
while (*check) {
if (!isspace(*check)) {
fprintf(stderr,
"Badly formed number in bad blocks file line %d\n",
lineno);
die("Error in bad blocks file");
}
check++;
}
/* ignore empty or white space only lines */
if (end == line)
continue;
/* Mark all of the sectors in the block as bad */
for (i = 0; i < SECTORS_PER_BLOCK; i++) {
unsigned long long sector = blockno * SECTORS_PER_BLOCK + i;
if (sector < start_data_sector) {
fprintf(stderr, "Block number %lld is before data area\n",
blockno);
die("Error in bad blocks file");
}
if (sector >= num_sectors) {
fprintf(stderr, "Block number %lld is behind end of filesystem\n",
blockno);
die("Error in bad blocks file");
}
mark_sector_bad(sector);
}
badblocks++;
}
fclose(listfile);
free(line);
if (badblocks)
printf("%d bad block%s\n", badblocks, (badblocks > 1) ? "s" : "");
}
/* Check to see if the specified device is currently mounted - abort if it is */
static void check_mount(char *device_name)
{
if (is_device_mounted(device_name))
die("%s contains a mounted filesystem.", device_name);
}
/* Establish the geometry and media parameters for the device */
static void establish_params(struct device_info *info)
{
unsigned int sec_per_track;
unsigned int heads;
unsigned int media = 0xf8;
unsigned int cluster_size = 4; /* starting point for FAT12 and FAT16 */
int def_root_dir_entries = 512;
if (info->geom_heads > 0) {
heads = info->geom_heads;
sec_per_track = info->geom_sectors;
} else {
unsigned long long int total_sectors;
if (info->geom_size > 0)
total_sectors = info->geom_size;
else if (info->sector_size > 0)
total_sectors = info->size / info->sector_size;
else
total_sectors = info->size / sector_size;
if (total_sectors <= 524288) {
/* For capacity below the 256MB (with 512b sectors) use CHS Recommendation from SD Card Part 2 File System Specification */
heads = total_sectors <= 32768 ? 2 :
total_sectors <= 65536 ? 4 :
total_sectors <= 262144 ? 8 : 16;
sec_per_track = total_sectors <= 4096 ? 16 : 32;
} else {
/* Use LBA-Assist Translation for calculating CHS when disk geometry is not available */
heads = total_sectors <= 16*63*1024 ? 16 :
total_sectors <= 32*63*1024 ? 32 :
total_sectors <= 64*63*1024 ? 64 :
total_sectors <= 128*63*1024 ? 128 : 255;
sec_per_track = 63;
}
}
if (info->type != TYPE_FIXED) {
/* enter default parameters for floppy disks if the size matches */
switch (info->size / 1024) {
case 360:
sec_per_track = 9;
heads = 2;
media = 0xfd;
cluster_size = 2;
def_root_dir_entries = 112;
break;
case 720:
sec_per_track = 9;
heads = 2;
media = 0xf9;
cluster_size = 2;
def_root_dir_entries = 112;
break;
case 1200:
sec_per_track = 15;
heads = 2;
media = 0xf9;
cluster_size = (atari_format ? 2 : 1);
def_root_dir_entries = 224;
break;
case 1440:
sec_per_track = 18;
heads = 2;
media = 0xf0;
cluster_size = (atari_format ? 2 : 1);
def_root_dir_entries = 224;
break;
case 2880:
sec_per_track = 36;
heads = 2;
media = 0xf0;
cluster_size = 2;
def_root_dir_entries = 224;
break;
}
}
if (!size_fat && info->size >= 512 * 1024 * 1024) {
if (verbose)
printf("Auto-selecting FAT32 for large filesystem\n");
size_fat = 32;
}
if (size_fat == 32) {
/*
* For FAT32, try to do the same as M$'s format command
* (see http://www.win.tue.nl/~aeb/linux/fs/fat/fatgen103.pdf p. 20):
* fs size <= 260M: 0.5k clusters
* fs size <= 8G: 4k clusters
* fs size <= 16G: 8k clusters
* fs size <= 32G: 16k clusters
* fs size > 32G: 32k clusters
*/
unsigned long long int sectors = info->size / sector_size;
cluster_size = sectors > 32*1024*1024*2 ? 64 :
sectors > 16*1024*1024*2 ? 32 :
sectors > 8*1024*1024*2 ? 16 :
sectors > 260*1024*2 ? 8 : 1;
}
if (!hidden_sectors_by_user && info->geom_start >= 0 && info->geom_start + part_sector <= UINT32_MAX)
hidden_sectors = info->geom_start + part_sector;
if (!root_dir_entries)
root_dir_entries = def_root_dir_entries;
if (!bs.secs_track)
bs.secs_track = htole16(sec_per_track);
if (!bs.heads)
bs.heads = htole16(heads);
bs.media = media;
bs.cluster_size = cluster_size;
}
/*
* If alignment is enabled, round the first argument up to the second; the
* latter must be a power of two.
*/
static unsigned int align_object(unsigned int sectors, unsigned int clustsize)
{
if (align_structures)
return (sectors + clustsize - 1) & ~(clustsize - 1);
else
return sectors;
}
/* Create the filesystem data tables */
static void setup_tables(void)
{
unsigned cluster_count = 0, fat_length;
struct tm *ctime;
struct msdos_volume_info *vi =
(size_fat == 32 ? &bs.fat32.vi : &bs.oldfat.vi);
char label[12] = { 0 };
size_t len;
int ret;
int i;
if (atari_format) {
/* On Atari, the first few bytes of the boot sector are assigned
* differently: The jump code is only 2 bytes (and m68k machine code
* :-), then 6 bytes filler (ignored), then 3 byte serial number. */
bs.boot_jump[2] = 'm';
memcpy((char *)bs.system_id, "kdosf", strlen("kdosf"));
} else
memcpy((char *)bs.system_id, "mkfs.fat", strlen("mkfs.fat"));
if (sectors_per_cluster)
bs.cluster_size = (char)sectors_per_cluster;
if (fat_media_byte)
bs.media = (char) fat_media_byte;
if (bs.media == 0xf8)
vi->drive_number=0x80;
else
vi->drive_number=0x00;
if (drive_number_by_user)
vi->drive_number= (char) drive_number_option;
if (size_fat == 32) {
/* Under FAT32, the root dir is in a cluster chain, and this is
* signalled by bs.dir_entries being 0. */
if (root_dir_entries_set)
fprintf(stderr, "Warning: root directory entries specified with -r have no effect on FAT32\n");
root_dir_entries = 0;
}
if (atari_format) {
bs.system_id[5] = (unsigned char)(volume_id & 0x000000ff);
bs.system_id[6] = (unsigned char)((volume_id & 0x0000ff00) >> 8);
bs.system_id[7] = (unsigned char)((volume_id & 0x00ff0000) >> 16);
} else {
vi->volume_id[0] = (unsigned char)(volume_id & 0x000000ff);
vi->volume_id[1] = (unsigned char)((volume_id & 0x0000ff00) >> 8);
vi->volume_id[2] = (unsigned char)((volume_id & 0x00ff0000) >> 16);
vi->volume_id[3] = (unsigned char)(volume_id >> 24);
}
len = mbstowcs(NULL, volume_name, 0);
if (len != (size_t)-1 && len > 11)
die("Label can be no longer than 11 characters");
if (!local_string_to_dos_string(label, volume_name, 12))
die("Error when processing label");
for (i = strlen(label); i < 11; ++i)
label[i] = ' ';
label[11] = 0;
if (memcmp(label, " ", MSDOS_NAME) == 0)
memcpy(label, NO_NAME, MSDOS_NAME);
ret = validate_volume_label(label);
if (ret & 0x1)
fprintf(stderr,
"mkfs.fat: Warning: lowercase labels might not work properly on some systems\n");
if (ret & 0x2)
die("Labels with characters below 0x20 are not allowed\n");
if (ret & 0x4)
die("Labels with characters *?.,;:/\\|+=<>[]\" are not allowed\n");
if (ret & 0x10)
die("Label can't start with a space character");
if (!atari_format) {
memcpy(vi->volume_label, label, 11);
memcpy(bs.boot_jump, dummy_boot_jump, 3);
/* Patch in the correct offset to the boot code */
bs.boot_jump[1] = ((size_fat == 32 ?
(char *)&bs.fat32.boot_code :
(char *)&bs.oldfat.boot_code) - (char *)&bs) - 2;
if (size_fat == 32) {
int offset = (char *)&bs.fat32.boot_code -
(char *)&bs + MESSAGE_OFFSET + 0x7c00;
if (dummy_boot_code[BOOTCODE_FAT32_SIZE - 1])
printf("Warning: message too long; truncated\n");
dummy_boot_code[BOOTCODE_FAT32_SIZE - 1] = 0;
memcpy(bs.fat32.boot_code, dummy_boot_code, BOOTCODE_FAT32_SIZE);
bs.fat32.boot_code[MSG_OFFSET_OFFSET] = offset & 0xff;
bs.fat32.boot_code[MSG_OFFSET_OFFSET + 1] = offset >> 8;
} else {
memcpy(bs.oldfat.boot_code, dummy_boot_code, BOOTCODE_SIZE);
}
bs.boot_sign = htole16(BOOT_SIGN);
} else {
memcpy(bs.boot_jump, dummy_boot_jump_m68k, 2);
}
if (verbose >= 2)
printf("Boot jump code is %02x %02x\n",
bs.boot_jump[0], bs.boot_jump[1]);
if (!reserved_sectors)
reserved_sectors = (size_fat == 32) ? 32 : 1;
else {
if (size_fat == 32 && reserved_sectors < 2)
die("On FAT32 at least 2 reserved sectors are needed.");
}
bs.reserved = htole16(reserved_sectors);
if (verbose >= 2)
printf("Using %d reserved sectors\n", reserved_sectors);
bs.fats = (char)nr_fats;
if (!atari_format || size_fat == 32)
bs.hidden = htole32(hidden_sectors);
else {
/* In Atari format, hidden is a 16 bit field */
uint16_t hidden = htole16(hidden_sectors);
if (hidden_sectors & ~0xffff)
die("#hidden doesn't fit in 16bit field of Atari format\n");
memcpy(&bs.hidden, &hidden, 2);
}
if ((long long)(blocks * BLOCK_SIZE / sector_size) + orphaned_sectors >
UINT32_MAX) {
printf("Warning: target too large, space at end will be left unused\n");
num_sectors = UINT32_MAX;
blocks = (unsigned long long)UINT32_MAX * sector_size / BLOCK_SIZE;
} else {
num_sectors =
(long long)(blocks * BLOCK_SIZE / sector_size) + orphaned_sectors;
}
if (align_structures) {
/* Align number of sectors to be multiple of sectors per track, needed by DOS and mtools */
num_sectors = num_sectors / le16toh(bs.secs_track) * le16toh(bs.secs_track);
}
if (!atari_format) {
unsigned fatdata1216; /* Sectors for FATs + data area (FAT12/16) */
unsigned fatdata32; /* Sectors for FATs + data area (FAT32) */
unsigned fatlength12, fatlength16, fatlength32;
unsigned maxclust12, maxclust16, maxclust32;
unsigned clust12, clust16, clust32;
int maxclustsize;
unsigned root_dir_sectors = cdiv(root_dir_entries * 32, sector_size);
/*
* If the filesystem is 8192 sectors or less (4 MB with 512-byte
* sectors, i.e. floppy size), don't align the data structures.
*/
if (num_sectors <= 8192) {
if (align_structures && verbose >= 2)
printf("Disabling alignment due to tiny filesystem\n");
align_structures = FALSE;
}
if (sectors_per_cluster)
bs.cluster_size = maxclustsize = sectors_per_cluster;
else
/* An initial guess for bs.cluster_size should already be set */
maxclustsize = 128;
do {
fatdata32 = num_sectors
- align_object(reserved_sectors, bs.cluster_size);
fatdata1216 = fatdata32
- align_object(root_dir_sectors, bs.cluster_size);
if (verbose >= 2)
printf("Trying with %d sectors/cluster:\n", bs.cluster_size);
/* The factor 2 below avoids cut-off errors for nr_fats == 1.
* The "nr_fats*3" is for the reserved first two FAT entries */
clust12 = 2 * ((long long)fatdata1216 * sector_size + nr_fats * 3) /
(2 * (int)bs.cluster_size * sector_size + nr_fats * 3);
fatlength12 = cdiv(((clust12 + 2) * 3 + 1) >> 1, sector_size);
fatlength12 = align_object(fatlength12, bs.cluster_size);
/* Need to recalculate number of clusters, since the unused parts of the
* FATS and data area together could make up space for an additional,
* not really present cluster. */
clust12 = (fatdata1216 - nr_fats * fatlength12) / bs.cluster_size;
maxclust12 = (fatlength12 * 2 * sector_size) / 3;
if (maxclust12 > MAX_CLUST_12)
maxclust12 = MAX_CLUST_12;
if (verbose >= 2 && (size_fat == 0 || size_fat == 12))
printf("Trying FAT12: #clu=%u, fatlen=%u, maxclu=%u, limit=%u\n",
clust12, fatlength12, maxclust12, MAX_CLUST_12);
if (clust12 > maxclust12) {
clust12 = 0;
if (verbose >= 2 && (size_fat == 0 || size_fat == 12))
printf("Trying FAT12: too much clusters\n");
}
clust16 = ((long long)fatdata1216 * sector_size + nr_fats * 4) /
((int)bs.cluster_size * sector_size + nr_fats * 2);
fatlength16 = cdiv((clust16 + 2) * 2, sector_size);
fatlength16 = align_object(fatlength16, bs.cluster_size);
/* Need to recalculate number of clusters, since the unused parts of the
* FATS and data area together could make up space for an additional,
* not really present cluster. */
clust16 = (fatdata1216 - nr_fats * fatlength16) / bs.cluster_size;
maxclust16 = (fatlength16 * sector_size) / 2;
if (maxclust16 > MAX_CLUST_16)
maxclust16 = MAX_CLUST_16;
if (verbose >= 2 && (size_fat == 0 || size_fat == 16))
printf("Trying FAT16: #clu=%u, fatlen=%u, maxclu=%u, limit=%u/%u\n",
clust16, fatlength16, maxclust16, MIN_CLUST_16, MAX_CLUST_16);
if (clust16 > maxclust16) {
if (verbose >= 2 && (size_fat == 0 || size_fat == 16))
printf("Trying FAT16: too much clusters\n");
clust16 = 0;
}
/* This avoids that the filesystem will be misdetected as having a
* 12 bit FAT. */
if (clust16 && clust16 < MIN_CLUST_16) {
if (verbose >= 2 && (size_fat == 0 || size_fat == 16))
printf("Trying FAT16: not enough clusters, would be misdetected as FAT12\n");
clust16 = 0;
}
clust32 = ((long long)fatdata32 * sector_size + nr_fats * 8) /
((int)bs.cluster_size * sector_size + nr_fats * 4);
fatlength32 = cdiv((clust32 + 2) * 4, sector_size);
fatlength32 = align_object(fatlength32, bs.cluster_size);
/* Need to recalculate number of clusters, since the unused parts of the
* FATS and data area together could make up space for an additional,
* not really present cluster. */
clust32 = (fatdata32 - nr_fats * fatlength32) / bs.cluster_size;
maxclust32 = (fatlength32 * sector_size) / 4;
if (maxclust32 > MAX_CLUST_32)
maxclust32 = MAX_CLUST_32;
if (verbose >= 2 && (size_fat == 0 || size_fat == 32))
printf("Trying FAT32: #clu=%u, fatlen=%u, maxclu=%u, limit=%u/%u\n",
clust32, fatlength32, maxclust32, MIN_CLUST_32, MAX_CLUST_32);
if (clust32 > maxclust32) {
if (verbose >= 2 && (size_fat == 0 || size_fat == 32))
printf("Trying FAT32: too much clusters\n");
clust32 = 0;
}
/* When explicitely asked, allow to create FAT32 with less then MIN_CLUST_32 */
if (clust32 && clust32 < MIN_CLUST_32
&& !(size_fat_by_user && size_fat == 32)) {
if (verbose >= 2 && (size_fat == 0 || size_fat == 32))
printf("Trying FAT32: not enough clusters\n");
clust32 = 0;
}
if ((clust12 && (size_fat == 0 || size_fat == 12)) ||
(clust16 && (size_fat == 0 || size_fat == 16)) ||
(clust32 && size_fat == 32))
break;
bs.cluster_size <<= 1;
} while (bs.cluster_size && bs.cluster_size <= maxclustsize);
/* Use the optimal FAT size if not specified;
* establish_params() will have already set size_fat to 32 if it is not
* specified and the filesystem size is over a specific threshold */
if (!size_fat) {
size_fat = (clust16 > clust12) ? 16 : 12;
if (verbose >= 2)
printf("Choosing %d bits for FAT\n", size_fat);
}
switch (size_fat) {
case 12:
cluster_count = clust12;
fat_length = fatlength12;
bs.fat_length = htole16(fatlength12);
memcpy(vi->fs_type, MSDOS_FAT12_SIGN, 8);
break;
case 16:
cluster_count = clust16;
fat_length = fatlength16;
bs.fat_length = htole16(fatlength16);
memcpy(vi->fs_type, MSDOS_FAT16_SIGN, 8);
break;
case 32:
if (clust32 < MIN_CLUST_32)
fprintf(stderr, "WARNING: Number of clusters for 32 bit FAT is less then suggested minimum.\n");
cluster_count = clust32;
fat_length = fatlength32;
bs.fat_length = htole16(0);
bs.fat32.fat32_length = htole32(fatlength32);
memcpy(vi->fs_type, MSDOS_FAT32_SIGN, 8);
root_dir_entries = 0;
break;
default:
die("FAT not 12, 16 or 32 bits");
}
/* Adjust the reserved number of sectors for alignment */
reserved_sectors = align_object(reserved_sectors, bs.cluster_size);
bs.reserved = htole16(reserved_sectors);
/* Adjust the number of root directory entries to help enforce alignment */
if (align_structures) {
root_dir_entries = align_object(root_dir_sectors, bs.cluster_size)
* (sector_size >> 5);
}
} else {
unsigned clusters, maxclust, fatdata;
/* GEMDOS always uses a 12 bit FAT on floppies, and always a 16 bit FAT on
* hard disks. So use 12 bit if the size of the filesystem suggests that
* this fs is for a floppy disk, if the user hasn't explicitly requested a
* size.
*/
if (!size_fat)
size_fat = (num_sectors == 1440 || num_sectors == 2400 ||
num_sectors == 2880 || num_sectors == 5760) ? 12 : 16;
if (verbose >= 2)
printf("Choosing %d bits for FAT\n", size_fat);
/* Atari format: cluster size should be 2, except explicitly requested by
* the user, since GEMDOS doesn't like other cluster sizes very much.
* Instead, tune the sector size for the FS to fit.
*/
bs.cluster_size = sectors_per_cluster ? sectors_per_cluster : 2;
if (!sector_size_set) {
while (num_sectors > GEMDOS_MAX_SECTORS) {
num_sectors >>= 1;
sector_size <<= 1;
}
}
if (verbose >= 2)
printf("Sector size must be %d to have less than %d log. sectors\n",
sector_size, GEMDOS_MAX_SECTORS);
/* Check if there are enough FAT indices for how much clusters we have */
do {
fatdata = num_sectors - cdiv(root_dir_entries * 32, sector_size) -
reserved_sectors;
/* The factor 2 below avoids cut-off errors for nr_fats == 1 and
* size_fat == 12
* The "2*nr_fats*size_fat/8" is for the reserved first two FAT entries
*/
clusters =
(2 *
((long long)fatdata * sector_size -
2 * nr_fats * size_fat / 8)) / (2 * ((int)bs.cluster_size *
sector_size +
nr_fats * size_fat / 8));
fat_length = cdiv((clusters + 2) * size_fat / 8, sector_size);
/* Need to recalculate number of clusters, since the unused parts of the
* FATS and data area together could make up space for an additional,
* not really present cluster. */
clusters = (fatdata - nr_fats * fat_length) / bs.cluster_size;
maxclust = (fat_length * sector_size * 8) / size_fat;
if (verbose >= 2)
printf("ss=%d: #clu=%d, fat_len=%d, maxclu=%d\n",
sector_size, clusters, fat_length, maxclust);
/* last 10 cluster numbers are special (except FAT32: 4 high bits rsvd);
* first two numbers are reserved */
if (maxclust <=
(size_fat == 32 ? MAX_CLUST_32 : (1 << size_fat) - 0x10)
&& clusters <= maxclust - 2)
break;
if (verbose >= 2)
printf(clusters > maxclust - 2 ?
"Too many clusters\n" : "FAT too big\n");
/* need to increment sector_size once more to */
if (sector_size_set)
die("With this sector size, the maximum number of FAT entries "
"would be exceeded.");
num_sectors >>= 1;
sector_size <<= 1;
} while (sector_size <= GEMDOS_MAX_SECTOR_SIZE);
if (sector_size > GEMDOS_MAX_SECTOR_SIZE)
die("Would need a sector size > 16k, which GEMDOS can't work with");
cluster_count = clusters;
if (size_fat != 32)
bs.fat_length = htole16(fat_length);
else {
bs.fat_length = 0;
bs.fat32.fat32_length = htole32(fat_length);
}
}
if (fill_mbr_partition) {
uint8_t *partition;
uint8_t *disk_sig_ptr;
uint32_t disk_sig;
uint8_t buf[512];
int fd;
if (verbose)
printf("Adding MBR table\n");
if (size_fat == 32)
disk_sig_ptr = bs.fat32.boot_code + BOOTCODE_FAT32_SIZE - 16*4 - 6;
else
disk_sig_ptr = bs.oldfat.boot_code + BOOTCODE_SIZE - 16*4 - 6;
if (*(disk_sig_ptr-1)) {
printf("Warning: message too long; truncated\n");
*(disk_sig_ptr-1) = 0;
}
disk_sig = 0;
memset(disk_sig_ptr, 0, 16*4 + 6);
/* Try to read existing 32 bit disk signature */
fd = open(device_name, O_RDONLY);
if (fd >= 0) {
if (read(fd, buf, sizeof(buf)) == sizeof(buf) && buf[510] == 0x55 && buf[511] == 0xAA)
disk_sig = (uint32_t)buf[440] | ((uint32_t)buf[441] << 8) | ((uint32_t)buf[442] << 16) | ((uint32_t)buf[443] << 24);
close(fd);
}
/* If is not available then generate random 32 bit disk signature */
if (invariant)
disk_sig = volume_id;
else if (!disk_sig)
disk_sig = generate_volume_id();
disk_sig_ptr[0] = (disk_sig >> 0) & 0xFF;
disk_sig_ptr[1] = (disk_sig >> 8) & 0xFF;
disk_sig_ptr[2] = (disk_sig >> 16) & 0xFF;
disk_sig_ptr[3] = (disk_sig >> 24) & 0xFF;
partition = disk_sig_ptr + 6;
/* Active flag */
partition[0] = 0x80;
/* CHS address of the first sector */
partition[1] = 0;
partition[2] = 1;
partition[3] = 0;
/* Partition type */
if (le16toh(bs.heads) > 254 || le16toh(bs.secs_track) > 63) { /* CHS values are out of range for MBR, use LBA */
if (size_fat != 32)
partition[4] = 0x0E; /* BIG FAT16 (LBA) */
else
partition[4] = 0x0C; /* FAT32 (LBA) */
} else if (size_fat == 12 && num_sectors < 65536)
partition[4] = 0x01; /* FAT12 (CHS) */
else if (size_fat == 16 && num_sectors < 65536)
partition[4] = 0x04; /* FAT16 (CHS) */
else if (size_fat != 32 && num_sectors < le16toh(bs.secs_track) * le16toh(bs.heads) * 1024)
partition[4] = 0x06; /* BIG FAT16 or FAT12 (CHS) */
else if (size_fat != 32)
partition[4] = 0x0E; /* BIG FAT16 (LBA) */
else
partition[4] = 0x0C; /* FAT32 (LBA) */
/* CHS address of the last sector */
if (le16toh(bs.heads) > 254 || le16toh(bs.secs_track) > 63 || num_sectors >= le16toh(bs.secs_track) * le16toh(bs.heads) * 1024) {
/* If CHS address is too large use tuple (1023, 254, 63) */
partition[5] = 254;
partition[6] = 255;
partition[7] = 255;
} else {
partition[5] = (num_sectors / le16toh(bs.secs_track)) % le16toh(bs.heads);
partition[6] = ((1 + num_sectors % le16toh(bs.secs_track)) & 63) | (((num_sectors / (le16toh(bs.heads) * le16toh(bs.secs_track))) >> 8) * 64);
partition[7] = (num_sectors / (le16toh(bs.heads) * le16toh(bs.secs_track))) & 255;
}
/* LBA of the first sector */
partition[ 8] = 0;
partition[ 9] = 0;
partition[10] = 0;
partition[11] = 0;
/* Number of sectors */
partition[12] = (num_sectors >> 0) & 0xFF;
partition[13] = (num_sectors >> 8) & 0xFF;
partition[14] = (num_sectors >> 16) & 0xFF;
partition[15] = (num_sectors >> 24) & 0xFF;
}
bs.sector_size[0] = (char)(sector_size & 0x00ff);
bs.sector_size[1] = (char)((sector_size & 0xff00) >> 8);
bs.dir_entries[0] = (char)(root_dir_entries & 0x00ff);
bs.dir_entries[1] = (char)((root_dir_entries & 0xff00) >> 8);
if (size_fat == 32) {
/* set up additional FAT32 fields */
bs.fat32.flags = htole16(0);
bs.fat32.version[0] = 0;
bs.fat32.version[1] = 0;
bs.fat32.root_cluster = htole32(2);
if (!info_sector)
info_sector = 1;
bs.fat32.info_sector = htole16(info_sector);
if (!backup_boot_set)
backup_boot = (reserved_sectors >= 7 && info_sector != 6) ? 6 :
(reserved_sectors >= 3 + info_sector &&
info_sector != reserved_sectors - 2 &&
info_sector != reserved_sectors - 1) ? reserved_sectors - 2 :
(reserved_sectors >= 3 && info_sector != reserved_sectors - 1) ?
reserved_sectors - 1 : 0;
if (backup_boot) {
if (backup_boot == info_sector)
die("Backup boot sector must not be same as info sector (%d)", info_sector);
else if (backup_boot >= reserved_sectors)
die("Backup boot sector must be a reserved sector");
}
if (verbose >= 2)
printf("Using sector %d as backup boot sector (0 = none)\n",
backup_boot);
bs.fat32.backup_boot = htole16(backup_boot);
memset(&bs.fat32.reserved2, 0, sizeof(bs.fat32.reserved2));
}
if (atari_format) {
/* Just some consistency checks */
if (num_sectors >= GEMDOS_MAX_SECTORS)
die("GEMDOS can't handle more than 65531 sectors");
else if (num_sectors >= OLDGEMDOS_MAX_SECTORS)
printf("Warning: More than 32765 sector need TOS 1.04 "
"or higher.\n");
}
if (num_sectors >= 65536) {
bs.sectors[0] = (char)0;
bs.sectors[1] = (char)0;
bs.total_sect = htole32(num_sectors);
} else {
bs.sectors[0] = (char)(num_sectors & 0x00ff);
bs.sectors[1] = (char)((num_sectors & 0xff00) >> 8);
if (!atari_format)
bs.total_sect = htole32(0);
}
if (!atari_format)
vi->ext_boot_sign = MSDOS_EXT_SIGN;
if (!cluster_count) {
if (sectors_per_cluster) /* If yes, die if we'd spec'd sectors per cluster */
die("Not enough or too many clusters for filesystem - try less or more sectors per cluster");
else
die("Attempting to create a too small or a too large filesystem");
}
fat_entries = cluster_count + 2;
/* The two following vars are in hard sectors, i.e. 512 byte sectors! */
start_data_sector = (reserved_sectors + nr_fats * fat_length +
cdiv(root_dir_entries * 32, sector_size)) *
(sector_size / HARD_SECTOR_SIZE);
start_data_block = (start_data_sector + SECTORS_PER_BLOCK - 1) /
SECTORS_PER_BLOCK;
if (blocks < start_data_block + 32) /* Arbitrary undersize filesystem! */
die("Too few blocks for viable filesystem");
if (verbose) {
printf("%s has %d head%s and %d sector%s per track,\n",
device_name, le16toh(bs.heads),
(le16toh(bs.heads) != 1) ? "s" : "", le16toh(bs.secs_track),
(le16toh(bs.secs_track) != 1) ? "s" : "");
printf("hidden sectors 0x%04x;\n", hidden_sectors);
printf("logical sector size is %d,\n", sector_size);
printf("using 0x%02x media descriptor, with %u sectors;\n",
(int)(bs.media), (unsigned)num_sectors);
printf("drive number 0x%02x;\n", (int) (vi->drive_number));
printf("filesystem has %d %d-bit FAT%s and %d sector%s per cluster.\n",
(int)(bs.fats), size_fat, (bs.fats != 1) ? "s" : "",
(int)(bs.cluster_size), (bs.cluster_size != 1) ? "s" : "");
printf("FAT size is %d sector%s, and provides %d cluster%s.\n",
fat_length, (fat_length != 1) ? "s" : "",
cluster_count, (cluster_count != 1) ? "s" : "");
printf("There %s %u reserved sector%s.\n",
(reserved_sectors != 1) ? "are" : "is",
reserved_sectors, (reserved_sectors != 1) ? "s" : "");
if (size_fat != 32) {
unsigned root_dir_entries =
bs.dir_entries[0] + ((bs.dir_entries[1]) * 256);
unsigned root_dir_sectors =
cdiv(root_dir_entries * 32, sector_size);
printf("Root directory contains %u slots and uses %u sectors.\n",
root_dir_entries, root_dir_sectors);
}
printf("Volume ID is %08lx, ", volume_id &
(atari_format ? 0x00ffffff : 0xffffffff));
if (memcmp(label, NO_NAME, MSDOS_NAME))
printf("volume label %s.\n", volume_name);
else
printf("no volume label.\n");
}
/* Make the file allocation tables! */
if (malloc_entire_fat)
alloced_fat_length = fat_length;
else
alloced_fat_length = 1;
if ((fat =
(unsigned char *)malloc(alloced_fat_length * sector_size)) == NULL)
die("unable to allocate space for FAT image in memory");
memset(fat, 0, alloced_fat_length * sector_size);
mark_FAT_cluster(0, 0xffffffff); /* Initial fat entries */
mark_FAT_cluster(1, 0xffffffff);
fat[0] = (unsigned char)bs.media; /* Put media type in first byte! */
if (size_fat == 32) {
/* Mark cluster 2 as EOF (used for root dir) */
mark_FAT_cluster(2, FAT_EOF);
}
/* Make the root directory entries */
size_root_dir = (size_fat == 32) ?
bs.cluster_size * sector_size :
(((int)bs.dir_entries[1] * 256 + (int)bs.dir_entries[0]) *
sizeof(struct msdos_dir_entry));
if ((root_dir = (struct msdos_dir_entry *)malloc(size_root_dir)) == NULL) {
free(fat); /* Tidy up before we die! */
die("unable to allocate space for root directory in memory");
}
memset(root_dir, 0, size_root_dir);
if (memcmp(label, NO_NAME, MSDOS_NAME)) {
struct msdos_dir_entry *de = &root_dir[0];
memcpy(de->name, label, MSDOS_NAME);
if (de->name[0] == 0xe5)
de->name[0] = 0x05;
de->attr = ATTR_VOLUME;
if (create_time != (time_t)-1) {
if (!invariant)
ctime = localtime(&create_time);
else
ctime = gmtime(&create_time);
} else {
ctime = NULL;
}
if (ctime && ctime->tm_year >= 80 && ctime->tm_year <= 207) {
de->time = htole16((unsigned short)((ctime->tm_sec >> 1) +
(ctime->tm_min << 5) +
(ctime->tm_hour << 11)));
de->date = htole16((unsigned short)(ctime->tm_mday +
((ctime->tm_mon + 1) << 5) +
((ctime->tm_year - 80) << 9)));
} else {
/* fallback to 1.1.1980 00:00:00 */
de->time = htole16(0);
de->date = htole16(1 + (1 << 5));
}
de->ctime_cs = 0;
de->ctime = de->time;
de->cdate = de->date;
de->adate = de->date;
de->starthi = htole16(0);
de->start = htole16(0);
de->size = htole32(0);
}
if (size_fat == 32) {
/* For FAT32, create an info sector */
struct fat32_fsinfo *info;
if (!(info_sector_buffer = malloc(sector_size)))
die("Out of memory");
memset(info_sector_buffer, 0, sector_size);
/* fsinfo structure is at offset 0x1e0 in info sector by observation */
info = (struct fat32_fsinfo *)(info_sector_buffer + 0x1e0);
/* Info sector magic */
info_sector_buffer[0] = 'R';
info_sector_buffer[1] = 'R';
info_sector_buffer[2] = 'a';
info_sector_buffer[3] = 'A';
/* Magic for fsinfo structure */
info->signature = htole32(0x61417272);
/* We've allocated cluster 2 for the root dir. */
info->free_clusters = htole32(cluster_count - 1);
info->next_cluster = htole32(2);
/* Info sector also must have boot sign */
*(uint16_t *) (info_sector_buffer + 0x1fe) = htole16(BOOT_SIGN);
}
if (!(blank_sector = malloc(sector_size)))
die("Out of memory");
memset(blank_sector, 0, sector_size);
}
/* Write the new filesystem's data tables to wherever they're going to end up! */
#define error(str) \
do { \
free (fat); \
free (info_sector_buffer); \
free (root_dir); \
die (str); \
} while(0)
#define seekto(pos,errstr) \
do { \
off_t __pos = (pos); \
if (lseek (dev, part_sector * sector_size + __pos, SEEK_SET) != part_sector * sector_size + __pos) \
error ("seek to " errstr " failed whilst writing tables"); \
} while(0)
#define writebuf(buf,size,errstr) \
do { \
int __size = (size); \
if (write (dev, buf, __size) != __size) \
error ("failed whilst writing " errstr); \
} while(0)
static void write_tables(void)
{
int x;
int fat_length;
fat_length = (size_fat == 32) ?
le32toh(bs.fat32.fat32_length) : le16toh(bs.fat_length);
seekto(0, "start of device");
/* clear all reserved sectors */
for (x = 0; x < reserved_sectors; ++x)
writebuf(blank_sector, sector_size, "reserved sector");
/* seek back to sector 0 and write the boot sector */
seekto(0, "boot sector");
writebuf((char *)&bs, sizeof(struct msdos_boot_sector), "boot sector");
/* on FAT32, write the info sector and backup boot sector */
if (size_fat == 32) {
seekto(le16toh(bs.fat32.info_sector) * sector_size, "info sector");
writebuf(info_sector_buffer, 512, "info sector");
if (backup_boot != 0) {
seekto(backup_boot * sector_size, "backup boot sector");
writebuf((char *)&bs, sizeof(struct msdos_boot_sector),
"backup boot sector");
if (backup_boot + le16toh(bs.fat32.info_sector) != le16toh(bs.fat32.info_sector) &&
backup_boot + le16toh(bs.fat32.info_sector) < reserved_sectors) {
seekto((backup_boot + le16toh(bs.fat32.info_sector)) * sector_size, "backup info sector");
writebuf(info_sector_buffer, 512, "backup info sector");
}
}
}
/* seek to start of FATS and write them all */
seekto(reserved_sectors * sector_size, "first FAT");
for (x = 1; x <= nr_fats; x++) {
int y;
int blank_fat_length = fat_length - alloced_fat_length;
writebuf(fat, alloced_fat_length * sector_size, "FAT");
for (y = 0; y < blank_fat_length; y++)
writebuf(blank_sector, sector_size, "FAT");
}
/* Write the root directory directly after the last FAT. This is the root
* dir area on FAT12/16, and the first cluster on FAT32. */
writebuf((char *)root_dir, size_root_dir, "root directory");
if (blank_sector)
free(blank_sector);
free(info_sector_buffer);
free(root_dir); /* Free up the root directory space from setup_tables */
free(fat); /* Free up the fat table space reserved during setup_tables */
}
/* Report the command usage and exit with the given error code */
static void usage(const char *name, int exitval)
{
fprintf(stderr, "Usage: %s [OPTIONS] TARGET [BLOCKS]\n", name);
fprintf(stderr, "Create FAT filesystem in TARGET, which can be a block device or file. Use only\n");
fprintf(stderr, "up to BLOCKS 1024 byte blocks if specified. With the -C option, file TARGET will be\n");
fprintf(stderr, "created with a size of 1024 bytes times BLOCKS, which must be specified.\n");
fprintf(stderr, "\n");
fprintf(stderr, "Options:\n");
fprintf(stderr, " -a Disable alignment of data structures\n");
fprintf(stderr, " -A Toggle Atari variant of the filesystem\n");
fprintf(stderr, " -b SECTOR Select SECTOR as location of the FAT32 backup boot sector\n");
fprintf(stderr, " -c Check device for bad blocks before creating the filesystem\n");
fprintf(stderr, " -C Create file TARGET then create filesystem in it\n");
fprintf(stderr, " -D NUMBER Write BIOS drive number NUMBER to boot sector\n");
fprintf(stderr, " -f COUNT Create COUNT file allocation tables\n");
fprintf(stderr, " -F SIZE Select FAT size SIZE (12, 16 or 32)\n");
fprintf(stderr, " -g GEOM Select disk geometry: heads/sectors_per_track\n");
fprintf(stderr, " -h NUMBER Write hidden sectors NUMBER to boot sector\n");
fprintf(stderr, " -i VOLID Set volume ID to VOLID (a 32 bit hexadecimal number)\n");
fprintf(stderr, " -I Ignore and disable safety checks\n");
fprintf(stderr, " -l FILENAME Read bad blocks list from FILENAME\n");
fprintf(stderr, " -m FILENAME Replace default error message in boot block with contents of FILENAME\n");
fprintf(stderr, " -M TYPE Set media type in boot sector to TYPE\n");
fprintf(stderr, " --mbr[=y|n|a] Fill (fake) MBR table with one partition which spans whole disk\n");
fprintf(stderr, " -n LABEL Set volume name to LABEL (up to 11 characters long)\n");
fprintf(stderr, " --codepage=N use DOS codepage N to encode label (default: %d)\n", DEFAULT_DOS_CODEPAGE);
fprintf(stderr, " -r COUNT Make room for at least COUNT entries in the root directory\n");
fprintf(stderr, " -R COUNT Set minimal number of reserved sectors to COUNT\n");
fprintf(stderr, " -s COUNT Set number of sectors per cluster to COUNT\n");
fprintf(stderr, " -S SIZE Select a sector size of SIZE (a power of two, at least 512)\n");
fprintf(stderr, " -v Verbose execution\n");
fprintf(stderr, " --variant=TYPE Select variant TYPE of filesystem (standard or Atari)\n");
fprintf(stderr, "\n");
fprintf(stderr, " --invariant Use constants for randomly generated or time based values\n");
fprintf(stderr, " --offset=SECTOR Write the filesystem at a specific sector into the device file.\n");
fprintf(stderr, " --help Show this help message and exit\n");
exit(exitval);
}
/* The "main" entry point into the utility - we pick up the options and attempt to process them in some sort of sensible
way. In the event that some/all of the options are invalid we need to tell the user so that something can be done! */
int main(int argc, char **argv)
{
int c;
char *tmp;
char *listfile = NULL;
FILE *msgfile;
struct device_info devinfo;
int i = 0, pos, ch;
int create = 0;
unsigned long long cblocks = 0;
int blocks_specified = 0;
struct timeval create_timeval;
long long conversion;
enum {OPT_HELP=1000, OPT_INVARIANT, OPT_MBR, OPT_VARIANT, OPT_CODEPAGE, OPT_OFFSET};
const struct option long_options[] = {
{"codepage", required_argument, NULL, OPT_CODEPAGE},
{"invariant", no_argument, NULL, OPT_INVARIANT},
{"mbr", optional_argument, NULL, OPT_MBR},
{"variant", required_argument, NULL, OPT_VARIANT},
{"offset", required_argument, NULL, OPT_OFFSET},
{"help", no_argument, NULL, OPT_HELP},
{0,}
};
program_name = "mkfs.fat";
if (argc && *argv) { /* What's the program name? */
char *p;
program_name = *argv;
if ((p = strrchr(program_name, '/')))
program_name = p + 1;
}
if (gettimeofday(&create_timeval, NULL) == 0 && create_timeval.tv_sec != (time_t)-1)
create_time = create_timeval.tv_sec;
volume_id = generate_volume_id();
check_atari();
printf("mkfs.fat " VERSION " (" VERSION_DATE ")\n");
while ((c = getopt_long(argc, argv, "aAb:cCf:D:F:g:Ii:l:m:M:n:r:R:s:S:h:v",
long_options, NULL)) != -1)
/* Scan the command line for options */
switch (c) {
case 'A': /* toggle Atari format */
atari_format = !atari_format;
break;
case 'a': /* a : skip alignment */
align_structures = FALSE;
break;
case 'b': /* b : location of backup boot sector */
errno = 0;
conversion = strtol(optarg, &tmp, 0);
if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 0 || conversion > 0xffff) {
printf("Bad location for backup boot sector : %s\n", optarg);
usage(argv[0], 1);
}
backup_boot = conversion;
backup_boot_set = 1;
break;
case 'c': /* c : Check FS as we build it */
check = TRUE;
malloc_entire_fat = TRUE; /* Need to be able to mark clusters bad */
break;
case 'C': /* C : Create a new file */
create = TRUE;
break;
case 'D': /* D : Choose Drive Number */
errno = 0;
conversion = strtol(optarg, &tmp, 0);
if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 0x00 || conversion > 0xFF) {
printf ("Bad drive number: %s\n", optarg);
usage(argv[0], 1);
}
drive_number_option = conversion;
drive_number_by_user=1;
break;
case 'f': /* f : Choose number of FATs */
errno = 0;
conversion = strtol(optarg, &tmp, 0);
if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 1 || conversion > 4) {
printf("Bad number of FATs : %s\n", optarg);
usage(argv[0], 1);
}
nr_fats = conversion;
break;
case 'F': /* F : Choose FAT size */
errno = 0;
conversion = strtol(optarg, &tmp, 0);
if (!*optarg || isspace(*optarg) || *tmp || errno || (conversion != 12 && conversion != 16 && conversion != 32)) {
printf("Bad FAT type : %s\n", optarg);
usage(argv[0], 1);
}
size_fat = conversion;
size_fat_by_user = 1;
break;
case 'g': /* g : geometry: heads and sectors per track */
errno = 0;
conversion = strtol(optarg, &tmp, 0);
if (!*optarg || isspace(*optarg) || tmp[0] != '/' || !tmp[1] || isspace(tmp[1]) || errno || conversion <= 0 || conversion > UINT16_MAX) {
printf("Bad format of geometry : %s\n", optarg);
usage(argv[0], 1);
}
bs.heads = htole16(conversion);
conversion = strtol(tmp+1, &tmp, 0);
if (*tmp || errno || conversion <= 0 || conversion > UINT16_MAX) {
printf("Bad format of geometry : %s\n", optarg);
usage(argv[0], 1);
}
bs.secs_track = htole16(conversion);
break;
case 'h': /* h : number of hidden sectors */
errno = 0;
conversion = strtoll(optarg, &tmp, 0);
if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 0 || conversion > UINT32_MAX) {
printf("Bad number of hidden sectors : %s\n", optarg);
usage(argv[0], 1);
}
hidden_sectors = conversion;
hidden_sectors_by_user = 1;
break;
case 'I':
ignore_safety_checks = 1;
break;
case 'i': /* i : specify volume ID */
errno = 0;
conversion = strtoll(optarg, &tmp, 16);
if (!*optarg || isspace(*optarg) || *tmp || conversion < 0) {
printf("Volume ID must be a hexadecimal number\n");
usage(argv[0], 1);
}
if (conversion > UINT32_MAX) {
printf("Volume ID does not fit in 32 bit\n");
usage(argv[0], 1);
}
if (errno) {
printf("Parsing volume ID failed (%s)\n", strerror(errno));
usage(argv[0], 1);
}
volume_id = conversion;
break;
case 'l': /* l : Bad block filename */
listfile = optarg;
malloc_entire_fat = TRUE; /* Need to be able to mark clusters bad */
break;
case 'm': /* m : Set boot message */
if (strcmp(optarg, "-")) {
msgfile = fopen(optarg, "r");
if (!msgfile)
perror(optarg);
} else
msgfile = stdin;
if (msgfile) {
/* The boot code ends at offset 448 and needs a null terminator */
i = MESSAGE_OFFSET;
pos = 0; /* We are at beginning of line */
do {
ch = getc(msgfile);
switch (ch) {
case '\r': /* Ignore CRs */
case '\0': /* and nulls */
break;
case '\n': /* LF -> CR+LF if necessary */
if (pos) { /* If not at beginning of line */
dummy_boot_code[i++] = '\r';
pos = 0;
}
dummy_boot_code[i++] = '\n';
break;
case '\t': /* Expand tabs */
do {
dummy_boot_code[i++] = ' ';
pos++;
}
while (pos % 8 && i < BOOTCODE_SIZE - 1);
break;
case EOF:
dummy_boot_code[i++] = '\0'; /* Null terminator */
break;
default:
dummy_boot_code[i++] = ch; /* Store character */
pos++; /* Advance position */
break;
}
}
while (ch != EOF && i < BOOTCODE_SIZE - 1);
/* Fill up with zeros */
while (i < BOOTCODE_SIZE - 1)
dummy_boot_code[i++] = '\0';
dummy_boot_code[BOOTCODE_SIZE - 1] = '\0'; /* Just in case */
if (ch != EOF)
printf("Warning: message too long; truncated\n");
if (msgfile != stdin)
fclose(msgfile);
}
break;
case 'M': /* M : FAT Media byte */
errno = 0;
conversion = strtol(optarg, &tmp, 0);
if (!*optarg || isspace(*optarg) || *tmp || errno) {
printf("Bad number for media descriptor : %s\n", optarg);
usage(argv[0], 1);
}
if (conversion != 0xf0 && (conversion < 0xf8 || conversion > 0xff)) {
printf("FAT Media byte must either be between 0xF8 and 0xFF or be 0xF0 : %s\n", optarg);
usage(argv[0], 1);
}
fat_media_byte = conversion;
break;
case 'n': /* n : Volume name */
volume_name = optarg;
break;
case OPT_CODEPAGE: /* --codepage : Code page */
errno = 0;
conversion = strtol(optarg, &tmp, 10);
if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 0 || conversion > INT_MAX) {
fprintf(stderr, "Invalid codepage : %s\n", optarg);
usage(argv[0], 1);
}
if (!set_dos_codepage(conversion))
usage(argv[0], 1);
break;
case 'r': /* r : Root directory entries */
errno = 0;
conversion = strtol(optarg, &tmp, 0);
if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 16 || conversion > 32768) {
printf("Bad number of root directory entries : %s\n", optarg);
usage(argv[0], 1);
}
root_dir_entries = conversion;
root_dir_entries_set = 1;
break;
case 'R': /* R : number of reserved sectors */
errno = 0;
conversion = strtol(optarg, &tmp, 0);
if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 1 || conversion > 0xffff) {
printf("Bad number of reserved sectors : %s\n", optarg);
usage(argv[0], 1);
}
reserved_sectors = conversion;
break;
case 's': /* s : Sectors per cluster */
errno = 0;
conversion = strtol(optarg, &tmp, 0);
if (!*optarg || isspace(*optarg) || *tmp || errno || (conversion != 1 && conversion != 2
&& conversion != 4 && conversion != 8 && conversion != 16
&& conversion != 32 && conversion != 64 && conversion != 128)) {
printf("Bad number of sectors per cluster : %s\n", optarg);
usage(argv[0], 1);
}
sectors_per_cluster = conversion;
break;
case 'S': /* S : Sector size */
errno = 0;
conversion = strtol(optarg, &tmp, 0);
if (!*optarg || isspace(*optarg) || *tmp || errno || (conversion != 512 && conversion != 1024 &&
conversion != 2048 && conversion != 4096 && conversion != 8192 &&
conversion != 16384 && conversion != 32768)) {
printf("Bad logical sector size : %s\n", optarg);
usage(argv[0], 1);
}
sector_size = conversion;
sector_size_set = 1;
break;
case 'v': /* v : Verbose execution */
++verbose;
break;
case OPT_HELP:
usage(argv[0], 0);
break;
case OPT_INVARIANT:
invariant = 1;
volume_id = 0x1234abcd;
create_time = 1426325213;
break;
case OPT_MBR:
if (!optarg || !strcasecmp(optarg, "y") || !strcasecmp(optarg, "yes"))
fill_mbr_partition = 1;
else if (!strcasecmp(optarg, "n") || !strcasecmp(optarg, "no"))
fill_mbr_partition = 0;
else if (!strcasecmp(optarg, "a") || !strcasecmp(optarg, "auto"))
fill_mbr_partition = -1;
else {
printf("Unknown option for --mbr: '%s'\n", optarg);
usage(argv[0], 1);
}
break;
case OPT_VARIANT:
if (!strcasecmp(optarg, "standard")) {
atari_format = 0;
} else if (!strcasecmp(optarg, "atari")) {
atari_format = 1;
} else {
printf("Unknown variant: %s\n", optarg);
usage(argv[0], 1);
}
break;
case OPT_OFFSET:
errno = 0;
conversion = strtoll(optarg, &tmp, 0);
if (!*optarg || isspace(*optarg) || *tmp || errno) {
printf("Bad number for offset : %s\n", optarg);
usage(argv[0], 1);
}
if (conversion < 0 || conversion > OFF_MAX) {
printf("FAT offset must be between 0 and %lld: %s\n", (long long) OFF_MAX, optarg);
usage(argv[0], 1);
}
part_sector = (off_t) conversion;
break;
case '?':
usage(argv[0], 1);
exit(1);
default:
fprintf(stderr,
"Internal error: getopt_long() returned unexpected value %d\n", c);
exit(2);
}
if (!set_dos_codepage(-1)) /* set default codepage if none was given in command line */
exit(1);
if (optind == argc || !argv[optind]) {
printf("No device specified.\n");
usage(argv[0], 1);
}
device_name = argv[optind++];
if (optind != argc) {
blocks_specified = 1;
errno = 0;
conversion = strtoll(argv[optind], &tmp, 0);
if (!*argv[optind] || isspace(*argv[optind]) || *tmp || errno || conversion < 0) {
printf("Bad block count : %s\n", argv[optind]);
usage(argv[0], 1);
}
blocks = conversion;
optind++;
}
if (optind != argc) {
fprintf(stderr, "Excess arguments on command line\n");
usage(argv[0], 1);
}
if (create && !blocks_specified)
die("Need intended size with -C.");
if (check && listfile) /* Auto and specified bad block handling are mutually */
die("-c and -l are incompatible"); /* exclusive of each other! */
if (!create) {
check_mount(device_name); /* Is the device already mounted? */
dev = open(device_name, O_EXCL | O_RDWR); /* Is it a suitable device to build the FS on? */
if (dev < 0) {
fprintf(stderr, "%s: unable to open %s: %s\n", program_name,
device_name, strerror(errno));
exit(1); /* The error exit code is 1! */
}
} else {
/* create the file */
dev = open(device_name, O_EXCL | O_RDWR | O_CREAT, 0666);
if (dev < 0) {
if (errno == EEXIST)
die("file %s already exists", device_name);
else
die("unable to create %s", device_name);
}
/* expand to desired size */
if (ftruncate(dev, part_sector * sector_size + blocks * BLOCK_SIZE)) /* TODO: check overflow */
die("unable to resize %s", device_name);
}
if (get_device_info(dev, &devinfo) < 0)
die("error collecting information about %s", device_name);
if (devinfo.size <= 0)
die("unable to discover size of %s", device_name);
if (devinfo.sector_size > 0) {
if (sector_size_set) {
if (sector_size < devinfo.sector_size) {
sector_size = devinfo.sector_size;
fprintf(stderr,
"Warning: sector size was set to %d (minimal for this device)\n",
sector_size);
}
} else {
sector_size = devinfo.sector_size;
sector_size_set = 1;
}
if (devinfo.size <= part_sector * sector_size)
die("The device %s size %llu is less then the offset %llu",
device_name, devinfo.size, (unsigned long long) part_sector * sector_size);
}
if (sector_size > 4096)
fprintf(stderr,
"Warning: sector size %d > 4096 is non-standard, filesystem may not be usable\n",
sector_size);
cblocks = (devinfo.size - part_sector * sector_size) / BLOCK_SIZE;
orphaned_sectors = ((devinfo.size - part_sector * sector_size) % BLOCK_SIZE) / sector_size;
if (blocks_specified) {
if (blocks != cblocks) {
fprintf(stderr, "Warning: block count mismatch: ");
fprintf(stderr, "found %llu but assuming %llu.\n",
cblocks, blocks);
}
} else {
blocks = cblocks;
}
/*
* Ignore any 'full' fixed disk devices, if -I is not given.
*/
if (!ignore_safety_checks && devinfo.has_children > 0)
die("Partitions or virtual mappings on device '%s', not making filesystem (use -I to override)",
device_name);
/*
* On non-removable fixed disk devices we need to create (fake) MBR partition
* table so disk would be correctly recognized on MS Windows systems.
*/
if (fill_mbr_partition == -1) {
if (devinfo.type == TYPE_FIXED && devinfo.partition == 0)
fill_mbr_partition = 1;
else
fill_mbr_partition = 0;
}
establish_params(&devinfo);
/* Establish the media parameters */
setup_tables(); /* Establish the filesystem tables */
if (check) /* Determine any bad block locations and mark them */
check_blocks();
else if (listfile)
get_list_blocks(listfile);
write_tables(); /* Write the filesystem tables away! */
/* Let's make sure to sync the block device. Otherwise, if we operate on a loop device and people issue
* "losetup -d" right after this command finishes our in-flight writes might never hit the disk */
if (fsync(dev) < 0)
pdie("unable to synchronize %s", device_name);
exit(0); /* Terminate with no errors! */
}
dosfstools-4.2/src/lfn.h 0000644 0001750 0001750 00000002530 14005523510 012211 0000000 0000000 /* lfn.h - Functions for handling VFAT long filenames
Copyright (C) 1998 Roman Hodek
Copyright (C) 2008-2014 Daniel Baumann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
#ifndef _LFN_H
#define _LFN_H
void lfn_reset(void);
/* Reset the state of the LFN parser. */
void lfn_add_slot(DIR_ENT * de, off_t dir_offset);
/* Process a dir slot that is a VFAT LFN entry. */
char *lfn_get(DIR_ENT * de, off_t * lfn_offset);
/* Retrieve the long name for the proper dir entry. */
void lfn_check_orphaned(void);
void lfn_fix_checksum(off_t from, off_t to, const char *short_name);
#endif
dosfstools-4.2/src/lfn.c 0000644 0001750 0001750 00000036223 14005523510 012212 0000000 0000000 /* lfn.c - Functions for handling VFAT long filenames
Copyright (C) 1998 Roman Hodek
Copyright (C) 2008-2014 Daniel Baumann
Copyright (C) 2015 Andreas Bombe
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
#include
#include
#include
#include
#include
#include
#include "common.h"
#include "io.h"
#include "fsck.fat.h"
#include "lfn.h"
#include "file.h"
typedef struct {
uint8_t id; /* sequence number for slot */
uint8_t name0_4[10]; /* first 5 characters in name */
uint8_t attr; /* attribute byte */
uint8_t reserved; /* always 0 */
uint8_t alias_checksum; /* checksum for 8.3 alias */
uint8_t name5_10[12]; /* 6 more characters in name */
uint16_t start; /* starting cluster number, 0 in long slots */
uint8_t name11_12[4]; /* last 2 characters in name */
} LFN_ENT;
#define LFN_ID_START 0x40
#define LFN_ID_SLOTMASK 0x1f
#define CHARS_PER_LFN 13
/* These modul-global vars represent the state of the LFN parser */
unsigned char *lfn_unicode = NULL;
unsigned char lfn_checksum;
int lfn_slot = -1;
off_t *lfn_offsets = NULL;
int lfn_parts = 0;
static unsigned char fat_uni2esc[64] = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd',
'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z', '+', '-'
};
/* This defines which unicode chars are directly convertable to ISO-8859-1 */
#define UNICODE_CONVERTABLE(cl,ch) (ch == 0 && (cl < 0x80 || cl >= 0xa0))
/* for maxlen param */
#define UNTIL_0 INT_MAX
/* Convert name parts collected so far (from previous slots) from unicode to
* ASCII */
#define CNV_PARTS_SO_FAR() \
(cnv_unicode( lfn_unicode+(lfn_slot*CHARS_PER_LFN*2), \
lfn_parts*CHARS_PER_LFN, 0 ))
#define BYTES_TO_WCHAR(cl,ch) ((wchar_t)((unsigned)(cl) + ((unsigned)(ch) << 8)))
static size_t mbslen(wchar_t x)
{
wchar_t wstr[] = { x, 0 };
return wcstombs(NULL, wstr, 0);
}
static size_t wctombs(char *dest, wchar_t x)
{
wchar_t wstr[] = { x, 0 };
size_t size = wcstombs(NULL, wstr, 0);
if (size != (size_t) - 1)
size = wcstombs(dest, wstr, size + 1);
return size;
}
/* This function converts an unicode string to a normal ASCII string, assuming
* ISO-8859-1 charset. Characters not in 8859-1 are converted to the same
* escape notation as used by the kernel, i.e. the uuencode-like ":xxx" */
static char *cnv_unicode(const unsigned char *uni, int maxlen, int use_q)
{
const unsigned char *up;
unsigned char *out, *cp;
int len, val;
size_t x;
for (len = 0, up = uni; (up - uni) / 2 < maxlen && (up[0] || up[1]);
up += 2) {
if ((x = mbslen(BYTES_TO_WCHAR(up[0], up[1]))) != (size_t) - 1)
len += x;
else if (UNICODE_CONVERTABLE(up[0], up[1]))
++len;
else
len += 4;
}
cp = out = use_q ? qalloc(&mem_queue, len + 1) : alloc(len + 1);
for (up = uni; (up - uni) / 2 < maxlen && (up[0] || up[1]); up += 2) {
if ((x =
wctombs((char *)cp, BYTES_TO_WCHAR(up[0], up[1]))) != (size_t) - 1)
cp += x;
else if (UNICODE_CONVERTABLE(up[0], up[1]))
*cp++ = up[0];
else {
/* here the same escape notation is used as in the Linux kernel */
*cp++ = ':';
val = (up[1] << 8) + up[0];
cp[2] = fat_uni2esc[val & 0x3f];
val >>= 6;
cp[1] = fat_uni2esc[val & 0x3f];
val >>= 6;
cp[0] = fat_uni2esc[val & 0x3f];
cp += 3;
}
}
*cp = 0;
return (char *)out;
}
static void copy_lfn_part(unsigned char *dst, LFN_ENT * lfn)
{
memcpy(dst, lfn->name0_4, 10);
memcpy(dst + 10, lfn->name5_10, 12);
memcpy(dst + 22, lfn->name11_12, 4);
}
/* Convert name part in 'lfn' from unicode to ASCII */
static inline char *cnv_this_part(LFN_ENT *lfn)
{
unsigned char part_uni[CHARS_PER_LFN * 2];
copy_lfn_part(part_uni, lfn);
return cnv_unicode(part_uni, CHARS_PER_LFN, 0);
}
static void clear_lfn_slots(int start, int end)
{
int i;
LFN_ENT empty;
/* New dir entry is zeroed except first byte, which is set to 0xe5.
* This is to avoid that some FAT-reading OSes (not Linux! ;) stop reading
* a directory at the first zero entry...
*/
memset(&empty, 0, sizeof(empty));
empty.id = DELETED_FLAG;
for (i = start; i <= end; ++i) {
fs_write(lfn_offsets[i], sizeof(LFN_ENT), &empty);
}
}
void lfn_fix_checksum(off_t from, off_t to, const char *short_name)
{
int i;
uint8_t sum;
for (sum = 0, i = 0; i < 11; i++)
sum = (((sum & 1) << 7) | ((sum & 0xfe) >> 1)) + short_name[i];
for (; from < to; from += sizeof(LFN_ENT)) {
fs_write(from + offsetof(LFN_ENT, alias_checksum), sizeof(sum), &sum);
}
}
void lfn_reset(void)
{
if (lfn_unicode)
free(lfn_unicode);
lfn_unicode = NULL;
if (lfn_offsets)
free(lfn_offsets);
lfn_offsets = NULL;
lfn_slot = -1;
}
/* This function is only called with de->attr == VFAT_LN_ATTR. It stores part
* of the long name. */
void lfn_add_slot(DIR_ENT * de, off_t dir_offset)
{
LFN_ENT *lfn = (LFN_ENT *) de;
int slot = lfn->id & LFN_ID_SLOTMASK;
unsigned offset;
if (lfn_slot == 0)
lfn_check_orphaned();
if (de->attr != VFAT_LN_ATTR)
die("lfn_add_slot called with non-LFN directory entry");
if (lfn->id & LFN_ID_START && slot != 0) {
if (lfn_slot != -1) {
int can_clear = 0;
/* There is already a LFN "in progess", so it is an error that a
* new start entry is here. */
/* Causes: 1) if slot# == expected: start bit set mysteriously, 2)
* old LFN overwritten by new one */
/* Fixes: 1) delete previous LFN 2) if slot# == expected and
* checksum ok: clear start bit */
/* XXX: Should delay that until next LFN known (then can better
* display the name) */
printf("A new long file name starts within an old one.\n");
if (slot == lfn_slot && lfn->alias_checksum == lfn_checksum) {
char *part1 = cnv_this_part(lfn);
char *part2 = CNV_PARTS_SO_FAR();
printf(" It could be that the LFN start bit is wrong here\n"
" if \"%s\" seems to match \"%s\".\n", part1, part2);
free(part1);
free(part2);
can_clear = 1;
}
switch (get_choice(2, " Not auto-correcting this.",
can_clear ? 3 : 2,
1, "Delete previous LFN",
2, "Leave it as it is",
3, "Clear start bit and concatenate LFNs")) {
case 1:
clear_lfn_slots(0, lfn_parts - 1);
lfn_reset();
break;
case 2:
break;
case 3:
lfn->id &= ~LFN_ID_START;
fs_write(dir_offset + offsetof(LFN_ENT, id),
sizeof(lfn->id), &lfn->id);
break;
}
}
lfn_slot = slot;
lfn_checksum = lfn->alias_checksum;
lfn_unicode = alloc((lfn_slot * CHARS_PER_LFN + 1) * 2);
lfn_offsets = alloc(lfn_slot * sizeof(off_t));
lfn_parts = 0;
} else if (lfn_slot == -1 && slot != 0) {
/* No LFN in progress, but slot found; start bit missing */
/* Causes: 1) start bit got lost, 2) Previous slot with start bit got
* lost */
/* Fixes: 1) delete LFN, 2) set start bit */
char *part = cnv_this_part(lfn);
printf("Long filename fragment \"%s\" found outside a LFN "
"sequence.\n (Maybe the start bit is missing on the "
"last fragment)\n", part);
free(part);
switch (get_choice(2, " Not auto-correcting this.",
3,
1, "Delete fragment",
2, "Leave it as it is",
3, "Set start bit")) {
case 1:
if (!lfn_offsets)
lfn_offsets = alloc(sizeof(off_t));
lfn_offsets[0] = dir_offset;
clear_lfn_slots(0, 0);
lfn_reset();
return;
case 2:
lfn_reset();
return;
case 3:
lfn->id |= LFN_ID_START;
fs_write(dir_offset + offsetof(LFN_ENT, id),
sizeof(lfn->id), &lfn->id);
lfn_slot = slot;
lfn_checksum = lfn->alias_checksum;
lfn_unicode = alloc((lfn_slot * CHARS_PER_LFN + 1) * 2);
lfn_offsets = alloc(lfn_slot * sizeof(off_t));
lfn_parts = 0;
break;
}
} else if (slot != lfn_slot) {
/* wrong sequence number */
/* Causes: 1) seq-no destroyed */
/* Fixes: 1) delete LFN, 2) fix number (maybe only if following parts
* are ok?, maybe only if checksum is ok?) (Attention: space
* for name was allocated before!) */
int can_fix = 0;
printf("Unexpected long filename sequence number "
"(%d vs. expected %d).\n", slot, lfn_slot);
if (lfn->alias_checksum == lfn_checksum && lfn_slot > 0) {
char *part1 = cnv_this_part(lfn);
char *part2 = CNV_PARTS_SO_FAR();
printf(" It could be that just the number is wrong\n"
" if \"%s\" seems to match \"%s\".\n", part1, part2);
free(part1);
free(part2);
can_fix = 1;
}
switch (get_choice(2, " Not auto-correcting this.",
can_fix ? 3 : 2,
1, "Delete LFN",
2, "Leave it as it is (and ignore LFN so far)",
3, "Correct sequence number")) {
case 1:
if (!lfn_offsets) {
lfn_offsets = alloc(sizeof(off_t));
lfn_parts = 0;
}
lfn_offsets[lfn_parts++] = dir_offset;
clear_lfn_slots(0, lfn_parts - 1);
lfn_reset();
return;
case 2:
lfn_reset();
return;
case 3:
lfn->id = (lfn->id & ~LFN_ID_SLOTMASK) | lfn_slot;
fs_write(dir_offset + offsetof(LFN_ENT, id),
sizeof(lfn->id), &lfn->id);
break;
}
}
if (lfn->alias_checksum != lfn_checksum) {
/* checksum mismatch */
/* Causes: 1) checksum field here destroyed */
/* Fixes: 1) delete LFN, 2) fix checksum */
printf("Checksum in long filename part wrong "
"(%02x vs. expected %02x).\n",
lfn->alias_checksum, lfn_checksum);
switch (get_choice(2, " Not auto-correcting this.",
3,
1, "Delete LFN",
2, "Leave it as it is",
3, "Correct checksum")) {
case 1:
lfn_offsets[lfn_parts++] = dir_offset;
clear_lfn_slots(0, lfn_parts - 1);
lfn_reset();
return;
case 2:
break;
case 3:
lfn->alias_checksum = lfn_checksum;
fs_write(dir_offset + offsetof(LFN_ENT, alias_checksum),
sizeof(lfn->alias_checksum), &lfn->alias_checksum);
break;
}
}
if (lfn_slot != -1) {
lfn_slot--;
offset = lfn_slot * CHARS_PER_LFN * 2;
copy_lfn_part(lfn_unicode + offset, lfn);
if (lfn->id & LFN_ID_START)
lfn_unicode[offset + 26] = lfn_unicode[offset + 27] = 0;
lfn_offsets[lfn_parts++] = dir_offset;
}
if (lfn->reserved != 0) {
printf("Reserved field in VFAT long filename slot is not 0 "
"(but 0x%02x).\n", lfn->reserved);
if (get_choice(1, "Auto-setting to 0.",
2,
1, "Fix",
2, "Leave it") == 1) {
lfn->reserved = 0;
fs_write(dir_offset + offsetof(LFN_ENT, reserved),
sizeof(lfn->reserved), &lfn->reserved);
}
}
if (lfn->start != htole16(0)) {
printf("Start cluster field in VFAT long filename slot is not 0 "
"(but 0x%04x).\n", lfn->start);
if (get_choice(1, "Auto-setting to 0.",
2,
1, "Fix",
2, "Leave it") == 1) {
lfn->start = htole16(0);
fs_write(dir_offset + offsetof(LFN_ENT, start),
sizeof(lfn->start), &lfn->start);
}
}
}
/* This function is always called when de->attr != VFAT_LN_ATTR is found, to
* retrieve the previously constructed LFN. */
char *lfn_get(DIR_ENT * de, off_t * lfn_offset)
{
char *lfn;
uint8_t sum;
int i;
*lfn_offset = 0;
if (de->attr == VFAT_LN_ATTR)
die("lfn_get called with LFN directory entry");
#if 0
if (de->lcase)
printf("lcase=%02x\n", de->lcase);
#endif
if (lfn_slot == -1)
/* no long name for this file */
return NULL;
if (lfn_slot != 0) {
/* The long name isn't finished yet. */
/* Causes: 1) LFN slot overwritten by non-VFAT aware tool */
/* Fixes: 1) delete LFN 2) move overwriting entry to somewhere else
* and let user enter missing part of LFN (hard to do :-()
* 3) renumber entries and truncate name */
char *long_name = CNV_PARTS_SO_FAR();
char *short_name = file_name(de->name);
char *fix_num_string;
int choice;
printf("Unfinished long file name \"%s\".\n"
" (Start may have been overwritten by %s)\n",
long_name, short_name);
free(long_name);
xasprintf(&fix_num_string,
"Fix numbering (truncates long name and attaches "
"it to short name %s)", short_name);
choice = get_choice(2, " Not auto-correcting this.",
3,
1, "Delete LFN",
2, "Leave it as it is",
3, fix_num_string);
free(fix_num_string);
switch (choice) {
case 1:
clear_lfn_slots(0, lfn_parts - 1);
lfn_reset();
return NULL;
case 2:
lfn_reset();
return NULL;
case 3:
for (i = 0; i < lfn_parts; ++i) {
uint8_t id = (lfn_parts - i) | (i == 0 ? LFN_ID_START : 0);
fs_write(lfn_offsets[i] + offsetof(LFN_ENT, id),
sizeof(id), &id);
}
memmove(lfn_unicode, lfn_unicode + lfn_slot * CHARS_PER_LFN * 2,
lfn_parts * CHARS_PER_LFN * 2);
break;
}
}
for (sum = 0, i = 0; i < MSDOS_NAME; i++)
sum = (((sum & 1) << 7) | ((sum & 0xfe) >> 1)) + de->name[i];
if (sum != lfn_checksum) {
/* checksum doesn't match, long name doesn't apply to this alias */
/* Causes: 1) alias renamed */
/* Fixes: 1) Fix checksum in LFN entries */
char *long_name = CNV_PARTS_SO_FAR();
char *short_name = file_name(de->name);
char *fix_check_string;
int choice;
printf("Wrong checksum for long file name \"%s\".\n"
" (Short name %s may have changed without updating the long name)\n",
long_name, short_name);
free(long_name);
xasprintf(&fix_check_string,
"Fix checksum (attaches to short name %s)", short_name);
choice = get_choice(9, " Not auto-correcting this.",
3,
1, "Delete LFN",
2, "Leave it as it is",
3, fix_check_string);
free(fix_check_string);
switch (choice) {
case 1:
clear_lfn_slots(0, lfn_parts - 1);
lfn_reset();
return NULL;
case 2:
lfn_reset();
return NULL;
case 3:
for (i = 0; i < lfn_parts; ++i) {
fs_write(lfn_offsets[i] + offsetof(LFN_ENT, alias_checksum),
sizeof(sum), &sum);
}
break;
}
}
*lfn_offset = lfn_offsets[0];
lfn = cnv_unicode(lfn_unicode, UNTIL_0, 1);
lfn_reset();
return (lfn);
}
void lfn_check_orphaned(void)
{
char *long_name;
if (lfn_slot == -1)
return;
long_name = CNV_PARTS_SO_FAR();
printf("Orphaned long file name part \"%s\"\n", long_name);
free(long_name);
if (get_choice(1, " Auto-deleting.",
2,
1, "Delete",
2, "Leave it") == 1) {
clear_lfn_slots(0, lfn_parts - 1);
}
lfn_reset();
}
dosfstools-4.2/src/fsck.fat.c 0000644 0001750 0001750 00000020335 14005523510 013127 0000000 0000000 /* fsck.fat.c - User interface
Copyright (C) 1993 Werner Almesberger
Copyright (C) 1998 Roman Hodek
Copyright (C) 2008-2014 Daniel Baumann
Copyright (C) 2018-2021 Pali Rohár
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
/* FAT32, VFAT, Atari format support, and various fixes additions May 1998
* by Roman Hodek */
#include "version.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "common.h"
#include "fsck.fat.h"
#include "io.h"
#include "boot.h"
#include "fat.h"
#include "file.h"
#include "check.h"
#include "charconv.h"
int rw = 0, list = 0, test = 0, verbose = 0;
long fat_table = 0;
int no_spaces_in_sfns = 0;
int only_uppercase_label = 0;
int boot_only = 0;
unsigned n_files = 0;
void *mem_queue = NULL;
static struct termios original_termios;
static void restore_termios(void)
{
tcsetattr(0, TCSAFLUSH, &original_termios);
}
static void usage(char *name, int exitval)
{
fprintf(stderr, "Usage: %s [OPTIONS] DEVICE\n", name);
fprintf(stderr, "Check FAT filesystem on DEVICE for errors.\n");
fprintf(stderr, "\n");
fprintf(stderr, "Options:\n");
fprintf(stderr, " -a automatically repair the filesystem\n");
fprintf(stderr, " -A toggle Atari variant of the FAT filesystem\n");
fprintf(stderr, " -b make read-only boot sector check\n");
fprintf(stderr, " -c N use DOS codepage N to decode short file names (default: %d)\n",
DEFAULT_DOS_CODEPAGE);
fprintf(stderr, " -d PATH drop file with name PATH (can be given multiple times)\n");
fprintf(stderr, " -f salvage unused chains to files\n");
fprintf(stderr, " -F NUM specify FAT table NUM used for filesystem access\n");
fprintf(stderr, " -l list path names\n");
fprintf(stderr, " -n no-op, check non-interactively without changing\n");
fprintf(stderr, " -p same as -a, for compat with other *fsck\n");
fprintf(stderr, " -r interactively repair the filesystem (default)\n");
fprintf(stderr, " -S disallow spaces in the middle of short file names\n");
fprintf(stderr, " -t test for bad clusters\n");
fprintf(stderr, " -u PATH try to undelete (non-directory) file that was named PATH (can be\n");
fprintf(stderr, " given multiple times)\n");
fprintf(stderr, " -U allow only uppercase characters in volume and boot label\n");
fprintf(stderr, " -v verbose mode\n");
fprintf(stderr, " -V perform a verification pass\n");
fprintf(stderr, " --variant=TYPE handle variant TYPE of the filesystem\n");
fprintf(stderr, " -w write changes to disk immediately\n");
fprintf(stderr, " -y same as -a, for compat with other *fsck\n");
fprintf(stderr, " --help print this message\n");
exit(exitval);
}
int main(int argc, char **argv)
{
DOS_FS fs;
int salvage_files, verify, c;
uint32_t free_clusters = 0;
struct termios tio;
char *tmp;
long codepage;
enum {OPT_HELP=1000, OPT_VARIANT};
const struct option long_options[] = {
{"variant", required_argument, NULL, OPT_VARIANT},
{"help", no_argument, NULL, OPT_HELP},
{0,}
};
if (!tcgetattr(0, &original_termios)) {
tio = original_termios;
tio.c_lflag &= ~(ICANON | ECHO);
tcsetattr(0, TCSAFLUSH, &tio);
atexit(restore_termios);
}
memset(&fs, 0, sizeof(fs));
salvage_files = verify = 0;
rw = interactive = 1;
check_atari();
while ((c = getopt_long(argc, argv, "Aac:d:bfF:lnprStu:UvVwy",
long_options, NULL)) != -1)
switch (c) {
case 'A': /* toggle Atari format */
atari_format = !atari_format;
break;
case 'a':
case 'p':
case 'y':
rw = 1;
interactive = 0;
salvage_files = 1;
break;
case 'b':
rw = 0;
interactive = 0;
boot_only = 1;
break;
case 'c':
errno = 0;
codepage = strtol(optarg, &tmp, 10);
if (!*optarg || isspace(*optarg) || *tmp || errno || codepage < 0 || codepage > INT_MAX) {
fprintf(stderr, "Invalid codepage : %s\n", optarg);
usage(argv[0], 2);
}
if (!set_dos_codepage(codepage))
usage(argv[0], 2);
break;
case 'd':
file_add(optarg, fdt_drop);
break;
case 'f':
salvage_files = 1;
break;
case 'F':
errno = 0;
fat_table = strtol(optarg, &tmp, 10);
if (!*optarg || isspace(*optarg) || *tmp || errno || fat_table < 0 || fat_table > 255) {
fprintf(stderr, "Invalid FAT table : %s\n", optarg);
usage(argv[0], 2);
}
break;
case 'l':
list = 1;
break;
case 'n':
rw = 0;
interactive = 0;
break;
case 'r':
rw = 1;
interactive = 1;
break;
case 'S':
no_spaces_in_sfns = 1;
break;
case 't':
test = 1;
break;
case 'u':
file_add(optarg, fdt_undelete);
break;
case 'U':
only_uppercase_label = 1;
break;
case 'v':
verbose = 1;
break;
case 'V':
verify = 1;
break;
case OPT_VARIANT:
if (!strcasecmp(optarg, "standard")) {
atari_format = 0;
} else if (!strcasecmp(optarg, "atari")) {
atari_format = 1;
} else {
fprintf(stderr, "Unknown variant: %s\n", optarg);
usage(argv[0], 2);
}
break;
case 'w':
write_immed = 1;
break;
case OPT_HELP:
usage(argv[0], 0);
break;
case '?':
usage(argv[0], 2);
break;
default:
fprintf(stderr,
"Internal error: getopt_long() returned unexpected value %d\n", c);
exit(3);
}
if (!set_dos_codepage(-1)) /* set default codepage if none was given in command line */
exit(2);
if ((test || write_immed) && !rw) {
fprintf(stderr, "-t and -w can not be used in read only mode\n");
exit(2);
}
if (optind != argc - 1)
usage(argv[0], 2);
printf("fsck.fat " VERSION " (" VERSION_DATE ")\n");
fs_open(argv[optind], rw);
read_boot(&fs);
if (boot_only)
goto exit;
if (verify)
printf("Starting check/repair pass.\n");
while (read_fat(&fs, 2), scan_root(&fs))
qfree(&mem_queue);
check_label(&fs);
if (test)
fix_bad(&fs);
if (salvage_files)
reclaim_file(&fs);
else
reclaim_free(&fs);
if (!atari_format)
check_dirty_bits(&fs);
free_clusters = update_free(&fs);
file_unused();
qfree(&mem_queue);
if (verify) {
n_files = 0;
printf("Starting verification pass.\n");
read_fat(&fs, 2);
scan_root(&fs);
check_label(&fs);
reclaim_free(&fs);
if (!atari_format)
check_dirty_bits(&fs);
qfree(&mem_queue);
}
release_fat(&fs);
exit:
if (!write_immed && fs_changed()) {
if (rw) {
printf("\n*** Filesystem was changed ***\n");
if (interactive)
printf("The changes have not yet been written, you can still choose to leave the\n"
"filesystem unmodified:\n");
rw = get_choice(1, "Writing changes.",
2,
1, "Write changes",
2, "Leave filesystem unchanged") == 1;
} else
printf("\nLeaving filesystem unchanged.\n");
}
if (!boot_only)
printf("%s: %u files, %lu/%lu clusters\n", argv[optind],
n_files, (unsigned long)fs.data_clusters - free_clusters,
(unsigned long)fs.data_clusters);
return fs_close(rw) ? 1 : 0;
}
dosfstools-4.2/src/file.h 0000644 0001750 0001750 00000004341 14005523510 012353 0000000 0000000 /* file.h - Additional file attributes
Copyright (C) 1993 Werner Almesberger
Copyright (C) 2008-2014 Daniel Baumann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
#ifndef _FILE_H
#define _FILE_H
#include "msdos_fs.h"
typedef enum { fdt_none, fdt_drop, fdt_undelete } FD_TYPE;
typedef struct _fptr {
char name[MSDOS_NAME];
FD_TYPE type;
struct _fptr *first; /* first entry */
struct _fptr *next; /* next file in directory */
} FDSC;
extern FDSC *fp_root;
char *file_name(unsigned char *fixed);
/* Returns a pointer to a pretty-printed representation of a fixed MS-DOS file
name. */
int file_cvt(unsigned char *name, unsigned char *fixed);
/* Converts a pretty-printed file name to the fixed MS-DOS format. Returns a
non-zero integer on success, zero on failure. */
void file_add(char *path, FD_TYPE type);
/* Define special attributes for a path. TYPE can be either FDT_DROP or
FDT_UNDELETE. */
FDSC **file_cd(FDSC ** curr, char *fixed);
/* Returns a pointer to the directory descriptor of the subdirectory FIXED of
CURR, or NULL if no such subdirectory exists. */
FD_TYPE file_type(FDSC ** curr, char *fixed);
/* Returns the attribute of the file FIXED in directory CURR or FDT_NONE if no
such file exists or if CURR is NULL. */
void file_modify(FDSC ** curr, char *fixed);
/* Performs the necessary operation on the entry of CURR that is named FIXED. */
void file_unused(void);
/* Displays warnings for all unused file attributes. */
#endif
dosfstools-4.2/src/file.c 0000644 0001750 0001750 00000015162 14005523510 012351 0000000 0000000 /* file.c - Additional file attributes
Copyright (C) 1993 Werner Almesberger
Copyright (C) 1998 Roman Hodek
Copyright (C) 2008-2014 Daniel Baumann
Copyright (C) 2020 Pali Rohár
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
/* FAT32, VFAT, Atari format support, and various fixes additions May 1998
* by Roman Hodek */
#include
#include
#include
#include
#include
#include "common.h"
#include "file.h"
#include "msdos_fs.h"
#include "charconv.h"
FDSC *fp_root = NULL;
static void put_char(char **p, unsigned char c, unsigned int out_size)
{
if (dos_char_to_printable(p, c, out_size))
return;
if (out_size >= 1 && c >= ' ' && c < 0x7f)
*(*p)++ = c;
else if (out_size >= 4) {
*(*p)++ = '\\';
*(*p)++ = '0' + (c >> 6);
*(*p)++ = '0' + ((c >> 3) & 7);
*(*p)++ = '0' + (c & 7);
}
}
/**
* Construct the "pretty-printed" representation of the name in a short directory entry.
*
* @param[in] fixed Pointer to name[0] of a DIR_ENT
*
* @return Pointer to static string containing pretty "8.3" equivalent of the
* name in the directory entry.
*/
char *file_name(unsigned char *fixed)
{
static char path[256];
char *p;
int i, j;
p = path;
i = j = 0;
if (fixed[0] == 0x05) {
put_char(&p, 0xe5, path + sizeof(path) - 1 - p);
++i;
++j;
}
for (; i < 8; i++)
if (fixed[i] != ' ') {
while (j++ < i)
*p++ = ' ';
put_char(&p, fixed[i], path + sizeof(path) - 1 - p);
}
if (strncmp((const char *)(fixed + 8), " ", 3)) {
*p++ = '.';
for (i = j = 0; i < 3; i++)
if (fixed[i + 8] != ' ') {
while (j++ < i)
*p++ = ' ';
put_char(&p, fixed[i + 8], path + sizeof(path) - 1 - p);
}
}
*p = 0;
return path;
}
int file_cvt(unsigned char *name, unsigned char *fixed)
{
unsigned char c;
int size, ext, cnt;
size = 8;
ext = 0;
while (*name) {
c = *name;
if (c < ' ' || c > 0x7e || strchr("*?<>|\"/", c)) {
printf("Invalid character in name. Use \\ooo for special "
"characters.\n");
return 0;
}
if (c == '.') {
if (ext) {
printf("Duplicate dots in name.\n");
return 0;
}
while (size--)
*fixed++ = ' ';
size = 3;
ext = 1;
name++;
continue;
}
if (c == '\\') {
c = 0;
name++;
for (cnt = 3; cnt; cnt--) {
if (*name < '0' || *name > '7') {
printf("Expected three octal digits.\n");
return 0;
}
c = c * 8 + *name++ - '0';
}
name--;
}
if (islower(c))
c = toupper(c);
if (size) {
if (size == 8 && c == 0xE5)
*fixed++ = 0x05;
else
*fixed++ = c;
size--;
}
name++;
}
if (*name || size == 8)
return 0;
if (!ext) {
while (size--)
*fixed++ = ' ';
size = 3;
}
while (size--)
*fixed++ = ' ';
return 1;
}
void file_add(char *path, FD_TYPE type)
{
FDSC **current, *walk;
char name[MSDOS_NAME];
char *here;
current = &fp_root;
if (*path != '/')
die("%s: Absolute path required.", path);
path++;
while (1) {
if ((here = strchr(path, '/')))
*here = 0;
if (!file_cvt((unsigned char *)path, (unsigned char *)name))
exit(2);
for (walk = *current; walk; walk = walk->next)
if (!here && (!strncmp(name, walk->name, MSDOS_NAME) || (type ==
fdt_undelete
&&
!strncmp
(name + 1,
walk->name
+ 1,
MSDOS_NAME
- 1))))
die("Ambiguous name: \"%s\"", path);
else if (here && !strncmp(name, walk->name, MSDOS_NAME))
break;
if (!walk) {
walk = alloc(sizeof(FDSC));
strncpy(walk->name, name, MSDOS_NAME);
walk->type = here ? fdt_none : type;
walk->first = NULL;
walk->next = *current;
*current = walk;
}
current = &walk->first;
if (!here)
break;
*here = '/';
path = here + 1;
}
}
FDSC **file_cd(FDSC ** curr, char *fixed)
{
FDSC **walk;
if (!curr || !*curr)
return NULL;
for (walk = curr; *walk; walk = &(*walk)->next)
if (!strncmp((*walk)->name, fixed, MSDOS_NAME) && (*walk)->first)
return &(*walk)->first;
return NULL;
}
static FDSC **file_find(FDSC ** dir, char *fixed)
{
if (!dir || !*dir)
return NULL;
if (*(unsigned char *)fixed == DELETED_FLAG) {
while (*dir) {
if (!strncmp((*dir)->name + 1, fixed + 1, MSDOS_NAME - 1)
&& !(*dir)->first)
return dir;
dir = &(*dir)->next;
}
return NULL;
}
while (*dir) {
if (!strncmp((*dir)->name, fixed, MSDOS_NAME) && !(*dir)->first)
return dir;
dir = &(*dir)->next;
}
return NULL;
}
/* Returns the attribute of the file FIXED in directory CURR or FDT_NONE if no
such file exists or if CURR is NULL. */
FD_TYPE file_type(FDSC ** curr, char *fixed)
{
FDSC **this;
if ((this = file_find(curr, fixed)))
return (*this)->type;
return fdt_none;
}
void file_modify(FDSC ** curr, char *fixed)
{
FDSC **this, *next;
if (!(this = file_find(curr, fixed)))
die("Internal error: file_find failed");
switch ((*this)->type) {
case fdt_drop:
printf("Dropping %s\n", file_name((unsigned char *)fixed));
*(unsigned char *)fixed = DELETED_FLAG;
break;
case fdt_undelete:
*fixed = *(*this)->name;
printf("Undeleting %s\n", file_name((unsigned char *)fixed));
break;
default:
die("Internal error: file_modify");
}
next = (*this)->next;
free(*this);
*this = next;
}
static void report_unused(FDSC * this)
{
FDSC *next;
while (this) {
next = this->next;
if (this->first)
report_unused(this->first);
else if (this->type != fdt_none)
printf("Warning: did not %s file %s\n", this->type == fdt_drop ?
"drop" : "undelete", file_name((unsigned char *)this->name));
free(this);
this = next;
}
}
void file_unused(void)
{
report_unused(fp_root);
}
dosfstools-4.2/src/check.h 0000644 0001750 0001750 00000002570 14005523510 012513 0000000 0000000 /* check.h - Check and repair a PC/MS-DOS filesystem
Copyright (C) 1993 Werner Almesberger
Copyright (C) 2008-2014 Daniel Baumann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
#ifndef _CHECK_H
#define _CHECK_H
void check_dirty_bits(DOS_FS * fs);
int scan_root(DOS_FS * fs);
/* Scans the root directory and recurses into all subdirectories. See check.c
for all the details. Returns a non-zero integer if the filesystem has to
be checked again. */
void check_label(DOS_FS * fs);
/* Checks the volume label from the root directory entry that is valid and
* matches the label stored in boot sector. */
#endif
dosfstools-4.2/src/check.c 0000644 0001750 0001750 00000115626 14005523510 012515 0000000 0000000 /* check.c - Check and repair a PC/MS-DOS filesystem
Copyright (C) 1993 Werner Almesberger
Copyright (C) 1998 Roman Hodek
Copyright (C) 2008-2014 Daniel Baumann
Copyright (C) 2015 Andreas Bombe
Copyright (C) 2017-2021 Pali Rohár
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
/* FAT32, VFAT, Atari format support, and various fixes additions May 1998
* by Roman Hodek */
#include
#include
#include
#include
#include
#include
#include
#include "common.h"
#include "fsck.fat.h"
#include "io.h"
#include "fat.h"
#include "file.h"
#include "lfn.h"
#include "check.h"
#include "boot.h"
#include "charconv.h"
/* the longest path on the filesystem that can be handled by path_name() */
#define PATH_NAME_MAX 1023
static DOS_FILE *root;
/* get start field of a dir entry */
#define FSTART(p,fs) \
((uint32_t)le16toh(p->dir_ent.start) | \
(fs->fat_bits == 32 ? (uint32_t)le16toh(p->dir_ent.starthi) << 16 : 0))
#define MODIFY(p,i,v) \
do { \
if (p->offset) { \
p->dir_ent.i = v; \
fs_write(p->offset+offsetof(DIR_ENT,i), \
sizeof(p->dir_ent.i),&p->dir_ent.i); \
} \
} while(0)
#define MODIFY_START(p,v,fs) \
do { \
uint32_t __v = (v); \
if (!p->offset) { \
/* writing to fake entry for FAT32 root dir */ \
if (!__v) die("Oops, deleting FAT32 root dir!"); \
fs->root_cluster = __v; \
p->dir_ent.start = htole16(__v&0xffff); \
p->dir_ent.starthi = htole16(__v>>16); \
__v = htole32(__v); \
fs_write(offsetof(struct boot_sector,root_cluster), \
sizeof(((struct boot_sector *)0)->root_cluster), \
&__v); \
} \
else { \
MODIFY(p,start,htole16((__v)&0xffff)); \
if (fs->fat_bits == 32) \
MODIFY(p,starthi,htole16((__v)>>16)); \
} \
} while(0)
/**
* Construct a full path (starting with '/') for the specified dentry,
* relative to the partition. All components are "long" names where possible.
*
* @param[in] file Information about dentry (file or directory) of interest
*
* return Pointer to static string containing file's full path
*/
static char *path_name(DOS_FILE * file)
{
static char path[PATH_NAME_MAX * 2];
if (!file)
*path = 0; /* Reached the root directory */
else {
if (strlen(path_name(file->parent)) > PATH_NAME_MAX)
die("Path name too long.");
if (strcmp(path, "/") != 0)
strcat(path, "/");
/* Append the long name to the path,
* or the short name if there isn't a long one
*/
strcpy(strrchr(path, 0),
file->lfn ? file->lfn : file_name(file->dir_ent.name));
}
return path;
}
static const char *month_str[] =
{ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
static char *file_stat(DOS_FILE * file)
{
static char temp[100];
unsigned int hours, minutes, secs, day, month, year;
unsigned short time, date;
time = le16toh(file->dir_ent.time);
date = le16toh(file->dir_ent.date);
year = 1980 + (date >> 9);
month = ((date >> 5) & 15);
if (month < 1) month = 1;
else if (month > 12) month = 12;
day = (date & 31);
if (day < 1) day = 1;
hours = (time >> 11);
if (hours > 23) hours = 23;
minutes = ((time >> 5) & 63);
if (minutes > 59) minutes = 59;
secs = (time & 31) * 2;
if (secs > 59) secs = 59;
sprintf(temp, " Size %u bytes, date %02u:%02u:%02u %s %02u %4u",
le32toh(file->dir_ent.size), hours, minutes, secs, month_str[month-1], day, year);
return temp;
}
static int bad_name(DOS_FILE * file)
{
int i, spc, suspicious = 0;
const char *bad_chars = atari_format ? "*?\\/:" : "*?<>|\"\\/:.";
const unsigned char *name = file->dir_ent.name;
const unsigned char *ext = name + 8;
/* do not check synthetic FAT32 root entry */
if (!file->offset)
return 0;
/* check if we have neither a long filename nor a short name */
if ((file->lfn == NULL) && (file->dir_ent.lcase & FAT_NO_83NAME)) {
return 1;
}
/* don't complain about the dummy 11 bytes used by patched Linux
kernels */
if (file->dir_ent.lcase & FAT_NO_83NAME)
return 0;
for (i = 0; i < MSDOS_NAME; i++) {
if ((name[i] < ' ' && !(i == 0 && name[0] == 0x05)) || name[i] == 0x7f)
return 1;
if (name[i] > 0x7f)
++suspicious;
if (strchr(bad_chars, name[i]))
return 1;
}
if (name[0] == ' ')
return 1;
if (no_spaces_in_sfns) {
spc = 0;
for (i = 0; i < 8; i++) {
if (name[i] == ' ')
spc = 1;
else if (spc)
/* non-space after a space not allowed, space terminates the name
* part */
return 1;
}
spc = 0;
for (i = 0; i < 3; i++) {
if (ext[i] == ' ')
spc = 1;
else if (spc)
/* non-space after a space not allowed, space terminates the ext
* part */
return 1;
}
}
/* Under GEMDOS, chars >= 128 are never allowed. */
if (atari_format && suspicious)
return 1;
/* Under MS-DOS and Windows, chars >= 128 in short names are valid
* (but these characters can be visualised differently depending on
* local codepage: CP437, CP866, etc). The chars are all basically ok,
* so we shouldn't auto-correct such names. */
return 0;
}
static void lfn_remove(off_t from, off_t to)
{
DIR_ENT empty;
/* New dir entry is zeroed except first byte, which is set to 0xe5.
* This is to avoid that some FAT-reading OSes (not Linux! ;) stop reading
* a directory at the first zero entry...
*/
memset(&empty, 0, sizeof(empty));
empty.name[0] = DELETED_FLAG;
for (; from < to; from += sizeof(empty)) {
fs_write(from, sizeof(DIR_ENT), &empty);
}
}
static void drop_file(DOS_FS * fs, DOS_FILE * file)
{
(void) fs;
MODIFY(file, name[0], DELETED_FLAG);
if (file->lfn)
lfn_remove(file->lfn_offset, file->offset);
--n_files;
}
static void truncate_file(DOS_FS * fs, DOS_FILE * file, uint32_t clusters)
{
int deleting;
uint32_t walk, next;
walk = FSTART(file, fs);
if ((deleting = !clusters))
MODIFY_START(file, 0, fs);
while (walk > 0 && walk != -1) {
next = next_cluster(fs, walk);
if (deleting)
set_fat(fs, walk, 0);
else if ((deleting = !--clusters))
set_fat(fs, walk, -1);
walk = next;
}
}
static void auto_rename(DOS_FILE * file)
{
DOS_FILE *first, *walk;
uint32_t number;
if (!file->offset) {
printf("Cannot rename FAT32 root dir\n");
return; /* cannot rename FAT32 root dir */
}
first = file->parent ? file->parent->first : root;
number = 0;
while (1) {
char num[8];
sprintf(num, "%07lu", (unsigned long)number);
memcpy(file->dir_ent.name, "FSCK", 4);
memcpy(file->dir_ent.name + 4, num, 7);
for (walk = first; walk; walk = walk->next)
if (walk != file
&& !strncmp((const char *)walk->dir_ent.name,
(const char *)file->dir_ent.name, MSDOS_NAME))
break;
if (!walk) {
if (file->dir_ent.lcase & FAT_NO_83NAME) {
/* as we only assign a new 8.3 filename, reset flag that 8.3 name is not
present */
file->dir_ent.lcase &= ~FAT_NO_83NAME;
/* reset the attributes, only keep DIR and VOLUME */
file->dir_ent.attr &= ~(ATTR_DIR | ATTR_VOLUME);
fs_write(file->offset, MSDOS_NAME + 2, &file->dir_ent);
} else {
fs_write(file->offset, MSDOS_NAME, file->dir_ent.name);
}
if (file->lfn) {
lfn_remove(file->lfn_offset, file->offset);
file->lfn = NULL;
}
return;
}
number++;
if (number > 9999999) {
die("Too many files need repair.");
}
}
die("Can't generate a unique name.");
}
static void rename_file(DOS_FILE * file)
{
unsigned char name[46];
unsigned char *walk, *here;
if (!file->offset) {
printf("Cannot rename FAT32 root dir\n");
return; /* cannot rename FAT32 root dir */
}
while (1) {
if (get_line("New name", (char *)name, 45)) {
if ((here = (unsigned char *)strchr((const char *)name, '\n')))
*here = 0;
for (walk = (unsigned char *)strrchr((const char *)name, 0);
walk >= name && (*walk == ' ' || *walk == '\t'); walk--) ;
walk[1] = 0;
for (walk = name; *walk == ' ' || *walk == '\t'; walk++) ;
if (file_cvt(walk, file->dir_ent.name)) {
if (file->dir_ent.lcase & FAT_NO_83NAME) {
/* as we only assign a new 8.3 filename, reset flag that 8.3 name is not
present */
file->dir_ent.lcase &= ~FAT_NO_83NAME;
/* reset the attributes, only keep DIR and VOLUME */
file->dir_ent.attr &= ~(ATTR_DIR | ATTR_VOLUME);
fs_write(file->offset, MSDOS_NAME + 2, &file->dir_ent);
} else {
fs_write(file->offset, MSDOS_NAME, file->dir_ent.name);
}
if (file->lfn) {
lfn_remove(file->lfn_offset, file->offset);
file->lfn = NULL;
}
return;
}
}
}
}
static uint32_t scan_free_entry(DOS_FS * fs, DOS_FILE * this)
{
uint32_t clu_num, offset;
int i;
DIR_ENT de;
i = 2 * sizeof(DIR_ENT); /* Skip '.' and '..' slots */
clu_num = FSTART(this, fs);
while (clu_num > 0 && clu_num != -1) {
offset = cluster_start(fs, clu_num) + (i % fs->cluster_size);
fs_read(offset, sizeof(DIR_ENT), &de);
if (IS_FREE(de.name))
return offset;
i += sizeof(DIR_ENT);
if (!(i % fs->cluster_size))
if ((clu_num = next_cluster(fs, clu_num)) == 0 || clu_num == -1)
break;
}
return 0;
}
static int handle_dot(DOS_FS * fs, DOS_FILE * file, int dotdot)
{
const char *name, *ent;
uint32_t new_offset, start;
if (dotdot) {
name = "..";
ent = MSDOS_DOTDOT;
if (!file->parent->parent) {
start = 0;
} else {
start = FSTART(file->parent->parent, fs);
if (start == fs->root_cluster)
start = 0;
}
} else {
name = ".";
ent = MSDOS_DOT;
start = FSTART(file->parent, fs);
}
if (!(file->dir_ent.attr & ATTR_DIR) || (FSTART(file, fs) != start) ||
strncmp((const char *)(file->dir_ent.name), ent, MSDOS_NAME)) {
if (IS_FREE(file->dir_ent.name)) {
printf("%s\n Expected a valid '%s' entry in the %s slot, found free entry.\n",
path_name(file->parent), name, dotdot ? "second" : "first");
switch (get_choice(1, " Creating.",
2,
1, "Create entry",
2, "Drop parent")) {
case 1:
goto conjure;
case 2:
drop_file(fs, file->parent);
return 1;
}
}
if (!strncmp((const char *)(file->dir_ent.name), ent, MSDOS_NAME)) {
printf("%s\n Invalid '%s' entry in the %s slot. Fixing.\n",
path_name(file->parent), name, dotdot ? "second" : "first");
MODIFY_START(file, start, fs);
MODIFY(file, attr, ATTR_DIR);
} else {
printf("%s\n Expected a valid '%s' entry in this slot.\n",
path_name(file), name);
switch (get_choice(3, " Moving entry down.",
3,
1, "Drop entry",
2, "Drop parent",
3, "Move entry down")) {
case 1:
drop_file(fs, file);
goto conjure;
case 2:
drop_file(fs, file->parent);
return 1;
case 3:
new_offset = scan_free_entry(fs, file->parent);
if (!new_offset) {
printf("No free entry found.\n");
return 0;
}
fs_write(new_offset, sizeof(file->dir_ent), &file->dir_ent);
goto conjure;
}
}
}
if (file->dir_ent.lcase & FAT_NO_83NAME) {
/* Some versions of mtools write these directory entries with random data in
this field. */
printf("%s\n Is a dot with no 8.3 name flag set, clearing.\n", path_name(file));
file->dir_ent.lcase &= ~FAT_NO_83NAME;
MODIFY(file, lcase, file->dir_ent.lcase);
}
return 0;
conjure:
memset(&file->dir_ent, 0, sizeof(DIR_ENT));
memcpy(file->dir_ent.name, ent, MSDOS_NAME);
fs_write(file->offset, sizeof(file->dir_ent), &file->dir_ent);
MODIFY_START(file, start, fs);
MODIFY(file, attr, ATTR_DIR);
return 0;
}
static int check_file(DOS_FS * fs, DOS_FILE * file)
{
DOS_FILE *owner;
int restart;
uint32_t parent, grandp, curr, this, clusters, prev, walk, clusters2;
if (IS_FREE(file->dir_ent.name))
return 0;
if (file->dir_ent.attr & ATTR_DIR) {
if (le32toh(file->dir_ent.size)) {
printf("%s\n Directory has non-zero size. Fixing it.\n",
path_name(file));
MODIFY(file, size, htole32(0));
}
if (FSTART(file, fs) == 0) {
printf("%s\n Start does point to root directory. Deleting dir. \n",
path_name(file));
MODIFY(file, name[0], DELETED_FLAG);
return 0;
}
if (file->parent) {
parent = FSTART(file->parent, fs);
grandp = file->parent->parent ? FSTART(file->parent->parent, fs) : 0;
if (fs->root_cluster && grandp == fs->root_cluster)
grandp = 0;
if (FSTART(file, fs) == parent) {
printf("%s\n Start does point to containing directory. Deleting entry.\n",
path_name(file));
MODIFY(file, name[0], DELETED_FLAG);
MODIFY_START(file, 0, fs);
return 0;
}
if (FSTART(file, fs) == grandp) {
printf("%s\n Start does point to containing directory's parent. Deleting entry.\n",
path_name(file));
MODIFY(file, name[0], DELETED_FLAG);
MODIFY_START(file, 0, fs);
return 0;
}
}
}
if (FSTART(file, fs) == 1) {
printf("%s\n Bad start cluster 1. Truncating file.\n",
path_name(file));
if (!file->offset)
die("Bad FAT32 root directory! (bad start cluster 1)\n");
MODIFY_START(file, 0, fs);
}
if (FSTART(file, fs) >= fs->data_clusters + 2) {
printf
("%s\n Start cluster beyond limit (%lu > %lu). Truncating file.\n",
path_name(file), (unsigned long)FSTART(file, fs),
(unsigned long)(fs->data_clusters + 1));
if (!file->offset)
die("Bad FAT32 root directory! (start cluster beyond limit: %lu > %lu)\n",
(unsigned long)FSTART(file, fs),
(unsigned long)(fs->data_clusters + 1));
MODIFY_START(file, 0, fs);
}
clusters = prev = 0;
for (curr = FSTART(file, fs) ? FSTART(file, fs) :
-1; curr != -1; curr = next_cluster(fs, curr)) {
FAT_ENTRY curEntry;
get_fat(&curEntry, fs->fat, curr, fs);
if (!curEntry.value || bad_cluster(fs, curr)) {
printf("%s\n Contains a %s cluster (%lu). Assuming EOF.\n",
path_name(file), curEntry.value ? "bad" : "free", (unsigned long)curr);
if (prev)
set_fat(fs, prev, -1);
else if (!file->offset)
die("FAT32 root dir starts with a bad cluster!");
else
MODIFY_START(file, 0, fs);
break;
}
if (!(file->dir_ent.attr & ATTR_DIR) && le32toh(file->dir_ent.size) <=
clusters * fs->cluster_size) {
printf
("%s\n File size is %u bytes, cluster chain length is > %u "
"bytes.\n Truncating file to %u bytes.\n", path_name(file),
le32toh(file->dir_ent.size),
(unsigned)clusters * fs->cluster_size,
le32toh(file->dir_ent.size));
truncate_file(fs, file, clusters);
break;
}
if ((owner = get_owner(fs, curr))) {
int do_trunc = 0;
printf("%s and\n", path_name(owner));
printf("%s\n share clusters.\n", path_name(file));
clusters2 = 0;
for (walk = FSTART(owner, fs); walk > 0 && walk != -1; walk =
next_cluster(fs, walk))
if (walk == curr)
break;
else {
if ((unsigned long long)clusters2 * fs->cluster_size >= UINT32_MAX)
die("Internal error: File size is larger than 2^32-1");
clusters2++;
}
restart = file->dir_ent.attr & ATTR_DIR;
if (!owner->offset) {
printf(" Truncating second to %u bytes because first "
"is FAT32 root dir.\n",
(unsigned)clusters * fs->cluster_size);
do_trunc = 2;
} else if (!file->offset) {
printf(" Truncating first to %u bytes because second "
"is FAT32 root dir.\n",
(unsigned)clusters2 * fs->cluster_size);
do_trunc = 1;
} else {
char *trunc_first_string;
char *trunc_second_string;
char *noninteractive_string;
xasprintf(&trunc_first_string,
"Truncate first to %u bytes%s",
(unsigned)clusters2 * fs->cluster_size,
restart ? " and restart" : "");
xasprintf(&trunc_second_string,
"Truncate second to %u bytes",
(unsigned)clusters * fs->cluster_size);
xasprintf(&noninteractive_string,
" Truncating second to %u bytes.",
(unsigned)clusters * fs->cluster_size);
do_trunc = get_choice(2, noninteractive_string,
2,
1, trunc_first_string,
2, trunc_second_string);
free(trunc_first_string);
free(trunc_second_string);
free(noninteractive_string);
}
if (do_trunc == 1) {
prev = 0;
clusters = 0;
for (this = FSTART(owner, fs); this > 0 && this != -1; this =
next_cluster(fs, this)) {
if (this == curr) {
if (prev)
set_fat(fs, prev, -1);
else
MODIFY_START(owner, 0, fs);
MODIFY(owner, size, htole32(clusters * fs->cluster_size));
if (restart)
return 1;
while (this > 0 && this != -1) {
set_owner(fs, this, NULL);
this = next_cluster(fs, this);
}
this = curr;
break;
}
if ((unsigned long long)clusters * fs->cluster_size >= UINT32_MAX)
die("Internal error: File size is larger than 2^32-1");
clusters++;
prev = this;
}
if (this != curr)
die("Internal error: didn't find cluster %d in chain"
" starting at %d", curr, FSTART(owner, fs));
} else {
if (prev)
set_fat(fs, prev, -1);
else
MODIFY_START(file, 0, fs);
break;
}
}
set_owner(fs, curr, file);
if ((unsigned long long)clusters * fs->cluster_size >= UINT32_MAX)
die("Internal error: File size is larger than 2^32-1");
clusters++;
prev = curr;
}
if (!(file->dir_ent.attr & ATTR_DIR) && le32toh(file->dir_ent.size) >
clusters * fs->cluster_size) {
printf
("%s\n File size is %u bytes, cluster chain length is %u bytes."
"\n Truncating file to %u bytes.\n", path_name(file),
le32toh(file->dir_ent.size),
(unsigned)clusters * fs->cluster_size,
(unsigned)clusters * fs->cluster_size);
MODIFY(file, size,
htole32(clusters * fs->cluster_size));
}
return 0;
}
static int check_files(DOS_FS * fs, DOS_FILE * start)
{
while (start) {
if (check_file(fs, start))
return 1;
start = start->next;
}
return 0;
}
static int check_dir(DOS_FS * fs, DOS_FILE ** root, int dots)
{
DOS_FILE *parent, **walk, **scan;
int skip, redo;
int good, bad;
if (!*root)
return 0;
parent = (*root)->parent;
good = bad = 0;
for (walk = root; *walk; walk = &(*walk)->next)
if (bad_name(*walk))
bad++;
else
good++;
if (*root && parent && good + bad > 4 && bad > good / 2) {
printf("%s\n Has a large number of bad entries. (%d/%d)\n",
path_name(parent), bad, good + bad);
if (!dots)
printf(" Not dropping root directory.\n");
else if (get_choice(2, " Not dropping it in auto-mode.",
2,
1, "Drop directory",
2, "Keep directory") == 1) {
truncate_file(fs, parent, 0);
MODIFY(parent, name[0], DELETED_FLAG);
/* buglet: deleted directory stays in the list. */
return 1;
}
}
redo = 0;
walk = root;
while (*walk) {
if (!((*walk)->dir_ent.attr & ATTR_VOLUME) && bad_name(*walk)) {
puts(path_name(*walk));
printf(" Bad short file name (%s).\n",
file_name((*walk)->dir_ent.name));
switch (get_choice(3, " Auto-renaming it.",
4,
1, "Drop file",
2, "Rename file",
3, "Auto-rename",
4, "Keep it")) {
case 1:
drop_file(fs, *walk);
walk = &(*walk)->next;
continue;
case 2:
rename_file(*walk);
redo = 1;
break;
case 3:
auto_rename(*walk);
printf(" Renamed to %s\n", file_name((*walk)->dir_ent.name));
break;
case 4:
break;
}
}
/* don't check for duplicates of the volume label */
if (!((*walk)->dir_ent.attr & ATTR_VOLUME)) {
scan = &(*walk)->next;
skip = 0;
while (*scan && !skip) {
if (!((*scan)->dir_ent.attr & ATTR_VOLUME) &&
!memcmp((*walk)->dir_ent.name, (*scan)->dir_ent.name,
MSDOS_NAME)) {
printf("%s\n Duplicate directory entry.\n First %s\n",
path_name(*walk), file_stat(*walk));
printf(" Second %s\n", file_stat(*scan));
switch (get_choice(6, " Auto-renaming second.",
6,
1, "Drop first",
2, "Drop second",
3, "Rename first",
4, "Rename second",
5, "Auto-rename first",
6, "Auto-rename second")) {
case 1:
drop_file(fs, *walk);
*walk = (*walk)->next;
skip = 1;
break;
case 2:
drop_file(fs, *scan);
*scan = (*scan)->next;
continue;
case 3:
rename_file(*walk);
printf(" Renamed to %s\n", path_name(*walk));
redo = 1;
break;
case 4:
rename_file(*scan);
printf(" Renamed to %s\n", path_name(*walk));
redo = 1;
break;
case 5:
auto_rename(*walk);
printf(" Renamed to %s\n",
file_name((*walk)->dir_ent.name));
break;
case 6:
auto_rename(*scan);
printf(" Renamed to %s\n",
file_name((*scan)->dir_ent.name));
break;
}
}
scan = &(*scan)->next;
}
if (skip)
continue;
}
if (!redo)
walk = &(*walk)->next;
else {
walk = root;
redo = 0;
}
}
return 0;
}
/**
* Check a dentry's cluster chain for bad clusters.
* If requested, we verify readability and mark unreadable clusters as bad.
*
* @param[inout] fs Information about the filesystem
* @param[in] file dentry to check
* @param[in] read_test Nonzero == verify that dentry's clusters can
* be read
*/
static void test_file(DOS_FS * fs, DOS_FILE * file, int read_test)
{
DOS_FILE *owner;
uint32_t walk, prev, clusters, next_clu;
prev = clusters = 0;
for (walk = FSTART(file, fs); walk > 1 && walk < fs->data_clusters + 2;
walk = next_clu) {
next_clu = next_cluster(fs, walk);
/* In this stage we are checking only for a loop within our own
* cluster chain.
* Cross-linking of clusters is handled in check_file()
*/
if ((owner = get_owner(fs, walk))) {
if (owner == file) {
printf("%s\n Circular cluster chain. Truncating to %lu "
"cluster%s.\n", path_name(file), (unsigned long)clusters,
clusters == 1 ? "" : "s");
if (prev)
set_fat(fs, prev, -1);
else if (!file->offset)
die("Bad FAT32 root directory! (bad start cluster)\n");
else
MODIFY_START(file, 0, fs);
}
break;
}
if (bad_cluster(fs, walk))
break;
if (read_test) {
if (fs_test(cluster_start(fs, walk), fs->cluster_size)) {
prev = walk;
clusters++;
} else {
printf("%s\n Cluster %lu (%lu) is unreadable. Skipping it.\n",
path_name(file), (unsigned long)clusters, (unsigned long)walk);
if (prev)
set_fat(fs, prev, next_cluster(fs, walk));
else
MODIFY_START(file, next_cluster(fs, walk), fs);
set_fat(fs, walk, -2);
}
} else {
prev = walk;
clusters++;
}
set_owner(fs, walk, file);
}
/* Revert ownership (for now) */
for (walk = FSTART(file, fs); walk > 1 && walk < fs->data_clusters + 2;
walk = next_cluster(fs, walk))
if (bad_cluster(fs, walk))
break;
else if (get_owner(fs, walk) == file)
set_owner(fs, walk, NULL);
else
break;
}
static void undelete(DOS_FS * fs, DOS_FILE * file)
{
uint32_t clusters, left, prev, walk;
clusters = left = (le32toh(file->dir_ent.size) + fs->cluster_size - 1) /
fs->cluster_size;
prev = 0;
walk = FSTART(file, fs);
while (left && (walk >= 2) && (walk < fs->data_clusters + 2)) {
FAT_ENTRY curEntry;
get_fat(&curEntry, fs->fat, walk, fs);
if (!curEntry.value)
break;
left--;
if (prev)
set_fat(fs, prev, walk);
prev = walk;
walk++;
}
if (prev)
set_fat(fs, prev, -1);
else
MODIFY_START(file, 0, fs);
if (left)
printf("Warning: Did only undelete %lu of %lu cluster%s.\n",
(unsigned long)clusters - left, (unsigned long)clusters, clusters == 1 ? "" : "s");
}
static void new_dir(void)
{
lfn_reset();
}
/**
* Create a description for a referenced dentry and insert it in our dentry
* tree. Then, go check the dentry's cluster chain for bad clusters and
* cluster loops.
*
* @param[inout] fs Information about the filesystem
* @param[out] chain
* @param[in] parent Information about parent directory of this file
* NULL == no parent ('file' is root directory)
* @param[in] offset Partition-relative byte offset of directory entry of interest
* 0 == Root directory
* @param cp
*/
static void add_file(DOS_FS * fs, DOS_FILE *** chain, DOS_FILE * parent,
off_t offset, FDSC ** cp)
{
DOS_FILE *new;
DIR_ENT de;
FD_TYPE type;
if (offset)
fs_read(offset, sizeof(DIR_ENT), &de);
else {
/* Construct a DIR_ENT for the root directory */
memset(&de, 0, sizeof de);
memcpy(de.name, " ", MSDOS_NAME);
de.attr = ATTR_DIR;
de.start = htole16(fs->root_cluster & 0xffff);
de.starthi = htole16((fs->root_cluster >> 16) & 0xffff);
}
if ((type = file_type(cp, (char *)de.name)) != fdt_none) {
if (type == fdt_undelete && (de.attr & ATTR_DIR))
die("Can't undelete directories.");
file_modify(cp, (char *)de.name);
fs_write(offset, 1, &de);
}
if (IS_FREE(de.name)) {
lfn_check_orphaned();
return;
}
if (de.attr == VFAT_LN_ATTR) {
lfn_add_slot(&de, offset);
return;
}
new = qalloc(&mem_queue, sizeof(DOS_FILE));
new->lfn = lfn_get(&de, &new->lfn_offset);
new->offset = offset;
memcpy(&new->dir_ent, &de, sizeof(de));
new->next = new->first = NULL;
new->parent = parent;
if (type == fdt_undelete)
undelete(fs, new);
**chain = new;
*chain = &new->next;
if (list) {
printf("Checking file %s", path_name(new));
if (new->lfn)
printf(" (%s)", file_name(new->dir_ent.name)); /* (8.3) */
printf("\n");
}
/* Don't include root directory in the total file count */
if (offset)
++n_files;
test_file(fs, new, test); /* Bad cluster check */
}
static int subdirs(DOS_FS * fs, DOS_FILE * parent, FDSC ** cp);
static int scan_dir(DOS_FS * fs, DOS_FILE * this, FDSC ** cp)
{
DOS_FILE **chain;
int i;
uint32_t clu_num;
chain = &this->first;
i = 0;
clu_num = FSTART(this, fs);
new_dir();
if (clu_num != 0 && clu_num != -1 && this->offset) {
DOS_FILE file;
file.lfn = NULL;
file.lfn_offset = 0;
file.next = NULL;
file.parent = this;
file.first = NULL;
file.offset = cluster_start(fs, clu_num) + (i % fs->cluster_size);
fs_read(file.offset, sizeof(DIR_ENT), &file.dir_ent);
if (handle_dot(fs, &file, 0))
return 1;
i += sizeof(DIR_ENT);
file.offset = cluster_start(fs, clu_num) + (i % fs->cluster_size);
fs_read(file.offset, sizeof(DIR_ENT), &file.dir_ent);
if (handle_dot(fs, &file, 1))
return 1;
i += sizeof(DIR_ENT);
}
while (clu_num > 0 && clu_num != -1) {
add_file(fs, &chain, this,
cluster_start(fs, clu_num) + (i % fs->cluster_size), cp);
i += sizeof(DIR_ENT);
if (!(i % fs->cluster_size))
if ((clu_num = next_cluster(fs, clu_num)) == 0 || clu_num == -1)
break;
}
lfn_check_orphaned();
if (check_dir(fs, &this->first, this->offset))
return 0;
if (check_files(fs, this->first))
return 1;
return subdirs(fs, this, cp);
}
/**
* Recursively scan subdirectories of the specified parent directory.
*
* @param[inout] fs Information about the filesystem
* @param[in] parent Identifies the directory to scan
* @param[in] cp
*
* @return 0 Success
* @return 1 Error
*/
static int subdirs(DOS_FS * fs, DOS_FILE * parent, FDSC ** cp)
{
DOS_FILE *walk;
for (walk = parent ? parent->first : root; walk; walk = walk->next)
if (!IS_FREE(walk->dir_ent.name) && (walk->dir_ent.attr & ATTR_DIR))
if (scan_dir(fs, walk, file_cd(cp, (char *)walk->dir_ent.name)))
return 1;
return 0;
}
/**
* Scan all directory and file information for errors.
*
* @param[inout] fs Information about the filesystem
*
* @return 0 Success
* @return 1 Error
*/
int scan_root(DOS_FS * fs)
{
DOS_FILE **chain;
int i;
root = NULL;
chain = &root;
new_dir();
if (fs->root_cluster) {
add_file(fs, &chain, NULL, 0, &fp_root);
} else {
for (i = 0; i < fs->root_entries; i++)
add_file(fs, &chain, NULL, fs->root_start + i * sizeof(DIR_ENT),
&fp_root);
}
lfn_check_orphaned();
(void)check_dir(fs, &root, 0);
if (check_files(fs, root))
return 1;
return subdirs(fs, NULL, &fp_root);
}
static char print_fat_dirty_state(void)
{
printf("Dirty bit is set. Fs was not properly unmounted and"
" some data may be corrupt.\n");
return get_choice(1, " Automatically removing dirty bit.",
2,
1, "Remove dirty bit",
2, "No action");
}
void check_dirty_bits(DOS_FS * fs)
{
if (fs->fat_bits == 32) {
struct boot_sector b32;
FAT_ENTRY fat32_flags;
get_fat(&fat32_flags, fs->fat, 1, fs);
fs_read(0, sizeof(b32), &b32);
if ((b32.boot_flags & FAT_STATE_DIRTY) || !(fat32_flags.value & FAT32_FLAG_CLEAN_SHUTDOWN)) {
if (print_fat_dirty_state() == 1) {
if (b32.boot_flags & FAT_STATE_DIRTY) {
b32.boot_flags &= ~FAT_STATE_DIRTY;
fs_write(0, sizeof(b32), &b32);
}
if (!(fat32_flags.value & FAT32_FLAG_CLEAN_SHUTDOWN)) {
uint32_t *new_flags_ptr = (uint32_t *)(fs->fat + 4);
*new_flags_ptr = htole32(fat32_flags.value | FAT32_FLAG_CLEAN_SHUTDOWN | (fat32_flags.reserved << 28));
fs_write(fs->fat_start + 4, 4, new_flags_ptr);
if (fs->nfats > 1)
fs_write(fs->fat_start + 4 + fs->fat_size, 4, new_flags_ptr);
}
}
}
} else {
struct boot_sector_16 b16;
FAT_ENTRY fat16_flags;
int fat16_is_dirty = 0;
fs_read(0, sizeof(b16), &b16);
if (fs->fat_bits == 16) {
get_fat(&fat16_flags, fs->fat, 1, fs);
fat16_is_dirty = !(fat16_flags.value & FAT16_FLAG_CLEAN_SHUTDOWN);
}
if ((b16.boot_flags & FAT_STATE_DIRTY) || fat16_is_dirty) {
if (print_fat_dirty_state() == 1) {
if (b16.boot_flags & FAT_STATE_DIRTY) {
b16.boot_flags &= ~FAT_STATE_DIRTY;
fs_write(0, sizeof(b16), &b16);
}
if (fat16_is_dirty) {
uint16_t *new_flags_ptr = (uint16_t *)(fs->fat + 2);
*new_flags_ptr = htole16(fat16_flags.value | FAT16_FLAG_CLEAN_SHUTDOWN);
fs_write(fs->fat_start + 2, 2, new_flags_ptr);
if (fs->nfats > 1)
fs_write(fs->fat_start + 2 + fs->fat_size, 2, new_flags_ptr);
}
}
}
}
}
static void get_new_label(char doslabel[12])
{
char newlabel[256];
size_t len;
char *p;
int ret;
int i;
while (1) {
if (get_line("New label", newlabel, sizeof(newlabel))) {
if ((p = strchr(newlabel, '\n')))
*p = 0;
len = mbstowcs(NULL, newlabel, 0);
if (len != (size_t)-1 && len > 11) {
printf("Label can be no longer than 11 characters\n");
continue;
}
if (!local_string_to_dos_string(doslabel, newlabel, 12)) {
printf("Error when processing label\n");
continue;
}
for (i = strlen(doslabel); i < 11; ++i)
doslabel[i] = ' ';
doslabel[11] = 0;
ret = validate_volume_label(doslabel);
if ((ret && only_uppercase_label) || (ret & ~0x1)) {
printf("New label is invalid\n");
continue;
} else if (ret & 0x1) {
printf("Warning: lowercase labels might not work properly on some systems\n");
}
break;
}
}
}
static int check_boot_label(DOS_FS *fs)
{
char doslabel[12];
wchar_t wlabel[12];
int ret;
int i;
ret = validate_volume_label(fs->label);
if (ret & ~0x1) {
printf("Label '%s' stored in boot sector is not valid.\n", pretty_label(fs->label));
switch (get_choice(1, " Auto-removing label from boot sector.",
2,
1, "Remove invalid label from boot sector",
2, "Enter new label")) {
case 1:
write_boot_label(fs, "NO NAME ");
memcpy(fs->label, "NO NAME ", 11);
return 1;
case 2:
get_new_label(doslabel);
write_boot_label(fs, doslabel);
memcpy(fs->label, doslabel, 11);
return 1;
}
} else if ((ret & 0x1) && only_uppercase_label) {
printf("Label '%s' stored in boot sector contains lowercase characters.\n", pretty_label(fs->label));
switch (get_choice(1, " Auto-changing lowercase characters to uppercase",
3,
1, "Change lowercase characters to uppercase",
2, "Remove invalid label",
2, "Set new label")) {
case 1:
if (!dos_string_to_wchar_string(wlabel, fs->label, sizeof(wlabel)))
die("Cannot change lowercase characters to uppercase.");
for (i = 0; i < 11; ++i)
wlabel[i] = towupper(wlabel[i]);
if (!wchar_string_to_dos_string(doslabel, wlabel, sizeof(doslabel)))
die("Cannot change lowercase characters to uppercase.");
write_boot_label(fs, doslabel);
memcpy(fs->label, doslabel, 11);
return 1;
case 2:
write_boot_label(fs, "NO NAME ");
memcpy(fs->label, "NO NAME ", 11);
return 1;
case 3:
get_new_label(doslabel);
write_boot_label(fs, doslabel);
memcpy(fs->label, doslabel, 11);
return 1;
}
}
return 0;
}
void check_label(DOS_FS *fs)
{
DIR_ENT de;
off_t offset;
char buffer[256];
char doslabel[12];
wchar_t wlabel[12];
int ret;
int i;
offset = find_volume_de(fs, &de);
if (offset == 0 && memcmp(fs->label, "NO NAME ", 11) != 0)
check_boot_label(fs);
if (offset == 0 && memcmp(fs->label, "NO NAME ", 11) != 0) {
printf("Label in boot sector is '%s', but there is no volume label in root directory.\n", pretty_label(fs->label));
switch (get_choice(1, " Auto-removing label from boot sector.",
2,
1, "Remove label from boot sector",
2, "Copy label from boot sector to root directory")) {
case 1:
write_boot_label(fs, "NO NAME ");
memcpy(fs->label, "NO NAME ", 11);
break;
case 2:
write_volume_label(fs, fs->label);
offset = find_volume_de(fs, &de);
break;
}
}
if (offset != 0) {
memcpy(doslabel, de.name, 11);
if (doslabel[0] == 0x05)
doslabel[0] = 0xe5;
ret = validate_volume_label(doslabel);
if (ret & ~0x1) {
printf("Volume label '%s' stored in root directory is not valid.\n", pretty_label(doslabel));
switch (get_choice(1, " Auto-removing label.",
2,
1, "Remove invalid label",
2, "Set new label")) {
case 1:
remove_label(fs);
memcpy(fs->label, "NO NAME ", 11);
offset = 0;
break;
case 2:
get_new_label(doslabel);
write_label(fs, doslabel);
memcpy(fs->label, doslabel, 11);
break;
}
} else if ((ret & 0x1) && only_uppercase_label) {
printf("Volume label '%s' stored in root directory contains lowercase characters.\n", pretty_label(doslabel));
switch (get_choice(1, " Auto-changing lowercase characters to uppercase",
3,
1, "Change lowercase characters to uppercase",
2, "Remove invalid label",
2, "Set new label")) {
case 1:
if (!dos_string_to_wchar_string(wlabel, doslabel, sizeof(wlabel)))
die("Cannot change lowercase characters to uppercase.");
for (i = 0; i < 11; ++i)
wlabel[i] = towupper(wlabel[i]);
if (!wchar_string_to_dos_string(doslabel, wlabel, sizeof(doslabel)))
die("Cannot change lowercase characters to uppercase.");
write_label(fs, doslabel);
memcpy(fs->label, doslabel, 11);
break;
case 2:
remove_label(fs);
memcpy(fs->label, "NO NAME ", 11);
offset = 0;
break;
case 3:
get_new_label(doslabel);
write_label(fs, doslabel);
memcpy(fs->label, doslabel, 11);
break;
}
}
}
again:
if (offset != 0 && memcmp(fs->label, "NO NAME ", 11) == 0 && memcmp(doslabel, "NO NAME ", 11) != 0) {
printf("There is no label in boot sector, but there is volume label '%s' stored in root directory\n", pretty_label(doslabel));
switch (get_choice(1, " Auto-copying volume label from root directory to boot sector.",
2,
1, "Copy volume label from root directory to boot sector",
2, "Remove volume label from root directory")) {
case 1:
write_boot_label(fs, doslabel);
memcpy(fs->label, doslabel, 11);
break;
case 2:
remove_label(fs);
offset = 0;
break;
}
}
if (offset != 0 && memcmp(fs->label, "NO NAME ", 11) != 0 && memcmp(fs->label, doslabel, 11) != 0) {
strncpy(buffer, pretty_label(doslabel), sizeof(buffer)-1);
buffer[sizeof(buffer)-1] = 0;
printf("Volume label '%s' stored in root directory and label '%s' stored in boot sector and different.\n", buffer, pretty_label(fs->label));
switch (get_choice(1, " Auto-copying volume label from root directory to boot sector.",
2,
1, "Copy volume label from root directory to boot sector",
2, "Copy label from boot sector to root directory")) {
case 1:
write_boot_label(fs, doslabel);
memcpy(fs->label, doslabel, 11);
break;
case 2:
ret = check_boot_label(fs);
if (ret)
goto again;
write_volume_label(fs, fs->label);
offset = find_volume_de(fs, &de);
/* NOTE: doslabel is not updated */
break;
}
}
}
dosfstools-4.2/src/endian_compat.h 0000644 0001750 0001750 00000001521 14005523510 014232 0000000 0000000 #ifndef ENDIAN_COMPAT_H
#define ENDIAN_COMPAT_H
#if defined(HAVE_ENDIAN_H)
#include
#elif defined(HAVE_SYS_ENDIAN_H)
#include
#elif defined(HAVE_LIBKERN_OSBYTEORDER_H)
#include
#define htobe16(x) OSSwapHostToBigInt16(x)
#define htole16(x) OSSwapHostToLittleInt16(x)
#define be16toh(x) OSSwapBigToHostInt16(x)
#define le16toh(x) OSSwapLittleToHostInt16(x)
#define htobe32(x) OSSwapHostToBigInt32(x)
#define htole32(x) OSSwapHostToLittleInt32(x)
#define be32toh(x) OSSwapBigToHostInt32(x)
#define le32toh(x) OSSwapLittleToHostInt32(x)
#define htobe64(x) OSSwapHostToBigInt64(x)
#define htole64(x) OSSwapHostToLittleInt64(x)
#define be64toh(x) OSSwapBigToHostInt64(x)
#define le64toh(x) OSSwapLittleToHostInt64(x)
#else
#error No endian.h available and no fallback code
#endif
#endif
dosfstools-4.2/src/fsck.fat.h 0000644 0001750 0001750 00000016454 14005523510 013143 0000000 0000000 /* fsck.fat.h - Common data structures and global variables
Copyright (C) 1993 Werner Almesberger
Copyright (C) 1998 Roman Hodek
Copyright (C) 2008-2014 Daniel Baumann
Copyright (C) 2015 Andreas Bombe
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
/* FAT32, VFAT, Atari format support, and various fixes additions May 1998
* by Roman Hodek */
#ifndef _DOSFSCK_H
#define _DOSFSCK_H
#include
#include
#include
#include
#include "endian_compat.h"
#include "msdos_fs.h"
#define VFAT_LN_ATTR (ATTR_RO | ATTR_HIDDEN | ATTR_SYS | ATTR_VOLUME)
#define FAT_STATE_DIRTY 0x01
#define FAT_NEED_SURFACE_TEST 0x02
#define FAT16_FLAG_HARDDISK_ERROR 0x4000
#define FAT16_FLAG_CLEAN_SHUTDOWN 0x8000
#define FAT32_FLAG_HARDDISK_ERROR 0x4000000
#define FAT32_FLAG_CLEAN_SHUTDOWN 0x8000000
/* ++roman: Use own definition of boot sector structure -- the kernel headers'
* name for it is msdos_boot_sector in 2.0 and fat_boot_sector in 2.1 ... */
struct boot_sector {
uint8_t ignored[3]; /* Boot strap short or near jump */
uint8_t system_id[8]; /* Name - can be used to special case
partition manager volumes */
uint8_t sector_size[2]; /* bytes per logical sector */
uint8_t cluster_size; /* sectors/cluster */
uint16_t reserved; /* reserved sectors */
uint8_t fats; /* number of FATs */
uint8_t dir_entries[2]; /* root directory entries */
uint8_t sectors[2]; /* number of sectors */
uint8_t media; /* media code (unused) */
uint16_t fat_length; /* sectors/FAT */
uint16_t secs_track; /* sectors per track */
uint16_t heads; /* number of heads */
uint32_t hidden; /* hidden sectors (unused) */
uint32_t total_sect; /* number of sectors (if sectors == 0) */
/* The following fields are only used by FAT32 */
uint32_t fat32_length; /* sectors/FAT */
uint16_t flags; /* bit 8: fat mirroring, low 4: active fat */
uint8_t version[2]; /* major, minor filesystem version */
uint32_t root_cluster; /* first cluster in root directory */
uint16_t info_sector; /* filesystem info sector */
uint16_t backup_boot; /* backup boot sector */
uint8_t reserved2[12]; /* Unused */
uint8_t drive_number; /* Logical Drive Number */
uint8_t boot_flags; /* bit 0: dirty, bit 1: need surface test */
uint8_t extended_sig; /* Extended Signature (0x29) */
uint32_t serial; /* Serial number */
uint8_t label[11]; /* FS label */
uint8_t fs_type[8]; /* FS Type */
/* fill up to 512 bytes */
uint8_t junk[422];
} __attribute__ ((packed));
struct boot_sector_16 {
uint8_t ignored[3]; /* Boot strap short or near jump */
uint8_t system_id[8]; /* Name - can be used to special case
partition manager volumes */
uint8_t sector_size[2]; /* bytes per logical sector */
uint8_t cluster_size; /* sectors/cluster */
uint16_t reserved; /* reserved sectors */
uint8_t fats; /* number of FATs */
uint8_t dir_entries[2]; /* root directory entries */
uint8_t sectors[2]; /* number of sectors */
uint8_t media; /* media code (unused) */
uint16_t fat_length; /* sectors/FAT */
uint16_t secs_track; /* sectors per track */
uint16_t heads; /* number of heads */
uint32_t hidden; /* hidden sectors (unused) */
uint32_t total_sect; /* number of sectors (if sectors == 0) */
uint8_t drive_number; /* Logical Drive Number */
uint8_t boot_flags; /* bit 0: dirty, bit 1: need surface test */
uint8_t extended_sig; /* Extended Signature (0x29) */
uint32_t serial; /* Serial number */
uint8_t label[11]; /* FS label */
uint8_t fs_type[8]; /* FS Type */
/* fill up to 512 bytes */
uint8_t junk[450];
} __attribute__ ((packed));
struct info_sector {
uint32_t magic; /* Magic for info sector ('RRaA') */
uint8_t reserved1[480];
uint32_t signature; /* 0x61417272 ('rrAa') */
uint32_t free_clusters; /* Free cluster count. -1 if unknown */
uint32_t next_cluster; /* Most recently allocated cluster. */
uint8_t reserved2[12];
uint32_t boot_sign;
};
typedef struct {
uint8_t name[MSDOS_NAME]; /* name including extension */
uint8_t attr; /* attribute bits */
uint8_t lcase; /* Case for base and extension */
uint8_t ctime_ms; /* Creation time, milliseconds */
uint16_t ctime; /* Creation time */
uint16_t cdate; /* Creation date */
uint16_t adate; /* Last access date */
uint16_t starthi; /* High 16 bits of cluster in FAT32 */
uint16_t time, date, start; /* time, date and first cluster */
uint32_t size; /* file size (in bytes) */
} __attribute__ ((packed)) DIR_ENT;
typedef struct _dos_file {
DIR_ENT dir_ent;
char *lfn;
off_t offset;
off_t lfn_offset;
struct _dos_file *parent; /* parent directory */
struct _dos_file *next; /* next entry */
struct _dos_file *first; /* first entry (directory only) */
} DOS_FILE;
typedef struct {
uint32_t value;
uint32_t reserved;
} FAT_ENTRY;
typedef struct {
int nfats;
off_t fat_start;
unsigned int fat_size; /* unit is bytes */
unsigned int fat_bits; /* size of a FAT entry */
unsigned int eff_fat_bits; /* # of used bits in a FAT entry */
uint32_t root_cluster; /* 0 for old-style root dir */
off_t root_start;
unsigned int root_entries;
off_t data_start;
unsigned int cluster_size;
uint32_t data_clusters; /* not including two reserved cluster numbers */
off_t fsinfo_start; /* 0 if not present */
long free_clusters;
off_t backupboot_start; /* 0 if not present */
unsigned char *fat;
DOS_FILE **cluster_owner;
uint32_t serial;
char label[11];
} DOS_FS;
extern int rw, list, verbose, test, no_spaces_in_sfns;
extern long fat_table;
extern int only_uppercase_label;
extern unsigned n_files;
extern void *mem_queue;
/* value to use as end-of-file marker */
#define FAT_EOF(fs) ((atari_format ? 0xfff : 0xff8) | FAT_EXTD(fs))
#define FAT_IS_EOF(fs,v) ((uint32_t)(v) >= (0xff8|FAT_EXTD(fs)))
/* value to mark bad clusters */
#define FAT_BAD(fs) (0xff7 | FAT_EXTD(fs))
/* range of values used for bad clusters */
#define FAT_MIN_BAD(fs) ((atari_format ? 0xff0 : 0xff7) | FAT_EXTD(fs))
#define FAT_MAX_BAD(fs) ((atari_format ? 0xff7 : 0xff7) | FAT_EXTD(fs))
#define FAT_IS_BAD(fs,v) ((v) >= FAT_MIN_BAD(fs) && (v) <= FAT_MAX_BAD(fs))
/* return -16 as a number with fs->fat_bits bits */
#define FAT_EXTD(fs) (((1 << fs->eff_fat_bits)-1) & ~0xf)
/* marker for files with no 8.3 name */
#define FAT_NO_83NAME 32
#endif
dosfstools-4.2/src/charconv.h 0000644 0001750 0001750 00000002517 14005523510 013242 0000000 0000000 /* charconv.h
Copyright (C) 2010 Alexander Korolkov
Copyright (C) 2018-2020 Pali Rohár
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
#ifndef _CHARCONV_H
#define _CHARCONV_H
#include
#define DEFAULT_DOS_CODEPAGE 850
int set_dos_codepage(int codepage);
int dos_char_to_printable(char **p, unsigned char c, unsigned int out_size);
int local_string_to_dos_string(char *out, char *in, unsigned int out_size);
int dos_string_to_wchar_string(wchar_t *out, char *in, unsigned int out_size);
int wchar_string_to_dos_string(char *out, wchar_t *in, unsigned int out_size);
#endif
dosfstools-4.2/src/charconv.c 0000644 0001750 0001750 00000031627 14005523510 013241 0000000 0000000 /* charconv.c
Copyright (C) 2010 Alexander Korolkov
Copyright (C) 2018-2020 Pali Rohár
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
#include "charconv.h"
#include
#include
#include
#include
#include
#include
#include
#ifdef HAVE_ICONV
#include
#endif
/* CP850 table for 0x80-0xFF range from:
* http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP850.TXT
*/
static const wchar_t cp850_table[128] = {
0x00c7, 0x00fc, 0x00e9, 0x00e2, 0x00e4, 0x00e0, 0x00e5, 0x00e7,
0x00ea, 0x00eb, 0x00e8, 0x00ef, 0x00ee, 0x00ec, 0x00c4, 0x00c5,
0x00c9, 0x00e6, 0x00c6, 0x00f4, 0x00f6, 0x00f2, 0x00fb, 0x00f9,
0x00ff, 0x00d6, 0x00dc, 0x00f8, 0x00a3, 0x00d8, 0x00d7, 0x0192,
0x00e1, 0x00ed, 0x00f3, 0x00fa, 0x00f1, 0x00d1, 0x00aa, 0x00ba,
0x00bf, 0x00ae, 0x00ac, 0x00bd, 0x00bc, 0x00a1, 0x00ab, 0x00bb,
0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00c1, 0x00c2, 0x00c0,
0x00a9, 0x2563, 0x2551, 0x2557, 0x255d, 0x00a2, 0x00a5, 0x2510,
0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0x00e3, 0x00c3,
0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x00a4,
0x00f0, 0x00d0, 0x00ca, 0x00cb, 0x00c8, 0x0131, 0x00cd, 0x00ce,
0x00cf, 0x2518, 0x250c, 0x2588, 0x2584, 0x00a6, 0x00cc, 0x2580,
0x00d3, 0x00df, 0x00d4, 0x00d2, 0x00f5, 0x00d5, 0x00b5, 0x00fe,
0x00de, 0x00da, 0x00db, 0x00d9, 0x00fd, 0x00dd, 0x00af, 0x00b4,
0x00ad, 0x00b1, 0x2017, 0x00be, 0x00b6, 0x00a7, 0x00f7, 0x00b8,
0x00b0, 0x00a8, 0x00b7, 0x00b9, 0x00b3, 0x00b2, 0x25a0, 0x00a0,
};
/* CP850 translit table to 7bit ASCII for 0x80-0xFF range */
static const char *const cp850_translit_table[128] = {
"C", "u", "e", "a", "a", "a", "a", "c",
"e", "e", "e", "i", "i", "i", "A", "A",
"E", "ae", "AE", "o", "o", "o", "u", "u",
"y", "O", "U", "o", "GBP", "O", "x", "f",
"a", "i", "o", "u", "n", "N", "a", "o",
"?", "(R)", "!", " 1/2 ", " 1/4 ", "!", "<<", ">>",
"?", "?", "?", "|", "+", "A", "A", "A",
"(C)", "?", "?", "?", "?", "c", "JPY", "+",
"+", "+", "+", "+", "-", "+", "a", "A",
"?", "?", "?", "?", "?", "?", "?", "?",
"d", "D", "E", "E", "E", "i", "I", "I",
"I", "+", "+", "?", "?", "|", "I", "?",
"O", "ss", "O", "O", "o", "O", "u", "th",
"TH", "U", "U", "U", "y", "Y", "?", "'",
"-", "+-", "?", " 3/4 ", "?", "?", "/", ",",
"?", "?", ".", "1", "3", "2", "?", " ",
};
static int wchar_string_to_cp850_string(char *out, const wchar_t *in, unsigned int out_size)
{
unsigned i, j;
for (i = 0; i < out_size-1 && in[i]; ++i) {
if (in[i] > 0 && in[i] < 0x80) {
out[i] = in[i];
continue;
}
for (j = 0; j < 0x80; ++j) {
if (in[i] == cp850_table[j]) {
out[i] = (0x80 | j);
break;
}
}
if (j == 0x80) {
fprintf(stderr, "Cannot convert input character 0x%04x to 'CP850': %s\n", (unsigned int)in[i], strerror(EILSEQ));
return 0;
}
}
if (in[i]) {
fprintf(stderr, "Cannot convert input string to 'CP850': String is too long\n");
return 0;
}
out[i] = 0;
return 1;
}
static int cp850_string_to_wchar_string(wchar_t *out, const char *in, unsigned int out_size)
{
unsigned i;
for (i = 0; i < out_size-1 && i < 11 && in[i]; ++i) {
out[i] = (in[i] & 0x80) ? cp850_table[in[i] & 0x7F] : in[i];
}
if (i < 11 && in[i]) {
fprintf(stderr, "Cannot convert input string to 'CP850': String is too long\n");
return 0;
}
out[i] = L'\0';
return 1;
}
static int cp850_char_to_printable(char **p, unsigned char c, unsigned int out_size)
{
size_t ret;
wchar_t wcs[2];
wcs[0] = (c & 0x80) ? cp850_table[c & 0x7F] : c;
wcs[1] = 0;
ret = wcstombs(*p, wcs, out_size);
if (ret == 0)
return 0;
if (ret != (size_t)-1)
*p += ret;
else if (!(c & 0x80))
*(*p++) = c;
else {
ret = strlen(cp850_translit_table[c & 0x7F]);
if (ret > out_size)
return 0;
memcpy(*p, cp850_translit_table[c & 0x7F], ret);
*p += ret;
}
return 1;
}
static int local_string_to_cp850_string(char *out, const char *in, unsigned int out_size)
{
int ret;
wchar_t *wcs;
if (strlen(in) >= out_size) {
fprintf(stderr, "Cannot convert input string '%s' to 'CP850': String is too long\n", in);
return 0;
}
wcs = calloc(out_size, sizeof(wchar_t));
if (!wcs) {
fprintf(stderr, "Cannot convert input string '%s' to 'CP850': %s\n", in, strerror(ENOMEM));
return 0;
}
if (mbstowcs(wcs, in, out_size) == (size_t)-1) {
fprintf(stderr, "Cannot convert input string '%s' to 'CP850': %s\n", in, strerror(errno));
free(wcs);
return 0;
}
ret = wchar_string_to_cp850_string(out, wcs, out_size);
free(wcs);
return ret;
}
#ifdef HAVE_ICONV
static int iconv_init_codepage(int codepage, const char *local, iconv_t *to_local, iconv_t *from_local)
{
char codepage_name[32];
snprintf(codepage_name, sizeof(codepage_name), "CP%d//TRANSLIT", codepage);
*to_local = iconv_open(local, codepage_name);
if (*to_local == (iconv_t) - 1) {
snprintf(codepage_name, sizeof(codepage_name), "CP%d", codepage);
*to_local = iconv_open(local, codepage_name);
}
if (*to_local == (iconv_t) - 1)
fprintf(stderr, "Cannot initialize conversion from codepage %d to %s: %s\n", codepage, local, strerror(errno));
snprintf(codepage_name, sizeof(codepage_name), "CP%d", codepage);
*from_local = iconv_open(codepage_name, local);
if (*from_local == (iconv_t) - 1)
fprintf(stderr, "Cannot initialize conversion from %s to codepage %d: %s\n", local, codepage, strerror(errno));
return (*to_local != (iconv_t)-1 && *from_local != (iconv_t)-1) ? 1 : 0;
}
static iconv_t dos_to_local;
static iconv_t local_to_dos;
static iconv_t dos_to_wchar;
static iconv_t wchar_to_dos;
static int used_codepage;
static int internal_cp850;
/*
* Initialize conversion from codepage.
* codepage = -1 means default codepage.
* Returns non-zero on success, 0 on failure
*/
static int init_conversion(int codepage)
{
static int initialized = -1;
if (initialized < 0) {
initialized = 1;
if (codepage < 0)
codepage = DEFAULT_DOS_CODEPAGE;
setlocale(LC_CTYPE, ""); /* initialize locale for CODESET */
if (!iconv_init_codepage(codepage, nl_langinfo(CODESET), &dos_to_local, &local_to_dos))
initialized = 0;
if (initialized && !iconv_init_codepage(codepage, "WCHAR_T", &dos_to_wchar, &wchar_to_dos))
initialized = 0;
if (!initialized && codepage == 850) {
fprintf(stderr, "Using internal CP850 conversion table\n");
internal_cp850 = 1; /* use internal CP850 conversion table */
initialized = 1;
}
if (initialized)
used_codepage = codepage;
}
return initialized;
}
int set_dos_codepage(int codepage)
{
return init_conversion(codepage);
}
int dos_char_to_printable(char **p, unsigned char c, unsigned int out_size)
{
char in[1] = { c };
ICONV_CONST char *pin = in;
size_t bytes_in = 1;
size_t bytes_out = out_size;
if (!init_conversion(-1))
return 0;
if (internal_cp850)
return cp850_char_to_printable(p, c, out_size);
return iconv(dos_to_local, &pin, &bytes_in, p, &bytes_out) != (size_t)-1;
}
int local_string_to_dos_string(char *out, char *in, unsigned int out_size)
{
ICONV_CONST char *pin = in;
char *pout = out;
size_t bytes_in = strlen(in);
size_t bytes_out = out_size-1;
size_t ret;
if (!init_conversion(-1))
return 0;
if (internal_cp850)
return local_string_to_cp850_string(out, in, out_size);
ret = iconv(local_to_dos, &pin, &bytes_in, &pout, &bytes_out);
if (ret == (size_t)-1) {
if (errno == E2BIG)
fprintf(stderr, "Cannot convert input string '%s' to 'CP%d': String is too long\n",
in, used_codepage);
else
fprintf(stderr, "Cannot convert input sequence '\\x%.02hhX' from codeset '%s' to 'CP%d': %s\n",
*pin, nl_langinfo(CODESET), used_codepage, strerror(errno));
iconv(local_to_dos, NULL, NULL, &pout, &bytes_out);
return 0;
} else {
ret = iconv(local_to_dos, NULL, NULL, &pout, &bytes_out);
if (ret == (size_t)-1) {
fprintf(stderr, "Cannot convert input string '%s' to 'CP%d': String is too long\n",
in, used_codepage);
return 0;
}
}
out[out_size-1-bytes_out] = 0;
return 1;
}
int dos_string_to_wchar_string(wchar_t *out, char *in, unsigned int out_size)
{
ICONV_CONST char *pin = in;
char *pout = (char *)out;
size_t bytes_in = strnlen(in, 11);
size_t bytes_out = out_size-sizeof(wchar_t);
size_t ret;
if (!init_conversion(-1))
return 0;
if (internal_cp850)
return cp850_string_to_wchar_string(out, in, out_size);
ret = iconv(dos_to_wchar, &pin, &bytes_in, &pout, &bytes_out);
if (ret == (size_t)-1) {
if (errno == E2BIG)
fprintf(stderr, "Cannot convert input string from 'CP%d': String is too long\n",
used_codepage);
else
fprintf(stderr, "Cannot convert input sequence '\\x%.02hhX' from 'CP%d': %s\n",
*pin, used_codepage, strerror(errno));
iconv(dos_to_wchar, NULL, NULL, &pout, &bytes_out);
return 0;
} else {
ret = iconv(dos_to_wchar, NULL, NULL, &pout, &bytes_out);
if (ret == (size_t)-1) {
fprintf(stderr, "Cannot convert input string from 'CP%d': String is too long\n",
used_codepage);
return 0;
}
}
out[(out_size-sizeof(wchar_t)-bytes_out)/sizeof(wchar_t)] = L'\0';
return 1;
}
int wchar_string_to_dos_string(char *out, wchar_t *in, unsigned int out_size)
{
ICONV_CONST char *pin = (char *)in;
char *pout = out;
size_t bytes_in = wcslen(in)*sizeof(wchar_t);
size_t bytes_out = out_size-1;
size_t ret;
if (!init_conversion(-1))
return 0;
if (internal_cp850)
return wchar_string_to_cp850_string(out, in, out_size);
ret = iconv(wchar_to_dos, &pin, &bytes_in, &pout, &bytes_out);
if (ret == (size_t)-1) {
if (errno == E2BIG)
fprintf(stderr, "Cannot convert input string '%ls' to 'CP%d': String is too long\n",
in, used_codepage);
else
fprintf(stderr, "Cannot convert input character '%lc' to 'CP%d': %s\n",
(wint_t)*(wchar_t *)pin, used_codepage, strerror(errno));
iconv(wchar_to_dos, NULL, NULL, &pout, &bytes_out);
return 0;
} else {
ret = iconv(wchar_to_dos, NULL, NULL, &pout, &bytes_out);
if (ret == (size_t)-1) {
fprintf(stderr, "Cannot convert input string '%ls' to 'CP%d': String is too long\n",
in, used_codepage);
return 0;
}
}
out[out_size-1-bytes_out] = 0;
return 1;
}
#else
int set_dos_codepage(int codepage)
{
static int initialized = -1;
if (initialized < 0) {
setlocale(LC_CTYPE, ""); /* initialize locale for wide character functions */
if (codepage < 0)
codepage = DEFAULT_DOS_CODEPAGE;
initialized = (codepage == 850) ? 1 : 0;
if (!initialized)
fprintf(stderr, "Cannot initialize unsupported codepage %d, only codepage 850 is supported\n", codepage);
}
return initialized;
}
int dos_char_to_printable(char **p, unsigned char c, unsigned int out_size)
{
return cp850_char_to_printable(p, c, out_size);
}
int local_string_to_dos_string(char *out, char *in, unsigned int out_size)
{
return local_string_to_cp850_string(out, in, out_size);
}
int dos_string_to_wchar_string(wchar_t *out, char *in, unsigned int out_size)
{
return cp850_string_to_wchar_string(out, in, out_size);
}
int wchar_string_to_dos_string(char *out, wchar_t *in, unsigned int out_size)
{
return wchar_string_to_cp850_string(out, in, out_size);
}
#endif
dosfstools-4.2/src/msdos_fs.h 0000644 0001750 0001750 00000004543 14005523510 013255 0000000 0000000 /* msdos_fs.h - MS-DOS filesystem constants/structures
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
#ifndef _MSDOS_FS_H
#define _MSDOS_FS_H
#include
#define SECTOR_SIZE 512 /* sector size (bytes) */
#define MSDOS_DPS (SECTOR_SIZE / sizeof(struct msdos_dir_entry))
#define MSDOS_DPS_BITS 4 /* log2(MSDOS_DPS) */
#define MSDOS_DIR_BITS 5 /* log2(sizeof(struct msdos_dir_entry)) */
#define ATTR_NONE 0 /* no attribute bits */
#define ATTR_RO 1 /* read-only */
#define ATTR_HIDDEN 2 /* hidden */
#define ATTR_SYS 4 /* system */
#define ATTR_VOLUME 8 /* volume label */
#define ATTR_DIR 16 /* directory */
#define ATTR_ARCH 32 /* archived */
/* attribute bits that are copied "as is" */
#define ATTR_UNUSED (ATTR_VOLUME | ATTR_ARCH | ATTR_SYS | ATTR_HIDDEN)
#define DELETED_FLAG 0xe5 /* marks file as deleted when in name[0] */
#define IS_FREE(n) (!*(n) || *(n) == DELETED_FLAG)
#define MSDOS_NAME 11 /* maximum name length */
#define MSDOS_DOT ". " /* ".", padded to MSDOS_NAME chars */
#define MSDOS_DOTDOT ".. " /* "..", padded to MSDOS_NAME chars */
struct msdos_dir_entry {
uint8_t name[MSDOS_NAME]; /* name including extension */
uint8_t attr; /* attribute bits */
uint8_t lcase; /* Case for base and extension */
uint8_t ctime_cs; /* Creation time, centiseconds (0-199) */
uint16_t ctime; /* Creation time */
uint16_t cdate; /* Creation date */
uint16_t adate; /* Last access date */
uint16_t starthi; /* High 16 bits of cluster in FAT32 */
uint16_t time, date, start; /* time, date and first cluster */
uint32_t size; /* file size (in bytes) */
} __attribute__ ((packed));
#endif /* _MSDOS_FS_H */
dosfstools-4.2/src/io.h 0000644 0001750 0001750 00000004301 14005523510 012037 0000000 0000000 /* io.h - Virtual disk input/output
Copyright (C) 1993 Werner Almesberger
Copyright (C) 1998 Roman Hodek
Copyright (C) 2008-2014 Daniel Baumann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
/* FAT32, VFAT, Atari format support, and various fixes additions May 1998
* by Roman Hodek */
#ifndef _IO_H
#define _IO_H
#include /* for off_t */
void fs_open(const char *path, int rw);
/* Opens the filesystem PATH. If RW is zero, the filesystem is opened
read-only, otherwise, it is opened read-write. */
void fs_read(off_t pos, int size, void *data);
/* Reads SIZE bytes starting at POS into DATA. Performs all applicable
changes. */
int fs_test(off_t pos, int size);
/* Returns a non-zero integer if SIZE bytes starting at POS can be read without
errors. Otherwise, it returns zero. */
void fs_write(off_t pos, int size, void *data);
/* If write_immed is non-zero, SIZE bytes are written from DATA to the disk,
starting at POS. If write_immed is zero, the change is added to a list in
memory. */
int fs_close(int write);
/* Closes the filesystem, performs all pending changes if WRITE is non-zero
and removes the list of changes. Returns a non-zero integer if the file
system has been changed since the last fs_open, zero otherwise. */
int fs_changed(void);
/* Determines whether the filesystem has changed. See fs_close. */
#endif
dosfstools-4.2/src/io.c 0000644 0001750 0001750 00000011607 14005523510 012041 0000000 0000000 /* io.c - Virtual disk input/output
Copyright (C) 1993 Werner Almesberger
Copyright (C) 1998 Roman Hodek
Copyright (C) 2008-2014 Daniel Baumann
Copyright (C) 2015 Andreas Bombe
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
/*
* Thu Feb 26 01:15:36 CET 1998: Martin Schulze
* Fixed nasty bug that caused every file with a name like
* xxxxxxxx.xxx to be treated as bad name that needed to be fixed.
*/
/* FAT32, VFAT, Atari format support, and various fixes additions May 1998
* by Roman Hodek */
#define _LARGEFILE64_SOURCE
#include
#include
#include
#include
#include
#include
#include
#include
#include "fsck.fat.h"
#include "common.h"
#include "io.h"
typedef struct _change {
void *data;
off_t pos;
int size;
struct _change *next;
} CHANGE;
static CHANGE *changes, *last;
static int fd, did_change = 0;
void fs_open(const char *path, int rw)
{
if ((fd = open(path, rw ? O_RDWR : O_RDONLY)) < 0) {
perror("open");
exit(6);
}
changes = last = NULL;
did_change = 0;
}
/**
* Read data from the partition, accounting for any pending updates that are
* queued for writing.
*
* @param[in] pos Byte offset, relative to the beginning of the partition,
* at which to read
* @param[in] size Number of bytes to read
* @param[out] data Where to put the data read
*/
void fs_read(off_t pos, int size, void *data)
{
CHANGE *walk;
int got;
if (lseek(fd, pos, 0) != pos)
pdie("Seek to %lld", (long long)pos);
if ((got = read(fd, data, size)) < 0)
pdie("Read %d bytes at %lld", size, (long long)pos);
if (got != size)
die("Got %d bytes instead of %d at %lld", got, size, (long long)pos);
for (walk = changes; walk; walk = walk->next) {
if (walk->pos < pos + size && walk->pos + walk->size > pos) {
if (walk->pos < pos)
memcpy(data, (char *)walk->data + pos - walk->pos,
min(size, walk->size - pos + walk->pos));
else
memcpy((char *)data + walk->pos - pos, walk->data,
min(walk->size, size + pos - walk->pos));
}
}
}
int fs_test(off_t pos, int size)
{
void *scratch;
int okay;
if (lseek(fd, pos, 0) != pos)
pdie("Seek to %lld", (long long)pos);
scratch = alloc(size);
okay = read(fd, scratch, size) == size;
free(scratch);
return okay;
}
void fs_write(off_t pos, int size, void *data)
{
CHANGE *new;
int did;
if (write_immed) {
did_change = 1;
if (lseek(fd, pos, 0) != pos)
pdie("Seek to %lld", (long long)pos);
if ((did = write(fd, data, size)) == size)
return;
if (did < 0)
pdie("Write %d bytes at %lld", size, (long long)pos);
die("Wrote %d bytes instead of %d at %lld", did, size, (long long)pos);
}
new = alloc(sizeof(CHANGE));
new->pos = pos;
memcpy(new->data = alloc(new->size = size), data, size);
new->next = NULL;
if (last)
last->next = new;
else
changes = new;
last = new;
}
static void fs_flush(void)
{
CHANGE *this;
int size;
while (changes) {
this = changes;
changes = changes->next;
if (lseek(fd, this->pos, 0) != this->pos)
fprintf(stderr,
"Seek to %lld failed: %s\n Did not write %d bytes.\n",
(long long)this->pos, strerror(errno), this->size);
else if ((size = write(fd, this->data, this->size)) < 0)
fprintf(stderr, "Writing %d bytes at %lld failed: %s\n", this->size,
(long long)this->pos, strerror(errno));
else if (size != this->size)
fprintf(stderr, "Wrote %d bytes instead of %d bytes at %lld."
"\n", size, this->size, (long long)this->pos);
free(this->data);
free(this);
}
}
int fs_close(int write)
{
CHANGE *next;
int changed;
changed = ! !changes;
if (write)
fs_flush();
else
while (changes) {
next = changes->next;
free(changes->data);
free(changes);
changes = next;
}
if (close(fd) < 0)
pdie("closing filesystem");
return changed || did_change;
}
int fs_changed(void)
{
return ! !changes || did_change;
}
dosfstools-4.2/src/fat.h 0000644 0001750 0001750 00000006057 14005523510 012214 0000000 0000000 /* fat.h - Read/write access to the FAT
Copyright (C) 1993 Werner Almesberger
Copyright (C) 2008-2014 Daniel Baumann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
THe complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
#ifndef _FAT_H
#define _FAT_H
void read_fat(DOS_FS * fs, int mode);
/* Loads the FAT of the filesystem described by FS. Initializes the FAT,
replaces broken FATs and rejects invalid cluster entries. */
void release_fat(DOS_FS * fs);
/* Release the FAT of the filesystem described by FS and free allocated memory.
Call it after finish work with FAT. */
void get_fat(FAT_ENTRY * entry, void *fat, uint32_t cluster, DOS_FS * fs);
/* Retrieve the FAT entry (next chained cluster) for CLUSTER. */
void set_fat(DOS_FS * fs, uint32_t cluster, int32_t new);
/* Changes the value of the CLUSTERth cluster of the FAT of FS to NEW. Special
values of NEW are -1 (EOF, 0xff8 or 0xfff8) and -2 (bad sector, 0xff7 or
0xfff7) */
int bad_cluster(DOS_FS * fs, uint32_t cluster);
/* Returns a non-zero integer if the CLUSTERth cluster is marked as bad or zero
otherwise. */
uint32_t next_cluster(DOS_FS * fs, uint32_t cluster);
/* Returns the number of the cluster following CLUSTER, or -1 if this is the
last cluster of the respective cluster chain. CLUSTER must not be a bad
cluster. */
off_t cluster_start(DOS_FS * fs, uint32_t cluster);
/* Returns the byte offset of CLUSTER, relative to the respective device. */
void set_owner(DOS_FS * fs, uint32_t cluster, DOS_FILE * owner);
/* Sets the owner pointer of the respective cluster to OWNER. If OWNER was NULL
before, it can be set to NULL or any non-NULL value. Otherwise, only NULL is
accepted as the new value. */
DOS_FILE *get_owner(DOS_FS * fs, uint32_t cluster);
/* Returns the owner of the repective cluster or NULL if the cluster has no
owner. */
void fix_bad(DOS_FS * fs);
/* Scans the disk for currently unused bad clusters and marks them as bad. */
void reclaim_free(DOS_FS * fs);
/* Marks all allocated, but unused clusters as free. */
void reclaim_file(DOS_FS * fs);
/* Scans the FAT for chains of allocated, but unused clusters and creates files
for them in the root directory. Also tries to fix all inconsistencies (e.g.
loops, shared clusters, etc.) in the process. */
uint32_t update_free(DOS_FS * fs);
/* Updates free cluster count in FSINFO sector. */
#endif
dosfstools-4.2/src/fat.c 0000644 0001750 0001750 00000046507 14005523510 012213 0000000 0000000 /* fat.c - Read/write access to the FAT
Copyright (C) 1993 Werner Almesberger
Copyright (C) 1998 Roman Hodek
Copyright (C) 2008-2014 Daniel Baumann
Copyright (C) 2021 Pali Rohár
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
/* FAT32, VFAT, Atari format support, and various fixes additions May 1998
* by Roman Hodek */
#include
#include
#include
#include
#include "common.h"
#include "fsck.fat.h"
#include "io.h"
#include "boot.h"
#include "check.h"
#include "fat.h"
/**
* Fetch the FAT entry for a specified cluster.
*
* @param[out] entry Cluster to which cluster of interest is linked
* @param[in] fat FAT table for the partition
* @param[in] cluster Cluster of interest
* @param[in] fs Information from the FAT boot sectors (bits per FAT entry)
*/
void get_fat(FAT_ENTRY * entry, void *fat, uint32_t cluster, DOS_FS * fs)
{
unsigned char *ptr;
if (cluster > fs->data_clusters + 1) {
die("Internal error: cluster out of range in get_fat() (%lu > %lu).",
(unsigned long)cluster, (unsigned long)(fs->data_clusters + 1));
}
switch (fs->fat_bits) {
case 12:
ptr = &((unsigned char *)fat)[cluster * 3 / 2];
entry->value = 0xfff & (cluster & 1 ? (ptr[0] >> 4) | (ptr[1] << 4) :
(ptr[0] | ptr[1] << 8));
break;
case 16:
entry->value = le16toh(((unsigned short *)fat)[cluster]);
break;
case 32:
/* According to M$, the high 4 bits of a FAT32 entry are reserved and
* are not part of the cluster number. So we cut them off. */
{
uint32_t e = le32toh(((unsigned int *)fat)[cluster]);
entry->value = e & 0xfffffff;
entry->reserved = e >> 28;
}
break;
default:
die("Bad FAT entry size: %d bits.", fs->fat_bits);
}
}
void release_fat(DOS_FS * fs)
{
if (fs->fat)
free(fs->fat);
if (fs->cluster_owner)
free(fs->cluster_owner);
fs->fat = NULL;
fs->cluster_owner = NULL;
}
static void fix_first_cluster(DOS_FS * fs, void * first_cluster)
{
struct boot_sector b;
fs_read(0, sizeof(b), &b);
printf("Fixing first cluster in FAT.\n");
if (fs->fat_bits == 12)
*(uint16_t *)first_cluster = htole16((le16toh(*(uint16_t *)first_cluster) & 0xf000) | FAT_EXTD(fs) | b.media);
else if (fs->fat_bits == 16)
*(uint16_t *)first_cluster = htole16(FAT_EXTD(fs) | b.media);
else
*(uint32_t *)first_cluster = htole32(FAT_EXTD(fs) | b.media);
}
/**
* Build a bookkeeping structure from the partition's FAT table.
* If the partition has multiple FATs and they don't agree, try to pick a winner,
* and queue a command to overwrite the loser.
* One error that is fixed here is a cluster that links to something out of range.
*
* @param[inout] fs Information about the filesystem
* @param[in] mode 0 - read-only, 1 - read-write (no repair), 2 - repair
*/
void read_fat(DOS_FS * fs, int mode)
{
int eff_size, alloc_size;
uint32_t i;
void *first, *second = NULL;
int first_ok, second_ok = 0;
FAT_ENTRY first_media, second_media;
uint32_t total_num_clusters;
if (fat_table > fs->nfats)
die("Requested FAT table %ld does not exist.", fat_table);
if (fat_table > 2)
die("Reading FAT table greather than 2 is implemented yet.");
/* Clean up from previous pass */
release_fat(fs);
total_num_clusters = fs->data_clusters + 2;
eff_size = (total_num_clusters * fs->fat_bits + 7) / 8ULL;
if (fs->fat_bits != 12)
alloc_size = eff_size;
else
/* round up to an even number of FAT entries to avoid special
* casing the last entry in get_fat() */
alloc_size = (total_num_clusters * 12 + 23) / 24 * 3;
first = alloc(alloc_size);
fs_read(fs->fat_start, eff_size, first);
get_fat(&first_media, first, 0, fs);
first_ok = (first_media.value & FAT_EXTD(fs)) == FAT_EXTD(fs);
if (fs->nfats > 1) {
second = alloc(alloc_size);
fs_read(fs->fat_start + fs->fat_size, eff_size, second);
get_fat(&second_media, second, 0, fs);
second_ok = (second_media.value & FAT_EXTD(fs)) == FAT_EXTD(fs);
}
if (mode != 0 && fat_table == 0) {
if (!first_ok && second && !second_ok)
die("Both FATs appear to be corrupt. Giving up. Run fsck.fat with non-zero -F option.");
if (!first_ok && !second)
die("First FAT appears to be corrupt and second FAT does not exist. Giving up. Run fsck.fat with -F 1 option.");
}
if (mode == 0 && !first_ok && second && second_ok) {
/* In read-only mode if first FAT is corrupted and second is OK then use second FAT */
void *first_backup = first;
first = second;
second = first_backup;
}
if (mode != 0 && fat_table == 0 && second && memcmp(first, second, eff_size) != 0) {
if (mode != 2)
die("FATs differ, please run fsck.fat");
if (first_ok && !second_ok) {
printf("FATs differ - using first FAT.\n");
fs_write(fs->fat_start + fs->fat_size, eff_size, first);
} else if (!first_ok && second_ok) {
printf("FATs differ - using second FAT.\n");
fs_write(fs->fat_start, eff_size, second);
memcpy(first, second, eff_size);
} else {
if (first_ok && second_ok)
printf("FATs differ but appear to be intact.\n");
else
printf("FATs differ and both appear to be corrupt.\n");
if (get_choice(1, " Using first FAT.",
2,
1, "Use first FAT",
2, "Use second FAT") == 1) {
if (!first_ok) {
fix_first_cluster(fs, first);
fs_write(fs->fat_start, (fs->fat_bits + 7) / 8, first);
}
fs_write(fs->fat_start + fs->fat_size, eff_size, first);
} else {
if (!second_ok) {
fix_first_cluster(fs, second);
fs_write(fs->fat_start + fs->fat_size, (fs->fat_bits + 7) / 8, second);
}
fs_write(fs->fat_start, eff_size, second);
memcpy(first, second, eff_size);
}
}
}
if (mode != 0 && fat_table != 0) {
if (fat_table == 1) {
printf("Using first FAT.\n");
if (!first_ok) {
fix_first_cluster(fs, first);
fs_write(fs->fat_start, (fs->fat_bits + 7) / 8, first);
}
if (second && memcmp(first, second, eff_size) != 0)
fs_write(fs->fat_start + fs->fat_size, eff_size, first);
} else if (fat_table == 2) {
printf("Using second FAT.\n");
if (!second_ok) {
fix_first_cluster(fs, second);
fs_write(fs->fat_start + fs->fat_size, (fs->fat_bits + 7) / 8, second);
}
if (memcmp(first, second, eff_size) != 0) {
fs_write(fs->fat_start, eff_size, second);
memcpy(first, second, eff_size);
}
}
}
if (second) {
free(second);
}
fs->fat = (unsigned char *)first;
fs->cluster_owner = alloc(total_num_clusters * sizeof(DOS_FILE *));
memset(fs->cluster_owner, 0, (total_num_clusters * sizeof(DOS_FILE *)));
if (mode == 0)
return;
/* Truncate any cluster chains that link to something out of range */
for (i = 2; i < fs->data_clusters + 2; i++) {
FAT_ENTRY curEntry;
get_fat(&curEntry, fs->fat, i, fs);
if (curEntry.value == 1) {
if (mode != 2)
die("Cluster %ld out of range (1), please run fsck.fat",
(long)(i - 2));
printf("Cluster %ld out of range (1). Setting to EOF.\n",
(long)(i - 2));
set_fat(fs, i, -1);
}
if (curEntry.value >= fs->data_clusters + 2 &&
(curEntry.value < FAT_MIN_BAD(fs))) {
if (mode != 2)
die("Cluster %ld out of range (%ld > %ld), please run fsck.fat",
(long)(i - 2), (long)curEntry.value,
(long)(fs->data_clusters + 2 - 1));
printf("Cluster %ld out of range (%ld > %ld). Setting to EOF.\n",
(long)(i - 2), (long)curEntry.value,
(long)(fs->data_clusters + 2 - 1));
set_fat(fs, i, -1);
}
}
}
/**
* Update the FAT entry for a specified cluster
* (i.e., change the cluster it links to).
* Queue a command to write out this change.
*
* @param[in,out] fs Information about the filesystem
* @param[in] cluster Cluster to change
* @param[in] new Cluster to link to
* Special values:
* 0 == free cluster
* -1 == end-of-chain
* -2 == bad cluster
*/
void set_fat(DOS_FS * fs, uint32_t cluster, int32_t new)
{
unsigned char *data = NULL;
int size;
off_t offs;
if (cluster > fs->data_clusters + 1) {
die("Internal error: cluster out of range in set_fat() (%lu > %lu).",
(unsigned long)cluster, (unsigned long)(fs->data_clusters + 1));
}
if (new == -1)
new = FAT_EOF(fs);
else if ((long)new == -2)
new = FAT_BAD(fs);
else if (new > fs->data_clusters + 1) {
die("Internal error: new cluster out of range in set_fat() (%lu > %lu).",
(unsigned long)new, (unsigned long)(fs->data_clusters + 1));
}
switch (fs->fat_bits) {
case 12:
data = fs->fat + cluster * 3 / 2;
offs = fs->fat_start + cluster * 3 / 2;
if (cluster & 1) {
FAT_ENTRY prevEntry;
get_fat(&prevEntry, fs->fat, cluster - 1, fs);
data[0] = ((new & 0xf) << 4) | (prevEntry.value >> 8);
data[1] = new >> 4;
} else {
FAT_ENTRY subseqEntry;
if (cluster != fs->data_clusters + 1)
get_fat(&subseqEntry, fs->fat, cluster + 1, fs);
else
subseqEntry.value = 0;
data[0] = new & 0xff;
data[1] = (new >> 8) | ((0xff & subseqEntry.value) << 4);
}
size = 2;
break;
case 16:
data = fs->fat + cluster * 2;
offs = fs->fat_start + cluster * 2;
*(unsigned short *)data = htole16(new);
size = 2;
break;
case 32:
{
FAT_ENTRY curEntry;
get_fat(&curEntry, fs->fat, cluster, fs);
data = fs->fat + cluster * 4;
offs = fs->fat_start + cluster * 4;
/* According to M$, the high 4 bits of a FAT32 entry are reserved and
* are not part of the cluster number. So we never touch them. */
*(uint32_t *)data = htole32((new & 0xfffffff) |
(curEntry.reserved << 28));
size = 4;
}
break;
default:
die("Bad FAT entry size: %d bits.", fs->fat_bits);
}
fs_write(offs, size, data);
if (fs->nfats > 1) {
fs_write(offs + fs->fat_size, size, data);
}
}
int bad_cluster(DOS_FS * fs, uint32_t cluster)
{
FAT_ENTRY curEntry;
get_fat(&curEntry, fs->fat, cluster, fs);
return FAT_IS_BAD(fs, curEntry.value);
}
/**
* Get the cluster to which the specified cluster is linked.
* If the linked cluster is marked bad, abort.
*
* @param[in] fs Information about the filesystem
* @param[in] cluster Cluster to follow
*
* @return -1 'cluster' is at the end of the chain
* @return Other values Next cluster in this chain
*/
uint32_t next_cluster(DOS_FS * fs, uint32_t cluster)
{
uint32_t value;
FAT_ENTRY curEntry;
get_fat(&curEntry, fs->fat, cluster, fs);
value = curEntry.value;
if (FAT_IS_BAD(fs, value))
die("Internal error: next_cluster on bad cluster");
return FAT_IS_EOF(fs, value) ? -1 : value;
}
off_t cluster_start(DOS_FS * fs, uint32_t cluster)
{
/* TODO: check overflow */
return fs->data_start + ((off_t)cluster - 2) * (unsigned long long)fs->cluster_size;
}
/**
* Update internal bookkeeping to show that the specified cluster belongs
* to the specified dentry.
*
* @param[in,out] fs Information about the filesystem
* @param[in] cluster Cluster being assigned
* @param[in] owner Information on dentry that owns this cluster
* (may be NULL)
*/
void set_owner(DOS_FS * fs, uint32_t cluster, DOS_FILE * owner)
{
if (fs->cluster_owner == NULL)
die("Internal error: attempt to set owner in non-existent table");
if (owner && fs->cluster_owner[cluster]
&& (fs->cluster_owner[cluster] != owner))
die("Internal error: attempt to change file owner");
fs->cluster_owner[cluster] = owner;
}
DOS_FILE *get_owner(DOS_FS * fs, uint32_t cluster)
{
if (fs->cluster_owner == NULL)
return NULL;
else
return fs->cluster_owner[cluster];
}
void fix_bad(DOS_FS * fs)
{
uint32_t i;
if (verbose)
printf("Checking for bad clusters.\n");
for (i = 2; i < fs->data_clusters + 2; i++) {
FAT_ENTRY curEntry;
get_fat(&curEntry, fs->fat, i, fs);
if (!get_owner(fs, i) && !FAT_IS_BAD(fs, curEntry.value))
if (!fs_test(cluster_start(fs, i), fs->cluster_size)) {
printf("Cluster %lu is unreadable.\n", (unsigned long)i);
set_fat(fs, i, -2);
}
}
}
void reclaim_free(DOS_FS * fs)
{
int reclaimed;
uint32_t i;
if (verbose)
printf("Checking for unused clusters.\n");
reclaimed = 0;
for (i = 2; i < fs->data_clusters + 2; i++) {
FAT_ENTRY curEntry;
get_fat(&curEntry, fs->fat, i, fs);
if (!get_owner(fs, i) && curEntry.value &&
!FAT_IS_BAD(fs, curEntry.value)) {
set_fat(fs, i, 0);
reclaimed++;
}
}
if (reclaimed)
printf("Reclaimed %d unused cluster%s (%llu bytes).\n", (int)reclaimed,
reclaimed == 1 ? "" : "s",
(unsigned long long)reclaimed * fs->cluster_size);
}
/**
* Assign the specified owner to all orphan chains (except cycles).
* Break cross-links between orphan chains.
*
* @param[in,out] fs Information about the filesystem
* @param[in] owner dentry to be assigned ownership of orphans
* @param[in,out] num_refs For each orphan cluster [index], how many
* clusters link to it.
* @param[in] start_cluster Where to start scanning for orphans
*/
static void tag_free(DOS_FS * fs, DOS_FILE * owner, uint32_t *num_refs,
uint32_t start_cluster)
{
int prev;
uint32_t i, walk;
if (start_cluster == 0)
start_cluster = 2;
for (i = start_cluster; i < fs->data_clusters + 2; i++) {
FAT_ENTRY curEntry;
get_fat(&curEntry, fs->fat, i, fs);
/* If the current entry is the head of an un-owned chain... */
if (curEntry.value && !FAT_IS_BAD(fs, curEntry.value) &&
!get_owner(fs, i) && !num_refs[i]) {
prev = 0;
/* Walk the chain, claiming ownership as we go */
for (walk = i; walk != -1; walk = next_cluster(fs, walk)) {
if (!get_owner(fs, walk)) {
set_owner(fs, walk, owner);
} else {
/* We've run into cross-links between orphaned chains,
* or a cycle with a tail.
* Terminate this orphan chain (break the link)
*/
set_fat(fs, prev, -1);
/* This is not necessary because 'walk' is owned and thus
* will never become the head of a chain (the only case
* that would matter during reclaim to files).
* It's easier to decrement than to prove that it's
* unnecessary.
*/
num_refs[walk]--;
break;
}
prev = walk;
}
}
}
}
/**
* Recover orphan chains to files, handling any cycles or cross-links.
*
* @param[in,out] fs Information about the filesystem
*/
void reclaim_file(DOS_FS * fs)
{
DOS_FILE orphan;
int reclaimed, files;
int changed = 0;
uint32_t i, next, walk;
uint32_t *num_refs = NULL; /* Only for orphaned clusters */
uint32_t total_num_clusters;
if (verbose)
printf("Reclaiming unconnected clusters.\n");
total_num_clusters = fs->data_clusters + 2;
num_refs = alloc(total_num_clusters * sizeof(uint32_t));
memset(num_refs, 0, (total_num_clusters * sizeof(uint32_t)));
/* Guarantee that all orphan chains (except cycles) end cleanly
* with an end-of-chain mark.
*/
for (i = 2; i < total_num_clusters; i++) {
FAT_ENTRY curEntry;
get_fat(&curEntry, fs->fat, i, fs);
next = curEntry.value;
if (!get_owner(fs, i) && next && next < fs->data_clusters + 2) {
/* Cluster is linked, but not owned (orphan) */
FAT_ENTRY nextEntry;
get_fat(&nextEntry, fs->fat, next, fs);
/* Mark it end-of-chain if it links into an owned cluster,
* a free cluster, or a bad cluster.
*/
if (get_owner(fs, next) || !nextEntry.value ||
FAT_IS_BAD(fs, nextEntry.value))
set_fat(fs, i, -1);
else
num_refs[next]++;
}
}
/* Scan until all the orphans are accounted for,
* and all cycles and cross-links are broken
*/
do {
tag_free(fs, &orphan, num_refs, changed);
changed = 0;
/* Any unaccounted-for orphans must be part of a cycle */
for (i = 2; i < total_num_clusters; i++) {
FAT_ENTRY curEntry;
get_fat(&curEntry, fs->fat, i, fs);
if (curEntry.value && !FAT_IS_BAD(fs, curEntry.value) &&
!get_owner(fs, i)) {
if (!num_refs[curEntry.value]--)
die("Internal error: num_refs going below zero");
set_fat(fs, i, -1);
changed = curEntry.value;
printf("Broke cycle at cluster %lu in free chain.\n", (unsigned long)i);
/* If we've created a new chain head,
* tag_free() can claim it
*/
if (num_refs[curEntry.value] == 0)
break;
}
}
}
while (changed);
/* Now we can start recovery */
files = reclaimed = 0;
for (i = 2; i < total_num_clusters; i++)
/* If this cluster is the head of an orphan chain... */
if (get_owner(fs, i) == &orphan && !num_refs[i]) {
DIR_ENT de;
off_t offset;
files++;
offset = alloc_rootdir_entry(fs, &de, "FSCK%04dREC", 1);
de.start = htole16(i & 0xffff);
if (fs->fat_bits == 32)
de.starthi = htole16(i >> 16);
for (walk = i; walk > 0 && walk != -1;
walk = next_cluster(fs, walk)) {
de.size = htole32(le32toh(de.size) + fs->cluster_size);
reclaimed++;
}
fs_write(offset, sizeof(DIR_ENT), &de);
}
if (reclaimed)
printf("Reclaimed %d unused cluster%s (%llu bytes) in %d chain%s.\n",
reclaimed, reclaimed == 1 ? "" : "s",
(unsigned long long)reclaimed * fs->cluster_size, files,
files == 1 ? "" : "s");
free(num_refs);
}
uint32_t update_free(DOS_FS * fs)
{
uint32_t i;
uint32_t free = 0;
int do_set = 0;
for (i = 2; i < fs->data_clusters + 2; i++) {
FAT_ENTRY curEntry;
get_fat(&curEntry, fs->fat, i, fs);
if (!get_owner(fs, i) && !FAT_IS_BAD(fs, curEntry.value))
++free;
}
if (!fs->fsinfo_start)
return free;
if (verbose)
printf("Checking free cluster summary.\n");
if (fs->free_clusters != 0xFFFFFFFF) {
if (free != fs->free_clusters) {
printf("Free cluster summary wrong (%ld vs. really %ld)\n",
(long)fs->free_clusters, (long)free);
if (get_choice(1, " Auto-correcting.",
2,
1, "Correct",
2, "Don't correct") == 1)
do_set = 1;
}
} else {
printf("Free cluster summary uninitialized (should be %ld)\n", (long)free);
if (rw) {
if (get_choice(1, " Auto-setting.",
2,
1, "Set it",
2, "Leave it uninitialized") == 1)
do_set = 1;
}
}
if (do_set) {
uint32_t le_free = htole32(free);
fs->free_clusters = free;
fs_write(fs->fsinfo_start + offsetof(struct info_sector, free_clusters),
sizeof(le_free), &le_free);
}
return free;
}
dosfstools-4.2/src/common.h 0000644 0001750 0001750 00000006640 14005523510 012730 0000000 0000000 /* common.h - Common functions
Copyright (C) 1993 Werner Almesberger
Copyright (C) 2008-2014 Daniel Baumann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
#ifndef _COMMON_H
#define _COMMON_H
#include
#include
#include
#ifndef OFF_MAX
#define OFF_MAX (off_t)((1ULL << (sizeof(off_t) * CHAR_BIT - 1)) - 1)
#endif
extern int interactive;
extern int write_immed;
extern int atari_format; /* Use Atari variation of MS-DOS FS format */
/* program_name used for printing messages; no name will be printed when it is
* left as NULL */
extern const char *program_name;
void die(const char *msg, ...)
__attribute((noreturn, format(printf, 1, 2)));
/* Displays a prinf-style message and terminates the program. */
void pdie(const char *msg, ...)
__attribute((noreturn, format(printf, 1, 2)));
/* Like die, but appends an error message according to the state of errno. */
void *alloc(int size);
/* mallocs SIZE bytes and returns a pointer to the data. Terminates the program
if malloc fails. */
void *qalloc(void **root, int size);
/* Like alloc, but registers the data area in a list described by ROOT. */
void qfree(void **root);
/* Deallocates all qalloc'ed data areas described by ROOT. */
int min(int a, int b);
/* Returns the smaller integer value of a and b. */
int xasprintf(char **strp, const char *fmt, ...)
__attribute((format(printf, 2, 3)));
/* Runs asprintf() and terminates the program if it fails. */
int get_choice(int noninteractive_result, const char *noninteractive_msg,
int choices, ...);
/*
* Display a numbered list of choices and accept user input to select one. If
* interactive is false, it will instead print noninteractive_msg and return
* noninteractive_result. The number of options must be given in choices and
* must be more than one and less then ten.
*
* The variable arguments are choices times , where
* val is the value that is returned when the user selects this option and desc
* is the string describing this option.
*/
char *get_line(const char *prompt, char *dest, size_t length);
/*
* Display prompt and read a line, placing it in dest with at most length-1
* characters plus a null byte. This behaves like printing a prompt and fgets()
* afterwards with the addition of temporarily enabling canonical input mode
* with echo if needed.
*/
void check_atari(void);
/*
* ++roman: On m68k Linux, check if this is an Atari; if yes, turn on Atari
* variant of MS-DOS filesystem by default.
*/
uint32_t generate_volume_id(void);
/*
* Generate a 32 bit volume ID
*/
int validate_volume_label(char *doslabel);
/*
* Validate volume label
*/
#endif
dosfstools-4.2/src/common.c 0000644 0001750 0001750 00000020746 14005523510 012726 0000000 0000000 /* common.c - Common functions
Copyright (C) 1993 Werner Almesberger
Copyright (C) 1998 Roman Hodek
Copyright (C) 2008-2014 Daniel Baumann
Copyright (C) 2018 Pali Rohár
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
/* FAT32, VFAT, Atari format support, and various fixes additions May 1998
* by Roman Hodek */
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "common.h"
#include "charconv.h"
int interactive;
int write_immed;
int atari_format;
const char *program_name;
typedef struct _link {
void *data;
struct _link *next;
} LINK;
void die(const char *msg, ...)
{
va_list args;
if (program_name)
fprintf(stderr, "%s: ", program_name);
va_start(args, msg);
vfprintf(stderr, msg, args);
va_end(args);
fprintf(stderr, "\n");
exit(1);
}
void pdie(const char *msg, ...)
{
va_list args;
if (program_name)
fprintf(stderr, "%s: ", program_name);
va_start(args, msg);
vfprintf(stderr, msg, args);
va_end(args);
fprintf(stderr, ":%s\n", strerror(errno));
exit(1);
}
void *alloc(int size)
{
void *this;
if ((this = malloc(size)))
return this;
pdie("malloc");
return NULL; /* for GCC */
}
void *qalloc(void **root, int size)
{
LINK *link;
link = alloc(sizeof(LINK));
link->next = *root;
*root = link;
return link->data = alloc(size);
}
void qfree(void **root)
{
LINK *this;
while (*root) {
this = (LINK *) * root;
*root = this->next;
free(this->data);
free(this);
}
}
int min(int a, int b)
{
return a < b ? a : b;
}
#ifndef HAVE_VASPRINTF
static int vasprintf(char **strp, const char *fmt, va_list va)
{
int length;
va_list vacopy;
va_copy(vacopy, va);
length = vsnprintf(NULL, 0, fmt, vacopy);
if (length < 0)
return length;
*strp = malloc(length + 1);
if (!*strp) {
errno = ENOMEM;
return -1;
}
return vsnprintf(*strp, length + 1, fmt, va);
}
#endif
int xasprintf(char **strp, const char *fmt, ...)
{
va_list va;
int retval;
va_start(va, fmt);
retval = vasprintf(strp, fmt, va);
va_end(va);
if (retval < 0)
pdie("asprintf");
return retval;
}
int get_choice(int noninteractive_result, const char *noninteractive_msg,
int choices, ...)
{
int choice_values[9];
const char *choice_strings[9];
int choice;
int quit_choice;
int print_choices, print_full_choices;
va_list va;
int i;
static int inhibit_quit_choice;
if (!interactive) {
printf("%s\n", noninteractive_msg);
return noninteractive_result;
}
if (choices < 2 || choices > 9)
die("internal error: invalid number %u of choices in get_choice()",
choices);
va_start(va, choices);
for (i = 0; i < choices; i++) {
choice_values[i] = va_arg(va, int);
choice_strings[i] = va_arg(va, const char *);
}
va_end(va);
print_choices = 1;
print_full_choices = 0;
while (1) {
if (print_choices) {
print_choices = 0;
for (i = 0; i < choices; i++)
printf("%d) %s\n", i + 1, choice_strings[i]);
if (print_full_choices) {
printf("?) List all choices\n");
printf("q) Quit fsck\n");
}
}
printf("[%.*s?%s]? ", choices, "123456789", inhibit_quit_choice ? "" : "q");
fflush(stdout);
do {
choice = getchar();
} while (choice == '\n'); /* filter out enter presses */
if (choice == EOF)
exit(1);
printf("%c\n", choice);
if (choice > '0' && choice <= '0' + choices)
break;
if (choice == '?') {
print_choices = 1;
print_full_choices = 1;
}
if (!inhibit_quit_choice && (choice == 'q' || choice == 'Q')) {
if (!write_immed)
printf("No changes have been written to the filesystem yet. If you choose\n"
"to quit, it will be left in the same state it was in before you\n"
"started this program.\n");
else
printf("fsck is running in immediate write mode. All changes so far have\n"
"already been written and can not be undone now. If you choose to\n"
"quit now, these changes will stay in place.\n");
inhibit_quit_choice = 1;
quit_choice = get_choice(1, "This is never non-interactive.",
2,
1, "Quit now",
2, "Continue");
inhibit_quit_choice = 0;
if (quit_choice == 1)
exit(0);
}
}
return choice_values[choice - '1'];
}
char *get_line(const char *prompt, char *dest, size_t length)
{
struct termios tio, tio_orig;
int tio_fail;
char *retval;
tio_fail = tcgetattr(0, &tio_orig);
if (!tio_fail) {
tio = tio_orig;
tio.c_lflag |= ICANON | ECHO;
tcsetattr(0, TCSAFLUSH, &tio);
}
printf("%s: ", prompt);
fflush(stdout);
retval = fgets(dest, length, stdin);
if (!tio_fail)
tcsetattr(0, TCSAFLUSH, &tio_orig);
return retval;
}
/*
* ++roman: On m68k, check if this is an Atari; if yes, turn on Atari variant
* of MS-DOS filesystem by default.
*/
void check_atari(void)
{
#if defined(__mc68000__) && defined(__linux__) && defined(CONF_CHECK_ATARI)
FILE *f;
char line[128], *p;
if (!(f = fopen("/proc/hardware", "r"))) {
perror("/proc/hardware");
return;
}
while (fgets(line, sizeof(line), f)) {
if (strncmp(line, "Model:", 6) == 0) {
p = line + 6;
p += strspn(p, " \t");
if (strncmp(p, "Atari ", 6) == 0)
atari_format = 1;
break;
}
}
fclose(f);
#endif
}
uint32_t generate_volume_id(void)
{
struct timeval now;
if (gettimeofday(&now, NULL) != 0 || now.tv_sec == (time_t)-1 || now.tv_sec < 0) {
srand(getpid());
/* rand() returns int from [0,RAND_MAX], therefore only 31 bits */
return (((uint32_t)(rand() & 0xFFFF)) << 16) | ((uint32_t)(rand() & 0xFFFF));
}
/* volume ID = current time, fudged for more uniqueness */
return ((uint32_t)now.tv_sec << 20) | (uint32_t)now.tv_usec;
}
/*
* Validate volume label
*
* @param[in] doslabel Label stored according to current DOS codepage
*
* @return bitmask of errors
* 0x01 - lowercase character
* 0x02 - character below 0x20
* 0x04 - character in disallowed set
* 0x08 - empty or space-only label
* 0x10 - space at beginning
*/
int validate_volume_label(char *doslabel)
{
int i;
int ret = 0;
wchar_t wlabel[12];
if (dos_string_to_wchar_string(wlabel, doslabel, sizeof(wlabel))) {
for (i = 0; wlabel[i]; i++) {
/* FAT specification: Lower case characters are not allowed in DIR_Name
(what these characters are is country specific)
Original label is stored in DOS OEM code page, so islower() function
cannot be used. Therefore convert original label to locale independent
wchar_t* and then use iswlower() function for it.
*/
if (iswlower(wlabel[i])) {
ret |= 0x01;
break;
}
}
}
/* According to FAT specification those bytes (after conversion to DOS OEM
code page) are not allowed.
*/
for (i = 0; i < 11; i++) {
if (doslabel[i] < 0x20)
ret |= 0x02;
if (doslabel[i] == 0x22 ||
(doslabel[i] >= 0x2A && doslabel[i] <= 0x2C) ||
doslabel[i] == 0x2E ||
doslabel[i] == 0x2F ||
(doslabel[i] >= 0x3A && doslabel[i] <= 0x3F) ||
(doslabel[i] >= 0x5B && doslabel[i] <= 0x5D) ||
doslabel[i] == 0x7C)
ret |= 0x04;
}
if (memcmp(doslabel, " ", 11) == 0)
ret |= 0x08;
if (doslabel[0] == ' ')
ret |= 0x10;
return ret;
}
dosfstools-4.2/src/boot.h 0000644 0001750 0001750 00000003676 14005523510 012411 0000000 0000000 /* boot.h - Read and analyze ia PC/MS-DOS boot sector
Copyright (C) 1993 Werner Almesberger
Copyright (C) 2008-2014 Daniel Baumann
Copyright (C) 2017 Andreas Bombe
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
#ifndef _BOOT_H
#define _BOOT_H
#include
void read_boot(DOS_FS * fs);
void write_label(DOS_FS * fs, char *label);
void write_boot_label(DOS_FS * fs, const char *label);
void write_volume_label(DOS_FS * fs, char *label);
void remove_label(DOS_FS *fs);
void write_serial(DOS_FS * fs, uint32_t serial);
off_t find_volume_de(DOS_FS * fs, DIR_ENT * de);
const char *pretty_label(const char *label);
/* Reads the boot sector from the currently open device and initializes *FS */
off_t alloc_rootdir_entry(DOS_FS * fs, DIR_ENT * de, const char *pattern, int gen_name);
/* Allocate a free slot in the root directory for a new file. If gen_name is
true, the file name is constructed after 'pattern', which must include a %d
type format for printf and expand to exactly 11 characters. The name
actually used is written into the 'de' structure, the rest of *de is cleared.
The offset returned is to where in the filesystem the entry belongs. */
#endif
dosfstools-4.2/src/boot.c 0000644 0001750 0001750 00000057205 14005523510 012401 0000000 0000000 /* boot.c - Read and analyze ia PC/MS-DOS boot sector
Copyright (C) 1993 Werner Almesberger
Copyright (C) 1998 Roman Hodek
Copyright (C) 2008-2014 Daniel Baumann
Copyright (C) 2015-2017 Andreas Bombe
Copyright (C) 2018-2021 Pali Rohár
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
/* FAT32, VFAT, Atari format support, and various fixes additions May 1998
* by Roman Hodek */
#include
#include
#include
#include
#include
#include
#include
#include "common.h"
#include "fsck.fat.h"
#include "fat.h"
#include "io.h"
#include "boot.h"
#include "check.h"
#include "charconv.h"
#define ROUND_TO_MULTIPLE(n,m) ((n) && (m) ? (n)+(m)-1-((n)-1)%(m) : 0)
/* don't divide by zero */
/* cut-over cluster counts for FAT12 and FAT16 */
#define FAT12_THRESHOLD 4085
#define FAT16_THRESHOLD 65525
off_t alloc_rootdir_entry(DOS_FS * fs, DIR_ENT * de, const char *pattern, int gen_name)
{
static int curr_num = 0;
off_t offset;
if (fs->root_cluster) {
DIR_ENT d2;
int i = 0, got = 0;
uint32_t clu_num, prev = 0;
off_t offset2;
clu_num = fs->root_cluster;
offset = cluster_start(fs, clu_num);
while (clu_num > 0 && clu_num != -1) {
fs_read(offset, sizeof(DIR_ENT), &d2);
if (IS_FREE(d2.name) && d2.attr != VFAT_LN_ATTR) {
got = 1;
break;
}
i += sizeof(DIR_ENT);
offset += sizeof(DIR_ENT);
if ((i % fs->cluster_size) == 0) {
prev = clu_num;
if ((clu_num = next_cluster(fs, clu_num)) == 0 || clu_num == -1)
break;
offset = cluster_start(fs, clu_num);
}
}
if (!got) {
/* no free slot, need to extend root dir: alloc next free cluster
* after previous one */
if (!prev)
die("Root directory has no cluster allocated!");
for (clu_num = prev + 1; clu_num != prev; clu_num++) {
FAT_ENTRY entry;
if (clu_num >= fs->data_clusters + 2)
clu_num = 2;
get_fat(&entry, fs->fat, clu_num, fs);
if (!entry.value)
break;
}
if (clu_num == prev)
die("Root directory full and no free cluster");
set_fat(fs, prev, clu_num);
set_fat(fs, clu_num, -1);
set_owner(fs, clu_num, get_owner(fs, fs->root_cluster));
/* clear new cluster */
memset(&d2, 0, sizeof(d2));
offset = cluster_start(fs, clu_num);
for (i = 0; i < fs->cluster_size; i += sizeof(DIR_ENT))
fs_write(offset + i, sizeof(d2), &d2);
}
memset(de, 0, sizeof(DIR_ENT));
if (gen_name) {
while (1) {
char expanded[12];
sprintf(expanded, pattern, curr_num);
memcpy(de->name, expanded, MSDOS_NAME);
clu_num = fs->root_cluster;
i = 0;
offset2 = cluster_start(fs, clu_num);
while (clu_num > 0 && clu_num != -1) {
fs_read(offset2, sizeof(DIR_ENT), &d2);
if (offset2 != offset &&
!strncmp((const char *)d2.name, (const char *)de->name,
MSDOS_NAME))
break;
i += sizeof(DIR_ENT);
offset2 += sizeof(DIR_ENT);
if ((i % fs->cluster_size) == 0) {
if ((clu_num = next_cluster(fs, clu_num)) == 0 ||
clu_num == -1)
break;
offset2 = cluster_start(fs, clu_num);
}
}
if (clu_num == 0 || clu_num == -1)
break;
if (++curr_num >= 10000)
die("Unable to create unique name");
}
} else {
memcpy(de->name, pattern, MSDOS_NAME);
}
} else {
DIR_ENT *root;
int next_free = 0, scan;
root = alloc(fs->root_entries * sizeof(DIR_ENT));
fs_read(fs->root_start, fs->root_entries * sizeof(DIR_ENT), root);
while (next_free < fs->root_entries)
if (IS_FREE(root[next_free].name) &&
root[next_free].attr != VFAT_LN_ATTR)
break;
else
next_free++;
if (next_free == fs->root_entries)
die("Root directory is full.");
offset = fs->root_start + next_free * sizeof(DIR_ENT);
memset(de, 0, sizeof(DIR_ENT));
if (gen_name) {
while (1) {
char expanded[12];
sprintf(expanded, pattern, curr_num);
memcpy(de->name, expanded, MSDOS_NAME);
for (scan = 0; scan < fs->root_entries; scan++)
if (scan != next_free &&
!strncmp((const char *)root[scan].name,
(const char *)de->name, MSDOS_NAME))
break;
if (scan == fs->root_entries)
break;
if (++curr_num >= 10000)
die("Unable to create unique name");
}
} else {
memcpy(de->name, pattern, MSDOS_NAME);
}
free(root);
}
++n_files;
return offset;
}
static struct {
uint8_t media;
const char *descr;
} mediabytes[] = {
{
0xf0, "5.25\" or 3.5\" HD floppy"}, {
0xf8, "hard disk"}, {
0xf9, "3,5\" 720k floppy 2s/80tr/9sec or "
"5.25\" 1.2M floppy 2s/80tr/15sec"}, {
0xfa, "5.25\" 320k floppy 1s/80tr/8sec"}, {
0xfb, "3.5\" 640k floppy 2s/80tr/8sec"}, {
0xfc, "5.25\" 180k floppy 1s/40tr/9sec"}, {
0xfd, "5.25\" 360k floppy 2s/40tr/9sec"}, {
0xfe, "5.25\" 160k floppy 1s/40tr/8sec"}, {
0xff, "5.25\" 320k floppy 2s/40tr/8sec"},};
/* Unaligned fields must first be accessed byte-wise */
#define GET_UNALIGNED_W(f) \
( (uint16_t)f[0] | ((uint16_t)f[1]<<8) )
static const char *get_media_descr(unsigned char media)
{
int i;
for (i = 0; i < sizeof(mediabytes) / sizeof(*mediabytes); ++i) {
if (mediabytes[i].media == media)
return (mediabytes[i].descr);
}
return ("undefined");
}
static void dump_boot(DOS_FS * fs, struct boot_sector *b, unsigned lss)
{
unsigned short sectors;
printf("Boot sector contents:\n");
if (!atari_format) {
char id[9];
strncpy(id, (const char *)b->system_id, 8);
id[8] = 0;
printf("System ID \"%s\"\n", id);
} else {
/* On Atari, a 24 bit serial number is stored at offset 8 of the boot
* sector */
printf("Serial number 0x%x\n",
b->system_id[5] | (b->system_id[6] << 8) | (b->
system_id[7] << 16));
}
printf("Media byte 0x%02x (%s)\n", b->media, get_media_descr(b->media));
printf("%10d bytes per logical sector\n", GET_UNALIGNED_W(b->sector_size));
printf("%10d bytes per cluster\n", fs->cluster_size);
printf("%10d reserved sector%s\n", le16toh(b->reserved),
le16toh(b->reserved) == 1 ? "" : "s");
printf("First FAT starts at byte %llu (sector %llu)\n",
(unsigned long long)fs->fat_start,
(unsigned long long)fs->fat_start / lss);
printf("%10d FATs, %d bit entries\n", b->fats, fs->fat_bits);
printf("%10u bytes per FAT (= %u sectors)\n", fs->fat_size,
fs->fat_size / lss);
if (!fs->root_cluster) {
printf("Root directory starts at byte %llu (sector %llu)\n",
(unsigned long long)fs->root_start,
(unsigned long long)fs->root_start / lss);
printf("%10d root directory entries\n", fs->root_entries);
} else {
printf("Root directory start at cluster %lu (arbitrary size)\n",
(unsigned long)fs->root_cluster);
}
printf("Data area starts at byte %llu (sector %llu)\n",
(unsigned long long)fs->data_start,
(unsigned long long)fs->data_start / lss);
printf("%10lu data clusters (%llu bytes)\n",
(unsigned long)fs->data_clusters,
(unsigned long long)fs->data_clusters * fs->cluster_size);
printf("%u sectors/track, %u heads\n", le16toh(b->secs_track),
le16toh(b->heads));
printf("%10u hidden sectors\n", atari_format ?
/* On Atari, the hidden field is only 16 bit wide and unused */
(((unsigned char *)&b->hidden)[0] |
((unsigned char *)&b->hidden)[1] << 8) : le32toh(b->hidden));
sectors = GET_UNALIGNED_W(b->sectors);
printf("%10u sectors total\n", sectors ? sectors : le32toh(b->total_sect));
}
static void check_backup_boot(DOS_FS * fs, struct boot_sector *b, unsigned int lss)
{
struct boot_sector b2;
if (!fs->backupboot_start) {
printf("There is no backup boot sector.\n");
if (le16toh(b->reserved) < 3) {
printf("And there is no space for creating one!\n");
return;
}
if (get_choice(1, " Auto-creating backup boot block.",
2,
1, "Create one",
2, "Do without a backup") == 1) {
unsigned int bbs;
/* The usual place for the backup boot sector is sector 6. Choose
* that or the last reserved sector. */
if (le16toh(b->reserved) >= 7 && le16toh(b->info_sector) != 6)
bbs = 6;
else {
bbs = le16toh(b->reserved) - 1;
if (bbs == le16toh(b->info_sector))
--bbs; /* this is never 0, as we checked reserved >= 3! */
}
fs->backupboot_start = bbs * lss;
b->backup_boot = htole16(bbs);
fs_write(fs->backupboot_start, sizeof(*b), b);
fs_write(offsetof(struct boot_sector, backup_boot),
sizeof(b->backup_boot), &b->backup_boot);
printf("Created backup of boot sector in sector %d\n", bbs);
return;
} else
return;
}
fs_read(fs->backupboot_start, sizeof(b2), &b2);
if (memcmp(b, &b2, sizeof(b2)) != 0) {
/* there are any differences */
uint8_t *p, *q;
int i, pos, first = 1;
char buf[32];
printf("There are differences between boot sector and its backup.\n");
printf("This is mostly harmless. Differences: (offset:original/backup)\n ");
pos = 2;
for (p = (uint8_t *) b, q = (uint8_t *) & b2, i = 0; i < sizeof(b2);
++p, ++q, ++i) {
if (*p != *q) {
sprintf(buf, "%s%u:%02x/%02x", first ? "" : ", ",
(unsigned)(p - (uint8_t *) b), *p, *q);
if (pos + strlen(buf) > 78)
printf("\n "), pos = 2;
printf("%s", buf);
pos += strlen(buf);
first = 0;
}
}
printf("\n");
switch (get_choice(3, " Not automatically fixing this.",
3,
1, "Copy original to backup",
2, "Copy backup to original",
3, "No action")) {
case 1:
fs_write(fs->backupboot_start, sizeof(*b), b);
break;
case 2:
fs_write(0, sizeof(b2), &b2);
break;
default:
break;
}
}
}
static void init_fsinfo_except_reserved(struct info_sector *i)
{
i->magic = htole32(0x41615252);
i->signature = htole32(0x61417272);
i->free_clusters = htole32(-1);
i->next_cluster = htole32(2);
i->boot_sign = htole32(0xaa550000);
}
static void read_fsinfo(DOS_FS * fs, struct boot_sector *b, unsigned int lss)
{
struct info_sector i;
if (!b->info_sector) {
printf("No FSINFO sector\n");
if (get_choice(2, " Not automatically creating it.",
2,
1, "Create one",
2, "Do without FSINFO") == 1) {
/* search for a free reserved sector (not boot sector and not
* backup boot sector) */
uint32_t s;
for (s = 1; s < le16toh(b->reserved); ++s)
if (s != le16toh(b->backup_boot))
break;
if (s > 0 && s < le16toh(b->reserved)) {
memset(&i, 0, sizeof (struct info_sector));
init_fsinfo_except_reserved(&i);
fs_write((off_t)s * lss, sizeof(i), &i);
b->info_sector = htole16(s);
fs_write(offsetof(struct boot_sector, info_sector),
sizeof(b->info_sector), &b->info_sector);
if (fs->backupboot_start)
fs_write(fs->backupboot_start +
offsetof(struct boot_sector, info_sector),
sizeof(b->info_sector), &b->info_sector);
} else {
printf("No free reserved sector found -- "
"no space for FSINFO sector!\n");
return;
}
} else
return;
}
fs->fsinfo_start = le16toh(b->info_sector) * lss;
fs_read(fs->fsinfo_start, sizeof(i), &i);
if (i.magic != htole32(0x41615252) ||
i.signature != htole32(0x61417272) || i.boot_sign != htole32(0xaa550000)) {
printf("FSINFO sector has bad magic number(s):\n");
if (i.magic != htole32(0x41615252))
printf(" Offset %llu: 0x%08x != expected 0x%08x\n",
(unsigned long long)offsetof(struct info_sector, magic),
le32toh(i.magic), 0x41615252);
if (i.signature != htole32(0x61417272))
printf(" Offset %llu: 0x%08x != expected 0x%08x\n",
(unsigned long long)offsetof(struct info_sector, signature),
le32toh(i.signature), 0x61417272);
if (i.boot_sign != htole32(0xaa550000))
printf(" Offset %llu: 0x%08x != expected 0x%08x\n",
(unsigned long long)offsetof(struct info_sector, boot_sign),
le32toh(i.boot_sign), 0xaa550000);
if (get_choice(1, " Auto-correcting it.",
2,
1, "Correct",
2, "Don't correct (FSINFO invalid then)") == 1) {
init_fsinfo_except_reserved(&i);
fs_write(fs->fsinfo_start, sizeof(i), &i);
} else
fs->fsinfo_start = 0;
}
if (fs->fsinfo_start)
fs->free_clusters = le32toh(i.free_clusters);
}
void read_boot(DOS_FS * fs)
{
struct boot_sector b;
unsigned total_sectors;
unsigned int logical_sector_size, sectors;
long long fat_length;
unsigned total_fat_entries;
off_t data_size;
long long position;
fs_read(0, sizeof(b), &b);
logical_sector_size = GET_UNALIGNED_W(b.sector_size);
if (!logical_sector_size)
die("Logical sector size is zero.");
/* This was moved up because it's the first thing that will fail */
/* if the platform needs special handling of unaligned multibyte accesses */
/* but such handling isn't being provided. See GET_UNALIGNED_W() above. */
if (logical_sector_size & (SECTOR_SIZE - 1))
die("Logical sector size (%u bytes) is not a multiple of the physical "
"sector size.", logical_sector_size);
fs->cluster_size = b.cluster_size * logical_sector_size;
if (!fs->cluster_size)
die("Cluster size is zero.");
if (b.fats != 2 && b.fats != 1)
die("Currently, only 1 or 2 FATs are supported, not %d.\n", b.fats);
fs->nfats = b.fats;
sectors = GET_UNALIGNED_W(b.sectors);
total_sectors = sectors ? sectors : le32toh(b.total_sect);
if (verbose)
printf("Checking we can access the last sector of the filesystem\n");
/* Can't access last odd sector anyway, so round down */
position = (long long)((total_sectors & ~1) - 1) * logical_sector_size;
if (position > OFF_MAX)
die("Filesystem is too large.");
if (!fs_test(position, logical_sector_size))
die("Failed to read sector %u.", (total_sectors & ~1) - 1);
fat_length = le16toh(b.fat_length) ?
le16toh(b.fat_length) : le32toh(b.fat32_length);
if (!fat_length)
die("FAT size is zero.");
fs->fat_start = (off_t)le16toh(b.reserved) * logical_sector_size;
position = (le16toh(b.reserved) + b.fats * fat_length) *
logical_sector_size;
if (position > OFF_MAX)
die("Filesystem is too large.");
fs->root_start = position;
fs->root_entries = GET_UNALIGNED_W(b.dir_entries);
position = (long long)fs->root_start +
ROUND_TO_MULTIPLE(fs->root_entries << MSDOS_DIR_BITS,
logical_sector_size);
if (position > OFF_MAX)
die("Filesystem is too large.");
fs->data_start = position;
position = (long long)total_sectors * logical_sector_size - fs->data_start;
if (position > OFF_MAX)
die("Filesystem is too large.");
data_size = position;
if (data_size < fs->cluster_size)
die("Filesystem has no space for any data clusters");
fs->data_clusters = data_size / fs->cluster_size;
fs->root_cluster = 0; /* indicates standard, pre-FAT32 root dir */
fs->fsinfo_start = 0; /* no FSINFO structure */
fs->free_clusters = -1; /* unknown */
if (!b.fat_length && b.fat32_length) {
fs->fat_bits = 32;
fs->root_cluster = le32toh(b.root_cluster);
if (!fs->root_cluster && fs->root_entries)
/* M$ hasn't specified this, but it looks reasonable: If
* root_cluster is 0 but there is a separate root dir
* (root_entries != 0), we handle the root dir the old way. Give a
* warning, but convertig to a root dir in a cluster chain seems
* to complex for now... */
fprintf(stderr, "Warning: FAT32 root dir not in cluster chain! "
"Compatibility mode...\n");
else if (!fs->root_cluster && !fs->root_entries)
die("No root directory!");
else if (fs->root_cluster && fs->root_entries)
fprintf(stderr, "Warning: FAT32 root dir is in a cluster chain, but "
"a separate root dir\n"
" area is defined. Cannot fix this easily.\n");
if (fs->data_clusters < FAT16_THRESHOLD)
fprintf(stderr, "Warning: Filesystem is FAT32 according to fat_length "
"and fat32_length fields,\n"
" but has only %lu clusters, less than the required "
"minimum of %d.\n"
" This may lead to problems on some systems.\n",
(unsigned long)fs->data_clusters, FAT16_THRESHOLD);
fs->backupboot_start = le16toh(b.backup_boot) * logical_sector_size;
check_backup_boot(fs, &b, logical_sector_size);
read_fsinfo(fs, &b, logical_sector_size);
} else if (!atari_format) {
/* On real MS-DOS, a 16 bit FAT is used whenever there would be too
* much clusers otherwise. */
fs->fat_bits = (fs->data_clusters >= FAT12_THRESHOLD) ? 16 : 12;
if (fs->data_clusters >= FAT16_THRESHOLD)
die("Too many clusters (%lu) for FAT16 filesystem.",
(unsigned long)fs->data_clusters);
} else {
/* On Atari, things are more difficult: GEMDOS always uses 12bit FATs
* on floppies, and always 16 bit on harddisks. */
fs->fat_bits = 16; /* assume 16 bit FAT for now */
/* If more clusters than fat entries in 16-bit fat, we assume
* it's a real MSDOS FS with 12-bit fat. */
if (fs->data_clusters + 2 > fat_length * logical_sector_size * 8 / 16 ||
/* if it has one of the usual floppy sizes -> 12bit FAT */
(total_sectors == 720 || total_sectors == 1440 ||
total_sectors == 2880))
fs->fat_bits = 12;
}
/* On FAT32, the high 4 bits of a FAT entry are reserved */
fs->eff_fat_bits = (fs->fat_bits == 32) ? 28 : fs->fat_bits;
position = fat_length * logical_sector_size;
if (position > OFF_MAX)
die("Filesystem is too large.");
fs->fat_size = position;
fs->label[0] = 0;
if (fs->fat_bits == 12 || fs->fat_bits == 16) {
struct boot_sector_16 *b16 = (struct boot_sector_16 *)&b;
if (b16->extended_sig == 0x29) {
memmove(fs->label, b16->label, 11);
fs->serial = b16->serial;
}
} else if (fs->fat_bits == 32) {
if (b.extended_sig == 0x29) {
memmove(fs->label, &b.label, 11);
fs->serial = b.serial;
}
}
position = (long long)fs->fat_size * 8 / fs->fat_bits;
if (position > UINT_MAX)
die("FAT has space for too many entries (%lld).", (long long)position);
total_fat_entries = position;
if (fs->data_clusters > total_fat_entries - 2)
die("Filesystem has %u clusters but only space for %u FAT entries.",
fs->data_clusters, total_fat_entries - 2);
if (!fs->root_entries && !fs->root_cluster)
die("Root directory has zero size.");
if (fs->root_entries & (MSDOS_DPS - 1))
die("Root directory (%d entries) doesn't span an integral number of "
"sectors.", fs->root_entries);
if (logical_sector_size & (SECTOR_SIZE - 1))
die("Logical sector size (%u bytes) is not a multiple of the physical "
"sector size.", logical_sector_size);
#if 0 /* linux kernel doesn't check that either */
/* ++roman: On Atari, these two fields are often left uninitialized */
if (!atari_format && (!b.secs_track || !b.heads))
die("Invalid disk format in boot sector.");
#endif
if (verbose)
dump_boot(fs, &b, logical_sector_size);
}
static void write_boot_label_or_serial(int label_mode, DOS_FS * fs,
const char *label, uint32_t serial)
{
if (fs->fat_bits == 12 || fs->fat_bits == 16) {
struct boot_sector_16 b16;
fs_read(0, sizeof(b16), &b16);
if (b16.extended_sig != 0x29) {
b16.extended_sig = 0x29;
b16.serial = 0;
memmove(b16.label, "NO NAME ", 11);
memmove(b16.fs_type, fs->fat_bits == 12 ? "FAT12 " : "FAT16 ",
8);
}
if (label_mode)
memmove(b16.label, label, 11);
else
b16.serial = serial;
fs_write(0, sizeof(b16), &b16);
} else if (fs->fat_bits == 32) {
struct boot_sector b;
fs_read(0, sizeof(b), &b);
if (b.extended_sig != 0x29) {
b.extended_sig = 0x29;
b.serial = 0;
memmove(b.label, "NO NAME ", 11);
memmove(b.fs_type, "FAT32 ", 8);
}
if (label_mode)
memmove(b.label, label, 11);
else
b.serial = serial;
fs_write(0, sizeof(b), &b);
if (fs->backupboot_start)
fs_write(fs->backupboot_start, sizeof(b), &b);
}
}
void write_boot_label(DOS_FS * fs, const char *label)
{
write_boot_label_or_serial(1, fs, label, 0);
}
void write_serial(DOS_FS * fs, uint32_t serial)
{
write_boot_label_or_serial(0, fs, NULL, serial);
}
off_t find_volume_de(DOS_FS * fs, DIR_ENT * de)
{
uint32_t cluster;
off_t offset;
int i;
if (fs->root_cluster) {
for (cluster = fs->root_cluster;
cluster != 0 && cluster != -1;
cluster = next_cluster(fs, cluster)) {
offset = cluster_start(fs, cluster);
for (i = 0; i * sizeof(DIR_ENT) < fs->cluster_size; i++) {
fs_read(offset, sizeof(DIR_ENT), de);
/* no point in scanning after end of directory marker */
if (!de->name[0])
return 0;
if (!IS_FREE(de->name) &&
de->attr != VFAT_LN_ATTR && de->attr & ATTR_VOLUME)
return offset;
offset += sizeof(DIR_ENT);
}
}
} else {
for (i = 0; i < fs->root_entries; i++) {
offset = fs->root_start + i * sizeof(DIR_ENT);
fs_read(offset, sizeof(DIR_ENT), de);
/* no point in scanning after end of directory marker */
if (!de->name[0])
return 0;
if (!IS_FREE(de->name) &&
de->attr != VFAT_LN_ATTR && de->attr & ATTR_VOLUME)
return offset;
}
}
return 0;
}
void write_volume_label(DOS_FS * fs, char *label)
{
time_t now;
struct tm *mtime;
off_t offset;
int created;
DIR_ENT de;
created = 0;
offset = find_volume_de(fs, &de);
if (offset == 0) {
created = 1;
offset = alloc_rootdir_entry(fs, &de, label, 0);
}
memcpy(de.name, label, 11);
if (de.name[0] == 0xe5)
de.name[0] = 0x05;
now = time(NULL);
mtime = (now != (time_t)-1) ? localtime(&now) : NULL;
if (mtime && mtime->tm_year >= 80 && mtime->tm_year <= 207) {
de.time = htole16((unsigned short)((mtime->tm_sec >> 1) +
(mtime->tm_min << 5) +
(mtime->tm_hour << 11)));
de.date = htole16((unsigned short)(mtime->tm_mday +
((mtime->tm_mon + 1) << 5) +
((mtime->tm_year - 80) << 9)));
} else {
/* fallback to 1.1.1980 00:00:00 */
de.time = htole16(0);
de.date = htole16(1 + (1 << 5));
}
if (created) {
de.attr = ATTR_VOLUME;
de.ctime_ms = 0;
de.ctime = de.time;
de.cdate = de.date;
de.adate = de.date;
de.starthi = 0;
de.start = 0;
de.size = 0;
}
fs_write(offset, sizeof(DIR_ENT), &de);
}
void write_label(DOS_FS * fs, char *label)
{
int l = strlen(label);
while (l < 11)
label[l++] = ' ';
write_boot_label(fs, label);
write_volume_label(fs, label);
}
void remove_label(DOS_FS *fs)
{
off_t offset;
DIR_ENT de;
write_boot_label(fs, "NO NAME ");
offset = find_volume_de(fs, &de);
if (offset) {
/* mark entry as deleted */
de.name[0] = 0xe5;
/* remove ATTR_VOLUME for compatibility with older fatlabel version
* which ignores above deletion mark for entries with ATTR_VOLUME */
de.attr = 0;
fs_write(offset, sizeof(DIR_ENT), &de);
}
}
const char *pretty_label(const char *label)
{
static char buffer[256];
char *p;
int i;
int last;
for (last = 10; last >= 0; last--) {
if (label[last] != ' ')
break;
}
p = buffer;
for (i = 0; i <= last && label[i] && p < buffer + sizeof(buffer) - 1; ++i) {
if (!dos_char_to_printable(&p, label[i], buffer + sizeof(buffer) - 1 - p))
*p++ = '_';
}
*p = 0;
return buffer;
}
dosfstools-4.2/src/fatlabel.c 0000644 0001750 0001750 00000016006 14005523510 013202 0000000 0000000 /* fatlabel.c - User interface
Copyright (C) 1993 Werner Almesberger
Copyright (C) 1998 Roman Hodek
Copyright (C) 2007 Red Hat, Inc.
Copyright (C) 2008-2014 Daniel Baumann
Copyright (C) 2015-2017 Andreas Bombe
Copyright (C) 2017-2018 Pali Rohár
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
#include "version.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "common.h"
#include "fsck.fat.h"
#include "io.h"
#include "boot.h"
#include "fat.h"
#include "file.h"
#include "check.h"
#include "charconv.h"
int rw = 0, list = 0, test = 0, verbose = 0, no_spaces_in_sfns = 0;
long fat_table = 0;
unsigned n_files = 0;
void *mem_queue = NULL;
static void handle_label(bool change, bool reset, const char *device, char *newlabel)
{
DOS_FS fs = { 0 };
off_t offset;
DIR_ENT de;
char label[12] = { 0 };
size_t len;
int ret;
int i;
if (change) {
len = mbstowcs(NULL, newlabel, 0);
if (len != (size_t)-1 && len > 11) {
fprintf(stderr,
"fatlabel: labels can be no longer than 11 characters\n");
exit(1);
}
if (!local_string_to_dos_string(label, newlabel, 12)) {
fprintf(stderr,
"fatlabel: error when processing label\n");
exit(1);
}
for (i = strlen(label); i < 11; ++i)
label[i] = ' ';
label[11] = 0;
ret = validate_volume_label(label);
if (ret & 0x1) {
fprintf(stderr,
"fatlabel: warning - lowercase labels might not work properly on some systems\n");
}
if (ret & 0x2) {
fprintf(stderr,
"fatlabel: labels with characters below 0x20 are not allowed\n");
exit(1);
}
if (ret & 0x4) {
fprintf(stderr,
"fatlabel: labels with characters *?.,;:/\\|+=<>[]\" are not allowed\n");
exit(1);
}
if (ret & 0x08) {
fprintf(stderr,
"fatlabel: labels can't be empty or white space only\n");
exit(1);
}
if (ret & 0x10) {
fprintf(stderr,
"fatlabel: labels can't start with a space character\n");
exit(1);
}
}
fs_open(device, rw);
read_boot(&fs);
if (!change && !reset) {
if (fs.fat_bits == 32)
read_fat(&fs, 0);
offset = find_volume_de(&fs, &de);
if (offset != 0) {
if (de.name[0] == 0x05)
de.name[0] = 0xe5;
printf("%s\n", pretty_label((char *)de.name));
}
if (fs.fat_bits == 32)
release_fat(&fs);
exit(0);
}
if (fs.fat_bits == 32)
read_fat(&fs, 1);
if (!reset)
write_label(&fs, label);
else
remove_label(&fs);
if (fs.fat_bits == 32)
release_fat(&fs);
}
static void handle_volid(bool change, bool reset, const char *device, const char *newserial)
{
DOS_FS fs = { 0 };
char *tmp;
long long conversion;
uint32_t serial = 0;
if (change) {
errno = 0;
conversion = strtoll(newserial, &tmp, 16);
if (!*newserial || isspace(*newserial) || *tmp || conversion < 0) {
fprintf(stderr, "fatlabel: volume ID must be a hexadecimal number\n");
exit(1);
}
if (conversion > UINT32_MAX) {
fprintf(stderr, "fatlabel: given volume ID does not fit in 32 bit\n");
exit(1);
}
if (errno) {
fprintf(stderr, "fatlabel: parsing volume ID failed (%s)\n", strerror(errno));
exit(1);
}
serial = conversion;
}
if (reset)
serial = generate_volume_id();
fs_open(device, rw);
read_boot(&fs);
if (!change && !reset) {
printf("%08x\n", fs.serial);
exit(0);
}
write_serial(&fs, serial);
}
static void usage(int error, int usage_only)
{
FILE *f = error ? stderr : stdout;
int status = error ? 1 : 0;
fprintf(f, "Usage: fatlabel [OPTIONS] DEVICE [NEW]\n");
if (usage_only)
exit(status);
fprintf(f, "Change the FAT filesystem label or serial on DEVICE to NEW or display the\n");
fprintf(f, "existing label or serial if NEW is not given.\n");
fprintf(f, "\n");
fprintf(f, "Options:\n");
fprintf(f, " -i, --volume-id Work on serial number instead of label\n");
fprintf(f, " -r, --reset Remove label or generate new serial number\n");
fprintf(f, " -c N, --codepage=N use DOS codepage N to encode/decode label (default: %d)\n", DEFAULT_DOS_CODEPAGE);
fprintf(f, " -V, --version Show version number and terminate\n");
fprintf(f, " -h, --help Print this message and terminate\n");
exit(status);
}
int main(int argc, char *argv[])
{
const struct option long_options[] = {
{"volume-id", no_argument, NULL, 'i'},
{"reset", no_argument, NULL, 'r'},
{"codepage", required_argument, NULL, 'c'},
{"version", no_argument, NULL, 'V'},
{"help", no_argument, NULL, 'h'},
{0,}
};
bool change;
bool reset = false;
bool volid_mode = false;
char *device = NULL;
char *new = NULL;
char *tmp;
long codepage;
int c;
check_atari();
while ((c = getopt_long(argc, argv, "irc:Vh", long_options, NULL)) != -1) {
switch (c) {
case 'i':
volid_mode = 1;
break;
case 'r':
reset = true;
break;
case 'c':
errno = 0;
codepage = strtol(optarg, &tmp, 10);
if (!*optarg || isspace(*optarg) || *tmp || errno || codepage < 0 || codepage > INT_MAX) {
fprintf(stderr, "Invalid codepage : %s\n", optarg);
usage(1, 0);
}
if (!set_dos_codepage(codepage))
usage(1, 0);
break;
case 'V':
printf("fatlabel " VERSION " (" VERSION_DATE ")\n");
exit(0);
break;
case 'h':
usage(0, 0);
break;
case '?':
usage(1, 0);
exit(1);
default:
fprintf(stderr,
"Internal error: getopt_long() returned unexpected value %d\n", c);
exit(2);
}
}
if (!set_dos_codepage(-1)) /* set default codepage if none was given in command line */
exit(1);
if (optind == argc - 2) {
change = true;
} else if (optind == argc - 1) {
change = false;
} else {
usage(1, 1);
}
if (change || reset)
rw = 1;
if (change && reset) {
fprintf(stderr, "fatlabel: giving new value with --reset not allowed\n");
exit(1);
}
device = argv[optind++];
if (change)
new = argv[optind];
if (!volid_mode)
handle_label(change, reset, device, new);
else
handle_volid(change, reset, device, new);
fs_close(rw);
return 0;
}
dosfstools-4.2/src/version.h.in 0000644 0001750 0001750 00000002031 14005523510 013520 0000000 0000000 /* @configure_input@
Copyright (C) 1998-2005 Roman Hodek
Copyright (C) 2008-2014 Daniel Baumann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
#ifndef _version_h
#define _version_h
#define VERSION "@PACKAGE_VERSION@"
#define VERSION_DATE "@RELEASE_DATE@"
#endif
dosfstools-4.2/src/Makefile.in 0000644 0001750 0001750 00000136133 14005523525 013343 0000000 0000000 # Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# dosfstools src/Makefile.am
# Copyright (C) 2015 Andreas Bombe
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
sbin_PROGRAMS = fsck.fat$(EXEEXT) mkfs.fat$(EXEEXT) fatlabel$(EXEEXT)
noinst_PROGRAMS = testdevinfo$(EXEEXT)
subdir = src
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES = version.h
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(sbindir)"
PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS)
am__objects_1 = charconv.$(OBJEXT)
am__objects_2 = boot.$(OBJEXT) common.$(OBJEXT) fat.$(OBJEXT) \
io.$(OBJEXT) $(am__objects_1)
am_fatlabel_OBJECTS = fatlabel.$(OBJEXT) $(am__objects_2)
fatlabel_OBJECTS = $(am_fatlabel_OBJECTS)
am__DEPENDENCIES_1 =
am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
fatlabel_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_fsck_fat_OBJECTS = check.$(OBJEXT) file.$(OBJEXT) \
fsck.fat.$(OBJEXT) lfn.$(OBJEXT) $(am__objects_2)
fsck_fat_OBJECTS = $(am_fsck_fat_OBJECTS)
fsck_fat_DEPENDENCIES = $(am__DEPENDENCIES_2)
am__objects_3 = mkfs_fat-charconv.$(OBJEXT)
am__dirstamp = $(am__leading_dot)dirstamp
am__objects_4 = mkfs_fat-device_info.$(OBJEXT) \
blkdev/mkfs_fat-blkdev.$(OBJEXT) \
blkdev/mkfs_fat-linux_version.$(OBJEXT)
am_mkfs_fat_OBJECTS = mkfs_fat-mkfs.fat.$(OBJEXT) \
mkfs_fat-common.$(OBJEXT) $(am__objects_3) $(am__objects_4)
mkfs_fat_OBJECTS = $(am_mkfs_fat_OBJECTS)
mkfs_fat_DEPENDENCIES = $(am__DEPENDENCIES_2)
mkfs_fat_LINK = $(CCLD) $(mkfs_fat_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
am__objects_5 = testdevinfo-device_info.$(OBJEXT) \
blkdev/testdevinfo-blkdev.$(OBJEXT) \
blkdev/testdevinfo-linux_version.$(OBJEXT)
am_testdevinfo_OBJECTS = testdevinfo-testdevinfo.$(OBJEXT) \
$(am__objects_5)
testdevinfo_OBJECTS = $(am_testdevinfo_OBJECTS)
testdevinfo_LDADD = $(LDADD)
testdevinfo_LINK = $(CCLD) $(testdevinfo_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/boot.Po ./$(DEPDIR)/charconv.Po \
./$(DEPDIR)/check.Po ./$(DEPDIR)/common.Po ./$(DEPDIR)/fat.Po \
./$(DEPDIR)/fatlabel.Po ./$(DEPDIR)/file.Po \
./$(DEPDIR)/fsck.fat.Po ./$(DEPDIR)/io.Po ./$(DEPDIR)/lfn.Po \
./$(DEPDIR)/mkfs_fat-charconv.Po \
./$(DEPDIR)/mkfs_fat-common.Po \
./$(DEPDIR)/mkfs_fat-device_info.Po \
./$(DEPDIR)/mkfs_fat-mkfs.fat.Po \
./$(DEPDIR)/testdevinfo-device_info.Po \
./$(DEPDIR)/testdevinfo-testdevinfo.Po \
blkdev/$(DEPDIR)/mkfs_fat-blkdev.Po \
blkdev/$(DEPDIR)/mkfs_fat-linux_version.Po \
blkdev/$(DEPDIR)/testdevinfo-blkdev.Po \
blkdev/$(DEPDIR)/testdevinfo-linux_version.Po
am__mv = mv -f
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(fatlabel_SOURCES) $(fsck_fat_SOURCES) $(mkfs_fat_SOURCES) \
$(testdevinfo_SOURCES)
DIST_SOURCES = $(fatlabel_SOURCES) $(fsck_fat_SOURCES) \
$(mkfs_fat_SOURCES) $(testdevinfo_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/version.h.in \
$(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHECKATARI = @CHECKATARI@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RELEASE_DATE = @RELEASE_DATE@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
XXD_FOUND = @XXD_FOUND@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CFLAGS = -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers \
-Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings
EXTRA_DIST = blkdev/README
charconv_common_sources = charconv.c charconv.h
charconv_common_ldadd = $(LIBICONV)
fscklabel_common_sources = boot.c boot.h common.c common.h \
fat.c fat.h io.c io.h msdos_fs.h \
$(charconv_common_sources) \
fsck.fat.h endian_compat.h
fsck_fat_SOURCES = check.c check.h file.c file.h fsck.fat.c \
lfn.c lfn.h \
$(fscklabel_common_sources)
fsck_fat_LDADD = $(charconv_common_ldadd)
fatlabel_SOURCES = fatlabel.c $(fscklabel_common_sources)
fatlabel_LDADD = $(charconv_common_ldadd)
devinfo_common_sources = device_info.c device_info.h \
blkdev/blkdev.c blkdev/blkdev.h \
blkdev/linux_version.c blkdev/linux_version.h
mkfs_fat_SOURCES = mkfs.fat.c msdos_fs.h common.c common.h endian_compat.h \
$(charconv_common_sources) $(devinfo_common_sources)
mkfs_fat_CPPFLAGS = -I$(srcdir)/blkdev
mkfs_fat_CFLAGS = $(AM_CFLAGS)
mkfs_fat_LDADD = $(charconv_common_ldadd)
testdevinfo_SOURCES = testdevinfo.c $(devinfo_common_sources)
testdevinfo_CPPFLAGS = -I$(srcdir)/blkdev
testdevinfo_CFLAGS = $(AM_CFLAGS)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign src/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
version.h: $(top_builddir)/config.status $(srcdir)/version.h.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
clean-noinstPROGRAMS:
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
install-sbinPROGRAMS: $(sbin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p \
; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' \
-e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
} \
; done
uninstall-sbinPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' \
`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(sbindir)" && rm -f $$files
clean-sbinPROGRAMS:
-test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
fatlabel$(EXEEXT): $(fatlabel_OBJECTS) $(fatlabel_DEPENDENCIES) $(EXTRA_fatlabel_DEPENDENCIES)
@rm -f fatlabel$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(fatlabel_OBJECTS) $(fatlabel_LDADD) $(LIBS)
fsck.fat$(EXEEXT): $(fsck_fat_OBJECTS) $(fsck_fat_DEPENDENCIES) $(EXTRA_fsck_fat_DEPENDENCIES)
@rm -f fsck.fat$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(fsck_fat_OBJECTS) $(fsck_fat_LDADD) $(LIBS)
blkdev/$(am__dirstamp):
@$(MKDIR_P) blkdev
@: > blkdev/$(am__dirstamp)
blkdev/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) blkdev/$(DEPDIR)
@: > blkdev/$(DEPDIR)/$(am__dirstamp)
blkdev/mkfs_fat-blkdev.$(OBJEXT): blkdev/$(am__dirstamp) \
blkdev/$(DEPDIR)/$(am__dirstamp)
blkdev/mkfs_fat-linux_version.$(OBJEXT): blkdev/$(am__dirstamp) \
blkdev/$(DEPDIR)/$(am__dirstamp)
mkfs.fat$(EXEEXT): $(mkfs_fat_OBJECTS) $(mkfs_fat_DEPENDENCIES) $(EXTRA_mkfs_fat_DEPENDENCIES)
@rm -f mkfs.fat$(EXEEXT)
$(AM_V_CCLD)$(mkfs_fat_LINK) $(mkfs_fat_OBJECTS) $(mkfs_fat_LDADD) $(LIBS)
blkdev/testdevinfo-blkdev.$(OBJEXT): blkdev/$(am__dirstamp) \
blkdev/$(DEPDIR)/$(am__dirstamp)
blkdev/testdevinfo-linux_version.$(OBJEXT): blkdev/$(am__dirstamp) \
blkdev/$(DEPDIR)/$(am__dirstamp)
testdevinfo$(EXEEXT): $(testdevinfo_OBJECTS) $(testdevinfo_DEPENDENCIES) $(EXTRA_testdevinfo_DEPENDENCIES)
@rm -f testdevinfo$(EXEEXT)
$(AM_V_CCLD)$(testdevinfo_LINK) $(testdevinfo_OBJECTS) $(testdevinfo_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
-rm -f blkdev/*.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/boot.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/charconv.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fat.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fatlabel.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsck.fat.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lfn.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfs_fat-charconv.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfs_fat-common.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfs_fat-device_info.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfs_fat-mkfs.fat.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdevinfo-device_info.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdevinfo-testdevinfo.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@blkdev/$(DEPDIR)/mkfs_fat-blkdev.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@blkdev/$(DEPDIR)/mkfs_fat-linux_version.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@blkdev/$(DEPDIR)/testdevinfo-blkdev.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@blkdev/$(DEPDIR)/testdevinfo-linux_version.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
mkfs_fat-mkfs.fat.o: mkfs.fat.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT mkfs_fat-mkfs.fat.o -MD -MP -MF $(DEPDIR)/mkfs_fat-mkfs.fat.Tpo -c -o mkfs_fat-mkfs.fat.o `test -f 'mkfs.fat.c' || echo '$(srcdir)/'`mkfs.fat.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mkfs_fat-mkfs.fat.Tpo $(DEPDIR)/mkfs_fat-mkfs.fat.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mkfs.fat.c' object='mkfs_fat-mkfs.fat.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@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.o `test -f 'mkfs.fat.c' || echo '$(srcdir)/'`mkfs.fat.c
mkfs_fat-mkfs.fat.obj: mkfs.fat.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT mkfs_fat-mkfs.fat.obj -MD -MP -MF $(DEPDIR)/mkfs_fat-mkfs.fat.Tpo -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`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mkfs_fat-mkfs.fat.Tpo $(DEPDIR)/mkfs_fat-mkfs.fat.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mkfs.fat.c' object='mkfs_fat-mkfs.fat.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@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`
mkfs_fat-common.o: common.c
@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
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mkfs_fat-common.Tpo $(DEPDIR)/mkfs_fat-common.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='common.c' object='mkfs_fat-common.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@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
mkfs_fat-common.obj: common.c
@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`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mkfs_fat-common.Tpo $(DEPDIR)/mkfs_fat-common.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='common.c' object='mkfs_fat-common.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@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`
mkfs_fat-charconv.o: charconv.c
@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
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mkfs_fat-charconv.Tpo $(DEPDIR)/mkfs_fat-charconv.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='charconv.c' object='mkfs_fat-charconv.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@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
mkfs_fat-charconv.obj: charconv.c
@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`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mkfs_fat-charconv.Tpo $(DEPDIR)/mkfs_fat-charconv.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='charconv.c' object='mkfs_fat-charconv.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@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`
mkfs_fat-device_info.o: device_info.c
@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
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mkfs_fat-device_info.Tpo $(DEPDIR)/mkfs_fat-device_info.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='device_info.c' object='mkfs_fat-device_info.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@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-device_info.o `test -f 'device_info.c' || echo '$(srcdir)/'`device_info.c
mkfs_fat-device_info.obj: device_info.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT mkfs_fat-device_info.obj -MD -MP -MF $(DEPDIR)/mkfs_fat-device_info.Tpo -c -o mkfs_fat-device_info.obj `if test -f 'device_info.c'; then $(CYGPATH_W) 'device_info.c'; else $(CYGPATH_W) '$(srcdir)/device_info.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mkfs_fat-device_info.Tpo $(DEPDIR)/mkfs_fat-device_info.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='device_info.c' object='mkfs_fat-device_info.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@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-device_info.obj `if test -f 'device_info.c'; then $(CYGPATH_W) 'device_info.c'; else $(CYGPATH_W) '$(srcdir)/device_info.c'; fi`
blkdev/mkfs_fat-blkdev.o: blkdev/blkdev.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT blkdev/mkfs_fat-blkdev.o -MD -MP -MF blkdev/$(DEPDIR)/mkfs_fat-blkdev.Tpo -c -o blkdev/mkfs_fat-blkdev.o `test -f 'blkdev/blkdev.c' || echo '$(srcdir)/'`blkdev/blkdev.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) blkdev/$(DEPDIR)/mkfs_fat-blkdev.Tpo blkdev/$(DEPDIR)/mkfs_fat-blkdev.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='blkdev/blkdev.c' object='blkdev/mkfs_fat-blkdev.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o blkdev/mkfs_fat-blkdev.o `test -f 'blkdev/blkdev.c' || echo '$(srcdir)/'`blkdev/blkdev.c
blkdev/mkfs_fat-blkdev.obj: blkdev/blkdev.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT blkdev/mkfs_fat-blkdev.obj -MD -MP -MF blkdev/$(DEPDIR)/mkfs_fat-blkdev.Tpo -c -o blkdev/mkfs_fat-blkdev.obj `if test -f 'blkdev/blkdev.c'; then $(CYGPATH_W) 'blkdev/blkdev.c'; else $(CYGPATH_W) '$(srcdir)/blkdev/blkdev.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) blkdev/$(DEPDIR)/mkfs_fat-blkdev.Tpo blkdev/$(DEPDIR)/mkfs_fat-blkdev.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='blkdev/blkdev.c' object='blkdev/mkfs_fat-blkdev.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o blkdev/mkfs_fat-blkdev.obj `if test -f 'blkdev/blkdev.c'; then $(CYGPATH_W) 'blkdev/blkdev.c'; else $(CYGPATH_W) '$(srcdir)/blkdev/blkdev.c'; fi`
blkdev/mkfs_fat-linux_version.o: blkdev/linux_version.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT blkdev/mkfs_fat-linux_version.o -MD -MP -MF blkdev/$(DEPDIR)/mkfs_fat-linux_version.Tpo -c -o blkdev/mkfs_fat-linux_version.o `test -f 'blkdev/linux_version.c' || echo '$(srcdir)/'`blkdev/linux_version.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) blkdev/$(DEPDIR)/mkfs_fat-linux_version.Tpo blkdev/$(DEPDIR)/mkfs_fat-linux_version.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='blkdev/linux_version.c' object='blkdev/mkfs_fat-linux_version.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o blkdev/mkfs_fat-linux_version.o `test -f 'blkdev/linux_version.c' || echo '$(srcdir)/'`blkdev/linux_version.c
blkdev/mkfs_fat-linux_version.obj: blkdev/linux_version.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT blkdev/mkfs_fat-linux_version.obj -MD -MP -MF blkdev/$(DEPDIR)/mkfs_fat-linux_version.Tpo -c -o blkdev/mkfs_fat-linux_version.obj `if test -f 'blkdev/linux_version.c'; then $(CYGPATH_W) 'blkdev/linux_version.c'; else $(CYGPATH_W) '$(srcdir)/blkdev/linux_version.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) blkdev/$(DEPDIR)/mkfs_fat-linux_version.Tpo blkdev/$(DEPDIR)/mkfs_fat-linux_version.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='blkdev/linux_version.c' object='blkdev/mkfs_fat-linux_version.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o blkdev/mkfs_fat-linux_version.obj `if test -f 'blkdev/linux_version.c'; then $(CYGPATH_W) 'blkdev/linux_version.c'; else $(CYGPATH_W) '$(srcdir)/blkdev/linux_version.c'; fi`
testdevinfo-testdevinfo.o: testdevinfo.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -MT testdevinfo-testdevinfo.o -MD -MP -MF $(DEPDIR)/testdevinfo-testdevinfo.Tpo -c -o testdevinfo-testdevinfo.o `test -f 'testdevinfo.c' || echo '$(srcdir)/'`testdevinfo.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testdevinfo-testdevinfo.Tpo $(DEPDIR)/testdevinfo-testdevinfo.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testdevinfo.c' object='testdevinfo-testdevinfo.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -c -o testdevinfo-testdevinfo.o `test -f 'testdevinfo.c' || echo '$(srcdir)/'`testdevinfo.c
testdevinfo-testdevinfo.obj: testdevinfo.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -MT testdevinfo-testdevinfo.obj -MD -MP -MF $(DEPDIR)/testdevinfo-testdevinfo.Tpo -c -o testdevinfo-testdevinfo.obj `if test -f 'testdevinfo.c'; then $(CYGPATH_W) 'testdevinfo.c'; else $(CYGPATH_W) '$(srcdir)/testdevinfo.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testdevinfo-testdevinfo.Tpo $(DEPDIR)/testdevinfo-testdevinfo.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testdevinfo.c' object='testdevinfo-testdevinfo.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -c -o testdevinfo-testdevinfo.obj `if test -f 'testdevinfo.c'; then $(CYGPATH_W) 'testdevinfo.c'; else $(CYGPATH_W) '$(srcdir)/testdevinfo.c'; fi`
testdevinfo-device_info.o: device_info.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -MT testdevinfo-device_info.o -MD -MP -MF $(DEPDIR)/testdevinfo-device_info.Tpo -c -o testdevinfo-device_info.o `test -f 'device_info.c' || echo '$(srcdir)/'`device_info.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testdevinfo-device_info.Tpo $(DEPDIR)/testdevinfo-device_info.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='device_info.c' object='testdevinfo-device_info.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -c -o testdevinfo-device_info.o `test -f 'device_info.c' || echo '$(srcdir)/'`device_info.c
testdevinfo-device_info.obj: device_info.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -MT testdevinfo-device_info.obj -MD -MP -MF $(DEPDIR)/testdevinfo-device_info.Tpo -c -o testdevinfo-device_info.obj `if test -f 'device_info.c'; then $(CYGPATH_W) 'device_info.c'; else $(CYGPATH_W) '$(srcdir)/device_info.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testdevinfo-device_info.Tpo $(DEPDIR)/testdevinfo-device_info.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='device_info.c' object='testdevinfo-device_info.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -c -o testdevinfo-device_info.obj `if test -f 'device_info.c'; then $(CYGPATH_W) 'device_info.c'; else $(CYGPATH_W) '$(srcdir)/device_info.c'; fi`
blkdev/testdevinfo-blkdev.o: blkdev/blkdev.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -MT blkdev/testdevinfo-blkdev.o -MD -MP -MF blkdev/$(DEPDIR)/testdevinfo-blkdev.Tpo -c -o blkdev/testdevinfo-blkdev.o `test -f 'blkdev/blkdev.c' || echo '$(srcdir)/'`blkdev/blkdev.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) blkdev/$(DEPDIR)/testdevinfo-blkdev.Tpo blkdev/$(DEPDIR)/testdevinfo-blkdev.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='blkdev/blkdev.c' object='blkdev/testdevinfo-blkdev.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -c -o blkdev/testdevinfo-blkdev.o `test -f 'blkdev/blkdev.c' || echo '$(srcdir)/'`blkdev/blkdev.c
blkdev/testdevinfo-blkdev.obj: blkdev/blkdev.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -MT blkdev/testdevinfo-blkdev.obj -MD -MP -MF blkdev/$(DEPDIR)/testdevinfo-blkdev.Tpo -c -o blkdev/testdevinfo-blkdev.obj `if test -f 'blkdev/blkdev.c'; then $(CYGPATH_W) 'blkdev/blkdev.c'; else $(CYGPATH_W) '$(srcdir)/blkdev/blkdev.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) blkdev/$(DEPDIR)/testdevinfo-blkdev.Tpo blkdev/$(DEPDIR)/testdevinfo-blkdev.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='blkdev/blkdev.c' object='blkdev/testdevinfo-blkdev.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -c -o blkdev/testdevinfo-blkdev.obj `if test -f 'blkdev/blkdev.c'; then $(CYGPATH_W) 'blkdev/blkdev.c'; else $(CYGPATH_W) '$(srcdir)/blkdev/blkdev.c'; fi`
blkdev/testdevinfo-linux_version.o: blkdev/linux_version.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -MT blkdev/testdevinfo-linux_version.o -MD -MP -MF blkdev/$(DEPDIR)/testdevinfo-linux_version.Tpo -c -o blkdev/testdevinfo-linux_version.o `test -f 'blkdev/linux_version.c' || echo '$(srcdir)/'`blkdev/linux_version.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) blkdev/$(DEPDIR)/testdevinfo-linux_version.Tpo blkdev/$(DEPDIR)/testdevinfo-linux_version.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='blkdev/linux_version.c' object='blkdev/testdevinfo-linux_version.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -c -o blkdev/testdevinfo-linux_version.o `test -f 'blkdev/linux_version.c' || echo '$(srcdir)/'`blkdev/linux_version.c
blkdev/testdevinfo-linux_version.obj: blkdev/linux_version.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -MT blkdev/testdevinfo-linux_version.obj -MD -MP -MF blkdev/$(DEPDIR)/testdevinfo-linux_version.Tpo -c -o blkdev/testdevinfo-linux_version.obj `if test -f 'blkdev/linux_version.c'; then $(CYGPATH_W) 'blkdev/linux_version.c'; else $(CYGPATH_W) '$(srcdir)/blkdev/linux_version.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) blkdev/$(DEPDIR)/testdevinfo-linux_version.Tpo blkdev/$(DEPDIR)/testdevinfo-linux_version.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='blkdev/linux_version.c' object='blkdev/testdevinfo-linux_version.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -c -o blkdev/testdevinfo-linux_version.obj `if test -f 'blkdev/linux_version.c'; then $(CYGPATH_W) 'blkdev/linux_version.c'; else $(CYGPATH_W) '$(srcdir)/blkdev/linux_version.c'; fi`
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
for dir in "$(DESTDIR)$(sbindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-rm -f blkdev/$(DEPDIR)/$(am__dirstamp)
-rm -f blkdev/$(am__dirstamp)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
@COMPAT_SYMLINKS_FALSE@install-exec-hook:
@COMPAT_SYMLINKS_FALSE@uninstall-hook:
clean: clean-am
clean-am: clean-generic clean-noinstPROGRAMS clean-sbinPROGRAMS \
mostlyclean-am
distclean: distclean-am
-rm -f ./$(DEPDIR)/boot.Po
-rm -f ./$(DEPDIR)/charconv.Po
-rm -f ./$(DEPDIR)/check.Po
-rm -f ./$(DEPDIR)/common.Po
-rm -f ./$(DEPDIR)/fat.Po
-rm -f ./$(DEPDIR)/fatlabel.Po
-rm -f ./$(DEPDIR)/file.Po
-rm -f ./$(DEPDIR)/fsck.fat.Po
-rm -f ./$(DEPDIR)/io.Po
-rm -f ./$(DEPDIR)/lfn.Po
-rm -f ./$(DEPDIR)/mkfs_fat-charconv.Po
-rm -f ./$(DEPDIR)/mkfs_fat-common.Po
-rm -f ./$(DEPDIR)/mkfs_fat-device_info.Po
-rm -f ./$(DEPDIR)/mkfs_fat-mkfs.fat.Po
-rm -f ./$(DEPDIR)/testdevinfo-device_info.Po
-rm -f ./$(DEPDIR)/testdevinfo-testdevinfo.Po
-rm -f blkdev/$(DEPDIR)/mkfs_fat-blkdev.Po
-rm -f blkdev/$(DEPDIR)/mkfs_fat-linux_version.Po
-rm -f blkdev/$(DEPDIR)/testdevinfo-blkdev.Po
-rm -f blkdev/$(DEPDIR)/testdevinfo-linux_version.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-sbinPROGRAMS
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) install-exec-hook
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/boot.Po
-rm -f ./$(DEPDIR)/charconv.Po
-rm -f ./$(DEPDIR)/check.Po
-rm -f ./$(DEPDIR)/common.Po
-rm -f ./$(DEPDIR)/fat.Po
-rm -f ./$(DEPDIR)/fatlabel.Po
-rm -f ./$(DEPDIR)/file.Po
-rm -f ./$(DEPDIR)/fsck.fat.Po
-rm -f ./$(DEPDIR)/io.Po
-rm -f ./$(DEPDIR)/lfn.Po
-rm -f ./$(DEPDIR)/mkfs_fat-charconv.Po
-rm -f ./$(DEPDIR)/mkfs_fat-common.Po
-rm -f ./$(DEPDIR)/mkfs_fat-device_info.Po
-rm -f ./$(DEPDIR)/mkfs_fat-mkfs.fat.Po
-rm -f ./$(DEPDIR)/testdevinfo-device_info.Po
-rm -f ./$(DEPDIR)/testdevinfo-testdevinfo.Po
-rm -f blkdev/$(DEPDIR)/mkfs_fat-blkdev.Po
-rm -f blkdev/$(DEPDIR)/mkfs_fat-linux_version.Po
-rm -f blkdev/$(DEPDIR)/testdevinfo-blkdev.Po
-rm -f blkdev/$(DEPDIR)/testdevinfo-linux_version.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-sbinPROGRAMS
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) uninstall-hook
.MAKE: install-am install-exec-am install-strip uninstall-am
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-generic clean-noinstPROGRAMS clean-sbinPROGRAMS \
cscopelist-am ctags ctags-am distclean distclean-compile \
distclean-generic distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-exec-hook install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-hook \
uninstall-sbinPROGRAMS
.PRECIOUS: Makefile
@COMPAT_SYMLINKS_TRUE@install-exec-hook:
@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(sbindir) && $(LN_S) -f fatlabel dosfslabel
@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(sbindir) && $(LN_S) -f fsck.fat dosfsck
@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(sbindir) && $(LN_S) -f fsck.fat fsck.msdos
@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(sbindir) && $(LN_S) -f fsck.fat fsck.vfat
@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(sbindir) && $(LN_S) -f mkfs.fat mkdosfs
@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(sbindir) && $(LN_S) -f mkfs.fat mkfs.msdos
@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(sbindir) && $(LN_S) -f mkfs.fat mkfs.vfat
@COMPAT_SYMLINKS_TRUE@uninstall-hook:
@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(sbindir)/dosfslabel
@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(sbindir)/dosfsck
@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(sbindir)/fsck.msdos
@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(sbindir)/fsck.vfat
@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(sbindir)/mkdosfs
@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(sbindir)/mkfs.msdos
@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(sbindir)/mkfs.vfat
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
dosfstools-4.2/src/Makefile.am 0000644 0001750 0001750 00000005270 14005523510 013321 0000000 0000000 # dosfstools src/Makefile.am
# Copyright (C) 2015 Andreas Bombe
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
AM_CFLAGS = -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers \
-Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings
sbin_PROGRAMS = fsck.fat mkfs.fat fatlabel
noinst_PROGRAMS = testdevinfo
EXTRA_DIST = blkdev/README
charconv_common_sources = charconv.c charconv.h
charconv_common_ldadd = $(LIBICONV)
fscklabel_common_sources = boot.c boot.h common.c common.h \
fat.c fat.h io.c io.h msdos_fs.h \
$(charconv_common_sources) \
fsck.fat.h endian_compat.h
fsck_fat_SOURCES = check.c check.h file.c file.h fsck.fat.c \
lfn.c lfn.h \
$(fscklabel_common_sources)
fsck_fat_LDADD = $(charconv_common_ldadd)
fatlabel_SOURCES = fatlabel.c $(fscklabel_common_sources)
fatlabel_LDADD = $(charconv_common_ldadd)
devinfo_common_sources = device_info.c device_info.h \
blkdev/blkdev.c blkdev/blkdev.h \
blkdev/linux_version.c blkdev/linux_version.h
mkfs_fat_SOURCES = mkfs.fat.c msdos_fs.h common.c common.h endian_compat.h \
$(charconv_common_sources) $(devinfo_common_sources)
mkfs_fat_CPPFLAGS = -I$(srcdir)/blkdev
mkfs_fat_CFLAGS = $(AM_CFLAGS)
mkfs_fat_LDADD = $(charconv_common_ldadd)
testdevinfo_SOURCES = testdevinfo.c $(devinfo_common_sources)
testdevinfo_CPPFLAGS = -I$(srcdir)/blkdev
testdevinfo_CFLAGS = $(AM_CFLAGS)
if COMPAT_SYMLINKS
install-exec-hook:
cd $(DESTDIR)$(sbindir) && $(LN_S) -f fatlabel dosfslabel
cd $(DESTDIR)$(sbindir) && $(LN_S) -f fsck.fat dosfsck
cd $(DESTDIR)$(sbindir) && $(LN_S) -f fsck.fat fsck.msdos
cd $(DESTDIR)$(sbindir) && $(LN_S) -f fsck.fat fsck.vfat
cd $(DESTDIR)$(sbindir) && $(LN_S) -f mkfs.fat mkdosfs
cd $(DESTDIR)$(sbindir) && $(LN_S) -f mkfs.fat mkfs.msdos
cd $(DESTDIR)$(sbindir) && $(LN_S) -f mkfs.fat mkfs.vfat
uninstall-hook:
$(RM) $(DESTDIR)$(sbindir)/dosfslabel
$(RM) $(DESTDIR)$(sbindir)/dosfsck
$(RM) $(DESTDIR)$(sbindir)/fsck.msdos
$(RM) $(DESTDIR)$(sbindir)/fsck.vfat
$(RM) $(DESTDIR)$(sbindir)/mkdosfs
$(RM) $(DESTDIR)$(sbindir)/mkfs.msdos
$(RM) $(DESTDIR)$(sbindir)/mkfs.vfat
endif
dosfstools-4.2/src/blkdev/ 0000755 0001750 0001750 00000000000 14005523537 012621 5 0000000 0000000 dosfstools-4.2/src/blkdev/README 0000644 0001750 0001750 00000000253 14005523510 013410 0000000 0000000 The source files blkdev.[ch] and linux_version.[ch] have been taken from
util-linux (git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git)
git revision 42f536ee8.
dosfstools-4.2/src/blkdev/linux_version.h 0000644 0001750 0001750 00000000413 14005523510 015603 0000000 0000000 #ifndef LINUX_VERSION_H
#define LINUX_VERSION_H
#ifdef HAVE_LINUX_VERSION_H
# include
#endif
#ifndef KERNEL_VERSION
# define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
#endif
int get_linux_version(void);
#endif /* LINUX_VERSION_H */
dosfstools-4.2/src/blkdev/linux_version.c 0000644 0001750 0001750 00000000661 14005523510 015603 0000000 0000000 #include
#include
#include "linux_version.h"
int get_linux_version (void)
{
static int kver = -1;
struct utsname uts;
int major = 0;
int minor = 0;
int teeny = 0;
int n;
if (kver != -1)
return kver;
if (uname (&uts))
return kver = 0;
n = sscanf(uts.release, "%d.%d.%d", &major, &minor, &teeny);
if (n < 1 || n > 3)
return kver = 0;
return kver = KERNEL_VERSION(major, minor, teeny);
}
dosfstools-4.2/src/blkdev/blkdev.h 0000644 0001750 0001750 00000011114 14005523510 014146 0000000 0000000 /*
* No copyright is claimed. This code is in the public domain; do with
* it what you wish.
*
* Written by Karel Zak
*/
#ifndef BLKDEV_H
#define BLKDEV_H
#include
#include
#ifdef HAVE_SYS_IOCCOM_H
# include /* for _IO macro on e.g. Solaris */
#endif
#include
#include
#ifdef HAVE_SYS_MKDEV_H
# include /* major and minor on Solaris */
#endif
#define DEFAULT_SECTOR_SIZE 512
#ifdef __linux__
/* very basic ioctls, should be available everywhere */
# ifndef BLKROSET
# define BLKROSET _IO(0x12,93) /* set device read-only (0 = read-write) */
# define BLKROGET _IO(0x12,94) /* get read-only status (0 = read_write) */
# define BLKRRPART _IO(0x12,95) /* re-read partition table */
# define BLKGETSIZE _IO(0x12,96) /* return device size /512 (long *arg) */
# define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
# define BLKRASET _IO(0x12,98) /* set read ahead for block device */
# define BLKRAGET _IO(0x12,99) /* get current read ahead setting */
# define BLKFRASET _IO(0x12,100) /* set filesystem (mm/filemap.c) read-ahead */
# define BLKFRAGET _IO(0x12,101) /* get filesystem (mm/filemap.c) read-ahead */
# define BLKSECTSET _IO(0x12,102) /* set max sectors per request (ll_rw_blk.c) */
# define BLKSECTGET _IO(0x12,103) /* get max sectors per request (ll_rw_blk.c) */
# define BLKSSZGET _IO(0x12,104) /* get block device sector size */
/* ioctls introduced in 2.2.16, removed in 2.5.58 */
# define BLKELVGET _IOR(0x12,106,size_t) /* elevator get */
# define BLKELVSET _IOW(0x12,107,size_t) /* elevator set */
# define BLKBSZGET _IOR(0x12,112,size_t)
# define BLKBSZSET _IOW(0x12,113,size_t)
# endif /* !BLKROSET */
# ifndef BLKGETSIZE64
# define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */
# endif
/* block device topology ioctls, introduced in 2.6.32 (commit ac481c20) */
# ifndef BLKIOMIN
# define BLKIOMIN _IO(0x12,120)
# define BLKIOOPT _IO(0x12,121)
# define BLKALIGNOFF _IO(0x12,122)
# define BLKPBSZGET _IO(0x12,123)
# endif
/* discard zeroes support, introduced in 2.6.33 (commit 98262f27) */
# ifndef BLKDISCARDZEROES
# define BLKDISCARDZEROES _IO(0x12,124)
# endif
/* filesystem freeze, introduced in 2.6.29 (commit fcccf502) */
# ifndef FIFREEZE
# define FIFREEZE _IOWR('X', 119, int) /* Freeze */
# define FITHAW _IOWR('X', 120, int) /* Thaw */
# endif
/* uniform CD-ROM information */
# ifndef CDROM_GET_CAPABILITY
# define CDROM_GET_CAPABILITY 0x5331
# endif
#endif /* __linux */
#ifdef APPLE_DARWIN
# define BLKGETSIZE DKIOCGETBLOCKCOUNT32
#endif
#ifndef HDIO_GETGEO
# ifdef __linux__
# define HDIO_GETGEO 0x0301
# endif
struct hd_geometry {
unsigned char heads;
unsigned char sectors;
unsigned short cylinders; /* truncated */
unsigned long start;
};
#endif /* HDIO_GETGEO */
/* are we working with block device? */
int is_blkdev(int fd);
/* Determine size in bytes */
off_t blkdev_find_size (int fd);
/* get size in bytes */
int blkdev_get_size(int fd, unsigned long long *bytes);
/* get 512-byte sector count */
int blkdev_get_sectors(int fd, unsigned long long *sectors);
/* get hardware sector size */
int blkdev_get_sector_size(int fd, int *sector_size);
/* specifies whether or not the device is misaligned */
int blkdev_is_misaligned(int fd);
/* get physical block device size */
int blkdev_get_physector_size(int fd, int *sector_size);
/* is the device cdrom capable? */
int blkdev_is_cdrom(int fd);
/* get device's geometry - legacy */
int blkdev_get_geometry(int fd, unsigned int *h, unsigned int *s);
/* get partition devices start offset */
int blkdev_get_start(int fd, dev_t rdev, unsigned long long *s);
/* SCSI device types. Copied almost as-is from kernel header.
* http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/scsi/scsi.h */
#define SCSI_TYPE_DISK 0x00
#define SCSI_TYPE_TAPE 0x01
#define SCSI_TYPE_PRINTER 0x02
#define SCSI_TYPE_PROCESSOR 0x03 /* HP scanners use this */
#define SCSI_TYPE_WORM 0x04 /* Treated as ROM by our system */
#define SCSI_TYPE_ROM 0x05
#define SCSI_TYPE_SCANNER 0x06
#define SCSI_TYPE_MOD 0x07 /* Magneto-optical disk - treated as SCSI_TYPE_DISK */
#define SCSI_TYPE_MEDIUM_CHANGER 0x08
#define SCSI_TYPE_COMM 0x09 /* Communications device */
#define SCSI_TYPE_RAID 0x0c
#define SCSI_TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */
#define SCSI_TYPE_RBC 0x0e
#define SCSI_TYPE_OSD 0x11
#define SCSI_TYPE_NO_LUN 0x7f
/* convert scsi type code to name */
const char *blkdev_scsi_type_to_name(int type);
#endif /* BLKDEV_H */
dosfstools-4.2/src/blkdev/blkdev.c 0000644 0001750 0001750 00000016632 14005523510 014153 0000000 0000000 /*
* No copyright is claimed. This code is in the public domain; do with
* it what you wish.
*
* Written by Karel Zak
*/
#include
#include
#include
#include
#include
#include
#include
#include
#ifdef HAVE_LINUX_HDREG_H
#include
#endif
#ifdef HAVE_LINUX_FD_H
#include
#endif
#ifdef HAVE_SYS_DISKLABEL_H
#include
#endif
#ifdef HAVE_SYS_DISK_H
# ifdef HAVE_SYS_QUEUE_H
# include