- add support for auto LUN scan to zfcpconf.sh (#1552697)
This commit is contained in:
parent
a9bf2dafeb
commit
a895d0c8be
@ -6,7 +6,7 @@
|
|||||||
Name: s390utils
|
Name: s390utils
|
||||||
Summary: Utilities and daemons for IBM z Systems
|
Summary: Utilities and daemons for IBM z Systems
|
||||||
Version: 2.14.0
|
Version: 2.14.0
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
Epoch: 2
|
Epoch: 2
|
||||||
License: MIT
|
License: MIT
|
||||||
ExclusiveArch: s390 s390x
|
ExclusiveArch: s390 s390x
|
||||||
@ -792,6 +792,9 @@ User-space development files for the s390/s390x architecture.
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Aug 25 2020 Dan Horák <dan[at]danny.cz> - 2:2.14.0-2
|
||||||
|
- add support for auto LUN scan to zfcpconf.sh (#1552697)
|
||||||
|
|
||||||
* Tue Aug 25 2020 Dan Horák <dan[at]danny.cz> - 2:2.14.0-1
|
* Tue Aug 25 2020 Dan Horák <dan[at]danny.cz> - 2:2.14.0-1
|
||||||
- rebased to 2.14.0
|
- rebased to 2.14.0
|
||||||
|
|
||||||
|
24
zfcpconf.sh
24
zfcpconf.sh
@ -2,10 +2,12 @@
|
|||||||
|
|
||||||
# config file syntax:
|
# config file syntax:
|
||||||
# deviceno WWPN FCPLUN
|
# deviceno WWPN FCPLUN
|
||||||
|
# deviceno # allowed when auto LUN scan is enabled and port is in NPIV mode
|
||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
# 0.0.4000 0x5005076300C213e9 0x5022000000000000
|
# 0.0.4000 0x5005076300C213e9 0x5022000000000000
|
||||||
# 0.0.4001 0x5005076300c213e9 0x5023000000000000
|
# 0.0.4001 0x5005076300c213e9 0x5023000000000000
|
||||||
|
# 0.0.5000
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# manual setup:
|
# manual setup:
|
||||||
@ -21,6 +23,14 @@
|
|||||||
CONFIG=/etc/zfcp.conf
|
CONFIG=/etc/zfcp.conf
|
||||||
PATH=/bin:/sbin
|
PATH=/bin:/sbin
|
||||||
|
|
||||||
|
set_online()
|
||||||
|
{
|
||||||
|
DEVICE=$1
|
||||||
|
|
||||||
|
[ `cat /sys/bus/ccw/drivers/zfcp/${DEVICE}/online` = "0" ] \
|
||||||
|
&& echo 1 > /sys/bus/ccw/drivers/zfcp/${DEVICE}/online
|
||||||
|
}
|
||||||
|
|
||||||
if [ -f "$CONFIG" ]; then
|
if [ -f "$CONFIG" ]; then
|
||||||
if [ ! -d /sys/bus/ccw/drivers/zfcp ]; then
|
if [ ! -d /sys/bus/ccw/drivers/zfcp ]; then
|
||||||
modprobe zfcp
|
modprobe zfcp
|
||||||
@ -34,6 +44,17 @@ if [ -f "$CONFIG" ]; then
|
|||||||
*)
|
*)
|
||||||
[ -z "$line" ] && continue
|
[ -z "$line" ] && continue
|
||||||
set $line
|
set $line
|
||||||
|
if [ $# -eq 1 ]; then
|
||||||
|
DEVICE=${1##*0x}
|
||||||
|
if [ `cat /sys/module/zfcp/parameters/allow_lun_scan` = "Y" ]; then
|
||||||
|
set_online ${DEVICE}
|
||||||
|
grep -q NPIV /sys/bus/ccw/devices/${DEVICE}/host*/fc_host/host*/port_type || \
|
||||||
|
echo "Error: Only device ID (${DEVICE}) given, but port not in NPIV mode"
|
||||||
|
else
|
||||||
|
echo "Error: Only device ID (${DEVICE}) given, but LUN scan is disabled for the zfcp module"
|
||||||
|
fi
|
||||||
|
continue
|
||||||
|
fi
|
||||||
if [ $# -eq 5 ]; then
|
if [ $# -eq 5 ]; then
|
||||||
DEVICE=$1
|
DEVICE=$1
|
||||||
SCSIID=$2
|
SCSIID=$2
|
||||||
@ -46,8 +67,7 @@ if [ -f "$CONFIG" ]; then
|
|||||||
WWPN=$2
|
WWPN=$2
|
||||||
FCPLUN=$3
|
FCPLUN=$3
|
||||||
fi
|
fi
|
||||||
[ `cat /sys/bus/ccw/drivers/zfcp/${DEVICE}/online` = "0" ] \
|
set_online ${DEVICE}
|
||||||
&& echo 1 > /sys/bus/ccw/drivers/zfcp/${DEVICE}/online
|
|
||||||
[ ! -d /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/${FCPLUN} ] \
|
[ ! -d /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/${FCPLUN} ] \
|
||||||
&& echo $FCPLUN > /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/unit_add
|
&& echo $FCPLUN > /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/unit_add
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user