kernel-rt.spec: Install modules.kvm only once

Unlike the standard kernel's kernel.spec, the low-latency/preempt-rt
kernel's kernel-rt.spec splits KVM-related kernel modules into a
separate RPM package, named kernel-rt-kvm. However, there exists a bug
in the generation of the kernel-rt-core RPM package, which causes the
file /lib/modules/<kver>/modules.kvm file to be included in
kernel-rt-core package as well as the kernel-rt-kvm package.

This issue has not been problematic until commit bccb327f150f ("Fix
secure boot signing of 5.10 kernel") has been merged to the
starlingx/root repository. For easier cross-referencing, the
aforementioned commit's change identifier is as follows:
  I4f49b9ac48fa50397aa98b8075386400b62ec6fa

With the aforementioned change and with an ISO file that includes a
kernel-rt-core RPM package that has been regenerated for binary code
signing, the following installation error is encountered at installation
time in All-in-One mode and low-latency profile:

  YumRPMTransError: Could not run transaction.
  file /lib/modules/5.10.74-XXX.XXXX.tis.rt.el7.x86_64/modules.kvm
  conflicts between attempted installs of
  kernel-rt-kvm-5.10.74-XXX.XXXX.tis.rt.el7.x86_64 and
  kernel-rt-core-5.10.74-XXX.XXXX.tis.rt.el7.x86_64

The reason why the aforementioned commit uncovers this issue is not
fully known, but is most likely because the procedure for signing the
kernel binaries regenerates the RPM files, which, along the way, change
the attributes (such as the timestamp) of the modules.kvm file in
kernel-rt-core. The discrepancy of the modules.kvm file's attributes
between kernel-rt-core and kernel-rt-kvm appears to cause this issue.

This commit resolves this issue by ensuring that the modules.kvm file is
only provided by the kernel-rt-kvm RPM package and not the
kernel-rt-core package.

Verification:
- An ISO image was built successfully with an incremental monolithic
  build.
- The generated kernel-rt-core RPM package was confirmed to not include
  a modules.kvm file.
- The built ISO image was confirmed to successfully install onto a VM
  using the All-in-One mode with low-latency profile.

Closes-Bug: #1952488

Signed-off-by: M. Vefa Bicakci <vefa.bicakci@windriver.com>
Change-Id: I5e783c9b931450a5b81d6b597892e93a66ddd25f
This commit is contained in:
M. Vefa Bicakci 2021-11-26 17:13:56 -05:00
parent 84af231862
commit e0a913e78a

View File

@ -2932,6 +2932,7 @@ fi
%{expand:%%files -f kernel-%{?3:%{3}-}core.list %{?1:-f kernel-%{?3:%{3}-}ldsoconf.list} %{?3:%{3}-}core}\
%exclude /lib/modules/%{KVERREL}%{?3:+%{3}}/kernel/arch/x86/kvm\
%exclude /lib/modules/%{KVERREL}%{?3:+%{3}}/kernel/drivers/gpu/drm/i915/gvt\
%exclude /lib/modules/%{KVERREL}%{?3:+%{3}}/modules.kvm\
%{!?_licensedir:%global license %%doc}\
%license linux-%{KVERREL}/COPYING-%{version}-%{release}\
/lib/modules/%{KVERREL}%{?3:+%{3}}/%{?-k:%{-k*}}%{!?-k:vmlinuz}\