From eca6613c433db39acbe669461acc59f1b58b054e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=E1=B4=8F=C9=B4=C9=A2=20Jie?= Date: Mon, 21 May 2018 15:44:04 +0800 Subject: [PATCH] Thinker xCAT/postscripts/cuda_power9_setup, (#5231) * Fix the 40-redhat.rules udev rule * Remake initrd image for diskfull compute node --- xCAT/postscripts/cuda_power9_setup | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/xCAT/postscripts/cuda_power9_setup b/xCAT/postscripts/cuda_power9_setup index d448fefe2..977cf1520 100755 --- a/xCAT/postscripts/cuda_power9_setup +++ b/xCAT/postscripts/cuda_power9_setup @@ -22,6 +22,15 @@ printf '[Service]\nRestart=always\n' > ${IMG_ROOTIMGDIR}/etc/systemd/system/nvid [ ! -z "${IMG_ROOTIMGDIR}" ] && CHROOTCMD="chroot ${IMG_ROOTIMGDIR}" $CHROOTCMD /bin/bash -c "systemctl enable nvidia-persistenced" -rm -f ${IMG_ROOTIMGDIR}/lib/udev/rules.d/40-redhat.rules +if [ -f ${IMG_ROOTIMGDIR}/lib/udev/rules.d/40-redhat.rules ] +then + sed -i /SUBSYSTEM==\"memory\"/d ${IMG_ROOTIMGDIR}/lib/udev/rules.d/40-redhat.rules +fi echo 'options nvidia NVreg_EnableStreamMemOPs=1 NVreg_RegistryDwords="PeerMappingOverride=1"' >${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf + +if [ -z "${IMG_ROOTIMGDIR}" ] +then + kernel_version="$(for d in $(ls /lib/modules | sort -V) ; do : ; done && echo $d)" + mkinitrd -v -f "/boot/initramfs-${kernel_version}.img" "${kernel_version}" +fi