Merge ~rafaeldtinoco/ubuntu/+source/sg3-utils:lp1833618-disco into ubuntu/+source/sg3-utils:ubuntu/disco-devel

Proposed by Rafael David Tinoco
Status: Merged
Approved by: Christian Ehrhardt 
Approved revision: 78092a6a38994f2dd17bcd21b1bc1892302e33d2
Merged at revision: 78092a6a38994f2dd17bcd21b1bc1892302e33d2
Proposed branch: ~rafaeldtinoco/ubuntu/+source/sg3-utils:lp1833618-disco
Merge into: ubuntu/+source/sg3-utils:ubuntu/disco-devel
Diff against target: 156 lines (+130/-0)
4 files modified
debian/changelog (+8/-0)
debian/patches/55-scsi-sg3_id.rules-ID_SERIAL-fix.patch (+85/-0)
debian/patches/new-location-for-major-and-minor.patch (+35/-0)
debian/patches/series (+2/-0)
Reviewer Review Type Date Requested Status
Rafael David Tinoco (community) Approve
Christian Ehrhardt  (community) Approve
Ryan Harper Pending
Canonical Server Pending
Review via email: mp+373439@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

https://bugs.launchpad.net/curtin/+bug/1833618/comments/45:

I have to re-submit Disco MR and a new PPA package, as the compiler in Disco is likely more recent and treating lots of "new warnings" as errors (-Wimplicit-fallthrough, etc...). I'll do it tomorrow!

review: Needs Fixing
Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

I'll wait for feedback in bug:

https://bugs.launchpad.net/ubuntu/+source/sg3-utils/+bug/1833618

Before asking for this to be sponsored (fyio).

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) :
review: Approve
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

The patch looks correctly ported form upstream (the needed snippet applies as-is), I'll leave the effect it has on the system to Ryan's review who is deeper into the tech side of this case already.

Minor fixups needed, therefore "Need Fixing"

review: Needs Fixing
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Minor comments on the FTBFS fixes as well

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Other than the stated patches LGTM, as I said functionally we might wait for Ryan to comment.
You might cleanup the style issue until then to be ready to upload.

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Fixed, re-pushing.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

LGTM now, thanks for the fixups.

One nit pick inline, just to bother you :-)

review: Approve
Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :
review: Approve
Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

> I'll go on with this fix.

Christian, would you mind uploading this for me ? sg3-utils needs core-dev!

Thanks a lot!

PS: next one is the Bionic SRU (that will fix that original MAAS case).

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I've checked the other MPs comments.
Marking as approved and sponsoring as requested.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Umm - only now I see a bad version number.
I either missed it on the initial review or it wasn't there back then.

Anyway - let me explain and fix it up on upload:
1.42-2ubuntu2~19.04~1

First of all "double ~" seems wrong and ~ means "before what is in front"
This is disco, so 19.04, which means before the 19.04 - that seems odd.

Current versions:
 sg3-utils | 1.42-2ubuntu1 | bionic | source, amd64, arm64, armhf, i386, ppc64el, s390x
 sg3-utils | 1.42-2ubuntu1 | disco | source, amd64, arm64, armhf, i386, ppc64el, s390x
 sg3-utils | 1.44-1ubuntu1 | eoan | source, amd64, arm64, armhf, i386, ppc64el, s390x
 sg3-utils | 1.44-1ubuntu1 | focal | source, amd64, arm64, armhf, i386, ppc64el, s390x

E+F are fixe. So we need new versions vor B+D and since they are the same now we need the release in the version - so far so good.

But that would usually be:
B: 1.42-2ubuntu1.18.04.1
D: 1.42-2ubuntu1.19.04.1

See https://wiki.ubuntu.com/SecurityTeam/UpdatePreparation#Update_the_packaging

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

