Search
j0ke.net Open Build Service
>
Projects
>
GFS
>
sysconfig
> sysconfig-hwup-fixup-hwdown-zfcp.210968.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File sysconfig-hwup-fixup-hwdown-zfcp.210968.patch of Package sysconfig (Revision 1)
Currently displaying revision
1
,
show latest
--- sysconfig-0.50.9/scripts/hardware/hwdown-zfcp.orig 2007-01-16 12:52:57.757361600 +0100 +++ sysconfig-0.50.9/scripts/hardware/hwdown-zfcp 2007-01-16 12:53:06.996105550 +0100 @@ -38,54 +38,32 @@ fi _zfcp_dir=${HWD_DEVICEPATH} # Find corresponding fcp wwpn:lun -scsi_id=${_zfcp_dir##*/} -saved_IFS="$IFS" -IFS=":" -set -- $scsi_id -scsi_host_num=$1 -scsi_target_num=$3 -scsi_lun_num=$4 -IFS="$saved_IFS" - -path=`echo $_zfcp_dir | sed "s@/host[0-9]\{1,\}/.*@@"` - -# Find the fcp port corresponding to the scsi target -for tmp_wwpn in ${path}/0x*; do - if [ -d $tmp_wwpn ]; then - read tmp_target_num < $tmp_wwpn/scsi_id - if (($tmp_target_num == $scsi_target_num)); then - wwpn=${tmp_wwpn##*/} - break; - fi - fi -done +if [ -d ${_zfcp_dir} ] ; then + read _zfcp_lun < ${_zfcp_dir}/fcp_lun +fi +path=${_zfcp_dir%%/host*} +_rport_dir=${_zfcp_dir%%/target*} +_rport_num=${_rport_dir##*/} +if [ -d ${_rport_dir}/fc_remote_ports:${_rport_num} ] ; then + read _zfcp_wwpn < ${_rport_dir}/fc_remote_ports:${_rport_num}/port_name +fi -if [ "$wwpn" ]; then +if [ "$_zfcp_wwpn" -a "$_zfcp_lun" ]; then # Find the fcp lun corresponding to the scsi lun - for tmp_lun in ${path}/$wwpn/0x*; do - if [ -d $tmp_lun ]; then - read tmp_lun_num < $tmp_lun/scsi_lun - if (($tmp_lun_num == $scsi_lun_num)); then - lun=${tmp_lun##*/} - break; - fi - fi - done - # Remove if found - if [ "$lun" ]; then - message "Removing fcp unit $wwpn:$lun" - echo "$lun" > ${path}/$wwpn/unit_remove + if [ -d "${path}/${_zfcp_wwpn}/${_zfcp_lun}" ] ; then + message "Removing fcp unit $_zfcp_wwpn:$_zfcp_lun" + echo $_zfcp_lun > ${path}/${_zfcp_wwpn}/unit_remove fi # Recheck if the port still has luns open num_luns=0 - for tmp_lun in ${path}/$wwpn/0x*; do + for tmp_lun in ${path}/${_zfcp_wwpn}/0x*; do if [ -d $tmp_lun ]; then num_luns=$(expr $num_luns + 1) fi done if (($num_luns == 0)); then # No, remove the fcp port - echo "$wwpn" > ${path}/port_remove + echo "$_zfcp_wwpn" > ${path}/port_remove message "Removing fcp port $wwpn" fi fi --- sysconfig-0.50.9/scripts/hardware/hwdown-scsi.orig 2007-01-16 12:54:05.619135346 +0100 +++ sysconfig-0.50.9/scripts/hardware/hwdown-scsi 2007-01-16 12:54:17.397533964 +0100 @@ -38,18 +38,23 @@ fi # Set sysfs paths _zfcp_dir=${HWD_DEVICEPATH} -# Delete all SCSI Ids -read _scsi_host_no < ${_zfcp_dir}/scsi_host_no - -num_ids=0 -for id in ${_zfcp_dir}/host$((_scsi_host_no))/*; do - if [ -d $id ]; then - echo "0" > ${id}/online - echo "1" > ${id}/delete - num_ids=$(expr $num_ids + 1) +# Remove all SCSI devices +for host_dir in ${_zfcp_dir}/host*; do + if [ -d $host_dir ] ; then + host_num=${host_dir##*/host} fi done +num_ids=0 +if [ "$host_num" ] ; then + for id in ${_zfcp_dir}/host${host_num}/rport-*/target${host_num}:*:*/${host_num}:*:*:* ; do + if [ -d $id ]; then + echo "1" > ${id}/delete + num_ids=$(expr $num_ids + 1) + fi + done +fi + # If no SCSI IDs has been found, no hotplug # events have been generated either. So we need # to deconfigure the adapter by hand.