Hi,
On 11/25/2009 04:44 PM, Radek Vykydal wrote:
Hans de Goede wrote:
Hi,
On 11/25/2009 11:26 AM, Radek Vykydal wrote:
I modified patch by Masahiro Matsuya. Tested both for rescue and
upgrade,
both for encrypted/non-encrypted logical volume.
---
partedUtils.py | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/partedUtils.py b/partedUtils.py
index 9c9cd33..1f7238d 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -764,6 +764,32 @@ class DiskSet:
if crypto:
crypto.closeDevice()
+ for (vg, lv, size, lvorigin) in lvm.lvlist():
+ if lvorigin:
+ continue
+ prefix = "/dev/"
+ dev = "%s/%s" % (vg, lv)
+ dmnode = "mapper/%s-%s" % (vg, lv)
I don't think this will work for Volgroups or LV's with a - in their name
(see the current master code for that).
You are right, it won't work for encrypted LVs having '-' in their
name. We are doing this at some more places - (1) the LVs won't
go to list of encrypted devices (partitions.py:215) which is used
in next line (below), (2) won't be discovered by upgrade
(partitions.py:423),
and (3) won't be found as root partitions (partedUtils.py: 860).
I am attaching a patch that should fix it, I tested it for rescue,
upgrade and install. The fix of (2) and (3) is probably not necessary
for this specific bug, they are related to (FIXED in rhel5)
https://bugzilla.redhat.com/show_bug.cgi?id=430907 so
I am not completely sure if it is OK to include them though it seems
safe.
Patch looks good, as whether or not to include them, as we already had
a bug for this (430907), which apparently was not fixed completely, or
we later regressed, I think we should fix this.
You may want to split of the fixing of the 2 cases not introduced by
this patch in a second patch though and refer to bug 430907 in that
commit.
Regards,
Hans
Radek
+ crypto = self.anaconda.id.partitions.encryptedDevices.get(dmnode)
+ if crypto and not crypto.openDevice():
+ dev = crypto.getDevice()
+ found = 0
+ for fs in fsset.getFStoTry(prefix + dev):
+ try:
+ isys.mount(prefix + dev, self.anaconda.rootPath, fs, readOnly = 1)
+ found = 1
+ break
+ except SystemError:
+ pass
+ if found:
+ label = isys.readFSLabel(prefix + dev, makeDevNode = 0)
+ if label:
+ labels[dev] = label
+ isys.umount(self.anaconda.rootPath)
+
+ if crypto:
+ crypto.closeDevice()
+
return labels
def findExistingRootPartitions(self, upgradeany = 0):
Other then that it looks good.
Regards,
Hans
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list