From f229bb081cff2272e043112feeb1960a8da0a4c4 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Sat, 4 Mar 2023 15:39:12 +0100 Subject: [PATCH] - updated to 2.03.19, partial merge of PLD changes --- lvm2-run-dir.patch | 12 ++++---- lvm2-thin.patch | 61 ++++++++++++++++++++------------------- lvm2.spec | 71 ++++++++++++++++++++++------------------------ 3 files changed, 70 insertions(+), 74 deletions(-) diff --git a/lvm2-run-dir.patch b/lvm2-run-dir.patch index bade245..8ff63ab 100644 --- a/lvm2-run-dir.patch +++ b/lvm2-run-dir.patch @@ -1,13 +1,13 @@ -diff -ur LVM2.2.03.02.orig/configure.ac LVM2.2.03.02/configure.ac ---- LVM2.2.03.02.orig/configure.ac 2019-03-22 17:02:35.939000000 +0100 -+++ LVM2.2.03.02/configure.ac 2019-03-22 17:06:34.965000000 +0100 -@@ -689,8 +689,7 @@ +diff -ur LVM2.2.03.19/configure.ac lvm2-2_03_19/configure.ac +--- LVM2.2.03.19/configure.ac 2023-03-03 22:58:49.813964537 +0100 ++++ LVM2.2.03.19/configure.ac 2023-03-03 22:59:34.844579648 +0100 +@@ -714,8 +714,7 @@ ################################################################################ - AC_MSG_CHECKING(for default run directory) + AC_MSG_CHECKING([for default run directory]) -RUN_DIR="/run" -test -d "/run" || RUN_DIR="/var/run" +RUN_DIR="/var/run" - AC_MSG_RESULT($RUN_DIR) + AC_MSG_RESULT([$RUN_DIR]) dnl -- Set up pidfile and run directory AH_TEMPLATE(DEFAULT_PID_DIR) diff --git a/lvm2-thin.patch b/lvm2-thin.patch index 3b56167..0f0cd21 100644 --- a/lvm2-thin.patch +++ b/lvm2-thin.patch @@ -1,48 +1,47 @@ -diff -ur LVM2.2.03.02.orig/configure.ac LVM2.2.03.02/configure.ac ---- LVM2.2.03.02.orig/configure.ac 2019-03-22 17:10:13.162000000 +0100 -+++ LVM2.2.03.02/configure.ac 2019-03-22 17:10:38.684000000 +0100 -@@ -411,7 +411,7 @@ +--- LVM2.2.03.19/configure.ac.orig 2023-02-21 15:37:53.000000000 +0100 ++++ LVM2.2.03.19/configure.ac 2023-02-22 10:52:41.267893915 +0100 +@@ -393,7 +393,7 @@ 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) +- 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 -@@ -426,7 +426,7 @@ - THIN_CONFIGURE_WARN=y - fi - fi -- if test "$THIN_CHECK_NEEDS_CHECK" = yes && test "$THIN_CONFIGURE_WARN" != y ; then -+ if test "$THIN_CHECK_NEEDS_CHECK" = autodetect && test "$THIN_CONFIGURE_WARN" != y ; 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}'` -@@ -439,6 +439,8 @@ +@@ -421,7 +421,7 @@ AC_MSG_WARN([$THIN_CHECK_CMD: Old version "$THIN_CHECK_VSN" found]) - THIN_CHECK_VERSION_WARN=y - THIN_CHECK_NEEDS_CHECK=no -+ else -+ THIN_CHECK_NEEDS_CHECK=yes - fi - fi + THIN_CHECK_VERSION_WARN="y" + THIN_CHECK_NEEDS_CHECK="no" +- ]) ++ ], [ THIN_CHECK_NEEDS_CHECK="yes" ]) + ]) # Empty means a config way to ignore thin dumping -@@ -524,7 +526,7 @@ + AS_IF([test "$THIN_DUMP_CMD" = "autodetect"], [ +@@ -505,7 +505,7 @@ 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) +- 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 -@@ -563,6 +565,8 @@ +@@ -520,7 +520,7 @@ + CACHE_CONFIGURE_WARN="y" + ]) + ]) +- AS_IF([test "$CACHE_CHECK_NEEDS_CHECK" = "yes" && test "$CACHE_CONFIGURE_WARN" != "y"], [ ++ AS_IF([test "$CACHE_CHECK_NEEDS_CHECK" = "autodetect" && 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 +@@ -544,7 +544,7 @@ AC_MSG_WARN([$CACHE_CHECK_CMD: Old version "$CACHE_CHECK_VSN" does not support new cache format V2]) CACHE_CHECK_VERSION_WARN=y - fi -+ else -+ CACHE_CHECK_NEEDS_CHECK=yes - fi - fi + ]) +- ]) ++ ], [ CACHE_CHECK_NEEDS_CHECK="yes" ]) + ]) # Empty means a config way to ignore cache dumping + AS_IF([test "$CACHE_DUMP_CMD" = "autodetect"], [ diff --git a/lvm2.spec b/lvm2.spec index 3194dea..47bc1e3 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -1,17 +1,15 @@ # TODO # - vgscan --ignorelocking failure creates /var/lock/lvm (even if /var is not yet mounted) -# - spec default value for --with-replicators (=internal/shared/none, configure default is none)? -# (also internal vs shared for lvm1,pool,cluster,snapshots,mirrors,raid,replicators,thin,cache; -# note: dmeventd requires mirrors=internal) +# - internal vs shared for snapshots,mirrors,thin,cache ? +# note: dmeventd requires mirrors=internal) # # Conditional build: # - functionality -%bcond_without cluster # disable all cluster support (cmirrord) +%bcond_without cluster # disable all cluster support (cmirrord, dlm support in lvmlockd) %bcond_without lvmdbusd # lvmdbusd %bcond_without lvmpolld # lvmpolld (and lvmlockd) %bcond_without lvmlockd # lvmlockd %bcond_with sanlock # sanlock support in lvmlockd -%bcond_with replicator # internal replicator support # - additional features %bcond_without selinux # SELinux support # - bindings @@ -28,31 +26,29 @@ %undefine with_lvmdbusd %endif -%define ver 2.03.16 -%define tgz_ver %(echo %{version} | tr . _) - Summary: The new version of Logical Volume Manager for Linux Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa Name: lvm2 -Version: %{ver} +Version: 2.03.19 Release: 1 License: GPL v2 and LGPL v2.1 Group: Applications/System -Source0: https://github.com/lvmteam/lvm2/archive/v%{tgz_ver}.tar.gz -# Source0-md5: 0454f35c17f28e714d7d72f4c43f2ebd +Source0: ftp://sourceware.org/pub/lvm2/LVM2.%{version}.tgz +# Source0-md5: e805199669c5fb2d87fba9a4082ecada Patch0: %{name}-selinux.patch Patch1: device-mapper-dmsetup-export.patch Patch2: %{name}-tld_init.patch Patch3: %{name}-run-dir.patch Patch4: device-mapper-dmsetup-deps-export.patch Patch5: %{name}-thin.patch -Patch6: %{name}-no-systemd.patch -Patch7: link.patch +Patch6: link.patch URL: http://www.sourceware.org/lvm2/ BuildRequires: autoconf >= 2.69 +BuildRequires: autoconf-archive BuildRequires: automake # for /run detection BuildRequires: filesystem >= 3.0-43 +BuildRequires: libaio-devel BuildRequires: libblkid-devel >= 2.24 %{?with_selinux:BuildRequires: libselinux-devel >= 1.10} %{?with_selinux:BuildRequires: libsepol-devel} @@ -89,13 +85,10 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) # changing CFLAGS in the middle confuses confcache %undefine configure_cache -# borken on AC -%define filterout_ld -Wl,--as-needed - # causes: undefined reference to `__stack_chk_fail_local' %define filterout_c -fstack-protector -%define skip_post_check_so '.*(libdevmapper-event.so|libdevmapper-event-lvm2.so).*' +%define skip_post_check_so '.*libdevmapper-event-lvm2.so.*' 'liblvm2cmd.so.*' %description This package includes a number of utilities for creating, checking, @@ -121,7 +114,7 @@ This daemon relies on the cluster infrastructure provided by the Cluster MANager (CMAN), which must be set up and running in order for cmirrord to function. -%description cmirrord +%description cmirrord -l pl.UTF-8 cmirrord to demon śledzący informacje logu lustrzanego w klastrze. Jest specyficzny dla klastrów lustrzanych opartych na device-mapperze (oraz, poprzez rozszerzenie, klastrów lustrzanych LVM). W klastrach @@ -280,7 +273,7 @@ Static devmapper library built with dietlibc. Statyczna biblioteka devmapper zbudowana z dietlibc. %prep -%setup -q -n lvm2-%{tgz_ver} +%setup -q -n LVM2.%{version} %{?with_selinux:%patch0 -p1} %patch1 -p1 %patch2 -p1 @@ -288,14 +281,8 @@ Statyczna biblioteka devmapper zbudowana z dietlibc. %patch4 -p1 %patch5 -p1 %patch6 -p1 -%patch7 -p1 - -# do not force --export-symbol linker option for e.g. statically linked executables -# -rdynamic compiler option drives linker in the right way. -%{__sed} -i -e 's#-Wl,--export-dynamic#-rdynamic#g' configure.ac %build -cp -f /usr/share/automake/config.sub autoconf %{__aclocal} %{__autoconf} @@ -303,11 +290,14 @@ cp -f /usr/share/automake/config.sub autoconf --enable-applib \ --enable-cache_check_needs_check \ --enable-cmdlib \ +%if %{with cluster} + --enable-cmirrord \ +%endif %{?with_lvmdbusd:--enable-dbus-service} \ %{?debug:--enable-debug} \ --enable-dmeventd \ + --enable-dmfilemapd \ --enable-fsadm \ - --with-default-locking-dir=/var/lock/lvm \ %if %{with lvmlockd} %{?with_cluster:--enable-lvmlockd-dlm} \ %{?with_sanlock:--enable-lvmlockd-sanlock} \ @@ -316,9 +306,10 @@ cp -f /usr/share/automake/config.sub autoconf --enable-ocf \ %{?with_python2:--enable-python2_bindings} \ %{?with_python3:--enable-python3_bindings} \ + --enable-pkgconfig \ --enable-readline \ %{!?with_selinux:--disable-selinux} \ - --enable-pkgconfig \ + --disable-silent-rules \ --enable-thin_check_needs_check \ --enable-udev_sync \ --enable-udev_rules \ @@ -328,17 +319,12 @@ cp -f /usr/share/automake/config.sub autoconf --with-cache-dump=/usr/sbin/cache_dump \ --with-cache-repair=/usr/sbin/cache_repair \ --with-cache-restore=/usr/sbin/cache_restore \ - --with-cluster=internal \ -%if %{with cluster} - --enable-cmirrord \ -%endif + --with-default-locking-dir=/var/lock/lvm \ --with-dmeventd-path=%{_sbindir}/dmeventd \ --with-interface=ioctl \ - --with-lvm1=internal \ + --with-libexecdir=%{_libexecdir} \ --with-mirrors=internal \ --with-optimisation="%{rpmcflags}" \ - --with-pool=internal \ - %{?with_replicator:--with-replicators=internal} \ --with-snapshots=internal \ --with-thin=internal \ --with-thin-check=/usr/sbin/thin_check \ @@ -348,14 +334,17 @@ cp -f /usr/share/automake/config.sub autoconf --with-udev-prefix=/ \ --with-usrlibdir=%{_libdir} # use bash because of "set -o pipefail" +# V=1 still used because of missing --disable-silent-rules support in libdm (as of 2.03.09) %{__make} -j1 \ - SHELL=/bin/bash + SHELL=/bin/bash \ + V=1 %{__make} -j1 -C libdm \ - LIB_STATIC=libdevmapper.a + LIB_STATIC=libdevmapper.a \ + V=1 %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT{/%{_lib},%{_sysconfdir}/lvm,/etc/sysconfig} +install -d $RPM_BUILD_ROOT{/%{_lib},%{_sysconfdir}/lvm,/etc/sysconfig,/var/lock/lvm/subsys} %{__make} install install_system_dirs install_initscripts \ DESTDIR=$RPM_BUILD_ROOT \ @@ -363,6 +352,9 @@ install -d $RPM_BUILD_ROOT{/%{_lib},%{_sysconfdir}/lvm,/etc/sysconfig} GROUP="" \ python3dir=%{py3_sitescriptdir} +%{__make} -C scripts \ + DESTDIR=$RPM_BUILD_ROOT + %{__mv} $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib} for lib in $RPM_BUILD_ROOT/%{_lib}/lib*.so.*; do lib=$(echo $lib | sed -e "s#$RPM_BUILD_ROOT##g") @@ -460,7 +452,9 @@ fi %attr(755,root,root) %{_sbindir}/vgs %attr(755,root,root) %{_sbindir}/vgscan %attr(755,root,root) %{_sbindir}/vgsplit +%attr(755,root,root) %{_libexecdir}/lvresize_fs_helper %{_mandir}/man5/lvm.conf.5* +%{_mandir}/man7/lvmautoactivation.7* %{_mandir}/man7/lvmcache.7* %{_mandir}/man7/lvmraid.7* %{_mandir}/man7/lvmreport.7* @@ -538,6 +532,7 @@ fi %attr(754,root,root) /etc/rc.d/init.d/lvm2-monitor %attr(700,root,root) %dir /var/run/lvm %attr(700,root,root) %dir /var/lock/lvm +%attr(700,root,root) %dir /var/lock/lvm/subsys %if %{with lvmlockd} %attr(755,root,root) %{_sbindir}/lvmlockctl %attr(755,root,root) %{_sbindir}/lvmlockd @@ -595,6 +590,7 @@ fi /lib/udev/rules.d/69-dm-lvm.rules /lib/udev/rules.d/95-dm-notify.rules %attr(755,root,root) %{_sbindir}/dmeventd +%attr(755,root,root) %{_sbindir}/dmfilemapd %attr(755,root,root) %{_sbindir}/dmsetup %attr(755,root,root) %{_sbindir}/dmstats %attr(755,root,root) %{_libdir}/libdevmapper-event-lvm2mirror.so @@ -608,6 +604,7 @@ fi %attr(755,root,root) %{_libdir}/device-mapper/libdevmapper-event-lvm2snapshot.so %attr(755,root,root) %{_libdir}/device-mapper/libdevmapper-event-lvm2thin.so %attr(755,root,root) %{_libdir}/device-mapper/libdevmapper-event-lvm2vdo.so +%{_mandir}/man8/dmfilemapd.8* %{_mandir}/man8/dmsetup.8* %{_mandir}/man8/dmstats.8* %{_mandir}/man8/dmeventd.8* -- 2.46.0