Whilst not a direct answer to your question, I have stopped using a postscript for this task and instead create a local repository containing the OFED rpms and just use the regular otherpkgs mechanism. This is largely because I run a mixed CX3/CX4/CX5/CX6 HBA environment and the CX3 cards require staying on the LTS OFED release but I want the newer OFED where possible. Managing that just got too messy with the script. Mellanox OFED being what it is, its obviously not that simple. See the following Mellanox links, though note I don't use their repo because they only build for OS pointrelease baseline kernels:
https://www.mellanox.com/support/mlnx-ofed-public-repository https://www.mellanox.com/related-docs/prod_software/Using_MLNX_OFED_Repository.pdf Local repo setup instructions from my notes: ===5.4-1.0.3.0=== ofedver="5.4-1.0.3.0" # NB CentOS specific but easy to adapt for other OSes - or just hard code pointreleasever="$( sed 's/CentOS Linux release \([78].[0-9][0-9]*\).*$/\1/' /etc/redhat-release )" ofed="MLNX_OFED_LINUX-${ofedver}-rhel${pointreleasever}-x86_64" wget "https://content.mellanox.com/ofed/MLNX_OFED-${ofedver}/${ofed}.tgz" tar xf ${ofed}.tgz # If adding kernel support is required: # As root on buildbox # - must have the desired kernel version installed # - the following yum install adds missing dependencies for me but omits several already installed in my images yum -y install libtool ${ofed}/mlnx_add_kernel_support.sh -m ${ofed} --make-tgz --kmp --yes -v mv "/tmp/${ofed}-ext.tgz" ./ # On a box with the repo filestore mounted mkdir -p "/mnt/repo/mellanox/mlnx_ofed/${ofedver}/$(uname -r)" tar -C "/mnt/repo/mellanox/mlnx_ofed/${ofedver}/$(uname -r)" --strip 1 -xf "${ofed}-ext.tgz" "${ofed}-ext/RPMS" # Shorter alternative if adding kernel support is not required (pointrelease baseline kernel only) wget 'https://content.mellanox.com/ofed/MLNX_OFED-${ofedver}/${ofed}.tgz' mkdir -p "/mnt/repo/mellanox/mlnx_ofed/${ofedver}/$(uname -r)" tar -C "/mnt/repo/mellanox/mlnx_ofed/${ofedver}/$(uname -r)" --strip 2 -xf "${ofed}.tgz" "./${ofed}/RPMS" === In our mixed CX3/CX4+ environment I need to combine this with a bit of yum & xcat trickery to get the correct LTS/non-LTS OFED version for the HBA and the build for the correct kernel. I have an rpm that causes two files to be created under /etc/yum/vars - 'mlnxofed' containing the OFED version number I want given what HBA is in the box and 'uname_r' being the output of `/usr/bin/rpm -q kernel --last | head -1 | sed 's/^kernel-\([^ ]*\).*$/\1/'`, both derived at rpm installation time (the latter might even work for genimage - I'm diskful so haven't checked). The '/mnt/repo/mellanox/mlnx_ofed' directory used above is presented under the configured otherpkgdir for the osimage and my otherpkgs.pkglist then includes: rescomp-combined/bmrc-mlnxofed-yum-vars #NEW_INSTALL_LIST# mlnx_ofed/$mlnxofed/$uname_r/RPMS/mlnx-ofed-all.noarch mlnx_ofed/$mlnxofed/$uname_r/RPMS/mlnx-fw-updater The '#NEW_INSTALL_LIST#' ensures the yum vars provided by bmrc-mlnxofed-yum-vars are present before the next two lines get interpreted by yum. I could't tell you if anything other than yum-based package management is happy to do variable substitution on the repo path, or how it would be configured if it did. A subsequent '#NEW_INSTALL_LIST#' might be advisable if you have other packages to install that depend on OFED being first installed. A bit of a pain to set up, but it means I don't have to do an OFED build on every node, I get to inspect and test the build before it gets rolled out, I get better control over which OFED I am installing and I can do a kernal-and-OFED upgrade with 'updatenode compute -S'. OS kernel updates are still a royal pain as new OFED repos need building and the bmrc-mlnxofed-yum-vars rpm updating first and if I need to do an OFED downgrade I need to do an explicit ofed_uninstall before the updatenode call - but less crazy than it was with the script. I need a new gpfs portability layer for a kernel update so its not a step taken lightly anyway. If your hardware is less diverse (or even just less ancient) you probably wouldn't need the fancy yum vars and could just hardcode the OFED and kernel versions in the included bit of otherpkgs.pkglist and update those values as necessary. For genimage, the rpm install isn't being run on the box the image will run on, so detecting the HBA at rpm install time is inappropriate anyway - as is installing the mlnx-fw-updater rpm, as that actually does the firmware update as part of the package install! Just don't forget the mlnx_add_kernel_support.sh step if you do kernel updates between point releases. There's something about that in the mlnxofed_ib_install script for diskful installs but I don't see it for diskless. Happy New Year, Jon -- Dr. Jonathan Diprose <j...@well.ox.ac.uk> Tel: 01865 287873 Research Computing Manager Henry Wellcome Building for Genomic Medicine Roosevelt Drive, Headington, Oxford OX3 7BN ________________________________________ From: Vinícius Ferrão via xCAT-user [xcat-user@lists.sourceforge.net] Sent: 04 January 2022 04:23 To: xCAT Users Mailing list Cc: Vinícius Ferrão Subject: [xcat-user] ib.rhels8.x86_64.pkglist Hello, I'm trying to use the OFED install script from xCAT but some template files seems to be missing, the first one is the one in the title: /opt/xcat/share/xcat/ib/netboot/rh/ib.rhels8.x86_64.pkglist Does anyone have a list of the packages required? EL8 and x86_64? Thanks all and happy new year. PS: Anything else that I should be aware with mlnxofed_ib_install script? _______________________________________________ xCAT-user mailing list xCAT-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xcat-user _______________________________________________ xCAT-user mailing list xCAT-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xcat-user