modzilla99 / rpms / kmod-kvdo

Forked from rpms/kmod-kvdo 3 years ago
Clone

Blame SPECS/kvdo.spec

cf0ddc
%global commit                  a1b364f3fac0a55766db62775157d620913400ba
cf0ddc
%global gittag                  6.1.0.171
8ac5a7
%global shortcommit             %(c=%{commit}; echo ${c:0:7})
8ac5a7
cf0ddc
%define spec_release            17
b241ce
b241ce
%define kmod_name		kvdo
cf0ddc
%define kmod_driver_version	%{gittag}
b241ce
%define kmod_rpm_release	%{spec_release}
b241ce
%define kmod_kernel_version	3.10.0-693.el7
b241ce
%define kmod_headers_version	%(rpm -qa kernel-devel | sed 's/^kernel-devel-//')
b241ce
%define kmod_kbuild_dir		.
b241ce
%define kmod_dependencies       %{nil}
b241ce
%define kmod_build_dependencies	%{nil}
b241ce
%define kmod_devel_package	0
b241ce
b241ce
%{!?dist: %define dist .el7_4}
b241ce
8ac5a7
Source0:        https://github.com/dm-vdo/%{kmod_name}/archive/%{commit}/%{kmod_name}-%{shortcommit}.tar.gz
b241ce
%{nil}
b241ce
b241ce
%define findpat %( echo "%""P" )
b241ce
%define __find_requires /usr/lib/rpm/redhat/find-requires.ksyms
b241ce
%define __find_provides /usr/lib/rpm/redhat/find-provides.ksyms %{kmod_name} %{?epoch:%{epoch}:}%{version}-%{release}
b241ce
%define sbindir %( if [ -d "/sbin" -a \! -h "/sbin" ]; then echo "/sbin"; else echo %{_sbindir}; fi )
b241ce
b241ce
Name:		kmod-kvdo
b241ce
Version:	%{kmod_driver_version}
b241ce
Release:	%{kmod_rpm_release}%{?dist}
b241ce
Summary:	Kernel Modules for Virtual Data Optimizer
b241ce
License:	GPLv2+
b241ce
URL:		http://github.com/dm-vdo/kvdo
b241ce
BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
b241ce
BuildRequires:	kernel-devel >= %{kmod_kernel_version}
b241ce
BuildRequires:  redhat-rpm-config
b241ce
BuildRequires:  kernel-debug >= %{kmod_kernel_version}
b241ce
BuildRequires:	glibc
b241ce
BuildRequires:	kernel-abi-whitelists
b241ce
BuildRequires:  libuuid-devel
b241ce
ExclusiveArch:	x86_64
b241ce
ExcludeArch:    s390
b241ce
ExcludeArch:    s390x
b241ce
ExcludeArch:    ppc
b241ce
ExcludeArch:    ppc64
b241ce
ExcludeArch:    ppc64le
b241ce
ExcludeArch:    aarch64
b241ce
ExcludeArch:    i686
b241ce
%global kernel_source() /usr/src/kernels/%{kmod_headers_version}
b241ce
b241ce
%global _use_internal_dependency_generator 0
b241ce
Provides:	kernel-modules = %{kmod_kernel_version}.%{_target_cpu}
b241ce
Provides:	kmod-%{kmod_name} = %{?epoch:%{epoch}:}%{version}-%{release}
b241ce
Requires(post):	%{sbindir}/weak-modules
b241ce
Requires(postun):	%{sbindir}/weak-modules
b241ce
Requires:	kernel >= %{kmod_kernel_version}
b241ce
%if 0
b241ce
Requires: firmware(%{kmod_name}) = ENTER_FIRMWARE_VERSION
b241ce
%endif
b241ce
%if "%{kmod_build_dependencies}" != ""
b241ce
BuildRequires:  %{kmod_build_dependencies}
b241ce
%endif
b241ce
%if "%{kmod_dependencies}" != ""
b241ce
Requires:       %{kmod_dependencies}
b241ce
%endif
b241ce
# if there are multiple kmods for the same driver from different vendors,
b241ce
# they should conflict with each other.
b241ce
Conflicts:	kmod-%{kmod_name}
b241ce
b241ce
%description
b241ce
Virtual Data Optimizer (VDO) is a device mapper target that delivers
b241ce
block-level deduplication, compression, and thin provisioning.
b241ce
b241ce
This package provides the kernel modules for VDO.
b241ce
b241ce
%if 0
b241ce
b241ce
%package -n kmod-kvdo-firmware
b241ce
Version:	ENTER_FIRMWARE_VERSION
b241ce
Summary:	Kernel Modules for Virtual Data Optimizer
b241ce
Provides:	firmware(%{kmod_name}) = ENTER_FIRMWARE_VERSION
b241ce
Provides:	kernel-modules = %{kmod_kernel_version}.%{_target_cpu}
b241ce
%description -n  kmod-kvdo-firmware
b241ce
Virtual Data Optimizer (VDO) is a device mapper target that delivers
b241ce
block-level deduplication, compression, and thin provisioning.
b241ce
b241ce
This package provides the firmware for VDO.
b241ce
b241ce
%files -n kmod-kvdo-firmware
b241ce
%defattr(644,root,root,755)
b241ce
%{FIRMWARE_FILES}
b241ce
b241ce
%endif
b241ce
b241ce
# Development package
b241ce
%if 0%{kmod_devel_package}
b241ce
%package -n kmod-kvdo-devel
b241ce
Version:	%{kmod_driver_version}
b241ce
Requires:	kernel >= %{kmod_kernel_version}
b241ce
Summary:	Kernel Modules for Virtual Data Optimizer
b241ce
b241ce
%description -n  kmod-kvdo-devel
b241ce
Virtual Data Optimizer (VDO) is a device mapper target that delivers
b241ce
block-level deduplication, compression, and thin provisioning.
b241ce
b241ce
This package provides the development files for VDO.
b241ce
b241ce
%files -n kmod-kvdo-devel
b241ce
%defattr(644,root,root,755)
b241ce
/usr/share/kmod-%{kmod_name}/Module.symvers
b241ce
%endif
b241ce
b241ce
%post
b241ce
modules=( $(find /lib/modules/%{kmod_headers_version}/extra/kmod-%{kmod_name} | grep '\.ko$') )
b241ce
printf '%s\n' "${modules[@]}" >> /var/lib/rpm-kmod-posttrans-weak-modules-add
b241ce
b241ce
%pretrans -p <lua>
b241ce
posix.unlink("/var/lib/rpm-kmod-posttrans-weak-modules-add")
b241ce
b241ce
%posttrans
b241ce
if [ -f "/var/lib/rpm-kmod-posttrans-weak-modules-add" ]; then
b241ce
	modules=( $(cat /var/lib/rpm-kmod-posttrans-weak-modules-add) )
