Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zfs-kmod builds when using rpm >= 4.14 #7284

Merged
merged 1 commit into from
Mar 9, 2018

Conversation

loli10K
Copy link
Contributor

@loli10K loli10K commented Mar 8, 2018

Description

With rpm-software-management/rpm@5e94633 a package version containing invalid characters (most commonly a double '-') causes the kmod package generation to terminate with an error. This change takes advantage of the newly introduced rpm macro "_wrong_version_format_terminate_build"
to allow kmod packages to be built.

Motivation and Context

Fix openzfs/spl#673

How Has This Been Tested?

Tested on Debian Buster:

root@linux:~/rpmbuild/SPECS# dpkg -l rpm
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                           Version                      Architecture                 Description
+++-==============================================-============================-============================-==================================================================================================
ii  rpm                                            4.14.0+dfsg1-2               amd64                        package manager for RPM
root@linux:~/rpmbuild/SPECS# rpmbuild -bb spl-kmod.spec 
error: line 68: Invalid version (double separator '-'): 4.15.0-1-amd64: Provides:         kernel-modules-for-kernel = 4.15.0-1-amd64
root@linux:~/rpmbuild/SPECS# rpmbuild --define "_wrong_version_format_terminate_build 0" -bb spl-kmod.spec 
warning: line 68: Invalid version (double separator '-'): 4.15.0-1-amd64: Provides:         kernel-modules-for-kernel = 4.15.0-1-amd64
warning: line 68: Invalid version (double separator '-'): 4.15.0-1-amd64: Provides:         kmod-spl-uname-r = 4.15.0-1-amd64
warning: line 68: Invalid version (double separator '-'): 4.15.0-1-amd64: Provides:         kernel-objects-for-kernel = 4.15.0-1-amd64
warning: line 68: Invalid version (double separator '-'): 4.15.0-1-amd64: Provides:         kmod-spl-devel-uname-r = 4.15.0-1-amd64
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.nthHUu
+ umask 022
+ cd /root/rpmbuild/BUILD
+ bash /root/rpmbuild/SOURCES/kmodtool --target x86_64 --kmodname spl-kmod --newest --devel --for-kernels 4.15.0-1-amd64
%package       -n kmod-spl-4.15.0-1-amd64
Summary:          spl kernel module(s) for 4.15.0-1-amd64
Group:            System Environment/Kernel
Provides:         kernel-modules-for-kernel = 4.15.0-1-amd64
Provides:         kmod-spl-uname-r = 4.15.0-1-amd64
Provides:         spl-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
Requires:         spl-kmod-common >= %{?epoch:%{epoch}:}%{version}
Requires(post):   /sbin/depmod
Requires(postun): /sbin/depmod
%post          -n kmod-spl-4.15.0-1-amd64
[[ "4.15.0-1-amd64" == "4.15.0-1-amd64"  ]] && /sbin/depmod -a > /dev/null || :
%postun        -n kmod-spl-4.15.0-1-amd64
[[ "4.15.0-1-amd64" == "4.15.0-1-amd64"  ]] && /sbin/depmod -a > /dev/null || :

%description  -n kmod-spl-4.15.0-1-amd64
This package provides the spl kernel modules built for the Linux
kernel 4.15.0-1-amd64 for the %{_target_cpu} family of processors.
%files        -n kmod-spl-4.15.0-1-amd64
%defattr(644,root,root,755)
%dir /lib/modules/4.15.0-1-amd64/extra
/lib/modules/4.15.0-1-amd64/extra/spl/


%package       -n kmod-spl-devel
Summary:          spl kernel module(s) devel common
Group:            System Environment/Kernel
Provides:         spl-devel-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
%description  -n kmod-spl-devel
This package provides the common header files to build kernel modules
which depend on the spl kernel module.  It may optionally require
the spl-devel-<kernel> objects for the newest kernel.

%files        -n kmod-spl-devel
%defattr(644,root,root,755)
%{_usrsrc}/spl-%{version}
%exclude %{_usrsrc}/spl-%{version}/4.15.0-1-amd64


