Merge ~rafaeldtinoco/ubuntu/+source/grub2:lp1838525-eoan into ubuntu/+source/grub2:ubuntu/eoan-devel

Proposed by Rafael David Tinoco
Status: Merged
Approved by: Andreas Hasenack
Approved revision: 41bea29f20f17155db3bf0187175af4ce9f9f5f7
Merge reported by: Rafael David Tinoco
Merged at revision: 41bea29f20f17155db3bf0187175af4ce9f9f5f7
Proposed branch: ~rafaeldtinoco/ubuntu/+source/grub2:lp1838525-eoan
Merge into: ubuntu/+source/grub2:ubuntu/eoan-devel
Diff against target: 93 lines (+71/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/series (+1/-0)
debian/patches/ubuntu-skip-disk-by-id-lvm-pvm-uuid-entries.patch (+62/-0)
Reviewer Review Type Date Requested Status
Dimitri John Ledkov (community) coredev Approve
Canonical Server Pending
Review via email: mp+373792@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Bug:

https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/1838525

contains valid SRU template with all explanations (hopefully) and summaries.

PPA:

https://launchpad.net/~rafaeldtinoco/+archive/ubuntu/lp1838525

contains a packaged version of the fix.

This is the merge request =).

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

Comment:

https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/1838525/comments/32

Describes how I tested this fix.

Bug comment has the full way of verifying (which requires the installer to have this new grub-common package).

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

I have just rebased my changes to 2.04-1ubuntu10 since that version is the latest one (also submitted this same version to the PPA).

Revision history for this message
Dimitri John Ledkov (xnox) :
review: Approve (coredev)
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Note to self:
- convert into the git-dpm repo
- upload this
- upload matching grub2-signed

Revision history for this message
Dimitri John Ledkov (xnox) wrote :
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Uploaded to unapproved queue.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Switching to approved since it was reviewed and uploaded.

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 43387cd..177a71c 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+grub2 (2.04-1ubuntu10) eoan; urgency=medium
7+
8+ * debian/patches/ubuntu-skip-disk-by-id-lvm-pvm-uuid-entries.patch:
9+ skip /dev/disk/by-id/lvm-pvm-uuid entries from device iteration.
10+ (LP: #1838525)
11+
12+ -- Rafael David Tinoco <rafaeldtinoco@ubuntu.com> Mon, 07 Oct 2019 23:23:54 -0300
13+
14 grub2 (2.04-1ubuntu9) eoan; urgency=medium
15
16 * debian/patches/ubuntu-zfs-enhance-support.patch:
17diff --git a/debian/patches/series b/debian/patches/series
18index 9bec185..52aa88d 100644
19--- a/debian/patches/series
20+++ b/debian/patches/series
21@@ -66,3 +66,4 @@ ubuntu-clear-invalid-initrd-spacing.patch
22 ubuntu-temp-keep-auto-nvram.patch
23 ubuntu-add-devicetree-command-support.patch
24 ubuntu-boot-from-multipath-dependent-symlink.patch
25+ubuntu-skip-disk-by-id-lvm-pvm-uuid-entries.patch
26diff --git a/debian/patches/ubuntu-skip-disk-by-id-lvm-pvm-uuid-entries.patch b/debian/patches/ubuntu-skip-disk-by-id-lvm-pvm-uuid-entries.patch
27new file mode 100644
28index 0000000..d1012e2
29--- /dev/null
30+++ b/debian/patches/ubuntu-skip-disk-by-id-lvm-pvm-uuid-entries.patch
31@@ -0,0 +1,62 @@
32+From 765731dae4dd076ae543a164c000544e147b3fd3 Mon Sep 17 00:00:00 2001
33+From: Rafael David Tinoco <rafaeldtinoco@ubuntu.com>
34+Date: Mon, 7 Oct 2019 22:53:32 -0300
35+Subject: [PATCH] Skip /dev/disk/by-id/lvm-pvm-uuid entries from device
36+ iteration
37+
38+The following LVM2 commit:
39+
40+commit 417e52c13a8156b11c25c411d44bda8b32bf87e4
41+Author: Peter Rajnoha <prajnoha@redhat.com>
42+Date: Tue Feb 18 07:27:21 2014
43+
44+ udev: create /dev/disk/by-id/lvm-pv-uuid-<PV_UUID> symlink for a PV
45+
46+ We already have /dev/disk/by-id/dm-uuid-... (which encompasses the
47+ VG UUID and LV UUID in case of LVs since the mapping's UUID is
48+ VG+LV UUID together) and /dev/disk/by-id/dm-name-... (which encompasses
49+ the VG and LV name in case of LVs).
50+
51+ This patch addds /dev/disk/by-id/lvm-pv-uuid-<PV_UUID> that completes
52+ this scheme and makes navigation a bit easier using PV UUIDs since
53+ one can navigate using PV UUIDs only and there's no need to do extra
54+ PV UUID <--> kernel name matching (the PV UUID is stable across reboots).
55+ This may come in handy in various scripts.
56+
57+ Since we already have the PV UUID stored in udev database (as a result
58+ of blkid call - returned in ID_FS_UUID blkid's variable), this operation
59+ is very cheap indeed, just creating the extra one symlink.
60+
61+creates a udev rule that populates /dev/disk/by-id with LVM PVs
62+according to discovered UUIDs. That will trigger a bad logic in
63+debian-installer as the installer depends on grub_util_iterate_devices()
64+logic to discover the disks that can have grub installed.
65+
66+This change only ignores those entries, so debian-installer bad
67+execution path is not triggered, just like grub_iterate_devices()
68+already does for other similar entries, like the partition ones.
69+
70+Author: Rafael David Tinoco <rafaeldtinoco@ubuntu.com>
71+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1838525
72+Last-Update: 2019-10-07
73+---
74+ util/deviceiter.c | 3 +++
75+ 1 file changed, 3 insertions(+)
76+
77+diff --git a/util/deviceiter.c b/util/deviceiter.c
78+index dddc50da7..ec9a6d0ab 100644
79+--- a/util/deviceiter.c
80++++ b/util/deviceiter.c
81+@@ -589,6 +589,9 @@ grub_util_iterate_devices (int (*hook) (const char *, int, void *), void *hook_d
82+ /* Skip partition entries. */
83+ if (strstr (entry->d_name, "-part"))
84+ continue;
85++ /* LVM might create /dev/disk/by-id/lvm-pv-uuid-<PV_UUID> symlinks */
86++ if (strstr (entry->d_name, "lvm-pv-uuid"))
87++ continue;
88+ /* Skip device-mapper entries; we'll handle the ones we want
89+ later. */
90+ if (strncmp (entry->d_name, "dm-", sizeof ("dm-") - 1) == 0)
91+--
92+2.20.1
93+

Subscribers

People subscribed via source and target branches