$ git push pkg upload/1.42-2ubuntu1.19.04.1
Enumerating objects: 26, done.
Counting objects: 100% (26/26), done.
Delta compression using up to 4 threads
Compressing objects: 100% (21/21), done.
Writing objects: 100% (21/21), 5.25 KiB | 1.31 MiB/s, done.
Total 21 (delta 11), reused 0 (delta 0)
To ssh://git.launchpad.net/~usd-import-team/ubuntu/+source/sg3-utils
 * [new tag] upload/1.42-2ubuntu1.19.04.1 -> upload/1.42-2ubuntu1.19.04.1

$ dput ubuntu ../sg3-utils_1.42-2ubuntu1.19.04.1_source.changes
Checking signature on .changes
gpg: ../sg3-utils_1.42-2ubuntu1.19.04.1_source.changes: Error checking signature from BA3E29338280B242: SignatureVerifyError: 0
Checking signature on .dsc
gpg: ../sg3-utils_1.42-2ubuntu1.19.04.1.dsc: Error checking signature from BA3E29338280B242: SignatureVerifyError: 0
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading sg3-utils_1.42-2ubuntu1.19.04.1.dsc: done.
  Uploading sg3-utils_1.42-2ubuntu1.19.04.1.debian.tar.xz: done.
  Uploading sg3-utils_1.42-2ubuntu1.19.04.1_source.buildinfo: done.
  Uploading sg3-utils_1.42-2ubuntu1.19.04.1_source.changes: done.
Successfully uploaded packages.

