rpms/s390utils/F-12 device_cio_free,1.2,1.3 s390utils.spec,1.18,1.19

Dan Horák sharkcz at fedoraproject.org
Fri Jan 8 11:14:15 UTC 2010


Author: sharkcz

Update of /cvs/pkgs/rpms/s390utils/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv8913

Modified Files:
	device_cio_free s390utils.spec 
Log Message:
* Fri Jan  8 2010 Dan Horák <dan[at]danny.cz> 2:1.8.2-8
- updated device_cio_free script (#533494)



Index: device_cio_free
===================================================================
RCS file: /cvs/pkgs/rpms/s390utils/F-12/device_cio_free,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- device_cio_free	8 Jan 2010 07:43:49 -0000	1.2
+++ device_cio_free	8 Jan 2010 11:14:15 -0000	1.3
@@ -22,10 +22,12 @@ BLACKLIST=/proc/cio_ignore
 VERBOSE=
 PATH=/bin:/usr/bin:/sbin:/usr/sbin
 ALL_DEVICES=
+WAITING_TIMEOUT=60	# maximum time to wait for all devices to appear
+WAITING_TOTAL=0		# actual time spent waiting for devices
 
 usage()
 {
-    echo "$0 [-h|--help] [-V|--verbose]"
+    echo "Usage: $CMD [-h|--help] [-V|--verbose]"
     exit 1
 }
 
@@ -53,22 +55,24 @@ free_device()
 # wait until a device appears on the ccw bus
 wait_on_device()
 {
-    local DEVICE_CCW DEVICE_ONLINE DEV
+    local DEVICE_ONLINE DEV
     
     [ -z "$1" ] && return
     
     DEV=$1
-    DEVICE_CCW=/sys/bus/ccw/devices/$DEV
-    DEVICE_ONLINE=$DEVICE_CCW/online
-
-#    [ -f $DEVICE_CCW ] || sleep 1
-#    [ -f $DEVICE_CCW ] || return
+    DEVICE_ONLINE=/sys/bus/ccw/devices/$DEV/online
 
     [ $VERBOSE ] && echo "Waiting on device $DEV"
     [ -f "$DEVICE_ONLINE" ] && return
 
     for t in 1 2 3 4 5
     do
+	if [ $WAITING_TOTAL -ge $WAITING_TIMEOUT ]; then
+	    [ $VERBOSE ] && echo "Waiting timeout of $WAITING_TIMEOUT seconds reached"
+	    break
+	fi
+	WAITING_TOTAL=$(($WAITING_TOTAL + $t))
+        [ $VERBOSE ] && echo "Waiting additional $t second(s) and $WAITING_TOTAL second(s) in total"
 	sleep $t
 	[ -f "$DEVICE_ONLINE" ] && return
     done


Index: s390utils.spec
===================================================================
RCS file: /cvs/pkgs/rpms/s390utils/F-12/s390utils.spec,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -p -r1.18 -r1.19
--- s390utils.spec	8 Jan 2010 07:43:49 -0000	1.18
+++ s390utils.spec	8 Jan 2010 11:14:15 -0000	1.19
@@ -8,7 +8,7 @@ Name:           s390utils
 Summary:        Utilities and daemons for IBM System/z
 Group:          System Environment/Base
 Version:        1.8.2
-Release:        7%{?dist}
+Release:        8%{?dist}
 Epoch:          2
 License:        GPLv2 and GPLv2+ and CPL
 Buildroot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -826,6 +826,9 @@ User-space development files for the s39
 
 
 %changelog
+* Fri Jan  8 2010 Dan Horák <dan[at]danny.cz> 2:1.8.2-8
+- updated device_cio_free script (#533494)
+
 * Fri Jan  8 2010 Dan Horák <dan[at]danny.cz> 2:1.8.2-7
 - updated device_cio_free script (#533494)
 




More information about the fedora-extras-commits mailing list