- updated device_cio_free script (#533494)

This commit is contained in:
Dan Horák 2010-01-08 11:15:27 +00:00
parent 2d050c5e5f
commit 970848073e
2 changed files with 15 additions and 8 deletions

View File

@ -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

View File

@ -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 s390/s390x architecture.
%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)