Blame SPECS/iwlwifi.spec

deb259
%define kmod_name		iwlwifi
deb259
%define kmod_vendor		redhat
deb259
%define kmod_driver_version	4.18.0_107_dup8.0
deb259
%define kmod_driver_epoch	%{nil}
deb259
%define kmod_rpm_release	5
deb259
%define kmod_kernel_version	4.18.0-80.el8
deb259
%define kmod_kernel_version_min	%{nil}
deb259
%define kmod_kernel_version_dep	%{nil}
deb259
%define kmod_kbuild_dir		drivers/net/wireless/intel/iwlwifi
deb259
%define kmod_dependencies       (dracut >= 049-10.git20190115.el8_0.1 if kernel > 4.18.0-80.el8)
deb259
%define kmod_dist_build_deps	%{nil}
deb259
%define kmod_build_dependencies	%{nil}
deb259
%define kmod_devel_package	1
deb259
%define kmod_install_path	extra/kmod-redhat-iwlwifi
deb259
%define kernel_pkg		kernel
deb259
%define kernel_devel_pkg	kernel-devel
deb259
%define kernel_modules_pkg	kernel-modules
deb259
deb259
%{!?dist: %define dist .el8_0}
deb259
%{!?make_build: %define make_build make}
deb259
deb259
%if "%{kmod_kernel_version_dep}" == ""
deb259
%define kmod_kernel_version_dep %{kmod_kernel_version}
deb259
%endif
deb259
deb259
%if "%{kmod_dist_build_deps}" == ""
deb259
%if (0%{?rhel} > 7) || (0%{?centos} > 7)
deb259
%define kmod_dist_build_deps redhat-rpm-config kernel-abi-whitelists elfutils-libelf-devel kernel-rpm-macros kmod
deb259
%else
deb259
%define kmod_dist_build_deps redhat-rpm-config kernel-abi-whitelists
deb259
%endif
deb259
%endif
deb259
deb259
Source0:	%{kmod_name}-%{kmod_vendor}-%{kmod_driver_version}.tar.bz2
deb259
# Source code patches
deb259
Patch0:	0001-Revert-netlink-make-validation-more-configurable-for.patch
deb259
Patch1:	0002-Revert-iwlwifi-mvm-fix-merge-damage-in-iwl_mvm_vif_d.patch
deb259
Patch2:	0003-Revert-iwlwifi-mvm-fix-pointer-reference-when-settin.patch
deb259
Patch3:	0004-Revert-iwlwifi-remove-unnecessary-goto-out-in-iwl_pa.patch
deb259
Patch4:	0005-Revert-iwlwifi-Use-struct_size-in-kzalloc.patch
deb259
Patch5:	0006-Revert-mac80211-update-HE-IEs-to-D3.3.patch
deb259
Patch6:	0007-Revert-iwlwifi-mvm-report-FTM-start-time-TSF-when-ap.patch
deb259
Patch7:	0008-Revert-iwlwifi-mvm-support-rtt-confidence-indication.patch
deb259
Patch8:	0009-Revert-iwlwifi-fix-64-bit-division.patch
deb259
Patch9:	0010-Revert-iwlwifi-mvm-add-debug-prints-for-FTM.patch
deb259
Patch10:	0011-Revert-iwlwifi-mvm-add-support-for-new-FTM-fw-API.patch
deb259
Patch11:	0012-Revert-iwlwifi-mvm-support-FTM-initiator.patch
deb259
Patch12:	0013-Revert-iwlwifi-mvm-support-FTM-responder.patch
deb259
Patch13:	0014-Revert-iwlwifi-mvm-support-HE-context-cmd-API-change.patch
deb259
Patch14:	0015-Revert-iwlwifi-mvm-support-multiple-BSSID.patch
deb259
Patch15:	0016-Revert-iwlwifi-mvm-advertise-support-for-TWT-in-the-.patch
deb259
Patch16:	0017-Revert-iwlwifi-mvm-limit-AMSDU-size-to-8K.patch
deb259
Patch17:	0018-Revert-iwlwifi-mvm-bring-back-mvm-GSO-code.patch
deb259
Patch18:	0019-Revert-iwlwifi-mvm-support-mac80211-AMSDU.patch
deb259
Patch19:	0020-Revert-iwlwifi-mvm-remove-redundant-condition.patch
deb259
Patch20:	0021-Revert-iwlwifi-mvm-stop-static-queues-correctly.patch
deb259
Patch21:	0022-Revert-iwlwifi-mvm-remove-buggy-and-unnecessary-hw_q.patch
deb259
Patch22:	0023-Revert-iwlwifi-mvm-support-mac80211-TXQs-model.patch
deb259
Patch23:	0024-Revert-iwlwifi-nvm-parse-advertise-IEEE80211_VHT_EXT.patch
deb259
Patch24:	0025-Revert-iwlwifi-mvm-set-HW-capability-VHT_EXT_NSS_BW.patch
deb259
Patch25:	0026-Revert-iwlwifi-mvm-config-mac-ctxt-to-HE-before-TLC.patch
deb259
Patch26:	0027-Revert-iwlwifi-mvm-send-the-STA_HE_CTXT-command-in-A.patch
deb259
Patch27:	0028-Revert-iwlwifi-trust-calling-function.patch
deb259
Patch28:	0029-Revert-iwlwifi-split-HE-capabilities-between-AP-and-.patch
deb259
Patch29:	0030-Revert-wireless-align-to-draft-11ax-D3.0.patch
deb259
Patch30:	0031-Revert-iwlwifi-add-module-parameter-to-disable-802.1.patch
deb259
Patch31:	0032-Revert-iwlwifi-mvm-limit-TLC-according-to-our-HE-cap.patch
deb259
Patch32:	0033-Revert-iwlwifi-rs-consider-LDPC-capability-in-case-o.patch
deb259
Patch33:	0034-Revert-iwlwifi-mvm-fix-HE-radiotap-data4-for-HE-TB-P.patch
deb259
Patch34:	0035-Revert-iwlwifi-mvm-radiotap-remove-UL_DL-bit-in-HE-T.patch
deb259
Patch35:	0036-Revert-iwlwifi-mvm-report-all-NO_DATA-events-to-mac8.patch
deb259
Patch36:	0037-Revert-iwlwifi-mvm-fix-the-spatial-reuse-parsing-for.patch
deb259
Patch37:	0038-Revert-iwlwifi-mvm-clean-up-NO_PSDU-case.patch
deb259
Patch38:	0039-Revert-iwlwifi-mvm-don-t-hide-HE-radiotap-data-in-SK.patch
deb259
Patch39:	0040-Revert-iwlwifi-mvm-add-HE-TB-PPDU-SIG-A-BW-to-radiot.patch
deb259
Patch40:	0041-Revert-iwlwifi-iwlmvm-ignore-HE-PPDU-type-regarding-.patch
deb259
Patch41:	0042-Revert-iwlwifi-mvm-add-L-SIG-length-to-radiotap.patch
deb259
Patch42:	0043-Revert-iwlwifi-mvm-change-PHY-data-RX-for-HE-radiota.patch
deb259
Patch43:	0044-Revert-iwlwifi-mvm-remove-set-but-not-used-variable-.patch
deb259
Patch44:	0045-Revert-iwlwifi-mvm-show-more-HE-radiotap-data-for-TB.patch
deb259
Patch45:	0046-Revert-iwlwifi-mvm-decode-HE-information-for-MU-with.patch
deb259
Patch46:	0047-Revert-iwlwifi-mvm-add-more-information-to-HE-radiot.patch
deb259
Patch47:	0048-Revert-iwlwifi-mvm-add-LDPC-XSYM-to-HE-radiotap-data.patch
deb259
Patch48:	0049-Revert-iwlwifi-mvm-add-TXOP-to-HE-radiotap-data.patch
deb259
Patch49:	0050-Revert-iwlwifi-mvm-move-HE-MU-LTF_NUM-parsing-to-he_.patch
deb259
Patch50:	0051-Revert-iwlwifi-mvm-clean-up-HE-radiotap-RU-allocatio.patch
deb259
Patch51:	0052-Revert-iwlwifi-mvm-pull-some-he_phy_data-decoding-in.patch
deb259
Patch52:	0053-Revert-iwlwifi-mvm-put-HE-SIG-B-symbols-users-data-c.patch
deb259
Patch53:	0054-Revert-iwlwifi-mvm-minor-cleanups-to-HE-radiotap-cod.patch
deb259
Patch54:	0055-Revert-iwlwifi-mvm-remove-unnecessary-overload-varia.patch
deb259
Patch55:	0056-Revert-iwlwifi-mvm-report-RU-offset-is-known.patch
deb259
Patch56:	0057-Revert-iwlwifi-mvm-decode-HE-TB-PPDU-data.patch
deb259
Patch57:	0058-Revert-iwlwifi-mvm-remove-channel-2-from-HE-radiotap.patch
deb259
Patch58:	0059-Revert-iwlwifi-mvm-report-of-LTF-symbols-for-extende.patch
deb259
Patch59:	0060-Revert-iwlwifi-mvm-properly-decode-HE-GI-duration.patch
deb259
Patch60:	0061-Revert-iwlwifi-mvm-put-LTF-symbol-size-into-HE-radio.patch
deb259
Patch61:	0062-Revert-iwlwifi-RX-API-remove-unnecessary-anonymous-s.patch
deb259
Patch62:	0063-Revert-iwlwifi-mvm-implement-extended-HE-MU-sniffer-.patch
deb259
Patch63:	0064-Revert-iwlwifi-mvm-move-he-RX-handling-to-a-separate.patch
deb259
Patch64:	0065-Revert-iwlwifi-iwlmvm-fix-typo-when-checking-for-TX-.patch
deb259
Patch65:	0066-Revert-iwlwifi-mvm-move-he-RX-handling-to-a-separate.patch
deb259
Patch66:	0067-Revert-iwlwifi-mvm-add-support-for-RX_AMPDU_EOF-bit-.patch
deb259
Patch67:	0068-Revert-iwlwifi-mvm-add-bss-color-to-radiotap.patch
deb259
Patch68:	0069-Revert-iwlwifi-support-new-rx_mpdu_desc-api.patch
deb259
Patch69:	0070-Revert-iwlwifi-mvm-add-radiotap-data-for-HE.patch
deb259
Patch70:	0071-Revert-iwlwifi-mvm-set-MAC_FILTER_IN_11AX-in-AP-mode.patch
deb259
Patch71:	0072-Revert-iwlwifi-add-support-for-IEEE802.11ax.patch
deb259
Patch72:	0073-Revert-iwlwifi-mvm-update-firmware-when-MU-EDCA-para.patch
deb259
Patch73:	0074-Revert-iwlwifi-mvm-report-delayed-beacon-count-to-FW.patch
deb259
Patch74:	0075-Revert-iwlwifi-mvm-track-changes-in-beacon-count-dur.patch
deb259
Patch75:	0076-Revert-iwlwifi-mvm-disconnect-in-case-of-bad-channel.patch
deb259
Patch76:	0077-Revert-iwlwifi-mvm-notify-FW-on-quiet-mode-in-CSA.patch
deb259
Patch77:	0078-Revert-iwlwifi-mvm-track-CSA-beacons.patch
deb259
Patch78:	0079-Revert-iwlwifi-mvm-implement-CSA-abort.patch
deb259
Patch79:	0080-Revert-iwlwifi-nvm-parse-use-struct_size-in-kzalloc.patch
deb259
Patch80:	0081-Revert-iwlwifi-support-new-NVM-response-API.patch
deb259
Patch81:	0082-Revert-iwlwifi-add-support-for-6-7-GHz-channels.patch
deb259
Patch82:	0083-Revert-iwlwifi-use-kmemdup-in-iwl_parse_nvm_mcc_info.patch
deb259
Patch83:	0084-Revert-cfg80211-make-wmm_rule-part-of-the-reg_rule-s.patch
deb259
Patch84:	0085-Revert-iwlwifi-Use-correct-channel_profile-iniwl_get.patch
deb259
Patch85:	0086-Revert-iwlwifi-mvm-report-all-NO_DATA-events-to-mac8.patch
deb259
Patch86:	0087-Revert-iwlwifi-mvm-add-read-debugfs-for-he_sniffer_p.patch
deb259
Patch87:	0088-Revert-iwlwifi-mvm-include-configured-sniffer-AID-in.patch
deb259
Patch88:	0089-Revert-iwlwifi-mvm-implement-CSI-reporting.patch
deb259
Patch89:	0090-Revert-iwlwifi-iwlmvm-in-monitor-NDP-notif-take-the-.patch
deb259
Patch90:	0091-Revert-iwlwifi-mvm-handle-RX-no-data-notification.patch
deb259
Patch91:	0092-Revert-iwlwifi-mvm-fix-merge-damage-in-iwl_mvm_rx_mp.patch
deb259
Patch92:	0093-Revert-iwlwifi-mvm-implement-VHT-extended-NSS-suppor.patch
deb259
Patch93:	0094-Revert-iwlwifi-fw-do-not-set-sgi-bits-for-HE-connect.patch
deb259
Patch94:	0095-Revert-iwlwifi-mvm-fix-wrong-DCM-TLC-config.patch
deb259
Patch95:	0096-Revert-iwlwifi-rs-fw-support-dcm.patch
deb259
Patch96:	0097-Revert-iwlwifi-rs-fw-enable-STBC-in-he-correctly.patch
deb259
Patch97:	0000-add-back-rate_name-items-rs_sta_dbgfs_drv_tx_stats_read.patch
deb259
Patch98:	0000-add-iwlwifi_backport_compat-h.patch
deb259
Patch99:	0000-bump-module-version.patch
deb259
Patch100:	0000-define-IEEE80211_MAX_AMPDU_BUF_HT.patch
deb259
Patch101:	0000-fixup-firmware-modinfo.patch
deb259
Patch102:	0000-no-cap_he-check-iwl_mvm_max_amsdu_size.patch
deb259
Patch103:	0000-use-DUP-firmware-files.patch
deb259
Patch104:	_RHEL8_PATCH_17-45_iwlwifi_mvm_remove_d3_sram_debugfs_file.patch
deb259
Patch105:	_RHEL8_PATCH_18-45_iwlwifi_fix_load_in_rfkill_flow_for_unified_firmwar.patch
deb259
Patch106:	_RHEL8_PATCH_19-45_iwlwifi_clear_persistence_bit_according_to_device_f.patch
deb259
Patch107:	_RHEL8_PATCH_20-45_iwlwifi_print_fseq_info_upon_fw_assert.patch
deb259
Patch108:	_RHEL8_PATCH_21-45_iwlwifi_fix_AX201_killer_sku_loading_firmware_issue.patch
deb259
Patch109:	_RHEL8_PATCH_22-45_iwlwifi_Fix_double-free_problems_in_iwl_req_fw_call.patch
deb259
Patch110:	_RHEL8_PATCH_23-45_iwlwifi_mvm_change_TLC_config_cmd_sent_by_rs_to_be_.patch
deb259
deb259
%define findpat %( echo "%""P" )
deb259
%define __find_requires /usr/lib/rpm/redhat/find-requires.ksyms
deb259
%define __find_provides /usr/lib/rpm/redhat/find-provides.ksyms %{kmod_name} %{?epoch:%{epoch}:}%{version}-%{release}
deb259
%define sbindir %( if [ -d "/sbin" -a \! -h "/sbin" ]; then echo "/sbin"; else echo %{_sbindir}; fi )
deb259
%define dup_state_dir %{_localstatedir}/lib/rpm-state/kmod-dups
deb259
%define kver_state_dir %{dup_state_dir}/kver
deb259
%define kver_state_file %{kver_state_dir}/%{kmod_kernel_version}.%(arch)
deb259
%define dup_module_list %{dup_state_dir}/rpm-kmod-%{kmod_name}-modules
deb259
deb259
Name:		kmod-redhat-iwlwifi
deb259
Version:	%{kmod_driver_version}
deb259
Release:	%{kmod_rpm_release}%{?dist}
deb259
%if "%{kmod_driver_epoch}" != ""
deb259
Epoch:		%{kmod_driver_epoch}
deb259
%endif
deb259
Summary:	iwlwifi kernel module for Driver Update Program
deb259
Group:		System/Kernel
deb259
License:	GPLv2
deb259
URL:		https://www.kernel.org/
deb259
BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
deb259
BuildRequires:	%kernel_devel_pkg = %kmod_kernel_version
deb259
%if "%{kmod_dist_build_deps}" != ""
deb259
BuildRequires:	%{kmod_dist_build_deps}
deb259
%endif
deb259
ExclusiveArch:	x86_64
deb259
%global kernel_source() /usr/src/kernels/%{kmod_kernel_version}.$(arch)
deb259
deb259
%global _use_internal_dependency_generator 0
deb259
%if "%{?kmod_kernel_version_min}" != ""
deb259
Provides:	%kernel_modules_pkg >= %{kmod_kernel_version_min}.%{_target_cpu}
deb259
%else
deb259
Provides:	%kernel_modules_pkg = %{kmod_kernel_version_dep}.%{_target_cpu}
deb259
%endif
deb259
Provides:	kmod-%{kmod_name} = %{?epoch:%{epoch}:}%{version}-%{release}
deb259
Requires(post):	%{sbindir}/weak-modules
deb259
Requires(postun):	%{sbindir}/weak-modules
deb259
Requires:	kernel >= 4.18.0-80.el8
deb259
deb259
Requires:	kernel < 4.18.0-81.el8
deb259
%if 1
deb259
Requires: firmware(%{kmod_name}) = 20190516_dup8.0
deb259
%endif
deb259
%if "%{kmod_build_dependencies}" != ""
deb259
BuildRequires:  %{kmod_build_dependencies}
deb259
%endif
deb259
%if "%{kmod_dependencies}" != ""
deb259
Requires:       %{kmod_dependencies}
deb259
%endif
deb259
# if there are multiple kmods for the same driver from different vendors,
deb259
# they should conflict with each other.
deb259
Conflicts:	kmod-%{kmod_name}
deb259
deb259
%description
deb259
iwlwifi kernel module for Driver Update Program
deb259
deb259
%if 1
deb259
deb259
%package -n kmod-redhat-iwlwifi-firmware
deb259
Version:	20190516_dup8.0
deb259
Summary:	iwlwifi firmware for Driver Update Program
deb259
Provides:	firmware(%{kmod_name}) = 20190516_dup8.0
deb259
%if "%{kmod_kernel_version_min}" != ""
deb259
Provides:	%kernel_modules_pkg >= %{kmod_kernel_version_min}.%{_target_cpu}
deb259
%else
deb259
Provides:	%kernel_modules_pkg = %{kmod_kernel_version_dep}.%{_target_cpu}
deb259
%endif
deb259
%description -n  kmod-redhat-iwlwifi-firmware
deb259
iwlwifi firmware for Driver Update Program
deb259
deb259
deb259
%files -n kmod-redhat-iwlwifi-firmware
deb259
%defattr(644,root,root,755)
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-41.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-34.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-34.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-29.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-41.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265-17.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-27.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-27.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-43.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-38.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-46.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-10.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-7260-17.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-21.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-31.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-27.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-21.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-22.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-3168-22.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-16.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-17.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-7260-16.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-3168-27.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-3168-21.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-22.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-16.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-22.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-34.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-3160-17.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-46.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-36.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-3160-16.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-3168-29.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-cc-a0-46.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-21.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-38.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-43.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-33.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-33.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-34.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-36.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-31.ucode
deb259
/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265-16.ucode
deb259
deb259
deb259
%endif
deb259
deb259
# Development package
deb259
%if 0%{kmod_devel_package}
deb259
%package -n kmod-redhat-iwlwifi-devel
deb259
Version:	%{kmod_driver_version}
deb259
Requires:	kernel >= 4.18.0-80.el8
deb259
deb259
Requires:	kernel < 4.18.0-81.el8
deb259
Summary:	iwlwifi development files for Driver Update Program
deb259
deb259
%description -n  kmod-redhat-iwlwifi-devel
deb259
iwlwifi development files for Driver Update Program
deb259
deb259
deb259
%files -n kmod-redhat-iwlwifi-devel
deb259
%defattr(644,root,root,755)
deb259
/usr/share/kmod-%{kmod_vendor}-%{kmod_name}/Module.symvers
deb259
%endif
deb259
deb259
%post
deb259
modules=( $(find /lib/modules/%{kmod_kernel_version}.%(arch)/%{kmod_install_path} | grep '\.ko$') )
deb259
printf '%s\n' "${modules[@]}" | %{sbindir}/weak-modules --add-modules --no-initramfs
deb259
deb259
mkdir -p "%{kver_state_dir}"
deb259
touch "%{kver_state_file}"
deb259
deb259
exit 0
deb259
deb259
%posttrans
deb259
# We have to re-implement part of weak-modules here because it doesn't allow
deb259
# calling initramfs regeneration separately
deb259
if [ -f "%{kver_state_file}" ]; then
deb259
	kver_base="%{kmod_kernel_version_dep}"
deb259
	kvers=$(ls -d "/lib/modules/${kver_base%%.*}"*)
deb259
deb259
	for k_dir in $kvers; do
deb259
		k="${k_dir#/lib/modules/}"
deb259
deb259
		tmp_initramfs="/boot/initramfs-$k.tmp"
deb259
		dst_initramfs="/boot/initramfs-$k.img"
deb259
deb259
		# The same check as in weak-modules: we assume that the kernel present
deb259
		# if the symvers file exists.
deb259
		if [ -e "/boot/symvers-$k.gz" ]; then
deb259
			/usr/bin/dracut -f "$tmp_initramfs" "$k" || exit 1
deb259
			cmp -s "$tmp_initramfs" "$dst_initramfs"
deb259
			if [ "$?" = 1 ]; then
deb259
				mv "$tmp_initramfs" "$dst_initramfs"
deb259
			else
deb259
				rm -f "$tmp_initramfs"
deb259
			fi
deb259
		fi
deb259
	done
deb259
deb259
	rm -f "%{kver_state_file}"
deb259
	rmdir "%{kver_state_dir}" 2> /dev/null
deb259
fi
deb259
deb259
rmdir "%{dup_state_dir}" 2> /dev/null
deb259
deb259
exit 0
deb259
deb259
%preun
deb259
if rpm -q --filetriggers kmod 2> /dev/null| grep -q "Trigger for weak-modules call on kmod removal"; then
deb259
	mkdir -p "%{kver_state_dir}"
