dosfstools-4.2/0000755000175000017500000000000014005523537010563 500000000000000dosfstools-4.2/test-driver0000755000175000017500000001104214005523525012674 00000000000000#! /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/0000755000175000017500000000000014005523537011725 500000000000000dosfstools-4.2/tests/Makefile.in0000644000175000017500000010032614005523525013711 00000000000000# 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=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ 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.xxd0000644000175000017500000001620014005523510016102 0000000000000000000000: 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.label0000644000175000017500000000000014005523510016345 00000000000000dosfstools-4.2/tests/label-fat32_xp_none_mlabel_label1.xxd0000644000175000017500000002030214005523510020634 0000000000000000000000: 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.label0000644000175000017500000000000714005523510021110 00000000000000LABEL1 dosfstools-4.2/tests/label-fat32_xp_none_dosfslabel_label1.xxd0000644000175000017500000001620014005523510021520 0000000000000000000000: 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.label0000644000175000017500000000000014005523510021763 00000000000000dosfstools-4.2/tests/label-fat32_xp_label1.xxd0000644000175000017500000001651614005523510016315 0000000000000000000000: 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.label0000644000175000017500000000000714005523510016555 00000000000000LABEL1 dosfstools-4.2/tests/label-fat32_mkdosfs_none.xxd0000644000175000017500000000557214005523510017133 0000000000000000000000: 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.label0000644000175000017500000000000014005523510017364 00000000000000dosfstools-4.2/tests/label-fat32_mkdosfs_none_xp_label1.xxd0000644000175000017500000000611014005523510021047 0000000000000000000000: 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.label0000644000175000017500000000000714005523510021322 00000000000000LABEL1 dosfstools-4.2/tests/label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.xxd0000644000175000017500000000611014005523510024466 0000000000000000000000: 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.label0000644000175000017500000000000714005523510024741 00000000000000label2 dosfstools-4.2/tests/label-fat32_mkdosfs_none_dosfslabel_NO_NAME.xxd0000644000175000017500000000557214005523510022525 0000000000000000000000: 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.label0000644000175000017500000000000014005523510022756 00000000000000dosfstools-4.2/tests/label-fat32_mkdosfs_none_dosfslabel_label1.xxd0000644000175000017500000000557214005523510022551 0000000000000000000000: 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.label0000644000175000017500000000000014005523510023002 00000000000000dosfstools-4.2/tests/label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.xxd0000644000175000017500000000611014005523510024466 0000000000000000000000: 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.label0000644000175000017500000000000714005523510024741 00000000000000LABEL2 dosfstools-4.2/tests/label-fat32_mkdosfs_label1.xxd0000644000175000017500000000611014005523510017321 0000000000000000000000: 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.label0000644000175000017500000000000714005523510017574 00000000000000label1 dosfstools-4.2/tests/label-fat32_mkdosfs_label1_xp_label2.xxd0000644000175000017500000000611014005523510021251 0000000000000000000000: 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.label0000644000175000017500000000000714005523510021524 00000000000000LABEL2 dosfstools-4.2/tests/label-fat32_mkdosfs_label1_xp_erase.xxd0000644000175000017500000000611014005523510021207 0000000000000000000000: 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.label0000644000175000017500000000000014005523510021453 00000000000000dosfstools-4.2/tests/label-fat32_mkdosfs_label1_mlabel_NO_NAME.xxd0000644000175000017500000001074214005523510022037 0000000000000000000000: 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.label0000644000175000017500000000001014005523510022276 00000000000000NO NAME dosfstools-4.2/tests/label-fat32_mkdosfs_label1_mlabel_erase.xxd0000644000175000017500000001074214005523510022022 0000000000000000000000: 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.label0000644000175000017500000000000014005523510022260 00000000000000dosfstools-4.2/tests/label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.xxd0000644000175000017500000000611014005523510022713 0000000000000000000000: 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.label0000644000175000017500000000001014005523510023160 00000000000000NO NAME dosfstools-4.2/tests/label-fat32_mkdosfs_label1_dosfslabel_label2.xxd0000644000175000017500000000611014005523510022740 0000000000000000000000: 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.label0000644000175000017500000000000714005523510023213 00000000000000label2 dosfstools-4.2/tests/label-fat32_mkdosfs_label1_dosfslabel_empty.xxd0000644000175000017500000000611014005523510022735 0000000000000000000000: 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.label0000644000175000017500000000000114005523510023202 00000000000000 dosfstools-4.2/tests/check-label-only-root.xxd0000644000175000017500000001651614005523510016464 0000000000000000000000: 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.fsck0000644000175000017500000001651614005523510016607 0000000000000000000000: 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.xxd0000644000175000017500000000611014005523510016431 0000000000000000000000: 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.fsck0000644000175000017500000000611014005523510016554 0000000000000000000000: 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.xxd0000644000175000017500000000611014005523510016455 0000000000000000000000: 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.fsck0000644000175000017500000000611014005523510016600 0000000000000000000000: 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.fsck0000644000175000017500000000536014005523510014513 0000000000000000000000: 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.xxd0000644000175000017500000000547014005523510015761 0000000000000000000000: 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.fsck0000644000175000017500000000505014005523510016076 0000000000000000000000: 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.xxd0000644000175000017500000000411214005523510016567 0000000000000000000000: 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.fsck0000644000175000017500000000411214005523510016712 0000000000000000000000: 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.xxd0000644000175000017500000000453614005523510016412 0000000000000000000000: 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.fsck0000644000175000017500000000432614005523510016532 0000000000000000000000: 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.xxd0000644000175000017500000001340014005523510017416 0000000000000000000000: 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.fsck0000644000175000017500000001276014005523510017551 0000000000000000000000: 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.xxd0000644000175000017500000000370214005523510016420 0000000000000000000000: 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.fsck0000644000175000017500000000370214005523510016543 0000000000000000000000: 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.xxd0000644000175000017500000000347014005523510017766 0000000000000000000000: 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.fsck0000644000175000017500000000347014005523510020111 0000000000000000000000: 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.xxd0000644000175000017500000000621414005523510017122 0000000000000000000000: 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.fsck0000644000175000017500000000621414005523510017245 0000000000000000000000: 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.xxd0000644000175000017500000000253014005523510017121 0000000000000000000000: 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.fsck0000644000175000017500000000253014005523510017244 0000000000000000000000: 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.xxd0000644000175000017500000000621414005523510017326 0000000000000000000000: 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.args0000644000175000017500000000000514005523510017447 00000000000000-F 1 dosfstools-4.2/tests/check-fat32_first_cluster.fsck0000644000175000017500000000621414005523510017451 0000000000000000000000: 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.xxd0000644000175000017500000000253014005523510017325 0000000000000000000000: 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.args0000644000175000017500000000000514005523510017451 00000000000000-F 1 dosfstools-4.2/tests/check-fat16_first_cluster.fsck0000644000175000017500000000253014005523510017450 0000000000000000000000: 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.xxd0000644000175000017500000000242214005523510017321 0000000000000000000000: 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.args0000644000175000017500000000000514005523510017445 00000000000000-F 1 dosfstools-4.2/tests/check-fat12_first_cluster.fsck0000644000175000017500000000242214005523510017444 0000000000000000000000: 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.xxd0000644000175000017500000000410614005523510015346 0000000000000000000000: 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.fsck0000644000175000017500000000410614005523510015471 0000000000000000000000: 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.xxd0000644000175000017500000000674614005523510014611 0000000000000000000000: 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.mkfs0000644000175000017500000000006314005523510014730 00000000000000ARGS="-n TEST4K -S 4096" SIZE=614400 CMP_LIMIT=10M dosfstools-4.2/tests/mkfs-fat32_2_res_sects.xxd0000644000175000017500000000357214005523510016540 0000000000000000000000: 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.mkfs0000644000175000017500000000006714005523510016671 00000000000000ARGS="-n TESTFAT32 -a -R 2" SIZE=1024000 CMP_LIMIT=10M dosfstools-4.2/tests/referenceFAT32mbr.xxd0000644000175000017500000000757214005523510015533 0000000000000000000000: 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.mkfs0000644000175000017500000000006514005523510015656 00000000000000ARGS="-n TESTFAT32 --mbr" SIZE=1024000 CMP_LIMIT=10M dosfstools-4.2/tests/referenceFAT32.xxd0000644000175000017500000000653214005523510015025 0000000000000000000000: 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.mkfs0000644000175000017500000000005714005523510015156 00000000000000ARGS="-n TESTFAT32" SIZE=1024000 CMP_LIMIT=10M dosfstools-4.2/tests/referenceFAT16.xxd0000644000175000017500000000304614005523510015024 0000000000000000000000: 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.mkfs0000644000175000017500000000005514005523510015156 00000000000000ARGS="-n TESTFAT16" SIZE=256000 CMP_LIMIT=1M dosfstools-4.2/tests/referenceFAT12.xxd0000644000175000017500000000274014005523510015020 0000000000000000000000: 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.mkfs0000644000175000017500000000005114005523510015146 00000000000000ARGS="-n TESTFAT12" SIZE=1440 CMP_LIMIT= dosfstools-4.2/tests/test-label0000755000175000017500000000331014005523510013613 00000000000000#!/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-fsck0000755000175000017500000000442214005523510013467 00000000000000#!/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-mkfs0000755000175000017500000000417214005523510013503 00000000000000#!/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.am0000644000175000017500000001433314005523510013674 00000000000000AM_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/0000755000175000017500000000000014005523537012356 500000000000000dosfstools-4.2/manpages/mkfs.fat.8.in0000644000175000017500000003053414005523510014501 00000000000000.\" 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.in0000644000175000017500000002462714005523510014475 00000000000000.\" 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.in0000644000175000017500000001577514005523510014554 00000000000000.\" 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.in0000644000175000017500000004144714005523525014352 00000000000000# 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.am0000644000175000017500000000307714005523510014330 00000000000000# 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/depcomp0000755000175000017500000005602014005523525012060 00000000000000#! /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/0000755000175000017500000000000014005523537011352 500000000000000dosfstools-4.2/src/testdevinfo.c0000644000175000017500000000536714005523510013772 00000000000000/* 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.h0000644000175000017500000000237214005523510013710 00000000000000#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.c0000644000175000017500000002242714005523510013706 00000000000000/* 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.c0000644000175000017500000020445314005523510013146 00000000000000/* 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.h0000644000175000017500000000253014005523510012211 00000000000000/* 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.c0000644000175000017500000003622314005523510012212 00000000000000/* 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.c0000644000175000017500000002033514005523510013127 00000000000000/* 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.h0000644000175000017500000000434114005523510012353 00000000000000/* 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.c0000644000175000017500000001516214005523510012351 00000000000000/* 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.h0000644000175000017500000000257014005523510012513 00000000000000/* 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.c0000644000175000017500000011562614005523510012515 00000000000000/* 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.h0000644000175000017500000000152114005523510014232 00000000000000#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.h0000644000175000017500000001645414005523510013143 00000000000000/* 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.h0000644000175000017500000000251714005523510013242 00000000000000/* 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.c0000644000175000017500000003162714005523510013241 00000000000000/* 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.h0000644000175000017500000000454314005523510013255 00000000000000/* 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.h0000644000175000017500000000430114005523510012037 00000000000000/* 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.c0000644000175000017500000001160714005523510012041 00000000000000/* 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.h0000644000175000017500000000605714005523510012214 00000000000000/* 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.c0000644000175000017500000004650714005523510012213 00000000000000/* 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.h0000644000175000017500000000664014005523510012730 00000000000000/* 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.c0000644000175000017500000002074614005523510012726 00000000000000/* 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.h0000644000175000017500000000367614005523510012411 00000000000000/* 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.c0000644000175000017500000005720514005523510012401 00000000000000/* 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.c0000644000175000017500000001600614005523510013202 00000000000000/* 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.in0000644000175000017500000000203114005523510013520 00000000000000/* @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.in0000644000175000017500000013613314005523525013343 00000000000000# 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.am0000644000175000017500000000527014005523510013321 00000000000000# 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/0000755000175000017500000000000014005523537012621 500000000000000dosfstools-4.2/src/blkdev/README0000644000175000017500000000025314005523510013410 00000000000000The 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.h0000644000175000017500000000041314005523510015603 00000000000000#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.c0000644000175000017500000000066114005523510015603 00000000000000#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.h0000644000175000017500000001111414005523510014146 00000000000000/* * 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.c0000644000175000017500000001663214005523510014153 00000000000000/* * 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 /* for LIST_HEAD */ # endif # include #endif #include "blkdev.h" #include "linux_version.h" static long blkdev_valid_offset (int fd, off_t offset) { char ch; if (lseek (fd, offset, 0) < 0) return 0; if (read (fd, &ch, 1) < 1) return 0; return 1; } int is_blkdev(int fd) { struct stat st; return (fstat(fd, &st) == 0 && S_ISBLK(st.st_mode)); } off_t blkdev_find_size (int fd) { uintmax_t high, low = 0; for (high = 1024; blkdev_valid_offset (fd, high); ) { if (high == UINTMAX_MAX) return -1; low = high; if (high >= UINTMAX_MAX/2) high = UINTMAX_MAX; else high *= 2; } while (low < high - 1) { uintmax_t mid = (low + high) / 2; if (blkdev_valid_offset (fd, mid)) low = mid; else high = mid; } blkdev_valid_offset (fd, 0); return (low + 1); } /* get size in bytes */ int blkdev_get_size(int fd, unsigned long long *bytes) { #ifdef DKIOCGETBLOCKCOUNT /* Apple Darwin */ if (ioctl(fd, DKIOCGETBLOCKCOUNT, bytes) >= 0) { *bytes <<= 9; return 0; } #endif #ifdef BLKGETSIZE64 { #ifdef __linux__ int ver = get_linux_version(); /* kernels 2.4.15-2.4.17, had a broken BLKGETSIZE64 */ if (ver >= KERNEL_VERSION (2,6,0) || (ver >= KERNEL_VERSION (2,4,18) && ver < KERNEL_VERSION (2,5,0))) #endif if (ioctl(fd, BLKGETSIZE64, bytes) >= 0) return 0; } #endif /* BLKGETSIZE64 */ #ifdef BLKGETSIZE { unsigned long size; if (ioctl(fd, BLKGETSIZE, &size) >= 0) { *bytes = ((unsigned long long)size << 9); return 0; } } #endif /* BLKGETSIZE */ #ifdef DIOCGMEDIASIZE /* FreeBSD */ if (ioctl(fd, DIOCGMEDIASIZE, bytes) >= 0) return 0; #endif #ifdef FDGETPRM { struct floppy_struct this_floppy; if (ioctl(fd, FDGETPRM, &this_floppy) >= 0) { *bytes = ((unsigned long long) this_floppy.size) << 9; return 0; } } #endif /* FDGETPRM */ #ifdef HAVE_SYS_DISKLABEL_H { /* * This code works for FreeBSD 4.11 i386, except for the full device * (such as /dev/ad0). It doesn't work properly for newer FreeBSD * though. FreeBSD >= 5.0 should be covered by the DIOCGMEDIASIZE * above however. * * Note that FreeBSD >= 4.0 has disk devices as unbuffered (raw, * character) devices, so we need to check for S_ISCHR, too. */ int part = -1; struct disklabel lab; struct partition *pp; struct stat st; if ((fstat(fd, &st) >= 0) && (S_ISBLK(st.st_mode) || S_ISCHR(st.st_mode))) part = st.st_rdev & 7; if (part >= 0 && (ioctl(fd, DIOCGDINFO, (char *)&lab) >= 0)) { pp = &lab.d_partitions[part]; if (pp->p_size) { *bytes = pp->p_size << 9; return 0; } } } #endif /* HAVE_SYS_DISKLABEL_H */ { struct stat st; if (fstat(fd, &st) == 0 && S_ISREG(st.st_mode)) { *bytes = st.st_size; return 0; } if (!S_ISBLK(st.st_mode)) return -1; } *bytes = blkdev_find_size(fd); return 0; } /* get 512-byte sector count */ int blkdev_get_sectors(int fd, unsigned long long *sectors) { unsigned long long bytes; if (blkdev_get_size(fd, &bytes) == 0) { *sectors = (bytes >> 9); return 0; } return -1; } /* * Get logical sector size. * * This is the smallest unit the storage device can * address. It is typically 512 bytes. */ int blkdev_get_sector_size(int fd, int *sector_size) { #ifdef BLKSSZGET if (ioctl(fd, BLKSSZGET, sector_size) >= 0) return 0; return -1; #else (void)fd; /* prevent unused parameter warning */ *sector_size = DEFAULT_SECTOR_SIZE; return 0; #endif } /* * Get physical block device size. The BLKPBSZGET is supported since Linux * 2.6.32. For old kernels is probably the best to assume that physical sector * size is the same as logical sector size. * * Example: * * rc = blkdev_get_physector_size(fd, &physec); * if (rc || physec == 0) { * rc = blkdev_get_sector_size(fd, &physec); * if (rc) * physec = DEFAULT_SECTOR_SIZE; * } */ int blkdev_get_physector_size(int fd, int *sector_size) { #ifdef BLKPBSZGET if (ioctl(fd, BLKPBSZGET, §or_size) >= 0) return 0; return -1; #else (void)fd; /* prevent unused parameter warning */ *sector_size = DEFAULT_SECTOR_SIZE; return 0; #endif } /* * Return the alignment status of a device */ int blkdev_is_misaligned(int fd) { #ifdef BLKALIGNOFF int aligned; if (ioctl(fd, BLKALIGNOFF, &aligned) < 0) return 0; /* probably kernel < 2.6.32 */ /* * Note that kernel returns -1 as alignement offset if no compatible * sizes and alignments exist for stacked devices */ return aligned != 0 ? 1 : 0; #else (void)fd; /* prevent unused parameter warning */ return 0; #endif } int blkdev_is_cdrom(int fd) { #ifdef CDROM_GET_CAPABILITY int ret; if ((ret = ioctl(fd, CDROM_GET_CAPABILITY, NULL)) < 0) return 0; else return ret; #else (void)fd; /* prevent unused parameter warning */ return 0; #endif } /* * Get kernel's interpretation of the device's geometry. * * Returns the heads and sectors - but not cylinders * as it's truncated for disks with more than 65535 tracks. * * Note that this is deprecated in favor of LBA addressing. */ int blkdev_get_geometry(int fd, unsigned int *h, unsigned int *s) { #ifdef HDIO_GETGEO { struct hd_geometry geometry; if (ioctl(fd, HDIO_GETGEO, &geometry) == 0) { *h = geometry.heads; *s = geometry.sectors; return 0; } } #endif #ifdef FDGETPRM { struct floppy_struct fdparam; if (ioctl(fd, FDGETPRM, &fdparam) == 0) { *h = fdparam.head; *s = fdparam.sect; return 0; } } #endif (void)fd; /* prevent unused parameter warning */ *h = 0; *s = 0; return -1; } /* * Get start offset of partition */ int blkdev_get_start(int fd, dev_t rdev, unsigned long long *s) { #ifdef __linux__ { char path[PATH_MAX]; FILE *file; int ret; snprintf(path, sizeof(path), "/sys/dev/block/%d:%d/start", major(rdev), minor(rdev)); file = fopen(path, "r"); if (file) { ret = fscanf(file, "%llu", s); fclose(file); if (ret == 1) return 0; } } #endif #ifdef HDIO_GETGEO { struct hd_geometry geometry; if (ioctl(fd, HDIO_GETGEO, &geometry) == 0) { *s = geometry.start; return 0; } } #endif (void)rdev; /* prevent unused parameter warning */ (void)fd; /* prevent unused parameter warning */ *s = 0; return -1; } /* * Convert scsi type to human readable string. */ const char *blkdev_scsi_type_to_name(int type) { switch (type) { case SCSI_TYPE_DISK: return "disk"; case SCSI_TYPE_TAPE: return "tape"; case SCSI_TYPE_PRINTER: return "printer"; case SCSI_TYPE_PROCESSOR: return "processor"; case SCSI_TYPE_WORM: return "worm"; case SCSI_TYPE_ROM: return "rom"; case SCSI_TYPE_SCANNER: return "scanner"; case SCSI_TYPE_MOD: return "mo-disk"; case SCSI_TYPE_MEDIUM_CHANGER: return "changer"; case SCSI_TYPE_COMM: return "comm"; case SCSI_TYPE_RAID: return "raid"; case SCSI_TYPE_ENCLOSURE: return "enclosure"; case SCSI_TYPE_RBC: return "rbc"; case SCSI_TYPE_OSD: return "osd"; case SCSI_TYPE_NO_LUN: return "no-lun"; default: break; } return NULL; } dosfstools-4.2/autogen.sh0000755000175000017500000000060514005523510012474 00000000000000#!/bin/sh # Install config.rpath which is needed for AM_ICONV macro for dir in "$GETTEXT_DIR" /usr/share/gettext /usr/local/share/gettext; do if test -f "$dir/config.rpath"; then test -f config.rpath || echo "autogen.sh: installing './config.rpath'" cp -f "$dir/config.rpath" . break fi done aclocal --force autoconf --force automake --add-missing --copy --force-missing dosfstools-4.2/missing0000755000175000017500000001533614005523525012107 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # 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. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # 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/install-sh0000755000175000017500000003601014005523525012504 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2018-03-11.20; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # Note that $RANDOM variable is not portable (e.g. dash); Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p' feature. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # 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/config.sub0000755000175000017500000010645014005523525012471 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-02-22' # This file 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 . # # 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 Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo "$1" | sed 's/-[^-]*$//'` if [ "$basic_machine" != "$1" ] then os=`echo "$1" | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | wasm32 \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-pc os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2*) basic_machine=m68k-bull os=-sysv3 ;; e500v[12]) basic_machine=powerpc-unknown os=$os"spe" ;; e500v[12]-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=$os"spe" ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; nsv-tandem) basic_machine=nsv-tandem ;; nsx-tandem) basic_machine=nsx-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh5el) basic_machine=sh5le-unknown ;; simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; x64) basic_machine=x86_64-pc ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases that might get confused # with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # es1800 is here to avoid being matched by es* (a different OS) -es1800*) os=-ose ;; # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ | -midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -xray | -os68k* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo "$os" | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4*) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -pikeos*) # Until real need of OS specific support for # particular features comes up, bare metal # configurations are quite functional. case $basic_machine in arm*) os=-eabi ;; *) os=-elf ;; esac ;; -nacl*) ;; -ios) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; pru-*) os=-elf ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac echo "$basic_machine$os" exit # Local variables: # eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: dosfstools-4.2/config.rpath0000755000175000017500000004421614005523524013016 00000000000000#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2016 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # This file 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. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's _LT_CC_BASENAME. for cc_temp in $CC""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's _LT_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; mingw* | cygwin* | pw32* | os2* | cegcc*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in ecc*) wl='-Wl,' ;; icc* | ifort*) wl='-Wl,' ;; lf95*) wl='-Wl,' ;; nagfor*) wl='-Wl,-Wl,,' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; xl* | bgxl* | bgf* | mpixl*) wl='-Wl,' ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) wl= ;; *Sun\ C*) wl='-Wl,' ;; esac ;; esac ;; newsos6) ;; *nto* | *qnx*) ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; rdos*) ;; solaris*) case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) wl='-Qoption ld ' ;; *) wl='-Wl,' ;; esac ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3*) wl='-Wl,' ;; sysv4*MP*) ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) wl='-Wl,' ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's _LT_LINKER_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' case "$host_os" in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; haiku*) ;; interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' else ld_shlibs=no fi ;; esac ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then hardcode_libdir_flag_spec= fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then : else ld_shlibs=no fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd2.[01]*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no ;; *) hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) ;; sysv5* | sco3.2v5* | sco5v6*) hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. # Unlike libtool.m4, here we don't care about _all_ names of the library, but # only about the one the linker finds when passed -lNAME. This is the last # element of library_names_spec in libtool.m4, or possibly two of them if the # linker has special search rules. library_names_spec= # the last element of library_names_spec in libtool.m4 libname_spec='lib$name' case "$host_os" in aix3*) library_names_spec='$libname.a' ;; aix[4-9]*) library_names_spec='$libname$shrext' ;; amigaos*) case "$host_cpu" in powerpc*) library_names_spec='$libname$shrext' ;; m68k) library_names_spec='$libname.a' ;; esac ;; beos*) library_names_spec='$libname$shrext' ;; bsdi[45]*) library_names_spec='$libname$shrext' ;; cygwin* | mingw* | pw32* | cegcc*) shrext=.dll library_names_spec='$libname.dll.a $libname.lib' ;; darwin* | rhapsody*) shrext=.dylib library_names_spec='$libname$shrext' ;; dgux*) library_names_spec='$libname$shrext' ;; freebsd[23].*) library_names_spec='$libname$shrext$versuffix' ;; freebsd* | dragonfly*) library_names_spec='$libname$shrext' ;; gnu*) library_names_spec='$libname$shrext' ;; haiku*) library_names_spec='$libname$shrext' ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac library_names_spec='$libname$shrext' ;; interix[3-9]*) library_names_spec='$libname$shrext' ;; irix5* | irix6* | nonstopux*) library_names_spec='$libname$shrext' case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) library_names_spec='$libname$shrext' ;; netbsd*) library_names_spec='$libname$shrext' ;; newsos6) library_names_spec='$libname$shrext' ;; *nto* | *qnx*) library_names_spec='$libname$shrext' ;; openbsd*) library_names_spec='$libname$shrext$versuffix' ;; os2*) libname_spec='$name' shrext=.dll library_names_spec='$libname.a' ;; osf3* | osf4* | osf5*) library_names_spec='$libname$shrext' ;; rdos*) ;; solaris*) library_names_spec='$libname$shrext' ;; sunos4*) library_names_spec='$libname$shrext$versuffix' ;; sysv4 | sysv4.3*) library_names_spec='$libname$shrext' ;; sysv4*MP*) library_names_spec='$libname$shrext' ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) library_names_spec='$libname$shrext' ;; tpf*) library_names_spec='$libname$shrext' ;; uts4*) library_names_spec='$libname$shrext' ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. # # 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 Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > "$dummy.c" ; for c in cc gcc c89 c99 ; do if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval "$set_cc_for_build" cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" # If ldd exists, use it to detect musl libc. if command -v ldd >/dev/null && \ ldd --version 2>&1 | grep -q ^musl then LIBC=musl fi ;; esac # Note: order is significant - the case branches are not exclusive. case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ "/sbin/$sysctl" 2>/dev/null || \ "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine="${arch}${endian}"-unknown ;; *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "$machine-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:Sortix:*:*) echo "$UNAME_MACHINE"-unknown-sortix exit ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) echo mips-dec-osf1 exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval "$set_cc_for_build" SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ [ "$TARGET_BINARY_INTERFACE"x = x ] then echo m88k-dg-dgux"$UNAME_RELEASE" else echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` case "$UNAME_MACHINE" in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "$sc_kernel_bits" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "$HP_ARCH" = "" ]; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ "$HP_ARCH" = hppa2.0w ] then eval "$set_cc_for_build" # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo "$UNAME_MACHINE"-unknown-osf1mk else echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) case "$UNAME_MACHINE" in x86) echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; i*:UWIN*:*) echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; i*86:Minix:*:*) echo "$UNAME_MACHINE"-pc-minix exit ;; aarch64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) eval "$set_cc_for_build" if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-"$LIBC" exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) if objdump -f /bin/sh | grep -q elf32-x86-64; then echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32 else echo "$UNAME_MACHINE"-pc-linux-"$LIBC" fi exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv"$UNAME_RELEASE" else echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux"$UNAME_RELEASE" exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval "$set_cc_for_build" if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-*:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; NSR-*:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; NSV-*:NONSTOP_KERNEL:*:*) echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; NSX-*:NONSTOP_KERNEL:*:*) echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: # eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: dosfstools-4.2/compile0000755000175000017500000001632714005523525012067 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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 # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # 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/Makefile.in0000644000175000017500000006420414005523525012553 00000000000000# 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 = . 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 $(top_srcdir)/configure \ $(am__configure_deps) $(dist_doc_DATA) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno 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 = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive 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; }; \ } am__installdirs = "$(DESTDIR)$(docdir)" DATA = $(dist_doc_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck 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 CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in COPYING ChangeLog NEWS README \ compile config.guess config.rpath config.sub install-sh \ missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print 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@ SUBDIRS = src manpages tests dist_doc_DATA = doc/ANNOUNCE.mkdosfs \ doc/ChangeLog.dosfsck \ doc/ChangeLog.dosfstools-2.x \ doc/ChangeLog.mkdosfs \ doc/README.dosfsck \ doc/README.dosfstools-2.x \ doc/README.mkdosfs \ doc/TODO.dosfstools-2.x \ COPYING ChangeLog NEWS README EXTRA_DIST = autogen.sh all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): install-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-dist_docDATA: @$(NORMAL_UNINSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(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-recursive 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" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive 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 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(docdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dist_docDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-dist_docDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dist_docDATA 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 \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ tags-am uninstall uninstall-am uninstall-dist_docDATA .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/README0000644000175000017500000000332614005523510011356 00000000000000dosfstools consists of the programs mkfs.fat, fsck.fat and fatlabel to create, check and label file systems of the FAT family. The dosfstools are licensed under the GNU GPL version 3 or later. See the file COPYING for details. ### Build Requirements The test suite requires the tool xxd (available as part of the vim distribution). ### Installing dosfstools are built using an autoconf/automake system, so the standard method applies: ./configure make make install You need to have superuser privileges in order to install into the standard system wide locations. The ./configure script has an option --enable-compat-symlinks that will configure the build to symlink older names of the tools to the current ones on installation. These are dosfsck, fsck.msdos and fsck.vfat for fsck.fat, mkdosfs, mkfs.msdos and mkfs.vfat for mkfs.fat and dosfslabel for fatlabel. ### Running the test suite The test suite can be run with "make check" after configuring. Note that if xxd isn't available, all tests will be skipped and nothing actually tested. During the tests temporary files of multiple GB in size will be created, but the actual data content is not more than a few MB. The operating system and the filesystem the tests are executed on should support sparse files, otherwise the tests will be resource intensive. ### Building from the VCS repository If you are working directly from a git clone of the official dosfstools repository, you will find that you can not run "./configure" straight away because it, like other autogenerated files for the build system, is not included in the repository. First, autoconf, automake and gettext have to be installed. Then you can run "./autogen.sh" to generate all the required files. dosfstools-4.2/NEWS0000644000175000017500000003104514005523510011174 00000000000000dosfstools 4.2 - released 2021-01-31 ==================================== fatlabel now accepts two new options. When given the -i or --volume-id option, fatlabel changes to an alternate mode where it displays or changes the volume serial number instead of the volume label. With the -r or --reset option, it will remove the label or (in the alternate mode) generate a new volume serial number. The user prompting for interactive fsck has been overhauled. Now it will directly react to a pressed key without the user having to additionally press enter. The changed prompting is also consistently repeating the prompt when invalid input is given. The legacy check whether it is running on Atari hardware when compiled for 68k in order to automatically switch to Atari mode is now disabled by default. It can be compiled in with the new configure switch --enable-atari-check. Both mkfs and fsck now have a new option --variant=TYPE where TYPE can be 'standard' or 'atari' to explicitly select one of those variants rather than having to toggle between them with -A. fsck, mkfs and fatlabel were fixed to process volume label correctly. Previously there were many issues during processing labels. Fixes issues are: leading byte 0xE5 of root label needs to be handled in special way, label cannot contain some special characters, label itself is stored according to the current DOS codepage which may be specified by a new --codepage option. fatlabel now reads volume label only from the root directory to be compatible with existing systems like MS-DOS 5.00, MS-DOS 6.22, MS-DOS 7.10, Windows 98, Windows XP, Windows 7, 8, 10 and also with the Linux mlabel from mtools project. fsck was extended to fix incorrect volume labels and ensure that volume label from the root directory is same as the volume label stored in boot sector. Old versions of dosfslabel read label only from the boot sector. So with all these changes fsck now ensures compatibility with both MS-DOS/Windows and old Linux/dosfslabel world. fsck now allows spaces in the middle of SFNs. Previous behavior (when spaces are disallowed) can be achieved by a new option -S. Both mkfs and fsck now have fixed Year 2038 Bug. mkfs may still set filesystem timestamp to 1980-01-01 00:00:00 (beginning of the FAT era) in case operating system has Year 2038 Bug and cannot provide current time in time_t variable. Some memory leaks were fixed in fatlabel and fsck to make valgrind happy. Processing of command line arguments in all tools were fixed to ensure that invalid options are not accepted anymore and proper error message is thrown instead of trying to continue with uninitialized or undefined value. In fsck and fatlabel were fixed issues that faulty filesystems were able to trigger integer overflows during reading them. mkfs now has a new option --offset for specifying offset at which filesystem would start. This is useful when formatting FAT filesystem on disk image with MBR table without need to use loopback kernel driver with partx to access only specific partition. All tools now can be compiled without iconv library and in this case they support only CP850 codepage which is integrated into tools. This internal CP850 codepage can be used also when tools were compiled with iconv library which do not support CP850 (e.g. iconv from GNU libc without installed gconv shared libraries). Manual pages were updated to clarify some ambiguous options and descriptions. fatlabel has a new section with details about volume label and codepage issues. mkfs now has a new option --mbr which fills (fake) MBR table with one partition which spans whole disk device. This (fake) MBR table is needed only for non-removable disks used on Microsoft Windows systems and only when formatting whole unpartitioned disk. mkfs now calculates CHS geometry according to the SD Card Part 2 File System Specification. For SD cards with more than 256MB capacity is this new CHS calculation same as CHS calculation defined for hard disks via LBA-Assist Translation. So CHS geometry calculation in mkfs is now compatible with both SD Card specification and also LBA-Assist Translation. Moreover mkfs now has also a new option -g for specifying CHS geometry manually if it is needed for compatibility with some SD card readers. CHS geometry is part of FAT boot sector which mkfs.fat must fill. fsck now checks for DOS Clean Shutdown bit and marks filesystem as clean after successful run. This is for compatibility with Microsft Windows 98 and also with Windows NT-based variants. Dependency on systemd/udev was completely removed from mkfs tool. But there is no lost or removed functionality. Existing systemd/udev code was rewritten to directly access sysfs and new implementation has less lines of code as previous implementation which used systemd/udev libraries. mkfs was fixed to setup FAT32 backup boot sector correctly. mkfs's -D option (BIOS drive number) was relaxed to support also higher level hard disk and floppy devices (second, third, ...). fsck now preserve reserved fields in info sector. They are used by other systems (e.g. FSIBOOT stage of lDOS boot32.asm), hence why are reserved. fsck was extended to check and fix that first two entires in directory structures are . and .. mkfs now aligns total number of sectors to be multiple of the value of sectors per track which is stored in FAT boot sector. This requirement is needed by DOS systems and also by Linux FAT tools from mtools project. Alignment can be turned off by -a option. mkfs is now able to calculate FAT32 cluster size also for disks which have sector size different than 512 bytes. Note that this calculation is not optimal. It is just first step which ensures that mkfs does not fail during formatting Native 4K disks. mkfs cluster calculation was fixed to correctly handle differences between FAT12 and FAT16 variants. mkfs now explicitly disallow to create FAT filesystem with 4085 or 4086 clusters because Windows fastfat.sys detects such filesystem as FAT12 but Linux msdos.ko/vfat.ko detects it as FAT16. mkfs now avoids this situation to happen by fully automatic increasing or decreasing cluster size. fsck now has a new option -F which can be used to specify FAT table used for reading whole FAT filesystem. It can be useful in situation when user wants to do recovery and filesystem repairing from second FAT table independently of what fsck thinks that is the best. fsck was extended to try fixing first FAT cluster but only when -F option is specified. Previously when first FAT cluster was broken, fsck just printed error: "Both FATs appear to be corrupt. Giving up." and failed. fatlabel was fixed to not call parts of fsck procedure and to not print warning or log messages on stdout as it conflicts with expected label output on stdout. A test suite was heavily extended and now it also checks that fsck repairs broken filesystem into the expected state. List of fixed issues: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=803391 https://github.com/dosfstools/dosfstools/issues/13 https://github.com/dosfstools/dosfstools/issues/18 https://github.com/dosfstools/dosfstools/issues/22 https://github.com/dosfstools/dosfstools/issues/29 https://github.com/dosfstools/dosfstools/issues/32 https://github.com/dosfstools/dosfstools/issues/38 https://github.com/dosfstools/dosfstools/issues/39 https://github.com/dosfstools/dosfstools/issues/43 https://github.com/dosfstools/dosfstools/issues/45 https://github.com/dosfstools/dosfstools/issues/52 https://github.com/dosfstools/dosfstools/issues/53 https://github.com/dosfstools/dosfstools/issues/54 https://github.com/dosfstools/dosfstools/issues/64 https://github.com/dosfstools/dosfstools/issues/66 https://github.com/dosfstools/dosfstools/issues/69 https://github.com/dosfstools/dosfstools/issues/70 https://github.com/dosfstools/dosfstools/issues/74 https://github.com/dosfstools/dosfstools/issues/88 https://github.com/dosfstools/dosfstools/issues/99 https://github.com/dosfstools/dosfstools/issues/111 https://github.com/dosfstools/dosfstools/issues/139 https://github.com/dosfstools/dosfstools/issues/151 dosfstools 4.1 - released 2017-01-24 ==================================== A test suite is now included and can be run with "make check". The test suite requires xxd from the vim distribution to recreate image files from hexdumps and also adds a dependency on automake 1.11 or later for building from sources other than the release tarball. Now the default for mkfs for filesystems smaller than 512 MB is 64 heads / 32 sectors to make the defaults a bit more in line with the old defaults used up to 3.0.28. Other changes are fixes, some of them user visible, such as setting the sector size by command line option for mkfs working again after being broken in 4.0. Fixed a possible fatlabel crash when writing a label to an unlabelled filesystem and the given label contains printf style format specifiers. When circular cluster chains were detected and the -t option was not given, fsck used to truncate the file to zero length while not updating the free cluster count. This required a second fsck run to clear. Now it always truncates to the last cluster that begins the loop, as it is supposed to. The parsing of octal character specifications for filenames in the -u and -d options of fsck now works. It was broken in some ancient version and would always fail. dosfstools 4.0 - released 2016-05-06 ==================================== The programs are now portable to non-Linux operating systems. To that end, the build system has been converted to use autotools. There have been Linux specifics in a lot of places which have been either eliminated or should have equivalents so that it should now work in other Unix-like environments. It has been tested on FreeBSD and OS X. As part of making it portable all the code that assumed 8 bit major/minor numbers - and in fact masked out all other bits - has been cleaned up. Now mkfs.vfat should not misidentify devices anymore and require the -I option to override. The new device probing uses libudev (if available) to collect more information. Fixed data corruption errors in fsck.fat: Writing to the third to last cluster on FAT12 with an odd number of clusters would corrupt the following cluster. In mkfs.fat, long existing bugs in bad cluster marking (from scanning or user supplied bad blocks list) were fixed so that it actually marks the correct clusters. The automatic alignment of data clusters that was added in 3.0.8 and broken for FAT32 starting with 3.0.20 has been reinstated. If you need to create file systems for finicky devices that have broken FAT implementations use the option -a to disable alignment. dosfstools 3.0.28 - released 2015-05-16 ======================================= The major user visible change in this release is that fsck.fat now defaults to interactive repair mode which previously had to be selected with -r. The previous default of a read only check mode was confusing to users who had to repeat a potentially lengthy fsck.fat run with the right option in order to actually fix their file system. It was also pointless – the interactive repair mode already won't write anything without asking for confirmation. mkfs.fat now allows choosing 0xF0 as the media byte which was previously rejected. mkfs.fat now supports the --invariant option to facilitate testing mkfs.fat itself. It will reproducibly generate filesystems without random or time based differences between them when all else is identical. Bugs fixed in fsck.fat are a read one byte beyond the end of an allocated array when checking some FAT12 filesystems, and checking that the first cluster of a file as specified in the directory entry is not 1. Previously it could attempt to follow a block chain starting on cluster 1 and segfault when the conditions are right. dosfstools 3.0.27 - released 2014-11-12 ======================================= This is a pure bug fix release. The major bugs fixed: * fatlabel did not recognize long file names and mistook long file name segments in the root directory for labels. This caused output of garbage when asked to print the label and damage to the root directory (loss of long file name after fsck) when used to set the label. * A fsck.fat check introduced in 3.0.26 triggered use of uninitialized fields in the constructed root directory entry, which randomly caused the code checking file names to consider the empty "file name" of the root directory to be bad: $ /sbin/fsck.fat -y bad.img fsck.fat 3.0.26 (2014-03-07) / Bad short file name (). Auto-renaming it. Renamed to bad.img: 14 files, 19388/403266 clusters * And finally fsck.fat will not print the version string anymore every time the -v option is encountered. dosfstools-4.2/ChangeLog0000644000175000017500000051304314005523510012252 00000000000000commit eb9111e Author: Pali Rohár Date: Sun Jan 31 13:26:03 2021 +0100 Add missing files into distribution tarball commit 52518ae Author: Pali Rohár Date: Sun Jan 31 03:03:39 2021 +0100 mkfs.fat: Read geom_start from sysfs HDIO_GETGEO which provides start member is not supported for loop block devices. Also start member is only unsigned long so it cannot be used for bigger disks. So instead read geom_start from sysfs and store it into long long type to prevent overflow. commit ed2062b Author: Pali Rohár Date: Fri Jan 29 16:40:56 2021 +0100 Autogenerate release date in manpages commit fca589b Author: Pali Rohár Date: Fri Jan 29 16:40:20 2021 +0100 Update (C) and maintainers commit c251412 Author: Pali Rohár Date: Fri Jan 29 16:33:41 2021 +0100 Add TODO comments for checking integer overflow commit 73003cd Author: Pali Rohár Date: Sat Jan 19 13:28:45 2019 +0100 Replace uint64_t type by unsigned long long type commit c56ef3d Author: Pali Rohár Date: Sat Jan 19 13:22:05 2019 +0100 Remove useless casting to uint64_t or long long in check_file() Value of clusters * fs->cluster_size is file size and it always fits into 32bit value. So use just unsigned int type for it. commit 2e597d6 Author: Pali Rohár Date: Sat Jan 19 13:20:16 2019 +0100 Check that file size is not larger than maximal possible size commit 53d04ff Author: Pali Rohár Date: Sat Jan 19 13:15:25 2019 +0100 Change fat_size type from off_t to unsigned int Value in fat_size is result of multiplication of two 16bit unsigned values, therefore it fits into unsigned int. commit 2f6d8cf Author: Pali Rohár Date: Fri Jan 29 02:10:58 2021 +0100 testsuite: Add reference images of fsck result tests This ensures that fsck does not change its behavior and repair filesystems in the same way. Repaired reference images were generated by dosfstools 4.1 to ensure that they are still same. commit 5265c64 Author: Pali Rohár Date: Fri Jan 29 02:10:22 2021 +0100 testsuite: Add fsck tests for fat labels commit 2260f80 Author: Pali Rohár Date: Sun Jan 3 23:22:42 2021 +0100 fsck.fat: Check and fix label Checks the volume label from the root directory entry that is valid and matches the label stored in boot sector. Add new command line option -U which consider lowercase volume label as invalid and allows only uppercase labels. By default lowercase volume labels are allowed. commit 77c3de9 Author: Pali Rohár Date: Tue Jan 14 00:58:21 2020 +0100 Simplify usage of validate_volume_label() function Use new function dos_string_to_wchar_string() for converting label from DOS OEM code page to wchar_t* string. Therefore caller does not have to supply label in both DOS OEM encoding and locale independent wchar_t* string. commit f89b42d Author: Pali Rohár Date: Sun Aug 19 18:54:07 2018 +0200 Update warning message about lowercase labels They are working fine on MS-DOS and Windows systems. commit 5bbae89 Author: Pali Rohár Date: Wed Aug 15 16:35:48 2018 +0200 charconv: Add functions for converting DOS strings to locale independent wchar_t strings Use iconv library for it. And as a fallback use internal cp850_table. commit 3a3c1d3 Author: Pali Rohár Date: Thu Jan 28 10:39:36 2021 +0100 testsuite: Update mkfs-fat32_2_res_sects.xxd test as it is now not aligned due to -a commit 289fa53 Author: Pali Rohár Date: Wed Jan 27 02:03:39 2021 +0100 manpages: End every sentence by a newline commit 61390f3 Author: Pali Rohár Date: Wed Jan 27 02:01:48 2021 +0100 mkfs.fat: Do not align number of sectors when -a was specified commit 7deb97d Author: Pali Rohár Date: Wed Jan 27 02:00:33 2021 +0100 mkfs.fat: Document that -r and -R specify minimal number (and not exact) commit 4e06c33 Author: Pali Rohár Date: Wed Jan 27 01:58:38 2021 +0100 fsck: Move check_dirty_bits() from boot.c to check.c commit 738ee98 Author: Pali Rohár Date: Sun Jan 17 16:15:41 2021 +0100 fatlabel: Print warnings on stderr Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=803391 commit e62e52c Author: Pali Rohár Date: Sun Jan 17 19:45:26 2021 +0100 fatlabel: Do not call parts of fsck repair procedure This change adds a new parameter for read_fat() function to indicate a mode in which filesystem is doing to be used: Read-only, Read-write or Repair. fsck.fat uses Repair mode and fatlabel either Read-only or Read-write (which depends on fatlabel operation). fatlabel cannot repair broken FAT filesystem like fsck.fat. So when trying to modify FAT label on currupted FAT filesystem rather throw an fatal error indicating that running fsck.fat is needed. When fatlabel was called to just read existing FAT label, first FAT table is corrupted and second FAT table is clean then use second FAT table. This change also ensures that fatlabel does not print fsck/repair messages on stdout, which should be used only for printing FAT label. commit b8c8531 Author: Pali Rohár Date: Sun Jan 17 22:47:18 2021 +0100 testsuite: Add tests for DOS Clean Shutdown bit commit 82c2111 Author: Pali Rohár Date: Sun Jan 17 20:20:39 2021 +0100 testsuite: Add fsck tests with broken first FAT cluster Extend also test-fsck script to read additional arguments from .args file. commit 82e9730 Author: Pali Rohár Date: Sun Jan 17 19:34:10 2021 +0100 fsck.fat: Add code for fixing first FAT cluster This patch tries to fix infamous fsck.fat error: Both FATs appear to be corrupt. Giving up. It just fill again FAT media type and sets other bits to one as it is required by FAT specification. Similar thing is doing also Windows chkdsk tool. In the most cases corrupted first FAT cluster is fatal error which indicates totally corrupted filesystem impossible to repair. So fixing first FAT cluster is not done by fsck.fat automatically and needs to be enabled by a new -F option, which forces usage of specified FAT table (either clean or corrupted). commit e579a7d Author: Pali Rohár Date: Sat Nov 17 01:12:52 2018 +0100 mkfs.fat: Allow to specify disk geometry via new -g option commit 9443732 Author: Pali Rohár Date: Fri Jan 8 11:49:27 2021 +0100 testsuite: Add mkfs test for 600MB large 4K disk commit 3300839 Author: Pali Rohár Date: Sun Oct 14 16:19:51 2018 +0200 mkfs.fat: Do not show verbose messages not relevant to selected FAT size commit 43f0c4e Author: Pali Rohár Date: Fri Aug 17 14:26:30 2018 +0200 mkfs.fat: Fix text of verbose messages commit c01f78b Author: Pali Rohár Date: Tue Aug 14 15:48:50 2018 +0200 mkfs.fat: Fix limits for number of clusters According to Microsoft FAT specification (fatgen103.doc) disk with at least 4085 clusters and less then 65525 clusters 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 4085 clusters (or more) as FAT16, therefore for compatibility reasons with both systems disallow formatting disks to 4085 or 4086 clusters. So after this change mkfs.fat disallow to create a FAT16 which would be misinterpreted as FAT12. Next run of cluster detection algorithm would choose higher cluster size which decrease number of clusters. According to specification, FAT32 is detected by at least 65525 clusters, 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. commit 404ead8 Author: Pali Rohár Date: Sat Aug 11 20:34:08 2018 +0200 mkfs.fat: Fix calculation of FAT32 cluster size on non 512 bytes sector disks Previous FAT32 calculation worked correctly only for disks with 512 byte sectors. New calculation formula is generalized variant of previous one, but to be sector size independent. commit e6d2fc7 Author: Pali Rohár Date: Wed Aug 15 15:11:30 2018 +0200 mkfs.fat: Fix printing number of sectors It is unsigned 32bit number therefore use %u format. commit b29eb5b Author: Pali Rohár Date: Wed Aug 15 15:15:06 2018 +0200 mkfs.fat: Align total number of sectors to be multiple of sectors per track This requirement is needed by DOS systems and also by Linux mtools project. Without proper alignment, mtools applications refuse to work on such filesystem. commit 8c81232 Author: Pali Rohár Date: Sun Jan 10 22:29:48 2021 +0100 testsuite: Add referenceFAT32mbr test data to dist_check_DATA commit 468aad7 Author: Pali Rohár Date: Sun Jan 10 22:16:49 2021 +0100 manpages: Escape dot in fsck.fat manpage at the beginning of the line commit 9069ba0 Author: felix Date: Mon Apr 2 22:43:46 2018 +0200 fsck.fat: properly check for valid "." and ".." entries This change makes fsck.fat check whether "." and ".." entries exist in all non-root directories as the two very first. If those entries are occupied by some other file, fsck.fat will offer to move them to some later slot. "." and ".." entries found in any other slots are treated as ordinary bad-shortname entries. The test case for this situation has been enabled and verified to perform as expected. The function drop_file() was also modified so that it does not mark dropped file clusters as free. This was necessary because otherwise dropping too-late "." and ".." entries would delete their containing directory. If deleted entries' clusters are truly no longer used, they shall be picked up by a later reclamation stage. Additionally, subdirs() and check_file() were modified not to check unused directory entries. Additionally-fixed-by: Dave Odell commit 512141a Author: C. Masloch Date: Sat Oct 24 13:53:08 2020 +0200 fsck.fat: preserve info sector reserved fields This allows the FSIBOOT stage of lDOS boot32.asm to remain in the FSINFO sector even when the info entries are reset. I reviewed several sources to determine whether we are in the right to assume that the reserved 480 bytes used by FSIBOOT should be preserved by drivers updating the FSINFO entry fields. Quoting the document "Microsoft Extensible Firmware Initiative - FAT32 File System Specification - FAT: General Overview of On-Disk Format - Version 1.03, December 6, 2000" on these bytes: > [Name] FSI_Reserved1 > > [Offset (byte)] 4 > > [Size (bytes)] 480 > > [Description] This field is currently reserved for future expansion. > FAT32 format code should always initialize all bytes of this field > to 0. Bytes in this field must currently never be used. This specifically states that "FAT32 format code" should zero-initialise this space. It does not specify that a driver should or should not reset this space. The FreeDOS kernel uses a struct [1] that does not include the space used by FSIBOOT. Its driver's implementation [2] does preserve the FSIBOOT area. I have verified this in dosemu2; if the FreeDOS kernel updates the FSINFO sector it preserves this area. The Linux kernel uses a struct with a "reserved1" member [3] which is commented as being "Nothing as far as I can tell". If I am reading the source correctly, its driver [4] also preserves this area when updating the FSINFO entries. Testing on MS-DOS version 7.10 (as bundled with MS Windows 98 SE) I determined that it also preserves the area when updating the FSINFO entries. The free software RxDOS/lDOS boot loader for FAT32 that I wrote uses this reserved area to store its FSIBOOT stage, essentially an extension to the primary boot sector loader. To avoid clashing with Microsoft loaders which may use some of the reserved sectors, the large reserved area in the FSINFO sector was selected to hold this stage (if sector size is <= 512 bytes). If valid, the area starts with a signature [5] the first four bytes of which form the letters "FSIB"; the subsequent four bytes specify a protocol version. For example, the current (non-experimental) version is "FSIBOOT3" [6]. If there is no FSINFO sector or the FSIBOOT signature does not match the one expected, then the 'I' error code letter ("i"nvalid FS"I"BOOT) is displayed and the loading is aborted [7]. Prior to this patch, if the FSINFO entries were invalid (any of the three FSINFO signatures don't match) and then fsck.fat was used and instructed to correct this, it would reset the space used by FSIBOOT, rendering the image unbootable if the lDOS boot32 loader had been installed into the image. I previously posted a similar patch for mtools to the info-mtools mailing list [8]. I was approached to check whether dosfstools behaved as expected. I determined that this patch is needed to fix the corner case of invalid FSINFO entries with FSIBOOT installed into the sector. I also patched the lDOS instsect application [9] so it insures that the FSINFO entries are valid while installing FSIBOOT. With either that patch to instsect or this patch to dosfstools, FSIBOOT will always be preserved when running fsck.fat on a file system. [1]: https://github.com/FDOS/kernel/blob/6e42bb6d7c6dd304f738cf0d7a2db719598f1b9e/hdr/device.h#L325 [2]: https://github.com/FDOS/kernel/blob/6e42bb6d7c6dd304f738cf0d7a2db719598f1b9e/kernel/fattab.c#L116 [3]: https://github.com/torvalds/linux/blob/7cf726a59435301046250c42131554d9ccc566b8/include/uapi/linux/msdos_fs.h#L163 [4]: https://github.com/torvalds/linux/blob/7cf726a59435301046250c42131554d9ccc566b8/fs/fat/misc.c#L60 [5]: https://hg.ulukai.org/ecm/ldosboot/file/aa15fd7bc58e/boot32.asm#l1164 [6]: https://hg.ulukai.org/ecm/ldosboot/file/aa15fd7bc58e/boot32.asm#l27 [7]: https://hg.ulukai.org/ecm/ldosboot/file/aa15fd7bc58e/boot32.asm#l775 [8]: https://lists.gnu.org/archive/html/info-mtools/2020-10/msg00000.html [9]: https://hg.ulukai.org/ecm/instsect/rev/eee5dfaa52f6 commit 201665c Author: Pali Rohár Date: Sun Feb 16 12:33:32 2020 +0100 mkfs.fat: Update --help for -h (hidden sectors) commit 25da96e Author: Pali Rohár Date: Sun Feb 16 12:22:04 2020 +0100 mkfs.fat: Relax -D option (BIOS drive number) Allow to specify also second hard disk (0x81) or second floppy device (0x01) as -D option = BIOS drive number. commit bce0940 Author: Pali Rohár Date: Sun Feb 17 18:59:54 2019 +0100 manpages: Update mkfs.fat manpage about FAT32 backup boot sector commit da36707 Author: Pali Rohár Date: Sun Feb 17 11:48:32 2019 +0100 mkfs.fat: Write FAT32 backup info sector after FAT32 backup boot sector Write it only in the case when location does not conflict with real/primary FAT32 info sector and reserved area is big enough. commit 5b61d9f Author: Pali Rohár Date: Sun Feb 17 11:01:15 2019 +0100 testsuite: Run fsck test step always even if mkfs test step fails fsck test step can show more details about badly created image by mkfs. commit 53bfa1f Author: Pali Rohár Date: Sun Feb 17 10:56:06 2019 +0100 testsuite: Add test for mkfs.fat with two FAT32 sectors in reserved area commit 3cca83a Author: Pali Rohár Date: Sun Feb 17 10:36:33 2019 +0100 mkfs.fat: Fix setting location of FAT32 backup boot sector For FAT32 if there are only two sectors in reserved area, first must be boot sector and second must be FAT32 fs info sector. And there would not be FAT32 backup boot sector as it is optional. FAT32 info sector is for FAT32 media mandatory. When backup_boot variable is set to zero it means that no FAT32 backup boot sector is written. Check that FAT32 backup boot sector differs from FAT32 info sector is already there. Also allow user to specify zero for -b option which disable creating of FAT32 backup boot sector. commit c5e35e7 Author: Pali Rohár Date: Sun Feb 17 10:34:24 2019 +0100 mkfs.fat: Put FAT32 info sector number into variable Also check that it is not same as backup boot sector value. commit d276ddb Author: Pali Rohár Date: Sun Feb 17 10:32:08 2019 +0100 mkfs.fat: Rename info_sector buffer variable to info_sector_buffer Also call free() unconditionally as it does nothing for NULL argument. commit 5e936c9 Author: Pali Rohár Date: Sat Nov 24 19:45:39 2018 +0100 mkfs.fat: Remove dependency on systemd/udev There is no need that mkfs.fat depends on systemd. It uses it only for reading additional information about block device. This patch replace systemd/udev dependency code by reading those additional information about block device directly from sysfs. So no functionality of mkfs.fat is lost or removed. commit 18a05e7 Author: Pali Rohár Date: Sun Jan 5 00:58:41 2020 +0100 manpages: Fix '. SF' file names commit 7e6d7d3 Author: Pali Rohár Date: Sat Nov 24 18:18:53 2018 +0100 manpages: Fix switching to previous font style In troff manpage language previous font style is selected by "\fP" sequence, not by "\fR". "\fR" selects roman font style. commit ffa5dfa Author: Pali Rohár Date: Sun Nov 18 21:14:24 2018 +0100 manpages: Fix formatting of bullets In troff manpage language bullet is written as "\(bu". commit bc65dd6 Author: Pali Rohár Date: Sun Nov 18 21:10:29 2018 +0100 manpages: Fix formatting of emphases To emphasize use italic font style instead of putting word into two apostrophes. Ascii apostrophe in troff manpage language means "right single quotation mark", therefore putting word into two apostrophes is fully wrong. Also arguments and file names should be formatted in italic. commit 0273989 Author: Pali Rohár Date: Sun Nov 18 21:01:55 2018 +0100 manpages: Fix formatting of hyphens, en and em dashes In troff manpage language ascii minus is written as "\-", mathematical minus as "\(mi", hyphen as "-", en-dash as "\(en" and em-dash as "\(em". commit c85c863 Author: Pali Rohár Date: Sun Oct 21 12:58:19 2018 +0200 manpages: Clarify unit of BLOCK-COUNT BLOCK-COUNT is always in KiB unit independently of the disk sector size, FAT sector size or FAT cluster size. commit 69fcfe5 Author: Pali Rohár Date: Sun Aug 19 16:35:22 2018 +0200 fsck.fat: Check for DOS Clean Shutdown bit DOS Clean Shutdown bit in first reserved FAT entry is cleared when DOS or Windows FAT driver mounts a volume and set is back when doing unmount. Therefore set this bit when clearing FAT dirty bit in boot sector. commit 68e8e54 Author: Pali Rohár Date: Sat Jan 4 14:53:28 2020 +0100 mkfs.fat: Calculate CHS geometry according to SD Card Part 2 File System Specification Use this CHS calculation when disk geometry is not available. This change replaces hardcoded 64/32 value by formula based on total number of sectors. For SD cards with more then 256MB capacity is CHS calculation according to SD Card Part 2 File System Specification same as CHS calculation for hard disks via LBA-Assist Translation. commit 5199d68 Author: Pali Rohár Date: Sun Aug 19 09:57:41 2018 +0200 mkfs.fat: Add a new option --mbr which fills MBR table with one partition It is needed only for non-removable disks used on Microsoft Windows systems and only when formatting whole unpartitioned disk. Also some removable USB flash disks accessed via USB Mass Storage declares themselves as non-removable and Microsoft Windows systems do not recognize them without MBR partition table and MBR disk signature. Because MBR sector and first FAT sector are very similar (starts with boot code, ends with boot sign 0xAA55) they can live together at one sector. Moreover location of the MBR partition table overlaps only with the end of FAT boot code where is just place for the error message, it is possible to fill (fake) MBR partition table with one partition which refers to whole disk itself (starts at sector 0 and spans whole disk). Similar thing is doing mformat (FAT12/16/32 formatting tool) from mtools project or mkudffs (UDF formatting tool) from udftools project. commit 9f856b7 Author: Pali Rohár Date: Mon Jan 27 22:12:38 2020 +0100 charconv: Do not use %lc format modifier for wide char which cannot be converted to multibyte string commit 032ec02 Author: Pali Rohár Date: Tue Jan 14 00:27:31 2020 +0100 charconv: Fix usage of iconv() for state-dependent encodings After first main iconv() call set conversion state to the initial state and store corresponding shift sequence to output buffer via second iconv() call. commit 4428d7d Author: Pali Rohár Date: Mon Jan 13 23:15:22 2020 +0100 charconv: Fix checks for overlong input strings commit 2779d70 Author: Pali Rohár Date: Wed Jan 8 01:03:24 2020 +0100 charconv: Use ICONV_CONST macro to fix compile warnings with GNU libiconv Macro ICONV_CONST is defined by autoconf and expands either to "const" or nothing based on what API provides iconv() implementation, either according to SUSv2 or POSIX.1-2001/POSIX.1-2008. commit 565d7a2 Author: Pali Rohár Date: Wed Jan 8 01:02:16 2020 +0100 charconv: Fix check for return value of iconv iconv() returns (unsigned) size_t type, so its return value is always different from (signed) negative -1. To compare with -1 it first needs to be casted to size_t type. commit e9b42f5 Author: Pali Rohár Date: Wed Jan 8 00:44:27 2020 +0100 charconv: Increase buffer size for output strings in current locale MSDOS_NAME * 4 does not have to be enough size as iconv in translit mode can return also 5 bytes per one wide character. commit 1403c53 Author: Pali Rohár Date: Wed Jan 8 00:42:35 2020 +0100 charconv: Fix buffer overflows by specifying output buffer size commit 917846b Author: Pali Rohár Date: Tue Jan 7 00:54:15 2020 +0100 charconv: Fix put_char() function Ensure that this function always print characters according to current locale. So do not treat characters above 0xA0 as printable when dos_char_to_printable() cannot process them. commit 6dc68a8 Author: Pali Rohár Date: Tue Jan 7 00:52:43 2020 +0100 charconv: Fix comment for init_conversion() function commit 2d6c37d Author: Pali Rohár Date: Tue Jan 7 00:52:25 2020 +0100 charconv: For internal CP850 conversion add translit table This CP850 translit table was created by iconv ASCII//TRANSLIT as a 7bit ASCII fallback. commit 3ccfe29 Author: Pali Rohár Date: Tue Jan 7 00:50:09 2020 +0100 charconv: As a fallback try to use also non-translit iconv conversion commit 1b72fdf Author: Pali Rohár Date: Mon Jan 6 18:30:28 2020 +0100 charconv: Use const for input strings commit 102aa76 Author: Pali Rohár Date: Mon Jan 6 18:29:30 2020 +0100 charconv: Rename third argument of local_string_to_dos_string() Correct name is out_size as it is size of output buffer and not length of string. commit 49cc12a Author: Lennart Poettering Date: Mon Aug 3 12:17:12 2020 +0200 mkfs: fsync() the block device before exiting Let's make sure to sync the block device, before exiting. 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. (This took 4h of my life for me to figure out. The mkfs for all other file systems I tested appear to synchronize when done, hence fat should do too.) commit cc75143 Author: Pali Rohár Date: Mon Jan 27 22:22:35 2020 +0100 mkfs.fat: Mark struct fat32_fsinfo as packed commit f8f455b Author: Pali Rohár Date: Mon Jan 27 22:25:20 2020 +0100 fatlabel: Update documentation about DOS codepage commit 3ce32fa Author: Pali Rohár Date: Sat Jan 4 15:27:59 2020 +0100 mkfs.fat: Clarify licensing of the dummy boot sector Original author H. Peter Anvin allowed to put mkfs.fat boot sector code into the public domain. commit 8dc8976 Author: Pali Rohár Date: Fri Feb 14 00:00:27 2020 +0100 manpages: Update documentation about hidden sectors Fixes #29 commit 17be357 Author: David Gumberg Date: Sun Oct 13 18:21:57 2019 -0600 Get cross-platform libc6 generically commit 5e2529e Author: Pali Rohár Date: Mon Oct 14 12:21:36 2019 +0200 travis: use if ... fi construction As single test command has side effect in return value for Travis. commit 20092b8 Author: Pali Rohár Date: Mon Oct 14 12:14:07 2019 +0200 travis: Check for fatlabel test errors only for non-static builds Static builds have broken iconv support which is detected at configure time as usable. This leads to usage of internal CP850 conversion table as fallback solution which throws runtime non-fatal error. commit a4a0d62 Author: Pali Rohár Date: Mon Oct 14 09:48:43 2019 +0200 tests: Check for stderr errors from fatlabel tests commit 84a8d1c Author: Pali Rohár Date: Sun Jun 23 12:01:48 2019 +0200 charconv: Update Travis configuration Use autogen.sh instead of non-working autoreconf and test also static linked versions and configurations without iconv. commit b657ede Author: Pali Rohár Date: Sun Jun 23 10:47:44 2019 +0200 charconv: Add autogen.sh script AM_ICONV macro depends on gettext installation. Unfortunately autoreconf is not able to install config.rpath file so do it manually in autogen.sh. See reported bug: https://lists.gnu.org/archive/html/bug-gettext/2011-10/msg00012.html commit 0dec6a7 Author: Pali Rohár Date: Sat Jun 22 22:14:31 2019 +0200 charconv: Fix sources for testdevinfo target testdevinfo does not use any of charconv functions, nor any of mkfs functions. So do not link charconv/mkfs into testdevinfo. This fixes linking problems when iconv functions are not present in standard libraries. commit 664192e Author: Pali Rohár Date: Sat Jun 22 01:23:54 2019 +0200 charconv: Check return value of all set_dos_codepage() calls commit 6d49a1f Author: Pali Rohár Date: Sat Jun 22 01:16:44 2019 +0200 charconv: Check presence of iconv Use autoconf AM_ICONV macro for it. AM_ICONV should handle both cases when iconv_open is available in external libiconv library or as part of libc library. To force compilation of dosfstools without iconv support there is a new configure option --without-iconv. commit fa9761f Author: Pali Rohár Date: Sat Jun 22 01:14:37 2019 +0200 charconv: Fix return value from iconv_init_codepage function commit d74c592 Author: Pali Rohár Date: Sat Jun 22 01:12:46 2019 +0200 charconv: Add fallback to internal CP850 table Static linked version of glibc does not contain iconv with CP850 support. As CP850 is default code page for all dosfstools programs add own internal implementation which will be always supported. It would be used only in case iconv_open() fails. commit 91978a2 Author: Michael Forney Date: Fri Jun 7 08:48:13 2019 -0700 Use static inline function instead of statement expression commit e06e759 Author: Pali Rohár Date: Wed Jun 5 09:25:52 2019 +0200 Fix Travis CI configuration for powerpc and arm commit fc55b63 Author: Noé Rubinstein Date: Mon Aug 31 15:19:57 2015 +0200 mkfs: document --offset in the man page commit f473459 Author: Noé Rubinstein Date: Thu Jul 2 15:49:06 2015 +0200 Allow specifying an offset in the device file in mkfs commit 93b4288 Author: Tobias Stoeckmann Date: Sun Feb 24 20:55:15 2019 +0100 Fix out of boundary read in fsck.fat/fatlabel Faulty filesystems are able to trigger integer overflows in read_boot which eventually lead to insufficient allocation of memory for the FAT and therefore out of boundary reads. commit af3e50d Author: Pali Rohár Date: Sun Aug 12 12:15:45 2018 +0200 device_info: Fix parsing partition number Ensures that it is always valid number which does not overflow or underflow. commit 086e13c Author: Pali Rohár Date: Sun Aug 12 12:15:21 2018 +0200 mkfs.fat: Fix parsing of block number Block number must not be negative. It is 32bit so use long long type and strtoll() function to ensure that converted positive 32bit value would fit into type. commit a2b97c9 Author: Pali Rohár Date: Sun Aug 12 12:13:35 2018 +0200 mkfs.fat: Fix validation of numeric command line arguments Ensures that argument is always valid number which does not overflow or underflow. commit 07e63ac Author: Pali Rohár Date: Sun Aug 12 11:56:32 2018 +0200 mkfs.fat: Fix validation of volume ID Use same logic as in fatlabel. commit 425a415 Author: Pali Rohár Date: Sat Aug 11 22:49:37 2018 +0200 fatlabel: Fix validation of volume ID Standard C function strtoull() does not signal underflow, therefore it cannot be used for conversion of arbitrary string to integer with detection of failure. Instead use function strtoll() and detect underflow (negative value) manually. Note that strto* functions skips and ignores leading whitespace characters, so detects them manually via standard C function isspace(). commit da07aa4 Author: Pali Rohár Date: Sat Jan 19 09:48:25 2019 +0100 Update Travis configuration * Use both gcc and clang compilers * Compile with -fwrapv and -fsanitize=address * Compile in both 32 and 64 modes for x86 systems * Cross compile for little endian arm and big endian powerpc * Run cross compiled binaries in qemu commit a6ec69d Author: Tobias Stoeckmann Date: Mon Jan 14 22:47:40 2019 +0100 Renamed len to out_size. As pointed out by pali it makes sense to rename len to out_size to make explicitly sure by proper naming that this is the actually available memory size at "out", not the length of a string. Signed-off-by: Tobias Stoeckmann commit 6080fe2 Author: Tobias Stoeckmann Date: Mon Jan 14 19:36:11 2019 +0100 Fixed off-by-one in local_string_to_dos_string. The function local_string_to_dos_string is vulnerable to an off-by-one buffer overflow. In fact, it is triggered in default usage and becomes visible when compiled with ASAN: $ CFLAGS="-fsanitize=address" ./configure $ dd if=/dev/zero of=example.iso bs=1024 seek=64 count=1 $ ./src/mkfs.fat example.iso mkfs.fat 4.1+git (2017-01-24) ================================================================= ==3857==ERROR: AddressSanitizer: stack-buffer-overflow on address ... The problem is that the argument "len" to local_string_to_dos_string stores the length of the output buffer. Yet it can also be used as an index to store '\0': If the whole "out" buffer has been written to, bytes_out is 0 and the assignment in out[len-bytes_out] therefore leads to an off-by-one. Signed-off-by: Tobias Stoeckmann commit 332fc29 Author: Pali Rohár Date: Sun Nov 18 20:47:29 2018 +0100 Fix memory leaks in read_fat() function Function read_fat() allocates memory to the user supplied buffer. Therefore that function needs complement function for releasing allocated memory and user needs to call if after finish its work. This patch fixes memory leaks in fsck.fat and fatlabel tools. Fixes #13 commit 4cfd643 Author: Pali Rohár Date: Sat Sep 29 10:08:12 2018 +0200 mkfs.fat: Fix endianity for hidden_sectors Global variable hidden_sectors is in host byte order. commit a874650 Author: Pali Rohár Date: Tue Aug 14 21:13:52 2018 +0200 mkfs.fat: Add some workaround for Year 2038 Bug Check return values of time(), gmtime() and localtime() function which may fail. Fallback to date/time 1.1.1980 00:00:00 when those functions fail. For generating volume id, add fallback code based on rand() function. commit 607fbed Author: Pali Rohár Date: Tue Aug 14 20:57:27 2018 +0200 fsck.fat: Fix Year 2038 Bug Do not use time_t type and strftime() function which are affected by the Year 2038 Bug. Instead parse date/time directly from DOS format which avoids conversion from DOS to UNIX + conversion from UNIX to string. commit fb0cc0d Author: Andreas Bombe Date: Tue Aug 14 12:58:58 2018 +0200 Fix gcc sprintf() length warnings There are two sprintf() calls that receive warnings from current versions of gcc for possibly overrunning the temporary buffers they're writing into. The first one in src/check.c is theoretically safe since strftime() shouldn't generate such a long string. Reduce the maximum length of the strftime() string to fix this warning. Also detect strftime() errors and overwrite the buffer with a message in that case. The second one in src/boot.c should not be possible and is a limitation of gcc's detection. It assumes that %02x could write up to 8 characters, even though the arguments are pointers to uint8_t which can't be more than two characters. Placate gcc by lengthening the temporary buffer by 12 bytes. commit ca54953 Author: Pali Rohár Date: Mon May 7 09:27:16 2018 +0200 mkfs.fat: Add support for --codepage option for label and validate it commit 40da1b2 Author: Pali Rohár Date: Mon May 7 09:26:42 2018 +0200 fatlabel: Implement proper checks when setting new label According to Microsoft FAT specification "fatgen103.doc" there are following restrictions for FAT label stored in root directory: * DIR_Name[0] may not equal 0x20. * Lower case characters are not allowed in DIR_Name (what these characters are is country specific). * The following characters are not legal in any bytes of DIR_Name: - Values less than 0x20 except for the special case of 0x05 in DIR_Name[0] - 0x22, 0x2A, 0x2B, 0x2C, 0x2E, 0x2F, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x5B, 0x5C, 0x5D, and 0x7C And another Microsoft "FAT32 Spec (SDA Contribution).pdf" describe: * DIR_Name[0] cannot equal 0x20 (in other words, names cannot start with a space character). commit 4f953bb Author: Andreas Bombe Date: Mon Jun 11 14:21:17 2018 +0200 Remove long file name when changing short file name In the current state, long file names are poorly supported and in case the file got automatically or manually renamed in auto_rename() or rename_file(), only the short file name would be manipulated. Only the checksum would be fixed to have the LFN stay valid. This would cause issues such as the rename being hidden by the unchanged LFN or duplicate LFNs remaining if they were the cause for a rename. Change so that existing LFNs are removed for files being renamed. commit b356cf0 Author: Andreas Bombe Date: Mon Jun 11 14:17:03 2018 +0200 Print error message when auto_rename() is called on FAT32 root directory Use the same error message as rename_file() uses for the same reason when called on the FAT32 root directory pseudo file rather than silently ignoring. commit 8c4122e Author: felix Date: Mon Jun 11 04:35:35 2018 +0200 Fix allowing changes in SFNs reporting bogus error on FAT32 root directory The code to permit spaces in short filenames introduced in commit 4d01db7c6 caused the root directory pseudo file to be checked for a bad name. Since the name for that file is not set (zeroed out), bad_name() would report an error. Attempting to fix it would do nothing as the rename functions check for and ignore the root directory. Fix by checking for the root directory in bad_name(). commit 96e6efd Author: Andreas Bombe Date: Sun Jun 10 03:09:14 2018 +0200 fsck: Fix -S option not being recognized The call to getopt_long() did not include the -S option, so that it was not recognized even though its handling was implemented. commit 4d01db7 Author: felix Date: Mon Apr 2 10:20:10 2018 +0200 fsck.fat: Allow spaces in the middle of SFNs Also, introduce an -S option (mostly) restoring previous behaviour. commit c74ca0c Author: Pali Rohár Date: Wed Mar 7 18:00:15 2018 +0100 manpages: Add section DOS CODEPAGES to fatlabel Table was extracted from the National Language Support (NLS) API Reference: https://www.microsoft.com/resources/msdn/goglobal/default.mspx?OS=Windows+7 And filtered by codepages supported by GNU libiconv. commit b665a93 Author: Pali Rohár Date: Wed Mar 7 17:59:50 2018 +0100 fatlabel: Add support for --codepage option FAT label in both boot sector and root directory is stored according to current OEM code page. Microsoft Windows system treat FAT label really in this way. In most cases OEM code page is just 8bit extension of the printable ASCII, therefore for ASCII-only labels there is no change. By default OEM code page 850 is used which contains most of the characters that are also available in ISO-8859-1. Same default which is used by fsck.fat and mlabel (from mtools project). commit 76c0362 Author: Pali Rohár Date: Wed Mar 7 17:58:05 2018 +0100 fsck.fat: Change default DOS codepage to 850 The reason for change is that 850 is more common on Windowes and used by more regions as 437. Also it contains most of the characters that are also available in ISO-8859-1. And 850 is also default DOS code page used by mtools, which is used on Linux. commit 18ed349 Author: Pali Rohár Date: Wed Mar 7 17:57:23 2018 +0100 Initialize iconv "from codepage" with //TRANSLIT This would allow to show characters from DOS codepage on systems which current locale does not support it via transliteration. For example byte E8 in DOS CP437 (e with a grave accent) does not have representation in Linux locale Latin2. But it can be shown after transliteration as simple character "e". commit 08d743c Author: Pali Rohár Date: Wed Mar 7 17:57:13 2018 +0100 Initialize only LC_CTYPE locale LC_ALL is not needed as locale is used just for CODESET. LC_CTYPE is enough for using nl_langinfo(CODESET). commit 2112913 Author: Pali Rohár Date: Sun Apr 8 11:37:29 2018 +0200 Add tests for FAT32 labels These FAT32 images were generated for FAT label test suite in October 2017. Now fatlabel reports same FAT32 label as MS-DOS 6, 7 and Windows 98, XP, 10. For more information about test result see email: https://www.spinics.net/lists/kernel/msg2640891.html commit bfeedfc Author: Pali Rohár Date: Thu Nov 9 21:25:05 2017 +0100 mkfs.fat: Correctly process 0xe5 as first character of directory entry Same as commit 51da71aa9edc36fabf83323282f14e7ee71aa07b but for mkfs.fat. commit 1b866f4 Author: Pali Rohár Date: Thu Nov 9 21:25:01 2017 +0100 fsck.fat: Handle 0xe5 as first character of directory entry Same as commit 51da71aa9edc36fabf83323282f14e7ee71aa07b but for fsck.fat. commit 5b702a7 Author: Pali Rohár Date: Thu Nov 30 00:07:39 2017 +0100 manpages: Add section COMPATIBILITY and BUGS to fatlabel commit 900edb6 Author: Pali Rohár Date: Thu Nov 30 00:07:22 2017 +0100 fatlabel: Optimize size of the binary Move implementation of the alloc_rootdir_entry() function from the check.c to boot.c and do not link unneeded objects files into fatlabel binary. This would decrease size of the fatlabel binary nearly by half. With -g -O2 size before was about 194131 bytes and after just 104497 bytes. commit 0901aa8 Author: Pali Rohár Date: Thu Nov 30 00:07:05 2017 +0100 fatlabel: Clear ATTR_VOLUME from directory entry when removing label Older versions of fatlabel ignored FAT entries with deletion mark 0xE5 and tried to read labels also from those entries. This fix clear ATTR_VOLUME so older versions would not try to read label from deleted entry. commit cb8e674 Author: Pali Rohár Date: Thu Nov 30 00:06:51 2017 +0100 fatlabel: Print label without padding spaces Every entry in FAT directory is padded with spaces, which are not part of entry name. Therefore show also label from root FAT directory without those padding spaces. commit d822d5b Author: Pali Rohár Date: Thu Nov 30 00:06:36 2017 +0100 fatlabel: Show only label stored in root directory MS-DOS 6.22, MS-DOS 7.10, Windows 98, Windows XP and also Windows 10 ignores label stored in boot sector. When label in boot sector is non-empty and label in root directory is missing then they treat situation as there is no label for particular disk. So when labels in boot sector and root directory are out of sync, fatlabel shown different label as those MS-DOS and Windows systems. To make behavior between DOS, Windows and Linux consistent, ignores label in boot sector also in fatlabel. commit c598354 Author: Ashe David Sterkehus Date: Wed Nov 22 00:20:40 2017 +0900 mkfs: Check volume label given with -n is no longer than 11 characters Fixes #70 commit 87a8f29 Author: Will Newton Date: Thu Aug 31 10:42:13 2017 +0100 src/check.c: Fix up mtools created bad dir entries mtools writes uninitialized data to the case field of some directory entries. Running fsck.fat on these filesystems will cause the directory to get deleted which can lead to data loss. Detect this situation and clear the flag instead. mtools patch to fix the original issue: https://lists.gnu.org/archive/html/info-mtools/2014-08/msg00000.html Signed-off-by: Will Newton commit fe3ada3 Author: Andreas Bombe Date: Sun Oct 15 16:26:01 2017 +0200 manpages: Remove formatting from NAME sections where it doesn't belong The .SH NAME sections are supposed to contain just "name \- description" with no bolding on the name. Signed-off-by: Andreas Bombe commit 0d2d2b2 Author: Andreas Bombe Date: Sun Oct 1 15:17:13 2017 +0200 manpages: Clarify rules for volume labels as implemented Signed-off-by: Andreas Bombe commit 86fa0d8 Author: Andreas Bombe Date: Sun Oct 1 15:16:12 2017 +0200 manpages: Make SEE ALSO sections conform to conventions Signed-off-by: Andreas Bombe commit 5cdad55 Author: Andreas Bombe Date: Sun Oct 1 03:57:59 2017 +0200 Harmonize unknown command line option handling Now all binaries will show help and not try to print something like "unknown option '?'" because '?' is the value getopt_long() returns when it encounters an unknown option. At this point, getopt_long() has already printed the problem to stderr so we don't have to. The default action on getopt_long() return values (neither known option nor '?') is to report an internal error with the unexpected value. Signed-off-by: Andreas Bombe commit 34fd8eb Author: Andreas Bombe Date: Sun Oct 1 03:04:00 2017 +0200 fatlabel: Add new -r, --reset option This new option removes the label or generates a new serial number if in volume ID mode. Signed-off-by: Andreas Bombe commit e4e346f Author: Andreas Bombe Date: Sun Oct 1 02:43:03 2017 +0200 fatlabel: Don't access element of argv array that may not exist Signed-off-by: Andreas Bombe commit 17dea47 Author: Andreas Bombe Date: Sun Oct 1 02:27:31 2017 +0200 Move generation of serial number into new function generate_volume_id() Signed-off-by: Andreas Bombe commit 07f0238 Author: Andreas Bombe Date: Sun Oct 1 02:17:41 2017 +0200 Add remove_label() function Signed-off-by: Andreas Bombe commit ce7e7f9 Author: Andreas Bombe Date: Sun Oct 1 01:42:55 2017 +0200 fatlabel: Refuse empty strings as labels Signed-off-by: Andreas Bombe commit 51da71a Author: Andreas Bombe Date: Sun Oct 1 01:28:32 2017 +0200 Handle 0xe5 as first character of volume label Directory entries are not allowed to have 0xe5 as the first character as that is the marker for deleted entries. Instead, these have to be converted to 0x05 on writing and the other way on reading. Signed-off-by: Andreas Bombe commit 3a1aac1 Author: Andreas Bombe Date: Sun Oct 1 01:11:05 2017 +0200 Remove leftover handling of split directory entry name The name field in DIR_ENT used to be split into name and ext. Reading the volume label from a DIR_ENT used to require merging the contents of both fields and that handling was still there as reading parts of the same name field and merging them. Simply read in one go instead. Signed-off-by: Andreas Bombe commit 04aca69 Author: Andreas Bombe Date: Sun Oct 1 00:54:12 2017 +0200 Terminate volume label search at end of directory In find_volume_de() there is no point in scanning the directory entries after the first end of directory marker (name starts with a zero byte). Simply return 0 if end of directory is encountered. Signed-off-by: Andreas Bombe commit 747c8f9 Author: Andreas Bombe Date: Sun Oct 1 00:46:05 2017 +0200 Avoid returning deleted directory entries as labels In find_volume_de(), only the attributes were tested to decide whether a directory entry was a volume label. This could lead to deleted entries being returned. Check the name for deleted or unallocated marker to prevent this. Signed-off-by: Andreas Bombe commit 0a733d8 Author: Pali Rohár Date: Wed Jul 5 20:44:00 2017 +0200 fatlabel: Fix erasing label Empty label needs to be stored as "NO NAME ". Like in mkfs treat label which starts with character 0xE5 as empty. commit e1397b9 Author: Pali Rohár Date: Wed Jul 5 20:37:17 2017 +0200 mkfs: Handle -n "" correctly When user specify empty argument for -n, then it is empty label and needs to be transformed to NO_NAME. Also treat -n argument which starts with character 0xE5 as empty because label is stored also in root FAT directory and such entry is marked as deleted. Fixes #54 commit 2afb699 Author: Pali Rohár Date: Thu Sep 28 10:13:56 2017 +0200 fatlabel: Fix parsing volume ID * Do not allow specifying empty argument as volume ID * Check for errno (as general error) after more specific errors Fixes #64 commit 7ddcf9b Author: Andreas Bombe Date: Mon Sep 25 01:21:23 2017 +0200 fatlabel: Implement volume ID mode When given the new -i or --volume-id option, fatlabel will display or change the volume ID (serial number) instead of the volume label. The ID is displayed as an 8 digit hexadecimal number, when changing it must also be given as a hexadecimal number that fits within 32 bits. Fixes #52 Signed-off-by: Andreas Bombe commit 20a3e0f Author: Andreas Bombe Date: Mon Sep 25 00:36:33 2017 +0200 Add write_serial() function write_serial() works like write_boot_label() but sets the volume ID instead of the volume label in the boot sector. Signed-off-by: Andreas Bombe commit d7c9ffa Author: Andreas Bombe Date: Mon Sep 25 00:07:17 2017 +0200 Make fs_open() path argument const char* Signed-off-by: Andreas Bombe commit 06c2d11 Author: Andreas Bombe Date: Sun Sep 24 22:32:16 2017 +0200 Read volume ID in read_boot() The DOS_FS struct gets a new 32 bit field "serial" and read_boot() will now read the volume ID into this field. Signed-off-by: Andreas Bombe commit e501243 Author: Andreas Bombe Date: Thu Sep 21 15:20:33 2017 +0200 fatlabel: Expand help message by description and options Signed-off-by: Andreas Bombe commit 944ffe4 Author: Andreas Bombe Date: Thu Sep 21 15:15:54 2017 +0200 fatlabel: Change option parsing to getopt_long() Signed-off-by: Andreas Bombe commit 33dd224 Author: Andreas Bombe Date: Sat Aug 5 20:02:04 2017 -0400 Warn that -r is useless with FAT32 filesystems The option -r specifies the root directory size that neither is nor can be fixed on FAT32. If generating a FAT32 filesystem and this option is specified, warn the user that it has no effect. Fixes #43 Signed-off-by: Andreas Bombe commit ed9facf Author: Jakub Wilk Date: Tue Jul 11 01:01:20 2017 +0200 Fix signed integer overflow in FSTART uint16_t was promoted to int, and then left shift could overflow it. Add explicit cast to uint32_t to avoid undefined behavior. Signed-off-by: Jakub Wilk Signed-off-by: Andreas Bombe commit 995d814 Author: Emanuel Czirai Date: Fri May 5 22:43:54 2017 +0200 add missing \n To fix this: ``` Starting check/repair pass. FATs differ but appear to be intact.1) Use first FAT 2) Use second FAT [12?q]? ``` commit 9d822ba Author: Andreas Bombe Date: Thu Jun 29 20:56:03 2017 +0200 mkfs: List all options with short descriptions in --help message Make the help message more informative by giving a short description, simplifying the usage line and giving a short description of every option. The usage line now also shows the actual executable name instead of a hardwired 'mkfs.fat'. Signed-off-by: Andreas Bombe commit 32b3bce Author: Andreas Bombe Date: Wed Jun 28 15:17:33 2017 +0200 mkfs, fsck: Add --variant=TYPE command line option TYPE can be 'standard' or 'atari' (case insensitive) to select the desired mode rather than having to toggle with -A. Signed-off-by: Andreas Bombe commit 6fc9004 Author: Andreas Bombe Date: Tue May 30 21:26:44 2017 +0200 manpages: Rework the intro of the mkfs man page Acknowledge that image files can be used in place of device files. Remove mentions of "under Linux" since it has been portable for a while. Signed-off-by: Andreas Bombe commit bbbd077 Author: Andreas Bombe Date: Fri Apr 21 20:47:32 2017 +0200 manpages, configure.ac: Correct description of Atari format selection The -A option doesn't turn on (or turn off) Atari format selection, it toggles it with every occurrence. Change wording in the man pages to reflect that. Also mention that automatic selection can happen only on 68k Atari Linux in the man pages and the --enable-atari-check option help in configure.ac. Signed-off-by: Andreas Bombe commit 9fa180c Author: Andreas Bombe Date: Thu Apr 6 20:47:11 2017 +0200 Disable legacy check for 68k Atari by default The code that checked for Atari hardware when compiled for the 68k architecture is now disabled by default. A new configure option --enable-atari-check allows enabling it again. In addition to the the new configure option and the symbol __mc68000__ it also depends on __linux__, since its implementation checks Linux specific /proc files. Signed-off-by: Andreas Bombe commit d0c8900 Author: Andreas Bombe Date: Wed Apr 5 20:40:33 2017 +0200 Move all three check_atari() and atari_format definitions to common.c Now that mkfs is also using common.c, all three identical check_atari() definitions from mkfs, fsck and fatlabel can be combined in a single location in common.c Signed-off-by: Andreas Bombe commit a753734 Author: Andreas Bombe Date: Wed Apr 5 20:29:20 2017 +0200 mkfs: Link with common.c and use its die() implementation Now common.c is linked into mkfs and its die() implementation is used instead of the local implementation. That implementation consisting of a die() macro and fatal_error() function has been removed. To reproduce current messages exactly, there is now a program_name variable in common.c. If it is not NULL, die() will prepend its contents to the message it prints. The previous implementation implicitly passed device_name to the printf() so that die() invocations only needed to put "%s" where they wanted the device name to appear in the string. These invocations now have explicit device_name arguments. Signed-off-by: Andreas Bombe commit b0d524d Author: Andreas Bombe Date: Tue Apr 4 20:42:02 2017 +0200 fsck.fat.h: Remove extern declarations of interactive and write_immed These two declarations were forgotten when the variables moved to common.c. Signed-off-by: Andreas Bombe commit 2af848f Author: Andreas Bombe Date: Mon Apr 3 20:53:14 2017 +0200 fsck: Switch to getopt_long() option parser and add --help option Signed-off-by: Andreas Bombe commit c0c3141 Author: Andreas Bombe Date: Mon Apr 3 20:45:20 2017 +0200 fsck: Pass the exit value to use to usage() Signed-off-by: Andreas Bombe commit 112bdc6 Author: Andreas Bombe Date: Mon Apr 3 20:41:31 2017 +0200 fsck: Clean up usage() message a little Bring the usage() help message more in line with common conventions. Signed-off-by: Andreas Bombe commit 4d2273a Author: Andreas Bombe Date: Fri Mar 31 14:41:42 2017 +0200 mkfs.fat.c: Change misleading comment about FAT32 selection There was an apparently very old comment in setup_tables() about FAT32 not yet being chosen automatically. If a specific FAT size is not requested from the command line, establish_params() will previously have set size_fat to 32 when the filesystem size is at least 512 MiB. Signed-off-by: Andreas Bombe commit 8585962 Author: Andreas Bombe Date: Fri Mar 24 20:40:12 2017 +0100 fsck: Add quit choice to interactive prompts All prompts now get an additional 'q' choice to explicitly quit fsck. Selecting 'q' will print a message detailing the situation and ask for confirmation. Since the message describing the situation depends on whether fsck is in immediate-write mode, the variable selecting that is moved to common.c to make it accessible to the get_choice() function. Signed-off-by: Andreas Bombe commit c366076 Author: Andreas Bombe Date: Thu Feb 23 21:00:59 2017 +0100 fsck: Make prompts asking for writing changes at end more verbose and clear Signed-off-by: Andreas Bombe commit 141b009 Author: Andreas Bombe Date: Wed Feb 22 20:07:25 2017 +0100 fsck: Don't ask whether to perform changes in immediate write mode When all changes have already been written directly, it is useless to ask whether to commit the changes and probably confusing to the user. Signed-off-by: Andreas Bombe commit b2cfd70 Author: Andreas Bombe Date: Tue Feb 21 21:36:04 2017 +0100 Remove get_key() Signed-off-by: Andreas Bombe commit 0c1c5fc Author: Andreas Bombe Date: Tue Feb 21 21:24:14 2017 +0100 Overhaul interactive prompts All uses of get_key() are converted to get_choice() and fsck now disables canonical terminal mode to directly get key presses. It is no longer required to press enter after typing the choice and it is no longer possible to enter whole strings where only a character is expected. The reaction to invalid input should be consistent now (i.e. always repeat the prompt). Signed-off-by: Andreas Bombe commit 91b20bd Author: Andreas Bombe Date: Tue Feb 21 21:14:43 2017 +0100 Add get_choice() function The get_choice() function is intended to supersede get_key(). It takes pairs of return values and strings for every choice and a non-interactive default choice, does the prompting and reading of user input (if interactive) and returns the value for the selected choice. Since it needs to know if it runs in interactive mode, the "interactive" variable has been moved to common.c and removed from fsck.fat.c and fatlabel.c. Signed-off-by: Andreas Bombe commit fd92fab Author: Andreas Bombe Date: Tue Feb 21 14:15:12 2017 +0100 Add get_line() function to read user input in canonical mode The function will first save the terminal state and enable canonical and echo mode, display a prompt, call fgets(), then restore previous terminal mode. This allows it to work correctly regardless of the current terminal mode. Signed-off-by: Andreas Bombe commit 0155c9c Author: Andreas Bombe Date: Mon Feb 20 14:09:43 2017 +0100 Add asprintf() wrapper Make xasprintf() a wrapper that calls asprintf() and terminates if an error occurs like the alloc() function does for malloc(). The availability of the non-standard asprintf() call is checked in configure.ac and xasprintf() uses a local implementation if it isn't. Signed-off-by: Andreas Bombe commit 09769e6 Author: Andreas Bombe Date: Fri Feb 10 14:06:40 2017 +0100 Fix printf format specifier for printing label Fix a mistake introduced in the last commit where a field width instead of precision was given for rendering a fixed length string (without null termination). Signed-off-by: Andreas Bombe commit 08cf67b Author: Andreas Bombe Date: Thu Jan 26 21:31:03 2017 +0100 Turn label in struct DOS_FS into char array from pointer Signed-off-by: Andreas Bombe commit 32eff6f Author: Andreas Bombe Date: Thu Jan 26 21:27:19 2017 +0100 Append +git to version number Signed-off-by: Andreas Bombe commit 820c2f9 (tag: v4.1) Author: Andreas Bombe Date: Tue Jan 24 13:10:23 2017 +0100 Releasing version 4.1 Signed-off-by: Andreas Bombe commit cad2c17 Author: Andreas Bombe Date: Mon Jan 23 03:10:56 2017 +0100 fatlabel: Make sure printf style patterns in label are not expanded Writing a label to an unlabeled filesystem involves creating a root directory entry to contain the label. For this, the alloc_rootdir_entry() function used for creating new directory nodes for recovered orphan cluster chains is reused. However, this expects the filename to be a printf style pattern to generate a unique name. If the filesystem is unlabeled and the new label contains a printf specifier other than %d or similar, the attempted expansion of the pattern might crash fatlabel. Change alloc_rootdir_entry() to take an additional argument gen_name and only expand the name if its value is true. Signed-off-by: Andreas Bombe commit 77371e2 Author: Andreas Bombe Date: Fri Nov 4 13:10:58 2016 +0100 testsuite: Add missing fsck test files to dist_check_DATA Signed-off-by: Andreas Bombe commit d6df1d4 Author: Andreas Bombe Date: Thu Nov 3 20:03:25 2016 +0100 testsuite: Test for bad characters in file names The FAT16 test image contains four files with three errors. One has a space in the name, one a space in the extension and one contains '>' in the name. Signed-off-by: Andreas Bombe commit 307966c Author: Andreas Bombe Date: Sun Sep 18 00:11:43 2016 +0200 fsck: Fix reporting of length to truncate with shared clusters When files share clusters and one of the two files has been selected to truncate fsck reports which file has been selected and the length to which it will be truncated. All code paths erronously printed the length of the file that was not going to be truncated, leading to possible user confusion. Signed-off-by: Andreas Bombe commit b33424e Author: Andreas Bombe Date: Sat Sep 17 23:34:07 2016 +0200 testsuite: Test for files sharing clusters The FAT32 test image contains three files. One shares a cluster with the root directory and the other two share clusters among themselves. Signed-off-by: Andreas Bombe commit db5ec04 Author: Andreas Bombe Date: Sat Sep 17 22:41:07 2016 +0200 testsuite: Run fsck in test-mkfs Now the test-mkfs script also runs fsck on the created image to test its basic operation. The test fails if fsck reports seeing an error. Signed-off-by: Andreas Bombe commit 4ac17ae Author: Andreas Bombe Date: Sat Sep 17 22:25:06 2016 +0200 Fix FAT32 FSInfo signature checking In commit 7444694 the definition of struct info_sector was corrected to match the FSInfo sector specification. The initialization was adapted, but other places were missed. All runs of fsck would then incorrectly report a signature error on the FSInfo sector. Signed-off-by: Andreas Bombe commit e883d07 Author: Nico Roeser Date: Fri Sep 16 20:05:08 2016 +0200 mkfs: Bring back ability to set sector size. This had accidently been broken when the code was overhauled, resulting in unconditionally setting the sector size when devinfo detected it. Signed-off-by: Andreas Bombe commit 4ef83db Author: Andreas Bombe Date: Fri Sep 16 03:32:12 2016 +0200 Request minimum automake version 1.11 and add workaround for <1.13 Before automake 1.13, parallel-tests wasn't the default set it explicitly in the automake options list. The parallel test harness was introduced in 1.11 therefore that is the minimum now. However, the AM_TESTS_ENVIRONMENT variable was only starting to work in 1.13, so there is now a version check and a conditional assignment to TESTS_ENVIRONMENT (which should be for user setting only) in case automake is 1.11 or 1.12. Without it, the fact of xxd being found is not passed to the test scripts which then skip all tests due to perceived lack of xxd. Signed-off-by: Andreas Bombe commit 6a8c8b7 Author: Andreas Bombe Date: Fri Sep 16 01:45:17 2016 +0200 Add missing autoreconf step to Travis CI configuration Signed-off-by: Andreas Bombe commit 54f7aef Author: Andreas Bombe Date: Fri Sep 16 01:39:08 2016 +0200 Add configuration for the Travis CI build service Signed-off-by: Andreas Bombe commit 5421752 Author: Andreas Bombe Date: Wed Sep 14 20:37:57 2016 +0200 Check and fix printf style arguments to die() and pdie() Add the "format" gcc style attribute to the declarations of die() and pdie() so that the compiler knows how to check their arguments for correctness. Fix all problematic calls detected by this. Signed-off-by: Andreas Bombe commit 83e5ec5 Author: Andreas Bombe Date: Wed Sep 14 03:38:08 2016 +0200 Make some implicit integer conversions safer Coverity reports a few places where signed or short integers are promoted to int and then extended to long which might cause unintended sign extension. Given the context (being sector sizes and similar) the values should never actually reach unsafe values, but this patch cleans it up anyway. Signed-off-by: Andreas Bombe commit ff5e718 Author: Andreas Bombe Date: Tue Sep 13 20:25:34 2016 +0200 mkfs: Remove redundant unreachable warning message At some point the check for too many clusters for user requested FAT16 was moved a few lines above. The original location can only be reached when the cluster count is too low for FAT16 which means the too many clusters message can not be triggered there. Found through the dead code detection of Coverity Scan. Signed-off-by: Andreas Bombe commit e359a33 Author: Andreas Bombe Date: Tue Sep 13 20:12:21 2016 +0200 Fix octal character parsing in file_cvt() Apparently the octal code parsing got rewritten into a loop at some point while the rest of the code was not removed. It was impossible to specify an octal character code without the function returning an error. This affected the -u and -d options for fsck. Found through the dead code detection of Coverity Scan. Signed-off-by: Andreas Bombe commit ccd0a9d Author: Andreas Bombe Date: Mon Sep 12 20:21:53 2016 +0200 testsuite: Test for circular cluster chain The test image contains a file four clusters in length where the third cluster has been modified to point back to the second cluster. Signed-off-by: Andreas Bombe commit fab40f8 Author: Andreas Bombe Date: Mon Sep 12 19:51:10 2016 +0200 Fix truncation logic in circular chain check When scanning for circular chains, the first FAT entry that appeared a second time in a chain should cause the previous cluster to be the termination of the chain. To that end, test_file() keeps variables to point to the previous cluster and the current number of clusters. When the -t option is given, all clusters are checked to be readable and skipped (variables not updates) in test_file() when they are not. The problem was that the variables were updated only when the read check succeeded. If the -t option is not given, that check does not happen and the variables keep their initial value. The circular chain fix would then always truncate to zero length and fail to update the free cluster count, requiring a second fsck run. Fix by updating these variables unconditionally when -t option is not given. Signed-off-by: Andreas Bombe commit 8394ceb Author: Andreas Bombe Date: Mon Sep 12 14:39:11 2016 +0200 testsuite: Test for too long cluster chain The test image contains a file marked as 7 bytes in length (just a small part of 1 cluster) in the directory entry that has 2 clusters assigned to it in the FAT. Signed-off-by: Andreas Bombe commit 7444694 Author: Andreas Bombe Date: Wed Sep 7 21:09:41 2016 +0200 Fix definition and initialization of fsinfo sector Change the definition of the fsinfo struct to be more in line with the official definition, in particular make the trailing signature field 32 bit instead of 16 bit. During initialization in init_fsinfo(), first clear the whole struct to zero before setting fields, to make sure reserved fields are zeroed. Fixes #33. Signed-off-by: Andreas Bombe commit f78cb68 Author: Andreas Bombe Date: Wed Sep 7 20:45:29 2016 +0200 Add fsck testsuite Add the framework for a fsck testsuite and a few tests, including a test for the yet unimplemented check for misordered dot/dotdot directory entries. The test driver runs fsck twice on a given image and fails the test if the first run does not detect an error or the second run still detects an error. Signed-off-by: Andreas Bombe commit 7667295 Author: Andreas Bombe Date: Tue May 31 03:32:42 2016 +0200 Add testsuite foundations Add testsuite on the basis of the automake framework. As a start, three tests for basic mkfs functionality compare mkfs generated images against references images. Signed-off-by: Andreas Bombe commit f881195 Author: Andreas Bombe Date: Wed Sep 7 03:48:16 2016 +0200 Append +git to version number in configure.ac Don't let dosfstools compiled from git with additional commits show the exact release version number. Signed-off-by: Andreas Bombe commit 8788615 Author: Álvaro Fernández Rojas Date: Thu Jun 30 08:43:50 2016 +0200 Add config.guess and config.sub to gitignore Signed-off-by: Álvaro Fernández Rojas Signed-off-by: Andreas Bombe commit 39ab842 Author: Álvaro Fernández Rojas Date: Thu Jun 30 08:41:51 2016 +0200 Use autoconf to look for OS X endian include. Signed-off-by: Álvaro Fernández Rojas Signed-off-by: Andreas Bombe commit 69ac2b0 Author: Alessio Sergi Date: Fri May 6 18:18:18 2016 +0200 src/device_info.c: Fix undefined PATH_MAX under musl In musl libc, PATH_MAX is defined in . Signed-off-by: Andreas Bombe commit 744db84 Author: Lars Wendler Date: Tue May 10 09:47:57 2016 +0200 Don't link to udev via LDFLAGS. There's LDADD for such a task. See also: https://www.gnu.org/software/automake/manual/html_node/Linking.html Signed-off-by: Lars Wendler Signed-off-by: Andreas Bombe commit 1e76e57 Author: Andreas Bombe Date: Wed May 11 03:44:58 2016 +0200 mkfs: Default to 64/32 heads/sectors for targets smaller than 512 MB This may put defaults in certain use cases a little bit more in line with the old defaults in versions up to 3.0.28. It has mostly aesthetic value in most cases. Signed-off-by: Andreas Bombe commit 786e66e (tag: v4.0) Author: Andreas Bombe Date: Fri May 6 03:19:07 2016 +0200 Releasing version 4.0. Signed-off-by: Andreas Bombe commit a79ff90 Author: Andreas Bombe Date: Fri May 6 02:34:42 2016 +0200 src/Makefile.am: Fix CPPFLAGS for VPATH builds The -I flag to add the blkdev subdir to the include search path is now relative to $(srcdir) to allow VPATH builds to work. Additionally move the -I flag from the mkfs_fat and testdevinfo CFLAGS to CPPFLAGS where it actually belongs. Signed-off-by: Andreas Bombe commit e8eff14 Author: Andreas Bombe Date: Wed Apr 27 21:38:37 2016 +0200 read_boot(): Handle excessive FAT size specifications The variable used for storing the FAT size (in bytes) was an unsigned int. Since the size in sectors read from the BPB was not sufficiently checked, this could end up being zero after multiplying it with the sector size while some offsets still stayed excessive. Ultimately it would cause segfaults when accessing FAT entries for which no memory was allocated. Make it more robust by changing the types used to store FAT size to off_t and abort if there is no room for data clusters. Additionally check that FAT size is not specified as zero. Fixes #25 and fixes #26. Reported-by: Hanno Böck Signed-off-by: Andreas Bombe commit 016800e Author: Andreas Bombe Date: Wed Apr 27 14:16:53 2016 +0200 Use variable total_fat_entries in read_boot() for readability Signed-off-by: Andreas Bombe commit a6478d8 Author: Álvaro Fernández Rojas Date: Fri Apr 8 12:20:46 2016 +0200 Add missing iconv library for OS X Signed-off-by: Álvaro Fernández Rojas Signed-off-by: Andreas Bombe commit ce67dc6 Author: Álvaro Fernández Rojas Date: Fri Apr 8 12:20:27 2016 +0200 Add endian support for OS X Signed-off-by: Álvaro Fernández Rojas Signed-off-by: Andreas Bombe commit 08f3869 Author: Joel Holdsworth Date: Thu Mar 10 00:53:07 2016 +0000 Configure option to disable building with libudev Signed-off-by: Andreas Bombe commit ed4e47b Author: Andreas Bombe Date: Mon Feb 22 03:47:14 2016 +0100 Remove use of PATH_MAX in path_name() The length of a file path on the checked filesystem has no relation to the maximum path length of the system fsck is running on. So replace it with a constant of our own. As a bonus this will not fail compilation on a system without PATH_MAX. Signed-off-by: Andreas Bombe commit b1a38ab Author: Andreas Bombe Date: Wed Feb 17 21:04:35 2016 +0100 Add preliminary entry for release 4.0 to NEWS Signed-off-by: Andreas Bombe commit 4ad3e9e Author: Andreas Bombe Date: Wed Feb 17 21:02:06 2016 +0100 Adjust ridiculous source indentation in io.c Signed-off-by: Andreas Bombe commit b96acb2 Author: Andreas Bombe Date: Wed Feb 17 20:51:53 2016 +0100 Document ./configure --enable-compat-symlinks in README Signed-off-by: Andreas Bombe commit de39c5c Author: Andreas Bombe Date: Wed Feb 17 15:16:27 2016 +0100 Add include paths.h in the HAVE_DECL_GETMNTENT case _PATH_MOUNTED is now used for getmntent() in place of MOUNTED because the latter was marked as a deprecated alias in glibc's mntent.h. The mntent.h of musl libc does not include the _PATH_MOUNTED however. Fix this by including paths.h alongside mntent.h Signed-off-by: Andreas Bombe commit 86c7acd Author: Andreas Bombe Date: Wed Feb 17 15:06:56 2016 +0100 man fsck: Document the -c option Signed-off-by: Andreas Bombe commit ef9a73c Author: Andreas Bombe Date: Mon Feb 15 02:10:57 2016 +0100 Add NEWS file with changes of the last two releases Signed-off-by: Andreas Bombe commit bda6551 Author: Andreas Bombe Date: Fri Feb 12 03:56:16 2016 +0100 Make filesystem mounted check portable A new function is_device_mounted() in device_info.c is now used by check_mount() in mkfs.fat.c. It contains the getmntent() using code used before in check_mount() and now an alternative using getmntinfo() as found on the BSDs. In case neither function is available, is_device_mounted() defaults to reporting that the device isn't mounted. Signed-off-by: Andreas Bombe commit 4b8c9cc Author: Andreas Bombe Date: Fri Feb 12 01:57:33 2016 +0100 Make use of endian.h portable to BSD The endian.h found on Linux and the BSDs appear to be compatible, but they are found in different locations. Add tests in configure.ac and a new endian_compat.h file that has the logic to include the correct files. Signed-off-by: Andreas Bombe commit d7665f2 Author: Andreas Bombe Date: Wed Feb 10 21:30:06 2016 +0100 Fix format string in check_file() (%lu → %llu) The cluster chain length printing needs a 64 bit calculation, so we can just use unsigned long long instead of uint64_t and use the format string %llu. Signed-off-by: Andreas Bombe commit 6225e59 Author: Andreas Bombe Date: Fri Feb 5 14:39:00 2016 +0100 blkdev.c: Prevent unused parameter warnings in fallback code Signed-off-by: Andreas Bombe commit 34cdded Author: Andreas Bombe Date: Fri Feb 5 14:36:14 2016 +0100 blkdev_get_size(): Remove unused variable ch Signed-off-by: Andreas Bombe commit 5571d29 Author: Andreas Bombe Date: Wed Feb 10 03:22:19 2016 +0100 Reinstate alignment of FAT32 structures to cluster size This reverts commits 17c956cb9 and d63e0d627 where the alignment was removed because it created problems with a device that refused to read the aligned filesystem. The option -a is already provided to disable alignment in order to handle such cases. This change brings it back in line with FAT12/16 where alignment wasn't disabled and brings consistency with the current command line options, where only the option to disable alignment exists but no opposite option to enable it. Signed-off-by: Andreas Bombe commit 2c71ace Author: Andreas Bombe Date: Wed Feb 3 03:38:33 2016 +0100 Makefile.am: Add historic documentation to distribution Signed-off-by: Andreas Bombe commit bcbae63 Author: Andreas Bombe Date: Wed Feb 3 02:38:24 2016 +0100 src/Makefile.am: Add forgotten msdos_fs.h to mkfs_fat_SOURCES Signed-off-by: Andreas Bombe commit 19d1a13 Author: Andreas Bombe Date: Wed Feb 3 02:34:51 2016 +0100 Remove sys/ioctl.h and linux/fd.h include from io.c These weren't used anymore and the linux/fd.h include would gratuitously cause compilation to fail on non-Linux environments. Signed-off-by: Andreas Bombe commit f691660 Author: Andreas Bombe Date: Wed Feb 3 02:31:00 2016 +0100 Reinstate some #include These shouldn't have been removed in commit 245d0cce5. Put them back for correctness even though the definitions were pulled in implicitly. Signed-off-by: Andreas Bombe commit 51afd41 Author: Andreas Bombe Date: Wed Jan 27 21:38:29 2016 +0100 src/Makefile.am: Put all header files in appropriate _SOURCES variables With the headers missing the dist targets of the automake generated Makefiles would not include them and make the resulting dist unbuildable. Also combine sources collections into common variables for deduplication. Signed-off-by: Andreas Bombe commit bf6f142 Author: Andreas Bombe Date: Wed Jan 27 15:28:42 2016 +0100 mkfs man: Note that sector sizes > 4096 are non-standard Signed-off-by: Andreas Bombe commit ea96c32 Author: Andreas Bombe Date: Mon Jan 25 21:30:23 2016 +0100 mkfs: Improve parsing of bad blocks file The bad blocks file that can be given to mkfs via the -l option had a very simplistic design. It failed to notice it was parsing an empty line and would report errors for that. Replace it with a more robust version that ignores empty lines as well as leading and trailing white space. Additionally it produces meaningful error messages. GitHub: Fixes #17 Signed-off-by: Andreas Bombe commit dfb5bea Author: Andreas Bombe Date: Mon Jan 25 02:47:12 2016 +0100 mkfs: Limit filesystem size on targets that are too large For FAT filesystems, the number of sectors has to fit into a 32 bit variable. Previously this was not checked possibly causing invalid filesystems to be generated. Now there is a check for that case which will limit the number of sectors if needed and print a warning that disk space will be left unused in that case. Signed-off-by: Andreas Bombe commit fc0343f Author: Andreas Bombe Date: Fri Jan 22 21:29:20 2016 +0100 mkfs: Improved bounds checking in mark_FAT_sector()/mark_FAT_cluster() In mark_FAT_sector() the sector number itself is now checked against limits instead of the computed cluster number. Even with sector number before the start of the data area, the cluster number may be valid for the first cluster due to dividing by the cluster size. Both functions now check for upper limits and should prevent writing past the valid end of the FAT. Signed-off-by: Andreas Bombe commit 9211c8a Author: Andreas Bombe Date: Fri Jan 15 02:17:16 2016 +0100 mkfs: Fix offset error in FAT12/16 bad cluster marking The root directory wasn't factored in to the calculation of the data area start sector. On FAT32 the root directory is in the data area, but for FAT12 and FAT16 it is a reserved space before the start of the data area. On FAT12 and FAT16, this resulted in the wrong clusters being marked during bad blocks mapping, whether from check_blocks() or from reading the user supplied bad blocks file. Signed-off-by: Andreas Bombe commit 0627a62 Author: Andreas Bombe Date: Fri Jan 15 01:59:59 2016 +0100 mkfs: Fix off-by-2 error in bad cluster marking mark_FAT_sector(), which has the mark_sector_bad() macro as its sole user, computed the cluster number corresponding to the sector by taking its offset from the first data sector and dividing by sectors per cluster. What it missed was that the first data cluster is number 2 and not 0. This meant all marks were off by 2 and when the first two clusters are supposed to be marked, it would overwrite the reserved cluster values and create an invalid filesystem. Signed-off-by: Andreas Bombe commit 2dca9aa Author: Andreas Bombe Date: Thu Jan 14 14:43:00 2016 +0100 .gitignore: Add .dirstamp Signed-off-by: Andreas Bombe commit 6a966fb Author: Andreas Bombe Date: Thu Jan 14 14:38:53 2016 +0100 mkfs: Reword non-standard sector size warning Signed-off-by: Andreas Bombe commit bebc9ac Author: Andreas Bombe Date: Wed Dec 30 15:10:35 2015 +0100 Clean up includes in mkfs.fat.c Moving the device probing out into device_info.c removed the need for a number of includes in mkfs.fat.c. Remove them and add a define for BLOCK_SIZE, which was the only thing used from linux/fs.h. Signed-off-by: Andreas Bombe commit 12a1d46 Author: Andreas Bombe Date: Sun Nov 29 01:59:10 2015 +0100 Don't use pointer to first member when more of the struct gets copied Where a fs_write() of "first 13 bytes of directory entry" is intended, actually use pointer to directory entry structure instead of the 11 byte name field at the beginning. This does not change how the code works, it is just a clean up. Signed-off-by: Andreas Bombe commit d38bd2d Author: Andreas Bombe Date: Sun Nov 29 00:44:48 2015 +0100 Remove name/extension split in directory entry structures Both the DIR_ENT structure in fsck.fat.h and the msdos_dir_entry in msdos_fs.h - these represent the on disk format of directory entries - had the name field split into name[8] followed by ext[3]. By far the most operations on name are on the full name including extension and they treated the name field as an 11 byte array. This is an array overflow that worked because the structs have the attribute packed and the extension field is following right after. Nevertheless, this is not clean C and the merging of both fields actually simplified the code in a few places. Signed-off-by: Andreas Bombe commit 0847e4c Author: Andreas Bombe Date: Fri Nov 27 21:29:49 2015 +0100 Free allocated strings after use There are multiple calls to cnv_unicode() in lfn.c which returns an allocated string. Most had the appropriate free() calls after printing the strings. Add the missing two calls where memory was leaked. Found by Coverity. Signed-off-by: Andreas Bombe commit 1b7d91e Author: Andreas Bombe Date: Fri Nov 27 03:34:51 2015 +0100 Add test for and include linux/hdreg.h in blkdev.c Before, blkdev did not include it and depended on its own fallback definition of the ioctl and struct hd_geometry. Signed-off-by: Andreas Bombe commit 5024372 Author: Andreas Bombe Date: Fri Nov 27 03:28:14 2015 +0100 Add FDGETPRM attempt to blkdev_get_geometry() If HDIO_GETGEO isn't available or has failed, try FDGETPRM. This should get the geometry from floppy drivers where HDIO_GETGEO isn't supported. Signed-off-by: Andreas Bombe commit 4a146d7 Author: Andreas Bombe Date: Fri Nov 27 03:25:55 2015 +0100 Add blkdev_get_start() for getting partition start offset Signed-off-by: Andreas Bombe commit 254f8ab Author: Andreas Bombe Date: Thu Nov 26 23:33:02 2015 +0100 Remove use of libblkid again It appears libblkid is not as widely available as presumed, since some platforms only have the original libblkid included in e2fsprogs which lacks the needed functionality. This commit removes the requirement and use of libblkid. As a replacement, blkdev.c from util-linux is included, which offers the required basic functionality in a portable way. Signed-off-by: Andreas Bombe commit c9fb33c Author: Andreas Bombe Date: Wed Oct 21 21:32:30 2015 +0200 Use just device size not major number in Atari mode In Atari mode, read_boot() in boot.c used the device major number to determine whether to use FAT12. It would always use FAT12 for a floppy, otherwise only if it is a RAM disk or loopback device and has a size corresponding to standard floppy formats. Since this check was already broken for a long time (another place that assumed 8 bit major numbers) and there is no real point to make the distinction based on device, this commit reduces the check to just compare against standard floppy sizes. Signed-off-by: Andreas Bombe commit 64486ad Author: Andreas Bombe Date: Wed Oct 21 00:18:22 2015 +0200 Remove loff_t and llseek() There appear to have been multiple conversions to 64 bit file offsets on 32 bit architectures in dosfstools over the years, but today with the proper setup off_t is 64 bits and simple lseek() can be used. The AC_SYS_LARGEFILE macro in configure.ac does what is required to make that happen. Given this, convert all uses of loff_t to off_t, remove llseek() definitions and change llseek() calls to plain lseek(). Signed-off-by: Andreas Bombe commit e03a5f4 Author: Andreas Bombe Date: Fri Oct 16 21:47:04 2015 +0200 Remove DJGPP support These macros have been added back when dosfstools was around version 2. It is difficult to say whether these are still working correctly or whether they are in use at all. FreeDOS appears to still show version 2.11 of dosfstools in their software directory. Supporting actual MS-DOS or compatible may need more work in the current state of things and this DJGPP support can be removed until then. Signed-off-by: Andreas Bombe commit 5b9a88d Author: Andreas Bombe Date: Thu Oct 8 16:17:22 2015 +0200 mkfs.fat: Complete overhaul of device probing The device probing in mkfs.fat is used to get device parameters where needed and also to decide whether to refuse overwriting a device due to possible user error. This code has suffered severe bitrot and is highly Linux specific. Highlights include using hardcoded major/minor device numbers to classify a device, and using 8 bits major/minor numbers that have become obsolete a long time ago and thus often misidentifying a device. The overhauled implementation is now in src/device_info.c and makes use of libudev (optional, recommended) and libblkid (required) to probe the device and where Linux ioctls are required it provides fallbacks and does not attempt to call these on non-Linux systems. The FAT parameter selection has been unified and simplified in the process. A new executable testdevinfo has been added that gets built but not automatically installed. It takes one file name, uses the same probing as mkfs.fat would with verbose messages enabled and displays the results. Signed-off-by: Andreas Bombe commit 53eddfc Author: Andreas Bombe Date: Sat Sep 12 02:54:33 2015 +0200 Die on out of range cluster values in set_fat()/get_fat() To prevent bugs caused by FAT corruption inside fsck to go unnoticed, add a check against out of range requested cluster values in get_fat() and against out of range cluster to change and new cluster value in set_fat(). When an invalid cluster value is detected, these functions now die() with an "internal error" message. Signed-off-by: Andreas Bombe commit 456767b Author: Andreas Bombe Date: Mon Sep 14 00:33:49 2015 +0200 configure.ac: Use AS_HELP_STRING to format option help Signed-off-by: Andreas Bombe commit 3cfb479 Author: Andreas Bombe Date: Mon Sep 14 00:30:40 2015 +0200 version.h: Use @configure_input@ autoconf variable in boilerplate Signed-off-by: Andreas Bombe commit 41ef834 Author: Andreas Bombe Date: Mon Sep 14 00:29:27 2015 +0200 .gitignore: Add TAGS in addition to tags Signed-off-by: Andreas Bombe commit bdc3d2a Author: Andreas Bombe Date: Fri Sep 11 20:28:12 2015 +0200 Rename clusters field in DOS_FS struct Rename it to data_clusters to prevent mistaking the clusters field of the DOS_FS struct as the total number of FAT entries instead of the number of data clusters (two less than the number of entries). Signed-off-by: Andreas Bombe commit 0790812 Author: Andreas Bombe Date: Fri Sep 11 19:47:29 2015 +0200 set_fat(): Fix off-by-2 error leading to corruption in FAT12 In FAT12 two 12 bit entries are combined to a 24 bit value (three bytes). Therefore, when an even numbered FAT entry is set in FAT12, it must be be combined with the following entry. To prevent accessing beyond the end of the FAT array, it must be checked that the cluster is not the last one. Previously, the check tested that the requested cluster was equal to fs->clusters - 1. However, fs->clusters is the number of data clusters not including the two reserved FAT entries at the start so the test triggered two clusters early. If the third to last entry was written on a FAT12 filesystem with an odd number of clusters, the second to last entry would be corrupted. This corruption may also lead to invalid memory accesses when the corrupted entry becomes out of bounds and is used later. Change the test to fs->clusters + 1 to fix. Reported-by: Hanno Böck Signed-off-by: Andreas Bombe commit 39ce90f Author: Andreas Bombe Date: Fri Sep 11 19:34:10 2015 +0200 set_fat(): Move FAT12 next cluster check up In FAT12 two 12 bit entries are combined to a 24 bit value (three bytes). Therefore, when an even numbered FAT entry is set in FAT12, it must be be combined with the following entry. To prevent accessing beyond the end of the FAT array, it must be checked that the cluster is not the last one. This check was broken in ff1b24e9 (first included in 3.0.3) as the lookup was done unconditionally and the check influenced only using the looked up value. Move the check up to fix. Signed-off-by: Andreas Bombe commit 2aad1c8 Author: Andreas Bombe Date: Tue Sep 8 03:58:29 2015 +0200 Prevent out of bound array read in date_dos2unix() The function date_dos2unix() is called during fsck while showing information about duplicate file names. In case the date field of a directory entry contains the invalid value 0 for the month, date_dos2unix would read index -1 of the day_n array. Add a check to prevent that and also make the day_n array const on this occasion. Reported-by: Hanno Böck Signed-off-by: Andreas Bombe commit 3b95786 Author: Yann E. MORIN Date: Sun Aug 16 15:55:43 2015 +0200 mkfs.fat: fix incorrect int type u_int32_t is not a stanard type, while uint32_t is. This fixes builds with the musl C library, which only defines so-called "clean" headers; build failures are like (back-quotes and elision manually added for readability): http://autobuild.buildroot.org/results/a09/a0923d7f6d4dbae02eba4c5024bbdae3a52aa85a/build-end.log /home/peko/autobuild/instance-1/output/host/usr/bin/x86_64-linux-gcc -D_LARGEFILE_SOURCE \ -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -D_GNU_SOURCE -D_LARGEFILE_SOURCE \ -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -c -o mkfs.fat.o src/mkfs.fat.c src/mkfs.fat.c: In function 'main': src/mkfs.fat.c:1415:18: error: 'u_int32_t' undeclared (first use in this function) volume_id = (u_int32_t) ((create_timeval.tv_sec << 20) | create_timeval.tv_usec); [...] ^ src/mkfs.fat.c:1415:18: note: each undeclared identifier is reported only once for each function it appears in Signed-off-by: "Yann E. MORIN" Signed-off-by: Andreas Bombe commit 2b1c4d1 Author: Andreas Bombe Date: Wed Jun 3 03:33:10 2015 +0200 Add README.md, remove Markdown formatting from README Signed-off-by: Andreas Bombe commit b720acc Author: Andreas Bombe Date: Wed Jun 3 03:27:24 2015 +0200 Add simple README in Markdown format Signed-off-by: Andreas Bombe commit 2b255e6 Author: Andreas Bombe Date: Tue Jun 2 18:25:06 2015 +0200 Configure option for legacy names symlinks The symlinks from the old names (mkdosfs, dosfsck, etc.) are now only created on "make install" when the --enable-compat-symlinks option was given to configure. Signed-off-by: Andreas Bombe commit 0643db7 Author: Andreas Bombe Date: Sun May 31 02:40:19 2015 +0200 Convert build system to autoconf/automake In preparation for fixing the horribly outdated and broken device checking - which will likely involve using additional libraries like libblkid - as well as making this package portable to other operating systems, the build system is now the tried and true autoconf/automake combination which should make both goals a little more straightforward. The release version number and date are now in configure.ac and substituted by configure where they are needed. Now it is no longer necessary to change the number in multiple places for a release and the man pages get the number substituted directly into them, making the update-version.sh script and the VERSION file obsolete. The English man pages are moved back up one directory to mark their status as the master copy for all translations. At the moment the po4a translation infrastructure is defunct since it isn't integrated into the automake environment yet. So far it hasn't been used, so that is not an actual regression. The date in the man pages is not automatically updated anymore. This is as it should be, since the date is supposed to signify the time of the last nontrivial change and not the release date of the software. Signed-off-by: Andreas Bombe commit 85022fe (tag: v3.0.28) Author: Andreas Bombe Date: Sat May 16 02:56:17 2015 +0200 Releasing version 3.0.28. Signed-off-by: Andreas Bombe commit ad1342e Author: Andreas Bombe Date: Sat May 16 02:10:18 2015 +0200 manpages: Mark MT and ME tags as untranslated for po4a Signed-off-by: Andreas Bombe commit 3ed9ec2 Author: Andreas Bombe Date: Sun May 10 19:59:02 2015 +0200 mkfs: Small changes to FAT32 cluster size selection Put the cluster size selection back in line with the table used in Microsoft's fatgen103.pdf and fix the comment. This only involved changing some comparison operators, all values stayed the same. Signed-off-by: Andreas Bombe commit 9984552 Author: Andreas Bombe Date: Mon Apr 20 23:41:34 2015 +0200 fsck: Mention -r is default in usage message Signed-off-by: Andreas Bombe commit 3eaca68 Author: Andreas Bombe Date: Mon Apr 20 23:30:56 2015 +0200 manpages: Remove obsolete information about Linux FAT support Signed-off-by: Andreas Bombe commit a5e34de Author: Andreas Bombe Date: Thu Apr 16 23:16:08 2015 +0200 manpages: Convert the rest of argument placeholders to upper case Signed-off-by: Andreas Bombe commit 2303765 Author: Andreas Bombe Date: Thu Apr 16 22:51:20 2015 +0200 manpages: Fix formatting Make the manpages conform to the rules for groff sources. First, eliminate empty lines because these create vertical spaces where it isn't desired. Man page sources should not contain empty lines. Second, put a line break between sentences in a paragraph. A period is recognized and formatted as a full stop period only when a line break comes right after it. Signed-off-by: Andreas Bombe commit d3969b8 Author: Andreas Bombe Date: Fri Apr 10 20:32:50 2015 +0200 fsck: Verify first cluster of a file is not 1 Previously the FAT was checked for any out of bounds entries which were cleared. However the first cluster of a file, as specified in its directory entry, was not verified to not be 1. In addition to missing this filesystem error, code that correctly assumes the FAT contained no bad entries anymore could still look up invalid table indices depending on the value stored in entry 1. With the right values and FAT size this can lead to a segfault by accessing unallocated memory. Now test_file() will ignore files where the first cluster equals 1 and an additional check in check_file() will truncate them. This bug was reported in http://bugs.debian.org/773885 by Jakub Wilk. Signed-off-by: Andreas Bombe commit 2a56575 Author: Andreas Bombe Date: Thu Apr 2 23:35:00 2015 +0200 Simplify synopses of man pages Since there is only one mode of invocation for the tools, it is somewhat pointless to list every possible option in the synopsis. Fix a few style inconsistencies in addition, specifically that placeholders for option arguments are in capital letters and should be shown where the option is described. Signed-off-by: Andreas Bombe commit 40f1436 Author: Andreas Bombe Date: Wed Apr 1 20:55:58 2015 +0200 Update homepage and maintainer sections of man pages Signed-off-by: Andreas Bombe commit 0169db8 Author: Andreas Bombe Date: Wed Apr 1 20:05:01 2015 +0200 mkfs: Show a clearer message that file already exists with -C Signed-off-by: Andreas Bombe commit 2967e27 Author: Andreas Bombe Date: Mon Mar 30 21:12:51 2015 +0200 mkfs: Remove O_TRUNC from file creation call open() is called with O_EXCL | O_CREAT, so it will definitely create a new, empty file or error out. O_TRUNC is superfluous and may be harmless in practice but its effect under these circumstances is unspecified. Signed-off-by: Andreas Bombe commit 90612df Author: Andreas Bombe Date: Mon Mar 30 21:09:51 2015 +0200 mkfs: Use ftruncate() for expanding created file Signed-off-by: Andreas Bombe commit 58e8e09 Author: Andreas Bombe Date: Tue Mar 24 21:32:40 2015 +0100 mkfs: Add --invariant option The --invariant option is designed to prevent random or time based differences to end up in generated filesystems so that multiple runs generate on the same file or device create completely identical results. This is intended for debugging or regression testing of mkfs.fat. Signed-off-by: Andreas Bombe commit 354feaf Author: Andreas Bombe Date: Thu Mar 19 21:35:21 2015 +0100 mkfs: Add long option parsing Add long option parsing with getopt_long() to mkfs and define --help as the first long option. The usage() function now takes an exit code parameter so that the --help option handling can exit the program with a success exit code. Signed-off-by: Andreas Bombe commit b611549 Author: Andreas Bombe Date: Mon Mar 16 21:08:35 2015 +0100 Do not expect EOF as return value of getopt() Signed-off-by: Andreas Bombe commit a41fc32 Author: Andreas Bombe Date: Wed Mar 11 21:45:04 2015 +0100 fsck.fat: Fix read beyond end of array on FAT12 When a FAT12 filesystem contains an odd number of clusters, setting the last cluster with set_fat() will trigger a read of the next entry, which does not exist in the fat array allocated for this. Round up the allocation to an even number of FAT entries for FAT12 so that this is fixed without introducing special casing in get_fat(). Signed-off-by: Andreas Bombe commit e18d72f Author: Álvaro Fernández Rojas Date: Sat Mar 7 13:23:23 2015 +0100 Remove linux/msdos_fs.h includes Signed-off-by: Álvaro Fernández Rojas Signed-off-by: Andreas Bombe commit 245d0cc Author: Álvaro Fernández Rojas Date: Thu Feb 26 19:22:54 2015 +0100 Remove non standard int types Signed-off-by: Álvaro Fernández Rojas Signed-off-by: Andreas Bombe commit 628b3ec Author: Álvaro Fernández Rojas Date: Thu Feb 26 19:41:19 2015 +0100 Improve .gitignore Signed-off-by: Álvaro Fernández Rojas Signed-off-by: Andreas Bombe commit 02b5a6d Author: Álvaro Fernández Rojas Date: Thu Feb 26 12:51:23 2015 +0100 Makefile: avoid using install -D OS X and FreeBSD are not compatible with this option Signed-off-by: Álvaro Fernández Rojas Signed-off-by: Andreas Bombe commit fb6aea6 Author: Álvaro Fernández Rojas Date: Thu Feb 26 12:50:57 2015 +0100 Makefile: fix typo in uninstall-man Signed-off-by: Álvaro Fernández Rojas Signed-off-by: Andreas Bombe commit 357ab07 Author: Andreas Bombe Date: Thu Feb 19 21:22:54 2015 +0100 fsck.fat: Make -r option default Default mode is now to interactively repair with the option to write the changes back at the end (like the -r option) instead of the previous default mode of interactively correcting but never writing back the changes. The -r option continues to be recognized by fsck.fat. Signed-off-by: Andreas Bombe commit 266a5fc Author: Andreas Bombe Date: Fri Feb 20 03:19:28 2015 +0100 mkfs.fat: Allow 0xF0 to be specified as media byte Let the -M option accept 0xF0, which should be the proper descriptor byte for 3.5" 1.44 MB and 2.88 MB floppies. Also split the error reporting for -M between badly formatted and invalid numbers. Signed-off-by: Andreas Bombe commit 16e97e9 Author: Andreas Bombe Date: Wed Jan 28 15:07:18 2015 +0100 Make all char* that may take literals const Every char* variable or function argument that may be given a literal string is now made const. Additionally add -Wwrite-strings to CFLAGS to enable a warning where const would be missing. Signed-off-by: Andreas Bombe commit 8b8948c Author: Andreas Bombe Date: Mon Dec 29 18:24:54 2014 +0100 mkfs.fat.c: Use unsigned char for binary data Simple char technically works for the dummy_boot_jump variables, but some compiler warning settings would give a warning over a signed char overflowing with the values given as initializers. Signed-off-by: Andreas Bombe commit 45aeed0 Author: Andreas Bombe Date: Sun Nov 16 19:49:22 2014 +0100 Fix indentation of "fix power loss damage" commit I fixed the (sometimes misleading) indentation of the code introduced in commit 6893c45 to be in line with the reset of the code and also removed the /* PATCH ED+DL */ comments which are quite meaningless to the wider world. Signed-off-by: Andreas Bombe commit 75c5446 Author: Andreas Bombe Date: Sat Nov 15 16:48:48 2014 +0100 Add tags and editor backup files to .gitignore Signed-off-by: Andreas Bombe commit cb98ae2 (tag: v3.0.27) Author: Andreas Bombe Date: Wed Nov 12 01:10:23 2014 +0100 Releasing version 3.0.27. Signed-off-by: Andreas Bombe commit e2c8f06 Author: Andreas Bombe Date: Wed Nov 12 00:22:17 2014 +0100 fsck.fat: Don't print version string every time -v is encountered Remove the printing of the version string every time -v is seen during command line parsing in fsck.fat. The version string is printed anyway before opening the filesystem device/image. Signed-off-by: Andreas Bombe commit 82076b6 Author: Andreas Bombe Date: Tue Nov 11 23:25:30 2014 +0100 Fix attempt to rename root dir in fsck due to uninitialized fields When add_file() is called with offset 0, it will construct a DIR_ENT for the root directory instead of reading the contents from the filesystem. It did not initialize the whole DIR_ENT on the stack, just select values. In particular, the lcase field was left with an undefined value. If that value happened to include the FAT_NO_83NAME bit, the "neither long nor short file name" check in bad_name() added in 3.0.26 would trigger and cause an attempt to rename the entry (which is not possible). Example run: $ /sbin/fsck.fat -y bad.img fsck.fat 3.0.26 (2014-03-07) / Bad short file name (). Auto-renaming it. Renamed to bad.img: 14 files, 19388/403266 clusters This commit changes the initialization zeroize the whole struct before setting individual fields. Thanks to AlexisM, who found the cause and posted a patch on the Debian bug http://bugs.debian.org/764992 . Signed-off-by: Andreas Bombe commit c24ecb6 Author: Andreas Bombe Date: Tue Nov 11 22:49:50 2014 +0100 Support long file names in volume labeling code The code to find the volume label directory entry in find_volume_de() did not consider long file names so far. Directory entries that make up long file names have four attribute bits set, including the "volume" bit. This caused the code to mistake a directory entry that is part of a long file name as the volume name entry. If such an entry is found first, fatlabel would print garbage when asked to display the label and mangle the long file name when asked to set it. The latter would lead to the loss of the long file name and require a fsck to clean up. Change so that the set of attributes equal that of LFN entries will no langer match as a volume label. Signed-off-by: Andreas Bombe commit 1646f6e (tag: v3.0.26) Author: Daniel Baumann Date: Fri Mar 7 18:40:13 2014 +0100 Releasing version 3.0.26. Signed-off-by: Daniel Baumann commit 6893c45 Author: Dir Lotter Date: Fri Mar 7 18:25:39 2014 +0100 Fix "odd" files created by frequent power-loss. After running many power losses the filesystem can degrate, containing "odd" files making the filesystem corrupt that could not be solved by fsck: * file was not visible in a ls -l * ls -i reported a "invalid file name" on the console * a test program with diropen/dirread showed the file, a stat on this file failed * file was not accessible and could not be deleted After digging into the code we found why fsck didn't repair the file system: One thing was we don't have short filenames. Another issue was that the LFN pointer was set to NULL and so it looked like we didn't have short and long filenames. Our patch of check.c includes: * returns 1 from function bad_name() in case no short and no long filename exist * auto_rename() and rename_file() got a special handling for the case no short file name exist: - it enables the short file name (we think here was a weakness of the old code: it changed the short filename but didn't enabled it in the file->dir_ent.lcase entry) - it reset all attributes except ATTR_DIR and ATTR_VOLUME This solved our problem pretty well. Signed-off-by: Daniel Baumann commit 621e11f Author: Natanael Copa Date: Sat Feb 8 18:53:30 2014 +0100 Build fixes for musl libc. Signed-off-by: Daniel Baumann commit 52588b7 (tag: v3.0.25) Author: Daniel Baumann Date: Fri Jan 17 07:11:11 2014 +0100 Releasing version 3.0.25. Signed-off-by: Daniel Baumann commit acf64ae Author: Daniel Baumann Date: Fri Jan 17 07:09:54 2014 +0100 Updating copyright headers for 2014. Signed-off-by: Daniel Baumann commit 21fe921 Author: Andrew Tridgell Date: Tue Jan 14 09:37:51 2014 +1100 Fixed remaining 64 bit build warnings. Some of these may be real bugs. Signed-off-by: Daniel Baumann commit 9e3a2b1 Author: Andrew Tridgell Date: Tue Jan 14 09:25:28 2014 +1100 Prevent corruption of FAT during fsck on 64 bit platforms. unsigned long is 64 bit on x86-64, which means set_fat was writing two entries, which corrupts the next entry. This can cause loss of data in another file. Signed-off-by: Daniel Baumann commit 0d2c9bc (tag: v3.0.24) Author: Daniel Baumann Date: Sat Nov 23 10:36:55 2013 +0100 Releasing version 3.0.24. Signed-off-by: Daniel Baumann commit 55bd7b7 Author: Jaroslav Skarvada Date: Sat Nov 23 10:34:48 2013 +0100 Fixed dosfsck on big endian platforms (Resolves: rhbz#1029695). It seems there is problem in the double conversion on big endians. The first conversion is done by the explicit conversion to __u16 in the GET_UNALIGNED_W macro, so the secondary conversion by le16toh seems to be redundant (and wrong). Signed-off-by: Daniel Baumann commit 6debb4a (tag: v3.0.23) Author: Daniel Baumann Date: Tue Oct 15 08:05:46 2013 +0200 Releasing version 3.0.23. Signed-off-by: Daniel Baumann commit 07d85ff Author: Daniel Baumann Date: Tue Oct 15 08:04:11 2013 +0200 Reformating mkfs.fat manpage. Signed-off-by: Daniel Baumann commit 137552f Author: Michael Shigorin Date: Tue Oct 15 01:29:33 2013 +0400 Fixing "Fixing default sectors per cluster for FAT32" for UEFI. FAT32 "EFI System Partition" is basically required for UEFI boot; commit ge048a8d broke that for me with both virtualbox-4.2 and real hardware (ASUS C60M1-I to be exact) given ~250Mb filesystem. This commit amends that one by reverting its effects for these small sizes by restoring 512b cluster size for <= 260Mb FAT32. Signed-off-by: Daniel Baumann commit 2000696 Author: Daniel Baumann Date: Fri Aug 9 09:38:13 2013 +0200 Also allowing lowercase labels in mkfs (with warning message) consistent with the recent fsck change, thanks to Michael Baum . Signed-off-by: Daniel Baumann commit 9b04807 Author: Tim Harder Date: Fri Jul 19 18:15:21 2013 +0200 Add install-man dependency to install-symlinks Makefile target. This fixes a race condition during parallel installs where man page symlinks won't be installed because install-man hasn't been run yet. Signed-off-by: Daniel Baumann commit 651f91c (tag: v3.0.22) Author: Daniel Baumann Date: Fri Jul 19 07:01:19 2013 +0200 Releasing version 3.0.22. Signed-off-by: Daniel Baumann commit 3dc5560 Author: Daniel Baumann Date: Fri Jul 19 06:55:24 2013 +0200 Addding install-symlinks target to phony targets in Makefile. Signed-off-by: Daniel Baumann commit c6c0581 Author: Daniel Baumann Date: Fri Jul 19 06:55:00 2013 +0200 Adding uninstall-symlinks target in Makefile. Signed-off-by: Daniel Baumann commit 465dd8c Author: Daniel Baumann Date: Fri Jul 19 06:45:40 2013 +0200 Allowing fatlabel to write labels in all lowercase but give a warning about DOS/Windows (Closes: #714971). Signed-off-by: Daniel Baumann commit 3621b30 Author: John S Gruber Date: Fri Jul 19 06:40:21 2013 +0200 Add options and make dos boot sector more compatible with reference system (Closes: #552673). Unless overridden by the user sets the DOS boot sector's hidden-sectors field to match the start of a hard disk's partition. Initialize DOS boot sector drive_number according to FAT media type Addresses LP: #398241 and Debian #552673 Adds options to override the DOS boot sector device_number and the FAT media type. Signed-off-by: Daniel Baumann commit be1eed5 Author: Daniel Baumann Date: Wed Jul 17 12:52:20 2013 +0200 Correcting wrong check preventing installation of fatlabel legacy manpage symlink. Signed-off-by: Daniel Baumann commit d0065d3 (tag: v3.0.21) Author: Daniel Baumann Date: Tue Jul 16 08:34:28 2013 +0200 Releasing version 3.0.21. Signed-off-by: Daniel Baumann commit a74c12c Author: Jaroslav Skarvada Date: Tue Jun 25 14:53:14 2013 +0200 Adding the missing -p option to the fsck manpage (to be consistent with the output of the tool). Signed-off-by: Daniel Baumann commit 25e03c9 Author: Patrick J. Volkerding Date: Mon Jun 24 14:23:00 2013 +0200 Using $MANDIR instead of hardcoded ${PREFIX}/share/man in the Makefile. Signed-off-by: Daniel Baumann commit 7fd9cf7 Author: Daniel Baumann Date: Fri Jun 14 18:50:31 2013 +0200 Making install-symlinks Makefile target depend on install-bin to not break when using make in parallel, thanks to David Walser . Signed-off-by: Daniel Baumann commit a76bbcd Author: Daniel Baumann Date: Wed Jun 12 13:00:10 2013 +0200 Using US digit date format in version date, rather than name abbrev. Signed-off-by: Daniel Baumann commit a64195f (tag: v3.0.20) Author: Daniel Baumann Date: Wed Jun 12 12:25:32 2013 +0200 Releasing version 3.0.20. Signed-off-by: Daniel Baumann commit 1a5d99f Author: Daniel Baumann Date: Wed Jun 12 12:07:58 2013 +0200 Softening message about different boot sectors a bit (Closes: #704198). Signed-off-by: Daniel Baumann commit 4727286 Author: Daniel Baumann Date: Wed Jun 12 11:42:52 2013 +0200 Harmonizing program name output. Signed-off-by: Daniel Baumann commit 17c956c Author: Martin Wilck Date: Wed Jun 12 11:38:00 2013 +0200 Don't align FAT to cluster size. See previous patch for explanation. With this patch and the previous two, the mkdosfs generated FAT32 file systems work well in my extremely picky TechniSat device. Of course, they're also detected cleanly by Linux and Windows. Signed-off-by: Daniel Baumann commit d63e0d6 Author: Martin Wilck Date: Wed Jun 12 11:36:08 2013 +0200 Don't align FAT32 reserved sectors to cluster size. For certain file system sizes (in particular, exact GB sizes - don't ask me why) a Technisat HD S2 Plus DVB receiver will still choke on mkdosfs generated file systems, even if the sectors per cluster problem is fixed. By comparing the properties of generated FAT32 FS with results of the Windows tool "h2format" (www.heise.de/download/h2format.html), I found that the remaining problems were caused by rounding of the reserved sectors and FAT space to cluster size (the h2format tool doesn't do this). Signed-off-by: Daniel Baumann commit e048a8d Author: Martin Wilck Date: Wed Jun 12 11:33:33 2013 +0200 Fixing default sectors per cluster for FAT32 (Closes: #690062). The default sectors per cluster calculated by mkdosfs are outdated, see http://technet.microsoft.com/en-us/library/cc938438.aspx. The deviations may cause some 3rd party devices (e.g. TechniSat DVB receivers) to hang when reading mkdosfs generated file systems. Signed-off-by: Daniel Baumann commit 86509aa Author: Daniel Baumann Date: Tue Jun 11 20:19:09 2013 +0200 Splitting out legacy symlink creation in toplevel Makefile to own target. Signed-off-by: Daniel Baumann commit da37dd1 Author: Daniel Baumann Date: Wed Jun 12 11:29:12 2013 +0200 Correcting wrong toolname in fsck.fat. Signed-off-by: Daniel Baumann commit b29a722 Author: Daniel Baumann Date: Tue Jun 11 19:51:47 2013 +0200 Consistently spelling filesystem as filesystem, and not file system. Signed-off-by: Daniel Baumann commit 977d7aa Author: Daniel Baumann Date: Tue Jun 11 19:30:19 2013 +0200 Removing Debian reference in GPL license headers. Signed-off-by: Daniel Baumann commit 5505cc2 (tag: v3.0.19) Author: Daniel Baumann Date: Tue Jun 11 18:46:03 2013 +0200 Releasing version 3.0.19. Signed-off-by: Daniel Baumann commit 2c88f35 Author: Daniel Baumann Date: Tue Jun 11 18:44:50 2013 +0200 Running indent on source files. Signed-off-by: Daniel Baumann commit d495d43 Author: Daniel Baumann Date: Tue Jun 11 18:41:41 2013 +0200 Using memcpy instead of strcpy to fix segfault with fortify, thanks to Dave Reisner . Signed-off-by: Daniel Baumann commit 9fb4ffc Author: Daniel Baumann Date: Sun Jun 9 13:17:16 2013 +0200 Correcting fsck.fat spelling error in manpages, thanks to E.J.M. Hartman . Signed-off-by: Daniel Baumann commit 2d8ef9b (tag: v3.0.18) Author: Daniel Baumann Date: Thu Jun 6 09:49:00 2013 +0200 Releasing version 3.0.18. Signed-off-by: Daniel Baumann commit d4e1180 Author: Daniel Baumann Date: Thu Jun 6 09:38:45 2013 +0200 Adding initial i18n support for manpages with po4a. Signed-off-by: Daniel Baumann commit ea8f712 Author: Daniel Baumann Date: Thu Jun 6 09:17:13 2013 +0200 Renaming tools to sane namespace and keeping legacy symlinks in place. dosfslabel becomes fatlabel, dosfsck becomes fsck.fat, and mkdosfs becomes mkfs.fat. Signed-off-by: Daniel Baumann commit a42b127 Author: Daniel Baumann Date: Wed Jun 5 07:12:03 2013 +0200 Correcting wrong spelling of Debian in mkdosfs manpage. Signed-off-by: Daniel Baumann commit 2749084 Author: Daniel Baumann Date: Wed Jun 5 07:10:50 2013 +0200 Correcting spelling typo in boot.c. Signed-off-by: Daniel Baumann commit 6461c83 Author: Martin Pitt Date: Fri May 24 09:35:44 2013 +0200 dosfslabel: Do not read beyond string length (Closes: #709587). When checking whether the label contains any lower-case characters, do not read beyond the end of the string. Signed-off-by: Daniel Baumann commit 4203a90 (tag: v3.0.17) Author: Daniel Baumann Date: Wed May 29 10:14:09 2013 +0200 Releasing version 3.0.17. Signed-off-by: Daniel Baumann commit 3aa88ed Author: Daniel Baumann Date: Wed May 29 09:48:24 2013 +0200 Updating maximal lenght of a label in manpage to talk about bytes instead of characters, thanks to Francois Wendling (Closes: #655953). Signed-off-by: Daniel Baumann commit 0916f8a Author: Jaroslav Skarvada Date: Wed May 29 09:56:08 2013 +0200 Fixing segfault in dosfslabel. Signed-off-by: Daniel Baumann commit 4a265c6 Author: James Byrne Date: Mon Apr 22 12:29:51 2013 +0100 Allow operation on SH4 CPUs and remove compiler warnings. Simplify the GET_UNALIGNED_W macro and use it in all cases instead of making it conditional on CPU types. This missed some CPUs that needed it (e.g. SH4), and in any case the implementation caused "dereferencing type-punned pointer will break strict-aliasing rules" warnings. Enable extra warnings, but disable signed comparison and missing field initializer warnings as these are not helpful. Update write_boot_label() so that the boot_sector_16 and boot_sector cases are handled separately instead of using an aliased pointer, as that causes "dereferencing type-punned pointer will break strict-aliasing rules" warnings. Make date_dos2unix(), usage() and cdiv() static functions as they are only used in the files in which they are declared. Update bad_name() and lfn_get() so that the extension is processed separately instead of by indexing past the end of the name field as that causes "array subscript is above array bounds" warnings. Update the dosfsck() main function to avoid a warning that free_clusters may be used uninitialized. Do not print the final count of files and clusters when dosfsck is run with the "-b" option because the used files and clusters have not been counted in this case. Alter the setup_tables() function so that it does not cause an "array subscript is below array bounds" warning. Signed-off-by: Daniel Baumann commit eb68a14 Author: James Byrne Date: Mon Apr 22 13:32:01 2013 +0100 Add a .gitignore file. Add a .gitignore file so that the results of compilation do not appear as changes. Signed-off-by: Daniel Baumann commit 336e8f1 Author: James Byrne Date: Mon Apr 22 12:38:52 2013 +0100 Finish cleanup of byteswap code. Commit 9ba8992 left three references to the old CT_LE_W macro. Remove these since no conversion was needed as the value being converted was zero. Signed-off-by: Daniel Baumann commit 64b6227 Author: Daniel Baumann Date: Thu Apr 4 08:08:00 2013 +0200 Shortening links to upstream homepage. Signed-off-by: Daniel Baumann commit 76304be Author: Cristian Rodríguez Date: Fri Mar 1 08:23:34 2013 +0100 Fix offsetof definition. * include stddef.h to get the correct offsetof definition. * remove local offsetof definition, systems not having it on stddef.h are in violation of C89, C99, POSIX.1-2001. Signed-off-by: Daniel Baumann commit 9ba8992 Author: Cristian Rodríguez Date: Fri Mar 1 08:58:36 2013 +0100 Cleanup byteswap code. Remove all duplicate macro definitions for byteswapping routines and replace them for proper usage of userspace endian(3). Signed-off-by: Daniel Baumann commit 8733e12 (tag: v3.0.16) Author: Daniel Baumann Date: Wed May 29 10:06:01 2013 +0200 Releasing version 3.0.16. Signed-off-by: Daniel Baumann commit a9fa87e Author: Petr Gajdos Date: Fri Mar 1 08:34:12 2013 +0100 Create rootdir entry volume label with mkdosfs, create it when it doesn't exist with dosfslabel. See https://bugzilla.novell.com/show_bug.cgi?id=657011#c4 for more information. Signed-off-by: Daniel Baumann commit 92057f1 Author: Petr Gajdos Date: Fri Mar 1 08:33:18 2013 +0100 Forbid lowercase letters in label. See https://bugzilla.novell.com/show_bug.cgi?id=657011#c4 and http://support.microsoft.com/kb/71715/en-us for more information. Signed-off-by: Daniel Baumann commit 5e265c4 Author: Petr Gajdos Date: Fri Mar 1 08:32:02 2013 +0100 Read label also from rootdir entry. See https://bugzilla.novell.com/show_bug.cgi?id=657011#c4 for more information. Signed-off-by: Daniel Baumann commit 5cec53c Author: Petr Gajdos Date: Fri Mar 1 08:30:21 2013 +0100 alloc_rootdir_entry() is intended to be called with pattern == "FSCK%04dREC", the old code (probably c&p from auto_rename()) doesn't reflect this. Signed-off-by: Daniel Baumann commit 63938f0 Author: Petr Gajdos Date: Fri Mar 1 08:29:00 2013 +0100 Instead of eleven blanks, fill in "NO NAME " as specification tells. See https://bugzilla.novell.com/show_bug.cgi?id=657011#c4 and http://www.win.tue.nl/~aeb/linux/fs/fat/fat-1.html for more information. Signed-off-by: Daniel Baumann commit 10c1c41 Author: Petr Gajdos Date: Fri Mar 1 08:58:15 2013 +0100 Write uppercase letters in label. See https://bugzilla.novell.com/show_bug.cgi?id=657011#c4 and http://support.microsoft.com/kb/71715/en-us for more information. Signed-off-by: Daniel Baumann commit a75fb1c (tag: v3.0.15) Author: Daniel Baumann Date: Thu Feb 21 15:06:52 2013 +0100 Releasing version 3.0.15. Signed-off-by: Daniel Baumann commit c8f84fd Author: Alexander Korolkov Date: Mon Feb 4 00:22:34 2013 +0400 Using wcstombs() to convert LFN unicode characters to printable text. This closes Debian bug #596336. Signed-off-by: Daniel Baumann commit 1546545 Author: Alexander Korolkov Date: Sun Sep 5 18:59:47 2010 +0400 Recode short filenames from DOS codepage (default 437). Recode short filenames from DOS codepage (default 437) to the current character encoding. This makes messages of dosfsck more readable. Partially closes Debian bug #596336. Signed-off-by: Daniel Baumann commit ad76cae Author: Jaroslav Skarvada Date: Thu Feb 21 14:40:52 2013 +0100 Fixing root directory allocation. See https://bugzilla.redhat.com/show_bug.cgi?id=674095 for more information. Signed-off-by: Daniel Baumann commit b8201b3 Author: Jaroslav Skarvada Date: Thu Feb 21 14:40:25 2013 +0100 Fixing device detection. See https://bugzilla.redhat.com/show_bug.cgi?id=710480 for more information. Signed-off-by: Daniel Baumann commit 7a75638 (tag: v3.0.14) Author: Daniel Baumann Date: Wed Jan 23 13:22:01 2013 +0100 Releasing version 3.0.14. Signed-off-by: Daniel Baumann commit 5bdd7ef Author: Daniel Baumann Date: Wed Jan 23 13:16:20 2013 +0100 Documenting dosfsck -b in its manpage. Signed-off-by: Daniel Baumann commit a307be2 Author: Oleksij Rempel Date: Wed Jan 23 12:36:56 2013 +0100 Adding option for bootsector read-only check. Most boot sectors may contains marker for filesystem state. We can this bit on every mount and warn user if some thing wrong, without checking complete filesystem. Signed-off-by: Oleksij Rempel Signed-off-by: Daniel Baumann commit ce2f8dc Author: Oleksij Rempel Date: Wed Jan 23 12:35:13 2013 +0100 Checking boot sector for dirty bit. Some OSos use reseved byte of boot sector to set state of the file system. If first bit set, then filesystem is proably damaged - write operation was not finished/cache not snycted/... Signed-off-by: Oleksij Rempel Signed-off-by: Daniel Baumann commit f33ee8c Author: Daniel Baumann Date: Wed Jan 23 12:25:59 2013 +0100 Completing and updating all copyright headers for 2013. Signed-off-by: Daniel Baumann commit bfe6d25 Author: Daniel Baumann Date: Wed Jan 23 12:17:20 2013 +0100 Updating my email address. Signed-off-by: Daniel Baumann commit 13cdb4d (tag: v3.0.13) Author: Daniel Baumann Date: Sat Jun 30 19:10:44 2012 +0200 Releasing version 3.0.13. Signed-off-by: Daniel Baumann commit d039482 Author: Jaroslav Škarvada Date: Sat Jun 30 19:09:11 2012 +0200 Fix 'dosfslabel throws "Seek to 114116076544:Invalid argument" error when labeling'. See https://bugzilla.redhat.com/show_bug.cgi?id=693662 for more information. Signed-off-by: Daniel Baumann commit e243612 (tag: v3.0.12) Author: Daniel Baumann Date: Sat Oct 29 08:40:53 2011 +0200 Releasing version 3.0.12. Signed-off-by: Daniel Baumann commit 025b4f0 Author: Michael Casadevall Date: Tue Jun 7 19:19:30 2011 +0200 Correcting miscalculation of sector number in some cases. mkdosfs will incorrectly calculate the number of sectors of a given FAT partition if the number sectors are odd due to count_blocks incorrectly handling the remainder of a division operation. This miscalculation causes the OMAP4 bootloader to fail to boot. This bug can be observed by comparing the total sector size in fdisk expert more to fsck.msdos; this discrepancy only shows up when the number of sectors are odd. See https://bugs.launchpad.net/ubuntu/+source/dosfstools/+bug/794043 for more information. Signed-off-by: Daniel Baumann commit 91a1fb9 Author: Daniel Baumann Date: Sat Jan 8 23:38:59 2011 +0100 Re-running Nindent. Signed-off-by: Daniel Baumann commit 0390c4c Author: Sergey Gusarov Date: Sat Jan 8 23:36:11 2011 +0100 Fixing compiler warnings related to the mismatch of types "char *" / "unsigned char *". These warnings appear when you compile the project with the option "-Wall", what is done with the current default Makefile. Signed-off-by: Daniel Baumann commit 4a8f8a6 Author: Jaroslav Skarvada Date: Thu Jan 6 22:35:00 2011 +0100 Fixing overflow bug in reclaim_file function, see https://bugzilla.redhat.com/show_bug.cgi?id=660154 for more information. The problem is that alloc_rootdir_entry counts with 10000 files at max, but the filename buffer is only 8 chars long. Due to pattern mask used it results to only 10 files at max (FSCK0-9REC). If there is more than 10 files, it overflows and hangs. Signed-off-by: Daniel Baumann commit e0366da Author: Sergey Gusarov Date: Thu Jan 6 22:31:39 2011 +0100 Fixing conversion specifiers in accordance with the type of expressions. Signed-off-by: Daniel Baumann commit 2d8be9c Author: Daniel Baumann Date: Sun Jan 2 15:41:44 2011 +0100 Indenting source files. Signed-off-by: Daniel Baumann commit 697af85 Author: Daniel Baumann Date: Sun Jan 2 15:39:03 2011 +0100 Adding Nindent script from syslinux. Signed-off-by: Daniel Baumann commit 66d55cd (tag: v3.0.11) Author: Daniel Baumann Date: Fri Dec 24 17:58:29 2010 +0100 Releasing version 3.0.11. Signed-off-by: Daniel Baumann commit d579802 Author: Michael Stapelberg Date: Fri Nov 19 14:09:36 2010 +0100 Add better error message when the device cannot be opened. This is helpful for SD cards or other removable media which have an enabled write lock -- without the "Permission denied" message, the user has to strace mkdosfs to find out what's going on. Signed-off-by: Daniel Baumann commit bb6000f Author: Jaroslav Skarvada Date: Fri Oct 8 13:38:16 2010 +0200 Unalign on s390x, see http://bugzilla.redhat.com/show_bug.cgi?id=624596 for more information. Signed-off-by: Daniel Baumann commit 5ef7f1f (tag: v3.0.10) Author: Daniel Baumann Date: Sun Sep 12 09:35:47 2010 +0200 Releasing version 3.0.10. Signed-off-by: Daniel Baumann commit ea41797 Author: Alexander Korolkov Date: Sun Sep 12 09:29:12 2010 +0200 Modify LFN direntries when file is renamed or deleted, see Debian bug #596329. Signed-off-by: Daniel Baumann commit e56ff72 Author: Alexander Korolkov Date: Sun Sep 12 09:27:07 2010 +0200 If the test of short filename fails, dosfsck could complain about bad long filename, see Debian bug #596327. Signed-off-by: Daniel Baumann commit f0a42d0 Author: Alexander Korolkov Date: Sun Sep 12 09:24:47 2010 +0200 dosfsck: don't complain about bad filenames when short filename contains 7 or more characters with codes 128-255, see Debian bug #596327. Signed-off-by: Daniel Baumann commit 0113c5b Author: Mitch Rybczynski Date: Mon Jul 5 14:45:54 2010 +0200 Adding __arm__ define check for some crosscompile toolchains. Signed-off-by: Daniel Baumann commit 88cb84f Author: Daniel Baumann Date: Sun Mar 14 16:42:32 2010 +0100 Modernizing dosfslabel manpage. Signed-off-by: Daniel Baumann commit 5aa7ec4 Author: Daniel Baumann Date: Sun Mar 14 16:33:47 2010 +0100 Modernizing dosfsck manpage. Signed-off-by: Daniel Baumann commit 807ed80 Author: Daniel Baumann Date: Sun Mar 14 16:05:32 2010 +0100 Fixing spelling error in boot.c. Signed-off-by: Daniel Baumann commit 5b6849d (tag: v3.0.9) Author: Daniel Baumann Date: Sun Jan 31 08:31:32 2010 +0100 Releasing version 3.0.9. Signed-off-by: Daniel Baumann commit 33bca7d Author: Daniel Kahn Gillmor Date: Sun Jan 31 00:11:41 2010 -0500 Be sure to store the updated reserved_sector count in the boot sector, see Debian bug #567337. Signed-off-by: Daniel Baumann commit 2a3bef8 (tag: v3.0.8) Author: Daniel Baumann Date: Sat Jan 23 10:16:18 2010 +0100 Releasing version 3.0.8. Signed-off-by: Daniel Baumann commit 726c02d Author: Daniel Baumann Date: Sat Jan 23 10:15:01 2010 +0100 Removing some cruft in end-comments. Signed-off-by: Daniel Baumann commit a5961d7 Author: Steven J. Magnani Date: Thu Jan 21 16:58:11 2010 +0100 When compiling a 32-bit version of dosfstools on an x86_64 machine, the resulting applications report strange errors on "large" (> 2 GiB) partitions: Seek to -2118967808:Invalid argument Warning: Filesystem is FAT32 according to fat_length and fat32_length fields, but has only 8613 clusters, less than the required minimum of 65525. This may lead to problems on some systems. This appears to be due to compilation with a 32-bit off_t and lseek() library function. Use lseek64 for positioning, and change some suspect uses of off_t to loff_t. Signed-off-by: Daniel Baumann commit bbb25bf Author: Steven J. Magnani Date: Thu Jan 21 16:56:26 2010 +0100 If dosfsck is run in read-only mode (-n), exit with code 0 if the only issue found is an uninitialized free cluster summary. Signed-off-by: Daniel Baumann commit 1cae726 Author: Steven J. Magnani Date: Thu Jan 21 16:55:30 2010 +0100 On x86_64, dosfsck incorrectly claims that a free_cluster summary of 0xFFFFFFFF, defined by Microsoft to be "uninitialized," is wrong. Signed-off-by: Daniel Baumann commit 62f806a Author: H. Peter Anvin Date: Fri Jan 8 09:16:38 2010 +0100 mkdosfs: correct alignment of the root directory. Correct the code to align the root directory; it was broken before since bs.dir_entries had already been set at the point of alignment. This patch removes the dual use of bs.dir_entries and root_dir_entries to carry the same information: the information is carried in root_dir_entires exclusively, and then bs.dir_entries is set inside setup_tables() at a late point. The code to align the root directory is also wrapped in if (align_structures); this avoids rounding the number of root directory entries up to a whole sector when used with -a (i.e. preserves the previous behavior.) Signed-off-by: Daniel Baumann commit 8825bda Author: H. Peter Anvin Date: Wed Jan 6 20:55:36 2010 +0100 mkdosfs: improve wording in the man page for the -a option. Improve the English language used in the man page for the -a (no align) option to mkdosfs. Signed-off-by: Daniel Baumann commit 21d3f81 Author: Daniel Baumann Date: Wed Jan 6 11:27:25 2010 +0100 Adding reference to dosfslable in mkdosfs manpage. Signed-off-by: Daniel Baumann commit 247ba06 Author: H. Peter Anvin Date: Wed Jan 6 11:18:55 2010 +0100 mkdosfs: by default align all structures to cluster boundaries Align all data structures (reserved sectors, FATs, root directory for FAT12/16) to an even multiple of the cluster size. This means that if the partition is aligned, so will all clusters be. This adds significant performance for anything where the physical sector size is larger than the logical sector size, e.g. flash media or large-sector hard disks. Signed-off-by: Daniel Baumann commit 171bc07 (tag: v3.0.7) Author: Daniel Baumann Date: Thu Dec 24 10:53:36 2009 +0100 Releasing version 3.0.7. Signed-off-by: Daniel Baumann commit 28708fc Author: Ben Hutchings Date: Thu Dec 24 09:55:52 2009 +0100 Fixing dosfslabel to set volume label in the right place, see Debian bug #559985. Signed-off-by: Daniel Baumann commit 2c405dd Author: Lubomir Rintel Date: Thu Dec 24 09:39:39 2009 +0100 Fixing out-of bound writes. Firstly, packed attribute is added to the structure so that extension is guarranteed to immediately follow name for the cross-name-extension reads to succeed. Secondly, writes into dir_entry->name that span through the extension as well are split into two, so that FORTIFY_SOURCE's bound checking does not abort dosfsck. There also was an off-by-one error in auto_rename()'s sprintf(). Signed-off-by: Daniel Baumann commit b8f3efe Author: San Mehat Date: Thu Dec 24 09:31:41 2009 +0100 Adding custom exit code in dosfsck for the case where the FS is read only. Signed-off-by: Daniel Baumann commit 0657e01 (tag: v3.0.6) Author: Daniel Baumann Date: Sun Oct 4 10:59:33 2009 +0200 Releasing version 3.0.6. Signed-off-by: Daniel Baumann commit bc84254 Author: Steven J. Magnani Date: Sun Oct 4 10:58:43 2009 +0200 Attempt to improve clarity of the orphan cluster reclaim code. Minor optimization - remove some unnecessary checking. Signed-off-by: Daniel Baumann commit 8054b4a Author: Steven J. Magnani Date: Sun Oct 4 08:37:19 2009 +0200 Close hole that permitted clusters to link to (invalid) cluster 1. If an orphan chain that linked to cluster 1 was reclaimed to a file, deletion of the file would result in a filesystem panic. Signed-off-by: Daniel Baumann commit e51af88 Author: Steven J. Magnani Date: Sun Oct 4 08:32:30 2009 +0200 Fix erroneous report of huge number of clusters in use on big-endian systems when the FSINFO free cluster count is reset. Signed-off-by: Daniel Baumann commit 16ba63f (tag: v3.0.5) Author: Daniel Baumann Date: Mon Jul 27 14:26:11 2009 +0200 Releasing version 3.0.5. Signed-off-by: Daniel Baumann commit 28ff9d9 Author: Piotr Kaczuba Date: Sun Jul 26 22:21:25 2009 +0200 Signed/unsigned char mismatch in check.c causes false positives in bad_name() and can result in data loss, see Debian bug #538758. Signed-off-by: Daniel Baumann commit d42a273 Author: Andrew Tridgell Date: Sun Jul 26 22:12:06 2009 +0200 Update to new kernel patches that add FAT_NO_83NAME flag. See http://lkml.org/lkml/2009/7/20/425 and http://lkml.org/lkml/2009/7/20/424 for more information. Signed-off-by: Daniel Baumann commit dd0f0b5 (tag: v3.0.4) Author: Daniel Baumann Date: Tue Jul 21 08:10:52 2009 +0200 Releasing version 3.0.4. Signed-off-by: Daniel Baumann commit b9f37a6 Author: Andrew Tridgell Date: Tue Jul 21 07:59:22 2009 +0200 Modify dosfstools to support the dummy 8.3 short filename values used by Linux systems with the VFAT_FS_DUALNAMES option disabled. See http://lkml.org/lkml/2009/6/26/313 and http://lkml.org/lkml/2009/6/26/314 for more information. Signed-off-by: Daniel Baumann commit ecd15e8 Author: Paul Rupe Date: Tue May 19 10:37:52 2009 +0200 Fixing "Too many files need repair" error during fsck. Signed-off-by: Daniel Baumann commit 7c16098 (tag: v3.0.3) Author: Daniel Baumann Date: Mon May 18 15:12:04 2009 +0200 Releasing version 3.0.3. Signed-off-by: Daniel Baumann commit b396dcf Author: Daniel Baumann Date: Mon May 18 15:10:55 2009 +0200 Also declaring arm as an unaligned architecture, see Debian bug #502961. Signed-off-by: Daniel Baumann commit ff1b24e Author: Steven J. Magnani Date: Mon May 18 15:01:49 2009 +0200 Adding support for limited-memory embedded systems. This patch reorganizes heap memory usage by dosfsck and mkdosfs to support limited-memory embedded systems - in particular, those based on Xilinx's Microblaze processor. It also adds a few comments. Signed-off-by: Daniel Baumann commit 89f0b72 Author: Mike Frysinger Date: Thu Mar 5 07:03:36 2009 +0100 Declaring Blackfin as an unaligned architecture. Signed-off-by: Daniel Baumann commit b54a8a4 (tag: v3.0.2) Author: Daniel Baumann Date: Sat Feb 28 09:48:04 2009 +0100 Releasing version 3.0.2. Signed-off-by: Daniel Baumann commit 9500529 Author: Hiroaki Ishizawa Date: Fri Feb 13 10:00:46 2009 +0100 dosfsck corrupts root directory when fs->nfats is 1. Signed-off-by: Daniel Baumann commit 043f8a8 Author: Stepan Kasal Date: Fri Jan 30 14:56:33 2009 +0100 src/dosfslabel.c (main): After writing the label, exit code should be 0. Signed-off-by: Daniel Baumann commit 017da27 Author: Daniel Baumann Date: Fri Jan 30 14:06:01 2009 +0100 Also installing ChangeLog in install-doc target of Makefile. Signed-off-by: Daniel Baumann commit 1c76f0f Author: Stepan Kasal Date: Fri Jan 30 14:05:12 2009 +0100 Makefile: Do not clobber time stamps of doc files. Signed-off-by: Daniel Baumann commit df2d2f1 (tag: v3.0.1) Author: Daniel Baumann Date: Sun Nov 23 22:45:45 2008 +0100 Releasing version 3.0.1. Signed-off-by: Daniel Baumann commit 17b269b Author: Daniel Baumann Date: Sun Nov 23 18:41:01 2008 +0100 Applying Fedoras dosfstools-vfat-timingfix.diff from Bill Nottingham to fix vfat timing issue. See https://bugzilla.redhat.com/show_bug.cgi?id=448247 for more information. Signed-off-by: Daniel Baumann commit e597caf Author: Ulrich Mueller Date: Tue Oct 7 07:55:37 2008 +0200 Patch to check for bad number of clusters in dosfsck: * FAT16 filesystems with 65525 clusters or more will be rejected (Before, this was not tested for. Up to 65535 clusters were accepted as good). * For FAT32 filesystems with less than 65525 a warning message will be output. Macro MSDOS_FAT12 is now replaced by FAT12_THRESHOLD to make it consistent with the definition in mkdosfs and to remove the dependency on the kernel version. Signed-off-by: Daniel Baumann commit 90102bc Author: Dann Frazier Date: Tue Sep 30 07:25:19 2008 +0200 Changing some wording to make the indended meaning of "full-disk device" more obvious. Signed-off-by: Daniel Baumann commit 21e9ba0 (tag: v3.0.0) Author: Daniel Baumann Date: Sun Sep 28 11:43:19 2008 +0200 Releasing version 3.0.0. Signed-off-by: Daniel Baumann commit eaf145d Author: Daniel Baumann Date: Sun Sep 28 11:29:01 2008 +0200 Adding GPL headers to all files. Signed-off-by: Daniel Baumann commit 0826117 Author: Daniel Baumann Date: Sun Sep 28 10:51:55 2008 +0200 Adding new GPL license file. Signed-off-by: Daniel Baumann commit f8d6127 Author: Daniel Baumann Date: Fri Sep 26 23:31:12 2008 +0200 Redoing Makefile from scratch. Signed-off-by: Daniel Baumann commit b4feb73 Author: Daniel Baumann Date: Sat Sep 27 00:17:38 2008 +0200 Removing whitespaces in all files at EOL and EOF. Signed-off-by: Daniel Baumann commit 1410138 Author: Daniel Baumann Date: Fri Sep 26 23:48:56 2008 +0200 Adding Debians dosfslabel.8 manpage from Francois Wendling . Signed-off-by: Daniel Baumann commit f62e7f2 Author: Daniel Baumann Date: Fri Sep 26 18:36:04 2008 +0200 Updating version.h includes to new location of version.h file. Signed-off-by: Daniel Baumann commit 32e5952 Author: Daniel Baumann Date: Fri Sep 26 18:19:36 2008 +0200 Removing old lsm file. Signed-off-by: Daniel Baumann commit 25a433b Author: Daniel Baumann Date: Fri Sep 26 18:07:47 2008 +0200 Removing old cvsignore files. Signed-off-by: Daniel Baumann commit acac13f Author: Daniel Baumann Date: Fri Sep 26 18:18:39 2008 +0200 Removing old build file. Signed-off-by: Daniel Baumann commit 3ecdd21 Author: Daniel Baumann Date: Fri Sep 26 18:19:16 2008 +0200 Removing old GPL license files. Signed-off-by: Daniel Baumann commit f183d0e Author: Daniel Baumann Date: Fri Sep 26 18:21:57 2008 +0200 Unifying dosfsck and mkdosfs Makefiles in common src/Makefile. Signed-off-by: Daniel Baumann commit 61e7466 Author: Daniel Baumann Date: Fri Sep 26 18:04:02 2008 +0200 Unifying dosfsck and mkdosfs sources in common src directory. Signed-off-by: Daniel Baumann commit 7552d57 Author: Daniel Baumann Date: Fri Sep 26 18:05:27 2008 +0200 Unifying dosfsck and mkdosfs manpages in common man directory. Signed-off-by: Daniel Baumann commit 124598b Author: Daniel Baumann Date: Fri Sep 26 18:12:29 2008 +0200 Unifying dosfsck and mkdosfs documents in common doc directory. Signed-off-by: Daniel Baumann commit fb9c46b Author: Daniel Baumann Date: Fri Sep 26 15:39:51 2008 +0200 Applying Gentoos dosfstools-2.11-preen.patch from Roy Marples to alias dosfsck -p to -a: * Map -p to -a for baselayout-2, #177514. Signed-off-by: Daniel Baumann commit aaa40a9 Author: Daniel Baumann Date: Fri Sep 26 15:49:43 2008 +0200 Applying Gentoos dosfstools-2.11-build.patch from Mike Frysinger to improve Makefile: * Respect user settings #157785/#157786 by Diego Petteno. Signed-off-by: Daniel Baumann commit 251626d Author: Daniel Baumann Date: Fri Sep 26 15:37:34 2008 +0200 Applying Gentoos dosfstools-2.11-verify-double-count-fix.patch from Robin H. Johnson to fix double count of files during verification: * Don't double-count n_files during a verification pass. Bugzilla: http://bugs.gentoo.org/show_bug.cgi?id=99845 Signed-off-by: Daniel Baumann commit e670ea8 Author: Daniel Baumann Date: Fri Sep 26 15:33:36 2008 +0200 Applying Gentoos dosfstools-2.11-fat32size.patch from Mike Frysinger to fix generation of filesystems on 256meg devices: * Fix generation of FAT filesystems on devices that are 256meg in size Patch by Ulrich Mueller and accepted upstream http://bugs.gentoo.org/112504 Signed-off-by: Daniel Baumann commit a6dc6a4 Author: Daniel Baumann Date: Fri Sep 26 15:22:06 2008 +0200 Applying Suses dosfstools-2.11-unsupported-sector-size.patch from Petr Gajdos to add sector size warning: * added warning for creation msdos on filesystem with sector size greater than 4096 [fate#303325] Signed-off-by: Daniel Baumann commit f746956 Author: Daniel Baumann Date: Fri Sep 26 15:18:35 2008 +0200 Applying Suses dosfstools-2.11-mkdosfs-geo0.diff from Ludwig Nussel to fix handling of zero heads and sectors: * the HDIO_GETGEO ioctl works on device mapper devices but returns zero heads and sectors. Therefore let's a) assume dummy values in that case in mkdosfs and b) don't consider such fat file systems as invalid in dosfsck. The Linux kernel accepts them anyways. Signed-off-by: Daniel Baumann commit cf243e4 Author: Daniel Baumann Date: Fri Sep 26 15:15:40 2008 +0200 Applying Suses dosfstools-2.11-linuxfs.patch from Ruediger Oertel to not include linux/fs.h. Signed-off-by: Daniel Baumann commit 2d4f184 Author: Daniel Baumann Date: Fri Sep 26 15:11:50 2008 +0200 Applying Fedoras dosfstools-2.11-assumeKernel26.patch from Peter Vrabec to remove linux 2.6 conditionals: * LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) does not work with glibc-kernheaders-2.4-9.1.94 Signed-off-by: Daniel Baumann commit 739a6fb Author: Daniel Baumann Date: Fri Sep 26 15:05:00 2008 +0200 Applying Debians 99-conglomeration.dpatch (no other information available). Signed-off-by: Daniel Baumann commit 3b5ed8a Author: Daniel Baumann Date: Fri Sep 26 14:26:41 2008 +0200 Applying Debians 15-manpage-files.dpatch from Daniel Baumann to improve dosfsck manpage: * Lists fsckNNNN.rec files in FILES section (Closes: #444596). Signed-off-by: Daniel Baumann commit 3b6a863 Author: Daniel Baumann Date: Fri Sep 26 14:34:42 2008 +0200 Applying Debians 13-getopt.dpatch from Adonikam Virgo to fix mkdosfs getopt: * Fixes backup sector getopt (Closes: #232387, #479794). Signed-off-by: Daniel Baumann commit 1b2c8ca Author: Daniel Baumann Date: Fri Sep 26 14:34:17 2008 +0200 Applying Debians 12-zero-slot.dpatch by Karl Tomlinson to fix dosfsck zero slot crashes: * Fixes crashes due to zero slot numbers causing a negative offset in the call to copy_lfn_part in lfn_add_slot. On amd64 this results in a SIGSEGV in copy_lfn_part. On x86 the result is heap corruption and thus sometimes a SIGSEGV or double free abort later. (Closes: #152550, #353198, #356377, #401798). Signed-off-by: Daniel Baumann commit eec8585 Author: Daniel Baumann Date: Fri Sep 26 14:33:54 2008 +0200 Applying Debians 11-memory-efficiency.dpatch from Eero Tamminen to improve dosfsck memory efficiency: * Improves memory efficiency when checking filesystems. Signed-off-by: Daniel Baumann commit 06bd669 Author: Daniel Baumann Date: Fri Sep 26 14:33:28 2008 +0200 Applying Debians 10-manpage-synopsis.dpatch from Daniel Baumann to fix manpage synopsis: * List alternative binary names in manpage synopsis (Closes: #284983). Signed-off-by: Daniel Baumann commit 42d340d Author: Daniel Baumann Date: Fri Sep 26 14:32:46 2008 +0200 Applying Debians 09-manpage-fat32.dpatch from Daniel Baumann to improve mkdosfs manpage: * Don't claim that FAT32 is not choosed automatically (Closes: #414183). Signed-off-by: Daniel Baumann commit 0f5ce0d Author: Daniel Baumann Date: Fri Sep 26 14:32:23 2008 +0200 Applying Debians 08-manpage-drop.dpatch from Daniel Baumann to improve dosfsck manpage: * Don't use confusing word 'drop' when 'delete' is meant (Closes: #134100). Signed-off-by: Daniel Baumann commit 8ec54dd Author: Daniel Baumann Date: Fri Sep 26 14:31:50 2008 +0200 Applying Debians 07-manpage-spelling.dpatch from Justin Pryzby to fix mkdosfs manpage typos. Signed-off-by: Daniel Baumann commit 4371588 Author: Daniel Baumann Date: Fri Sep 26 14:30:31 2008 +0200 Applying Suses dosfstools-2.11_determine-sector-size.patch from Petr Gajdos to determine mkdosfs sector size automatically: * determine sector size of device automatically or if -S parameter present, verify, that it's not under physical sector size Signed-off-by: Daniel Baumann commit fc92e19 Author: Daniel Baumann Date: Fri Sep 26 14:30:03 2008 +0200 Applying Suses dosfstools-2.11-o_excl.patch from Pavol Rusnak to use O_EXCL in mkdosfs: * mkdosfs now opens device with O_EXCL [#238687] Signed-off-by: Daniel Baumann commit 3084697 Author: Daniel Baumann Date: Fri Sep 26 14:29:36 2008 +0200 Applying Debians 04-unaligned-memory.dpatch from Khalid Aziz to fix dosfsck unaligned memory accesses: * Fix unaligned memory accesses which cause warnings to appear everytime the elilo bootloader script runs. This has led a number of users to believe their install has failed (Closes: #258839). Signed-off-by: Daniel Baumann commit 6d5c091 Author: Daniel Baumann Date: Fri Sep 26 13:47:40 2008 +0200 Applying Fedoras dosfstools-2.11-label.patch from Jeremy Katz to add dosfslabel (originally by Peter Jones). Signed-off-by: Daniel Baumann commit 07ef487 Author: Daniel Baumann Date: Fri Sep 26 13:41:14 2008 +0200 Applying Fedoras dosfstools-2.11-fortify.patch from Jakub Jelinek to make it build with -D_FORTIFY_SOURCE=2: * This violates -D_FORTIFY_SOURCE=2 (which is stricter than C standard), but isn't actually any buffer overflow. But using memcpy is more efficient anyway. Signed-off-by: Daniel Baumann commit 78f9dca Author: Daniel Baumann Date: Fri Sep 26 13:40:47 2008 +0200 Applying Fedoras dosfstools-2.7-argfix.patch (no other information available). Signed-off-by: Daniel Baumann commit ba6774a (tag: v2.11) Author: Daniel Baumann Date: Thu Jun 26 12:45:36 2008 +0200 Adding version 2.11. Signed-off-by: Daniel Baumann dosfstools-4.2/COPYING0000644000175000017500000010451314005523510011531 00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . dosfstools-4.2/aclocal.m40000644000175000017500000027416614005523524012357 00000000000000# generated automatically by aclocal 1.16.1 -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file 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. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # iconv.m4 serial 19 (gettext-0.18.2) dnl Copyright (C) 2000-2002, 2007-2014, 2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, dnl Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi am_cv_func_iconv_works=no for ac_iconv_const in '' 'const'; do AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[ #include #include #ifndef ICONV_CONST # define ICONV_CONST $ac_iconv_const #endif ]], [[int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\263"; char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; ICONV_CONST char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; ]])], [am_cv_func_iconv_works=yes], , [case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac]) test "$am_cv_func_iconv_works" = no || break done LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST([LIBICONV]) AC_SUBST([LTLIBICONV]) ]) dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to dnl avoid warnings like dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". dnl This is tricky because of the way 'aclocal' is implemented: dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. dnl Otherwise aclocal's initial scan pass would miss the macro definition. dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. dnl Otherwise aclocal would emit many "Use of uninitialized value $1" dnl warnings. m4_define([gl_iconv_AC_DEFUN], m4_version_prereq([2.64], [[AC_DEFUN_ONCE( [$1], [$2])]], [m4_ifdef([gl_00GNULIB], [[AC_DEFUN_ONCE( [$1], [$2])]], [[AC_DEFUN( [$1], [$2])]])])) gl_iconv_AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL([am_cv_proto_iconv], [ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ]], [[]])], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([ $am_cv_proto_iconv]) AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], [Define as const if the declaration of iconv() needs const.]) dnl Also substitute ICONV_CONST in the gnulib generated . m4_ifdef([gl_ICONV_H_DEFAULTS], [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) if test -n "$am_cv_proto_iconv_arg1"; then ICONV_CONST="const" fi ]) fi ]) # lib-ld.m4 serial 6 dnl Copyright (C) 1996-2003, 2009-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid dnl collision with libtool.m4. dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 /dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 = 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_FROMPACKAGE(name, package) dnl declares that libname comes from the given package. The configure file dnl will then not have a --with-libname-prefix option but a dnl --with-package-prefix option. Several libraries can come from the same dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar dnl macro call that searches for libname. AC_DEFUN([AC_LIB_FROMPACKAGE], [ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_frompackage_]NAME, [$2]) popdef([NAME]) pushdef([PACK],[$2]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_libsinpackage_]PACKUP, m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1]) popdef([PACKUP]) popdef([PACK]) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) dnl Autoconf >= 2.61 supports dots in --with options. pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_ARG_WITH(P_A_C_K[-prefix], [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= LIB[]NAME[]_PREFIX= dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been dnl computed. So it has to be reset here. HAVE_LIB[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" dnl The same code as in the loop below: dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi popdef([P_A_C_K]) popdef([PACKLIBS]) popdef([PACKUP]) popdef([PACK]) popdef([NAME]) ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) # lib-prefix.m4 serial 7 (gettext-0.18) dnl Copyright (C) 2001-2005, 2008-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates dnl - a variable acl_libdirstem, containing the basename of the libdir, either dnl "lib" or "lib64" or "lib/64", dnl - a variable acl_libdirstem2, as a secondary possible value for dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or dnl "lib/amd64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib and lib64. dnl On glibc systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine dnl the compiler's default mode by looking at the compiler's library search dnl path. If at least one of its elements ends in /lib64 or points to a dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. dnl Otherwise we use the default, namely "lib". dnl On Solaris systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. AC_REQUIRE([AC_CANONICAL_HOST]) acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment dnl . dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the dnl symlink is missing, so we set acl_libdirstem2 too. AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], [AC_EGREP_CPP([sixtyfour bits], [ #ifdef _LP64 sixtyfour bits #endif ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) ]) if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" ]) # Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file 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. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file 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. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file 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. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file 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. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file 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 macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2018 Free Software Foundation, Inc. # # This file 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. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file 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. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file 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. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file 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. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file 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. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2018 Free Software Foundation, Inc. # # This file 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. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2018 Free Software Foundation, Inc. # # This file 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. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR dosfstools-4.2/configure.ac0000644000175000017500000000552214005523510012764 00000000000000# configure.ac for dosfstools # 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 . AC_INIT([dosfstools], [4.2]) AC_SUBST([RELEASE_DATE], [2021-01-31]) AM_INIT_AUTOMAKE([1.11 foreign subdir-objects parallel-tests]) AC_ARG_ENABLE([compat-symlinks], [AS_HELP_STRING([--enable-compat-symlinks], [install symlinks for legacy names of the tools])], [case "${enableval}" in yes) symlinks=true ;; no) symlinks=false ;; *) AC_MSG_ERROR([bad value ${enableval} for --enable-compat-symlinks]) ;; esac], [symlinks=false]) AM_CONDITIONAL([COMPAT_SYMLINKS], [test x$symlinks = xtrue]) AC_ARG_ENABLE([atari-check], [AS_HELP_STRING([--enable-atari-check], [enable legacy check to let tools switch to Atari mode when they detect they are running on 68k Atari hardware (Linux only)])], [case "${enableval}" in yes) AC_SUBST(CHECKATARI, [1]) AC_DEFINE(CONF_CHECK_ATARI) ;; no) AC_SUBST(CHECKATARI, [0]) ;; *) AC_MSG_ERROR([bad value ${enableval} for --enable-atari-check]) ;; esac], [AC_SUBST(CHECKATARI, [0])]) AC_USE_SYSTEM_EXTENSIONS AC_PROG_CC AC_PROG_LN_S AC_SYS_LARGEFILE AC_CHECK_HEADERS([\ err.h \ linux/fd.h \ linux/hdreg.h \ linux/version.h \ linux/loop.h \ sys/disk.h \ sys/disklabel.h \ sys/ioccom.h \ sys/mkdev.h \ sys/queue.h \ ]) AC_CHECK_HEADERS([endian.h sys/endian.h libkern/OSByteOrder.h]) AC_CHECK_FUNCS([vasprintf]) AC_CHECK_DECLS([getmntent], [], [], [[#include ]]) AC_CHECK_DECLS([getmntinfo], [], [], [[#include ]]) # optional iconv support AC_ARG_WITH([iconv], AS_HELP_STRING([--without-iconv], [build without iconv support])) if test "x$with_iconv" != "xno"; then AM_ICONV fi # xxd (distributed with vim) is used in the testsuite AC_CHECK_PROG([XXD_FOUND], [xxd], [yes]) # check if automake is 1.11 or 1.12 for using a workaround for the parallel test harness # (we check for a minimum version of 1.11 above, so these are the only two values to check) AM_CONDITIONAL(AUTOMAKE_TEST_COMPAT, test $am__api_version = 1.11 -o $am__api_version = 1.12) AC_CONFIG_FILES([Makefile src/Makefile src/version.h manpages/Makefile manpages/mkfs.fat.8 manpages/fsck.fat.8 manpages/fatlabel.8 tests/Makefile]) AC_OUTPUT dosfstools-4.2/configure0000755000175000017500000071524414005523525012424 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for dosfstools 4.2. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='dosfstools' PACKAGE_TARNAME='dosfstools' PACKAGE_VERSION='4.2' PACKAGE_STRING='dosfstools 4.2' PACKAGE_BUGREPORT='' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS AUTOMAKE_TEST_COMPAT_FALSE AUTOMAKE_TEST_COMPAT_TRUE XXD_FOUND LTLIBICONV LIBICONV host_os host_vendor host_cpu host build_os build_vendor build_cpu build LN_S EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC CHECKATARI COMPAT_SYMLINKS_FALSE COMPAT_SYMLINKS_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM RELEASE_DATE target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_compat_symlinks enable_atari_check enable_dependency_tracking enable_largefile with_iconv with_gnu_ld enable_rpath with_libiconv_prefix ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures dosfstools 4.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/dosfstools] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of dosfstools 4.2:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-compat-symlinks install symlinks for legacy names of the tools --enable-atari-check enable legacy check to let tools switch to Atari mode when they detect they are running on 68k Atari hardware (Linux only) --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-largefile omit support for large files --disable-rpath do not hardcode runtime library paths Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --without-iconv build without iconv support --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF dosfstools configure 4.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by dosfstools $as_me 4.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu RELEASE_DATE=2021-01-31 am__api_version='1.16' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='dosfstools' VERSION='4.2' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi # Check whether --enable-compat-symlinks was given. if test "${enable_compat_symlinks+set}" = set; then : enableval=$enable_compat_symlinks; case "${enableval}" in yes) symlinks=true ;; no) symlinks=false ;; *) as_fn_error $? "bad value ${enableval} for --enable-compat-symlinks" "$LINENO" 5 ;; esac else symlinks=false fi if test x$symlinks = xtrue; then COMPAT_SYMLINKS_TRUE= COMPAT_SYMLINKS_FALSE='#' else COMPAT_SYMLINKS_TRUE='#' COMPAT_SYMLINKS_FALSE= fi # Check whether --enable-atari-check was given. if test "${enable_atari_check+set}" = set; then : enableval=$enable_atari_check; case "${enableval}" in yes) CHECKATARI=1 $as_echo "#define CONF_CHECK_ATARI 1" >>confdefs.h ;; no) CHECKATARI=0 ;; *) as_fn_error $? "bad value ${enableval} for --enable-atari-check" "$LINENO" 5 ;; esac else CHECKATARI=0 fi DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 $as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 $as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -rf conftest* fi fi for ac_header in \ err.h \ linux/fd.h \ linux/hdreg.h \ linux/version.h \ linux/loop.h \ sys/disk.h \ sys/disklabel.h \ sys/ioccom.h \ sys/mkdev.h \ sys/queue.h \ do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in endian.h sys/endian.h libkern/OSByteOrder.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in vasprintf do : ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf" if test "x$ac_cv_func_vasprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VASPRINTF 1 _ACEOF fi done ac_fn_c_check_decl "$LINENO" "getmntent" "ac_cv_have_decl_getmntent" "#include " if test "x$ac_cv_have_decl_getmntent" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETMNTENT $ac_have_decl _ACEOF ac_fn_c_check_decl "$LINENO" "getmntinfo" "ac_cv_have_decl_getmntinfo" "#include " if test "x$ac_cv_have_decl_getmntinfo" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETMNTINFO $ac_have_decl _ACEOF # optional iconv support # Check whether --with-iconv was given. if test "${with_iconv+set}" = set; then : withval=$with_iconv; fi if test "x$with_iconv" != "xno"; then # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${acl_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${acl_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } if ${acl_cv_rpath+:} false; then : $as_echo_n "(cached) " >&6 else CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 $as_echo "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; : else enable_rpath=yes fi acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 $as_echo_n "checking for 64-bit host... " >&6; } if ${gl_cv_solaris_64bit+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _LP64 sixtyfour bits #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "sixtyfour bits" >/dev/null 2>&1; then : gl_cv_solaris_64bit=yes else gl_cv_solaris_64bit=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 $as_echo "$gl_cv_solaris_64bit" >&6; } if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then : withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi fi LIBICONV= LTLIBICONV= INCICONV= LIBICONV_PREFIX= HAVE_LIBICONV= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if ${am_cv_func_iconv+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 $as_echo_n "checking for working iconv... " >&6; } if ${am_cv_func_iconv_works+:} false; then : $as_echo_n "(cached) " >&6 else am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi am_cv_func_iconv_works=no for ac_iconv_const in '' 'const'; do if test "$cross_compiling" = yes; then : case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef ICONV_CONST # define ICONV_CONST $ac_iconv_const #endif int main () { int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\263"; char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; ICONV_CONST char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : am_cv_func_iconv_works=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi test "$am_cv_func_iconv_works" = no || break done LIBS="$am_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 $as_echo "$am_cv_func_iconv_works" >&6; } case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then $as_echo "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 $as_echo_n "checking for iconv declaration... " >&6; } if ${am_cv_proto_iconv+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : am_cv_proto_iconv_arg1="" else am_cv_proto_iconv_arg1="const" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_proto_iconv" >&5 $as_echo " $am_cv_proto_iconv" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 _ACEOF fi fi # xxd (distributed with vim) is used in the testsuite # Extract the first word of "xxd", so it can be a program name with args. set dummy xxd; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_XXD_FOUND+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$XXD_FOUND"; then ac_cv_prog_XXD_FOUND="$XXD_FOUND" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_XXD_FOUND="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi XXD_FOUND=$ac_cv_prog_XXD_FOUND if test -n "$XXD_FOUND"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XXD_FOUND" >&5 $as_echo "$XXD_FOUND" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # check if automake is 1.11 or 1.12 for using a workaround for the parallel test harness # (we check for a minimum version of 1.11 above, so these are the only two values to check) if test $am__api_version = 1.11 -o $am__api_version = 1.12; then AUTOMAKE_TEST_COMPAT_TRUE= AUTOMAKE_TEST_COMPAT_FALSE='#' else AUTOMAKE_TEST_COMPAT_TRUE='#' AUTOMAKE_TEST_COMPAT_FALSE= fi ac_config_files="$ac_config_files Makefile src/Makefile src/version.h manpages/Makefile manpages/mkfs.fat.8 manpages/fsck.fat.8 manpages/fatlabel.8 tests/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${COMPAT_SYMLINKS_TRUE}" && test -z "${COMPAT_SYMLINKS_FALSE}"; then as_fn_error $? "conditional \"COMPAT_SYMLINKS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AUTOMAKE_TEST_COMPAT_TRUE}" && test -z "${AUTOMAKE_TEST_COMPAT_FALSE}"; then as_fn_error $? "conditional \"AUTOMAKE_TEST_COMPAT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by dosfstools $as_me 4.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ dosfstools config.status 4.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/version.h") CONFIG_FILES="$CONFIG_FILES src/version.h" ;; "manpages/Makefile") CONFIG_FILES="$CONFIG_FILES manpages/Makefile" ;; "manpages/mkfs.fat.8") CONFIG_FILES="$CONFIG_FILES manpages/mkfs.fat.8" ;; "manpages/fsck.fat.8") CONFIG_FILES="$CONFIG_FILES manpages/fsck.fat.8" ;; "manpages/fatlabel.8") CONFIG_FILES="$CONFIG_FILES manpages/fatlabel.8" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi dosfstools-4.2/Makefile.am0000644000175000017500000000047314005523510012532 00000000000000SUBDIRS = src manpages tests dist_doc_DATA = doc/ANNOUNCE.mkdosfs \ doc/ChangeLog.dosfsck \ doc/ChangeLog.dosfstools-2.x \ doc/ChangeLog.mkdosfs \ doc/README.dosfsck \ doc/README.dosfstools-2.x \ doc/README.mkdosfs \ doc/TODO.dosfstools-2.x \ COPYING ChangeLog NEWS README EXTRA_DIST = autogen.sh dosfstools-4.2/doc/0000755000175000017500000000000014005523537011330 500000000000000dosfstools-4.2/doc/TODO.dosfstools-2.x0000644000175000017500000000104714005523510014534 00000000000000 -*- mode: indented-text -*- - dosfsck: Better checking of file times: ctime <= mtime <= atime - mkdosfs: If /etc/bootsect.dos (or similar) exists, use it as a template for generating boot sectors. This way, you can, e.g., make bootable DOS disks. Addendum: Don't know if that's so wise... There are really many variants of DOS/Windows bootcode out in the wild, and the code is proprietary, too. - dosfsck: read-only sector test (-t without -a or -r); just print out errors. dosfstools-4.2/doc/README.mkdosfs0000644000175000017500000000416414005523510013571 00000000000000mkdosfs - Make DOS filesystem utilty. I wrote this, partially to complement the dosfsck utility written by Werner Almesberger (who graciously gave me some pointers when I asked for some advice about writing this code), and also to avoid me having to boot DOS just to create data partitions (I use Linux to back up DOS :-) ). The code is really derived from Remy Card's mke2fs utility - I used this as a framework, although all of the filesystem specific stuff was removed and the DOS stuff inserted. I believe originally mke2fs was based on Linus' mkfs code, hence the acknowledgements in the source code. Neither Remy nor Linus have had any involvement with mkdosfs, so if there are any bugs they're almost certainly "all my own work". The code has been available for ftp since 1st September 1993, and I have yet to receive any bug reports from users. I don't know of any bugs, but if you do find a bug or have any constructive comments, please mail me! The only bug I found with version 0.1 was an obscure fault that could lead to an invalid (for MS-DOS, not Linux's dos fs) number of sectors used in the file allocation table(s). Dave Hudson dave@humbug.demon.co.uk FAT32 support ============= mkdosfs now can also create filesystems in the new FAT32 format. To do this, give mkdosfs a "-F 32" option. FAT32 isn't selected automatically (yet), even if very large clusters are needed with FAT16. With FAT32 you have two additional options, -R to select the number of reserved sectors (usually 32), and -b to select the location of the backup boot sector (default 6). Of course such a backup is created, as well as the new info sector. On FAT32, the root directory is always created as a cluster chain. Sorry, there's no switch to generate an old static root dir. One bigger bug fix besides FAT32 was to reject filesystems that need a 16 bit FAT to fit all possible clusters, but the bigger FAT needs some more sectors, so the total number of clusters drop below the border where MS-DOS expects a 12 bit FAT. So such filesystems would be FAT16, but interpreted as FAT32 by DOS. The fix is to reduce filesystem size a bit. - Roman dosfstools-4.2/doc/README.dosfstools-2.x0000644000175000017500000000554014005523510014726 00000000000000 Atari format support ==================== Both mkdosfs and dosfsck now can also handle the Atari variation of the MS-DOS filesystem format. The Atari format has some minor differences, some caused by the different machine architecture (m68k), some being "historic" (Atari didn't change some things that M$ changed). Both tools automatically select Atari format if they run on an Atari. Additionally the -A switch toggles between Atari and MS-DOS format. I.e., on an Atari it selects plain DOS format, on any other machine it switches to Atari format. The differences are in detail: - Atari TOS doesn't like cluster sizes != 2, so the usual solution for bigger partitions was to increase the logical sector size. So mkdosfs can handle sector sizes != 512 now, you can also manually select it with the -S option. On filesystems larger than approx. 32 MB, the sector size is automatically increased (stead of the cluster size) to make the filesystem fit. mkdosfs will always use 2 sectors per cluster (also with the floppy standard configurations), except when directed otherwise on the command line. - From the docs, all values between 0xfff8 and 0xffff in the FAT mark an end-of-file. However, DOS usually uses 0xfff8 and Atari 0xffff. This seems to be only an consmetic difference. At least TOS doesn't complain about 0xffff EOF marks. Don't know what DOS thinks of 0xfff8 :-) Anyway, both tools use the EOF mark common to the system (DOS/Atari). - Something similar of the bad cluster marks: On Atari the FAT values 0xfff0 to 0xfff7 are used for this, under DOS only 0xfff7 (the others can be normal cluster numbers, allowing 7 more clusters :-) However, both systems usually mark with 0xfff7. Just dosfsck has to interpret 0xfff0...0xfff7 differently. - Some fields in the boot sector are interpreted differently. For example, Atari has a disk serial number (used to aid disk change detection) where DOS stores the system name; the 'hidden' field is 32 bit for DOS, but 16 bit for Atari, and there's no 'total_sect' field; the 12/16 bit FAT decision is different: it's not based on the number of clusters, but always FAT12 on floppies and FAT16 on hard disks. mkdosfs nows about these differences and constructs the boot sector accordingly. - In dosfsck, the boot sector differences also have to known, to not warn about things that are no error on Atari. In addition, most Atari formatting tools fill the 'tracks' and 'heads' fields with 0 for hard disks, because they're meaningless on SCSI disks (Atari has/had no IDE). Due to this, the check that they should be non-zero is switched off. - Under Atari TOS, some other characters are illegal in filenames: '<', '>', '|', '"', and ':' are allowed, but all non-ASCII chars (codes >= 128) are forbidden. - Roman dosfstools-4.2/doc/README.dosfsck0000644000175000017500000000451114005523510013553 00000000000000dosfsck, version 1 ================== WARNING: This is ALPHA test software. Use at your own risk. dosfsck is the Linux equivalent of PC/MS-DOS' CHKDSK. It checks the consistency of PC/MS-DOS filesystems and optionally tries to repair them. The tests dosfsck performs are described in the man page. dosfsck needs header files from dosfs.9 (or later) to compile. Before using dosfsck to repair a filesystem that contains data of any value, you should verify that dosfsck is able to correct all reported errors. (Except fatal errors and those reported as unfixable, of course.) In order to do this, run it with the -V option, e.g. dosfsck -V /dev/sda1 (automatic check) or dosfsck -V -r /dev/sda1 (interactive check and repair) dosfsck will perform two passes: in the first pass, inconsistencies are detected and a list of changes to correct the problems is generated. In the second pass, those changes are applied whenever dosfsck reads data from disk. Hence no fixable errors should be reported in the second pass if the first pass was successful. Please notify the author if fixable errors are reported in the second pass. After verifying that dosfsck appears to be able to perform the desired operations, either confirm that you want the changes to be performed (if dosfsck was started with -r) or re-run dosfsck with the -a option (if it was started without -r). Please send bug reports, comments, flames, etc. to almesber@nessie.cs.id.ethz.ch or almesber@bernina.ethz.ch - Werner FAT32 and LFN support ===================== I've finally implemented some of the new features of MS-DOS filesystems: FAT32 and long filenames. FAT32 is automatically detected and of course the different FAT structure is handled. (Internally many changes were needed, so 32 bit variables for all cluster numbers and 64 bit vars for offsets inside the filesystem.) New checks for FAT32 are most notably on the backup boot sector and the new info sector. Also the possibility that the root directory resides in a cluster chain (instead of in a static area) on FAT32 is handled. dosfscheck also knows about VFAT long filenames now. It parses those names and uses them in listings etc. when available. There are also some checks on the (cruel) structure of how LFNs are stored and some attempts to fix problems. - Roman BTW, version 2 isn't ALPHA anymore :-) dosfstools-4.2/doc/ChangeLog.mkdosfs0000644000175000017500000000135714005523510014464 0000000000000028th January 1995 H. Peter Anvin (hpa@yggdrasil.com) Better algorithm to select cluster sizes on large filesystems. Added bogus boot sector code that on attempts to boot prints a message (which can be chosen at mkdosfs time) and lets the user press any key and try again. Corrected support for 1.2 Mb floppies. mkdosfs now generates the extended bootsector (superblock) format of DOS 3.3+, with support for volume ID's and volume labels (volume labels are also written to the root directory, as they should). 18th February 1994 Dave Hudson (dave@humbug.demon.co.uk) Released version 0.2 - clears a bug in the FAT sizing code. 1st September 1993 Dave Hudson (dave@humbug.demon.co.uk) Released version 0.1 - ALPHA release of mkdosfs dosfstools-4.2/doc/ChangeLog.dosfstools-2.x0000644000175000017500000001477714005523510015634 00000000000000version 2.11 ============ - all: don't use own llseek() anymore, glibc lseek() does everything we need - dosfsck: lfn.c: avoid segfault - dosfsck: check.c, lfn.c: check for orphaned LFN slots - dosfsck: check.c alloc_rootdir_entry(): set owner of newly alloced clusters - dosfsck: dosfsck.h: better use for byte swapping - dosfsck: io.c: added code for real DOS - mkdosfs: raised FAT12_THRESHOLD from 4078 to 4085, introduced MIN_CLUST_32 - mkdosfs: fix loop device size - mkdosfs: by default, use FAT32 on devices >= 512MB - mkdosfs: fix a memory leak (blank_sector) - mkdosfs: fix parsing of number of blocks on command line, so that numbers >2G can be used - mkdosfs: add 'b' to getopt() string so this option can be used :) - mkdosfs: fix parsing of -i arg (should be unsigned) - mkdosfs: change default permissions of created images (-C) to 0666 & ~umask - mkdosfs: relax geometry check: if HDIO_GETGEO fails, print a warning and default to H=255,S=63 - dosfsck: new option -n (no-op): just check non-interactively, but don't write anything to filesystem - A few #include changes to support compilation with linux 2.6 headers (thanks to Jim Gifford ) - dosfsck: remove directory entries pointing to start cluster 0, if they're not "." or ".." entries that should actually point to the root dir (pointed out by Thomas Winkler ) - mkdosfs: new option -h to set number of hidden sectors (thanks to Godwin Stewart ) - all: updated my mail address everywhere... version 2.10 ============ - dosfsck: various 64-bit fixes and removed some warnings by Michal Cihar - mkdosfs: better error message if called without parameters (also suggested by Michal) version 2.9 =========== - dosfsck: if EOF from stdin, exit with error code - dosfsck: Fix potential for "Internal error: next_cluster on bad cluster". - dosfsck: When clearing long file names, don't overwrite the dir entries with all zeros, but put 0xe5 into the first byte. Otherwise, some OSes stop reading the directory at that point... - dosfsck: in statistics printed by -v, fix 32bit overflow in number of data bytes. - dosfsck: fix an potential overflow in "too many clusters" check - dosfsck: fix 64bit problem in fat.c (Debian bug #152769) - dosfsck: allow FAT size > 32MB. - dosfsck: allow for only one FAT - dosfsck: with -v, also check that last sector of the filesystem can be read (in case a partition is smaller than the fs thinks) - mkdosfs: add note in manpage that creating bootable filesystems is not supported. - mkdosfs: better error message with pointer to -I if target is a full-disk device. version 2.8 =========== - dosfsck: Fixed endless loop whenever a volume label was present. version 2.7 =========== - dosfsck: Don't check volume label for bad characters, everything seems to be allowed there... Also ignore duplicate names where one of them is a volume label. version 2.6 =========== - mkdosfs: Added correct heads definition for 2.88M floppies if not created via loopback. - dosfsck: If boot sector and its backup are different (FAT32), offer to write the backup to sector 0. (tnx to Pavel Roskin for this) - For 64 bit alpha, struct bootsector in dosfsck.h must be defined with __attribute__((packed)). - mkdosfs now actually accepts -R option. (tnx to David Kerrawn) - Fixed typo in dosfsck boot.c (recognition of boot signature in FSINFO) - Various compilation fixes for 2.4 kernel headers and for ia64. version 2.5 =========== - The llseek() implementation for alpha didn't really work; fixed it. version 2.4 =========== - Fix compiling problem on alpha (made a silly typo...) version 2.3 =========== - mkdosfs: Fixed usage message (printed only "bad address"). - both: made man pages and usage statements more consistent. - both: fix llseek function for alpha. - dosfsck: fix reading of unaligned fields in boot sector for alpha. - dosfsck: fixed renaming of files (extension wasn't really written). version 2.2 =========== - Added dosfsck/COPYING, putting dosfsck officially under GPL (Werner and I agree that it should be GPL). - mkdosfs: Allow creation of a 16 bit FAT on filesystems that are too small for it if the user explicitly selected FAT16 (but a warning is printed). Formerly, you got the misleading error message "make the fs a bit smaller". - dosfsck: new option -y as synonym for -y; for compability with other fs checkers, which also accept this option. - dosfsck: Now prints messages similar to e2fsck: at start version and feature list; at end number of files (and directories) and number of used/total clusters. This makes the printouts of *fsck at boot time nicer. - dosfsck: -a (auto repair) now turns on -f (salvage files), too. -a should act as non-destructive as possible, so lost clusters should be assigned to files. Otherwise the data in them might be overwritten later. - dosfsck: Don't drop a directory with lots of bad entries in auto-repair mode for the same reason as above. - dosfsck: avoid deleting the whole FAT32 root dir if something is wrong with it (bad start cluster or the like). - general: also create symlinks {mkfs,fsck}.vfat.8 to the respective real man pages. version 2.1 =========== - Fix some forgotten loff_t's for filesystems > 4GB. (Thanks to ). - Fix typo in mkdosfs manpage. - Removed inclusion of from mkdosfs.c; it's unnecessary and caused problems in some environments. - Fix condition when to expect . and .. entries in a directory. (Was wrong for non-FAT32 if first entry in root dir was a directory also.) - Also create mkfs.vfat and fsck.vfat symlinks, so that also filesystems listed with type "vfat" in /etc/fstab can be automatically checked. version 2.0 =========== - merge of mkdosfs and dosfstools in one package - new maintainer: Roman Hodek - FAT32 support in both mkdosfs and dosfsck - VFAT (long filename) support in dosfsck - Support for Atari variant of MS-DOS filesystem in both tools - Working support for big-endian systems in both tools - Better support for loop devices in mkdosfs: usual floppy sizes are detected and media byte etc. set accordingly; if loop fs has no standard floppy size, use hd params (mainly by Giuliano Procida ) - Removed lots of gcc warnings - Fixed some minor calculation bugs in mkdosfs. For change logs previous to 2.0, see the CHANGES files in the subdirectories. dosfstools-4.2/doc/ChangeLog.dosfsck0000644000175000017500000000063514005523510014450 00000000000000Changes from version 0 to 1 =========================== - fixed an off-by-two error in check.c:check_file - fixed marking clusters bad in fat.c:set_fat - fat.c:reclaim_free was also reclaiming bad clusters. - fixed many incorrect byte sex conversions in check.c and fat.c - -t and -w now require -a or -r - added option -d to drop files. - added option -u to try to "undelete" non-directory files. dosfstools-4.2/doc/ANNOUNCE.mkdosfs0000644000175000017500000000236114005523510014037 00000000000000Announcing the release of mkdosfs version 0.3b (Yggdrasil) It seems I didn't get the bug completely fixed in 0.3a. Some borderline cases would still allocate too many sectors for the FAT. Again, nothing to worry about, just a nitpick -- this one would only in certain cases add one sector per FAT. Announcing the release of mkdosfs version 0.3a (Yggdrasil) Fixed a bug which would cause too many sectors to be reserved for the FAT (filesystem will still work fine, but have slightly less space available). Announcing the release of mkdosfs version 0.3 (Yggdrasil) This version correctly handles even very large filesystems, and properly supports the modern (3.3+) DOS bootsector format, including a message printed on boot attempts. Peter Anvin Yggdrasil Computing, Inc. hpa@yggdrasil.com -------------- Announcing the release of mkdosfs version 0.2 I've just uploaded mkdosfs to sunsite.unc.edu. It works in a similar way to Remy Card's mke2fs, but creates an MS-DOS filesystem. The filename is mkdosfs-0.2.tar.gz. This second release should fix a small bug that could lead to FAT sizes that Linux's dosfs would accept but MS-DOS wouldn't. The archive contains a manual page, binary and source versions. Dave Hudson dave@humbug.demon.co.uk