Compare commits

...

No commits in common. "imports/c9-beta/sg3_utils-1.47-5.el9" and "c8" have entirely different histories.

10 changed files with 1679 additions and 73 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/sg3_utils-1.47r908.tgz
SOURCES/sg3_utils-1.44.tar.xz

View File

@ -1 +1 @@
e9cb6ac8f4f5a8d0c747c308653338f93f8a2e70 SOURCES/sg3_utils-1.47r908.tgz
b00dae1fc53fc4d31202f7a590233d98c1dda4d8 SOURCES/sg3_utils-1.44.tar.xz

View File

@ -0,0 +1,14 @@
#
# Blacklist specific USB devices
#
# don't inquire sn and di on broken devices (https://bugzilla.suse.com/show_bug.cgi?id=840054)
ACTION!="add|change", GOTO="usb_blacklist_end"
KERNEL!="sd*[!0-9]|sr*", GOTO="usb_blacklist_end"
# unkown device
ATTRS{idVendor}=="0aec", ATTRS{idProduct}=="3260", ENV{ID_SCSI_INQUIRY}="1"
# Sony/JMicron port replicator
ATTRS{idVendor}=="054c", ATTRS{idProduct}=="06a0", ENV{ID_SCSI_INQUIRY}="1"
LABEL="usb_blacklist_end"

View File

@ -0,0 +1,17 @@
#
# FC WWPN-based by-path links
#
ACTION!="add|change", GOTO="fc_wwpn_end"
KERNEL!="sd*", GOTO="fc_wwpn_end"
ENV{DEVTYPE}=="disk", IMPORT{program}="fc_wwpn_id %p"
ENV{DEVTYPE}=="partition", IMPORT{parent}="FC_*"
ENV{FC_TARGET_WWPN}!="?*", GOTO="fc_wwpn_end"
ENV{FC_INITIATOR_WWPN}!="?*", GOTO="fc_wwpn_end"
ENV{FC_TARGET_LUN}!="?*", GOTO="fc_wwpn_end"
ENV{DEVTYPE}=="disk", SYMLINK+="disk/by-path/fc-$env{FC_INITIATOR_WWPN}-$env{FC_TARGET_WWPN}-lun-$env{FC_TARGET_LUN}"
ENV{DEVTYPE}=="partition", SYMLINK+="disk/by-path/fc-$env{FC_INITIATOR_WWPN}-$env{FC_TARGET_WWPN}-lun-$env{FC_TARGET_LUN}-part%n"
LABEL="fc_wwpn_end"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
From 37b8af8278bba0b116b579950218f2e610a2ab2b Mon Sep 17 00:00:00 2001
From: jtpittman195 <jpittman@redhat.com>
Date: Fri, 4 Oct 2019 10:58:24 -0400
Subject: [PATCH] fc_wwpn_id: add condition to FC_TARGET_LUN return
If there is no relevant fc_remote_port or fc_host found, there is no need to return the target_lun number. Returning with no condition causes a FC_TARGET_LUN value to be present in the udev database for devices that are not fibre attached. Add condition to check.
---
scripts/fc_wwpn_id | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scripts/fc_wwpn_id b/scripts/fc_wwpn_id
index c8d0189..b05c5e8 100644
--- a/scripts/fc_wwpn_id
+++ b/scripts/fc_wwpn_id
@@ -38,7 +38,9 @@ while [ -n "$d" ] ; do
esac
done
-echo "FC_TARGET_LUN=$target_lun"
+if [ -n "$rport_wwpn" ] || [ -n "$host_wwpn" ] ; then
+ echo "FC_TARGET_LUN=$target_lun"
+fi
if [ -n "$rport_wwpn" ] ; then
echo "FC_TARGET_WWPN=$rport_wwpn"

View File

