Blame SPECS/kmod-kvdo.spec

6f09de
%global commit                  b084c094175147937c3caa47f29945e8f079f663
6f09de
%global gittag                  8.2.0.21
e5deca
%global shortcommit             %(c=%{commit}; echo ${c:0:7})
6f09de
%define spec_release            47
e5deca
e5deca
%define kmod_name		kvdo
e5deca
%define kmod_driver_version	%{gittag}
e5deca
%define kmod_rpm_release	%{spec_release}
6f09de
%define kmod_kernel_version	5.14.0-162.5.1.el9
e5deca
%define kmod_headers_version	%(rpm -qa kernel-devel | sed 's/^kernel-devel-//')
e5deca
%define kmod_kbuild_dir		.
e5deca
%define kmod_devel_package	0
e5deca
e5deca
Source0:	https://github.com/dm-vdo/%{kmod_name}/archive/%{commit}/%{kmod_name}-%{shortcommit}.tar.gz
6f09de
Patch0:         add_lz4_dependency.patch
6f09de
Patch1:         removed-logical-space-check-from-table-line.patch
e5deca
e5deca
%define findpat %( echo "%""P" )
e5deca
e5deca
Name:		kmod-kvdo
e5deca
Version:	%{kmod_driver_version}
e5deca
Release:	%{kmod_rpm_release}%{?dist}
e5deca
Summary:	Kernel Modules for Virtual Data Optimizer
e5deca
License:	GPLv2+
e5deca
URL:		http://github.com/dm-vdo/kvdo
e5deca
BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
e5deca
BuildRequires:  elfutils-libelf-devel
e5deca
BuildRequires:	glibc
e5deca
BuildRequires:	kernel-devel >= %{kmod_kernel_version}
e5deca
e5deca
# Disable the kernel-debug requirement for now
e5deca
e5deca
BuildRequires:  libuuid-devel
e5deca
BuildRequires:  redhat-rpm-config
e5deca
ExcludeArch:    i686
e5deca
ExcludeArch:    ppc
e5deca
ExcludeArch:    ppc64
e5deca
ExcludeArch:    s390
e5deca
e5deca
%global kernel_source() /usr/src/kernels/%{kmod_headers_version}
e5deca
e5deca
%global _use_internal_dependency_generator 0
e5deca
Provides:         kmod-%{kmod_name} = %{?epoch:%{epoch}:}%{version}-%{release}
e5deca
Requires(post):   %{_sbindir}/weak-modules
e5deca
Requires(postun): %{_sbindir}/weak-modules
e5deca
Requires:         kernel-core-uname-r    >= %{kmod_kernel_version}
e5deca
Requires:         kernel-modules-uname-r >= %{kmod_kernel_version}
e5deca
e5deca
%description
e5deca
Virtual Data Optimizer (VDO) is a device mapper target that delivers
e5deca
block-level deduplication, compression, and thin provisioning.
e5deca
e5deca
This package provides the kernel modules for VDO.
e5deca
e5deca
%pre
e5deca
# During the install, check whether kvdo or uds is loaded.  A warning here
e5deca
# indicates that a previous install was not completely removed.  This message
e5deca
# is purely informational to the user.
e5deca
for module in kvdo uds; do
e5deca
  if grep -q "^${module}" /proc/modules; then
e5deca
    if [ "${module}" == "kvdo" ]; then
e5deca
      echo "WARNING: Found ${module} module previously loaded (Version: $(cat /sys/kvdo/version 2>/dev/null || echo Unknown)).  A reboot is recommended before attempting to use the newly installed module."
e5deca
    else
e5deca
      echo "WARNING: Found ${module} module previously loaded.  A reboot is recommended before attempting to use the newly installed module."
e5deca
    fi
e5deca
  fi
e5deca
done
e5deca
e5deca
%post
e5deca
modules=( $(find /lib/modules/%{kmod_headers_version}/extra/kmod-%{kmod_name} | grep '\.ko$') )
e5deca
printf '%s\n' "${modules[@]}" >> /var/lib/rpm-kmod-posttrans-weak-modules-add
e5deca
e5deca
%pretrans -p <lua>
e5deca
posix.unlink("/var/lib/rpm-kmod-posttrans-weak-modules-add")
e5deca
e5deca
%posttrans
e5deca
if [ -f "/var/lib/rpm-kmod-posttrans-weak-modules-add" ]; then
e5deca
	modules=( $(cat /var/lib/rpm-kmod-posttrans-weak-modules-add) )
e5deca
	rm -rf /var/lib/rpm-kmod-posttrans-weak-modules-add
e5deca
	printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --dracut=/usr/bin/dracut --add-modules
