]> sourceware.org Git - lvm2.git/commitdiff
configure: set DEFAULT_FALLBACK_TO_LVM1 in configure and use it in config_settings.h
authorPeter Rajnoha <prajnoha@redhat.com>
Tue, 30 Jun 2015 12:09:00 +0000 (14:09 +0200)
committerPeter Rajnoha <prajnoha@redhat.com>
Tue, 30 Jun 2015 12:09:05 +0000 (14:09 +0200)
Just like we have DEFAULT_USE_LVMETAD (or DEFUALT_USE_LVMPOLLD), use
fallback_to_lvm1=1 lvm.conf setting if we configured lvm2 with
--enable-lvm1-fallback and use fallback_to_lvm1=0 otherwise.

Also, generate proper lvm.conf.in with unconfigured value.

conf/example.conf.in
configure
configure.in
lib/config/config_settings.h
lib/config/defaults.h
lib/misc/configure.h.in

index 45201628d1491daaf297ed1cb7c386547713aaee..9af58db7049ba45653e6624b99109f58b144e1c1 100644 (file)
@@ -602,7 +602,7 @@ global {
        # The LVM1 tools need to be installed with .lvm1 suffices,
        # e.g. vgscan.lvm1. They will stop working once the lvm2
        # on-disk metadata format is used.
-       # fallback_to_lvm1 = 1
+       # fallback_to_lvm1 = @DEFAULT_FALLBACK_TO_LVM1@
 
        # Configuration option global/format.
        # The default metadata format that commands should use.
index 13d10c4ed9fd431aefabf10c368c053830807443..13e40f88b5e525a7bf6072488c18e9933af17c50 100755 (executable)
--- a/configure
+++ b/configure
@@ -703,6 +703,7 @@ DEFAULT_RAID10_SEGTYPE
 DEFAULT_PROFILE_SUBDIR
 DEFAULT_PID_DIR
 DEFAULT_MIRROR_SEGTYPE
+DEFAULT_FALLBACK_TO_LVM1
 DEFAULT_LOCK_DIR
 DEFAULT_DM_RUN_DIR
 DEFAULT_DATA_ALIGNMENT
@@ -7462,11 +7463,19 @@ fi
 $as_echo "$LVM1_FALLBACK" >&6; }
 
 if test "$LVM1_FALLBACK" = yes; then
+       DEFAULT_FALLBACK_TO_LVM1=1
 
 $as_echo "#define LVM1_FALLBACK 1" >>confdefs.h
 
+else
+       DEFAULT_FALLBACK_TO_LVM1=0
 fi
 
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_FALLBACK_TO_LVM1 $DEFAULT_FALLBACK_TO_LVM1
+_ACEOF
+
+
 ################################################################################
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include support for lvm1 metadata" >&5
 $as_echo_n "checking whether to include support for lvm1 metadata... " >&6; }
@@ -13274,6 +13283,7 @@ LVM_LIBAPI=`echo "$VER" | $AWK -F '[()]' '{print $2}'`
 
 
 
+
 
 
 ################################################################################
index d330bd206c5e91f42278689dfb4e3614f598cdd5..0c310ca7c4f0bacce0c5a37435f1387a656fcc26 100644 (file)
@@ -263,8 +263,13 @@ AC_ARG_ENABLE(lvm1_fallback,
 AC_MSG_RESULT($LVM1_FALLBACK)
 
 if test "$LVM1_FALLBACK" = yes; then
+       DEFAULT_FALLBACK_TO_LVM1=1
        AC_DEFINE([LVM1_FALLBACK], 1, [Define to 1 if 'lvm' should fall back to using LVM1 binaries if device-mapper is missing from the kernel])
+else
+       DEFAULT_FALLBACK_TO_LVM1=0
 fi
+AC_DEFINE_UNQUOTED(DEFAULT_FALLBACK_TO_LVM1, [$DEFAULT_FALLBACK_TO_LVM1],
+                  [Fall back to LVM1 by default if device-mapper is missing from the kernel.])
 
 ################################################################################
 dnl -- format1 inclusion type
@@ -1782,6 +1787,7 @@ AC_SUBST(DEFAULT_CACHE_SUBDIR)
 AC_SUBST(DEFAULT_DATA_ALIGNMENT)
 AC_SUBST(DEFAULT_DM_RUN_DIR)
 AC_SUBST(DEFAULT_LOCK_DIR)
+AC_SUBST(DEFAULT_FALLBACK_TO_LVM1)
 AC_SUBST(DEFAULT_MIRROR_SEGTYPE)
 AC_SUBST(DEFAULT_PID_DIR)
 AC_SUBST(DEFAULT_PROFILE_SUBDIR)
index fb05b857af8cdb1619728b8075b6eb8039ea53b8..cac197835a13cd437d17a95279e2372576c96369 100644 (file)
@@ -628,7 +628,7 @@ cfg(global_activation_CFG, "activation", global_CFG_SECTION, 0, CFG_TYPE_BOOL, D
        "is not present in the kernel, disabling this should suppress\n"
        "the error messages.\n")
 
-cfg(global_fallback_to_lvm1_CFG, "fallback_to_lvm1", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_FALLBACK_TO_LVM1, vsn(1, 0, 18), NULL, 0, NULL,
+cfg(global_fallback_to_lvm1_CFG, "fallback_to_lvm1", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_FALLBACK_TO_LVM1, vsn(1, 0, 18), "@DEFAULT_FALLBACK_TO_LVM1@", 0, NULL,
        "Try running LVM1 tools if LVM cannot communicate with DM.\n"
        "This option only applies to 2.4 kernels and is provided to\n"
        "help switch between device-mapper kernels and LVM1 kernels.\n"
index 3745639fe936ac686de4c12deb52eb820af07638..2d74c17bd009152824af6fc313fe6bda52a4a70e 100644 (file)
 
 #define DEFAULT_UMASK 0077
 
-#ifdef LVM1_FALLBACK
-#  define DEFAULT_FALLBACK_TO_LVM1 1
-#else
-#  define DEFAULT_FALLBACK_TO_LVM1 0
-#endif
-
 #define DEFAULT_FORMAT "lvm2"
 
 #define DEFAULT_STRIPESIZE 64  /* KB */
index 9ec997fa97bf626221676dacf2e6cc7dd44a8ddf..6daf105aa2d0950b99d6117caff9b19ecd618e23 100644 (file)
 /* Default system configuration directory. */
 #undef DEFAULT_ETC_DIR
 
+/* Fall back to LVM1 by default if device-mapper is missing from the kernel.
+   */
+#undef DEFAULT_FALLBACK_TO_LVM1
+
 /* Name of default locking directory. */
 #undef DEFAULT_LOCK_DIR
 
This page took 0.065552 seconds and 5 git commands to generate.