Install MLNX OFED 4.7 on CentOS 8.0 with kernel 4.20.0 failed

We have machine installed with CentOS 8.0 with kernel 4.20.0, when we try to install MLNX OFED with “–upstream-libs --add-kernel-support --skip repo --distro RHEL8.0”, we would see the kernel module compilation failure like below,

*** ERROR: ambiguous python shebang in /usr/sbin/sysinfo-snapshot.py: #!/usr/bin/python. Change it to python3 (or python2) explicitly.

error: Bad exit status from /var/tmp/rpm-tmp.0P2KDE (%install)

It appears there’s a bug in the SRPM’s spec file due to python change in CentOS 8,

%global RHEL8 %(if test grep -E '^(ID="(rhel|ol)"|VERSION="8)' /etc/os-release 2>/dev/null | wc -l -eq 2; then echo -n ‘1’; else echo -n ‘0’; fi)

In case we insert “centos” to above line we shall have this fixed.

Hello Jacky,

Many thanks for posting your question on the Mellanox Community.

To rebuild the MLNX_OFED driver version 4.7 please install the following additional packages. After that you can use the ‘–add-kernel-support’ option to rebuild/install the MLNX_OFED driver.

The required packages for rebuilding the driver for a non-default kernel in Centos 8.0 are the following packages:

  • perl pciutils python2 gcc-gfortran python3-libxml2 tcsh expat glib2 tcl libstdc++ bc tk gtk2 atk cairo numactl pkgconfig ethtool lsof createrepo rpm-build kernel-headers kernel-devel elfutils-libelf-devel python36 python36-devel kernel-rpm-macros

You will notice that some of the packages are already installed by default on the OS.

Example output for comparison:

dnf install perl pciutils python2 gcc-gfortran python3-libxml2 tcsh expat glib2 tcl libstdc++ bc tk gtk2 atk cairo numactl pkgconfig ethtool lsof createrepo rpm-build kernel-headers kernel-devel elfutils-libelf-devel python36 python36-devel kernel-rpm-macros

Updating Subscription Management repositories.

Last metadata expiration check: 1:54:11 ago on Tue 23 Jul 2019 06:45:34 PM EDT.

Package perl-4:5.26.3-416.el8.x86_64 is already installed.

Package pciutils-3.5.6-4.el8.x86_64 is already installed.

Package python2-2.7.15-22.module+el8.0.0+2961+596d0223.x86_64 is already installed.

Package gcc-gfortran-8.2.1-3.5.el8.x86_64 is already installed.

Package python3-libxml2-2.9.7-5.el8.x86_64 is already installed.

Package tcsh-6.20.00-9.el8.x86_64 is already installed.

Package expat-2.2.5-3.el8.x86_64 is already installed.

Package glib2-2.56.4-1.el8.x86_64 is already installed.

Package tcl-1:8.6.8-2.el8.x86_64 is already installed.

Package libstdc+±8.2.1-3.5.el8.x86_64 is already installed.

Package bc-1.07.1-5.el8.x86_64 is already installed.

Package tk-1:8.6.8-1.el8.x86_64 is already installed.

Package gtk2-2.24.32-4.el8.x86_64 is already installed.

Package atk-2.28.1-1.el8.x86_64 is already installed.

Package cairo-1.15.12-3.el8.x86_64 is already installed.

Package numactl-2.0.12-2.el8.x86_64 is already installed.

Package pkgconf-pkg-config-1.4.2-1.el8.x86_64 is already installed.

Package ethtool-2:4.16-1.el8.x86_64 is already installed.

Package lsof-4.91-2.el8.x86_64 is already installed.

Package createrepo_c-0.11.0-1.el8.x86_64 is already installed.

Package rpm-build-4.14.2-9.el8.x86_64 is already installed.

Package kernel-headers-4.18.0-80.4.2.el8_0.x86_64 is already installed.

Package kernel-devel-4.18.0-80.4.2.el8_0.x86_64 is already installed.

Package elfutils-libelf-devel-0.174-6.el8.x86_64 is already installed.

Package python36-3.6.8-2.module+el8.0.0+2975+e0f02136.x86_64 is already installed.

Package python36-devel-3.6.8-2.module+el8.0.0+2975+e0f02136.x86_64 is already installed.

Package kernel-rpm-macros-116-1.el8.noarch is already installed.

Dependencies resolved.

Nothing to do.

Complete!

Thanks,

Abigail

Hi Abigail,

I’ve already installed all dependency packages, the problem occurs when the install script trying to compile kernel modules for my system, because there’s no default python on CentOS 8.

Thanks,

Jacky

Hello Jacky,

Hope you are doing well.

As you have a valid support contract I will be converting this case to a support ticket for easier communication.

Thanks,

Abigail.