From baedd2dccfdaaca52c1266e9c4b96de160d76ffe Mon Sep 17 00:00:00 2001 From: Mike Marciniszyn Date: Tue, 14 Jan 2014 10:05:02 -0500 Subject: [PATCH] truescale.cmds: fixes some issues with errors This fix checks for an Intel HCA and silences some other errors when attempting to read files that are not present. Signed-off-by: Mike Marciniszyn --- ofed_scripts/truescale.cmds | 53 ++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/ofed_scripts/truescale.cmds b/ofed_scripts/truescale.cmds index 42f5410..34a9550 100644 --- a/ofed_scripts/truescale.cmds +++ b/ofed_scripts/truescale.cmds @@ -469,44 +469,49 @@ clean_irq_affinity() } PATH=/sbin:/bin:/usr/sbin:/usr/bin:$PATH +has_qib=$(lspci -n 2>/dev/null | grep -i "1077\|1fc1") case "$1" in start) - has_qmh7342=$(grep QMH7342 ${qb}*/hca_type 2>/dev/null) - if [ "${has_qmh7342}" ]; then + if [ "${has_qib}" ]; then + has_qmh7342=$(grep QMH7342 ${qb}*/hca_type 2>/dev/null) + if [ "${has_qmh7342}" ]; then setup_qmh - else + else has_qme7342=$(grep QME7342 ${qb}*/hca_type 2>/dev/null) if [ "${has_qme7342}" ]; then setup_qme fi - fi - - umount /ipathfs >/dev/null 2>&1 - rm -rf /ipathfs - mkdir -p -m 755 /ipathfs 2>&1 - mount -t ipathfs none /ipathfs - - # make sure /dev/ipath files get created with correct permissions - typeset -i timeout=30 count=0 - while [ $((count++)) -lt $timeout ]; do - if [ -c /dev/ipath ]; then - chmod 666 /dev/ipath /dev/ipath[0-9]* >/dev/null 2>&1 - break fi - sleep 1 - done - if [ $count -ge $timeout ]; then - warn_and_log Failed to modify permissions on /dev/ipath\* files + + umount /ipathfs >/dev/null 2>&1 + rm -rf /ipathfs + mkdir -p -m 755 /ipathfs 2>&1 + mount -t ipathfs none /ipathfs + + # make sure /dev/ipath files get created with correct permissions + typeset -i timeout=30 count=0 + while [ $((count++)) -lt $timeout ]; do + if [ -c /dev/ipath ]; then + chmod 666 /dev/ipath /dev/ipath[0-9]* >/dev/null 2>&1 + break + fi + sleep 1 + done + if [ $count -ge $timeout ]; then + warn_and_log Failed to modify permissions on /dev/ipath\* files + fi + + set_irq_affinity fi - - set_irq_affinity ;; stop) - clean_irq_affinity - if [ -d /ipathfs ]; then + if [ "${has_qib}" ]; then + clean_irq_affinity + if [ -d /ipathfs ]; then umount /ipathfs rmdir /ipathfs + fi fi ;; esac -- 2.46.0