1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

configure: Warn if old thin_check tool found.

If thin_check is auto-detected, issue a warning if the version is older
than 0.3.x.
This commit is contained in:
Alasdair G Kergon 2014-04-07 16:44:29 +01:00
parent 2fd5c67f32
commit eb1602406b

View File

@ -433,6 +433,18 @@ case "$THIN" in
*) AC_MSG_ERROR([--with-thin parameter invalid ($THIN)]) ;;
esac
dnl -- thin_check needs-check flag
AC_MSG_CHECKING(whether thin_check supports the needs-check flag)
AC_ARG_ENABLE(thin_check_needs_check,
AC_HELP_STRING([--disable-thin_check_needs_check],
[required if thin_check version is < 0.3.0]),
THIN_CHECK_NEEDS_CHECK=$enableval, THIN_CHECK_NEEDS_CHECK=yes)
AC_MSG_RESULT($THIN_CHECK_NEEDS_CHECK)
if test x$THIN_CHECK_NEEDS_CHECK = xyes; then
AC_DEFINE([THIN_CHECK_NEEDS_CHECK], 1, [Define to 1 if the external 'thin_check' tool requires the --clear-needs-check-flag option])
fi
# Test if necessary thin tools are available
# if not - use plain defaults and warn user
case "$THIN" in
@ -440,11 +452,27 @@ case "$THIN" in
# Empty means a config way to ignore thin checking
if test "$THIN_CHECK_CMD" = "autodetect"; then
AC_PATH_TOOL(THIN_CHECK_CMD, thin_check)
test -z "$THIN_CHECK_CMD" && {
if test -z "$THIN_CHECK_CMD"; then
AC_MSG_WARN([thin_check not found in path $PATH])
THIN_CHECK_CMD=/usr/sbin/thin_check
THIN_CONFIGURE_WARN=y
}
else
if test x$THIN_CHECK_NEEDS_CHECK = xyes; then
THIN_CHECK_VSN=`"$THIN_CHECK_CMD" -V 2>/dev/null`
THIN_CHECK_VSN_MAJOR=`echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $1}'`
THIN_CHECK_VSN_MINOR=`echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $2}'`
if test -z "$THIN_CHECK_VSN_MAJOR" -o -z "$THIN_CHECK_VSN_MINOR" ; then
AC_MSG_WARN(Found thin_check version "$THIN_CHECK_VSN")
THIN_CHECK_VERSION_WARN=y
else
if test "$THIN_CHECK_VSN_MAJOR" -eq 0 -a "$THIN_CHECK_VSN_MINOR" -lt 3 ; then
AC_MSG_WARN(Found thin_check version "$THIN_CHECK_VSN")
THIN_CHECK_VERSION_WARN=y
fi
fi
fi
fi
fi
# Empty means a config way to ignore thin checking
if test "$THIN_DUMP_CMD" = "autodetect"; then
@ -476,18 +504,6 @@ AC_DEFINE_UNQUOTED([THIN_DUMP_CMD], ["$THIN_DUMP_CMD"],
AC_DEFINE_UNQUOTED([THIN_REPAIR_CMD], ["$THIN_REPAIR_CMD"],
[The path to 'thin_repair', if available.])
dnl -- thin_check needs-check flag
AC_MSG_CHECKING(whether thin_check supports the needs-check flag)
AC_ARG_ENABLE(thin_check_needs_check,
AC_HELP_STRING([--disable-thin_check_needs_check],
[required if thin_check version is < 0.3.0]),
THIN_CHECK_NEEDS_CHECK=$enableval, THIN_CHECK_NEEDS_CHECK=yes)
AC_MSG_RESULT($THIN_CHECK_NEEDS_CHECK)
if test x$THIN_CHECK_NEEDS_CHECK = xyes; then
AC_DEFINE([THIN_CHECK_NEEDS_CHECK], 1, [Define to 1 if the external 'thin_check' tool requires the --clear-needs-check-flag option])
fi
################################################################################
dnl -- cache inclusion type
AC_MSG_CHECKING(whether to include cache)
@ -1825,6 +1841,8 @@ AC_OUTPUT
test -n "$THIN_CONFIGURE_WARN" && AC_MSG_WARN([Support for thin provisioning is limited since some thin provisioning tools are missing!])
test -n "$THIN_CHECK_VERSION_WARN" && AC_MSG_WARN(You should also install thin_check vsn 0.3.2 (or later) to use lvm2 thin provisioning)
if test x$ODIRECT != xyes; then
AC_MSG_WARN(Warning: O_DIRECT disabled: low-memory pvmove may lock up)
AC_MSG_WARN(O_DIRECT disabled: low-memory pvmove may lock up)
fi