diff options
author | Mike Gilbert <floppym@gentoo.org> | 2024-11-17 10:57:22 -0500 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2024-11-17 11:14:52 -0500 |
commit | 3303524ef17c4d9cf627bfc8405d29c835da895c (patch) | |
tree | 7bcb7709f9c460aaf6537bafa0d7db6cf062b41b | |
parent | dev-ml/merlin-extend: add 0.6.2 (diff) | |
download | gentoo-3303524ef17c4d9cf627bfc8405d29c835da895c.tar.gz gentoo-3303524ef17c4d9cf627bfc8405d29c835da895c.tar.bz2 gentoo-3303524ef17c4d9cf627bfc8405d29c835da895c.zip |
sys-fs/lvm2: fix thin automagic
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
-rw-r--r-- | sys-fs/lvm2/files/lvm2-2.03.22-thin-autodetect.patch | 135 | ||||
-rw-r--r-- | sys-fs/lvm2/lvm2-2.03.22-r6.ebuild (renamed from sys-fs/lvm2/lvm2-2.03.22-r5.ebuild) | 8 |
2 files changed, 142 insertions, 1 deletions
diff --git a/sys-fs/lvm2/files/lvm2-2.03.22-thin-autodetect.patch b/sys-fs/lvm2/files/lvm2-2.03.22-thin-autodetect.patch new file mode 100644 index 000000000000..b02c9518f1d2 --- /dev/null +++ b/sys-fs/lvm2/files/lvm2-2.03.22-thin-autodetect.patch @@ -0,0 +1,135 @@ +From 25f0398b1c9d108160a39de43af6f2fa3f952db5 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert <floppym@gentoo.org> +Date: Sun, 17 Nov 2024 10:45:29 -0500 +Subject: [PATCH] configure: update thin_check_needs_check logic + +If the user has explicitly passed a value for thin_check_needs_check, +skip the autodetection logic entirely. Same for cache_check_needs_check. + +This allows lvm2 to be built consistently without having +thin-provisioning-tools installed. +--- + configure.ac | 84 ++++++++++++++++++++++++++++------------------------ + 1 file changed, 46 insertions(+), 38 deletions(-) + +diff --git a/configure.ac b/configure.ac +index cbea6adc6..4f77b4e6f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -422,7 +422,7 @@ dnl -- thin_check needs-check flag + AC_ARG_ENABLE(thin_check_needs_check, + AS_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") ++ THIN_CHECK_NEEDS_CHECK=$enableval, THIN_CHECK_NEEDS_CHECK="autodetect") + + # Test if necessary thin tools are available + # if not - use plain defaults and warn user +@@ -437,20 +437,24 @@ AS_CASE(["$THIN"], + THIN_CONFIGURE_WARN="y" + ]) + ]) +- AS_IF([test "$THIN_CHECK_NEEDS_CHECK" = "yes" && test "$THIN_CONFIGURE_WARN" != "y"], [ +- THIN_CHECK_VSN=$("$THIN_CHECK_CMD" -V 2>/dev/null) +- THIN_CHECK_VSN=${THIN_CHECK_VSN##* } # trim away all before the first space +- THIN_CHECK_VSN_MAJOR=$(echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $1}') +- THIN_CHECK_VSN_MINOR=$(echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $2}') +- +- AS_IF([test -z "$THIN_CHECK_VSN_MAJOR" || test -z "$THIN_CHECK_VSN_MINOR"], [ +- AC_MSG_WARN([$THIN_CHECK_CMD: Bad version "$THIN_CHECK_VSN" found]) +- THIN_CHECK_VERSION_WARN="y" +- THIN_CHECK_NEEDS_CHECK="no" +- ], [test "$THIN_CHECK_VSN_MAJOR" -eq 0 && test "$THIN_CHECK_VSN_MINOR" -lt 3], [ +- AC_MSG_WARN([$THIN_CHECK_CMD: Old version "$THIN_CHECK_VSN" found]) +- THIN_CHECK_VERSION_WARN="y" +- THIN_CHECK_NEEDS_CHECK="no" ++ AS_IF([test "$THIN_CHECK_NEEDS_CHECK" = "autodetect"], [ ++ AS_IF([test "$THIN_CONFIGURE_WARN" != "y"], [ ++ THIN_CHECK_VSN=$("$THIN_CHECK_CMD" -V 2>/dev/null) ++ THIN_CHECK_VSN=${THIN_CHECK_VSN##* } # trim away all before the first space ++ THIN_CHECK_VSN_MAJOR=$(echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $1}') ++ THIN_CHECK_VSN_MINOR=$(echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $2}') ++ ++ AS_IF([test -z "$THIN_CHECK_VSN_MAJOR" || test -z "$THIN_CHECK_VSN_MINOR"], [ ++ AC_MSG_WARN([$THIN_CHECK_CMD: Bad version "$THIN_CHECK_VSN" found]) ++ THIN_CHECK_VERSION_WARN="y" ++ THIN_CHECK_NEEDS_CHECK="no" ++ ], [test "$THIN_CHECK_VSN_MAJOR" -eq 0 && test "$THIN_CHECK_VSN_MINOR" -lt 3], [ ++ AC_MSG_WARN([$THIN_CHECK_CMD: Old version "$THIN_CHECK_VSN" found]) ++ THIN_CHECK_VERSION_WARN="y" ++ THIN_CHECK_NEEDS_CHECK="no" ++ ], [ ++ THIN_CHECK_NEEDS_CHECK="yes" ++ ]) + ]) + ]) + # Empty means a config way to ignore thin dumping +@@ -535,7 +539,7 @@ dnl -- cache_check needs-check flag + AC_ARG_ENABLE(cache_check_needs_check, + AS_HELP_STRING([--disable-cache_check_needs_check], + [required if cache_check version is < 0.5]), +- CACHE_CHECK_NEEDS_CHECK=$enableval, CACHE_CHECK_NEEDS_CHECK="yes") ++ CACHE_CHECK_NEEDS_CHECK=$enableval, CACHE_CHECK_NEEDS_CHECK="autodetect") + + # Test if necessary cache tools are available + # if not - use plain defaults and warn user +@@ -550,30 +554,34 @@ AS_CASE(["$CACHE"], + CACHE_CONFIGURE_WARN="y" + ]) + ]) +- AS_IF([test "$CACHE_CHECK_NEEDS_CHECK" = "yes" && test "$CACHE_CONFIGURE_WARN" != "y"], [ +- "$CACHE_CHECK_CMD" -V 2>/dev/null >conftest.tmp +- read -r CACHE_CHECK_VSN < conftest.tmp +- IFS=.- read -r CACHE_CHECK_VSN_MAJOR CACHE_CHECK_VSN_MINOR CACHE_CHECK_VSN_PATCH LEFTOVER < conftest.tmp +- rm -f conftest.tmp +- +- # Require version >= 0.5.4 for --clear-needs-check-flag +- CACHE_CHECK_VSN_MAJOR=${CACHE_CHECK_VSN_MAJOR##* } +- AS_IF([test -z "$CACHE_CHECK_VSN_MAJOR" \ +- || test -z "$CACHE_CHECK_VSN_MINOR" \ +- || test -z "$CACHE_CHECK_VSN_PATCH"], [ +- AC_MSG_WARN([$CACHE_CHECK_CMD: Bad version "$CACHE_CHECK_VSN" found]) +- CACHE_CHECK_VERSION_WARN="y" +- CACHE_CHECK_NEEDS_CHECK="no" +- ], [test "$CACHE_CHECK_VSN_MAJOR" -eq 0], [ +- AS_IF([test "$CACHE_CHECK_VSN_MINOR" -lt 5 \ +- || ( test "$CACHE_CHECK_VSN_MINOR" -eq 5 && test "$CACHE_CHECK_VSN_PATCH" -lt 4 )], [ +- AC_MSG_WARN([$CACHE_CHECK_CMD: Old version "$CACHE_CHECK_VSN" found]) ++ AS_IF([test "$CACHE_CHECK_NEEDS_CHECK" = "autodetect"], [ ++ AS_IF([test "$CACHE_CONFIGURE_WARN" != "y"], [ ++ "$CACHE_CHECK_CMD" -V 2>/dev/null >conftest.tmp ++ read -r CACHE_CHECK_VSN < conftest.tmp ++ IFS=.- read -r CACHE_CHECK_VSN_MAJOR CACHE_CHECK_VSN_MINOR CACHE_CHECK_VSN_PATCH LEFTOVER < conftest.tmp ++ rm -f conftest.tmp ++ ++ # Require version >= 0.5.4 for --clear-needs-check-flag ++ CACHE_CHECK_VSN_MAJOR=${CACHE_CHECK_VSN_MAJOR##* } ++ AS_IF([test -z "$CACHE_CHECK_VSN_MAJOR" \ ++ || test -z "$CACHE_CHECK_VSN_MINOR" \ ++ || test -z "$CACHE_CHECK_VSN_PATCH"], [ ++ AC_MSG_WARN([$CACHE_CHECK_CMD: Bad version "$CACHE_CHECK_VSN" found]) + CACHE_CHECK_VERSION_WARN="y" + CACHE_CHECK_NEEDS_CHECK="no" +- ]) +- AS_IF([test "$CACHE_CHECK_VSN_MINOR" -lt 7], [ +- AC_MSG_WARN([$CACHE_CHECK_CMD: Old version "$CACHE_CHECK_VSN" does not support new cache format V2]) +- CACHE_CHECK_VERSION_WARN=y ++ ], [test "$CACHE_CHECK_VSN_MAJOR" -eq 0], [ ++ AS_IF([test "$CACHE_CHECK_VSN_MINOR" -lt 5 \ ++ || ( test "$CACHE_CHECK_VSN_MINOR" -eq 5 && test "$CACHE_CHECK_VSN_PATCH" -lt 4 )], [ ++ AC_MSG_WARN([$CACHE_CHECK_CMD: Old version "$CACHE_CHECK_VSN" found]) ++ CACHE_CHECK_VERSION_WARN="y" ++ CACHE_CHECK_NEEDS_CHECK="no" ++ ]) ++ AS_IF([test "$CACHE_CHECK_VSN_MINOR" -lt 7], [ ++ AC_MSG_WARN([$CACHE_CHECK_CMD: Old version "$CACHE_CHECK_VSN" does not support new cache format V2]) ++ CACHE_CHECK_VERSION_WARN=y ++ ]) ++ ], [ ++ CACHE_CHECK_NEEDS_CHECK="yes" + ]) + ]) + ]) +-- +2.47.0 + diff --git a/sys-fs/lvm2/lvm2-2.03.22-r5.ebuild b/sys-fs/lvm2/lvm2-2.03.22-r6.ebuild index e0a1e2d36d8c..0a46f4913903 100644 --- a/sys-fs/lvm2/lvm2-2.03.22-r5.ebuild +++ b/sys-fs/lvm2/lvm2-2.03.22-r6.ebuild @@ -70,6 +70,7 @@ PATCHES=( "${FILESDIR}"/${PN}-2.03.20-freopen-musl.patch "${FILESDIR}"/${PN}-2.03.22-autoconf-2.72-egrep.patch "${FILESDIR}"/${PN}-2.03.22-thin-version-checking.patch + "${FILESDIR}"/${PN}-2.03.22-thin-autodetect.patch ) pkg_setup() { @@ -133,7 +134,12 @@ src_configure() { ) if use lvm && use thin; then - myeconfargs+=( --with-thin=internal --with-cache=internal ) + myeconfargs+=( + --with-thin=internal + --enable-thin_check_needs_check + --with-cache=internal + --enable-cache_check_needs_check + ) local texec for texec in check dump repair restore; do myeconfargs+=( --with-thin-${texec}="${EPREFIX}"/usr/sbin/thin_${texec} ) |