Re: [PATCH rhel5] Find LVs specified by label in /etc/fstab. (#502178)

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

 



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).

+            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

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux