From: Brian K. <br...@li...> - 2010-02-16 22:20:24
|
Running ls-vdev with disconnected adapters can result in errors getting printed. Fixup ls-vdev to bit bucket these errors. Signed-off-by: Brian King <br...@li...> --- scripts/ls-vdev | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -puN scripts/ls-vdev~powerpc_lsvdev_fixup scripts/ls-vdev --- powerpc-utils/scripts/ls-vdev~powerpc_lsvdev_fixup 2010-02-16 16:04:22.000000000 -0600 +++ powerpc-utils-bjking1/scripts/ls-vdev 2010-02-16 16:13:12.000000000 -0600 @@ -53,12 +53,12 @@ for dev in $($LS -d /proc/device-tree/vd slot=$(echo $dev | $SED -e "s/\/proc\/device-tree\/vdevice\/v-scsi@//") # there is only one host per device, assign it to the path's name - for host in $($LS -d /sys/devices/vio/$slot/host*) ; do + for host in $($LS -d /sys/devices/vio/$slot/host* 2> /dev/null) ; do parent=$(echo $host | $SED -e "s/.*\///") host=$($LS -d /sys/devices/vio/$slot/host*/) # loop through the targets for this host. - for t in $($LS -d $host/target*); do + for t in $($LS -d $host/target* 2> /dev/null); do target=$(echo $($LS -d $t/$($LS $t | $GREP -v uevent | $GREP -v power | $GREP -v subsystem))) if [[ ! -d $target/block ]]; then name=$(echo $($LS -d $target/block*) | $SED -e "s/.*://") _ |