← Back to team overview

curtin-dev team mailing list archive

[Merge] ~mwhudson/curtin:lp-1895192 into curtin:master

 

Michael Hudson-Doyle has proposed merging ~mwhudson/curtin:lp-1895192 into curtin:master.

Commit message:
curthooks: do not add lvm devices filter when / is mutipathed

This code was added to defend against lvcreate seeing multiple paths to
a PV but the relevant udev rules already protect against this, and the
devices filter prevents assembling a VG containing an encrypted volume.

LP: #1895192


Requested reviews:
  curtin developers (curtin-dev)
Related bugs:
  Bug #1895192 in curtin: "Optimistic approach of using zkey for encrypted installations on s390x not working"
  https://bugs.launchpad.net/curtin/+bug/1895192

For more details, see:
https://code.launchpad.net/~mwhudson/curtin/+git/curtin/+merge/406515
-- 
Your team curtin developers is requested to review the proposed merge of ~mwhudson/curtin:lp-1895192 into curtin:master.
diff --git a/curtin/commands/curthooks.py b/curtin/commands/curthooks.py
index 1ab2431..9d980b7 100644
--- a/curtin/commands/curthooks.py
+++ b/curtin/commands/curthooks.py
@@ -1145,28 +1145,7 @@ def detect_and_handle_multipath(cfg, target, osfamily=DISTROS.debian):
             raise ValueError(
                     'Unknown grub_cfg mapping for distro: %s' % osfamily)
 
-        if mp_supported:
-            # if root is on lvm, emit a multipath filter to lvm
-            lvmfilter = lvm.generate_multipath_dm_uuid_filter()
-            # lvm.conf device section indents config by 8 spaces
-            indent = ' ' * 8
-            mpfilter = '\n'.join([
-                indent + ('# Modified by curtin for multipath '
-                          'device %s' % (mpname)),
-                indent + lvmfilter])
-            lvmconf = paths.target_path(target, '/etc/lvm/lvm.conf')
-            orig_content = util.load_file(lvmconf)
-            devices_match = re.search(r'devices\ {',
-                                      orig_content, re.MULTILINE)
-            if devices_match:
-                LOG.debug('Adding multipath filter (%s) to lvm.conf', mpfilter)
-                shutil.move(lvmconf, lvmconf + '.orig-curtin')
-                index = devices_match.end()
-                new_content = (
-                    orig_content[:index] + '\n' + mpfilter + '\n' +
-                    orig_content[index + 1:])
-                util.write_file(lvmconf, new_content)
-        else:
+        if not mp_supported:
             # TODO: fix up dnames without multipath available on host
             msg = '\n'.join([
                 '# Written by curtin for multipath device %s %s' % (mpname,

Follow ups