Wait for up to 30 seconds for the /dev/ipath* devices to appear
before attempting to change their permissions. This helps with
system which boot a bit slower on which the device permissions
could be left in the wrong state.
Signed-off-by: Mitko Haralanov <mitko@qlogic.com>
mount -t ipathfs none /ipathfs
# make sure /dev/ipath files get created with correct permissions
- if [ ! -c /dev/ipath ]; then sleep 2; fi
- if [ ! -c /dev/ipath ]; then sleep 3; fi
- chmod 666 /dev/ipath /dev/ipath[0-9]* >/dev/null 2>&1
+ 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
;;