[LU-15521] RPM 4.16 support Created: 06/Feb/22  Updated: 09/Jan/24  Resolved: 09/Jan/24

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.16.0

Type: Improvement Priority: Minor
Reporter: Jian Yu Assignee: Jian Yu
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-15420 Linux kernel 5.15 support Open
is related to LU-15797 RHEL9 rpm spec updates Resolved
is related to LU-15874 RHEL 9.0 support Resolved
Rank (Obsolete): 9223372036854775807

 Description   

RPM 4.16 removed support for bare words in expressions (eg a == b needs to be "a" == "b" now). More changes are in:
https://rpm.org/wiki/Releases/4.16.0

The following errors in lustre.spec and lustre-dkms.spec need to be resolved:

# rpm --version
RPM version 4.16.1.3
# find . -name "*.spec" | xargs rpmlint
./lustre.spec:442: W: macro-in-comment %optflags
./lustre.spec:469: W: macro-in-comment %{name}
./lustre.spec:723: E: hardcoded-library-path in %{_prefix}/lib/ocf/resource.d/lustre/
./lustre.spec:110: W: mixed-use-of-spaces-and-tabs (spaces: line 110, tab: line 59)
./lustre.spec: E: specfile-error error: bare words are no longer supported, please use "...":  redhat=="redhat" || redhat=="fedora"
./lustre.spec: E: specfile-error error:                                                        ^
./lustre.spec: E: specfile-error error: ./lustre.spec:133: bad %if condition:  redhat=="redhat" || redhat=="fedora"
./lustre.spec: E: specfile-error error: query of specfile ./lustre.spec failed, can't parse
./lustre-dkms.spec:79: W: unversioned-explicit-provides lustre-dkms
./lustre-dkms.spec:80: W: unversioned-explicit-obsoletes lustre-dkms
./lustre-dkms.spec:107: W: unversioned-explicit-provides lustre-osd
./lustre-dkms.spec:109: W: unversioned-explicit-provides lustre-client
./lustre-dkms.spec:144: E: hardcoded-library-path in /usr/lib/dkms/common.postinst
./lustre-dkms.spec:40: W: mixed-use-of-spaces-and-tabs (spaces: line 40, tab: line 12)
./lustre-dkms.spec: E: specfile-error error: bare words are no longer supported, please use "...":  redhat=="redhat" || redhat=="fedora"
./lustre-dkms.spec: E: specfile-error error:                                                        ^
./lustre-dkms.spec: E: specfile-error error: ./lustre-dkms.spec:31: bad %if condition:  redhat=="redhat" || redhat=="fedora"
./lustre-dkms.spec: E: specfile-error error: query of specfile ./lustre-dkms.spec failed, can't parse
0 packages and 2 specfiles checked; 10 errors, 8 warnings.


 Comments   
Comment by Gerrit Updater [ 07/Feb/22 ]

"Jian Yu <yujian@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46471
Subject: LU-15521 spec: fix bare words error with rpm 4.16
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: e58e85128e5e7f6e682f9c9318c1429b7a60fe79

Comment by Jian Yu [ 07/Feb/22 ]

More issues need to be resolved:

warning: /tmp/rpmbuild-lustre-root-IAPduFT5/SPECS/lustre.spec: line 272: Macro %kmp_release defined but not used within scope
warning: /tmp/rpmbuild-lustre-root-IAPduFT5/SPECS/lustre.spec: line 272: Macro %kmp_version defined but not used within scope
warning: /tmp/rpmbuild-lustre-root-IAPduFT5/SPECS/lustre.spec: line 272: Macro %latest_kernel defined but not used within scope
warning: /tmp/rpmbuild-lustre-root-IAPduFT5/SPECS/lustre.spec: line 275: Macro %kmp_release defined but not used within scope
warning: /tmp/rpmbuild-lustre-root-IAPduFT5/SPECS/lustre.spec: line 275: Macro %kmp_version defined but not used within scope
warning: /tmp/rpmbuild-lustre-root-IAPduFT5/SPECS/lustre.spec: line 275: Macro %latest_kernel defined but not used within scope
warning: /tmp/rpmbuild-lustre-root-IAPduFT5/SPECS/lustre.spec: line 377: Macro %kmp_release defined but not used within scope
warning: /tmp/rpmbuild-lustre-root-IAPduFT5/SPECS/lustre.spec: line 377: Macro %kmp_version defined but not used within scope
warning: /tmp/rpmbuild-lustre-root-IAPduFT5/SPECS/lustre.spec: line 377: Macro %latest_kernel defined but not used within scope
sh: -c: line 13: syntax error near unexpected token `('
sh: -c: line 13: `    /usr/bin/sed -r --in-place=.backup 's/^char \(\*f\) \(\) = /__attribute__ ((used)) char (*f) () = /g' $file; '

