From 8285f2a3de08053c61f8b434fed4ef1aa85737fc Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 7 Oct 2020 15:27:06 -0400 Subject: [PATCH] Incorporate convenience for Mellanox OFED install --- .../el8/profiles/default/kickstart | 3 +++ .../default/scripts/infiniband/mofed.post | 20 +++++++++++++++++++ .../default/scripts/infiniband/mofed.pre | 10 ++++++++++ .../el8/profiles/default/scripts/post.custom | 3 +++ .../el8/profiles/default/scripts/pre.custom | 4 ++++ .../el8/profiles/default/scripts/pre.sh | 1 + misc/mofed/install_mofed | 19 +++++++++++------- 7 files changed, 53 insertions(+), 7 deletions(-) create mode 100644 confluent_osdeploy/el8/profiles/default/scripts/infiniband/mofed.post create mode 100644 confluent_osdeploy/el8/profiles/default/scripts/infiniband/mofed.pre diff --git a/confluent_osdeploy/el8/profiles/default/kickstart b/confluent_osdeploy/el8/profiles/default/kickstart index f0b65579..ba0a8104 100644 --- a/confluent_osdeploy/el8/profiles/default/kickstart +++ b/confluent_osdeploy/el8/profiles/default/kickstart @@ -37,6 +37,9 @@ reboot chrony rsync python3 +tar +pciutils +%include /tmp/addonpackages %include /tmp/cryptpkglist %end diff --git a/confluent_osdeploy/el8/profiles/default/scripts/infiniband/mofed.post b/confluent_osdeploy/el8/profiles/default/scripts/infiniband/mofed.post new file mode 100644 index 00000000..a777ea5c --- /dev/null +++ b/confluent_osdeploy/el8/profiles/default/scripts/infiniband/mofed.post @@ -0,0 +1,20 @@ +# To use this script, rename or copy the mofed image to either ofed.tgz or ofed.iso +# and modify the script below if wanting to use the iso instead of tgz + +# It checks for mellanox devices and opts not to install, so this script could be added +# to a general profile without causing mofed to install on non-mellanox systems +. /etc/confluent/functions +if lspci -d 15b3:: -n |grep 15b3 > /dev/null; then + # Uncomment the following three lines and comment out the next + # two lines to use the .iso instead of the tgz packaging + #fetch_remote infiniband/mofed.iso + #mkdir MLNX_OFED + #mount -o loop ofed.iso MLNX_OFED + fetch_remote infiniband/mofed.tgz + tar xf mofed.tgz + # The rest is common between tar and iso + cd MLNX_OFED* + mount -o loop ofed + ./mlnxofedinstall --force +fi + diff --git a/confluent_osdeploy/el8/profiles/default/scripts/infiniband/mofed.pre b/confluent_osdeploy/el8/profiles/default/scripts/infiniband/mofed.pre new file mode 100644 index 00000000..d7f38645 --- /dev/null +++ b/confluent_osdeploy/el8/profiles/default/scripts/infiniband/mofed.pre @@ -0,0 +1,10 @@ +# Add needed base packages to the install +cat << EOF >> /tmp/addonpackages +perl +pkgconf-pkg-config +tcsh +lsof +tk +gcc-gfortran +tcl +EOF diff --git a/confluent_osdeploy/el8/profiles/default/scripts/post.custom b/confluent_osdeploy/el8/profiles/default/scripts/post.custom index eea34051..4530569e 100644 --- a/confluent_osdeploy/el8/profiles/default/scripts/post.custom +++ b/confluent_osdeploy/el8/profiles/default/scripts/post.custom @@ -2,3 +2,6 @@ # This is a convenient place to keep customizations separate from modifying the stock scripts # While modification of the stock scripts is fine, it may be easier to rebase to a newer # stock profile if the '.custom' files are used. + +# An example for installing OFED for infiniband follows (see the file for more detail): +#run_remote infiniband/mofed.post diff --git a/confluent_osdeploy/el8/profiles/default/scripts/pre.custom b/confluent_osdeploy/el8/profiles/default/scripts/pre.custom index abecf04c..adb3866c 100644 --- a/confluent_osdeploy/el8/profiles/default/scripts/pre.custom +++ b/confluent_osdeploy/el8/profiles/default/scripts/pre.custom @@ -7,3 +7,7 @@ #to confluent configuration so that the BMC would be on the correct #network: #run_remote_python configbmc -c + +#Some addons improve efficiency by adding dependencies during install +#here is an example for adding OFED install prereqs to the install +#run_remote infiniband/mofed.pre diff --git a/confluent_osdeploy/el8/profiles/default/scripts/pre.sh b/confluent_osdeploy/el8/profiles/default/scripts/pre.sh index fa1d0880..28413741 100644 --- a/confluent_osdeploy/el8/profiles/default/scripts/pre.sh +++ b/confluent_osdeploy/el8/profiles/default/scripts/pre.sh @@ -53,6 +53,7 @@ fi cryptboot=$(grep ^encryptboot: /etc/confluent/confluent.deploycfg | awk '{print $2}') LUKSPARTY='' touch /tmp/cryptpkglist +touch /tmp/addonpackages if [ "$cryptboot" == "tpm2" ]; then LUKSPARTY="--encrypted --passphrase=$(cat /etc/confluent/confluent.apikey)" echo $cryptboot >> /tmp/cryptboot diff --git a/misc/mofed/install_mofed b/misc/mofed/install_mofed index 079205e7..9a4874b2 100644 --- a/misc/mofed/install_mofed +++ b/misc/mofed/install_mofed @@ -1,12 +1,17 @@ +# To use this script, rename or copy the mofed image to either ofed.tgz or ofed.iso +# and modify the script below if wanting to use the iso instead of tgz + +# It checks for mellanox devices and opts not to install, so this script could be added +# to a general profile without causing mofed to install on non-mellanox systems . /etc/confluent/functions if lspci -d 15b3:: -n |grep 15b3 > /dev/null; then - # Uncomment the following two lines and comment out the following - # three lines to use the .iso instead - #fetch_remote ofed/ofed.tgz - #tar xf ofed.tgz - fetch_remote ofed/ofed.iso - mkdir MLNX_OFED - mount -o loop ofed.iso MLNX_OFED + # Uncomment the following three lines and comment out the next + # two lines to use the .iso instead of the tgz packaging + #fetch_remote ofed/ofed.iso + #mkdir MLNX_OFED + #mount -o loop ofed.iso MLNX_OFED + fetch_remote mofed/mofed.tgz + tar xf mofed.tgz # The rest is common between tar and iso cd MLNX_OFED* mount -o loop ofed