deb259
	touch "%{kver_state_file}"
deb259
fi
deb259
deb259
mkdir -p "%{dup_state_dir}"
deb259
rpm -ql kmod-redhat-iwlwifi-%{kmod_driver_version}-%{kmod_rpm_release}%{?dist}.$(arch) | \
deb259
	grep '\.ko$' > "%{dup_module_list}"
deb259
deb259
%postun
deb259
if rpm -q --filetriggers kmod 2> /dev/null| grep -q "Trigger for weak-modules call on kmod removal"; then
deb259
	initramfs_opt="--no-initramfs"
deb259
else
deb259
	initramfs_opt=""
deb259
fi
deb259
deb259
modules=( $(cat "%{dup_module_list}") )
deb259
rm -f "%{dup_module_list}"
deb259
printf '%s\n' "${modules[@]}" | %{sbindir}/weak-modules --remove-modules $initramfs_opt
deb259
deb259
rmdir "%{dup_state_dir}" 2> /dev/null
deb259
deb259
exit 0
deb259
deb259
%files
deb259
%defattr(644,root,root,755)
deb259
/lib/modules/%{kmod_kernel_version}.%(arch)
deb259
/etc/depmod.d/%{kmod_name}.conf
deb259
/usr/share/doc/kmod-%{kmod_name}/greylist.txt
deb259
deb259
%prep
deb259
%setup -n %{kmod_name}-%{kmod_vendor}-%{kmod_driver_version}
deb259
deb259
%patch0 -p1
deb259
%patch1 -p1
deb259
%patch2 -p1
deb259
%patch3 -p1
deb259
%patch4 -p1
deb259
%patch5 -p1
deb259
%patch6 -p1
deb259
%patch7 -p1
deb259
%patch8 -p1
deb259
%patch9 -p1
deb259
%patch10 -p1
deb259
%patch11 -p1
deb259
%patch12 -p1
deb259
%patch13 -p1
deb259
%patch14 -p1
deb259
%patch15 -p1
deb259
%patch16 -p1
deb259
%patch17 -p1
deb259
%patch18 -p1
deb259
%patch19 -p1
deb259
%patch20 -p1
deb259
%patch21 -p1
deb259
%patch22 -p1
deb259
%patch23 -p1
deb259
%patch24 -p1
deb259
%patch25 -p1
deb259
%patch26 -p1
deb259
%patch27 -p1
deb259
%patch28 -p1
deb259
%patch29 -p1
deb259
%patch30 -p1
deb259
%patch31 -p1
deb259
%patch32 -p1
deb259
%patch33 -p1
deb259
%patch34 -p1
deb259
%patch35 -p1
deb259
%patch36 -p1
deb259
%patch37 -p1
deb259
%patch38 -p1
deb259
%patch39 -p1
deb259
%patch40 -p1
deb259
%patch41 -p1
deb259
%patch42 -p1
deb259
%patch43 -p1
deb259
%patch44 -p1
deb259
%patch45 -p1
deb259
%patch46 -p1
deb259
%patch47 -p1
deb259
%patch48 -p1
deb259
%patch49 -p1
deb259
%patch50 -p1
deb259
%patch51 -p1
deb259
%patch52 -p1
deb259
%patch53 -p1
deb259
%patch54 -p1
deb259
%patch55 -p1
deb259
%patch56 -p1
deb259
%patch57 -p1
deb259
%patch58 -p1
deb259
%patch59 -p1
deb259
%patch60 -p1
deb259
%patch61 -p1
deb259
%patch62 -p1
deb259
%patch63 -p1
deb259
%patch64 -p1
deb259
%patch65 -p1
deb259
%patch66 -p1
deb259
%patch67 -p1
deb259
%patch68 -p1
deb259
%patch69 -p1
deb259
%patch70 -p1
deb259
%patch71 -p1
deb259
%patch72 -p1
deb259
%patch73 -p1
deb259
%patch74 -p1
deb259
%patch75 -p1
deb259
%patch76 -p1
deb259
%patch77 -p1
deb259
%patch78 -p1
deb259
%patch79 -p1
deb259
%patch80 -p1
deb259
%patch81 -p1
deb259
%patch82 -p1
deb259
%patch83 -p1
deb259
%patch84 -p1
deb259
%patch85 -p1
deb259
%patch86 -p1
deb259
%patch87 -p1
deb259
%patch88 -p1
deb259
%patch89 -p1
deb259
%patch90 -p1
deb259
%patch91 -p1
deb259
%patch92 -p1
deb259
%patch93 -p1
deb259
%patch94 -p1
deb259
%patch95 -p1
deb259
%patch96 -p1
deb259
%patch97 -p1
deb259
%patch98 -p1
deb259
%patch99 -p1
deb259
%patch100 -p1
deb259
%patch101 -p1
deb259
%patch102 -p1
deb259
%patch103 -p1
deb259
%patch104 -p1
deb259
%patch105 -p1
deb259
%patch106 -p1
deb259
%patch107 -p1
deb259
%patch108 -p1
deb259
%patch109 -p1
deb259
%patch110 -p1
deb259
set -- *
deb259
mkdir source
deb259
mv "$@" source/
deb259
mkdir obj
deb259
deb259
%build
deb259
rm -rf obj
deb259
cp -r source obj
deb259
deb259
PWD_PATH="$PWD"
deb259
%if "%{workaround_no_pwd_rel_path}" != "1"
deb259
PWD_PATH=$(realpath --relative-to="%{kernel_source}" . 2>/dev/null || echo "$PWD")
deb259
%endif
deb259
%{make_build} -C %{kernel_source} V=1 M="$PWD_PATH/obj/%{kmod_kbuild_dir}" \
deb259
	NOSTDINC_FLAGS="-I$PWD_PATH/obj/include -I$PWD_PATH/obj/include/uapi" \
deb259
	EXTRA_CFLAGS="%{nil}" \
deb259
	%{nil}
deb259
# mark modules executable so that strip-to-file can strip them
deb259
find obj/%{kmod_kbuild_dir} -name "*.ko" -type f -exec chmod u+x '{}' +
deb259
deb259
whitelist="/lib/modules/kabi-current/kabi_whitelist_%{_target_cpu}"
deb259
for modules in $( find obj/%{kmod_kbuild_dir} -name "*.ko" -type f -printf "%{findpat}\n" | sed 's|\.ko$||' | sort -u ) ; do
deb259
	# update depmod.conf
deb259
	module_weak_path=$(echo "$modules" | sed 's/[\/]*[^\/]*$//')
deb259
	if [ -z "$module_weak_path" ]; then
deb259
		module_weak_path=%{name}
deb259
	else
deb259
		module_weak_path=%{name}/$module_weak_path
deb259
	fi
deb259
	echo "override $(echo $modules | sed 's/.*\///')" \
deb259
	     "$(echo "%{kmod_kernel_version_dep}" |
deb259
	        sed 's/\.[^\.]*$//;
deb259
		     s/\([.+?^$\/\\|()\[]\|\]\)/\\\0/g').*" \
deb259
		     "weak-updates/$module_weak_path" >> source/depmod.conf
