[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] Support discovery of preexisting rootfs on LV.



Add another pass at opening encrypted devices after starting RAID and LVM so that we can see what's on encrypted high-level devices. Also look for the correct key in the encryptedDevices dict when checking for encryption info.
---
 partedUtils.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/partedUtils.py b/partedUtils.py
index 4c050ef..6cb4830 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -809,6 +809,11 @@ class DiskSet:
 	lvm.vgscan()
 	lvm.vgactivate()
 
+        for dev, crypto in self.anaconda.id.partitions.encryptedDevices.items():
+            # FIXME: order these so LVM and RAID always work on the first try
+            if crypto.openDevice():
+                log.error("failed to open encrypted device %s" % (dev,))
+
         for (vg, lv, size, lvorigin) in lvm.lvlist():
             if lvorigin:
                 continue
@@ -816,7 +821,8 @@ class DiskSet:
             found = 0
             theDev = dev
             node = "%s/%s" % (vg, lv)
-            crypto = self.anaconda.id.partitions.encryptedDevices.get(node)
+            dmnode = "mapper/%s-%s" % (vg, lv)
+            crypto = self.anaconda.id.partitions.encryptedDevices.get(dmnode)
             if crypto and not crypto.openDevice():
                 theDev = "/dev/%s" % (crypto.getDevice(),)
             elif crypto:
-- 
1.5.4.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]