%global commit 3f9bde55d3d6bd6083af31a11eb2ac066904f581 %global gittag 6.30.223.271 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %define spec_release 5.14.0_39 %define kmod_name wl %define kmod_driver_version %{gittag} %define kmod_rpm_release %{spec_release} %define kmod_kernel_version 5.14.0-39 %define kmod_headers_version %(rpm -qa kernel-devel | sed 's/^kernel-devel-//') %define kmod_kbuild_dir . %define kmod_devel_package 0 Source0: hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz Patch001: wl-kmod-001_wext_workaround.patch Patch002: wl-kmod-002_kernel_3.18_null_pointer.patch Patch003: wl-kmod-003_gcc_4.9_remove_TIME_DATE_macros.patch Patch004: wl-kmod-004_kernel_4.3_rdtscl_to_rdtsc.patch Patch005: wl-kmod-005_kernel_4.7_IEEE80211_BAND_to_NL80211_BAND.patch Patch006: wl-kmod-006_gcc_6_fix_indentation_warnings.patch Patch007: wl-kmod-007_kernel_4.8_add_cfg80211_scan_info_struct.patch Patch008: wl-kmod-008_fix_kernel_warnings.patch Patch009: wl-kmod-009_kernel_4.11_remove_last_rx_in_net_device_struct.patch Patch010: wl-kmod-010_kernel_4.12_add_cfg80211_roam_info_struct.patch Patch011: wl-kmod-011_kernel_4.14_new_kernel_read_function_prototype.patch Patch012: wl-kmod-012_kernel_4.15_new_timer.patch Patch013: wl-kmod-013_gcc8_fix_bounds_check_warnings.patch Patch014: wl-kmod-014_kernel_read_pos_increment_fix.patch Patch015: wl-kmod-015_kernel_5.1_get_ds_removed.patch Patch016: wl-kmod-016_fix_unsupported_mesh_point.patch Patch017: wl-kmod-017_fix_gcc_fallthrough_warning.patch Patch018: wl-kmod-018_kernel_5.6_adaptations.patch Patch019: wl-kmod-019_kernel_5.9_segment_eq_removed.patch Patch020: wl-kmod-020_kernel_5.10_get_set_fs_removed.patch %define findpat %( echo "%""P" ) Name: kmod-wl Version: %{kmod_driver_version} Release: %{kmod_rpm_release}%{?dist}.frs Summary: Kernel Modules for Virtual Data Optimizer License: GPLv2+ URL: http://github.com/dm-vdo/wl BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRequires: elfutils-libelf-devel BuildRequires: glibc BuildRequires: kernel-devel >= %{kmod_kernel_version} # Disable the kernel-debug requirement for now BuildRequires: libuuid-devel BuildRequires: redhat-rpm-config ExcludeArch: i686 ExcludeArch: ppc ExcludeArch: ppc64 ExcludeArch: s390 %global kernel_source() /usr/src/kernels/%{kmod_headers_version} %global _use_internal_dependency_generator 0 Provides: kernel-modules = %{kmod_kernel_version}.%{_target_cpu} Provides: kmod-%{kmod_name} = %{?epoch:%{epoch}:}%{version}-%{release} Requires(post): %{_sbindir}/weak-modules Requires(postun): %{_sbindir}/weak-modules Requires: kernel >= %{kmod_kernel_version} Requires: kernel-core-uname-r >= %{kmod_kernel_version} %description Virtual Data Optimizer (VDO) is a device mapper target that delivers block-level deduplication, compression, and thin provisioning. This package provides the kernel modules for VDO. %pre # During the install, check whether wl or uds is loaded. A warning here # indicates that a previous install was not completely removed. This message # is purely informational to the user. for module in wl uds; do if grep -q "^${module}" /proc/modules; then if [ "${module}" == "wl" ]; then echo "WARNING: Found ${module} module previously loaded (Version: $(cat /sys/wl/version 2>/dev/null || echo Unknown)). A reboot is recommended before attempting to use the newly installed module." else echo "WARNING: Found ${module} module previously loaded. A reboot is recommended before attempting to use the newly installed module." fi fi done %post modules=( $(find /lib/modules/%{kmod_headers_version}/extra/kmod-%{kmod_name} | grep '\.ko$') ) printf '%s\n' "${modules[@]}" >> /var/lib/rpm-kmod-posttrans-weak-modules-add %pretrans -p posix.unlink("/var/lib/rpm-kmod-posttrans-weak-modules-add") %posttrans if [ -f "/var/lib/rpm-kmod-posttrans-weak-modules-add" ]; then modules=( $(cat /var/lib/rpm-kmod-posttrans-weak-modules-add) ) rm -rf /var/lib/rpm-kmod-posttrans-weak-modules-add printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --dracut=/usr/bin/dracut --add-modules fi %preun rpm -ql kmod-wl-%{kmod_driver_version}-%{kmod_rpm_release}%{?dist}.$(arch) | grep '\.ko$' > /var/run/rpm-kmod-%{kmod_name}-modules # Check whether wl or uds is loaded, and if so attempt to remove it. A # failure to unload means there is still something using the module. To make # sure the user is aware, we print a warning with recommended instructions. for module in wl uds; do if grep -q "^${module}" /proc/modules; then warnMessage="WARNING: ${module} in use. Changes will take effect after a reboot." modprobe -r ${module} 2>/dev/null || echo ${warnMessage} && /usr/bin/true fi done %postun modules=( $(cat /var/run/rpm-kmod-%{kmod_name}-modules) ) rm /var/run/rpm-kmod-%{kmod_name}-modules printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --dracut=/usr/bin/dracut --remove-modules %files %defattr(644,root,root,755) /lib/modules/%{kmod_headers_version} /etc/depmod.d/%{kmod_name}.conf /usr/share/doc/kmod-%{kmod_name}/greylist.txt %prep %setup -c -n %{kmod_name}-%{commit} %patch001 -p1 -b .wext_workaround %patch002 -p1 -b .kernel_3.18_null_pointer %patch003 -p1 -b .gcc_4.9_remove_TIME_DATE_macros %patch004 -p1 -b .kernel_4.3_rdtscl_to_rdtsc %patch005 -p1 -b .kernel_4.7_IEEE80211_BAND_to_NL80211_BAND %patch006 -p1 -b .gcc_6_fix_indentation_warnings %patch007 -p1 -b .kernel_4.8_add_cfg80211_scan_info_struct %patch008 -p1 -b .fix_kernel_warnings %patch009 -p1 -b .kernel_4.11_remove_last_rx_in_net_device_struct %patch010 -p1 -b .kernel_4.12_add_cfg80211_roam_info_struct %patch011 -p1 -b .kernel_4.14_new_kernel_read_function_prototype %patch012 -p1 -b .kernel_4.15_new_timer %patch013 -p1 -b .gcc8_fix_bounds_check_warnings %patch014 -p1 -b .kernel_read_pos_increment_fix %patch015 -p1 -b .kernel_5.1_get_ds_removed %patch016 -p1 -b .fix_unsupported_mesh_point %patch017 -p1 -b .fix_gcc_fallthrough_warning %patch018 -p1 -b .kernel_5.6_adaptations %patch019 -p1 -b .kernel_5.9_segment_eq_removed %patch020 -p1 -b .kernel_5.10_get_set_fs_removed %{nil} set -- * mkdir source mv "$@" source/ mkdir obj %build rm -rf obj cp -r source obj make -C %{kernel_source} M=$PWD/obj/%{kmod_kbuild_dir} V=1 \ NOSTDINC_FLAGS="-I $PWD/obj/include -I $PWD/obj/include/uapi" # mark modules executable so that strip-to-file can strip them find obj/%{kmod_kbuild_dir} -name "*.ko" -type f -exec chmod u+x '{}' + whitelist="/lib/modules/kabi-current/kabi_whitelist_%{_target_cpu}" for modules in $( find obj/%{kmod_kbuild_dir} -name "*.ko" -type f -printf "%{findpat}\n" | sed 's|\.ko$||' | sort -u ) ; do # update depmod.conf module_weak_path=$(echo $modules | sed 's/[\/]*[^\/]*$//') if [ -z "$module_weak_path" ]; then module_weak_path=%{name} else module_weak_path=%{name}/$module_weak_path fi echo "override $(echo $modules | sed 's/.*\///') $(echo %{kmod_headers_version} | sed 's/\.[^\.]*$//').* weak-updates/$module_weak_path" >> source/depmod.conf # update greylist nm -u obj/%{kmod_kbuild_dir}/$modules.ko | sed 's/.*U //' | sed 's/^\.//' | sort -u | while read -r symbol; do grep -q "^\s*$symbol\$" $whitelist || echo "$symbol" >> source/greylist done done sort -u source/greylist | uniq > source/greylist.txt %install export INSTALL_MOD_PATH=$RPM_BUILD_ROOT export INSTALL_MOD_DIR=extra/%{name} make -C %{kernel_source} modules_install V=1 \ M=$PWD/obj/%{kmod_kbuild_dir} # Cleanup unnecessary kernel-generated module dependency files. find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \; install -m 644 -D source/depmod.conf $RPM_BUILD_ROOT/etc/depmod.d/%{kmod_name}.conf install -m 644 -D source/greylist.txt $RPM_BUILD_ROOT/usr/share/doc/kmod-%{kmod_name}/greylist.txt %clean rm -rf $RPM_BUILD_ROOT %changelog * Thu Jan 06 2022 - Andy Walsh - 8.1.0.316-10 - Rebuilt for latest kernel. - Related: rhbz#2000926 - Temporarily disabled creation of sysfs nodes. - Related: rhbz#2035003 * Sun Dec 19 2021 - Andy Walsh - 8.1.0.316-9 - Rebuilt for latest kernel. - Related: rhbz#2000926 - Stopped using bvec_kmap_irq as it has been removed. - Removed usage of removed elevator constants - Resolves: rhbz#2035003 * Wed Dec 15 2021 - Andy Walsh - 8.1.0.316-8 - Rebuilt for latest kernel. - Related: rhbz#2000926 * Tue Dec 07 2021 - Andy Walsh - 8.1.0.316-7 - Rebuilt for latest kernel. - Related: rhbz#2000926 * Tue Dec 07 2021 - Andy Walsh - 8.1.0.316-6 - Rebuilt for latest kernel. - Related: rhbz#2000926 * Thu Nov 11 2021 - Andy Walsh - 8.1.0.316-5 - Rebuilt for latest kernel. - Related: rhbz#2000926 * Wed Oct 13 2021 - Andy Walsh - 8.1.0.316-4 - Rebuilt for latest kernel. - Related: rhbz#2000926 * Thu Sep 30 2021 - Andy Walsh - 8.1.0.316-3 - Rebuilt for latest kernel. - Related: rhbz#2000926 * Mon Aug 09 2021 - Andy Walsh - 8.1.0.316-2 - Rebased to upstream candidate. - Resolves: rhbz#1955374 * Mon Aug 09 2021 Mohan Boddu - 8.1.0.316-1.1 - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags Related: rhbz#1991688 * Sat Aug 07 2021 - Andy Walsh - 8.1.0.316-1 - Rebased to upstream candidate. - Resolves: rhbz#1955374 * Thu Jul 29 2021 - Andy Walsh - 8.1.0.264-1 - Rebased to upstream candidate. - Related: rhbz#1955374 - Fixed GCC implicit-fallthrough errors when building for latest kernel - Resolves: rhbz#1984814 * Tue May 04 2021 - Andy Walsh - 8.1.0.4-1 - Initial build for EL9 - Related: rhbz#1955374