e5deca
fi
e5deca
e5deca
%preun
e5deca
rpm -ql kmod-kvdo-%{kmod_driver_version}-%{kmod_rpm_release}%{?dist}.$(arch) | grep '\.ko$' > /var/run/rpm-kmod-%{kmod_name}-modules
e5deca
# Check whether kvdo or uds is loaded, and if so attempt to remove it.  A
e5deca
# failure to unload means there is still something using the module.  To make
e5deca
# sure the user is aware, we print a warning with recommended instructions.
e5deca
for module in kvdo uds; do
e5deca
  if grep -q "^${module}" /proc/modules; then
e5deca
    warnMessage="WARNING: ${module} in use.  Changes will take effect after a reboot."
e5deca
    modprobe -r ${module} 2>/dev/null || echo ${warnMessage} && /usr/bin/true
e5deca
  fi
e5deca
done
e5deca
e5deca
%postun
e5deca
modules=( $(cat /var/run/rpm-kmod-%{kmod_name}-modules) )
e5deca
rm /var/run/rpm-kmod-%{kmod_name}-modules
e5deca
printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --dracut=/usr/bin/dracut --remove-modules
e5deca
e5deca
%files
e5deca
%defattr(644,root,root,755)
e5deca
/lib/modules/%{kmod_headers_version}
e5deca
/etc/depmod.d/%{kmod_name}.conf
e5deca
/usr/share/doc/kmod-%{kmod_name}/greylist.txt
e5deca
e5deca
%prep
e5deca
%setup -n %{kmod_name}-%{commit}
6f09de
%patch0 -p1
6f09de
%patch1 -p1
e5deca
%{nil}
e5deca
set -- *
e5deca
mkdir source
e5deca
mv "$@" source/
e5deca
mkdir obj
e5deca
e5deca
%build
e5deca
rm -rf obj
e5deca
cp -r source obj
e5deca
make -C %{kernel_source} M=$PWD/obj/%{kmod_kbuild_dir} V=1 \
e5deca
	NOSTDINC_FLAGS="-I $PWD/obj/include -I $PWD/obj/include/uapi"
e5deca
# mark modules executable so that strip-to-file can strip them
e5deca
find obj/%{kmod_kbuild_dir} -name "*.ko" -type f -exec chmod u+x '{}' +
e5deca
e5deca
whitelist="/lib/modules/kabi-current/kabi_whitelist_%{_target_cpu}"
e5deca
e5deca
for modules in $( find obj/%{kmod_kbuild_dir} -name "*.ko" -type f -printf "%{findpat}\n" | sed 's|\.ko$||' | sort -u ) ; do
e5deca
	# update depmod.conf
e5deca
	module_weak_path=$(echo $modules | sed 's/[\/]*[^\/]*$//')
e5deca
	if [ -z "$module_weak_path" ]; then
e5deca
		module_weak_path=%{name}
e5deca
	else
e5deca
		module_weak_path=%{name}/$module_weak_path
e5deca
	fi
e5deca
	echo "override $(echo $modules | sed 's/.*\///') $(echo %{kmod_headers_version} | sed 's/\.[^\.]*$//').* weak-updates/$module_weak_path" >> source/depmod.conf
e5deca
e5deca
	# update greylist
e5deca
	nm -u obj/%{kmod_kbuild_dir}/$modules.ko | sed 's/.*U //' |  sed 's/^\.//' | sort -u | while read -r symbol; do
e5deca
		grep -q "^\s*$symbol\$" $whitelist || echo "$symbol" >> source/greylist
e5deca
	done
e5deca
done
e5deca
sort -u source/greylist | uniq > source/greylist.txt
e5deca
e5deca
%install
e5deca
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
e5deca
export INSTALL_MOD_DIR=extra/%{name}
e5deca
make -C %{kernel_source} modules_install V=1 \
e5deca
	M=$PWD/obj/%{kmod_kbuild_dir}
e5deca
# Cleanup unnecessary kernel-generated module dependency files.
e5deca
find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \;
e5deca
e5deca
install -m 644 -D source/depmod.conf $RPM_BUILD_ROOT/etc/depmod.d/%{kmod_name}.conf
e5deca
install -m 644 -D source/greylist.txt $RPM_BUILD_ROOT/usr/share/doc/kmod-%{kmod_name}/greylist.txt
e5deca
e5deca
%clean
e5deca
rm -rf $RPM_BUILD_ROOT
e5deca
e5deca
%changelog
6f09de
* Fri Sep 30 2022 - Susan LeGendre-McGhee <slegendr@redhat.com> - 8.2.0.21-47
e5deca
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Mon Sep 26 2022 - Andy Walsh <awalsh@redhat.com> - 8.2.0.21-46
6f09de
- Fixed a bug where I/O errors on data reads from below a vdo were ignored.
6f09de
- Resolves: rhbz#2125708
6f09de
6f09de
* Wed Aug 24 2022 - Andy Walsh <awalsh@redhat.com> - 8.2.0.18-46
6f09de
- Temporarily dropped a check that validates the logical size specified from
6f09de
  the table line.
