FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Kubuntu Development

 
 
LinkBack Thread Tools
 
Old 01-12-2010, 04:23 PM
David Cantrell
 
Default 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.
---
loader/linuxrc.s390 | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390
index a3ee665..7b09ea4 100644
--- a/loader/linuxrc.s390
+++ b/loader/linuxrc.s390
@@ -129,6 +129,25 @@ function sysecho () {
[ -f "$file" ] && echo $* > $file
}

+function dasd_settle() {
+ dasd=/sys/bus/ccw/devices/$1
+ if [ ! -d "$dasd" ]; then
+ return 0
+ 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 1 ;;
+ *)
+ sleep 0.1
+ i=$((i+1)) ;;
+ esac
+ done
+ return 0
+}
+
function startinetd()
{
echo
@@ -189,6 +208,10 @@ function readcmsfile() # $1=dasdport $2=filename
echo $"DASD $dev could not be set online"
return 1
fi
+ 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."
@@ -197,6 +220,10 @@ function readcmsfile() # $1=dasdport $2=filename
echo $"DASD $dev could not be set offline again"
return 1
fi
+ if ! dasd_settle $dev ; then
+ echo $"Could not access DASD $dev in time"
+ return 1
+ fi
udevadm settle
# consequences of no more module unload: loader can no longer
# use DASD module option to online DASDs and set other DASD parameters!
--
1.6.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 08:20 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org