public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/sg3_utils] f43: * Mon Feb 09 2026 Paul Evans <pevans@redhat.com> - 1.48-8
@ 2026-06-25 12:56 Paul Evans
  0 siblings, 0 replies; only message in thread
From: Paul Evans @ 2026-06-25 12:56 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/sg3_utils
            Branch : f43
            Commit : d239af9c16ba757c74d16612786c15e0746d69b4
            Author : Paul Evans <pevans@redhat.com>
            Date   : 2026-02-09T18:09:56+00:00
            Stats  : +343/-1 in 7 file(s)
            URL    : https://src.fedoraproject.org/rpms/sg3_utils/c/d239af9c16ba757c74d16612786c15e0746d69b4?branch=f43

            Log:
            * Mon Feb 09 2026 Paul Evans <pevans@redhat.com> - 1.48-8

* Mon Feb 09 2026 Paul Evans <pevans@redhat.com> - 1.48-8
- rescan-scsi-bus.sh: Correctly read RMB bit on enquiry (RHEL-122982)
- rescan-scsi-bus.sh: Replace 'which' with built in 'command -v' (RHEL-70693)
- sg_safte: update short option of version (RHEL-125869)
- sg_rdac: accept --help or -h without error (RHEL-69439)
- sg_inq: fix missing output fields in --export format (RHEL-119246)
- sg_inq: re-add Unit serial number field (RHEL-119246)

