Skip to content

Instantly share code, notes, and snippets.

@cityofships
Last active September 13, 2022 10:22
Show Gist options
  • Save cityofships/b4883ee19f75d14534f04115892b8465 to your computer and use it in GitHub Desktop.
Save cityofships/b4883ee19f75d14534f04115892b8465 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
OFED_URL_BASE="https://content.mellanox.com/ofed"
OFED_VERSION="5.6-2.0.9.0"
# Just in case
mkdir -p ~/tmp && sudo mount -o remount,exec /tmp || true
# Make sure the dependencies are in place
sudo dnf -y install bison \
cmake \
elfutils-devel \
flex \
gcc \
gcc-c++ \
gdb-headless \
glib2-devel \
glibc-devel \
iptables-devel \
kernel-devel \
kernel-rpm-macros \
libdb-devel \
libmnl-devel \
libnl3-devel \
libselinux-devel \
libstdc++-devel \
libtool \
numactl-devel \
openssl-devel \
perl-generators \
python3-docutils \
python38-Cython \
rpm-build \
systemd-devel \
valgrind-devel \
zlib-devel
# Download & extract OFED sources
curl ${OFED_URL_BASE}/MLNX_OFED-${OFED_VERSION}/MLNX_OFED_SRC-${OFED_VERSION}.tgz \
-o MLNX_OFED_SRC-${OFED_VERSION}.tgz && \
tar xzf MLNX_OFED_SRC-${OFED_VERSION}.tgz && \
cd MLNX_OFED_SRC-${OFED_VERSION}
# Start the build process - just kernel modules.
# Avoids usage of /var/tmp by specifying --builddir argument.
./install.pl --basic \
--build-only \
--builddir ~/tmp \
--distro el8s \
--kernel-only \
--without-depcheck
@cityofships
Copy link
Author

Usage: ./install.pl [-c <packages config_file>|--all|--hpc|--vma|--xlio|--basic|--bluefield] [OPTIONS]

Installation control:
    --force              Force installation
    --tmpdir             Change tmp directory. Default: /tmp
    -l|--prefix          Set installation prefix
    -k|--kernel <version>
                         Default on this system: 4.18.0-394.el8.x86_64
    -s|--kernel-sources <path>
                         Default on this system: /lib/modules/4.18.0-394.el8.x86_64/build
    -U|--update          Update installed version
    -b|--build-only      Build binary RPMs without installing them
                         - This option is supported only when '--kernel-only' option is given.
    --build32            Build 32-bit libraries. Relevant for x86_64 platforms
    --distro             Set Distro name for the running OS (e.g: rhel6.5, sles12sp3)
                         Default: Use auto-detection
    --without-depcheck   Run the installation without verifying that all required Distro's packages are installed
    --check-deps-only    Check for missing required Distro's packages and exit
    --print-distro       Print distribution name and exit
    --disable-kmp        Build kernel RPMs without KMP support
    --speed-up-kmp       Speed up KMP RPMs installation by skipping %post section and running the required operations once for all KMPs
    --builddir           Change build directory. Default: /var/tmp
    --umad-dev-rw        Grant non root users read/write permission for umad devices instead of default
    --umad-dev-na        Prevent from non root users read/write access for umad devices. Overrides '--umad-dev-rw'
    --enable-mlnx_tune   Enable Running the mlnx_tune utility
    --enable-opensm      Run opensm upon boot
    --without-mlx5-ipsec Disable IPsec support on ConnectX adapters

    --package-install-options
                         RPM install options to use when installing RPM packages (comma separated list)
    --pre-build-<package> <path to script>
                         Run given script before given package's build
    --post-build-<package> <path to script>
                         Run given script after given package's build
    --pre-install-<package> <path to script>
                         Run given script before given package's install
    --post-install-<package> <path to script>
                         Run given script after given package's install

Package selection:
    -c|--config <packages config_file>
                         Example of the config file can be found under docs (ofed.conf-example)
    --all                Install all available packages
    --bluefield          Install BlueField packages
    --hpc                Install minimum packages required for HPC
    --basic              Install minimum packages for basic functionality
    --dpdk               Install minimum packages required for DPDK
    --ovs-dpdk           Install DPDK and OVS packages
    --with-vma           Enable installing and configuring VMA package (to be used with any of the above installation options)
    --vma|--vma-vpi      Install minimum packages required by VMA to support VPI
    --vma-eth            Install minimum packages required by VMA to work over Ethernet
    --xlio     Install minimum packages required by XLIO
    --guest              Install minimum packages required by guest OS
    --hypervisor         Install minimum packages required by hypervisor OS
    --with-fabric-collector
                         Enable installing fabric-collector package
User-Space and libraries selection:
    --with-pyverbs       Build rdma-core package with pyverbs).
Extra package filtering:
    --kernel-only        Install kernel space packages only
    --user-space-only    Filter selected packages and install only User Space packages
    --without-<package>  Do not install package
    --with-<package>     Force installing package
    --with-memtrack      Build ofa_kernel RPM with memory tracking enabled for debugging
    --kernel-extra-args '<args>'
                         pass <args> to kernel configure script (single paraeter, space separated)

Miscellaneous:
    -h|--help            Display this help message and exit
    -p|--print-available Print available packages for current platform
                         And create corresponding ofed.conf file
    --conf-dir           Destination directory to save the configuration file
                         Default: /home/stack/MLNX_OFED_SRC-5.6-2.0.9.0
    --copy-ifnames-udev  Copy compatibility udev rules for interface names

Output control:
    -v|-vv|-vvv          Set verbosity level
    -q                   Set quiet - no messages will be printed

@mnasiadka
Copy link

python3-cython instead of python38-cython from PowerTools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment