Blame SPECS/kmod-exfat.spec

c00b0e
%global pkg exfat
c00b0e
Kmods SIG 9e3ffb
%global driver_version 4.18.0-0.el8
Kmods SIG 9e3ffb
Kmods SIG 09f1f6
%global kernel_version 4.18.0-358.el8
c00b0e
c00b0e
%global _use_internal_dependency_generator 0
da79c9
%global __find_requires /usr/lib/rpm/redhat/find-requires
da79c9
%global __find_provides /usr/lib/rpm/redhat/find-provides
c00b0e
c00b0e
%global debug_package %{nil}
c00b0e
c00b0e
%global __spec_install_post \
c00b0e
  %{?__debug_package:%{__debug_install_post}} \
c00b0e
  %{__arch_install_post} \
c00b0e
  %{__os_install_post} \
c00b0e
  %{__mod_compress_install_post}
c00b0e
c00b0e
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
c00b0e
c00b0e
c00b0e
Name:             kmod-%{pkg}
Kmods SIG 9e3ffb
Version:          4.18.0.0
Kmods SIG 09f1f6
Release:          3%{?dist}
c00b0e
Summary:          exFAT filesystem support
c00b0e
35f978
License:          GPLv2 and GPLv2+
c00b0e
URL:              https://www.kernel.org/
c00b0e
Kmods SIG 9e3ffb
Source0:          %{pkg}-%{driver_version}.tar.xz
Kmods SIG 9e3ffb
Patch1:           0001-exfat-add-in-memory-and-on-disk-structures-and-heade.patch
Kmods SIG 9e3ffb
Patch2:           0002-exfat-add-super-block-operations.patch
Kmods SIG 9e3ffb
Patch3:           0003-exfat-add-inode-operations.patch
Kmods SIG 9e3ffb
Patch4:           0004-exfat-add-directory-operations.patch
Kmods SIG 9e3ffb
Patch5:           0005-exfat-add-file-operations.patch
Kmods SIG 9e3ffb
Patch6:           0006-exfat-add-fat-entry-operations.patch
Kmods SIG 9e3ffb
Patch7:           0007-exfat-add-bitmap-operations.patch
Kmods SIG 9e3ffb
Patch8:           0008-exfat-add-exfat-cache.patch
Kmods SIG 9e3ffb
Patch9:           0009-exfat-add-misc-operations.patch
Kmods SIG 9e3ffb
Patch10:          0010-exfat-add-nls-operations.patch
Kmods SIG 9e3ffb
Patch11:          0011-exfat-add-Kconfig-and-Makefile.patch
Kmods SIG 9e3ffb
Patch12:          0012-exfat-update-file-system-parameter-handling.patch
Kmods SIG 9e3ffb
Patch13:          0013-exfat-Fix-discard-support.patch
Kmods SIG 9e3ffb
Patch14:          0014-exfat-add-missing-MODULE_ALIAS_FS.patch
Kmods SIG 9e3ffb
Patch15:          0015-exfat-Unify-access-to-the-boot-sector.patch
Kmods SIG 9e3ffb
Patch16:          0016-exfat-remove-bps-mount-option.patch
Kmods SIG 9e3ffb
Patch17:          0017-exfat-properly-set-s_time_gran.patch
Kmods SIG 9e3ffb
Patch18:          0018-exfat-truncate-atimes-to-2s-granularity.patch
Kmods SIG 9e3ffb
Patch19:          0019-exfat-use-iter_file_splice_write.patch
Kmods SIG 9e3ffb
Patch20:          0020-exfat-fix-possible-memory-leak-in-exfat_find.patch
Kmods SIG 9e3ffb
Patch21:          0021-exfat-add-the-dummy-mount-options-to-be-backward-com.patch
Kmods SIG 9e3ffb
#Patch22:          0022-fs-convert-mpage_readpages-to-mpage_readahead.patch
Kmods SIG 9e3ffb
Patch23:          0023-exfat-Simplify-exfat_utf8_d_cmp-for-code-points-abov.patch
Kmods SIG 9e3ffb
Patch24:          0024-exfat-Use-a-more-common-logging-style.patch
Kmods SIG 9e3ffb
Patch25:          0025-exfat-Simplify-exfat_utf8_d_hash-for-code-points-abo.patch
Kmods SIG 9e3ffb
Patch26:          0026-exfat-Remove-unused-functions-exfat_high_surrogate-a.patch
Kmods SIG 9e3ffb
Patch27:          0027-exfat-remove-the-assignment-of-0-to-bool-variable.patch
Kmods SIG 9e3ffb
Patch28:          0028-exfat-replace-time_ms-with-time_cs.patch
Kmods SIG 9e3ffb
Patch29:          0029-exfat-optimize-dir-cache.patch
Kmods SIG 9e3ffb
Patch30:          0030-exfat-redefine-PBR-as-boot_sector.patch
Kmods SIG 9e3ffb
Patch31:          0031-exfat-separate-the-boot-sector-analysis.patch
Kmods SIG 9e3ffb
Patch32:          0032-exfat-add-boot-region-verification.patch
Kmods SIG 9e3ffb
Patch33:          0033-exfat-standardize-checksum-calculation.patch
Kmods SIG 9e3ffb
Patch34:          0034-exfat-remove-unnecessary-reassignment-of-p_uniname-n.patch
Kmods SIG 9e3ffb
Patch35:          0035-exfat-fix-memory-leak-in-exfat_parse_param.patch
Kmods SIG 9e3ffb
Patch36:          0036-exfat-fix-incorrect-update-of-stream-entry-in-__exfa.patch
Kmods SIG 9e3ffb
Patch37:          0037-exfat-fix-range-validation-error-in-alloc-and-free-c.patch
Kmods SIG 9e3ffb
Patch38:          0038-exfat-Fix-potential-use-after-free-in-exfat_load_upc.patch
Kmods SIG 9e3ffb
Patch39:          0039-exfat-Set-the-unused-characters-of-FileName-field-to.patch
Kmods SIG 9e3ffb
Patch40:          0040-exfat-add-missing-brelse-calls-on-error-paths.patch
Kmods SIG 9e3ffb
Patch41:          0041-exfat-call-sync_filesystem-for-read-only-remount.patch
Kmods SIG 9e3ffb
Patch42:          0042-exfat-move-setting-VOL_DIRTY-over-exfat_remove_entri.patch
Kmods SIG 9e3ffb
Patch43:          0043-exfat-flush-dirty-metadata-in-fsync.patch
Kmods SIG 9e3ffb
Patch44:          0044-exfat-fix-overflow-issue-in-exfat_cluster_to_sector.patch
Kmods SIG 9e3ffb
Patch45:          0045-exfat-fix-wrong-hint_stat-initialization-in-exfat_fi.patch
Kmods SIG 9e3ffb
Patch46:          0046-exfat-fix-wrong-size-update-of-stream-entry-by-typo.patch
Kmods SIG 9e3ffb
Patch47:          0047-exfat-fix-name_hash-computation-on-big-endian-system.patch
Kmods SIG 9e3ffb
Patch48:          0048-exfat-remove-EXFAT_SB_DIRTY-flag.patch
Kmods SIG 9e3ffb
Patch49:          0049-exfat-write-multiple-sectors-at-once.patch
Kmods SIG 9e3ffb
Patch50:          0050-exfat-add-error-check-when-updating-dir-entries.patch
Kmods SIG 9e3ffb
Patch51:          0051-exfat-optimize-exfat_zeroed_cluster.patch
Kmods SIG 9e3ffb
Patch52:          0052-exfat-retain-VolumeFlags-properly.patch
Kmods SIG 9e3ffb
Patch53:          0053-exfat-fix-pointer-error-checking.patch
Kmods SIG 9e3ffb
Patch54:          0054-exfat-fix-use-of-uninitialized-spinlock-on-error-pat.patch
Kmods SIG 9e3ffb
Patch55:          0055-exfat-fix-misspellings-using-codespell-tool.patch
Kmods SIG 9e3ffb
Patch56:          0056-exfat-use-i_blocksize-to-get-blocksize.patch
Kmods SIG 9e3ffb
Patch57:          0057-exfat-eliminate-dead-code-in-exfat_find.patch
Kmods SIG 9e3ffb
Patch58:          0058-exfat-remove-useless-directory-scan-in-exfat_add_ent.patch
Kmods SIG 9e3ffb
Patch59:          0059-exfat-replace-memcpy-with-structure-assignment.patch
Kmods SIG 9e3ffb
Patch60:          0060-exfat-remove-rwoffset-in-exfat_inode_info.patch
Kmods SIG 9e3ffb
Patch61:          0061-exfat-remove-useless-check-in-exfat_move_file.patch
Kmods SIG 9e3ffb
#Patch62:          0062-PATCH-reduce-boilerplate-in-fsid-handling.patch
Kmods SIG 9e3ffb
Patch63:          0063-exfat-Avoid-allocating-upcase-table-using-kcalloc.patch
Kmods SIG 9e3ffb
#Patch64:          0064-block-use-an-on-stack-bio-in-blkdev_issue_flush.patch
Kmods SIG 9e3ffb
Patch65:          0065-exfat-fix-shift-out-of-bounds-in-exfat_fill_super.patch
Kmods SIG 9e3ffb
Patch66:          0066-exfat-improve-performance-of-exfat_free_cluster-when.patch
Kmods SIG 9e3ffb
#Patch67:          0067-attr-handle-idmapped-mounts.patch
Kmods SIG 9e3ffb
#Patch68:          0068-stat-handle-idmapped-mounts.patch
Kmods SIG 9e3ffb
#Patch69:          0069-fs-make-helpers-idmap-mount-aware.patch
Kmods SIG 9e3ffb
Patch70:          0070-exfat-fix-erroneous-discard-when-clear-cluster-bit.patch
Kmods SIG 9e3ffb
Patch71:          0071-exfat-introduce-bitmap_lock-for-cluster-bitmap-acces.patch
Kmods SIG 9e3ffb
Patch72:          0072-exfat-add-support-ioctl-and-FITRIM-function.patch
Kmods SIG 9e3ffb
Patch73:          0073-exfat-improve-write-performance-when-dirsync-enabled.patch
Kmods SIG 9e3ffb
Patch74:          0074-exfat-speed-up-iterate-lookup-by-fixing-start-point-.patch
Kmods SIG 9e3ffb
Patch75:          0075-mm-require-set_page_dirty-to-be-explicitly-wired-up.patch
Kmods SIG 9e3ffb
Patch76:          0076-exfat-avoid-incorrectly-releasing-for-root-inode.patch
Kmods SIG 9e3ffb
Patch77:          0077-exfat-handle-wrong-stream-entry-size-in-exfat_readdi.patch
Kmods SIG 9e3ffb
Patch78:          0078-exfat-fix-incorrect-loading-of-i_blocks-for-large-fi.patch
Kmods SIG 9e3ffb
Patch9001:        9001-Compat-for-missing-inode-method-free_inode.patch
Kmods SIG 9e3ffb
Patch9999:        9999-enable-exfat.patch
c00b0e
5a97e4
ExclusiveArch:    x86_64 aarch64 ppc64le
c00b0e
c00b0e
BuildRequires:    elfutils-libelf-devel
c00b0e
BuildRequires:    gcc
da79c9
BuildRequires:    kernel-rpm-macros
c00b0e
BuildRequires:    kmod
c00b0e
BuildRequires:    make
c00b0e
BuildRequires:    redhat-rpm-config
c00b0e
BuildRequires:    xz
c00b0e
da79c9
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
c00b0e
BuildRequires:    kernel-devel = %{kernel_version}
c00b0e
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
c00b0e
da79c9
Requires:         kernel >= %{kernel_version}
da79c9
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
da79c9
Requires:         kernel-modules >= %{kernel_version}
da79c9
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
c00b0e
c00b0e
Provides:         installonlypkg(kernel-module)
da79c9
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
c00b0e
da79c9
Requires(post):   %{_sbindir}/depmod
da79c9
Requires(postun): %{_sbindir}/depmod
c00b0e
da79c9
Requires(post):   %{_sbindir}/weak-modules
da79c9
Requires(postun): %{_sbindir}/weak-modules
c00b0e
c00b0e
Supplements:      exfatprogs
c00b0e
Recommends:       exfatprogs
c00b0e
c00b0e
c00b0e
%description
c00b0e
This package provides the required kernel module (exfat) to mount devices
c00b0e
formatted with the exFAT file system.
c00b0e
c00b0e
c00b0e
%prep
Kmods SIG 9e3ffb
%autosetup -p1 -n %{pkg}-%{driver_version}
c00b0e
c00b0e
c00b0e
%build
c00b0e
pushd src
c00b0e
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
c00b0e
popd
c00b0e
c00b0e
c00b0e
%install
96e671
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/fs/%{pkg} src/%{pkg}.ko
c00b0e
c00b0e
# Make .ko objects temporarily executable for automatic stripping
c00b0e
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
c00b0e
c00b0e
c00b0e
%clean
c00b0e
%{__rm} -rf %{buildroot}
c00b0e
c00b0e
c00b0e
%post
c00b0e
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
96e671
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/fs/%{pkg}/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
c00b0e
c00b0e
c00b0e
%preun
c00b0e
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
da79c9
rpm -ql kmod-%{pkg}-%{?epoch:%{epoch}:}%{version}-%{release}.%{_arch} | grep '/lib/modules/%{kernel_version}.%{_arch}/.*\.ko\.xz$' >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
c00b0e
c00b0e
c00b0e
%postun
da79c9
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
c00b0e
then
da79c9
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
da79c9
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
c00b0e
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
da79c9
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
c00b0e
fi
c00b0e
c00b0e
da79c9
%pretrans -p <lua>
da79c9
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
da79c9
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
da79c9
da79c9
c00b0e
%posttrans
da79c9
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
c00b0e
then
da79c9
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
da79c9
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
c00b0e
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
da79c9
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
c00b0e
fi
c00b0e
c00b0e
c00b0e
%files
c00b0e
%defattr(644,root,root,755)
c00b0e
/lib/modules/%{kernel_version}.%{_arch}
545bbf
%license LICENSES
c00b0e
c00b0e
c00b0e
%changelog
Kmods SIG 09f1f6
* Sun Jan 23 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.0-3
Kmods SIG 09f1f6
- Rebuild for 4.18.0-358.el8
Kmods SIG 09f1f6
5a97e4
* Sat Jan 22 2022 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.0-2
5a97e4
- Enable ppc64le
5a97e4
Kmods SIG 9e3ffb
* Thu Jan 13 2022 Kmods SIG <sig-kmods@centosproject.org> - 4.18.0.0-1
Kmods SIG 9e3ffb
- Switch to EL kernel source and versioning
Kmods SIG 9e3ffb
- kABI tracking kmod package (kernel >= 4.18.0-348.el8)