b241ce
	rm -rf /var/lib/rpm-kmod-posttrans-weak-modules-add
b241ce
	printf '%s\n' "${modules[@]}" | %{sbindir}/weak-modules --add-modules
b241ce
fi
b241ce
b241ce
%preun
b241ce
rpm -ql kmod-kvdo-%{kmod_driver_version}-%{kmod_rpm_release}%{?dist}.$(arch) | grep '\.ko$' > /var/run/rpm-kmod-%{kmod_name}-modules
b241ce
b241ce
# Check whether kvdo or uds is loaded, and if so attempt to remove it.  A
b241ce
# failure here means there is still something using the module, which should be
b241ce
# cleared up before attempting to remove again.
b241ce
for module in kvdo uds; do
b241ce
  if grep -q "^${module}" /proc/modules; then
b241ce
    modprobe -r ${module}
b241ce
  fi
b241ce
done
b241ce
b241ce
%postun
b241ce
modules=( $(cat /var/run/rpm-kmod-%{kmod_name}-modules) )
b241ce
rm /var/run/rpm-kmod-%{kmod_name}-modules
b241ce
printf '%s\n' "${modules[@]}" | %{sbindir}/weak-modules --remove-modules
b241ce
b241ce
%files
b241ce
%defattr(644,root,root,755)
b241ce
/lib/modules/%{kmod_headers_version}
b241ce
/etc/depmod.d/%{kmod_name}.conf
b241ce
/usr/share/doc/kmod-%{kmod_name}/greylist.txt
b241ce
b241ce
%prep
8ac5a7
%setup -n %{kmod_name}-%{commit}
b241ce
%{nil}
b241ce
set -- *
b241ce
mkdir source
b241ce
mv "$@" source/
b241ce
mkdir obj
b241ce
b241ce
%build
b241ce
rm -rf obj
b241ce
cp -r source obj
b241ce
make -C %{kernel_source} M=$PWD/obj/%{kmod_kbuild_dir} V=1 \
b241ce
	NOSTDINC_FLAGS="-I $PWD/obj/include -I $PWD/obj/include/uapi"
