From b559a1e6f0ce94a74d962847f70c8e831e07b030 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Mon, 20 Feb 2012 19:36:27 +0000 Subject: [PATCH] Check whether udev supports built-in blkid. Built-in blkid is supported since udev v176 - set the UDEV_HAS_BUILTIN_BLKID variable appropriately so we can use it in the rules to call the built-in blkid conditionaly. --- configure | 15 +++++++++++++++ configure.in | 12 ++++++++++++ 2 files changed, 27 insertions(+) diff --git a/configure b/configure index d4d14bc8d..836ad1378 100755 --- a/configure +++ b/configure @@ -606,6 +606,7 @@ kerneldir interface DMEVENTD_PIDFILE WRITE_INSTALL +UDEV_HAS_BUILTIN_BLKID UDEV_SYNC UDEV_RULES UDEV_PC @@ -8858,6 +8859,19 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UDEV_RULES" >&5 $as_echo "$UDEV_RULES" >&6; } +if test x$UDEV_RULES = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether udev supports builtin blkid" >&5 +$as_echo_n "checking whether udev supports builtin blkid... " >&6; } + udev_version=$(udevadm info --version 2>/dev/null) + if test -n "$udev_version" && test "$udev_version" -ge 176; then + UDEV_HAS_BUILTIN_BLKID=yes + else + UDEV_HAS_BUILTIN_BLKID=no + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UDEV_HAS_BUILTIN_BLKID" >&5 +$as_echo "$UDEV_HAS_BUILTIN_BLKID" >&6; } +fi + ################################################################################ # Check whether --enable-compat was given. if test "${enable_compat+set}" = set; then : @@ -10393,6 +10407,7 @@ LVM_LIBAPI=`echo "$VER" | $AWK -F '[()]' '{print $2}'` + ################################################################################ diff --git a/configure.in b/configure.in index 784cfa1c4..cfa80170c 100644 --- a/configure.in +++ b/configure.in @@ -873,6 +873,17 @@ AC_ARG_ENABLE(udev_rules, UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC) AC_MSG_RESULT($UDEV_RULES) +if test x$UDEV_RULES = xyes; then + AC_MSG_CHECKING(whether udev supports builtin blkid) + udev_version=$(udevadm info --version 2>/dev/null) + if test -n "$udev_version" && test "$udev_version" -ge 176; then + UDEV_HAS_BUILTIN_BLKID=yes + else + UDEV_HAS_BUILTIN_BLKID=no + fi + AC_MSG_RESULT($UDEV_HAS_BUILTIN_BLKID) +fi + ################################################################################ dnl -- Compatibility mode AC_ARG_ENABLE(compat, @@ -1454,6 +1465,7 @@ AC_SUBST(UDEV_LIBS) AC_SUBST(UDEV_PC) AC_SUBST(UDEV_RULES) AC_SUBST(UDEV_SYNC) +AC_SUBST(UDEV_HAS_BUILTIN_BLKID) AC_SUBST(CUNIT_LIBS) AC_SUBST(CUNIT_CFLAGS) AC_SUBST(WRITE_INSTALL) -- 2.43.5