@ -0,0 +1,28 @@
From c683e6e2bc62b43c140934b919323d107b0a48cb Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Tue, 28 May 2019 16:06:06 +0200
Subject: [PATCH] sg_raw: do not print error about device not specified on
version request
---
src/sg_raw.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/sg_raw.c b/src/sg_raw.c
index 33a85f7c..453ff42a 100644
--- a/src/sg_raw.c
+++ b/src/sg_raw.c
@@ -440,6 +440,13 @@ parse_cmd_line(struct opts_t * op, int argc, char *argv[])
}
}
+ if (op->version_given
+#ifdef DEBUG
+ && ! op->verbose_given
+#endif
+ )
+ return 0;
+
if (optind >= argc) {
pr2serr("No device specified\n\n");
return SG_LIB_SYNTAX_ERROR;

View File

@ -0,0 +1,95 @@
From a00692315686c7bc061010aa215bcb381181758f Mon Sep 17 00:00:00 2001
From: Douglas Gilbert <dgilbert@interlog.com>
Date: Wed, 10 Oct 2018 06:50:03 +0000
Subject: [PATCH] sg_ses: bug: --page= being overridden when --control and
--data= also given; fix; sg_opcodes: expand MLU (18-102r0)
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@793 6180dd3e-e324-4e3e-922d-17de1ae2f315
diff --git a/src/sg_ses.c b/src/sg_ses.c
index abb1feac..0cce8bd1 100644
--- a/src/sg_ses.c
+++ b/src/sg_ses.c
@@ -70,7 +70,7 @@ static const char * version_str = "2.43 20180810"; /* ses4r02 */
#define ELEM_DESC_DPC 0x7
#define SHORT_ENC_STATUS_DPC 0x8
#define ENC_BUSY_DPC 0x9
-#define ADD_ELEM_STATUS_DPC 0xa
+#define ADD_ELEM_STATUS_DPC 0xa /* Additional Element Status dpage code */
#define SUBENC_HELP_TEXT_DPC 0xb
#define SUBENC_STRING_DPC 0xc
#define SUPPORTED_SES_DPC 0xd /* should be 0x1 <= dpc <= 0x2f */
@@ -108,6 +108,7 @@ static const char * version_str = "2.43 20180810"; /* ses4r02 */
#define SAS_CONNECTOR_ETC 0x19
#define LAST_ETC SAS_CONNECTOR_ETC /* adjust as necessary */
+#define TPROTO_PCIE_PS_NVME 1 /* NVMe regarded as subset of PCIe */
#define NUM_ETC (LAST_ETC + 1)
#define DEF_CLEAR_VAL 0
@@ -1378,7 +1379,8 @@ parse_cmd_line(struct opts_t *op, int argc, char *argv[])
return SG_LIB_SYNTAX_ERROR;
}
op->do_raw = 0;
- if (op->arr_len > 3) {
+ /* struct data_in_desc_t stuff does not apply when --control */
+ if (op->do_status && (op->arr_len > 3)) {
int off;
int pc = 0;
const uint8_t * bp = op->data_arr + DATA_IN_OFF;
@@ -3476,9 +3478,9 @@ additional_elem_helper(const char * pad, const uint8_t * ae_bp,
if (len < 6)
break;
pcie_pt = (ae_bp[5] >> 5) & 0x7;
- if (1 == pcie_pt)
+ if (TPROTO_PCIE_PS_NVME == pcie_pt)
printf("%sPCIe protocol type: NVMe\n", pad);
- else {
+ else { /* no others currently defined */
printf("%sTransport protocol: PCIe subprotocol=0x%x not "
"decoded\n", pad, pcie_pt);
if (op->verbose)
@@ -3490,7 +3492,7 @@ additional_elem_helper(const char * pad, const uint8_t * ae_bp,
ae_bp[5] & 1);
printf(", device slot number: %d\n", ae_bp[7]);
- pcie_vid = sg_get_unaligned_le16(ae_bp + 10);
+ pcie_vid = sg_get_unaligned_le16(ae_bp + 10); /* N.B. LE */
printf("%sPCIe vendor id: 0x%" PRIx16 "%s\n", pad, pcie_vid,
(0xffff == pcie_vid) ? " (not reported)" : "");
printf("%sserial number: %.20s\n", pad, ae_bp + 12);
@@ -3505,14 +3507,14 @@ additional_elem_helper(const char * pad, const uint8_t * ae_bp,
(int)psn_valid, (int)bdf_valid, (int)cid_valid);
if (cid_valid) /* N.B. little endian */
printf("%s controller id: 0x%" PRIx16 "\n", pad,
- sg_get_unaligned_le16(aep + 1));
+ sg_get_unaligned_le16(aep + 1)); /* N.B. LEndian */
if (bdf_valid)
printf("%s bus number: 0x%x, device number: 0x%x, "
"function number: 0x%x\n", pad, aep[4],
(aep[5] >> 3) & 0x1f, 0x7 & aep[5]);
if (psn_valid) /* little endian, top 3 bits assumed zero */
printf("%s physical slot number: 0x%" PRIx16 "\n", pad,
- 0x1fff & sg_get_unaligned_le16(aep + 6));
+ 0x1fff & sg_get_unaligned_le16(aep + 6)); /* N.B. LE */
}
break;
default:
@@ -3524,7 +3526,7 @@ additional_elem_helper(const char * pad, const uint8_t * ae_bp,
}
}
-/* ADD_ELEM_STATUS_DPC [0xa]
+/* ADD_ELEM_STATUS_DPC [0xa] Additional Element Status dpage
* Previously called "Device element status descriptor". Changed "device"
* to "additional" to allow for SAS expander and SATA devices */
static void
@@ -5704,7 +5706,7 @@ main(int argc, char * argv[])
uint16_t oacs;
nvmsr = enc_stat_rsp[253];
- oacs = sg_get_unaligned_le16(enc_stat_rsp + 256);
+ oacs = sg_get_unaligned_le16(enc_stat_rsp + 256); /* N.B. LE */
if (vb > 3)
pr2serr("NVMe Identify ctl response: nvmsr=%u, oacs=0x%x\n",
nvmsr, oacs);

View File

@ -0,0 +1,24 @@
From 116e665ddb7b38bb8f7065ddb08192bd3551897d Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Tue, 26 Feb 2019 16:45:59 +0100
Subject: [PATCH] sg_turs: fix help invocation in the old mode
In the old mode the usage was printed out twice when called
by `sg_turs -O -?`.
---
src/sg_turs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sg_turs.c b/src/sg_turs.c
index 8c6e3792..a318d22c 100644
--- a/src/sg_turs.c
+++ b/src/sg_turs.c
@@ -252,7 +252,7 @@ old_parse_cmd_line(struct opts_t * op, int argc, char * argv[])
op->version_given = true;
break;
case '?':
- usage_old();
+ ++op->do_help;
return 0;
default:
jmp_out = true;

View File

@ -1,24 +1,32 @@
%global rescan_script rescan-scsi-bus.sh
%global _udevlibdir %{_prefix}/lib/udev
Summary: Utilities for devices that use SCSI command sets
Name: sg3_utils
Version: 1.47
Release: 5%{?dist}
Version: 1.44
Release: 6%{?dist}
License: GPLv2+ and BSD
Source0: http://sg.danny.cz/sg/p/sg3_utils-%{version}r908.tgz
Group: Applications/System
Source0: http://sg.danny.cz/sg/p/sg3_utils-%{version}.tar.xz
Source2: scsi-rescan.8
Source10: 40-usb-blacklist.rules
Source11: 59-fc-wwpn-id.rules
Patch0: BZ_1633235-sg3_utils-1.44-covscan-fix.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1683343
# sg_turs: improper usage show
Patch1: sg_turs-help.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1627657
# sg_raw -V fail
Patch2: sg_raw-version.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1760847
# FC_TARGET_LUN attribute assigned for non FC device
Patch3: fc_wwpn_id-non_FC-devices.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2078107
# sg_ses: --page= is incorrectly overridden when --control and --data= are also used
Patch4: sg_ses-1.45-page_control_data_args.patch
URL: http://sg.danny.cz/sg/sg3_utils.html
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
BuildRequires: make
BuildRequires: gcc
BuildRequires: systemd
BuildRequires: gettext-devel
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: libtool
%description
@ -37,12 +45,14 @@ and the incorrect usage of them may render your system inoperable.
%package libs
Summary: Shared library for %{name}
Group: System Environment/Libraries
%description libs
This package contains the shared library for %{name}.
%package devel
Summary: Development library and header files for the sg3_utils library
Group: Development/Libraries
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description devel
@ -50,21 +60,20 @@ This package contains the %{name} library and its header files for
developing applications.
%prep
%autosetup -p 1 -n sg3_utils-%{version}r908
%autosetup -p 1
%build
./autogen.sh
%configure --disable-static
# Don't use rpath!
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
%make_build
make %{?_smp_mflags}
%install
%make_install
make install DESTDIR=$RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la
install -p -m 755 scripts/%{rescan_script} $RPM_BUILD_ROOT%{_bindir}
@ -75,14 +84,17 @@ install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man8
# install all extra udev rules
mkdir -p $RPM_BUILD_ROOT%{_udevrulesdir}
mkdir -p $RPM_BUILD_ROOT/usr/lib/udev
install -p -m 644 scripts/40-usb-blacklist.rules $RPM_BUILD_ROOT%{_udevrulesdir}
# need to run after 60-persistent-storage.rules
install -p -m 644 scripts/55-scsi-sg3_id.rules $RPM_BUILD_ROOT%{_udevrulesdir}/61-scsi-sg3_id.rules
# need to run after 62-multipath.rules
install -p -m 644 scripts/58-scsi-sg3_symlink.rules $RPM_BUILD_ROOT%{_udevrulesdir}/63-scsi-sg3_symlink.rules
install -p -m 644 scripts/59-scsi-cciss_id.rules $RPM_BUILD_ROOT%{_udevrulesdir}/65-scsi-cciss_id.rules
install -p -m 644 scripts/59-fc-wwpn-id.rules $RPM_BUILD_ROOT%{_udevrulesdir}/63-fc-wwpn-id.rules
install -p -m 755 scripts/fc_wwpn_id $RPM_BUILD_ROOT%{_udevlibdir}
install -p -m 644 %{SOURCE10} $RPM_BUILD_ROOT%{_udevrulesdir}
install -p -m 644 %{SOURCE11} $RPM_BUILD_ROOT%{_udevrulesdir}/63-fc-wwpn-id.rules
install -p -m 755 scripts/fc_wwpn_id $RPM_BUILD_ROOT/usr/lib/udev
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%files
%doc AUTHORS BSD_LICENSE COPYING COVERAGE CREDITS ChangeLog README README.sg_start
@ -91,9 +103,8 @@ install -p -m 755 scripts/fc_wwpn_id $RPM_BUILD_ROOT%{_udevlibdir}
%{_udevrulesdir}/61-scsi-sg3_id.rules
%{_udevrulesdir}/63-scsi-sg3_symlink.rules
%{_udevrulesdir}/63-fc-wwpn-id.rules
%{_udevrulesdir}/65-scsi-cciss_id.rules
%{_udevrulesdir}/40-usb-blacklist.rules
%{_udevlibdir}/fc_wwpn_id
/usr/lib/udev/*
%files libs
%doc BSD_LICENSE COPYING
@ -105,62 +116,27 @@ install -p -m 755 scripts/fc_wwpn_id $RPM_BUILD_ROOT%{_udevlibdir}
%changelog
* Wed Aug 18 2021 Tomas Bzatek <tbzatek@redhat.com> - 1.47-5
- update to pre-release version 1.47 (svn: r908) (#1971681)
* Wed Jun 08 2022 Tomas Bzatek <tbzatek@redhat.com> - 1.44-6
- Fix sg_ses --page argument override when --control and --data are specified (#2078107)
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1.47-4
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Thu Jan 02 2020 Tomas Bzatek <tbzatek@redhat.com> - 1.44-5
- Reorder the udev rules to run after 60-persistent-storage.rules (RHBZ #1785062)
* Tue Jun 15 2021 Tomas Bzatek <tbzatek@redhat.com> - 1.47-3
- update to pre-release version 1.47 (svn: r904) (#1970981)
* Tue Dec 10 2019 Tomas Bzatek <tbzatek@redhat.com> - 1.44-4
- Enable supplemental udev rules by default (RHBZ #1746414)
* Thu May 27 2021 Tomas Bzatek <tbzatek@redhat.com> - 1.47-2
- Rebuild (#1963799)
* Mon May 17 2021 Tomas Bzatek <tbzatek@redhat.com> - 1.47-1
- update to pre-release version 1.47 (svn: r900)
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.45-5
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.45-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.45-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jul 14 2020 Tom Stellard <tstellar@redhat.com> - 1.45-2
- Use make macros
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
* Thu Mar 12 2020 Dan Horák <dan@danny.cz> - 1.45-1
- update to version 1.45 (#1809392)
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.44-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Mon Jan 06 2020 Tomas Bzatek <tbzatek@redhat.com> - 1.44-2
- Backport "rescan-scsi-bus.sh: use LUN wildcard in idlist"
* Fri Jan 03 2020 Tomas Bzatek <tbzatek@redhat.com> - 1.44-1
- Rebase to 1.44 release
- Enable supplemental udev rules
* Tue May 28 2019 Tomas Bzatek <tbzatek@redhat.com> - 1.44-3
- Fix sg_turs help invocation in an old mode (#1683343)
- Fix sg_raw printing error about device not specified on version request (#1627657)
- Fix coverity scan warnings (#1633235)
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.42-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Sep 28 2018 Gris Ge <fge@redhat.com> - 1.44-2
- Fix coverity scan warninings (RHBZ#1633235)
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.42-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Tue Sep 18 2018 Gris Ge <fge@redhat.com> - 1.44-1
- Upgrade to 1.44. (RHBZ#1631347)
* Mon Jul 16 2018 Dan Horák <dan[at]danny.cz> - 1.42-6
- fix build with new glibc - use sysmacros.h for major()/minor()
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.42-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Aug 10 2018 Gris Ge <fge@redhat.com> 1.43-0.beta785.1
- Upgrade to 1.43 beta r785.
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.42-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild