summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2010-01-12 07:05:16 -1000
committerDavid Cantrell <dcantrell@redhat.com>2010-01-13 09:33:07 -1000
commit6fd1cc12f95eaba13896a37eb48279a21b4e41cd (patch)
treeec08055278c5e995c8f42f0925e9d2d7712918c2
parent829bd5980b4c386de48b1a8274b499fe97c1b7dc (diff)
downloadanaconda-6fd1cc12f95eaba13896a37eb48279a21b4e41cd.tar.gz
anaconda-6fd1cc12f95eaba13896a37eb48279a21b4e41cd.tar.xz
anaconda-6fd1cc12f95eaba13896a37eb48279a21b4e41cd.zip
Poll DASD status for 'online' or 'unformatted' (#536803)
Give DASD devices some time to enter the online or unformatted state before calling udevadm settle. Max duration of loop is suggestion from IBM.
-rw-r--r--loader/linuxrc.s39024
1 files changed, 24 insertions, 0 deletions
diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390
index a3ee66564..7fd3f4fa2 100644
--- a/loader/linuxrc.s390
+++ b/loader/linuxrc.s390
@@ -129,6 +129,25 @@ function sysecho () {
[ -f "$file" ] && echo $* > $file
}
+function dasd_settle() {
+ local dasd=/sys/bus/ccw/devices/$1
+ if [ ! -d "$dasd" ]; then
+ return 1
+ fi
+ local i=1
+ while [ $i -le 30 ] ; do
+ status="$(< /sys/bus/ccw/devices/$dasd/status 2>/dev/null)"
+ case $status in
+ online|unformatted)
+ return 0 ;;
+ *)
+ sleep 0.1
+ i=$((i+1)) ;;
+ esac
+ done
+ return 1
+}
+
function startinetd()
{
echo
@@ -190,6 +209,11 @@ function readcmsfile() # $1=dasdport $2=filename
return 1
fi
udevadm settle
+ if ! dasd_settle $dev ; then
+ echo $"Could not access DASD $dev in time"
+ return 1
+ fi
+ udevadm settle
if ! cmsfscat -d /dev/dasda -a $2 > /tmp/$2; then
echo $"Could not read conf file $2 on CMS DASD $1."
fi