%package       -n kmod-spl-devel-4.15.0-1-amd64
Summary:          spl kernel module(s) devel for 4.15.0-1-amd64
Group:            System Environment/Kernel
Provides:         kernel-objects-for-kernel = 4.15.0-1-amd64
Provides:         spl-devel-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
Provides:         kmod-spl-devel-uname-r = 4.15.0-1-amd64
%description  -n kmod-spl-devel-4.15.0-1-amd64
This package provides objects and symbols required to build kernel modules
which depend on the spl kernel modules built for the Linux
kernel 4.15.0-1-amd64 for the %{_target_cpu} family of processors.
%files        -n kmod-spl-devel-4.15.0-1-amd64
%defattr(644,root,root,755)
%{_usrsrc}/spl-%{version}/4.15.0-1-amd64



%global kmodinstdir_prefix  /lib/modules/
%global kmodinstdir_postfix /extra/spl/
%global kernel_versions     4.15.0-1-amd64___/lib/modules/4.15.0-1-amd64/build/

+ cd /root/rpmbuild/BUILD
+ rm -rf spl-kmod-0.7.0
+ /bin/mkdir -p spl-kmod-0.7.0
+ cd spl-kmod-0.7.0
+ + /bin/tar/bin/gzip -xof -dc - /root/rpmbuild/SOURCES/spl-0.7.0.tar.gz

+ STATUS=0
+ [ 0 -ne 0 ]
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ /bin/mkdir _kmod_build_4.15.0-1-amd64
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.28GwBJ
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd spl-kmod-0.7.0
+ cd _kmod_build_4.15.0-1-amd64
+ CFLAGS=-O2 -g
+ export CFLAGS
+ CXXFLAGS=-O2 -g
+ export CXXFLAGS
+ FFLAGS=-O2 -g
+ export FFLAGS
+ [ -e /lib/modules/4.15.0-1-amd64/source ]
+ echo /lib/modules/4.15.0-1-amd64/source
+ ../spl-0.7.0/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/lib/x86_64-linux-gnu --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --with-config=kernel --with-linux=/lib/modules/4.15.0-1-amd64/source --with-linux-obj=/lib/modules/4.15.0-1-amd64/build --disable-debug --disable-debug-log --disable-debug-kmem --disable-debug-kmem-tracking --disable-atomic-spinlocks
...

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

  • My code follows the ZFS on Linux code style requirements.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • All commit messages are properly formatted and contain Signed-off-by.
  • Change has been approved by a ZFS on Linux member.

With rpm-software-management/rpm@5e94633 a package version containing
invalid characters (most commonly a double '-') causes the kmod package
generation to terminate with an error.  This change takes advantage of
the newly introduced rpm macro "_wrong_version_format_terminate_build"
to allow kmod packages to be built.

Signed-off-by:  loli10K <[email protected]>
Requires-spl: refs/pull/691/head
@codecov
Copy link

codecov bot commented Mar 9, 2018

Codecov Report

Merging #7284 into master will decrease coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7284      +/-   ##
==========================================
- Coverage   76.53%   76.48%   -0.05%     
==========================================
  Files         328      328              
  Lines      104006   104006              
==========================================
- Hits        79600    79552      -48     
- Misses      24406    24454      +48
Flag Coverage Δ
#kernel 75.96% <ø> (-0.4%) ⬇️
#user 65.76% <ø> (-0.16%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e5d148...f05fa25. Read the comment docs.

@behlendorf behlendorf merged commit c45c6d9 into openzfs:master Mar 9, 2018
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Mar 12, 2018
With rpm-software-management/rpm@5e94633 a package version containing
invalid characters (most commonly a double '-') causes the kmod package
generation to terminate with an error.  This change takes advantage of
the newly introduced rpm macro "_wrong_version_format_terminate_build"
to allow kmod packages to be built.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by:  loli10K <[email protected]>
Closes openzfs#7284
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Mar 13, 2018
This is a squashed patchset for zfs-0.7.7.  The individual commits are
in the tonyhutter:zfs-0.7.7-hutter branch.  I squashed the commits so
that buildbot wouldn't have to run against each one, and because
github/builbot seem to have a maximum limit of 30 commits they can
test from a PR.

