|
|
a6b06b |
diff -Nur sg3_utils-1.37_old/scripts/rescan-scsi-bus.sh sg3_utils-1.37/scripts/rescan-scsi-bus.sh
|
|
|
a6b06b |
--- sg3_utils-1.37_old/scripts/rescan-scsi-bus.sh 2018-06-12 19:54:42.668354127 +0800
|
|
|
a6b06b |
+++ sg3_utils-1.37/scripts/rescan-scsi-bus.sh 2018-06-12 19:55:13.261890351 +0800
|
|
|
a6b06b |
@@ -273,9 +273,19 @@
|
|
|
a6b06b |
return 2
|
|
|
a6b06b |
fi
|
|
|
a6b06b |
TMPSTR=`echo "$SCSISTR" | grep 'Vendor:'`
|
|
|
a6b06b |
- if [ "$TMPSTR" != "$STR" ]; then
|
|
|
a6b06b |
- echo -e "\e[A\e[A\e[A\e[A${red}$SGDEV changed: ${bold}\nfrom:${SCSISTR#* } \nto: $STR ${norm} \n\n\n"
|
|
|
a6b06b |
- return 1
|
|
|
a6b06b |
+ if test $ignore_rev -eq 0 ; then
|
|
|
a6b06b |
+ if [ "$TMPSTR" != "$STR" ]; then
|
|
|
a6b06b |
+ echo -e "\e[A\e[A\e[A\e[A${red}$SGDEV changed: ${bold}\nfrom:${SCSISTR#* } \nto: $STR ${norm} \n\n\n"
|
|
|
a6b06b |
+ return 1
|
|
|
a6b06b |
+ fi
|
|
|
a6b06b |
+ else
|
|
|
a6b06b |
+ # Ignore disk revision change
|
|
|
a6b06b |
+ local old_str_no_rev=`echo "$TMPSTR" | sed -e 's/.\{4\}$//'`
|
|
|
a6b06b |
+ local new_str_no_rev=`echo "$STR" | sed -e 's/.\{4\}$//'`
|
|
|
a6b06b |
+ if [ "$old_str_no_rev" != "$new_str_no_rev" ]; then
|
|
|
a6b06b |
+ echo -e "\e[A\e[A\e[A\e[A${red}$SGDEV changed: ${bold}\nfrom:${SCSISTR#* } \nto: $STR ${norm} \n\n\n"
|
|
|
a6b06b |
+ return 1
|
|
|
a6b06b |
+ fi
|
|
|
a6b06b |
fi
|
|
|
a6b06b |
TMPSTR=`echo "$SCSISTR" | sed -n 's/.*Type: *\(.*\) *ANSI.*/\1/p'`
|
|
|
a6b06b |
NTMPSTR="$(sed -e 's/[[:space:]]*$//' -e 's/^[[:space:]]*//' <<<${TMPSTR})"
|
|
|
a6b06b |
@@ -965,6 +975,7 @@
|
|
|
a6b06b |
echo "--sparselun: Tell kernel to support sparse LUN numbering"
|
|
|
a6b06b |
echo "--update: same as -u"
|
|
|
a6b06b |
echo "--resize: same as -s"
|
|
|
a6b06b |
+ echo "--ignore-rev: Ignore the revision change"
|
|
|
a6b06b |
echo " Host numbers may thus be specified either directly on cmd line (deprecated) or"
|
|
|
a6b06b |
echo " or with the --hosts=LIST parameter (recommended)."
|
|
|
a6b06b |
echo "LIST: A[-B][,C[-D]]... is a comma separated list of single values and ranges"
|
|
|
a6b06b |
@@ -1016,6 +1027,7 @@
|
|
|
a6b06b |
existing_targets=1
|
|
|
a6b06b |
mp_enable=
|
|
|
a6b06b |
declare -i scan_flags=0
|
|
|
a6b06b |
+ignore_rev=0
|
|
|
a6b06b |
|
|
|
a6b06b |
# Scan options
|
|
|
a6b06b |
opt="$1"
|
|
|
a6b06b |
@@ -1056,6 +1068,7 @@
|
|
|
a6b06b |
-sparselun) scan_flags=$((scan_flags|0x40)) ;;
|
|
|
a6b06b |
-update) update=1;;
|
|
|
a6b06b |
-wide) opt_idsearch=`seq 0 15` ;;
|
|
|
a6b06b |
+ -ignore-rev) ignore_rev=1;;
|
|
|
a6b06b |
*) echo "Unknown option -$opt !" ;;
|
|
|
a6b06b |
esac
|
|
|
a6b06b |
shift
|