diff --git a/Makefile.am b/Makefile.am
index 05425dd..6b70e75 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -24,6 +24,7 @@
atasmart.c \
blob-examples/README \
blob-examples/FUJITSU_MHY2120BH--0084000D \
+ blob-examples/FUJITSU_MHY2120BH--0085000B \
blob-examples/FUJITSU_MHZ2160BH_G1--0084000A \
blob-examples/Maxtor_96147H8--BAC51KJ0 \
blob-examples/SAMSUNG_HD501LJ--CR100-12 \
@@ -83,3 +84,5 @@
atasmart.strpool.c: atasmart.c strpool
$(top_builddir)/strpool $< $@
+
+ACLOCAL_AMFLAGS = -I m4
diff --git a/Makefile.in b/Makefile.in
index 5887c91..25b5546 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@@ -37,8 +38,9 @@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@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
@@ -70,24 +72,42 @@
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = libatasmart.pc
+CONFIG_CLEAN_VPATH_FILES =
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 = `echo $$p | sed -e 's|^.*/||'`;
+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__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sbindir)" \
"$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"
-libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
am__DEPENDENCIES_1 =
libatasmart_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_libatasmart_la_OBJECTS = libatasmart_la-atasmart.strpool.lo
libatasmart_la_OBJECTS = $(am_libatasmart_la_OBJECTS)
-libatasmart_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libatasmart_la_CFLAGS) \
- $(CFLAGS) $(libatasmart_la_LDFLAGS) $(LDFLAGS) -o $@
-sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+libatasmart_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(libatasmart_la_CFLAGS) $(CFLAGS) $(libatasmart_la_LDFLAGS) \
+ $(LDFLAGS) -o $@
PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS)
am_skdump_OBJECTS = skdump.$(OBJEXT)
skdump_OBJECTS = $(am_skdump_OBJECTS)
@@ -101,15 +121,29 @@
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
+am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
SOURCES = $(libatasmart_la_SOURCES) $(skdump_SOURCES) sktest.c \
$(strpool_SOURCES)
DIST_SOURCES = $(libatasmart_la_SOURCES) $(skdump_SOURCES) sktest.c \
@@ -121,12 +155,13 @@
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
-pkgconfigDATA_INSTALL = $(INSTALL_DATA)
DATA = $(noinst_DATA) $(pkgconfig_DATA)
-includeHEADERS_INSTALL = $(INSTALL_HEADER)
HEADERS = $(include_HEADERS)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir dist dist-all distcheck
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
@@ -134,15 +169,41 @@
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
- { test ! -d $(distdir) \
- || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
- && rm -fr $(distdir); }; }
+ { test ! -d "$(distdir)" \
+ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr "$(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
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
@@ -269,6 +330,7 @@
atasmart.c \
blob-examples/README \
blob-examples/FUJITSU_MHY2120BH--0084000D \
+ blob-examples/FUJITSU_MHY2120BH--0085000B \
blob-examples/FUJITSU_MHZ2160BH_G1--0084000A \
blob-examples/Maxtor_96147H8--BAC51KJ0 \
blob-examples/SAMSUNG_HD501LJ--CR100-12 \
@@ -320,6 +382,7 @@
BUILT_SOURCES = \
atasmart.strpool.c
+ACLOCAL_AMFLAGS = -I m4
all: $(BUILT_SOURCES) config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -331,15 +394,15 @@
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
- cd $(srcdir) && $(AUTOMAKE) --foreign \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -355,9 +418,10 @@
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
- cd $(srcdir) && $(AUTOCONF)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
config.h: stamp-h1
@if test ! -f $@; then \
@@ -369,7 +433,7 @@
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps)
- cd $(top_srcdir) && $(AUTOHEADER)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
@@ -380,20 +444,24 @@
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ list2=; for p in $$list; do \
if test -f $$p; then \
- f=$(am__strip_dir) \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+ list2="$$list2 $$p"; \
else :; fi; \
- done
+ done; \
+ test -z "$$list2" || { \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+ }
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
- p=$(am__strip_dir) \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
done
clean-libLTLIBRARIES:
@@ -405,51 +473,68 @@
rm -f "$${dir}/so_locations"; \
done
libatasmart.la: $(libatasmart_la_OBJECTS) $(libatasmart_la_DEPENDENCIES)
- $(libatasmart_la_LINK) -rpath $(libdir) $(libatasmart_la_OBJECTS) $(libatasmart_la_LIBADD) $(LIBS)
+ $(AM_V_CCLD)$(libatasmart_la_LINK) -rpath $(libdir) $(libatasmart_la_OBJECTS) $(libatasmart_la_LIBADD) $(LIBS)
clean-noinstPROGRAMS:
- @list='$(noinst_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
install-sbinPROGRAMS: $(sbin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
- @list='$(sbin_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- || test -f $$p1 \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \
- else :; fi; \
- done
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ 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) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
uninstall-sbinPROGRAMS:
@$(NORMAL_UNINSTALL)
- @list='$(sbin_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
- rm -f "$(DESTDIR)$(sbindir)/$$f"; \
- done
+ @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:
- @list='$(sbin_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
+ @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
skdump$(EXEEXT): $(skdump_OBJECTS) $(skdump_DEPENDENCIES)
@rm -f skdump$(EXEEXT)
- $(LINK) $(skdump_OBJECTS) $(skdump_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(skdump_OBJECTS) $(skdump_LDADD) $(LIBS)
sktest$(EXEEXT): $(sktest_OBJECTS) $(sktest_DEPENDENCIES)
@rm -f sktest$(EXEEXT)
- $(LINK) $(sktest_OBJECTS) $(sktest_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(sktest_OBJECTS) $(sktest_LDADD) $(LIBS)
strpool$(EXEEXT): $(strpool_OBJECTS) $(strpool_DEPENDENCIES)
@rm -f strpool$(EXEEXT)
- $(LINK) $(strpool_OBJECTS) $(strpool_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(strpool_OBJECTS) $(strpool_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -463,32 +548,36 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strpool.Po@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
-@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
libatasmart_la-atasmart.strpool.lo: atasmart.strpool.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libatasmart_la_CFLAGS) $(CFLAGS) -MT libatasmart_la-atasmart.strpool.lo -MD -MP -MF $(DEPDIR)/libatasmart_la-atasmart.strpool.Tpo -c -o libatasmart_la-atasmart.strpool.lo `test -f 'atasmart.strpool.c' || echo '$(srcdir)/'`atasmart.strpool.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libatasmart_la-atasmart.strpool.Tpo $(DEPDIR)/libatasmart_la-atasmart.strpool.Plo
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libatasmart_la_CFLAGS) $(CFLAGS) -MT libatasmart_la-atasmart.strpool.lo -MD -MP -MF $(DEPDIR)/libatasmart_la-atasmart.strpool.Tpo -c -o libatasmart_la-atasmart.strpool.lo `test -f 'atasmart.strpool.c' || echo '$(srcdir)/'`atasmart.strpool.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libatasmart_la-atasmart.strpool.Tpo $(DEPDIR)/libatasmart_la-atasmart.strpool.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='atasmart.strpool.c' object='libatasmart_la-atasmart.strpool.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libatasmart_la_CFLAGS) $(CFLAGS) -c -o libatasmart_la-atasmart.strpool.lo `test -f 'atasmart.strpool.c' || echo '$(srcdir)/'`atasmart.strpool.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libatasmart_la_CFLAGS) $(CFLAGS) -c -o libatasmart_la-atasmart.strpool.lo `test -f 'atasmart.strpool.c' || echo '$(srcdir)/'`atasmart.strpool.c
mostlyclean-libtool:
-rm -f *.lo
@@ -501,37 +590,43 @@
install-pkgconfigDATA: $(pkgconfig_DATA)
@$(NORMAL_INSTALL)
test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
- @list='$(pkgconfig_DATA)'; for p in $$list; do \
+ @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+ for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f=$(am__strip_dir) \
- echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
- $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
done
uninstall-pkgconfigDATA:
@$(NORMAL_UNINSTALL)
- @list='$(pkgconfig_DATA)'; for p in $$list; do \
- f=$(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
- rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \
- done
+ @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
- @list='$(include_HEADERS)'; for p in $$list; do \
+ @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+ for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f=$(am__strip_dir) \
- echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
- $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
+ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
done
uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
- @list='$(include_HEADERS)'; for p in $$list; do \
- f=$(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
- rm -f "$(DESTDIR)$(includedir)/$$f"; \
- done
+ @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(includedir)" && rm -f $$files
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
@@ -557,7 +652,7 @@
else \
local_target="$$target"; \
fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
@@ -591,16 +686,16 @@
else \
local_target="$$target"; \
fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -615,7 +710,7 @@
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
+ set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
@@ -627,7 +722,7 @@
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
- tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
@@ -636,36 +731,41 @@
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
+ $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
- test -d $(distdir) || mkdir $(distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -681,38 +781,54 @@
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 -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
- list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
- distdir=`$(am__cd) $(distdir) && pwd`; \
- top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
- (cd $$subdir && \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ 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="$$top_distdir" \
- distdir="$$distdir/$$subdir" \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
+ am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
- -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -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)
+ || chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
@@ -723,6 +839,10 @@
dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
$(am__remove_distdir)
dist-tarZ: distdir
@@ -753,6 +873,8 @@
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
@@ -764,9 +886,11 @@
mkdir $(distdir)/_build
mkdir $(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-$$$$/" \
- && cd $(distdir)/_build \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
@@ -788,13 +912,15 @@
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
- && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
$(am__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:
- @cd $(distuninstallcheck_dir) \
+ @$(am__cd) '$(distuninstallcheck_dir)' \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
@@ -843,6 +969,7 @@
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"
@@ -867,6 +994,8 @@
html: html-recursive
+html-am:
+
info: info-recursive
info-am:
@@ -875,17 +1004,27 @@
install-dvi: install-dvi-recursive
+install-dvi-am:
+
install-exec-am: install-libLTLIBRARIES install-sbinPROGRAMS
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:
@@ -912,33 +1051,36 @@
uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \
uninstall-pkgconfigDATA uninstall-sbinPROGRAMS
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
- install-strip
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \
+ ctags-recursive install install-am install-strip \
+ tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS \
clean-sbinPROGRAMS ctags ctags-recursive dist dist-all \
- dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ dist-zip \
- distcheck distclean distclean-compile distclean-generic \
- distclean-hdr distclean-libtool distclean-tags distcleancheck \
- distdir distuninstallcheck 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-includeHEADERS \
- install-info install-info-am install-libLTLIBRARIES \
- install-man install-pdf install-pdf-am install-pkgconfigDATA \
- install-ps install-ps-am install-sbinPROGRAMS install-strip \
- installcheck installcheck-am installdirs installdirs-am \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+ dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ dist-xz \
+ dist-zip distcheck distclean distclean-compile \
+ distclean-generic distclean-hdr distclean-libtool \
+ distclean-tags distcleancheck distdir distuninstallcheck 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-includeHEADERS install-info install-info-am \
+ install-libLTLIBRARIES install-man install-pdf install-pdf-am \
+ install-pkgconfigDATA install-ps install-ps-am \
+ install-sbinPROGRAMS install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-recursive uninstall uninstall-am \
uninstall-includeHEADERS uninstall-libLTLIBRARIES \
uninstall-pkgconfigDATA uninstall-sbinPROGRAMS
atasmart.strpool.c: atasmart.c strpool
$(top_builddir)/strpool $< $@
+
# 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:
diff --git a/aclocal.m4 b/aclocal.m4
index 657092d..b1d9ba5 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.10.2 -*- Autoconf -*-
+# generated automatically by aclocal 1.11 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009 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.
@@ -8136,10 +8136,10 @@
# 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.10'
+[am__api_version='1.11'
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.10.2], [],
+m4_if([$1], [1.11], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -8155,7 +8155,7 @@
# 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.10.2])dnl
+[AM_AUTOMAKE_VERSION([1.11])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@@ -8215,14 +8215,14 @@
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
# 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.
-# serial 8
+# serial 9
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
@@ -8235,6 +8235,7 @@
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='#'
@@ -8248,14 +8249,14 @@
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
# 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.
-# serial 9
+# serial 10
# 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,
@@ -8312,6 +8313,16 @@
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
@@ -8329,7 +8340,17 @@
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
@@ -8339,19 +8360,23 @@
break
fi
;;
+ 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
- # 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.
if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ $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 sub/conftest.${OBJEXT-o} 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
@@ -8415,59 +8440,61 @@
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-#serial 4
+#serial 5
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[# Autoconf 2.62 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.
-case $CONFIG_FILES in
-*\'*) eval set x "$CONFIG_FILES" ;;
-*) set x $CONFIG_FILES ;;
-esac
-shift
-for mf
-do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
+[{
+ # Autoconf 2.62 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.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
done
-done
+}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
@@ -8487,13 +8514,13 @@
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008 Free Software Foundation, Inc.
+# 2005, 2006, 2008, 2009 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.
-# serial 13
+# serial 16
# 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.
@@ -8510,7 +8537,7 @@
# 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.60])dnl
+[AC_PREREQ([2.62])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
@@ -8561,8 +8588,8 @@
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
@@ -8570,23 +8597,36 @@
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([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_CC],
- defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_CXX],
- defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
- [_AM_DEPENDENCIES(OBJC)],
- [define([AC_PROG_OBJC],
- defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
+dnl 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
])
+
+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.
@@ -8610,7 +8650,7 @@
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -8621,7 +8661,14 @@
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+if test x"${install_sh}" != 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, 2005 Free Software Foundation, Inc.
@@ -8647,13 +8694,13 @@
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2005, 2009 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.
-# serial 3
+# serial 4
# AM_MAKE_INCLUDE()
# -----------------
@@ -8662,7 +8709,7 @@
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
- @echo done
+ @echo this is the am__doit target
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
@@ -8672,24 +8719,24 @@
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
- am__include=include
- am__quote=
- _am_result=GNU
-fi
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
- am__include=.include
- am__quote="\""
- _am_result=BSD
- fi
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
@@ -8734,14 +8781,14 @@
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
# 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.
-# serial 5
+# serial 6
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
@@ -8758,7 +8805,14 @@
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+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 --run true"; then
am_missing_run="$MISSING --run "
@@ -8827,16 +8881,33 @@
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+# Copyright (C) 2001, 2003, 2005 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, 1997, 2000, 2001, 2003, 2005
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
# 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.
-# serial 4
+# serial 5
# AM_SANITY_CHECK
# ---------------
@@ -8845,16 +8916,29 @@
# Just in case
sleep 1
echo timestamp > conftest.file
+# 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 (
- set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ 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`
+ set X `ls -t "$srcdir/configure" conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
@@ -8878,6 +8962,33 @@
Check your system clock])
fi
AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2009 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.
+
+# serial 1
+
+# 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],
+[ --enable-silent-rules less verbose build output (undo: `make V=1')
+ --disable-silent-rules verbose build output (undo: `make V=0')])
+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
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
@@ -8907,17 +9018,24 @@
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2008 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.
+
+# serial 2
# _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 -*-
diff --git a/atasmart.c b/atasmart.c
index 5cf6c30..bce315b 100644
--- a/atasmart.c
+++ b/atasmart.c
@@ -64,13 +64,14 @@
/* These three will be autotested for: */
SK_DISK_TYPE_ATA_PASSTHROUGH_12, /* ATA passthrough over SCSI transport, 12-byte version */
SK_DISK_TYPE_ATA_PASSTHROUGH_16, /* ATA passthrough over SCSI transport, 16-byte version */
- SK_DISK_TYPE_ATA, /* Classic Linux /dev/hda ioctls */
+ SK_DISK_TYPE_LINUX_IDE, /* Classic Linux /dev/hda ioctls */
/* These three will not be autotested for */
SK_DISK_TYPE_SUNPLUS, /* SunPlus USB/ATA bridges */
SK_DISK_TYPE_JMICRON, /* JMicron USB/ATA bridges */
- SK_DISK_TYPE_BLOB,
- SK_DISK_TYPE_UNKNOWN,
+ SK_DISK_TYPE_BLOB, /* From a file */
+ SK_DISK_TYPE_NONE, /* No access method */
+ SK_DISK_TYPE_AUTO, /* We don't know yet */
_SK_DISK_TYPE_MAX,
_SK_DISK_TYPE_TEST_MAX = SK_DISK_TYPE_SUNPLUS /* only auto test until here */
} SkDiskType;
@@ -114,6 +115,8 @@
SkBool blob_smart_status:1;
SkBool blob_smart_status_valid:1;
+ SkBool attribute_verification_bad:1;
+
SkIdentifyParsedData identify_parsed_data;
SkSmartParsedData smart_parsed_data;
@@ -138,17 +141,26 @@
SK_SMART_COMMAND_RETURN_STATUS = 0xDA
} SkSmartCommand;
-static const char *disk_type_to_string(SkDiskType type) {
+/* Hmm, if the data we parse is out of a certain range just consider it misparsed */
+#define SK_MKELVIN_VALID_MIN ((uint64_t) ((-15LL*1000LL) + 273150LL))
+#define SK_MKELVIN_VALID_MAX ((uint64_t) ((100LL*1000LL) + 273150LL))
+
+#define SK_MSECOND_VALID_MIN 1ULL
+#define SK_MSECOND_VALID_SHORT_MAX (60ULL * 60ULL * 1000ULL)
+#define SK_MSECOND_VALID_LONG_MAX (30ULL * 365ULL * 24ULL * 60ULL * 60ULL * 1000ULL)
+
+static const char *disk_type_to_human_string(SkDiskType type) {
/* %STRINGPOOLSTART% */
static const char* const map[_SK_DISK_TYPE_MAX] = {
[SK_DISK_TYPE_ATA_PASSTHROUGH_16] = "16 Byte SCSI ATA SAT Passthru",
[SK_DISK_TYPE_ATA_PASSTHROUGH_12] = "12 Byte SCSI ATA SAT Passthru",
- [SK_DISK_TYPE_ATA] = "Native Linux ATA",
+ [SK_DISK_TYPE_LINUX_IDE] = "Native Linux IDE",
[SK_DISK_TYPE_SUNPLUS] = "Sunplus SCSI ATA Passthru",
[SK_DISK_TYPE_JMICRON] = "JMicron SCSI ATA Passthru",
[SK_DISK_TYPE_BLOB] = "Blob",
- [SK_DISK_TYPE_UNKNOWN] = "Unknown"
+ [SK_DISK_TYPE_AUTO] = "Automatic",
+ [SK_DISK_TYPE_NONE] = "None"
};
/* %STRINGPOOLSTOP% */
@@ -158,6 +170,55 @@
return _P(map[type]);
}
+static const char *disk_type_to_prefix_string(SkDiskType type) {
+
+ /* %STRINGPOOLSTART% */
+ static const char* const map[_SK_DISK_TYPE_MAX] = {
+ [SK_DISK_TYPE_ATA_PASSTHROUGH_16] = "sat16",
+ [SK_DISK_TYPE_ATA_PASSTHROUGH_12] = "sat12",
+ [SK_DISK_TYPE_LINUX_IDE] = "linux-ide",
+ [SK_DISK_TYPE_SUNPLUS] = "sunplus",
+ [SK_DISK_TYPE_JMICRON] = "jmicron",
+ [SK_DISK_TYPE_NONE] = "none",
+ [SK_DISK_TYPE_AUTO] = "auto",
+ };
+ /* %STRINGPOOLSTOP% */
+
+ if (type >= _SK_DISK_TYPE_MAX)
+ return NULL;
+
+ return _P(map[type]);
+}
+
+static const char *disk_type_from_string(const char *s, SkDiskType *type) {
+ unsigned u;
+
+ assert(s);
+ assert(type);
+
+ for (u = 0; u < _SK_DISK_TYPE_MAX; u++) {
+ const char *t;
+ size_t l;
+
+ if (!(t = disk_type_to_prefix_string(u)))
+ continue;
+
+ l = strlen(t);
+
+ if (strncmp(s, t, l))
+ continue;
+
+ if (s[l] != ':')
+ continue;
+
+ *type = u;
+
+ return s + l + 1;
+ }
+
+ return NULL;
+}
+
static SkBool disk_smart_is_available(SkDisk *d) {
return d->identify_valid && !!(d->identify[164] & 1);
}
@@ -189,11 +250,11 @@
return !!(d->smart_data[367] & 41);
}
-static int disk_ata_command(SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* data, size_t *len) {
+static int disk_linux_ide_command(SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* data, size_t *len) {
uint8_t *bytes = cmd_data;
int ret;
- assert(d->type == SK_DISK_TYPE_ATA);
+ assert(d->type == SK_DISK_TYPE_LINUX_IDE);
switch (direction) {
@@ -634,13 +695,14 @@
static int disk_command(SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* data, size_t *len) {
static int (* const disk_command_table[_SK_DISK_TYPE_MAX]) (SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* data, size_t *len) = {
- [SK_DISK_TYPE_ATA] = disk_ata_command,
+ [SK_DISK_TYPE_LINUX_IDE] = disk_linux_ide_command,
[SK_DISK_TYPE_ATA_PASSTHROUGH_12] = disk_passthrough_12_command,
[SK_DISK_TYPE_ATA_PASSTHROUGH_16] = disk_passthrough_16_command,
[SK_DISK_TYPE_SUNPLUS] = disk_sunplus_command,
[SK_DISK_TYPE_JMICRON] = disk_jmicron_command,
[SK_DISK_TYPE_BLOB] = NULL,
- [SK_DISK_TYPE_UNKNOWN] = NULL
+ [SK_DISK_TYPE_AUTO] = NULL,
+ [SK_DISK_TYPE_NONE] = NULL
};
assert(d);
@@ -1120,7 +1182,7 @@
else if (!strcmp(a->name, "temperature-centi-celsius"))
a->pretty_value = (fourtyeight & 0xFFFF)*100 + 273150;
else if (!strcmp(a->name, "power-on-minutes"))
- a->pretty_value = (((uint64_t) a->raw[0]) | (uint64_t) a->raw[1]) * 60 * 1000;
+ a->pretty_value = fourtyeight * 60 * 1000;
else if (!strcmp(a->name, "power-on-seconds"))
a->pretty_value = fourtyeight * 1000;
else if (!strcmp(a->name, "power-on-half-minutes"))
@@ -1128,84 +1190,144 @@
else if (!strcmp(a->name, "power-on-hours") ||
!strcmp(a->name, "loaded-hours") ||
!strcmp(a->name, "head-flying-hours"))
- a->pretty_value = fourtyeight * 60 * 60 * 1000;
- else if (!strcmp(a->name, "reallocated-sector-count"))
+ a->pretty_value = (fourtyeight & 0xFFFFFFFFU) * 60 * 60 * 1000;
+ else if (!strcmp(a->name, "reallocated-sector-count") ||
+ !strcmp(a->name, "current-pending-sector"))
a->pretty_value = fourtyeight & 0xFFFFFFFFU;
else
a->pretty_value = fourtyeight;
}
+typedef void (*SkSmartAttributeVerify)(SkDisk *d, SkSmartAttributeParsedData *a);
+
typedef struct SkSmartAttributeInfo {
const char *name;
SkSmartAttributeUnit unit;
+ SkSmartAttributeVerify verify;
} SkSmartAttributeInfo;
+
+static void verify_temperature(SkDisk *d, SkSmartAttributeParsedData *a) {
+ assert(a);
+ assert(a->pretty_unit == SK_SMART_ATTRIBUTE_UNIT_MKELVIN);
+
+ if (a->pretty_value < SK_MKELVIN_VALID_MIN ||
+ a->pretty_value > SK_MKELVIN_VALID_MAX) {
+ a->pretty_unit = SK_SMART_ATTRIBUTE_UNIT_UNKNOWN;
+ d->attribute_verification_bad = TRUE;
+ }
+}
+
+static void verify_short_time(SkDisk *d, SkSmartAttributeParsedData *a) {
+ assert(a);
+ assert(a->pretty_unit == SK_SMART_ATTRIBUTE_UNIT_MSECONDS);
+
+ if (a->pretty_value < SK_MSECOND_VALID_MIN ||
+ a->pretty_value > SK_MSECOND_VALID_SHORT_MAX) {
+ a->pretty_unit = SK_SMART_ATTRIBUTE_UNIT_UNKNOWN;
+ d->attribute_verification_bad = TRUE;
+ }
+}
+
+static void verify_long_time(SkDisk *d, SkSmartAttributeParsedData *a) {
+ assert(a);
+ assert(a->pretty_unit == SK_SMART_ATTRIBUTE_UNIT_MSECONDS);
+
+ if (a->pretty_value < SK_MSECOND_VALID_MIN ||
+ a->pretty_value > SK_MSECOND_VALID_LONG_MAX) {
+ a->pretty_unit = SK_SMART_ATTRIBUTE_UNIT_UNKNOWN;
+ d->attribute_verification_bad = TRUE;
+ }
+}
+
+static void verify_sectors(SkDisk *d, SkSmartAttributeParsedData *a) {
+ uint64_t max_sectors;
+
+ assert(d);
+ assert(a);
+ assert(a->pretty_unit == SK_SMART_ATTRIBUTE_UNIT_SECTORS);
+
+ max_sectors = d->size / 512ULL;
+
+ if (max_sectors > 0 && a->pretty_value > max_sectors) {
+ a->pretty_value = SK_SMART_ATTRIBUTE_UNIT_UNKNOWN;
+ d->attribute_verification_bad = TRUE;
+ } else {
+ if ((!strcmp(a->name, "reallocated-sector-count") ||
+ !strcmp(a->name, "current-pending-sector")) &&
+ a->pretty_value > 0)
+ a->warn = TRUE;
+ }
+}
/* This data is stolen from smartmontools */
/* %STRINGPOOLSTART% */
static const SkSmartAttributeInfo const attribute_info[256] = {
- [1] = { "raw-read-error-rate", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [2] = { "throughput-performance", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
- [3] = { "spin-up-time", SK_SMART_ATTRIBUTE_UNIT_MSECONDS },
- [4] = { "start-stop-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [5] = { "reallocated-sector-count", SK_SMART_ATTRIBUTE_UNIT_SECTORS },
- [6] = { "read-channel-margin", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
- [7] = { "seek-error-rate", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [8] = { "seek-time-performance", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
- [9] = { "power-on-hours", SK_SMART_ATTRIBUTE_UNIT_MSECONDS },
- [10] = { "spin-retry-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [11] = { "calibration-retry-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [12] = { "power-cycle-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [13] = { "read-soft-error-rate", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [187] = { "reported-uncorrect", SK_SMART_ATTRIBUTE_UNIT_SECTORS },
- [189] = { "high-fly-writes", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [190] = { "airflow-temperature-celsius", SK_SMART_ATTRIBUTE_UNIT_MKELVIN },
- [191] = { "g-sense-error-rate", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [192] = { "power-off-retract-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [193] = { "load-cycle-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [194] = { "temperature-celsius-2", SK_SMART_ATTRIBUTE_UNIT_MKELVIN },
- [195] = { "hardware-ecc-recovered", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [196] = { "reallocated-event-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [197] = { "current-pending-sector", SK_SMART_ATTRIBUTE_UNIT_SECTORS },
- [198] = { "offline-uncorrectable", SK_SMART_ATTRIBUTE_UNIT_SECTORS },
- [199] = { "udma-crc-error-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [200] = { "multi-zone-error-rate", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [201] = { "soft-read-error-rate", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [202] = { "ta-increase-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [203] = { "run-out-cancel", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
- [204] = { "shock-count-write-open", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [205] = { "shock-rate-write-open", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [206] = { "flying-height", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
- [207] = { "spin-high-current", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
- [208] = { "spin-buzz", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN},
- [209] = { "offline-seek-performance", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
- [220] = { "disk-shift", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
- [221] = { "g-sense-error-rate-2", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [222] = { "loaded-hours", SK_SMART_ATTRIBUTE_UNIT_MSECONDS },
- [223] = { "load-retry-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [224] = { "load-friction", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
- [225] = { "load-cycle-count-2", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [226] = { "load-in-time", SK_SMART_ATTRIBUTE_UNIT_MSECONDS },
- [227] = { "torq-amp-count", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [228] = { "power-off-retract-count-2", SK_SMART_ATTRIBUTE_UNIT_NONE },
- [230] = { "head-amplitude", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
- [231] = { "temperature-celsius", SK_SMART_ATTRIBUTE_UNIT_MKELVIN },
- [240] = { "head-flying-hours", SK_SMART_ATTRIBUTE_UNIT_MSECONDS },
- [250] = { "read-error-retry-rate", SK_SMART_ATTRIBUTE_UNIT_NONE }
+ [1] = { "raw-read-error-rate", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [2] = { "throughput-performance", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [3] = { "spin-up-time", SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_short_time },
+ [4] = { "start-stop-count", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [5] = { "reallocated-sector-count", SK_SMART_ATTRIBUTE_UNIT_SECTORS, verify_sectors },
+ [6] = { "read-channel-margin", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [7] = { "seek-error-rate", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [8] = { "seek-time-performance", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [9] = { "power-on-hours", SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time },
+ [10] = { "spin-retry-count", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [11] = { "calibration-retry-count", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [12] = { "power-cycle-count", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [13] = { "read-soft-error-rate", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [187] = { "reported-uncorrect", SK_SMART_ATTRIBUTE_UNIT_SECTORS, verify_sectors },
+ [189] = { "high-fly-writes", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [190] = { "airflow-temperature-celsius", SK_SMART_ATTRIBUTE_UNIT_MKELVIN, verify_temperature },
+ [191] = { "g-sense-error-rate", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [192] = { "power-off-retract-count", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [193] = { "load-cycle-count", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [194] = { "temperature-celsius-2", SK_SMART_ATTRIBUTE_UNIT_MKELVIN, verify_temperature },
+ [195] = { "hardware-ecc-recovered", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [196] = { "reallocated-event-count", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [197] = { "current-pending-sector", SK_SMART_ATTRIBUTE_UNIT_SECTORS, verify_sectors },
+ [198] = { "offline-uncorrectable", SK_SMART_ATTRIBUTE_UNIT_SECTORS, verify_sectors },
+ [199] = { "udma-crc-error-count", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [200] = { "multi-zone-error-rate", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [201] = { "soft-read-error-rate", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [202] = { "ta-increase-count", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [203] = { "run-out-cancel", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [204] = { "shock-count-write-open", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [205] = { "shock-rate-write-open", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [206] = { "flying-height", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [207] = { "spin-high-current", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [208] = { "spin-buzz", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [209] = { "offline-seek-performance", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [220] = { "disk-shift", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [221] = { "g-sense-error-rate-2", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [222] = { "loaded-hours", SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time },
+ [223] = { "load-retry-count", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [224] = { "load-friction", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [225] = { "load-cycle-count-2", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [226] = { "load-in-time", SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_short_time },
+ [227] = { "torq-amp-count", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [228] = { "power-off-retract-count-2", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [230] = { "head-amplitude", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [231] = { "temperature-celsius", SK_SMART_ATTRIBUTE_UNIT_MKELVIN, verify_temperature },
+ [240] = { "head-flying-hours", SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time },
+ [250] = { "read-error-retry-rate", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL }
};
/* %STRINGPOOLSTOP% */
typedef enum SkSmartQuirk {
- SK_SMART_QUIRK_9_POWERONMINUTES = 1,
- SK_SMART_QUIRK_9_POWERONSECONDS = 2,
- SK_SMART_QUIRK_9_POWERONHALFMINUTES = 4,
- SK_SMART_QUIRK_192_EMERGENCYRETRACTCYCLECT = 8,
- SK_SMART_QUIRK_193_LOADUNLOAD = 16,
- SK_SMART_QUIRK_194_10XCELSIUS = 32,
- SK_SMART_QUIRK_194_UNKNOWN = 64,
- SK_SMART_QUIRK_200_WRITEERRORCOUNT = 128,
- SK_SMART_QUIRK_201_DETECTEDTACOUNT = 256,
- SK_SMART_QUIRK_9_UNKNOWN = 512
+ SK_SMART_QUIRK_9_POWERONMINUTES = 0x0001,
+ SK_SMART_QUIRK_9_POWERONSECONDS = 0x0002,
+ SK_SMART_QUIRK_9_POWERONHALFMINUTES = 0x0004,
+ SK_SMART_QUIRK_192_EMERGENCYRETRACTCYCLECT = 0x0008,
+ SK_SMART_QUIRK_193_LOADUNLOAD = 0x0010,
+ SK_SMART_QUIRK_194_10XCELSIUS = 0x0020,
+ SK_SMART_QUIRK_194_UNKNOWN = 0x0040,
+ SK_SMART_QUIRK_200_WRITEERRORCOUNT = 0x0080,
+ SK_SMART_QUIRK_201_DETECTEDTACOUNT = 0x0100,
+ SK_SMART_QUIRK_5_UNKNOWN = 0x0200,
+ SK_SMART_QUIRK_9_UNKNOWN = 0x0400,
+ SK_SMART_QUIRK_197_UNKNOWN = 0x0800,
+ SK_SMART_QUIRK_198_UNKNOWN = 0x1000,
} SkSmartQuirk;
/* %STRINGPOOLSTART% */
@@ -1219,7 +1341,10 @@
"194_UNKNOWN",
"200_WRITEERRORCOUNT",
"201_DETECTEDTACOUNT",
+ "5_UNKNOWN",
"9_UNKNOWN",
+ "197_UNKNOWN",
+ "198_UNKNOWN",
NULL
};
/* %STRINGPOOLSTOP% */
@@ -1232,13 +1357,16 @@
static const SkSmartQuirkDatabase quirk_database[] = { {
- /*** Seagate */
- "^ST9160821AS$",
- NULL,
- SK_SMART_QUIRK_9_UNKNOWN
+ /*** Fujitsu */
+ "^("
+ "FUJITSU MHY2120BH|"
+ "FUJITSU MHY2250BH"
+ ")$",
+ "^0085000B$", /* seems to be specific to this firmware */
+ SK_SMART_QUIRK_9_POWERONMINUTES|
+ SK_SMART_QUIRK_197_UNKNOWN|
+ SK_SMART_QUIRK_198_UNKNOWN
}, {
-
- /*** Fujitsu */
"^FUJITSU MHR2040AT$",
NULL,
SK_SMART_QUIRK_9_POWERONSECONDS|
@@ -1357,7 +1485,10 @@
SK_SMART_QUIRK_9_POWERONMINUTES|
SK_SMART_QUIRK_193_LOADUNLOAD
}, {
-
+ "^HTS541010G9SA00$",
+ "^MBZOC60P$",
+ SK_SMART_QUIRK_5_UNKNOWN
+ }, {
NULL,
NULL,
0
@@ -1440,23 +1571,29 @@
if (quirk) {
switch (id) {
+ case 5:
+ if (quirk & SK_SMART_QUIRK_5_UNKNOWN)
+ return NULL;
+
+ break;
+
case 9:
/* %STRINGPOOLSTART% */
if (quirk & SK_SMART_QUIRK_9_POWERONMINUTES) {
static const SkSmartAttributeInfo a = {
- "power-on-minutes", SK_SMART_ATTRIBUTE_UNIT_MSECONDS
+ "power-on-minutes", SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time
};
return &a;
} else if (quirk & SK_SMART_QUIRK_9_POWERONSECONDS) {
static const SkSmartAttributeInfo a = {
- "power-on-seconds", SK_SMART_ATTRIBUTE_UNIT_MSECONDS
+ "power-on-seconds", SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time
};
return &a;
} else if (quirk & SK_SMART_QUIRK_9_POWERONHALFMINUTES) {
static const SkSmartAttributeInfo a = {
- "power-on-half-minutes", SK_SMART_ATTRIBUTE_UNIT_MSECONDS
+ "power-on-half-minutes", SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time
};
return &a;
} else if (quirk & SK_SMART_QUIRK_9_UNKNOWN)
@@ -1469,7 +1606,7 @@
/* %STRINGPOOLSTART% */
if (quirk & SK_SMART_QUIRK_192_EMERGENCYRETRACTCYCLECT) {
static const SkSmartAttributeInfo a = {
- "emergency-retract-cycle-count", SK_SMART_ATTRIBUTE_UNIT_NONE
+ "emergency-retract-cycle-count", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL
};
return &a;
}
@@ -1481,7 +1618,7 @@
/* %STRINGPOOLSTART% */
if (quirk & SK_SMART_QUIRK_194_10XCELSIUS) {
static const SkSmartAttributeInfo a = {
- "temperature-centi-celsius", SK_SMART_ATTRIBUTE_UNIT_MKELVIN
+ "temperature-centi-celsius", SK_SMART_ATTRIBUTE_UNIT_MKELVIN, verify_temperature
};
return &a;
} else if (quirk & SK_SMART_QUIRK_194_UNKNOWN)
@@ -1490,11 +1627,23 @@
break;
+ case 197:
+ if (quirk & SK_SMART_QUIRK_197_UNKNOWN)
+ return NULL;
+
+ break;
+
+ case 198:
+ if (quirk & SK_SMART_QUIRK_198_UNKNOWN)
+ return NULL;
+
+ break;
+
case 200:
/* %STRINGPOOLSTART% */
if (quirk & SK_SMART_QUIRK_200_WRITEERRORCOUNT) {
static const SkSmartAttributeInfo a = {
- "write-error-count", SK_SMART_ATTRIBUTE_UNIT_NONE
+ "write-error-count", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL
};
return &a;
}
@@ -1506,7 +1655,7 @@
/* %STRINGPOOLSTART% */
if (quirk & SK_SMART_QUIRK_201_DETECTEDTACOUNT) {
static const SkSmartAttributeInfo a = {
- "detected-ta-count", SK_SMART_ATTRIBUTE_UNIT_NONE
+ "detected-ta-count", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL
};
return &a;
}
@@ -1588,41 +1737,50 @@
uint8_t *p;
unsigned n;
- if (!d->smart_thresholds_valid) {
- a->threshold_valid = FALSE;
- return;
- }
+ if (!d->smart_thresholds_valid)
+ goto fail;
for (n = 0, p = d->smart_thresholds+2; n < 30; n++, p+=12)
if (p[0] == a->id)
break;
- if (n >= 30) {
- a->threshold_valid = FALSE;
- a->good_valid = FALSE;
- return;
- }
+ if (n >= 30)
+ goto fail;
a->threshold = p[1];
a->threshold_valid = p[1] != 0xFE;
- a->good_valid = FALSE;
- a->good = TRUE;
+ a->good_now_valid = FALSE;
+ a->good_now = TRUE;
+ a->good_in_the_past_valid = FALSE;
+ a->good_in_the_past = TRUE;
/* Always-Fail and Always-Passing thresholds are not relevant
* for our assessment. */
if (p[1] >= 1 && p[1] <= 0xFD) {
if (a->worst_value_valid) {
- a->good = a->good && (a->worst_value > a->threshold);
- a->good_valid = TRUE;
+ a->good_in_the_past = a->good_in_the_past && (a->worst_value > a->threshold);
+ a->good_in_the_past_valid = TRUE;
}
if (a->current_value_valid) {
- a->good = a->good && (a->current_value > a->threshold);
- a->good_valid = TRUE;
+ a->good_now = a->good_now && (a->current_value > a->threshold);
+ a->good_now_valid = TRUE;
}
}
+
+ a->warn =
+ (a->good_now_valid && !a->good_now) ||
+ (a->good_in_the_past_valid && !a->good_in_the_past);
+
+ return;
+
+fail:
+ a->threshold_valid = FALSE;
+ a->good_now_valid = FALSE;
+ a->good_in_the_past_valid = FALSE;
+ a->warn = FALSE;
}
int sk_disk_smart_parse_attributes(SkDisk *d, SkSmartAttributeParseCallback cb, void* userdata) {
@@ -1672,14 +1830,8 @@
find_threshold(d, &a);
- /* Handle a few fields specially */
- if ((!strcmp(a.name, "reallocated-sector-count") ||
- !strcmp(a.name, "current-pending-sector")) &&
- a.pretty_unit == SK_SMART_ATTRIBUTE_UNIT_SECTORS &&
- a.pretty_value > 0) {
- a.good = FALSE;
- a.good_valid = TRUE;
- }
+ if (i && i->verify)
+ i->verify(d, &a);
cb(d, &a, userdata);
free(an);
@@ -1890,9 +2042,11 @@
/* %STRINGPOOLSTART% */
const char * const map[] = {
[SK_SMART_OVERALL_GOOD] = "GOOD",
+ [SK_SMART_OVERALL_BAD_ATTRIBUTE_IN_THE_PAST] = "BAD_ATTRIBUTE_IN_THE_PAST",
+ [SK_SMART_OVERALL_BAD_SECTOR] = "BAD_SECTOR",
+ [SK_SMART_OVERALL_BAD_ATTRIBUTE_NOW] = "BAD_ATTRIBUTE_NOW",
+ [SK_SMART_OVERALL_BAD_SECTOR_MANY] = "BAD_SECTOR_MANY",
[SK_SMART_OVERALL_BAD_STATUS] = "BAD_STATUS",
- [SK_SMART_OVERALL_BAD_ATTRIBUTE] = "BAD_ATTRIBUTE",
- [SK_SMART_OVERALL_BAD_SECTOR] = "BAD_SECTOR"
};
/* %STRINGPOOLSTOP% */
@@ -1902,18 +2056,39 @@
return _P(map[overall]);
}
-static void bad_attribute_cb(SkDisk *d, const SkSmartAttributeParsedData *a, SkBool *good) {
- if (a->prefailure && a->good_valid && !a->good)
+static void bad_attribute_now_cb(SkDisk *d, const SkSmartAttributeParsedData *a, SkBool *good) {
+ if (a->prefailure && a->good_now_valid && !a->good_now)
*good = FALSE;
+}
+
+static void bad_attribute_in_the_past_cb(SkDisk *d, const SkSmartAttributeParsedData *a, SkBool *good) {
+ if (a->prefailure && a->good_in_the_past_valid && !a->good_in_the_past)
+ *good = FALSE;
+}
+
+static uint64_t u64log2(uint64_t n) {
+ unsigned r;
+
+ if (n <= 1)
+ return 0;
+
+ r = 0;
+ for (;;) {
+ n = n >> 1;
+ if (!n)
+ return r;
+ r++;
+ }
}
int sk_disk_smart_get_overall(SkDisk *d, SkSmartOverall *overall) {
SkBool good;
- uint64_t sectors;
+ uint64_t sectors, sector_threshold;
assert(d);
assert(overall);
+ /* First, check SMART self-assesment */
if (sk_disk_smart_status(d, &good) < 0)
return -1;
@@ -1922,23 +2097,51 @@
return 0;
}
+ /* Second, check if the number of bad sectors is greater than
+ * a certain threshold */
if (sk_disk_smart_get_bad(d, §ors) < 0) {
if (errno != ENOENT)
return -1;
- } else if (sectors > 0) {
+ sectors = 0;
+ } else {
+
+ /* We use log2(n_sectors) as a threshold here. We had to pick
+ * something, and this makes a bit of sense, or doesn't it? */
+ sector_threshold = u64log2(d->size/512);
+
+ if (sectors >= sector_threshold) {
+ *overall = SK_SMART_OVERALL_BAD_SECTOR_MANY;
+ return 0;
+ }
+ }
+
+ /* Third, check if any of the SMART attributes is bad */
+ good = TRUE;
+ if (sk_disk_smart_parse_attributes(d, (SkSmartAttributeParseCallback) bad_attribute_now_cb, &good) < 0)
+ return -1;
+
+ if (!good) {
+ *overall = SK_SMART_OVERALL_BAD_ATTRIBUTE_NOW;
+ return 0;
+ }
+
+ /* Fourth, check if there are any bad sectors at all */
+ if (sectors > 0) {
*overall = SK_SMART_OVERALL_BAD_SECTOR;
return 0;
}
+ /* Fifth, check if any of the SMART attributes ever was bad */
good = TRUE;
- if (sk_disk_smart_parse_attributes(d, (SkSmartAttributeParseCallback) bad_attribute_cb, &good) < 0)
+ if (sk_disk_smart_parse_attributes(d, (SkSmartAttributeParseCallback) bad_attribute_in_the_past_cb, &good) < 0)
return -1;
if (!good) {
- *overall = SK_SMART_OVERALL_BAD_ATTRIBUTE;
+ *overall = SK_SMART_OVERALL_BAD_ATTRIBUTE_IN_THE_PAST;
return 0;
}
+ /* Sixth, there's really nothing to complain about, so give it a pass */
*overall = SK_SMART_OVERALL_GOOD;
return 0;
}
@@ -2018,12 +2221,12 @@
snprintf(tc, sizeof(tc), "%3u", a->current_value);
tc[sizeof(tc)-1] = 0;
- highlight = a->good_valid && !a->good && isatty(1);
+ highlight = a->warn && isatty(1);
if (highlight)
fprintf(stderr, HIGHLIGHT);
- printf("%3u %-27s %-3s %-3s %-3s %-11s 0x%02x%02x%02x%02x%02x%02x %-7s %-7s %-3s\n",
+ printf("%3u %-27s %-3s %-3s %-3s %-11s 0x%02x%02x%02x%02x%02x%02x %-7s %-7s %-4s %-4s\n",
a->id,
print_name(name, sizeof(name), a->id, a->name),
a->current_value_valid ? tc : "n/a",
@@ -2033,7 +2236,8 @@
a->raw[0], a->raw[1], a->raw[2], a->raw[3], a->raw[4], a->raw[5],
a->prefailure ? "prefail" : "old-age",
a->online ? "online" : "offline",
- a->good_valid ? yes_no(a->good) : "n/a");
+ a->good_now_valid ? yes_no(a->good_now) : "n/a",
+ a->good_in_the_past_valid ? yes_no(a->good_in_the_past) : "n/a");
if (highlight)
fprintf(stderr, ENDHIGHLIGHT);
@@ -2046,10 +2250,12 @@
assert(d);
- printf("Device: %s\n"
+ printf("Device: %s%s%s\n"
"Type: %s\n",
+ d->name ? disk_type_to_prefix_string(d->type) : "",
+ d->name ? ":" : "",
d->name ? d->name : "n/a",
- disk_type_to_string(d->type));
+ disk_type_to_human_string(d->type));
ret = sk_disk_get_size(d, &size);
if (ret >= 0)
@@ -2084,7 +2290,6 @@
printf(" %s", _P(quirk_name[i]));
printf("\n");
-
}
ret = sk_disk_check_sleep_mode(d, &awake);
@@ -2099,9 +2304,10 @@
uint64_t value, power_on;
ret = sk_disk_smart_status(d, &good);
- printf("SMART Disk Health Good: %s\n",
- ret >= 0 ? yes_no(good) : strerror(errno));
-
+ printf("%sSMART Disk Health Good: %s%s\n",
+ ret >= 0 && !good ? HIGHLIGHT : "",
+ ret >= 0 ? yes_no(good) : strerror(errno),
+ ret >= 0 && !good ? ENDHIGHLIGHT : "");
if ((ret = sk_disk_smart_read_data(d)) < 0)
return ret;
@@ -2159,6 +2365,9 @@
else
printf("Temperature: %s\n", print_value(pretty, sizeof(pretty), value, SK_SMART_ATTRIBUTE_UNIT_MKELVIN));
+ printf("Attribute Parsing Verification: %s\n",
+ d->attribute_verification_bad ? "Bad" : "Good");
+
if (sk_disk_smart_get_overall(d, &overall) < 0)
printf("Overall Status: %s\n", strerror(errno));
else
@@ -2167,7 +2376,7 @@
sk_smart_overall_to_string(overall),
overall != SK_SMART_OVERALL_GOOD ? ENDHIGHLIGHT : "");
- printf("%3s %-27s %5s %5s %5s %-11s %-14s %-7s %-7s %-3s\n",
+ printf("%3s %-27s %5s %5s %5s %-11s %-14s %-7s %-7s %-4s %-4s\n",
"ID#",
"Name",
"Value",
@@ -2177,7 +2386,8 @@
"Raw",
"Type",
"Updates",
- "Good");
+ "Good",
+ "Good/Past");
if ((ret = sk_disk_smart_parse_attributes(d, disk_dump_attributes, NULL)) < 0)
return ret;
@@ -2204,6 +2414,7 @@
struct udev *udev;
struct udev_device *dev = NULL, *usb;
int r = -1;
+ const char *a;
assert(d);
@@ -2214,6 +2425,27 @@
if (!(dev = udev_device_new_from_devnum(udev, 'b', devnum))) {
errno = ENODEV;
+ goto finish;
+ }
+
+ if ((a = udev_device_get_property_value(dev, "ID_ATA_SMART_ACCESS"))) {
+ unsigned u;
+
+ for (u = 0; u < _SK_DISK_TYPE_MAX; u++) {
+ const char *t;
+
+ if (!(t = disk_type_to_prefix_string(u)))
+ continue;
+
+ if (!strcmp(a, t)) {
+ d->type = u;
+ r = 0;
+ goto finish;
+ }
+ }
+
+ d->type = SK_DISK_TYPE_NONE;
+ r = 0;
goto finish;
}
@@ -2234,9 +2466,10 @@
}
if ((vid == 0x0c0b && pid == 0xb159) ||
- (vid == 0x04fc && pid == 0x0c25))
+ (vid == 0x04fc && pid == 0x0c25) ||
+ (vid == 0x04fc && pid == 0x0c15))
d->type = SK_DISK_TYPE_SUNPLUS;
- if ((vid == 0x152d && pid == 0x2329) ||
+ else if ((vid == 0x152d && pid == 0x2329) ||
(vid == 0x152d && pid == 0x2336) ||
(vid == 0x152d && pid == 0x2338) ||
(vid == 0x152d && pid == 0x2339))
@@ -2245,11 +2478,11 @@
d->type = SK_DISK_TYPE_ATA_PASSTHROUGH_12;
} else if (udev_device_get_parent_with_subsystem_devtype(dev, "ide", NULL))
- d->type = SK_DISK_TYPE_ATA;
+ d->type = SK_DISK_TYPE_LINUX_IDE;
else if (udev_device_get_parent_with_subsystem_devtype(dev, "scsi", NULL))
d->type = SK_DISK_TYPE_ATA_PASSTHROUGH_16;
else
- d->type = SK_DISK_TYPE_UNKNOWN;
+ d->type = SK_DISK_TYPE_AUTO;
r = 0;
@@ -2275,18 +2508,25 @@
goto fail;
}
- if (!name) {
- d->fd = -1;
+ d->fd = -1;
+ d->size = (uint64_t) -1;
+
+ if (!name)
d->type = SK_DISK_TYPE_BLOB;
- d->size = (uint64_t) -1;
- } else {
-
- if (!(d->name = strdup(name))) {
+ else {
+ const char *dn;
+
+ d->type = SK_DISK_TYPE_AUTO;
+
+ if (!(dn = disk_type_from_string(name, &d->type)))
+ dn = name;
+
+ if (!(d->name = strdup(dn))) {
errno = ENOMEM;
goto fail;
}
- if ((d->fd = open(name,
+ if ((d->fd = open(d->name,
O_RDONLY|O_NOCTTY|O_NONBLOCK
#ifdef O_CLOEXEC
|O_CLOEXEC
@@ -2317,16 +2557,17 @@
}
/* OK, it's a real block device with a size. Now let's find the suitable API */
- if ((ret = disk_find_type(d, st.st_rdev)) < 0)
- goto fail;
-
- if (d->type == SK_DISK_TYPE_UNKNOWN) {
+ if (d->type == SK_DISK_TYPE_AUTO)
+ if ((ret = disk_find_type(d, st.st_rdev)) < 0)
+ goto fail;
+
+ if (d->type == SK_DISK_TYPE_AUTO) {
/* We have no clue, so let's autotest for a working API */
for (d->type = 0; d->type < _SK_DISK_TYPE_TEST_MAX; d->type++)
if (disk_identify_device(d) >= 0)
break;
if (d->type >= _SK_DISK_TYPE_TEST_MAX)
- d->type = SK_DISK_TYPE_UNKNOWN;
+ d->type = SK_DISK_TYPE_NONE;
} else
disk_identify_device(d);
diff --git a/atasmart.h b/atasmart.h
index c0baec5..aa4e339 100644
--- a/atasmart.h
+++ b/atasmart.h
@@ -157,8 +157,10 @@
SkBool prefailure:1;
/* Volatile data */
- SkBool good:1, good_valid:1;
+ SkBool good_now:1, good_now_valid:1;
+ SkBool good_in_the_past:1, good_in_the_past_valid:1;
SkBool current_value_valid:1, worst_value_valid:1;
+ SkBool warn:1;
uint8_t current_value, worst_value;
uint64_t pretty_value;
uint8_t raw[6];
@@ -171,9 +173,11 @@
typedef enum SkSmartOverall {
SK_SMART_OVERALL_GOOD,
- SK_SMART_OVERALL_BAD_STATUS, /* Smart Self Assessment negative */
- SK_SMART_OVERALL_BAD_SECTOR, /* At least one bad sector */
- SK_SMART_OVERALL_BAD_ATTRIBUTE, /* At least one pre-fail attribute exceeded its threshold in the past or now */
+ SK_SMART_OVERALL_BAD_ATTRIBUTE_IN_THE_PAST, /* At least one pre-fail attribute exceeded its threshold in the past */
+ SK_SMART_OVERALL_BAD_SECTOR, /* At least one bad sector */
+ SK_SMART_OVERALL_BAD_ATTRIBUTE_NOW, /* At least one pre-fail attribute is exceeding its threshold now */
+ SK_SMART_OVERALL_BAD_SECTOR_MANY, /* Many bad sectors */
+ SK_SMART_OVERALL_BAD_STATUS, /* Smart Self Assessment negative */
_SK_SMART_OVERALL_MAX
/* This enum may be extended at any time without this being
diff --git a/atasmart.strpool.c b/atasmart.strpool.c
index a2017b4..c71af29 100644
--- a/atasmart.strpool.c
+++ b/atasmart.strpool.c
@@ -1,12 +1,20 @@
-/* Saved 96 relocations, saved 2 strings (19 b) due to suffix compression. */
+/* Saved 109 relocations, saved 2 strings (19 b) due to suffix compression. */
static const char _strpool_[] =
"16 Byte SCSI ATA SAT Passthru\0"
"12 Byte SCSI ATA SAT Passthru\0"
- "Native Linux ATA\0"
+ "Native Linux IDE\0"
"Sunplus SCSI ATA Passthru\0"
"JMicron SCSI ATA Passthru\0"
"Blob\0"
- "Unknown\0"
+ "Automatic\0"
+ "None\0"
+ "sat16\0"
+ "sat12\0"
+ "linux-ide\0"
+ "sunplus\0"
+ "jmicron\0"
+ "none\0"
+ "auto\0"
"Off-line data collection activity was never started.\0"
"Off-line data collection activity was completed without error.\0"
"Off-line activity in progress.\0"
@@ -82,7 +90,10 @@
"194_UNKNOWN\0"
"200_WRITEERRORCOUNT\0"
"201_DETECTEDTACOUNT\0"
+ "5_UNKNOWN\0"
"9_UNKNOWN\0"
+ "197_UNKNOWN\0"
+ "198_UNKNOWN\0"
"power-on-minutes\0"
"power-on-seconds\0"
"power-on-half-minutes\0"
@@ -96,9 +107,11 @@
"sectors\0"
"mK\0"
"GOOD\0"
- "BAD_STATUS\0"
- "BAD_ATTRIBUTE\0"
- "BAD_SECTOR\0";
+ "BAD_ATTRIBUTE_IN_THE_PAST\0"
+ "BAD_SECTOR\0"
+ "BAD_ATTRIBUTE_NOW\0"
+ "BAD_SECTOR_MANY\0"
+ "BAD_STATUS\0";
#ifndef STRPOOL
#define STRPOOL
#endif
@@ -173,13 +186,14 @@
/* These three will be autotested for: */
SK_DISK_TYPE_ATA_PASSTHROUGH_12, /* ATA passthrough over SCSI transport, 12-byte version */
SK_DISK_TYPE_ATA_PASSTHROUGH_16, /* ATA passthrough over SCSI transport, 16-byte version */
- SK_DISK_TYPE_ATA, /* Classic Linux /dev/hda ioctls */
+ SK_DISK_TYPE_LINUX_IDE, /* Classic Linux /dev/hda ioctls */
/* These three will not be autotested for */
SK_DISK_TYPE_SUNPLUS, /* SunPlus USB/ATA bridges */
SK_DISK_TYPE_JMICRON, /* JMicron USB/ATA bridges */
- SK_DISK_TYPE_BLOB,
- SK_DISK_TYPE_UNKNOWN,
+ SK_DISK_TYPE_BLOB, /* From a file */
+ SK_DISK_TYPE_NONE, /* No access method */
+ SK_DISK_TYPE_AUTO, /* We don't know yet */
_SK_DISK_TYPE_MAX,
_SK_DISK_TYPE_TEST_MAX = SK_DISK_TYPE_SUNPLUS /* only auto test until here */
} SkDiskType;
@@ -223,6 +237,8 @@
SkBool blob_smart_status:1;
SkBool blob_smart_status_valid:1;
+ SkBool attribute_verification_bad:1;
+
SkIdentifyParsedData identify_parsed_data;
SkSmartParsedData smart_parsed_data;
@@ -247,17 +263,26 @@
SK_SMART_COMMAND_RETURN_STATUS = 0xDA
} SkSmartCommand;
-static const char *disk_type_to_string(SkDiskType type) {
+/* Hmm, if the data we parse is out of a certain range just consider it misparsed */
+#define SK_MKELVIN_VALID_MIN ((uint64_t) ((-15LL*1000LL) + 273150LL))
+#define SK_MKELVIN_VALID_MAX ((uint64_t) ((100LL*1000LL) + 273150LL))
+
+#define SK_MSECOND_VALID_MIN 1ULL
+#define SK_MSECOND_VALID_SHORT_MAX (60ULL * 60ULL * 1000ULL)
+#define SK_MSECOND_VALID_LONG_MAX (30ULL * 365ULL * 24ULL * 60ULL * 60ULL * 1000ULL)
+
+static const char *disk_type_to_human_string(SkDiskType type) {
/* %STRINGPOOLSTART% */
static const char* const map[_SK_DISK_TYPE_MAX] = {
[SK_DISK_TYPE_ATA_PASSTHROUGH_16] = ((const char*) 1),
[SK_DISK_TYPE_ATA_PASSTHROUGH_12] = ((const char*) 31),
- [SK_DISK_TYPE_ATA] = ((const char*) 61),
+ [SK_DISK_TYPE_LINUX_IDE] = ((const char*) 61),
[SK_DISK_TYPE_SUNPLUS] = ((const char*) 78),
[SK_DISK_TYPE_JMICRON] = ((const char*) 104),
[SK_DISK_TYPE_BLOB] = ((const char*) 130),
- [SK_DISK_TYPE_UNKNOWN] = ((const char*) 135)
+ [SK_DISK_TYPE_AUTO] = ((const char*) 135),
+ [SK_DISK_TYPE_NONE] = ((const char*) 145)
};
/* %STRINGPOOLSTOP% */
@@ -267,6 +292,55 @@
return _P(map[type]);
}
+static const char *disk_type_to_prefix_string(SkDiskType type) {
+
+ /* %STRINGPOOLSTART% */
+ static const char* const map[_SK_DISK_TYPE_MAX] = {
+ [SK_DISK_TYPE_ATA_PASSTHROUGH_16] = ((const char*) 150),
+ [SK_DISK_TYPE_ATA_PASSTHROUGH_12] = ((const char*) 156),
+ [SK_DISK_TYPE_LINUX_IDE] = ((const char*) 162),
+ [SK_DISK_TYPE_SUNPLUS] = ((const char*) 172),
+ [SK_DISK_TYPE_JMICRON] = ((const char*) 180),
+ [SK_DISK_TYPE_NONE] = ((const char*) 188),
+ [SK_DISK_TYPE_AUTO] = ((const char*) 193),
+ };
+ /* %STRINGPOOLSTOP% */
+
+ if (type >= _SK_DISK_TYPE_MAX)
+ return NULL;
+
+ return _P(map[type]);
+}
+
+static const char *disk_type_from_string(const char *s, SkDiskType *type) {
+ unsigned u;
+
+ assert(s);
+ assert(type);
+
+ for (u = 0; u < _SK_DISK_TYPE_MAX; u++) {
+ const char *t;
+ size_t l;
+
+ if (!(t = disk_type_to_prefix_string(u)))
+ continue;
+
+ l = strlen(t);
+
+ if (strncmp(s, t, l))
+ continue;
+
+ if (s[l] != ':')
+ continue;
+
+ *type = u;
+
+ return s + l + 1;
+ }
+
+ return NULL;
+}
+
static SkBool disk_smart_is_available(SkDisk *d) {
return d->identify_valid && !!(d->identify[164] & 1);
}
@@ -298,11 +372,11 @@
return !!(d->smart_data[367] & 41);
}
-static int disk_ata_command(SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* data, size_t *len) {
+static int disk_linux_ide_command(SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* data, size_t *len) {
uint8_t *bytes = cmd_data;
int ret;
- assert(d->type == SK_DISK_TYPE_ATA);
+ assert(d->type == SK_DISK_TYPE_LINUX_IDE);
switch (direction) {
@@ -743,13 +817,14 @@
static int disk_command(SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* data, size_t *len) {
static int (* const disk_command_table[_SK_DISK_TYPE_MAX]) (SkDisk *d, SkAtaCommand command, SkDirection direction, void* cmd_data, void* data, size_t *len) = {
- [SK_DISK_TYPE_ATA] = disk_ata_command,
+ [SK_DISK_TYPE_LINUX_IDE] = disk_linux_ide_command,
[SK_DISK_TYPE_ATA_PASSTHROUGH_12] = disk_passthrough_12_command,
[SK_DISK_TYPE_ATA_PASSTHROUGH_16] = disk_passthrough_16_command,
[SK_DISK_TYPE_SUNPLUS] = disk_sunplus_command,
[SK_DISK_TYPE_JMICRON] = disk_jmicron_command,
[SK_DISK_TYPE_BLOB] = NULL,
- [SK_DISK_TYPE_UNKNOWN] = NULL
+ [SK_DISK_TYPE_AUTO] = NULL,
+ [SK_DISK_TYPE_NONE] = NULL
};
assert(d);
@@ -1111,13 +1186,13 @@
/* %STRINGPOOLSTART% */
static const char* const map[] = {
- [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_NEVER] = ((const char*) 143),
- [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_SUCCESS] = ((const char*) 196),
- [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_INPROGRESS] = ((const char*) 259),
- [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_SUSPENDED] = ((const char*) 290),
- [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_ABORTED] = ((const char*) 376),
- [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_FATAL] = ((const char*) 460),
- [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_UNKNOWN] = ((const char*) 540)
+ [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_NEVER] = ((const char*) 198),
+ [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_SUCCESS] = ((const char*) 251),
+ [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_INPROGRESS] = ((const char*) 314),
+ [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_SUSPENDED] = ((const char*) 345),
+ [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_ABORTED] = ((const char*) 431),
+ [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_FATAL] = ((const char*) 515),
+ [SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_UNKNOWN] = ((const char*) 595)
};
/* %STRINGPOOLSTOP% */
@@ -1131,16 +1206,16 @@
/* %STRINGPOOLSTART% */
static const char* const map[] = {
- [SK_SMART_SELF_TEST_EXECUTION_STATUS_SUCCESS_OR_NEVER] = ((const char*) 555),
- [SK_SMART_SELF_TEST_EXECUTION_STATUS_ABORTED] = ((const char*) 645),
- [SK_SMART_SELF_TEST_EXECUTION_STATUS_INTERRUPTED] = ((const char*) 692),
- [SK_SMART_SELF_TEST_EXECUTION_STATUS_FATAL] = ((const char*) 777),
- [SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_UNKNOWN] = ((const char*) 936),
- [SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_ELECTRICAL] = ((const char*) 1037),
- [SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_SERVO] = ((const char*) 1120),
- [SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_READ] = ((const char*) 1217),
- [SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_HANDLING] = ((const char*) 1294),
- [SK_SMART_SELF_TEST_EXECUTION_STATUS_INPROGRESS] = ((const char*) 1416)
+ [SK_SMART_SELF_TEST_EXECUTION_STATUS_SUCCESS_OR_NEVER] = ((const char*) 610),
+ [SK_SMART_SELF_TEST_EXECUTION_STATUS_ABORTED] = ((const char*) 700),
+ [SK_SMART_SELF_TEST_EXECUTION_STATUS_INTERRUPTED] = ((const char*) 747),
+ [SK_SMART_SELF_TEST_EXECUTION_STATUS_FATAL] = ((const char*) 832),
+ [SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_UNKNOWN] = ((const char*) 991),
+ [SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_ELECTRICAL] = ((const char*) 1092),
+ [SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_SERVO] = ((const char*) 1175),
+ [SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_READ] = ((const char*) 1272),
+ [SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_HANDLING] = ((const char*) 1349),
+ [SK_SMART_SELF_TEST_EXECUTION_STATUS_INPROGRESS] = ((const char*) 1471)
};
/* %STRINGPOOLSTOP% */
@@ -1229,7 +1304,7 @@
else if (!strcmp(a->name, "temperature-centi-celsius"))
a->pretty_value = (fourtyeight & 0xFFFF)*100 + 273150;
else if (!strcmp(a->name, "power-on-minutes"))
- a->pretty_value = (((uint64_t) a->raw[0]) | (uint64_t) a->raw[1]) * 60 * 1000;
+ a->pretty_value = fourtyeight * 60 * 1000;
else if (!strcmp(a->name, "power-on-seconds"))
a->pretty_value = fourtyeight * 1000;
else if (!strcmp(a->name, "power-on-half-minutes"))
@@ -1237,98 +1312,161 @@
else if (!strcmp(a->name, "power-on-hours") ||
!strcmp(a->name, "loaded-hours") ||
!strcmp(a->name, "head-flying-hours"))
- a->pretty_value = fourtyeight * 60 * 60 * 1000;
- else if (!strcmp(a->name, "reallocated-sector-count"))
+ a->pretty_value = (fourtyeight & 0xFFFFFFFFU) * 60 * 60 * 1000;
+ else if (!strcmp(a->name, "reallocated-sector-count") ||
+ !strcmp(a->name, "current-pending-sector"))
a->pretty_value = fourtyeight & 0xFFFFFFFFU;
else
a->pretty_value = fourtyeight;
}
+typedef void (*SkSmartAttributeVerify)(SkDisk *d, SkSmartAttributeParsedData *a);
+
typedef struct SkSmartAttributeInfo {
const char *name;
SkSmartAttributeUnit unit;
+ SkSmartAttributeVerify verify;
} SkSmartAttributeInfo;
+
+static void verify_temperature(SkDisk *d, SkSmartAttributeParsedData *a) {
+ assert(a);
+ assert(a->pretty_unit == SK_SMART_ATTRIBUTE_UNIT_MKELVIN);
+
+ if (a->pretty_value < SK_MKELVIN_VALID_MIN ||
+ a->pretty_value > SK_MKELVIN_VALID_MAX) {
+ a->pretty_unit = SK_SMART_ATTRIBUTE_UNIT_UNKNOWN;
+ d->attribute_verification_bad = TRUE;
+ }
+}
+
+static void verify_short_time(SkDisk *d, SkSmartAttributeParsedData *a) {
+ assert(a);
+ assert(a->pretty_unit == SK_SMART_ATTRIBUTE_UNIT_MSECONDS);
+
+ if (a->pretty_value < SK_MSECOND_VALID_MIN ||
+ a->pretty_value > SK_MSECOND_VALID_SHORT_MAX) {
+ a->pretty_unit = SK_SMART_ATTRIBUTE_UNIT_UNKNOWN;
+ d->attribute_verification_bad = TRUE;
+ }
+}
+
+static void verify_long_time(SkDisk *d, SkSmartAttributeParsedData *a) {
+ assert(a);
+ assert(a->pretty_unit == SK_SMART_ATTRIBUTE_UNIT_MSECONDS);
+
+ if (a->pretty_value < SK_MSECOND_VALID_MIN ||
+ a->pretty_value > SK_MSECOND_VALID_LONG_MAX) {
+ a->pretty_unit = SK_SMART_ATTRIBUTE_UNIT_UNKNOWN;
+ d->attribute_verification_bad = TRUE;
+ }
+}
+
+static void verify_sectors(SkDisk *d, SkSmartAttributeParsedData *a) {
+ uint64_t max_sectors;
+
+ assert(d);
+ assert(a);
+ assert(a->pretty_unit == SK_SMART_ATTRIBUTE_UNIT_SECTORS);
+
+ max_sectors = d->size / 512ULL;
+
+ if (max_sectors > 0 && a->pretty_value > max_sectors) {
+ a->pretty_value = SK_SMART_ATTRIBUTE_UNIT_UNKNOWN;
+ d->attribute_verification_bad = TRUE;
+ } else {
+ if ((!strcmp(a->name, "reallocated-sector-count") ||
+ !strcmp(a->name, "current-pending-sector")) &&
+ a->pretty_value > 0)
+ a->warn = TRUE;
+ }
+}
/* This data is stolen from smartmontools */
/* %STRINGPOOLSTART% */
static const SkSmartAttributeInfo const attribute_info[256] = {
- [1] = { ((const char*) 1446), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [2] = { ((const char*) 1466), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
- [3] = { ((const char*) 1489), SK_SMART_ATTRIBUTE_UNIT_MSECONDS },
- [4] = { ((const char*) 1502), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [5] = { ((const char*) 1519), SK_SMART_ATTRIBUTE_UNIT_SECTORS },
- [6] = { ((const char*) 1544), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
- [7] = { ((const char*) 1564), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [8] = { ((const char*) 1580), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
- [9] = { ((const char*) 1602), SK_SMART_ATTRIBUTE_UNIT_MSECONDS },
- [10] = { ((const char*) 1617), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [11] = { ((const char*) 1634), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [12] = { ((const char*) 1658), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [13] = { ((const char*) 1676), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [187] = { ((const char*) 1697), SK_SMART_ATTRIBUTE_UNIT_SECTORS },
- [189] = { ((const char*) 1716), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [190] = { ((const char*) 1732), SK_SMART_ATTRIBUTE_UNIT_MKELVIN },
- [191] = { ((const char*) 1760), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [192] = { ((const char*) 1779), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [193] = { ((const char*) 1803), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [194] = { ((const char*) 1820), SK_SMART_ATTRIBUTE_UNIT_MKELVIN },
- [195] = { ((const char*) 1842), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [196] = { ((const char*) 1865), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [197] = { ((const char*) 1889), SK_SMART_ATTRIBUTE_UNIT_SECTORS },
- [198] = { ((const char*) 1912), SK_SMART_ATTRIBUTE_UNIT_SECTORS },
- [199] = { ((const char*) 1934), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [200] = { ((const char*) 1955), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [201] = { ((const char*) 1977), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [202] = { ((const char*) 1998), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [203] = { ((const char*) 2016), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
- [204] = { ((const char*) 2031), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [205] = { ((const char*) 2054), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [206] = { ((const char*) 2076), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
- [207] = { ((const char*) 2090), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
- [208] = { ((const char*) 2108), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN},
- [209] = { ((const char*) 2118), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
- [220] = { ((const char*) 2143), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
- [221] = { ((const char*) 2154), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [222] = { ((const char*) 2175), SK_SMART_ATTRIBUTE_UNIT_MSECONDS },
- [223] = { ((const char*) 2188), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [224] = { ((const char*) 2205), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
- [225] = { ((const char*) 2219), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [226] = { ((const char*) 2238), SK_SMART_ATTRIBUTE_UNIT_MSECONDS },
- [227] = { ((const char*) 2251), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [228] = { ((const char*) 2266), SK_SMART_ATTRIBUTE_UNIT_NONE },
- [230] = { ((const char*) 2292), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
- [231] = { ((const char*) 1740), SK_SMART_ATTRIBUTE_UNIT_MKELVIN },
- [240] = { ((const char*) 2307), SK_SMART_ATTRIBUTE_UNIT_MSECONDS },
- [250] = { ((const char*) 2325), SK_SMART_ATTRIBUTE_UNIT_NONE }
+ [1] = { ((const char*) 1501), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [2] = { ((const char*) 1521), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [3] = { ((const char*) 1544), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_short_time },
+ [4] = { ((const char*) 1557), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [5] = { ((const char*) 1574), SK_SMART_ATTRIBUTE_UNIT_SECTORS, verify_sectors },
+ [6] = { ((const char*) 1599), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [7] = { ((const char*) 1619), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [8] = { ((const char*) 1635), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [9] = { ((const char*) 1657), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time },
+ [10] = { ((const char*) 1672), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [11] = { ((const char*) 1689), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [12] = { ((const char*) 1713), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [13] = { ((const char*) 1731), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [187] = { ((const char*) 1752), SK_SMART_ATTRIBUTE_UNIT_SECTORS, verify_sectors },
+ [189] = { ((const char*) 1771), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [190] = { ((const char*) 1787), SK_SMART_ATTRIBUTE_UNIT_MKELVIN, verify_temperature },
+ [191] = { ((const char*) 1815), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [192] = { ((const char*) 1834), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [193] = { ((const char*) 1858), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [194] = { ((const char*) 1875), SK_SMART_ATTRIBUTE_UNIT_MKELVIN, verify_temperature },
+ [195] = { ((const char*) 1897), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [196] = { ((const char*) 1920), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [197] = { ((const char*) 1944), SK_SMART_ATTRIBUTE_UNIT_SECTORS, verify_sectors },
+ [198] = { ((const char*) 1967), SK_SMART_ATTRIBUTE_UNIT_SECTORS, verify_sectors },
+ [199] = { ((const char*) 1989), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [200] = { ((const char*) 2010), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [201] = { ((const char*) 2032), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [202] = { ((const char*) 2053), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [203] = { ((const char*) 2071), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [204] = { ((const char*) 2086), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [205] = { ((const char*) 2109), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [206] = { ((const char*) 2131), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [207] = { ((const char*) 2145), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [208] = { ((const char*) 2163), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [209] = { ((const char*) 2173), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [220] = { ((const char*) 2198), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [221] = { ((const char*) 2209), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [222] = { ((const char*) 2230), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time },
+ [223] = { ((const char*) 2243), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [224] = { ((const char*) 2260), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [225] = { ((const char*) 2274), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [226] = { ((const char*) 2293), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_short_time },
+ [227] = { ((const char*) 2306), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [228] = { ((const char*) 2321), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
+ [230] = { ((const char*) 2347), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
+ [231] = { ((const char*) 1795), SK_SMART_ATTRIBUTE_UNIT_MKELVIN, verify_temperature },
+ [240] = { ((const char*) 2362), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time },
+ [250] = { ((const char*) 2380), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL }
};
/* %STRINGPOOLSTOP% */
typedef enum SkSmartQuirk {
- SK_SMART_QUIRK_9_POWERONMINUTES = 1,
- SK_SMART_QUIRK_9_POWERONSECONDS = 2,
- SK_SMART_QUIRK_9_POWERONHALFMINUTES = 4,
- SK_SMART_QUIRK_192_EMERGENCYRETRACTCYCLECT = 8,
- SK_SMART_QUIRK_193_LOADUNLOAD = 16,
- SK_SMART_QUIRK_194_10XCELSIUS = 32,
- SK_SMART_QUIRK_194_UNKNOWN = 64,
- SK_SMART_QUIRK_200_WRITEERRORCOUNT = 128,
- SK_SMART_QUIRK_201_DETECTEDTACOUNT = 256,
- SK_SMART_QUIRK_9_UNKNOWN = 512
+ SK_SMART_QUIRK_9_POWERONMINUTES = 0x0001,
+ SK_SMART_QUIRK_9_POWERONSECONDS = 0x0002,
+ SK_SMART_QUIRK_9_POWERONHALFMINUTES = 0x0004,
+ SK_SMART_QUIRK_192_EMERGENCYRETRACTCYCLECT = 0x0008,
+ SK_SMART_QUIRK_193_LOADUNLOAD = 0x0010,
+ SK_SMART_QUIRK_194_10XCELSIUS = 0x0020,
+ SK_SMART_QUIRK_194_UNKNOWN = 0x0040,
+ SK_SMART_QUIRK_200_WRITEERRORCOUNT = 0x0080,
+ SK_SMART_QUIRK_201_DETECTEDTACOUNT = 0x0100,
+ SK_SMART_QUIRK_5_UNKNOWN = 0x0200,
+ SK_SMART_QUIRK_9_UNKNOWN = 0x0400,
+ SK_SMART_QUIRK_197_UNKNOWN = 0x0800,
+ SK_SMART_QUIRK_198_UNKNOWN = 0x1000,
} SkSmartQuirk;
/* %STRINGPOOLSTART% */
static const char *quirk_name[] = {
- ((const char*) 2347),
- ((const char*) 2364),
- ((const char*) 2381),
((const char*) 2402),
- ((const char*) 2430),
- ((const char*) 2445),
- ((const char*) 2460),
- ((const char*) 2472),
- ((const char*) 2492),
- ((const char*) 2512),
+ ((const char*) 2419),
+ ((const char*) 2436),
+ ((const char*) 2457),
+ ((const char*) 2485),
+ ((const char*) 2500),
+ ((const char*) 2515),
+ ((const char*) 2527),
+ ((const char*) 2547),
+ ((const char*) 2567),
+ ((const char*) 2577),
+ ((const char*) 2587),
+ ((const char*) 2599),
NULL
};
/* %STRINGPOOLSTOP% */
@@ -1341,13 +1479,16 @@
static const SkSmartQuirkDatabase quirk_database[] = { {
- /*** Seagate */
- "^ST9160821AS$",
- NULL,
- SK_SMART_QUIRK_9_UNKNOWN
+ /*** Fujitsu */
+ "^("
+ "FUJITSU MHY2120BH|"
+ "FUJITSU MHY2250BH"
+ ")$",
+ "^0085000B$", /* seems to be specific to this firmware */
+ SK_SMART_QUIRK_9_POWERONMINUTES|
+ SK_SMART_QUIRK_197_UNKNOWN|
+ SK_SMART_QUIRK_198_UNKNOWN
}, {
-
- /*** Fujitsu */
"^FUJITSU MHR2040AT$",
NULL,
SK_SMART_QUIRK_9_POWERONSECONDS|
@@ -1466,7 +1607,10 @@
SK_SMART_QUIRK_9_POWERONMINUTES|
SK_SMART_QUIRK_193_LOADUNLOAD
}, {
-
+ "^HTS541010G9SA00$",
+ "^MBZOC60P$",
+ SK_SMART_QUIRK_5_UNKNOWN
+ }, {
NULL,
NULL,
0
@@ -1549,23 +1693,29 @@
if (quirk) {
switch (id) {
+ case 5:
+ if (quirk & SK_SMART_QUIRK_5_UNKNOWN)
+ return NULL;
+
+ break;
+
case 9:
/* %STRINGPOOLSTART% */
if (quirk & SK_SMART_QUIRK_9_POWERONMINUTES) {
static const SkSmartAttributeInfo a = {
- ((const char*) 2522), SK_SMART_ATTRIBUTE_UNIT_MSECONDS
+ ((const char*) 2611), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time
};
return &a;
} else if (quirk & SK_SMART_QUIRK_9_POWERONSECONDS) {
static const SkSmartAttributeInfo a = {
- ((const char*) 2539), SK_SMART_ATTRIBUTE_UNIT_MSECONDS
+ ((const char*) 2628), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time
};
return &a;
} else if (quirk & SK_SMART_QUIRK_9_POWERONHALFMINUTES) {
static const SkSmartAttributeInfo a = {
- ((const char*) 2556), SK_SMART_ATTRIBUTE_UNIT_MSECONDS
+ ((const char*) 2645), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time
};
return &a;
} else if (quirk & SK_SMART_QUIRK_9_UNKNOWN)
@@ -1578,7 +1728,7 @@
/* %STRINGPOOLSTART% */
if (quirk & SK_SMART_QUIRK_192_EMERGENCYRETRACTCYCLECT) {
static const SkSmartAttributeInfo a = {
- ((const char*) 2578), SK_SMART_ATTRIBUTE_UNIT_NONE
+ ((const char*) 2667), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL
};
return &a;
}
@@ -1590,7 +1740,7 @@
/* %STRINGPOOLSTART% */
if (quirk & SK_SMART_QUIRK_194_10XCELSIUS) {
static const SkSmartAttributeInfo a = {
- ((const char*) 2608), SK_SMART_ATTRIBUTE_UNIT_MKELVIN
+ ((const char*) 2697), SK_SMART_ATTRIBUTE_UNIT_MKELVIN, verify_temperature
};
return &a;
} else if (quirk & SK_SMART_QUIRK_194_UNKNOWN)
@@ -1599,11 +1749,23 @@
break;
+ case 197:
+ if (quirk & SK_SMART_QUIRK_197_UNKNOWN)
+ return NULL;
+
+ break;
+
+ case 198:
+ if (quirk & SK_SMART_QUIRK_198_UNKNOWN)
+ return NULL;
+
+ break;
+
case 200:
/* %STRINGPOOLSTART% */
if (quirk & SK_SMART_QUIRK_200_WRITEERRORCOUNT) {
static const SkSmartAttributeInfo a = {
- ((const char*) 2634), SK_SMART_ATTRIBUTE_UNIT_NONE
+ ((const char*) 2723), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL
};
return &a;
}
@@ -1615,7 +1777,7 @@
/* %STRINGPOOLSTART% */
if (quirk & SK_SMART_QUIRK_201_DETECTEDTACOUNT) {
static const SkSmartAttributeInfo a = {
- ((const char*) 2652), SK_SMART_ATTRIBUTE_UNIT_NONE
+ ((const char*) 2741), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL
};
return &a;
}
@@ -1697,41 +1859,50 @@
uint8_t *p;
unsigned n;
- if (!d->smart_thresholds_valid) {
- a->threshold_valid = FALSE;
- return;
- }
+ if (!d->smart_thresholds_valid)
+ goto fail;
for (n = 0, p = d->smart_thresholds+2; n < 30; n++, p+=12)
if (p[0] == a->id)
break;
- if (n >= 30) {
- a->threshold_valid = FALSE;
- a->good_valid = FALSE;
- return;
- }
+ if (n >= 30)
+ goto fail;
a->threshold = p[1];
a->threshold_valid = p[1] != 0xFE;
- a->good_valid = FALSE;
- a->good = TRUE;
+ a->good_now_valid = FALSE;
+ a->good_now = TRUE;
+ a->good_in_the_past_valid = FALSE;
+ a->good_in_the_past = TRUE;
/* Always-Fail and Always-Passing thresholds are not relevant
* for our assessment. */
if (p[1] >= 1 && p[1] <= 0xFD) {
if (a->worst_value_valid) {
- a->good = a->good && (a->worst_value > a->threshold);
- a->good_valid = TRUE;
+ a->good_in_the_past = a->good_in_the_past && (a->worst_value > a->threshold);
+ a->good_in_the_past_valid = TRUE;
}
if (a->current_value_valid) {
- a->good = a->good && (a->current_value > a->threshold);
- a->good_valid = TRUE;
+ a->good_now = a->good_now && (a->current_value > a->threshold);
+ a->good_now_valid = TRUE;
}
}
+
+ a->warn =
+ (a->good_now_valid && !a->good_now) ||
+ (a->good_in_the_past_valid && !a->good_in_the_past);
+
+ return;
+
+fail:
+ a->threshold_valid = FALSE;
+ a->good_now_valid = FALSE;
+ a->good_in_the_past_valid = FALSE;
+ a->warn = FALSE;
}
int sk_disk_smart_parse_attributes(SkDisk *d, SkSmartAttributeParseCallback cb, void* userdata) {
@@ -1781,14 +1952,8 @@
find_threshold(d, &a);
- /* Handle a few fields specially */
- if ((!strcmp(a.name, "reallocated-sector-count") ||
- !strcmp(a.name, "current-pending-sector")) &&
- a.pretty_unit == SK_SMART_ATTRIBUTE_UNIT_SECTORS &&
- a.pretty_value > 0) {
- a.good = FALSE;
- a.good_valid = TRUE;
- }
+ if (i && i->verify)
+ i->verify(d, &a);
cb(d, &a, userdata);
free(an);
@@ -1807,9 +1972,9 @@
const char * const map[] = {
[SK_SMART_ATTRIBUTE_UNIT_UNKNOWN] = NULL,
[SK_SMART_ATTRIBUTE_UNIT_NONE] = ((const char*) 30),
- [SK_SMART_ATTRIBUTE_UNIT_MSECONDS] = ((const char*) 2670),
- [SK_SMART_ATTRIBUTE_UNIT_SECTORS] = ((const char*) 2673),
- [SK_SMART_ATTRIBUTE_UNIT_MKELVIN] = ((const char*) 2681)
+ [SK_SMART_ATTRIBUTE_UNIT_MSECONDS] = ((const char*) 2759),
+ [SK_SMART_ATTRIBUTE_UNIT_SECTORS] = ((const char*) 2762),
+ [SK_SMART_ATTRIBUTE_UNIT_MKELVIN] = ((const char*) 2770)
};
/* %STRINGPOOLSTOP% */
@@ -1998,10 +2163,12 @@
/* %STRINGPOOLSTART% */
const char * const map[] = {
- [SK_SMART_OVERALL_GOOD] = ((const char*) 2684),
- [SK_SMART_OVERALL_BAD_STATUS] = ((const char*) 2689),
- [SK_SMART_OVERALL_BAD_ATTRIBUTE] = ((const char*) 2700),
- [SK_SMART_OVERALL_BAD_SECTOR] = ((const char*) 2714)
+ [SK_SMART_OVERALL_GOOD] = ((const char*) 2773),
+ [SK_SMART_OVERALL_BAD_ATTRIBUTE_IN_THE_PAST] = ((const char*) 2778),
+ [SK_SMART_OVERALL_BAD_SECTOR] = ((const char*) 2804),
+ [SK_SMART_OVERALL_BAD_ATTRIBUTE_NOW] = ((const char*) 2815),
+ [SK_SMART_OVERALL_BAD_SECTOR_MANY] = ((const char*) 2833),
+ [SK_SMART_OVERALL_BAD_STATUS] = ((const char*) 2849),
};
/* %STRINGPOOLSTOP% */
@@ -2011,18 +2178,39 @@
return _P(map[overall]);
}
-static void bad_attribute_cb(SkDisk *d, const SkSmartAttributeParsedData *a, SkBool *good) {
- if (a->prefailure && a->good_valid && !a->good)
+static void bad_attribute_now_cb(SkDisk *d, const SkSmartAttributeParsedData *a, SkBool *good) {
+ if (a->prefailure && a->good_now_valid && !a->good_now)
*good = FALSE;
+}
+
+static void bad_attribute_in_the_past_cb(SkDisk *d, const SkSmartAttributeParsedData *a, SkBool *good) {
+ if (a->prefailure && a->good_in_the_past_valid && !a->good_in_the_past)
+ *good = FALSE;
+}
+
+static uint64_t u64log2(uint64_t n) {
+ unsigned r;
+
+ if (n <= 1)
+ return 0;
+
+ r = 0;
+ for (;;) {
+ n = n >> 1;
+ if (!n)
+ return r;
+ r++;
+ }
}
int sk_disk_smart_get_overall(SkDisk *d, SkSmartOverall *overall) {
SkBool good;
- uint64_t sectors;
+ uint64_t sectors, sector_threshold;
assert(d);
assert(overall);
+ /* First, check SMART self-assesment */
if (sk_disk_smart_status(d, &good) < 0)
return -1;
@@ -2031,23 +2219,51 @@
return 0;
}
+ /* Second, check if the number of bad sectors is greater than
+ * a certain threshold */
if (sk_disk_smart_get_bad(d, §ors) < 0) {
if (errno != ENOENT)
return -1;
- } else if (sectors > 0) {
+ sectors = 0;
+ } else {
+
+ /* We use log2(n_sectors) as a threshold here. We had to pick
+ * something, and this makes a bit of sense, or doesn't it? */
+ sector_threshold = u64log2(d->size/512);
+
+ if (sectors >= sector_threshold) {
+ *overall = SK_SMART_OVERALL_BAD_SECTOR_MANY;
+ return 0;
+ }
+ }
+
+ /* Third, check if any of the SMART attributes is bad */
+ good = TRUE;
+ if (sk_disk_smart_parse_attributes(d, (SkSmartAttributeParseCallback) bad_attribute_now_cb, &good) < 0)
+ return -1;
+
+ if (!good) {
+ *overall = SK_SMART_OVERALL_BAD_ATTRIBUTE_NOW;
+ return 0;
+ }
+
+ /* Fourth, check if there are any bad sectors at all */
+ if (sectors > 0) {
*overall = SK_SMART_OVERALL_BAD_SECTOR;
return 0;
}
+ /* Fifth, check if any of the SMART attributes ever was bad */
good = TRUE;
- if (sk_disk_smart_parse_attributes(d, (SkSmartAttributeParseCallback) bad_attribute_cb, &good) < 0)
+ if (sk_disk_smart_parse_attributes(d, (SkSmartAttributeParseCallback) bad_attribute_in_the_past_cb, &good) < 0)
return -1;
if (!good) {
- *overall = SK_SMART_OVERALL_BAD_ATTRIBUTE;
+ *overall = SK_SMART_OVERALL_BAD_ATTRIBUTE_IN_THE_PAST;
return 0;
}
+ /* Sixth, there's really nothing to complain about, so give it a pass */
*overall = SK_SMART_OVERALL_GOOD;
return 0;
}
@@ -2127,12 +2343,12 @@
snprintf(tc, sizeof(tc), "%3u", a->current_value);
tc[sizeof(tc)-1] = 0;
- highlight = a->good_valid && !a->good && isatty(1);
+ highlight = a->warn && isatty(1);
if (highlight)
fprintf(stderr, HIGHLIGHT);
- printf("%3u %-27s %-3s %-3s %-3s %-11s 0x%02x%02x%02x%02x%02x%02x %-7s %-7s %-3s\n",
+ printf("%3u %-27s %-3s %-3s %-3s %-11s 0x%02x%02x%02x%02x%02x%02x %-7s %-7s %-4s %-4s\n",
a->id,
print_name(name, sizeof(name), a->id, a->name),
a->current_value_valid ? tc : "n/a",
@@ -2142,7 +2358,8 @@
a->raw[0], a->raw[1], a->raw[2], a->raw[3], a->raw[4], a->raw[5],
a->prefailure ? "prefail" : "old-age",
a->online ? "online" : "offline",
- a->good_valid ? yes_no(a->good) : "n/a");
+ a->good_now_valid ? yes_no(a->good_now) : "n/a",
+ a->good_in_the_past_valid ? yes_no(a->good_in_the_past) : "n/a");
if (highlight)
fprintf(stderr, ENDHIGHLIGHT);
@@ -2155,10 +2372,12 @@
assert(d);
- printf("Device: %s\n"
+ printf("Device: %s%s%s\n"
"Type: %s\n",
+ d->name ? disk_type_to_prefix_string(d->type) : "",
+ d->name ? ":" : "",
d->name ? d->name : "n/a",
- disk_type_to_string(d->type));
+ disk_type_to_human_string(d->type));
ret = sk_disk_get_size(d, &size);
if (ret >= 0)
@@ -2193,7 +2412,6 @@
printf(" %s", _P(quirk_name[i]));
printf("\n");
-
}
ret = sk_disk_check_sleep_mode(d, &awake);
@@ -2208,9 +2426,10 @@
uint64_t value, power_on;
ret = sk_disk_smart_status(d, &good);
- printf("SMART Disk Health Good: %s\n",
- ret >= 0 ? yes_no(good) : strerror(errno));
-
+ printf("%sSMART Disk Health Good: %s%s\n",
+ ret >= 0 && !good ? HIGHLIGHT : "",
+ ret >= 0 ? yes_no(good) : strerror(errno),
+ ret >= 0 && !good ? ENDHIGHLIGHT : "");
if ((ret = sk_disk_smart_read_data(d)) < 0)
return ret;
@@ -2268,6 +2487,9 @@
else
printf("Temperature: %s\n", print_value(pretty, sizeof(pretty), value, SK_SMART_ATTRIBUTE_UNIT_MKELVIN));
+ printf("Attribute Parsing Verification: %s\n",
+ d->attribute_verification_bad ? "Bad" : "Good");
+
if (sk_disk_smart_get_overall(d, &overall) < 0)
printf("Overall Status: %s\n", strerror(errno));
else
@@ -2276,7 +2498,7 @@
sk_smart_overall_to_string(overall),
overall != SK_SMART_OVERALL_GOOD ? ENDHIGHLIGHT : "");
- printf("%3s %-27s %5s %5s %5s %-11s %-14s %-7s %-7s %-3s\n",
+ printf("%3s %-27s %5s %5s %5s %-11s %-14s %-7s %-7s %-4s %-4s\n",
"ID#",
"Name",
"Value",
@@ -2286,7 +2508,8 @@
"Raw",
"Type",
"Updates",
- "Good");
+ "Good",
+ "Good/Past");
if ((ret = sk_disk_smart_parse_attributes(d, disk_dump_attributes, NULL)) < 0)
return ret;
@@ -2313,6 +2536,7 @@
struct udev *udev;
struct udev_device *dev = NULL, *usb;
int r = -1;
+ const char *a;
assert(d);
@@ -2323,6 +2547,27 @@
if (!(dev = udev_device_new_from_devnum(udev, 'b', devnum))) {
errno = ENODEV;
+ goto finish;
+ }
+
+ if ((a = udev_device_get_property_value(dev, "ID_ATA_SMART_ACCESS"))) {
+ unsigned u;
+
+ for (u = 0; u < _SK_DISK_TYPE_MAX; u++) {
+ const char *t;
+
+ if (!(t = disk_type_to_prefix_string(u)))
+ continue;
+
+ if (!strcmp(a, t)) {
+ d->type = u;
+ r = 0;
+ goto finish;
+ }
+ }
+
+ d->type = SK_DISK_TYPE_NONE;
+ r = 0;
goto finish;
}
@@ -2343,9 +2588,10 @@
}
if ((vid == 0x0c0b && pid == 0xb159) ||
- (vid == 0x04fc && pid == 0x0c25))
+ (vid == 0x04fc && pid == 0x0c25) ||
+ (vid == 0x04fc && pid == 0x0c15))
d->type = SK_DISK_TYPE_SUNPLUS;
- if ((vid == 0x152d && pid == 0x2329) ||
+ else if ((vid == 0x152d && pid == 0x2329) ||
(vid == 0x152d && pid == 0x2336) ||
(vid == 0x152d && pid == 0x2338) ||
(vid == 0x152d && pid == 0x2339))
@@ -2354,11 +2600,11 @@
d->type = SK_DISK_TYPE_ATA_PASSTHROUGH_12;
} else if (udev_device_get_parent_with_subsystem_devtype(dev, "ide", NULL))
- d->type = SK_DISK_TYPE_ATA;
+ d->type = SK_DISK_TYPE_LINUX_IDE;
else if (udev_device_get_parent_with_subsystem_devtype(dev, "scsi", NULL))
d->type = SK_DISK_TYPE_ATA_PASSTHROUGH_16;
else
- d->type = SK_DISK_TYPE_UNKNOWN;
+ d->type = SK_DISK_TYPE_AUTO;
r = 0;
@@ -2384,18 +2630,25 @@
goto fail;
}
- if (!name) {
- d->fd = -1;
+ d->fd = -1;
+ d->size = (uint64_t) -1;
+
+ if (!name)
d->type = SK_DISK_TYPE_BLOB;
- d->size = (uint64_t) -1;
- } else {
-
- if (!(d->name = strdup(name))) {
+ else {
+ const char *dn;
+
+ d->type = SK_DISK_TYPE_AUTO;
+
+ if (!(dn = disk_type_from_string(name, &d->type)))
+ dn = name;
+
+ if (!(d->name = strdup(dn))) {
errno = ENOMEM;
goto fail;
}
- if ((d->fd = open(name,
+ if ((d->fd = open(d->name,
O_RDONLY|O_NOCTTY|O_NONBLOCK
#ifdef O_CLOEXEC
|O_CLOEXEC
@@ -2426,16 +2679,17 @@
}
/* OK, it's a real block device with a size. Now let's find the suitable API */
- if ((ret = disk_find_type(d, st.st_rdev)) < 0)
- goto fail;
-
- if (d->type == SK_DISK_TYPE_UNKNOWN) {
+ if (d->type == SK_DISK_TYPE_AUTO)
+ if ((ret = disk_find_type(d, st.st_rdev)) < 0)
+ goto fail;
+
+ if (d->type == SK_DISK_TYPE_AUTO) {
/* We have no clue, so let's autotest for a working API */
for (d->type = 0; d->type < _SK_DISK_TYPE_TEST_MAX; d->type++)
if (disk_identify_device(d) >= 0)
break;
if (d->type >= _SK_DISK_TYPE_TEST_MAX)
- d->type = SK_DISK_TYPE_UNKNOWN;
+ d->type = SK_DISK_TYPE_NONE;
} else
disk_identify_device(d);
diff --git a/blob-examples/FUJITSU_MHY2120BH--0085000B b/blob-examples/FUJITSU_MHY2120BH--0085000B
new file mode 100644
index 0000000..8db8d6e
Binary files /dev/null and b/blob-examples/FUJITSU_MHY2120BH--0085000B differ
diff --git a/bootstrap.sh b/bootstrap.sh
index e227225..918814d 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -18,7 +18,7 @@
# License along with libatasmart. If not, If not, see
# .
-VERSION=1.9
+VERSION=1.11
run_versioned() {
local P
@@ -55,8 +55,8 @@
mkdir -p m4
"$LIBTOOLIZE" -c --force
run_versioned aclocal "$VERSION"
- run_versioned autoconf 2.59 -Wall
- run_versioned autoheader 2.59
+ run_versioned autoconf 2.63 -Wall
+ run_versioned autoheader 2.63
run_versioned automake "$VERSION" --copy --foreign --add-missing
if test "x$NOCONFIGURE" = "x"; then
diff --git a/configure b/configure
index 2e1919c..01032cf 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for libatasmart 0.13.
+# Generated by GNU Autoconf 2.63 for libatasmart 0.14.
#
# Report bugs to .
#
@@ -745,8 +745,8 @@
# Identity of this package.
PACKAGE_NAME='libatasmart'
PACKAGE_TARNAME='libatasmart'
-PACKAGE_VERSION='0.13'
-PACKAGE_STRING='libatasmart 0.13'
+PACKAGE_VERSION='0.14'
+PACKAGE_STRING='libatasmart 0.14'
PACKAGE_BUGREPORT='mzyvongnfzneg (at) 0pointer (dot) net'
ac_unique_file="atasmart.c"
@@ -786,7 +786,9 @@
# include
#endif"
-ac_subst_vars='LTLIBOBJS
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
LIBOBJS
LIBUDEV_LIBS
LIBUDEV_CFLAGS
@@ -844,6 +846,8 @@
build
LIBATASMART_VERSION_INFO
PACKAGE_URL
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
am__untar
am__tar
AMTAR
@@ -907,6 +911,7 @@
ac_subst_files=''
ac_user_opts='
enable_option_checking
+enable_silent_rules
enable_dependency_tracking
enable_shared
enable_static
@@ -1484,7 +1489,7 @@
# 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 libatasmart 0.13 to adapt to many kinds of systems.
+\`configure' configures libatasmart 0.14 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1554,7 +1559,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libatasmart 0.13:";;
+ short | recursive ) echo "Configuration of libatasmart 0.14:";;
esac
cat <<\_ACEOF
@@ -1562,6 +1567,8 @@
--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')
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--enable-shared[=PKGS] build shared libraries [default=yes]
@@ -1662,7 +1669,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libatasmart configure 0.13
+libatasmart configure 0.14
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1676,7 +1683,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libatasmart $as_me 0.13, which was
+It was created by libatasmart $as_me 0.14, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -2049,7 +2056,7 @@
-am__api_version='1.10'
+am__api_version='1.11'
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -2180,16 +2187,33 @@
# Just in case
sleep 1
echo timestamp > conftest.file
+# 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_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5
+$as_echo "$as_me: error: unsafe absolute working directory name" >&2;}
+ { (exit 1); exit 1; }; };;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5
+$as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;}
+ { (exit 1); exit 1; }; };;
+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 (
- set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ 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`
+ set X `ls -t "$srcdir/configure" conftest.file`
fi
rm -f conftest.file
if test "$*" != "X $srcdir/configure conftest.file" \
@@ -2233,7 +2257,14 @@
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+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 --run true"; then
am_missing_run="$MISSING --run "
@@ -2242,6 +2273,115 @@
{ $as_echo "$as_me:$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}" != 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:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:$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:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:$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:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:$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:$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:$LINENO: checking for a thread-safe mkdir -p" >&5
$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
@@ -2373,6 +2513,18 @@
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_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."
@@ -2397,7 +2549,7 @@
# Define the identity of the package.
PACKAGE='libatasmart'
- VERSION='0.13'
+ VERSION='0.14'
cat >>confdefs.h <<_ACEOF
@@ -2424,108 +2576,6 @@
MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
-
-# 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:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:$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:$LINENO: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
- { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:$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:$LINENO: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
- { $as_echo "$as_me:$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:$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"
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
@@ -2533,17 +2583,98 @@
AMTAR=${AMTAR-"${am_missing_run}tar"}
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
-
-
-
-
-
-
-PACKAGE_URL=https://http://git.0pointer.de/?p=libatasmart.git
-
-
-LIBATASMART_VERSION_INFO=3:3:3
+
+{ $as_echo "$as_me:$LINENO: checking how to create a pax tar archive" >&5
+$as_echo_n "checking how to create a pax tar archive... " >&6; }
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar pax cpio none'
+_am_tools=${am_cv_prog_tar_pax-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ { echo "$as_me:$LINENO: $_am_tar --version" >&5
+ ($_am_tar --version) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && break
+ done
+ am__tar="$_am_tar --format=posix -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=posix -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 pax -w "$$tardir"'
+ am__tar_='pax -L -x pax -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H pax -L'
+ am__tar_='find "$tardir" -print | cpio -o -H pax -L'
+ am__untar='cpio -i -H pax -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_pax}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5
+ (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ { echo "$as_me:$LINENO: $am__untar &5
+ ($am__untar &5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+if test "${am_cv_prog_tar_pax+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ am_cv_prog_tar_pax=$_am_tool
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $am_cv_prog_tar_pax" >&5
+$as_echo "$am_cv_prog_tar_pax" >&6; }
+
+
+
+
+
+
+PACKAGE_URL=http://git.0pointer.de/?p=libatasmart.git
+
+
+LIBATASMART_VERSION_INFO=4:0:0
# Make sure we can run config.sub.
@@ -3580,7 +3711,7 @@
am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
- @echo done
+ @echo this is the am__doit target
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
@@ -3591,24 +3722,24 @@
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
- am__include=include
- am__quote=
- _am_result=GNU
-fi
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
- am__include=.include
- am__quote="\""
- _am_result=BSD
- fi
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
fi
@@ -3665,6 +3796,11 @@
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
@@ -3682,7 +3818,17 @@
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
@@ -3692,19 +3838,23 @@
break
fi
;;
+ 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
- # 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.
if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ $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 sub/conftest.${OBJEXT-o} 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
@@ -5187,6 +5337,11 @@
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
@@ -5204,7 +5359,17 @@
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
@@ -5214,19 +5379,23 @@
break
fi
;;
+ 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
- # 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.
if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ $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 sub/conftest.${OBJEXT-o} 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
@@ -5787,13 +5956,13 @@
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:5790: $ac_compile\"" >&5)
+ (eval echo "\"\$as_me:5959: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
- (eval echo "\"\$as_me:5793: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval echo "\"\$as_me:5962: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
- (eval echo "\"\$as_me:5796: output\"" >&5)
+ (eval echo "\"\$as_me:5965: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@@ -6998,7 +7167,7 @@
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 7001 "configure"' > conftest.$ac_ext
+ echo '#line 7170 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -8269,6 +8438,11 @@
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
@@ -8286,7 +8460,17 @@
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
@@ -8296,19 +8480,23 @@
break
fi
;;
+ 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
- # 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.
if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ $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 sub/conftest.${OBJEXT-o} 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
@@ -9082,11 +9270,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:9085: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:9273: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:9089: \$? = $ac_status" >&5
+ echo "$as_me:9277: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -9421,11 +9609,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:9424: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:9612: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:9428: \$? = $ac_status" >&5
+ echo "$as_me:9616: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -9526,11 +9714,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:9529: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:9717: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:9533: \$? = $ac_status" >&5
+ echo "$as_me:9721: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -9581,11 +9769,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:9584: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:9772: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:9588: \$? = $ac_status" >&5
+ echo "$as_me:9776: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -12384,7 +12572,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12387 "configure"
+#line 12575 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12480,7 +12668,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12483 "configure"
+#line 12671 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -14500,11 +14688,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14503: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14691: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14507: \$? = $ac_status" >&5
+ echo "$as_me:14695: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -14599,11 +14787,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14602: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14790: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14606: \$? = $ac_status" >&5
+ echo "$as_me:14794: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -14651,11 +14839,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14654: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14842: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14658: \$? = $ac_status" >&5
+ echo "$as_me:14846: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -18004,6 +18192,14 @@
LTLIBOBJS=$ac_ltlibobjs
+ if test -n "$EXEEXT"; then
+ am__EXEEXT_TRUE=
+ am__EXEEXT_FALSE='#'
+else
+ am__EXEEXT_TRUE='#'
+ am__EXEEXT_FALSE=
+fi
+
if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
{ { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
@@ -18355,7 +18551,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libatasmart $as_me 0.13, which was
+This file was extended by libatasmart $as_me 0.14, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -18418,7 +18614,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-libatasmart config.status 0.13
+libatasmart config.status 0.14
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
@@ -19552,27 +19748,28 @@
case $ac_file$ac_mode in
- "depfiles":C) test x"$AMDEP_TRUE" != x"" || # Autoconf 2.62 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.
-case $CONFIG_FILES in
-*\'*) eval set x "$CONFIG_FILES" ;;
-*) set x $CONFIG_FILES ;;
-esac
-shift
-for mf
-do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`$as_dirname -- "$mf" ||
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Autoconf 2.62 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.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$mf" : 'X\(//\)[^/]' \| \
X"$mf" : 'X\(//\)$' \| \
@@ -19595,28 +19792,28 @@
q
}
s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`$as_dirname -- "$file" ||
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$file" : 'X\(//\)[^/]' \| \
X"$file" : 'X\(//\)$' \| \
@@ -19639,7 +19836,7 @@
q
}
s/.*/./; q'`
- { as_dir=$dirpart/$fdir
+ { as_dir=$dirpart/$fdir
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
@@ -19680,10 +19877,11 @@
} || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
{ (exit 1); exit 1; }; }; }
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
done
-done
+}
;;
"libtool":C)
diff --git a/configure.ac b/configure.ac
index 74c70c3..f2a2ca4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,18 +19,18 @@
# License along with libatasmart. If not, If not, see
# .
-AC_PREREQ(2.57)
+AC_PREREQ(2.63)
-AC_INIT([libatasmart], 0.13, [mzyvongnfzneg (at) 0pointer (dot) net])
+AC_INIT([libatasmart], 0.14, [mzyvongnfzneg (at) 0pointer (dot) net])
AC_CONFIG_SRCDIR([atasmart.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR(m4)
-AM_INIT_AUTOMAKE([foreign 1.9 -Wall])
+AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax])
-AC_SUBST(PACKAGE_URL, [https://http://git.0pointer.de/?p=libatasmart.git])
+AC_SUBST(PACKAGE_URL, [http://git.0pointer.de/?p=libatasmart.git])
-AC_SUBST(LIBATASMART_VERSION_INFO, [3:3:3])
+AC_SUBST(LIBATASMART_VERSION_INFO, [4:0:0])
AC_CANONICAL_HOST
@@ -46,7 +46,7 @@
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_GCC_TRADITIONAL
-AC_GNU_SOURCE
+AC_USE_SYSTEM_EXTENSIONS
# C++