Merge ~jibel/ubiquity:lp187504-dont_export_all_pools into ubiquity:master

Proposed by Jean-Baptiste Lallement
Status: Merged
Merged at revision: 82a9b2587340908e7140f5ed38ae9f2841ad6152
Proposed branch: ~jibel/ubiquity:lp187504-dont_export_all_pools
Merge into: ubiquity:master
Diff against target: 42 lines (+8/-4)
2 files modified
bin/ubiquity (+6/-4)
debian/changelog (+2/-0)
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli (community) Approve
Review via email: mp+384701@code.launchpad.net

Commit message

Only export pools with dataset mounted under /target instead of exporting everything with -a.

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

LGTM +1 Trusting your tests :)

review: Approve
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Tested with a zfs installation and entire disk/ext4.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/ubiquity b/bin/ubiquity
2index 9e50e7e..309fdd9 100755
3--- a/bin/ubiquity
4+++ b/bin/ubiquity
5@@ -382,19 +382,21 @@ def unmount_target():
6 if not TARGET:
7 return
8 paths = []
9+ pools = set()
10 with open('/proc/mounts') as mounts:
11 for line in mounts:
12- path = line.split(' ')[1]
13+ source, path, fstype = line.split(' ')[:3]
14 if path == TARGET or path.startswith(TARGET + '/'):
15 paths.append(path)
16+ if fstype == 'zfs':
17+ pools.add(source.split('/')[0])
18 paths.sort()
19 paths.reverse()
20 for path in paths:
21 misc.execute_root('fuser', '-cv', path)
22 misc.execute_root('umount', path)
23- if os.path.exists("/sbin/zpool"):
24- misc.execute_root('umount', '/target/boot/grub')
25- misc.execute_root('/sbin/zpool', 'export', '-a')
26+ for pool in pools:
27+ misc.execute_root('/sbin/zpool', 'export', pool)
28
29
30 def prepend_path(directory):
31diff --git a/debian/changelog b/debian/changelog
32index f119ca4..ee46088 100644
33--- a/debian/changelog
34+++ b/debian/changelog
35@@ -1,6 +1,8 @@
36 ubiquity (20.10.2) UNRELEASED; urgency=medium
37
38 * zsys-setup: Use persistent device name for vdevs (LP: #1880869)
39+ * Only export pools created during installation and containing dataset
40+ mounted under /target (LP: #1875045)
41
42 -- Jean-Baptiste Lallement <jean-baptiste.lallement@ubuntu.com> Wed, 27 May 2020 13:49:15 +0200
43

Subscribers

People subscribed via source and target branches