6f09de
- Related: rhbz#2071648
6f09de
6f09de
* Tue Aug 23 2022 - Andy Walsh <awalsh@redhat.com> - 8.2.0.18-45
6f09de
- Fixed a race handling timeouts of dedupe requests.
6f09de
- Resolves: rhbz#2115504
e5deca
6f09de
* Tue Aug 23 2022 - Susan LeGendre-McGhee <slegendr@redhat.com> - 8.2.0.2-45
e5deca
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
e5deca
6f09de
* Thu Aug 18 2022 - Susan LeGendre-McGhee <slegendr@redhat.com> - 8.2.0.2-44
e5deca
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
e5deca
6f09de
* Wed Aug 10 2022 - Chung Chung <cchung@redhat.com> - 8.2.0.2-43
e5deca
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Wed Jul 27 2022 - Andy Walsh <awalsh@redhat.com> - 8.2.0.2-42
6f09de
- Added missing lz4 libs to rebased code
6f09de
- Resolves: rhbz#2071648
e5deca
6f09de
* Tue Jul 19 2022 - Andy Walsh <awalsh@redhat.com> - 8.2.0.2-41
6f09de
- Rebased to latest upstream candidate.
6f09de
- Resolves: rhbz#2071648
6f09de
6f09de
* Sat Jul 16 2022 - Susan LeGendre-McGhee <slegendr@redhat.com> - 8.1.1.371-41
e5deca
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
e5deca
6f09de
* Fri Jul 15 2022 - Susan LeGendre-McGhee <slegendr@redhat.com> - 8.1.1.371-40
e5deca
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
e5deca
6f09de
* Mon Jul 11 2022 - Chung Chung <cchung@redhat.com> - 8.1.1.371-39
e5deca
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
e5deca
6f09de
* Tue Jul 05 2022 - Chung Chung <cchung@redhat.com> - 8.1.1.371-38
e5deca
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
e5deca
6f09de
* Mon Jul 04 2022 - Chung Chung <cchung@redhat.com> - 8.1.1.371-37
e5deca
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Tue Jun 28 2022 - Susan LeGendre-McGhee <slegendr@redhat.com> - 8.1.1.371-36
6f09de
- TEMPORARY FIX to correct build failures regarding bio_reset(), __bio_clone_fast(), and bio_init().
6f09de
- Related: rhbz#2060486
e5deca
6f09de
* Tue Jun 28 2022 - Susan LeGendre-McGhee <slegendr@redhat.com> - 8.1.1.371-36
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Sun Jun 26 2022 - Chung Chung <cchung@redhat.com> - 8.1.1.371-35
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Wed Jun 15 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.371-34
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Tue Jun 07 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.371-33
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Wed Jun 01 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.371-32
6f09de
- Rebased to newer version.
6f09de
- Related: rhbz#2071648
6f09de
6f09de
* Tue May 31 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-32
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Sat May 28 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-31
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Mon May 23 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-30
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Mon May 16 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-29
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Fri May 13 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-28
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Thu May 12 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-27
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Tue May 10 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-26
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Sat May 07 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-25
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Thu May 05 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-24
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Wed May 04 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-23
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Fri Apr 29 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-22
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Fri Apr 22 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-21
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Thu Apr 21 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-20
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Wed Apr 13 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-19
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Mon Apr 11 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-18
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Mon Mar 28 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-17
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
6f09de
6f09de
* Mon Mar 21 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-16
6f09de
- Rebuilt for latest kernel.
6f09de
- Related: rhbz#2060486
e5deca
e5deca
* Mon Feb 28 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-15
e5deca
- Rebuilt for latest kernel.
e5deca
- Related: rhbz#2000926
e5deca
e5deca
* Mon Feb 21 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-14
e5deca
- Rebuilt for latest kernel.
e5deca
- Related: rhbz#2000926
e5deca
e5deca
* Wed Feb 16 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-13
e5deca
- Rebuilt for latest kernel.
e5deca
- Related: rhbz#2000926
e5deca
e5deca
* Sat Feb 12 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.360-12
e5deca
- Fixed a compilation issue due to changes in stdarg.h.
e5deca
- Resolves: rhbz#2035003
e5deca
- Modified the UDS index to handle backing store changes while suspended.
e5deca
- Resolves: rhbz#2007803
e5deca
- Fixed a bug which prevented the resumption of a suspended read-only vdo.
e5deca
- Resolves: rhbz#2004206
e5deca
e5deca
* Thu Feb 03 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.287-12
e5deca
- Adjusted kernel dependencies to grab the right packages.
e5deca
- Resolves: rhbz#2022464
e5deca
- Rebuilt for latest kernel.
e5deca
- Related: rhbz#2000926
e5deca
e5deca
* Mon Jan 31 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.287-11
e5deca
- Rebuilt for latest kernel.
e5deca
- Related: rhbz#2000926
e5deca
e5deca
* Sun Jan 23 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.1.287-10
e5deca
- Eliminated uses of "master" as part of the conscious language initiative.
e5deca
- Resolves: rhbz#2023970
e5deca
- Fixed potential use-after-free error found by Coverity.
e5deca
- Resolves: rhbz#1999056
e5deca
- Fixed bug which could result in empty flushes being issued to the storage
e5deca
  below vdo while suspended.
