summaryrefslogtreecommitdiffstats
path: root/fsset.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-06-29 21:03:26 +0000
committerJeremy Katz <katzj@redhat.com>2003-06-29 21:03:26 +0000
commit79c97fcdf4b7e01856b3cede6036d87e05b1b091 (patch)
tree838e51a6e16e73e54e72fefebf9dc533cb98b404 /fsset.py
parent8a38c76f2b93138a6e00dc70da0e2204ad93d6b0 (diff)
downloadanaconda-79c97fcdf4b7e01856b3cede6036d87e05b1b091.tar.gz
anaconda-79c97fcdf4b7e01856b3cede6036d87e05b1b091.tar.xz
anaconda-79c97fcdf4b7e01856b3cede6036d87e05b1b091.zip
if there is already a label on the disk, use it instead of making up our
own new one (#92100)
Diffstat (limited to 'fsset.py')
-rw-r--r--fsset.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/fsset.py b/fsset.py
index 3fbf5b69d..c0a83591e 100644
--- a/fsset.py
+++ b/fsset.py
@@ -1224,7 +1224,10 @@ class FileSystemSet:
sys.exit(0)
def labelEntry(self, entry, chroot):
- if entry.device.doLabel is not None:
+ label = entry.device.getLabel()
+ if label:
+ entry.setLabel(label)
+ elif entry.device.doLabel is not None:
entry.fsystem.labelDevice(entry, chroot)
def formatEntry(self, entry, chroot):
@@ -1629,6 +1632,12 @@ class Device:
def getName(self):
return self.__class__.__name__
+ def getLabel(self):
+ try:
+ return isys.readExt2Label(self.setupDevice(), makeDevNode = 0)
+ except:
+ return ""
+
class DevDevice(Device):
"""Device with a device node rooted in /dev that we just always use
the pre-created device node for."""