deb259
deb259
	# update greylist
deb259
	nm -u obj/%{kmod_kbuild_dir}/$modules.ko | sed 's/.*U //' |  sed 's/^\.//' | sort -u | while read -r symbol; do
deb259
		grep -q "^\s*$symbol\$" $whitelist || echo "$symbol" >> source/greylist
deb259
	done
deb259
done
deb259
sort -u source/greylist | uniq > source/greylist.txt
deb259
deb259
%install
deb259
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
deb259
export INSTALL_MOD_DIR=%{kmod_install_path}
deb259
PWD_PATH="$PWD"
deb259
%if "%{workaround_no_pwd_rel_path}" != "1"
deb259
PWD_PATH=$(realpath --relative-to="%{kernel_source}" . 2>/dev/null || echo "$PWD")
deb259
%endif
deb259
make -C %{kernel_source} modules_install \
deb259
	M=$PWD_PATH/obj/%{kmod_kbuild_dir}
deb259
# Cleanup unnecessary kernel-generated module dependency files.
deb259
find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \;
deb259
deb259
install -m 644 -D source/depmod.conf $RPM_BUILD_ROOT/etc/depmod.d/%{kmod_name}.conf
deb259
install -m 644 -D source/greylist.txt $RPM_BUILD_ROOT/usr/share/doc/kmod-%{kmod_name}/greylist.txt
deb259
%if 1
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-41.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-41.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8000C-34.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-34.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8265-34.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-34.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7265D-29.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-29.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-41.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-41.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7265-17.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265-17.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8000C-27.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-27.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8265-27.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-27.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-43.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-43.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-38.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-38.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-46.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-46.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7265D-10.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-10.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7260-17.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7260-17.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8000C-21.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-21.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8000C-31.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-31.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7265D-27.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-27.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8265-21.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-21.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7265D-22.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-22.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-3168-22.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-3168-22.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7265D-16.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-16.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7265D-17.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-17.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7260-16.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7260-16.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-3168-27.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-3168-27.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-3168-21.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-3168-21.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8000C-22.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-22.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8000C-16.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-16.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8265-22.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-22.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-34.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-34.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-3160-17.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-3160-17.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-46.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-46.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8000C-36.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8000C-36.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-3160-16.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-3160-16.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-3168-29.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-3168-29.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-cc-a0-46.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-cc-a0-46.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7265D-21.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265D-21.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-38.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-38.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-43.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-43.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-33.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9000-pu-b0-jf-b0-33.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-33.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-33.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-34.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-9260-th-b0-jf-b0-34.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8265-36.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-36.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-8265-31.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-8265-31.ucode
deb259
install -m 644 -D source/firmware/iwlwifi_dup8.0/iwlwifi-7265-16.ucode $RPM_BUILD_ROOT/lib/firmware/iwlwifi_dup8.0/iwlwifi-7265-16.ucode
deb259
deb259
%endif
deb259
%if 0%{kmod_devel_package}
deb259
install -m 644 -D $PWD/obj/%{kmod_kbuild_dir}/Module.symvers $RPM_BUILD_ROOT/usr/share/kmod-%{kmod_vendor}-%{kmod_name}/Module.symvers
deb259
%endif
deb259
deb259
%clean
deb259
rm -rf $RPM_BUILD_ROOT
deb259
deb259
%changelog
deb259
* Fri Oct 04 2019 Eugene Syromiatnikov <esyr@redhat.com> 4.18.0_107_dup8.0-5
deb259
- e67217ec68636d7570e69bab9e3b1ed1728b8292
deb259
- iwlwifi kernel module for Driver Update Program
deb259
- Resolves: #bz1755919