- Fix MMP write frequency for large pools openzfs#7205 openzfs#7289
- Handle zio_resume and mmp => off openzfs#7286
- Fix zfs-kmod builds when using rpm >= 4.14 openzfs#7284
- zdb and inuse tests don't pass with real disks openzfs#6939 openzfs#7261
- Take user namespaces into account in policy checks openzfs#6800 openzfs#7270
- Detect long config lock acquisition in mmp openzfs#7212
- Linux 4.16 compat: get_disk_and_module() openzfs#7264
- Change checksum & IO delay ratelimit values openzfs#7252
- Increment zil_itx_needcopy_bytes properly openzfs#6988 openzfs#7176
- Fix some typos openzfs#7237
- Fix zpool(8) list example to match actual format openzfs#7244
- Add SMART self-test results to zpool status -c openzfs#7178
- Add scrub after resilver zed script openzfs#4662 openzfs#7086
- Fix free memory calculation on v3.14+ openzfs#7170
- Report duration and error in mmp_history entries openzfs#7190
- Do not initiate MMP writes while pool is suspended openzfs#7182
- Linux 4.16 compat: use correct *_dec_and_test()
- Allow modprobe to fail when called within systemd openzfs#7174
- Add SMART attributes for SSD and NVMe openzfs#7183 openzfs#7193
- Correct count_uberblocks in mmp.kshlib openzfs#7191
- Fix config issues: frame size and headers openzfs#7169
- Clarify zinject(8) explanation of -e openzfs#7172
- OpenZFS 8857 - zio_remove_child() panic due to already destroyed parent zio openzfs#7168
- 'zfs receive' fails with "dataset is busy" openzfs#7129 openzfs#7154
- contrib/initramfs: add missing conf.d/zfs openzfs#7158
- mmp should use a fixed tag for spa_config locks openzfs#6530 openzfs#7155
- Handle zap_add() failures in mixed case mode openzfs#7011 openzfs#7054
- Fix zdb -ed on objset for exported pool openzfs#7099 openzfs#6464
- Fix zdb -E segfault openzfs#7099
- Fix zdb -R decompression openzfs#7099 openzfs#4984
- Fix racy assignment of zcb.zcb_haderrors openzfs#7099
- Fix zle_decompress out of bound access openzfs#7099
- Fix zdb -c traverse stop on damaged objset root openzfs#7099
- Linux 4.11 compat: avoid refcount_t name conflict openzfs#7148
- Linux 4.16 compat: inode_set_iversion() openzfs#7148
- OpenZFS 8966 - Source file zfs_acl.c, function zfs_aclset_common contains a use after end of the lifetime of a local variable openzfs#7141
- Remove deprecated zfs_arc_p_aggressive_disable openzfs#7135
- Fix default libdir for Debian/Ubuntu openzfs#7083 openzfs#7101
- Bug fix in qat_compress.c for vmalloc addr check openzfs#7125
- Fix systemd_ RPM macros usage on Debian-based distributions openzfs#7074 openzfs#7100
- Emit an error message before MMP suspends pool openzfs#7048
- ZTS: Fix create-o_ashift test case openzfs#6924 openzfs#6977
- Fix --with-systemd on Debian-based distributions (openzfs#6963) openzfs#6591 openzfs#6963
- Remove vn_rename and vn_remove dependency openzfs/spl#648 openzfs#6753
- Add support for "--enable-code-coverage" option openzfs#6670
- Make "-fno-inline" compile option more accessible openzfs#6605
- Add configure option to enable gcov analysis openzfs#6642
- Implement --enable-debuginfo to force debuginfo openzfs#2734
- Make --enable-debug fail when given bogus args openzfs#2734

Signed-off-by: Tony Hutter <[email protected]>
Requires-spl: refs/pull/690/head
@tonyhutter tonyhutter mentioned this pull request Mar 13, 2018
13 tasks
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Mar 13, 2018
This is a squashed patchset for zfs-0.7.7.  The individual commits are
in the tonyhutter:zfs-0.7.7-hutter branch.  I squashed the commits so
that buildbot wouldn't have to run against each one, and because
github/builbot seem to have a maximum limit of 30 commits they can
test from a PR.

- Fix MMP write frequency for large pools openzfs#7205 openzfs#7289
- Handle zio_resume and mmp => off openzfs#7286
- Fix zfs-kmod builds when using rpm >= 4.14 openzfs#7284
- zdb and inuse tests don't pass with real disks openzfs#6939 openzfs#7261
- Take user namespaces into account in policy checks openzfs#6800 openzfs#7270
- Detect long config lock acquisition in mmp openzfs#7212
- Linux 4.16 compat: get_disk_and_module() openzfs#7264
- Change checksum & IO delay ratelimit values openzfs#7252
- Increment zil_itx_needcopy_bytes properly openzfs#6988 openzfs#7176
- Fix some typos openzfs#7237
- Fix zpool(8) list example to match actual format openzfs#7244
- Add SMART self-test results to zpool status -c openzfs#7178
- Add scrub after resilver zed script openzfs#4662 openzfs#7086
- Fix free memory calculation on v3.14+ openzfs#7170
- Report duration and error in mmp_history entries openzfs#7190
- Do not initiate MMP writes while pool is suspended openzfs#7182
- Linux 4.16 compat: use correct *_dec_and_test()
- Allow modprobe to fail when called within systemd openzfs#7174
- Add SMART attributes for SSD and NVMe openzfs#7183 openzfs#7193
- Correct count_uberblocks in mmp.kshlib openzfs#7191
- Fix config issues: frame size and headers openzfs#7169
- Clarify zinject(8) explanation of -e openzfs#7172
- OpenZFS 8857 - zio_remove_child() panic due to already destroyed
  parent zio openzfs#7168
- 'zfs receive' fails with "dataset is busy" openzfs#7129 openzfs#7154
- contrib/initramfs: add missing conf.d/zfs openzfs#7158
- mmp should use a fixed tag for spa_config locks openzfs#6530 openzfs#7155
- Handle zap_add() failures in mixed case mode openzfs#7011 openzfs#7054
- Fix zdb -ed on objset for exported pool openzfs#7099 openzfs#6464
- Fix zdb -E segfault openzfs#7099
- Fix zdb -R decompression openzfs#7099 openzfs#4984
- Fix racy assignment of zcb.zcb_haderrors openzfs#7099
- Fix zle_decompress out of bound access openzfs#7099
- Fix zdb -c traverse stop on damaged objset root openzfs#7099
- Linux 4.11 compat: avoid refcount_t name conflict openzfs#7148
- Linux 4.16 compat: inode_set_iversion() openzfs#7148
- OpenZFS 8966 - Source file zfs_acl.c, function zfs_aclset_common
  contains a use after end of the lifetime of a local variable openzfs#7141
- Remove deprecated zfs_arc_p_aggressive_disable openzfs#7135
- Fix default libdir for Debian/Ubuntu openzfs#7083 openzfs#7101
- Bug fix in qat_compress.c for vmalloc addr check openzfs#7125
- Fix systemd_ RPM macros usage on Debian-based distributions openzfs#7074
  openzfs#7100
- Emit an error message before MMP suspends pool openzfs#7048
- ZTS: Fix create-o_ashift test case openzfs#6924 openzfs#6977
- Fix --with-systemd on Debian-based distributions (openzfs#6963) openzfs#6591 openzfs#6963
- Remove vn_rename and vn_remove dependency openzfs/spl#648 openzfs#6753
- Add support for "--enable-code-coverage" option openzfs#6670
- Make "-fno-inline" compile option more accessible openzfs#6605
- Add configure option to enable gcov analysis openzfs#6642
- Implement --enable-debuginfo to force debuginfo openzfs#2734
- Make --enable-debug fail when given bogus args openzfs#2734

Signed-off-by: Tony Hutter <[email protected]>
Requires-spl: refs/pull/690/head
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Mar 13, 2018
With rpm-software-management/rpm@5e94633 a package version containing
invalid characters (most commonly a double '-') causes the kmod package
generation to terminate with an error.  This change takes advantage of
the newly introduced rpm macro "_wrong_version_format_terminate_build"
to allow kmod packages to be built.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by:  loli10K <[email protected]>
Closes openzfs#7284
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Mar 13, 2018
This is a squashed patchset for zfs-0.7.7.  The individual commits are
in the tonyhutter:zfs-0.7.7-hutter branch.  I squashed the commits so
that buildbot wouldn't have to run against each one, and because
github/builbot seem to have a maximum limit of 30 commits they can
test from a PR.

- Fix MMP write frequency for large pools openzfs#7205 openzfs#7289
- Handle zio_resume and mmp => off openzfs#7286
- Fix zfs-kmod builds when using rpm >= 4.14 openzfs#7284
- zdb and inuse tests don't pass with real disks openzfs#6939 openzfs#7261
- Take user namespaces into account in policy checks openzfs#6800 openzfs#7270
- Detect long config lock acquisition in mmp openzfs#7212
- Linux 4.16 compat: get_disk_and_module() openzfs#7264
- Change checksum & IO delay ratelimit values openzfs#7252
- Increment zil_itx_needcopy_bytes properly openzfs#6988 openzfs#7176
- Fix some typos openzfs#7237
- Fix zpool(8) list example to match actual format openzfs#7244
- Add SMART self-test results to zpool status -c openzfs#7178
- Add scrub after resilver zed script openzfs#4662 openzfs#7086
- Fix free memory calculation on v3.14+ openzfs#7170
- Report duration and error in mmp_history entries openzfs#7190
- Do not initiate MMP writes while pool is suspended openzfs#7182
- Linux 4.16 compat: use correct *_dec_and_test()
- Allow modprobe to fail when called within systemd openzfs#7174
- Add SMART attributes for SSD and NVMe openzfs#7183 openzfs#7193
- Correct count_uberblocks in mmp.kshlib openzfs#7191
- Fix config issues: frame size and headers openzfs#7169
- Clarify zinject(8) explanation of -e openzfs#7172
- OpenZFS 8857 - zio_remove_child() panic due to already destroyed
  parent zio openzfs#7168
- 'zfs receive' fails with "dataset is busy" openzfs#7129 openzfs#7154
- contrib/initramfs: add missing conf.d/zfs openzfs#7158
- mmp should use a fixed tag for spa_config locks openzfs#6530 openzfs#7155
- Handle zap_add() failures in mixed case mode openzfs#7011 openzfs#7054
- Fix zdb -ed on objset for exported pool openzfs#7099 openzfs#6464
- Fix zdb -E segfault openzfs#7099
- Fix zdb -R decompression openzfs#7099 openzfs#4984
- Fix racy assignment of zcb.zcb_haderrors openzfs#7099
- Fix zle_decompress out of bound access openzfs#7099
- Fix zdb -c traverse stop on damaged objset root openzfs#7099
- Linux 4.11 compat: avoid refcount_t name conflict openzfs#7148
- Linux 4.16 compat: inode_set_iversion() openzfs#7148
- OpenZFS 8966 - Source file zfs_acl.c, function zfs_aclset_common
  contains a use after end of the lifetime of a local variable openzfs#7141
- Remove deprecated zfs_arc_p_aggressive_disable openzfs#7135
- Fix default libdir for Debian/Ubuntu openzfs#7083 openzfs#7101
- Bug fix in qat_compress.c for vmalloc addr check openzfs#7125
- Fix systemd_ RPM macros usage on Debian-based distributions openzfs#7074
  openzfs#7100
- Emit an error message before MMP suspends pool openzfs#7048
- ZTS: Fix create-o_ashift test case openzfs#6924 openzfs#6977
- Fix --with-systemd on Debian-based distributions (openzfs#6963) openzfs#6591 openzfs#6963
- Remove vn_rename and vn_remove dependency openzfs/spl#648 openzfs#6753
- Fix "--enable-code-coverage" debug build openzfs#6674
- Update codecov.yml openzfs#6669
- Add support for "--enable-code-coverage" option openzfs#6670
- Make "-fno-inline" compile option more accessible openzfs#6605
- Add configure option to enable gcov analysis openzfs#6642
- Implement --enable-debuginfo to force debuginfo openzfs#2734
- Make --enable-debug fail when given bogus args openzfs#2734

Signed-off-by: Tony Hutter <[email protected]>
Requires-spl: refs/pull/690/head
tonyhutter pushed a commit that referenced this pull request Mar 19, 2018
With rpm-software-management/rpm@5e94633 a package version containing
invalid characters (most commonly a double '-') causes the kmod package
generation to terminate with an error.  This change takes advantage of
the newly introduced rpm macro "_wrong_version_format_terminate_build"
to allow kmod packages to be built.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by:  loli10K <[email protected]>
Closes #7284
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing to build packages: Invalid version (double separator '-')
2 participants