- updated device_cio_free script (#533494)
This commit is contained in:
parent
2d050c5e5f
commit
970848073e
@ -22,10 +22,12 @@ BLACKLIST=/proc/cio_ignore
|
|||||||
VERBOSE=
|
VERBOSE=
|
||||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
||||||
ALL_DEVICES=
|
ALL_DEVICES=
|
||||||
|
WAITING_TIMEOUT=60 # maximum time to wait for all devices to appear
|
||||||
|
WAITING_TOTAL=0 # actual time spent waiting for devices
|
||||||
|
|
||||||
usage()
|
usage()
|
||||||
{
|
{
|
||||||
echo "$0 [-h|--help] [-V|--verbose]"
|
echo "Usage: $CMD [-h|--help] [-V|--verbose]"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,22 +55,24 @@ free_device()
|
|||||||
# wait until a device appears on the ccw bus
|
# wait until a device appears on the ccw bus
|
||||||
wait_on_device()
|
wait_on_device()
|
||||||
{
|
{
|
||||||
local DEVICE_CCW DEVICE_ONLINE DEV
|
local DEVICE_ONLINE DEV
|
||||||
|
|
||||||
[ -z "$1" ] && return
|
[ -z "$1" ] && return
|
||||||
|
|
||||||
DEV=$1
|
DEV=$1
|
||||||
DEVICE_CCW=/sys/bus/ccw/devices/$DEV
|
DEVICE_ONLINE=/sys/bus/ccw/devices/$DEV/online
|
||||||
DEVICE_ONLINE=$DEVICE_CCW/online
|
|
||||||
|
|
||||||
# [ -f $DEVICE_CCW ] || sleep 1
|
|
||||||
# [ -f $DEVICE_CCW ] || return
|
|
||||||
|
|
||||||
[ $VERBOSE ] && echo "Waiting on device $DEV"
|
[ $VERBOSE ] && echo "Waiting on device $DEV"
|
||||||
[ -f "$DEVICE_ONLINE" ] && return
|
[ -f "$DEVICE_ONLINE" ] && return
|
||||||
|
|
||||||
for t in 1 2 3 4 5
|
for t in 1 2 3 4 5
|
||||||
do
|
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
|
sleep $t
|
||||||
[ -f "$DEVICE_ONLINE" ] && return
|
[ -f "$DEVICE_ONLINE" ] && return
|
||||||
done
|
done
|
||||||
|
@ -8,7 +8,7 @@ Name: s390utils
|
|||||||
Summary: Utilities and daemons for IBM System/z
|
Summary: Utilities and daemons for IBM System/z
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
Version: 1.8.2
|
Version: 1.8.2
|
||||||
Release: 7%{?dist}
|
Release: 8%{?dist}
|
||||||
Epoch: 2
|
Epoch: 2
|
||||||
License: GPLv2 and GPLv2+ and CPL
|
License: GPLv2 and GPLv2+ and CPL
|
||||||
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
@ -826,6 +826,9 @@ User-space development files for the s390/s390x architecture.
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%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
|
* Fri Jan 8 2010 Dan Horák <dan[at]danny.cz> 2:1.8.2-7
|
||||||
- updated device_cio_free script (#533494)
|
- updated device_cio_free script (#533494)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user