Now in the SRU Teams queue

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index 15acda8..e53287a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
1sg3-utils (1.42-2ubuntu2~19.04~1) disco; urgency=medium
2
3 * d/p/55-scsi-sg3_id.rules-ID_SERIAL-fix.patch: ID_SERIAL fix for USB
4 SPC-only devices in 55-scsi-sg3_id.rules (LP: #1833618)
5 * d/p/new-location-for-major-and-minor.patch: Fix FTBS header issue
6
7 -- Rafael David Tinoco <rafaeldtinoco@ubuntu.com> Wed, 09 Oct 2019 06:13:54 +0000
8
1sg3-utils (1.42-2ubuntu1) yakkety; urgency=medium9sg3-utils (1.42-2ubuntu1) yakkety; urgency=medium
210
3 * debian/control, debian/rules: build a sg3-udeb installer package again.11 * debian/control, debian/rules: build a sg3-udeb installer package again.
diff --git a/debian/patches/55-scsi-sg3_id.rules-ID_SERIAL-fix.patch b/debian/patches/55-scsi-sg3_id.rules-ID_SERIAL-fix.patch
4new file mode 10064412new file mode 100644
index 0000000..7eddde3
--- /dev/null
+++ b/debian/patches/55-scsi-sg3_id.rules-ID_SERIAL-fix.patch
@@ -0,0 +1,85 @@
1Description: 55-scsi-sg3_id.rules: ID_SERIAL fix for USB SPC-only devices
2
3Upstream commit had changes for:
4
5git-svn-id: svn://localhost/trunk@703 6180dd3e-e324-4e3e-922d-17de1ae2f315
6---
7 ChangeLog | 4 +++-
8 scripts/55-scsi-sg3_id.rules | 15 ++++++++----
9 scripts/rescan-scsi-bus.sh | 46 ++++++++++++++++++++----------------
10 3 files changed, 38 insertions(+), 27 deletions(-)
11
12But, for this SRU, I'm backporting ONLY the changes in:
13
14 55-scsi-sg3_id.rules | 15 ++++++++++-----
15 1 file changed, 10 insertions(+), 5 deletions(-)
16
17Because I'm only interested in the fix for USB SPC-only devices ID_SERIAL.
18
19This upstream commit changes the udev rules logic for USB block devices
20that only supports SCSI PRIMARY COMMANDS, not supporting SCSI INQ 0x80
21nor 0x83.
22
23Despite a possible delay, still existing in this version, whenever a
24SPC-only block device (pendrive ?) is attached, this version fixes the
25main issue for LP: 1833618, wrong ID_SERIAL for those devices.
26
27Udev rules from sg3-utils will, still, execute SCSI INQ 0X80 trying to use VPDs
28from the kernel, and those will fail fast. Unfortunately, the subsequent SCSI
29INQ 0x83 command, also trying to use VPDs from kernel, will take much longer
30time (sometimes up to 1 minute) to fail when it sees there is no existing
31vpd_pg83 file in sysfs and send an INQ to the USB block device, adding a delay
32in the device attachment. This is not being addressed in this fix as this is
33still present in upstream version.
34
35This last issue has to be addressed in a future sg3-utils-merge and
36that is why is being documented here (when this patch will likely be
37dropped).
38
39Signed-off-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com>
40
41Author: Douglas Gilbert <dgilbert@interlog.com>
42Origin: upstream, https://github.com/hreinecke/sg3_utils/commit/988e967513f
43Bug-Ubuntu: https://bugs.launchpad.net/bugs/1833618
44Last-Update: 2019-10-09
45---
46 scripts/55-scsi-sg3_id.rules | 15 ++++++++++-----
47 1 file changed, 10 insertions(+), 5 deletions(-)
48
49diff --git a/scripts/55-scsi-sg3_id.rules b/scripts/55-scsi-sg3_id.rules
50index e914a5d..8c7356b 100644
51--- a/scripts/55-scsi-sg3_id.rules
52+++ b/scripts/55-scsi-sg3_id.rules
53@@ -7,7 +7,12 @@ SUBSYSTEM!="block", GOTO="sg3_utils_id_end"
54 # Import values for partitions
55 ENV{DEVTYPE}=="partition", IMPORT{parent}="SCSI_*", ENV{ID_SCSI}="1"
56 # SCSI INQUIRY values
57-KERNEL=="sd*[!0-9]|sr*", IMPORT{program}="/usr/bin/sg_inq --export $tempnode", ENV{ID_SCSI}="1"
58+# If the 'inquiry' sysfs attribute is present the kernel will already
59+# have scanned for VPD pages, so if the vpd page attribute is not
60+# present it is not supported (or deemed unsafe to access).
61+# Hence we can skip the call to sg_inq and avoid I/O altogether.
62+KERNEL=="sd*[!0-9]|sr*", IMPORT{program}="/usr/bin/sg_inq --export --inhex=/sys/block/$kernel/device/inquiry --raw", ENV{ID_SCSI}="1", ENV{ID_SCSI_SN}="1", ENV{ID_SCSI_DI}="1"
63+KERNEL=="sd*[!0-9]|sr*", ENV{ID_SCSI}!="1", IMPORT{program}="/usr/bin/sg_inq --export $tempnode", ENV{ID_SCSI}="1"
64 # scsi_id compat mappings
65 ENV{SCSI_VENDOR}=="?*", ENV{ID_VENDOR}="$env{SCSI_VENDOR}"
66 ENV{SCSI_VENDOR_ENC}=="?*", ENV{ID_VENDOR_ENC}="$env{SCSI_VENDOR_ENC}"
67@@ -16,11 +21,11 @@ ENV{SCSI_MODEL_ENC}=="?*", ENV{ID_MODEL_ENC}="$env{SCSI_MODEL_ENC}"
68 ENV{SCSI_REVISION}=="?*", ENV{ID_REVISION}="$env{SCSI_REVISION}"
69 ENV{SCSI_TYPE}=="?*", ENV{ID_TYPE}="$env{SCSI_TYPE}"
70 # SCSI EVPD page 0x80 values
71-KERNEL=="sd*[!0-9]|sr*", ENV{ID_SCSI}=="1", IMPORT{program}="/usr/bin/sg_inq --export --inhex=/sys/block/$kernel/device/vpd_pg80 --raw", ENV{ID_SCSI_SN}="1"
72-KERNEL=="sd*[!0-9]|sr*", ENV{ID_SCSI}=="1", ENV{ID_SCSI_SN}!="1", IMPORT{program}="/usr/bin/sg_inq --export --page=sn $tempnode", ENV{ID_SCSI_SN}="1"
73+KERNEL=="sd*[!0-9]|sr*", ENV{ID_SCSI}=="1", ENV{ID_SCSI_SN}=="1", IMPORT{program}="/usr/bin/sg_inq --export --inhex=/sys/block/$kernel/device/vpd_pg80 --raw"
74+KERNEL=="sd*[!0-9]|sr*", ENV{ID_SCSI}=="1", ENV{ID_SCSI_SN}!="1", IMPORT{program}="/usr/bin/sg_inq --export --page=sn $tempnode"
75 # SCSI EVPD page 0x83 values
76-KERNEL=="sd*[!0-9]", ENV{ID_SCSI}=="1", IMPORT{program}="/usr/bin/sg_inq --export --inhex=/sys/block/$kernel/device/vpd_pg83 --raw", ENV{ID_SCSI_DI}="1"
77-KERNEL=="sd*[!0-9]|sr*", ENV{ID_SCSI}=="1", ENV{ID_SCSI_DI}!="1", IMPORT{program}="/usr/bin/sg_inq --export --page=di $tempnode", ENV{ID_SCSI_DI}="1"
78+KERNEL=="sd*[!0-9]", ENV{ID_SCSI}=="1", ENV{ID_SCSI_DI}=="1", IMPORT{program}="/usr/bin/sg_inq --export --inhex=/sys/block/$kernel/device/vpd_pg83 --raw"
79+KERNEL=="sd*[!0-9]|sr*", ENV{ID_SCSI}=="1", ENV{ID_SCSI_DI}!="1", IMPORT{program}="/usr/bin/sg_inq --export --page=di $tempnode"
80
81 # ID_WWN compat mapping
82 ENV{SCSI_IDENT_LUN_NAA_REGEXT}=="?*", ENV{ID_WWN}!="?*", ENV{ID_WWN}="0x$env{SCSI_IDENT_LUN_NAA_REGEXT}"
83--
842.20.1
85
diff --git a/debian/patches/new-location-for-major-and-minor.patch b/debian/patches/new-location-for-major-and-minor.patch
0new file mode 10064486new file mode 100644
index 0000000..4196aa7
--- /dev/null
+++ b/debian/patches/new-location-for-major-and-minor.patch
@@ -0,0 +1,35 @@
1Description: new location for major() and minor()
2
3[Backport]
4 Only backported the header location change.
5
6Signed-off-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com>
7
8Author: Rafael David Tinoco <rafaeldtinoco@ubuntu.com>
9Origin: backport, https://github.com/hreinecke/sg3_utils/commit/3e50c99af4a4
10Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/sg3-utils/+bug/1833618
11Last-Update: 2019-10-01
12---
13 src/sg_map26.c | 5 ++++-
14 1 file changed, 4 insertions(+), 1 deletion(-)
15
16diff --git a/src/sg_map26.c b/src/sg_map26.c
17index 1a1301a..92f6de9 100644
18--- a/src/sg_map26.c
19+++ b/src/sg_map26.c
20@@ -31,8 +31,11 @@
21 #include <dirent.h>
22 #include <libgen.h>
23 #include <sys/ioctl.h>
24-#include <sys/types.h>
25 #include <sys/stat.h>
26+#include <sys/sysmacros.h> /* new location for major + minor */
27+#ifndef major
28+#include <sys/types.h>
29+#endif
30 #include <linux/major.h>
31
32 #ifdef HAVE_CONFIG_H
33--
342.20.1
35
diff --git a/debian/patches/series b/debian/patches/series
index 30d2fb2..fa0b7a4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,3 @@
1ship-rescan-script.sh1ship-rescan-script.sh
255-scsi-sg3_id.rules-ID_SERIAL-fix.patch
3new-location-for-major-and-minor.patch

Subscribers

People subscribed via source and target branches