Add missing BuildRequires to allow kmods to build reliably

The original update that broke layered build was
https://review.opendev.org/#/c/727908

all kmods failed to build due to a missing BuildRequires
on elfutils-libelf-devel.

The actual error message was:

Makefile:977: *** "Cannot generate ORC metadata for
CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or
elfutils-libelf-devel". Stop.
make: *** [default] Error 2
RPM build errors:

In the case of centos, it is elfutils-libelf-devel that we need.
The need for the kmod appears to relate to the new 4.18 kernel.
It might be that kernel-devel should now have a 'Require
elfutils-libelf-devel'

Reproducibility depends on one of a few factors.  If
elfutils-libelf-devel may already be present within the mock
environment due to build of a prior package, the build will pass.
The kernel build pulls in elfutils-libelf-devel, and produces
kernel-devel which is required for kmod builds.  So it's easy to
overlook this defect.

So we need a build where mock is clean yet the kernel is already
built.  Two possibilities.
1) clean mock after building the kernel, but before building the kmods.
2) build avoidance when the kernel has not changed, but the kmod has.

CENGN layered build hit the second scenario.

This fix tackles the problem from the kmod side by adding BuildRequires
elfutils-libelf-devel to each kmod.

An alternative approach might be to add a Requires elfutils-libelf-devel
to kernel-devel.  That option has not yet been explored.  So I'll call
that a partial fix only.

Partial-Bug: 1878072
Partial-Bug: 1880248
Change-Id: I472a5a285c2b47401fa6594358c0578d81e3f678
Signed-off-by: Scott Little <scott.little@windriver.com>
This commit is contained in:
Scott Little 2020-05-22 17:33:38 -04:00
parent 06dfc759e7
commit 494c52a7db
17 changed files with 40 additions and 8 deletions

View File

@ -1,4 +1,4 @@
COPY_LIST="$FILES_BASE/* \
$DISTRO/patches/* \
$CGCS_BASE/downloads/drbd-8.4.11-1.tar.gz"
TIS_PATCH_VER=3
TIS_PATCH_VER=4

View File

@ -18,6 +18,7 @@ License: GPLv2+
Summary: %{kmod_name} kernel module(s)
BuildRequires: kernel%{?bt_ext}-devel, redhat-rpm-config, perl, openssl
BuildRequires: elfutils-libelf-devel
ExclusiveArch: x86_64
# Sources.

View File

@ -1,4 +1,4 @@
COPY_LIST=" \
$PKG_BASE/files/* \
$STX_BASE/downloads/e1000e-3.6.0.tar.gz"
TIS_PATCH_VER=3
TIS_PATCH_VER=4

View File

@ -16,6 +16,7 @@ Summary: %{kmod_name}%{?bt_ext} kernel module(s)
URL: http://www.intel.com/
BuildRequires: kernel%{?bt_ext}-devel, redhat-rpm-config, perl, openssl
BuildRequires: elfutils-libelf-devel
ExclusiveArch: x86_64
# Sources.

View File

@ -1,4 +1,4 @@
COPY_LIST=" \
$PKG_BASE/files/* \
$STX_BASE/downloads/i40e-2.10.19.82.tar.gz"
TIS_PATCH_VER=3
TIS_PATCH_VER=4

View File

@ -16,6 +16,7 @@ Summary: %{kmod_name}%{?bt_ext} kernel module(s)
URL: http://www.intel.com/
BuildRequires: kernel%{?bt_ext}-devel, redhat-rpm-config, perl, openssl
BuildRequires: elfutils-libelf-devel
ExclusiveArch: x86_64
# Sources.

View File

@ -1,4 +1,4 @@
COPY_LIST=" \
$PKG_BASE/files/* \
$STX_BASE/downloads/iavf-3.7.61.20.tar.gz"
TIS_PATCH_VER=3
TIS_PATCH_VER=4

View File

@ -16,6 +16,7 @@ Summary: %{kmod_name} kernel module(s)
URL: http://www.intel.com/
BuildRequires: kernel%{?bt_ext}-devel, redhat-rpm-config, perl, openssl
BuildRequires: elfutils-libelf-devel
ExclusiveArch: x86_64
# Sources.

View File

@ -1,4 +1,4 @@
COPY_LIST=" \
$PKG_BASE/files/* \
$STX_BASE/downloads/ixgbe-5.6.5.tar.gz"
TIS_PATCH_VER=3
TIS_PATCH_VER=4

View File

@ -16,6 +16,7 @@ Summary: %{kmod_name} kernel module(s)
URL: http://www.intel.com/
BuildRequires: kernel%{?bt_ext}-devel, redhat-rpm-config, perl, openssl
BuildRequires: elfutils-libelf-devel
ExclusiveArch: x86_64
# Sources.

View File

@ -1,4 +1,4 @@
COPY_LIST=" \
$PKG_BASE/files/* \
$STX_BASE/downloads/ixgbevf-4.6.3.tar.gz"
TIS_PATCH_VER=3
TIS_PATCH_VER=4

View File

@ -16,6 +16,7 @@ Summary: %{kmod_name} kernel module(s)
URL: http://www.intel.com/
BuildRequires: kernel%{?bt_ext}-devel, redhat-rpm-config, perl, openssl
BuildRequires: elfutils-libelf-devel
ExclusiveArch: x86_64
# Sources.

View File

@ -1,3 +1,3 @@
COPY_LIST="$PKG_BASE/files/modules-load.conf"
TIS_PATCH_VER=3
TIS_PATCH_VER=4
BUILD_IS_SLOW=3

View File

@ -0,0 +1,24 @@
From 372af54951e76f0f03c85a3e99711a400a9e7072 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Fri, 22 May 2020 17:22:30 -0400
Subject: [PATCH] add BuildRequires elfutils-libelf-devel
---
SPECS/mlnx-ofa_kernel.spec | 1 +
1 file changed, 1 insertion(+)
diff --git a/SPECS/mlnx-ofa_kernel.spec b/SPECS/mlnx-ofa_kernel.spec
index 44a31ef..bddd949 100644
--- a/SPECS/mlnx-ofa_kernel.spec
+++ b/SPECS/mlnx-ofa_kernel.spec
@@ -35,6 +35,7 @@
%{!?KMP: %global KMP 0}
BuildRequires: kernel%{?bt_ext}-devel, openssl
+BuildRequires: elfutils-libelf-devel
%global WITH_SYSTEMD %(if ( test -d "%{_unitdir}" > /dev/null); then echo -n '1'; else echo -n '0'; fi)
%{!?configure_options: %global configure_options --with-core-mod --with-user_mad-mod --with-user_access-mod --with-addr_trans-mod --with-mlx4-mod --with-mlx4_en-mod --with-mlx5-mod --with-mlxfw-mod --with-ipoib-mod}
--
1.8.3.1

View File

@ -1 +1,2 @@
0001-Support-TiS-system.patch
0002-add-BuildRequires-elfutils-libelf-devel.patch

View File

@ -2,5 +2,5 @@ COPY_LIST=" \
$PKG_BASE/files/* \
$STX_BASE/downloads/qat1.7.l.4.5.0-00034.tar.gz \
"
TIS_PATCH_VER=3
TIS_PATCH_VER=4
BUILD_IS_SLOW=3

View File

@ -23,6 +23,7 @@ BuildRequires: libudev-devel
BuildRequires: boost-devel
BuildRequires: perl
BuildRequires: openssl
BuildRequires: elfutils-libelf-devel
%define icp_tools accelcomp
%define kernel_version %(rpm -q kernel%{?bt_ext}-devel | sed 's/kernel%{?bt_ext}-devel-//')