Hello community, here is the log from the commit of package sg3_utils checked in at Wed Jul 16 22:24:47 CEST 2008. -------- --- sg3_utils/sg3_utils.changes 2008-05-23 10:22:53.000000000 +0200 +++ sg3_utils/sg3_utils.changes 2008-07-16 09:56:05.464129000 +0200 @@ -1,0 +2,5 @@ +Wed Jul 16 09:55:33 CEST 2008 - hare@suse.de + +- Use correct length parameter for sg_inq (bnc#363438) + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sg3_utils.spec ++++++ --- /var/tmp/diff_new_pack.f23751/_old 2008-07-16 22:19:15.000000000 +0200 +++ /var/tmp/diff_new_pack.f23751/_new 2008-07-16 22:19:15.000000000 +0200 @@ -20,7 +20,7 @@ Obsoletes: scsi <= 1.7_2.38_1.25_0.19_1.02_0.93 AutoReqProv: on Version: 1.25 -Release: 9 +Release: 16 Summary: A collection of tools that send SCSI commands to devices Source: http://sg.torque.net/sg/p/sg3_utils-%{sgver}.tar.bz2 Source2: http://www.garloff.de/kurt/linux/rescan-scsi-bus.sh @@ -210,6 +210,8 @@ rm -rf $RPM_BUILD_DIR/sg3_utils-%{sgver} %changelog +* Wed Jul 16 2008 hare@suse.de +- Use correct length parameter for sg_inq (bnc#363438) * Fri May 23 2008 hare@suse.de - Use 'Provides' to clean update dependency * Fri May 09 2008 schwab@suse.de ++++++ rescan-scsi-bus.sh ++++++ --- sg3_utils/rescan-scsi-bus.sh 2008-04-24 15:03:42.000000000 +0200 +++ sg3_utils/rescan-scsi-bus.sh 2008-07-16 09:55:24.366318000 +0200 @@ -188,7 +188,7 @@ # echo -e "\e[A\e[A\e[A${yellow}Test existence of $SGDEV = $RC ${norm} \n\n\n" if test $RC = 1; then return $RC; fi # OK, device online, compare INQUIRY string - INQ=`sg_inq -36 /dev/$SGDEV` + INQ=`sg_inq $sg_len_arg /dev/$SGDEV` IVEND=`echo "$INQ" | grep 'Vendor identification:' | sed 's/^[^:]*: \(.*\)$/\1/'` IPROD=`echo "$INQ" | grep 'Product identification:' | sed 's/^[^:]*: \(.*\)$/\1/'` IPREV=`echo "$INQ" | grep 'Product revision level:' | sed 's/^[^:]*: \(.*\)$/\1/'` @@ -205,12 +205,12 @@ TMPSTR=`echo "$SCSISTR" | grep 'Vendor:'` if [ "$TMPSTR" != "$STR" ]; then echo -e "\e[A\e[A\e[A\e[A${red}$SGDEV changed: ${bold}\nfrom:${SCSISTR#* } \nto: $STR ${norm}\n\n\n" - return 1 + return 0 fi TMPSTR=`echo "$SCSISTR" | sed -n 's/.*Type: *\(.*\) *ANSI.*/\1/p'` if [ $TMPSTR != $TYPE ] ; then echo -e "\e[A\e[A\e[A\e[A${red}$SGDEV changed: ${bold}\nfrom:${TMPSTR} \nto: $TYPE ${norm}\n\n\n" - return 1 + return 0 fi return $RC } @@ -297,7 +297,8 @@ # Device exists: Test whether it's still online # (testonline returns 1 if it's gone or has changed) testonline - if test $? = 1 -o ! -z "$forceremove"; then + RC=$? + if test $RC = 1 -o ! -z "$forceremove"; then echo -en "\r\e[A\e[A\e[A${red}REM: " echo "$SCSISTR" | head -n1 echo -e "${norm}\e[B\e[B" @@ -311,6 +312,11 @@ echo "scsi add-single-device $devnr" > /proc/scsi/scsi fi fi + if test $RC = 0 ; then + if test -e /sys/class/scsi_device/${host}:${channel}:${id}:${lun}/device; then + echo 1 > /sys/class/scsi_device/${host}:${channel}:${id}:${lun}/device/rescan + fi + fi printf "\r\x1b[A\x1b[A\x1b[A${yellow}OLD: $norm" testexist if test -z "$SCSISTR"; then @@ -374,10 +380,7 @@ oldsearch="$lunsearch" for tmplun in $lunsearch; do if test $tmplun -eq $lun ; then - # Optimization: don't scan lun 0 again - if [ $lun -ne 0 ]; then - dolunscan - fi + dolunscan else newsearch="$newsearch $tmplun" fi @@ -471,11 +474,19 @@ # Make sure sg is there modprobe sg >/dev/null 2>&1 +sg_version=$(sg_inq -V 2>&1 | cut -d " " -f 3) +sg_version=${sg_version##0.} +if [ "$sg_version" -lt 70 ] ; then + sg_len_arg="-36" +else + sg_len_arg="--len=36" +fi + # defaults unsetcolor lunsearch="" idsearch=`seq 0 7` -channelsearch="0" +channelsearch="" remove= forceremove= optscan=1 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org