b241ce
# mark modules executable so that strip-to-file can strip them
b241ce
find obj/%{kmod_kbuild_dir} -name "*.ko" -type f -exec chmod u+x '{}' +
b241ce
b241ce
whitelist="/lib/modules/kabi-current/kabi_whitelist_%{_target_cpu}"
b241ce
for modules in $( find obj/%{kmod_kbuild_dir} -name "*.ko" -type f -printf "%{findpat}\n" | sed 's|\.ko$||' | sort -u ) ; do
b241ce
	# update depmod.conf
b241ce
	module_weak_path=$(echo $modules | sed 's/[\/]*[^\/]*$//')
b241ce
	if [ -z "$module_weak_path" ]; then
b241ce
		module_weak_path=%{name}
b241ce
	else
b241ce
		module_weak_path=%{name}/$module_weak_path
b241ce
	fi
b241ce
	echo "override $(echo $modules | sed 's/.*\///') $(echo %{kmod_headers_version} | sed 's/\.[^\.]*$//').* weak-updates/$module_weak_path" >> source/depmod.conf
b241ce
b241ce
	# update greylist
b241ce
	nm -u obj/%{kmod_kbuild_dir}/$modules.ko | sed 's/.*U //' |  sed 's/^\.//' | sort -u | while read -r symbol; do
b241ce
		grep -q "^\s*$symbol\$" $whitelist || echo "$symbol" >> source/greylist
b241ce
	done
b241ce
done
b241ce
sort -u source/greylist | uniq > source/greylist.txt
b241ce
b241ce
%install
b241ce
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
b241ce
export INSTALL_MOD_DIR=extra/%{name}
b241ce
make -C %{kernel_source} modules_install V=1 \
b241ce
	M=$PWD/obj/%{kmod_kbuild_dir}
b241ce
# Cleanup unnecessary kernel-generated module dependency files.
b241ce
find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \;
b241ce
b241ce
install -m 644 -D source/depmod.conf $RPM_BUILD_ROOT/etc/depmod.d/%{kmod_name}.conf
b241ce
install -m 644 -D source/greylist.txt $RPM_BUILD_ROOT/usr/share/doc/kmod-%{kmod_name}/greylist.txt
b241ce
%if 0
b241ce
%{FIRMWARE_FILES_INSTALL}
b241ce
%endif
b241ce
%if 0%{kmod_devel_package}
b241ce
install -m 644 -D $PWD/obj/%{kmod_kbuild_dir}/Module.symvers $RPM_BUILD_ROOT/usr/share/kmod-%{kmod_name}/Module.symvers
b241ce
%endif
b241ce
b241ce
%clean
b241ce
rm -rf $RPM_BUILD_ROOT
b241ce
b241ce
%changelog
cf0ddc
* Mon Jun 11 2018 - Andy Walsh <awalsh@redhat.com> - 6.1.0.171-17
cf0ddc
- Bumped NVR to maintain kABI compatibility.
cf0ddc
- Resolves: rhbz#1578421
cf0ddc
cf0ddc
* Sat May 19 2018 - Andy Walsh <awalsh@redhat.com> - 6.1.0.171-16
cf0ddc
- Fixed a bug which prevented disabling of the UDS index.
cf0ddc
- Resolves: rhbz#1578421
cf0ddc
8ac5a7
* Sun Apr 29 2018 - Andy Walsh <awalsh@redhat.com> - 6.1.0.168-16
8ac5a7
- Updated source to use GitHub
8ac5a7
- Fixed module version checking for upgrades.
8ac5a7
- Removed debug kernel requirement from spec file.
8ac5a7
- Fixed a deadlock resulting from sleeping while holding a spinlock while
8ac5a7
  getting statistics.
