Blame SPECS/kmod-exfat.spec

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