diff --git a/WHATS_NEW b/WHATS_NEW index a2c9c53b0..d506f9d97 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.96 - ================================ + Add --with-thin-check configure option for path to thin_check. Detect lvm binary path in lvmetad udev rules. Fix error message when pvmove LV activation fails with name already in use. Better structure layout for device_info in dev_subsystem_name(). diff --git a/configure b/configure index 5ba6fa25a..b9cdcc091 100755 --- a/configure +++ b/configure @@ -714,6 +714,7 @@ PKGCONFIGINIT_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG +THIN_CHECK_CMD POW_LIB LIBOBJS ALLOCA @@ -808,6 +809,7 @@ with_mirrors with_raid with_replicators with_thin +with_thin_check enable_readline enable_realtime enable_ocf @@ -1566,6 +1568,7 @@ Optional Packages: [[TYPE=none]] --with-thin=TYPE thin provisioning support: internal/shared/none [[TYPE=none]] + --with-thin-check=PATH thin_check tool: [[autodetect]] --with-ocfdir=DIR install OCF files in DIR [[PREFIX/lib/ocf/resource.d/lvm2]] --with-clvmd=TYPE build cluster LVM Daemon @@ -7007,6 +7010,70 @@ $as_echo "#define THIN_INTERNAL 1" >>confdefs.h *) as_fn_error $? "--with-thin parameter invalid ($THIN)" "$LINENO" 5 ;; esac +case "$THIN" in + internal|shared) + +# Check whether --with-thin-check was given. +if test "${with_thin_check+set}" = set; then : + withval=$with_thin_check; THIN_CHECK_CMD=$withval +else + THIN_CHECK_CMD="autodetect" +fi + + # Empty means a config way to ignore thin checking + if test "$THIN_CHECK_CMD" = "autodetect"; then + # Extract the first word of "thin_check", so it can be a program name with args. +set dummy thin_check; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_THIN_CHECK_CMD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $THIN_CHECK_CMD in + [\\/]* | ?:[\\/]*) + ac_cv_path_THIN_CHECK_CMD="$THIN_CHECK_CMD" # Let the user override the test with a path. + ;; + *) + 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_path_THIN_CHECK_CMD="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +THIN_CHECK_CMD=$ac_cv_path_THIN_CHECK_CMD +if test -n "$THIN_CHECK_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $THIN_CHECK_CMD" >&5 +$as_echo "$THIN_CHECK_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -z "$THIN_CHECK_CMD" && as_fn_error $? "thin_check not found in path $PATH" "$LINENO" 5 + fi + + +cat >>confdefs.h <<_ACEOF +#define THIN_CHECK_CMD "$THIN_CHECK_CMD" +_ACEOF + + ;; +esac + + ################################################################################ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable readline" >&5 $as_echo_n "checking whether to enable readline... " >&6; } @@ -10420,6 +10487,7 @@ LVM_LIBAPI=`echo "$VER" | $AWK -F '[()]' '{print $2}'` + ################################################################################ diff --git a/configure.in b/configure.in index c056984d8..1a4bdeb1c 100644 --- a/configure.in +++ b/configure.in @@ -411,6 +411,24 @@ case "$THIN" in *) AC_MSG_ERROR([--with-thin parameter invalid ($THIN)]) ;; esac +case "$THIN" in + internal|shared) + AC_ARG_WITH(thin-check, + AC_HELP_STRING([--with-thin-check=PATH], + [thin_check tool: [[autodetect]]]), + THIN_CHECK_CMD=$withval, THIN_CHECK_CMD="autodetect") + # Empty means a config way to ignore thin checking + if test "$THIN_CHECK_CMD" = "autodetect"; then + AC_PATH_PROG(THIN_CHECK_CMD, thin_check) + test -z "$THIN_CHECK_CMD" && AC_MSG_ERROR(thin_check not found in path $PATH) + fi + + AC_DEFINE_UNQUOTED([THIN_CHECK_CMD], ["$THIN_CHECK_CMD"], + [The path to 'thin_check', if available.]) + ;; +esac + + ################################################################################ dnl -- Disable readline AC_MSG_CHECKING(whether to enable readline) @@ -1475,6 +1493,7 @@ AC_SUBST(STATICDIR) AC_SUBST(STATIC_LINK) AC_SUBST(TESTING) AC_SUBST(THIN) +AC_SUBST(THIN_CHECK_CMD) AC_SUBST(UDEV_LIBS) AC_SUBST(UDEV_PC) AC_SUBST(UDEV_RULES) diff --git a/lib/misc/configure.h.in b/lib/misc/configure.h.in index aba4161bd..6d904f2a2 100644 --- a/lib/misc/configure.h.in +++ b/lib/misc/configure.h.in @@ -534,6 +534,9 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* The path to 'thin_check', if available. */ +#undef THIN_CHECK_CMD + /* Define to 1 to include built-in support for thin provisioning. */ #undef THIN_INTERNAL