8ac5a7
- Resolves: rhbz#1567742
8ac5a7
- Fixed bugs arising from attempts to access sysfs nodes during startup and
8ac5a7
  shutdown.
8ac5a7
- Resolves: rhbz#1567744
8ac5a7
- Removed the prepare_ioctl() function to avoid signature changes since this
8ac5a7
  function currently does nothing.
8ac5a7
- Resolves: rhbz#1572494
8ac5a7
b241ce
* Tue Feb 27 2018 - Andy Walsh <awalsh@redhat.com> - 6.1.0.153-15
b241ce
- Fixed preun handling of loaded modules
b241ce
- Resolves: rhbz#1549178
b241ce
b241ce
* Fri Feb 16 2018 - Joseph Chapman <jochapma@redhat.com> - 6.1.0.149-13
b241ce
- Sync mode is safe if underlying storage changes to requiring flushes
b241ce
- Resolves: rhbz#1540777
b241ce
b241ce
* Wed Feb 07 2018 - Joseph Chapman <jochapma@redhat.com> - 6.1.0.146-13
b241ce
- Module target is now "vdo" instead of "dedupe"
b241ce
- Fixed a bug where crash recovery led to failed kernel page request
b241ce
- Improved modification log messages
b241ce
- Improved package description and summary fields
b241ce
- Resolves: rhbz#1535127
b241ce
- Resolves: rhbz#1535597
b241ce
- Resolves: rhbz#1540696
b241ce
- Resolves: rhbz#1541409
b241ce
b241ce
* Tue Feb 06 2018 - Andy Walsh <awalsh@redhat.com> - 6.1.0.144-13
b241ce
- Updated summary and descriptions
b241ce
- Resolves: rhbz#1541409
b241ce
b241ce
* Thu Feb 01 2018 - Joseph Chapman <jochapma@redhat.com> - 6.1.0.130-12
b241ce
- Fix General Protection Fault unlocking UDS callback mutex
b241ce
- Removing kmod-kvdo package unloads kernel module
b241ce
- Fix URL to point to GitHub tree
b241ce
- Resolves: rhbz#1510176
b241ce
- Resolves: rhbz#1533260
b241ce
- Resolves: rhbz#1539061
b241ce
b241ce
* Fri Jan 19 2018 - Joseph Chapman <jochapma@redhat.com> - 6.1.0.124-11
b241ce
- Fixed provisional referencing for dedupe.
b241ce
- Only log a bio submission from a VDO to itself.
b241ce
- vdoformat cleans up metadata properly after fail.
b241ce
- Resolves: rhbz#1511587
b241ce
- Resolves: rhbz#1520972
b241ce
- Resolves: rhbz#1532481
b241ce
b241ce
* Wed Jan 10 2018 - Joseph Chapman <jochapma@redhat.com> - 6.1.0.114-11
b241ce
- /sys/uds permissions now resticted to superuser only
b241ce
- Remove /sys/uds files that should not be used in production
b241ce
- Removing kvdo module reports version
b241ce
- VDO automatically chooses the proper write policy by default
b241ce
- Fixed a Coverity-detected error path leak
b241ce
- Resolves: rhbz#1525305
b241ce
- Resolves: rhbz#1527734
b241ce
- Resolves: rhbz#1527737
b241ce
- Resolves: rhbz#1527924
b241ce
- Resolves: rhbz#1528399
b241ce
b241ce
* Thu Dec 21 2017 - Joseph Chapman <jochapma@redhat.com> - 6.1.0.106-11
b241ce
- Detect journal overflow after 160E of writes
b241ce
- Clean up UDS threads when removing last VDO
b241ce
- Resolves: rhbz#1512968
b241ce
- Resolves: rhbz#1523240
b241ce
b241ce
* Tue Dec 12 2017 Joe Chapman <jochapma@redhat.com> 6.1.0.97-11
b241ce
- Default logical size is no longer over-provisioned
b241ce
- Remove debug logging when verifying dedupe advice
b241ce
- Resolves: rhbz#1519330
b241ce
b241ce
* Fri Dec 08 2017 Joe Chapman <jochapma@redhat.com> 6.1.0.89-11
b241ce
- improve metadata cleanup after vdoformat failure
b241ce
- log REQ_FLUSH & REQ_FUA at level INFO
b241ce
- improve performance of cuncurrent write requests with the same data
b241ce
- Resolves: rhbz#1520972
b241ce
- Resolves: rhbz#1521200
b241ce
b241ce
* Fri Dec 01 2017 Joe Chapman <jochapma@redhat.com> 6.1.0.72-10
b241ce
- clear VDO metadata on a vdo remove call
b241ce
- fix create of new dedupe indices
b241ce
- add magic number to VDO geometry block
b241ce
- do less logging when stopping a VDO
b241ce
- add a UUID
b241ce
- Resolves: rhbz#1512127
b241ce
- Resolves: rhbz#1516081
b241ce
- Resolves: rhbz#1511109
b241ce
- Resolves: rhbz#1515183
b241ce
b241ce
* Fri Nov 17 2017 Joe Chapman <jochapma@redhat.com> 6.1.0.55-9
b241ce
- fail loading an uncreated index more gracefully
b241ce
- remove spurious/unnecessary files from the distribution
b241ce
- fix kernel module version
b241ce
- make logging less chatty
b241ce
- fix an integer overflow in makeVDOLayout
b241ce
- Resolves: rhbz#1511034
b241ce
- Resolves: rhbz#1511109
b241ce
- Resolves: rhbz#1511096
b241ce
b241ce
* Fri Nov 10 2017 Joe Chapman <jochapma@redhat.com> 6.1.0.44-8
b241ce
- fix readCacheSize handling large numbers
b241ce
- vdoformat signals error when it finds a geometry block
b241ce
- prevent kernel oops when loading an old geometry block
b241ce
- vdoformat silently rounds down physical sizes to a block boundary
b241ce
- UDS threads identify related VDO device
b241ce
- clean up contents of source tarballs
b241ce
- Resolves: rhbz#1505936
b241ce
- Resolves: rhbz#1507996
b241ce
- Resolves: rhbz#1509466
b241ce
- Resolves: rhbz#1510558
b241ce
- Resolves: rhbz#1510585
b241ce
- Resolves: rhbz#1511201
b241ce
- Resolves: rhbz#1511209
b241ce
b241ce
* Fri Nov 03 2017 Joe Chapman <jochapma@redhat.com> 6.1.0.34-7
b241ce
- Bugfixes
b241ce
- Resolves: rhbz#1491422
b241ce
b241ce
* Mon Oct 30 2017 Joe Chapman <jochapma@redhat.com> 6.1.0.13-6
b241ce
- Fixed some scanning tool complaints
b241ce
- Resolves: rhbz#1491422
b241ce
b241ce
* Tue Oct 24 2017 Andy Walsh <awalsh@redhat.com> 6.1.0.0-6
b241ce
- Fixed kernel requirement to allow subsequent releases without updating spec
b241ce
- Resolves: rhbz#1491422
b241ce
b241ce
* Fri Oct 20 2017 John Wiele <jwiele@redhat.com> 6.1.0.0-5
b241ce
- Bumped kernel requirement to 3.10.0-741
b241ce
- Resolves: rhbz#1491422
b241ce
b241ce
* Tue Oct 17 2017 John Wiele <jwiele@redhat.com> 6.1.0.0-4
b241ce
- Resolved some missing symbols
b241ce
- Resolves: rhbz#1491422
b241ce
b241ce
* Mon Oct 16 2017 John Wiele <jwiele@redhat.com> 6.1.0.0-3
b241ce
- Updated to provide a useable package
b241ce
- Resolves: rhbz#1491422
b241ce
b241ce
* Sat Oct 14 2017 Andy Walsh <awalsh@redhat.com> 6.1.0.0-2
b241ce
- Removed invalid requirement and some unnecessary comments in spec
b241ce
- Resolves: rhbz#1491422
b241ce
b241ce
* Wed Oct 11 2017 John Wiele <jwiele@redhat.com> 6.1.0.0-1
b241ce
- Initial vdo module for Driver Update Program
b241ce
- Resolves: rhbz#1491422