bnxt_en: Fix build failure due to signing keys

Commit 4aa9658077 ("CentOS: Place module signing keys in a separate
package") split the kernel's signing keys into a separate package and
adjusted the build dependencies of all kernel modules. However, the
changes for bnxt_en.spec were made to an incorrect line due to an
admittedly misleading %define directive left over from the development
of the original version of the spec file, introduced with commit
0ae9f6bd53 ("Add Broadcom NetXtreme-E drivers").

The build failure is as follows:

  === 8< ===
+ /usr/src/kernels/.../scripts/sign-file \
  sha256 \
  /usr/src/kernels/.../signing_key.pem \
  /usr/src/kernels/.../signing_key.x509 \
  .../extra/bnxt_en/drivers/infiniband/hw/bnxt_re/bnxt_re.ko

At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: \
  bss_file.c:175
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: \
  bss_file.c:182
sign-file: /usr/src/kernels/.../signing_key.pem: No such file or \
  directory
  === >8 ===

To resolve the build failure, this commit adds the newly added
kernel{,-rt}-devel-keys package to a BuildRequires line of the bnxt_en
kernel module spec file.

Furthermore, to prevent similar accidents from occurring in the future,
this commit removes the problematic %define directive from the spec
file.

Verification
- First, reproduce this issue as follows: Clean the mock chroot used by
  the CentOS-based StarlingX build system and then run the following
  commands:
    build-pkgs --clean kernel kmod-bnxt_en && \
    build-pkgs kernel kmod-bnxt_en

- Afterwards, apply this commit and confirm that the following command
  no longer fails, indicating that the build issue discussed in the
  description is fixed: build-pkgs kernel kmod-bnxt_en

Closes-Bug: 1990282
Fixes: 0ae9f6bd53 ("Add Broadcom NetXtreme-E drivers")
Fixes: 4aa9658077 ("CentOS: Place module signing keys in a separate package")
Change-Id: Ief76dec1966a19f1417d67833f74980280cf1f36
Signed-off-by: M. Vefa Bicakci <vefa.bicakci@windriver.com>
This commit is contained in:
M. Vefa Bicakci 2022-09-20 10:05:28 -04:00
parent b01a7cc659
commit d5b71162c6

View File

@ -11,8 +11,6 @@
## Default: retpolines are enabled.
%bcond_without retpoline
%define kernel_module_package_buildreqs kernel%{?bt_ext}-devel, kernel%{?bt_ext}-devel-keys
# Disable the building of debug package(s).
%define debug_package %{nil}
@ -31,7 +29,8 @@ BuildRequires: devtoolset-8-build
BuildRequires: devtoolset-8-binutils
BuildRequires: devtoolset-8-gcc
BuildRequires: devtoolset-8-make
BuildRequires: kernel%{?bt_ext}-devel findutils
BuildRequires: findutils
BuildRequires: kernel%{?bt_ext}-devel kernel%{?bt_ext}-devel-keys
BuildRequires: mlnx-ofa_kernel%{?bt_ext}-devel mlnx-ofa_kernel%{?bt_ext}-source
Requires: mlnx-ofa_kernel%{?bt_ext}-modules
Requires(post): /usr/sbin/depmod