e5deca
- Resolves: rhbz#2013057
e5deca
- Added optional table line parameters for enabling or disabling
e5deca
  deduplication and compression.
e5deca
- Resolves: rhbz#2007444
e5deca
- Adapted to kernel API changes.
e5deca
- Resolves: rhbz#2035003
e5deca
e5deca
* Thu Jan 06 2022 - Andy Walsh <awalsh@redhat.com> - 8.1.0.316-10
e5deca
- Rebuilt for latest kernel.
e5deca
- Related: rhbz#2000926
e5deca
- Temporarily disabled creation of sysfs nodes.
e5deca
- Related: rhbz#2035003
e5deca
e5deca
* Sun Dec 19 2021 - Andy Walsh <awalsh@redhat.com> - 8.1.0.316-9
e5deca
- Rebuilt for latest kernel.
e5deca
- Related: rhbz#2000926
e5deca
- Stopped using bvec_kmap_irq as it has been removed.
e5deca
- Removed usage of removed elevator constants
e5deca
- Resolves: rhbz#2035003
e5deca
e5deca
* Wed Dec 15 2021 - Andy Walsh <awalsh@redhat.com> - 8.1.0.316-8
e5deca
- Rebuilt for latest kernel.
e5deca
- Related: rhbz#2000926
e5deca
e5deca
* Tue Dec 07 2021 - Andy Walsh <awalsh@redhat.com> - 8.1.0.316-7
e5deca
- Rebuilt for latest kernel.
e5deca
- Related: rhbz#2000926
e5deca
e5deca
* Tue Dec 07 2021 - Andy Walsh <awalsh@redhat.com> - 8.1.0.316-6
e5deca
- Rebuilt for latest kernel.
e5deca
- Related: rhbz#2000926
e5deca
e5deca
* Thu Nov 11 2021 - Andy Walsh <awalsh@redhat.com> - 8.1.0.316-5
e5deca
- Rebuilt for latest kernel.
e5deca
- Related: rhbz#2000926
e5deca
e5deca
* Wed Oct 13 2021 - Andy Walsh <awalsh@redhat.com> - 8.1.0.316-4
e5deca
- Rebuilt for latest kernel.
e5deca
- Related: rhbz#2000926
e5deca
e5deca
* Thu Sep 30 2021 - Andy Walsh <awalsh@redhat.com> - 8.1.0.316-3
e5deca
- Rebuilt for latest kernel.
e5deca
- Related: rhbz#2000926
e5deca
e5deca
* Mon Aug 09 2021 - Andy Walsh <awalsh@redhat.com> - 8.1.0.316-2
e5deca
- Rebased to upstream candidate.
e5deca
- Resolves: rhbz#1955374
e5deca
e5deca
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 8.1.0.316-1.1
e5deca
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
e5deca
  Related: rhbz#1991688
e5deca
e5deca
* Sat Aug 07 2021 - Andy Walsh <awalsh@redhat.com> - 8.1.0.316-1
e5deca
- Rebased to upstream candidate.
e5deca
- Resolves: rhbz#1955374
e5deca
e5deca
* Thu Jul 29 2021 - Andy Walsh <awalsh@redhat.com> - 8.1.0.264-1
e5deca
- Rebased to upstream candidate.
e5deca
- Related: rhbz#1955374
e5deca
- Fixed GCC implicit-fallthrough errors when building for latest kernel
e5deca
- Resolves: rhbz#1984814
e5deca
e5deca
* Tue May 04 2021 - Andy Walsh <awalsh@redhat.com> - 8.1.0.4-1
e5deca
- Initial build for EL9
e5deca
- Related: rhbz#1955374