The issues came from the following codes:

lustre.spec.in
%if 0%{?rhel} == 7
# until we have achieved full kABI compatibility we need to
# restrict the kernel range that can be used to the kernel
# version from the RHEL minor release
# this is supposed to be done for kmods automatically but
# RHBZ#1467319 seems to be getting in the way
# this is true for el7.0 through el7.4
%define preamble %{expand:%(
TMPFILE=`mktemp`
cat %{SOURCE1} > $TMPFILE
kver=%{kernel_version}
linuxversion=${kver%%%%-*}
linuxrelease=${kver##*-}
kabiminor=${linuxrelease%%%%.*}
echo "Requires:       kernel < $linuxversion-$((kabiminor+1)), kernel >= $linuxversion-$((kabiminor))" >> $TMPFILE
echo $TMPFILE
)}
%else
%define preamble %{SOURCE1}
%endif
%kernel_module_package -n %{name} -p %preamble -f %SOURCE2 %{_flavor}
Comment by Gerrit Updater [ 11/Jun/22 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/46471/
Subject: LU-15521 spec: fix bare words error with rpm 4.16
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 597a6bf9e085150dd57eb727859b114deb8979cb

Comment by Peter Jones [ 11/Jun/22 ]

Landed for 2.16

Comment by Jian Yu [ 12/Jun/22 ]

More issues need to be resolved.

Comment by Gerrit Updater [ 23/Jun/22 ]

"Jian Yu <yujian@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/47710
Subject: LU-15521 spec: fix bare words error with rpm 4.16
Project: fs/lustre-release
Branch: b2_15
Current Patch Set: 1
Commit: fefa92f8e69f918641cdcbae52e86c3046565613

Comment by Gerrit Updater [ 29/Jun/22 ]

"Jian Yu <yujian@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/47833
Subject: LU-15521 spec: fix more bare words error with rpm 4.16
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 091bb5a39957b17cd3ebe77314870bbcc386eab6

Comment by Gerrit Updater [ 29/Jun/22 ]

"Jian Yu <yujian@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/47835
Subject: LU-15521 spec: fix more bare words error with rpm 4.16
Project: fs/lustre-release
Branch: b2_15
Current Patch Set: 1
Commit: a7b2994915b323d8be356b527ad27992196bdcb9

Comment by Gerrit Updater [ 05/Jul/22 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/47710/
Subject: LU-15521 spec: fix bare words error with rpm 4.16
Project: fs/lustre-release
Branch: b2_15
Current Patch Set:
Commit: ea45daebe0b03d449f99ca4ae949638b7e7d07a7

Comment by Gerrit Updater [ 10/Jul/22 ]

"Shaun Tancheff <shaun.tancheff@hpe.com>" uploaded a new patch: https://review.whamcloud.com/47929
Subject: LU-15521 build: Spec updates for RHEL9
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 854d88400a5e03a32d23c6fd311e8d821e270623

Comment by Gerrit Updater [ 15/Jul/22 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/47833/
Subject: LU-15521 spec: fix more bare words error with rpm 4.16
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 81530fe44c6b8d8819b8e70ea99ef7014c23a05b

Comment by Gerrit Updater [ 15/Jul/22 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/47835/
Subject: LU-15521 spec: fix more bare words error with rpm 4.16
Project: fs/lustre-release
Branch: b2_15
Current Patch Set:
Commit: 93169988e5f1e0723c02ec9b0bf5ba911b42a04d

Generated at Sat Feb 10 03:19:01 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.