---
diff --git a/0004-rescan-scsi-bus.sh-Correctly-read-RMB-bit-on-enquiry.patch b/0004-rescan-scsi-bus.sh-Correctly-read-RMB-bit-on-enquiry.patch
new file mode 100644
index 0000000..e83c799
--- /dev/null
+++ b/0004-rescan-scsi-bus.sh-Correctly-read-RMB-bit-on-enquiry.patch
@@ -0,0 +1,46 @@
+From fe9739425a5ef5220bd5efa3a45b531d3e9ee29c Mon Sep 17 00:00:00 2001
+From: Paul Evans <pevans@redhat.com>
+Date: Wed, 28 Jan 2026 14:42:02 +0000
+Subject: [PATCH] rescan-scsi-bus.sh Correctly read RMB bit on enquiry
+
+Make changes to is_removable() in rescan-scsi-bus.sh to correctly
+read the RMB byte on its hexedit enquiry response.
+
+As things stand the script incorrectly reads the first byte of the
+repsonse the "Peripheral Qualifier" and will always return a device
+as non-removable.
+
+Signed-off-by: Paul Evans <pevans@redhat.com>
+---
+ scripts/rescan-scsi-bus.sh | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
+index 52991e1e..23a90bb4 100755
+--- a/scripts/rescan-scsi-bus.sh
++++ b/scripts/rescan-scsi-bus.sh
+@@ -4,7 +4,7 @@
+ # (c) 2006--2022 Hannes Reinecke, GNU GPL v2 or later
+ # $Id: rescan-scsi-bus.sh,v 1.57 2012/03/31 14:08:48 garloff Exp $
+ 
+-VERSION="20230413"
++VERSION="20260126"
+ SCAN_WILD_CARD=4294967295
+ 
+ CLEANUP=:
+@@ -256,9 +256,10 @@ is_removable ()
+ 
+   p=/sys/class/scsi_device/${host}:${channel}:${id}:${lun}/device/inquiry
+   # Extract the second byte of the INQUIRY response and check bit 7 (mask 0x80).
+-  b=$(hexdump -n1 -e '/1 "%02X"' "$p" 2>/dev/null)
++  b=$(od -j1 -N1 -An -t x1 "$p" 2>/dev/null)
+   if [ -n "$b" ]; then
+-    echo $(((0x$b & 0x80) != 0))
++    # Handle od leading space with parameter substitution.
++    echo $(((0x${b// /} & 0x80) != 0))
+   else
+     sg_inq "$sg_len_arg" /dev/$SGDEV 2>/dev/null | sed -n 's/^.*RMB=\([0-9]*\).*$/\1/p'
+   fi
+-- 
+2.53.0
+

diff --git a/0005-rescan-scsi-bus.sh-Replace-which-with-build-in-comma.patch b/0005-rescan-scsi-bus.sh-Replace-which-with-build-in-comma.patch
new file mode 100644
index 0000000..119e0cd
--- /dev/null
+++ b/0005-rescan-scsi-bus.sh-Replace-which-with-build-in-comma.patch
@@ -0,0 +1,34 @@
+From 236875888f1c427fcc890842a9df0de8b768951d Mon Sep 17 00:00:00 2001
+From: Paul Evans <pevans@redhat.com>
+Date: Mon, 9 Feb 2026 15:21:53 +0000
+Subject: [PATCH] rescan-scsi-bus.sh Replace 'which' with build in 'command -v'
+
+Replace use of 'which' command to determine the existence of an
+executable and replace with the built in 'command -v' to achieve
+the same result. And to also remove the package dependency for
+minimal environments where 'which' might not be available.
+
+Signed-off-by: Paul Evans <pevans@redhat.com>
+---
+ scripts/rescan-scsi-bus.sh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
+index 52991e1e..2c8560ad 100755
+--- a/scripts/rescan-scsi-bus.sh
++++ b/scripts/rescan-scsi-bus.sh
+@@ -1350,9 +1350,9 @@ if [ -w /sys/module/scsi_mod/parameters/default_dev_flags ] && [ $scan_flags !=
+     unset OLD_SCANFLAGS
+   fi
+ fi
+-DMSETUP=$(which dmsetup)
++DMSETUP=$(version -s dmsetup)
+ [ -z "$DMSETUP" ] && flush= && mp_enable=
+-MULTIPATH=$(which multipath)
++MULTIPATH=$(version -s multipath)
+ [ -z "$MULTIPATH" ] && flush= && mp_enable=
+ 
+ echo -n "Scanning SCSI subsystem for new devices"
+-- 
+2.53.0
+

diff --git a/0006-Update-sg_safte.c-to-update-short-option-of-version.patch b/0006-Update-sg_safte.c-to-update-short-option-of-version.patch
new file mode 100644
index 0000000..0724515
--- /dev/null
+++ b/0006-Update-sg_safte.c-to-update-short-option-of-version.patch
@@ -0,0 +1,25 @@
+From da138e7b28a7c5e8ea2bb1ae099245d65e23ec5e Mon Sep 17 00:00:00 2001
+From: Fan <ffan@redhat.com>
+Date: Mon, 3 Nov 2025 19:54:03 +0800
+Subject: [PATCH] Update sg_safte.c  to update short option of version
+
+Update sg_safte.c to update short oprtion of version from -v to -V.
+
+Signed-off-by: Fan Fan <ffan@redhat.com>
+---
+ src/sg_safte.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/sg_safte.c b/src/sg_safte.c
+index 26d34169..2319ee83 100644
+--- a/src/sg_safte.c
++++ b/src/sg_safte.c
+@@ -492,7 +492,7 @@ usage()
+             "to stdout\n"
+             "    --usage|-u          output usage statistics\n"
+             "    --verbose|-v        increase verbosity\n"
+-            "    --version|-v        output version then exit\n\n"
++            "    --version|-V        output version then exit\n\n"
+             "Queries a SAF-TE processor device\n");
+ }
+ 

diff --git a/0007-Update-sg_rdac.c-to-accept--help-or--h-without-erro.patch b/0007-Update-sg_rdac.c-to-accept--help-or--h-without-erro.patch
new file mode 100644
index 0000000..272e78e
--- /dev/null
+++ b/0007-Update-sg_rdac.c-to-accept--help-or--h-without-erro.patch
@@ -0,0 +1,38 @@
+From 6450fb311edc28df015c977197bea5da7702ab80 Mon Sep 17 00:00:00 2001
+From: Fan Fan <ffan@redhat.com>
+Date: Thu, 28 Nov 2024 21:35:14 +0800
+Subject: [PATCH] Update sg_rdac.c to accept --help or -h without error ,
+ update the version number.
+
+---
+ src/sg_rdac.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/sg_rdac.c b/src/sg_rdac.c
+index a5476daa..50b4207c 100644
+--- a/src/sg_rdac.c
++++ b/src/sg_rdac.c
+@@ -32,7 +32,7 @@
+ #include "sg_pr2serr.h"
+ 
+ 
+-static const char * version_str = "1.18 20230622";
++static const char * version_str = "1.19 20241128";
+ 
+ static const uint8_t mode6_hdr[] = {
+     0x75, /* Length */
+@@ -405,8 +405,13 @@ int main(int argc, char * argv[])
+ 
+         for (k = 1; k < argc; ++k) {
+                 argptr = argv + k;
+-                if (!strcmp (*argptr, "-v"))
++                if (strcmp(argv[k], "--help") == 0 || strcmp(argv[k], "-h") == 0) {
++                        usage ();
++                        return 0;
++                }
++                else if (!strcmp (*argptr, "-v")) {
+                         ++do_verbose;
++                }
+                 else if (!strncmp(*argptr, "-f=",3)) {
+                         fail_path = true;
+                         lun = strtoul(*argptr + 3, NULL, 0);

diff --git a/0008-sg_inq-fix-missing-output-fields-in--export-format.patch b/0008-sg_inq-fix-missing-output-fields-in--export-format.patch
new file mode 100644
index 0000000..fa23391
--- /dev/null
+++ b/0008-sg_inq-fix-missing-output-fields-in--export-format.patch
@@ -0,0 +1,121 @@
+From 16c97d4df31a5dee7197e09b89c80d5b978a53bd Mon Sep 17 00:00:00 2001
+From: Martin Wilck <mwilck@suse.com>
+Date: Tue, 13 Feb 2024 18:09:34 +0100
+Subject: [PATCH 1/2] sg_inq: fix missing output fields in --export format
+
+The SCSI_MODEL, SCSI_MODEL_ENC, SCSI_REVISION, and other fields are
+missing in the output of sg_inq with --export:
+
+$ sg_inq /dev/sda
+standard INQUIRY:
+  PQual=0  PDT=0  RMB=0  LU_CONG=0  hot_pluggable=0  version=0x05  [SPC-3]
+  [AERC=0]  [TrmTsk=0]  NormACA=0  HiSUP=0  Resp_data_format=2
+  SCCS=0  ACC=0  TPGS=0  3PC=0  Protect=0  [BQue=0]
+  EncServ=0  MultiP=0  [MChngr=0]  [ACKREQQ=0]  Addr16=0
+  [RelAdr=0]  WBus16=0  Sync=0  [Linked=0]  [TranDis=0]  CmdQue=1
+  [SPI: Clocking=0x0  QAS=0  IUS=0]
+    length=96 (0x60)   Peripheral device type: disk
+ Vendor identification: ATA
+ Product identification: SK hynix SC300 M
+ Product revision level: 0P00
+
+$ sg_inq --export /dev/sda
+SCSI_TPGS=0
+SCSI_TYPE=disk
+SCSI_VENDOR=ATA
+SCSI_VENDOR_ENC=ATA\x20\x20\x20\x20\x20
+
+The reason is that the parameter "len" is overwritten in std_inq_decode().
+Fix it by using block-local variables for calculating field lengths.
+
+Output after applying this patch:
+
+$ sg_inq --export /dev/sda
+SCSI_TPGS=0
+SCSI_TYPE=disk
+SCSI_VENDOR=ATA
+SCSI_VENDOR_ENC=ATA\x20\x20\x20\x20\x20
+SCSI_MODEL=SK_hynix_SC300_M
+SCSI_MODEL_ENC=SK\x20hynix\x20SC300\x20M
+SCSI_REVISION=0P00
+
+Fixes: 0f1230a ("sg_readcap+sg_luns: add --inhex= and json")
+Signed-off-by: Martin Wilck <mwilck@suse.com>
+---
+ src/sg_inq.c | 24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/src/sg_inq.c b/src/sg_inq.c
+index b3b8127f..8e6b269d 100644
+--- a/src/sg_inq.c
++++ b/src/sg_inq.c
+@@ -2349,8 +2349,8 @@ std_inq_decode(const uint8_t * rp, int len, struct opts_t * op,
+             if (xtra_buff[i] == 0x09)
+                 xtra_buff[i] = ' ';
+         if (op->do_export) {
+-            len = encode_whitespaces((uint8_t *)xtra_buff, 8);
+-            if (len > 0) {
++            int vlen = encode_whitespaces((uint8_t *)xtra_buff, 8);
++            if (vlen > 0) {
+                 printf("SCSI_VENDOR=%s\n", xtra_buff);
+                 encode_string(xtra_buff, &rp[8], 8);
+                 printf("SCSI_VENDOR_ENC=%s\n", xtra_buff);
+@@ -2364,8 +2364,8 @@ std_inq_decode(const uint8_t * rp, int len, struct opts_t * op,
+             memcpy(xtra_buff, &rp[16], 16);
+             xtra_buff[16] = '\0';
+             if (op->do_export) {
+-                len = encode_whitespaces((uint8_t *)xtra_buff, 16);
+-                if (len > 0) {
++                int mlen = encode_whitespaces((uint8_t *)xtra_buff, 16);
++                if (mlen > 0) {
+                     printf("SCSI_MODEL=%s\n", xtra_buff);
+                     encode_string(xtra_buff, &rp[16], 16);
+                     printf("SCSI_MODEL_ENC=%s\n", xtra_buff);
+@@ -2380,8 +2380,8 @@ std_inq_decode(const uint8_t * rp, int len, struct opts_t * op,
+             memcpy(xtra_buff, &rp[32], 4);
+             xtra_buff[4] = '\0';
+             if (op->do_export) {
+-                len = encode_whitespaces((uint8_t *)xtra_buff, 4);
+-                if (len > 0)
++                int rlen = encode_whitespaces((uint8_t *)xtra_buff, 4);
++                if (rlen > 0)
+                     printf("SCSI_REVISION=%s\n", xtra_buff);
+             } else
+                 sgj_pr_hr(jsp, " Product revision level: %s\n", xtra_buff);
+@@ -2390,8 +2390,8 @@ std_inq_decode(const uint8_t * rp, int len, struct opts_t * op,
+             (' ' != rp[36])) {
+             memcpy(xtra_buff, &rp[36], len < 56 ? len - 36 : 20);
+             if (op->do_export) {
+-                len = encode_whitespaces((uint8_t *)xtra_buff, 20);
+-                if (len > 0)
++                int vlen = encode_whitespaces((uint8_t *)xtra_buff, 20);
++                if (vlen > 0)
+                     printf("VENDOR_SPECIFIC=%s\n", xtra_buff);
+             } else
+                 sgj_pr_hr(jsp, " Vendor specific: %s\n", xtra_buff);
+@@ -2404,9 +2404,9 @@ std_inq_decode(const uint8_t * rp, int len, struct opts_t * op,
+         if ((op->do_vendor > 1) && (len > 96)) {
+             memcpy(xtra_buff, &rp[96], len - 96);
+             if (op->do_export) {
+-                len = encode_whitespaces((uint8_t *)xtra_buff,
++                int vlen = encode_whitespaces((uint8_t *)xtra_buff,
+                                          len - 96);
+-                if (len > 0)
++                if (vlen > 0)
+                     printf("VENDOR_SPECIFIC=%s\n", xtra_buff);
+             } else
+                 sgj_pr_hr(jsp, " Vendor specific: %s\n", xtra_buff);
+@@ -2415,8 +2415,8 @@ std_inq_decode(const uint8_t * rp, int len, struct opts_t * op,
+             (0 == strncmp("OPEN-V", (const char *)&rp[16], 6))) {
+            memcpy(xtra_buff, &rp[212], 32);
+            if (op->do_export) {
+-                len = encode_whitespaces((uint8_t *)xtra_buff, 32);
+-                if (len > 0)
++                int vlen = encode_whitespaces((uint8_t *)xtra_buff, 32);
++                if (vlen > 0)
+                     printf("VENDOR_SPECIFIC_OPEN-V_LDEV_NAME=%s\n", xtra_buff);
+             } else
+                 sgj_pr_hr(jsp, " Vendor specific OPEN-V LDEV Name: %s\n",
+-- 
+2.53.0
+

diff --git a/0009-sg_inq-re-add-Unit-serial-number-field.patch b/0009-sg_inq-re-add-Unit-serial-number-field.patch
new file mode 100644
index 0000000..acdebd3
--- /dev/null
+++ b/0009-sg_inq-re-add-Unit-serial-number-field.patch
@@ -0,0 +1,52 @@
+From c86af25adb675bd508c82aa686d0e1b5952b12fc Mon Sep 17 00:00:00 2001
+From: Martin Wilck <mwilck@suse.com>
+Date: Fri, 19 Apr 2024 23:03:14 +0200
+Subject: [PATCH 2/2] sg_inq: re-add Unit serial number field
+
+After 0f1230a ("sg_readcap+sg_luns: add --inhex= and json"), the
+"Unit serial number" output field is missing from sg_inq output:
+
+> ./sg_inq /dev/sda
+standard INQUIRY:
+  PQual=0  PDT=0  RMB=0  LU_CONG=0  hot_pluggable=0  version=0x05  [SPC-3]
+  [AERC=0]  [TrmTsk=0]  NormACA=0  HiSUP=0  Resp_data_format=2
+  SCCS=0  ACC=0  TPGS=0  3PC=0  Protect=0  [BQue=0]
+  EncServ=0  MultiP=0  [MChngr=0]  [ACKREQQ=0]  Addr16=0
+  [RelAdr=0]  WBus16=0  Sync=0  [Linked=0]  [TranDis=0]  CmdQue=1
+  [SPI: Clocking=0x0  QAS=0  IUS=0]
+    length=96 (0x60)   Peripheral device type: disk
+  Vendor identification: ATA
+  Product identification: SK hynix SC300 M
+  Product revision level: 0P00
+
+Previously, the command would also print
+
+  Unit serial number: FJ63N456110303C1E
+
+The problem is caused by checking "len" rather than op->maxlen
+in the condition that's evaluated for printing the unit serial numnber.
+
+Fixes: 0f1230a ("sg_readcap+sg_luns: add --inhex= and json")
+Signed-off-by: Martin Wilck <mwilck@suse.com>
+---
+ src/sg_inq.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/sg_inq.c b/src/sg_inq.c
+index 8e6b269d..5d77d908 100644
+--- a/src/sg_inq.c
++++ b/src/sg_inq.c
+@@ -2428,8 +2428,8 @@ std_inq_decode(const uint8_t * rp, int len, struct opts_t * op,
+ 
+         if (as_json)
+             jo2p = std_inq_decode_js(rp, len, op, jop);
+-        if ((0 == len) && usn_buff[0])
+-            sgj_pr_hr(jsp, " Unit serial number: %s\n", usn_buff);
++        if ((0 == op->maxlen) && usn_buff[0])
++            sgj_pr_hr(jsp, "  Unit serial number: %s\n", usn_buff);
+         if (op->do_descriptors) {
+             sgj_opaque_p jap = sgj_named_subarray_r(jsp, jo2p,
+                                                 "version_descriptor_list");
+-- 
+2.53.0
+

diff --git a/sg3_utils.spec b/sg3_utils.spec
index 347f6d9..0b108d3 100644
--- a/sg3_utils.spec
+++ b/sg3_utils.spec
@@ -4,7 +4,7 @@
 Summary: Utilities for devices that use SCSI command sets
 Name:    sg3_utils
 Version: 1.48
-Release: 7%{?dist}
+Release: 8%{?dist}
 License: GPL-2.0-or-later AND BSD-2-Clause
 URL:     https://sg.danny.cz/sg/sg3_utils.html
 Source0: https://sg.danny.cz/sg/p/sg3_utils-%{version}.tar.xz
@@ -20,6 +20,24 @@ Patch1: 0002-rescan-scsi-bus.sh-remove-tmp-rescan-scsi-mpath-info.patch
 Patch2: 0003-rescan-scsi-bus.sh-fix-for-github.com-doug-gilbert-s.patch
 # https://github.com/doug-gilbert/sg3_utils/pull/47
 Patch3: udev_rules-avoid_spurious_warning_for_non-SCSI_devices.patch
+# https://github.com/doug-gilbert/sg3_utils/pull/68
+# rescan-scsi-bus.sh Correctly read RMB bit on enquiry
+Patch4: 0004-rescan-scsi-bus.sh-Correctly-read-RMB-bit-on-enquiry.patch
+# https://github.com/doug-gilbert/sg3_utils/pull/68
+# rescan-scsi-bus.sh Replace 'which' with build in 'command -v'
+Patch5: 0005-rescan-scsi-bus.sh-Replace-which-with-build-in-comma.patch
+# https://github.com/doug-gilbert/sg3_utils/pull/69
+# Update sg_safte.c to update short option of version
+Patch6: 0006-Update-sg_safte.c-to-update-short-option-of-version.patch
+# https://github.com/doug-gilbert/sg3_utils/pull/56
+# Update sg_rdac.c to accept --help or -h without error
+Patch7: 0007-Update-sg_rdac.c-to-accept--help-or--h-without-erro.patch
+# https://github.com/doug-gilbert/sg3_utils/pull/49
+# sg_inq: fix missing output fields in --export format
+Patch8: 0008-sg_inq-fix-missing-output-fields-in--export-format.patch
+# https://github.com/doug-gilbert/sg3_utils/pull/49
+# sg_inq: re-add Unit serial number field
+#Patch9: 0009-sg_inq-re-add-Unit-serial-number-field.patch
 
 Requires: %{name}-libs%{?_isa} = %{version}-%{release}
 BuildRequires: make
@@ -136,6 +154,14 @@ install -p -m 755 scripts/fc_wwpn_id %{buildroot}%{_udevlibdir}
 
 
 %changelog
+* Mon Feb 09 2026 Paul Evans <pevans@redhat.com> - 1.48-8
+- rescan-scsi-bus.sh: Correctly read RMB bit on enquiry (RHEL-122982)
+- rescan-scsi-bus.sh: Replace 'which' with built in 'command -v' (RHEL-70693)
+- sg_safte: update short option of version (RHEL-125869)
+- sg_rdac: accept --help or -h without error (RHEL-69439)
+- sg_inq: fix missing output fields in --export format (RHEL-119246)
+- sg_inq: re-add Unit serial number field (RHEL-119246)
+
 * Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1.48-7
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-25 12:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-25 12:56 [rpms/sg3_utils] f43: * Mon Feb 09 2026 Paul Evans <pevans@redhat.com> - 1.48-8 Paul Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox