def getLabels(self): """Return a list of all of the labels used on partitions.""" labels = {} drives = self.disks.keys() drives.sort() for drive in drives: disk = self.disks[drive] func = lambda part: (part.is_active() and not (part.get_flag(parted.PARTITION_RAID) or part.get_flag(parted.PARTITION_LVM)) and part.fs_type and (part.fs_type.name in ("ext2", "ext3", "xfs"))) parts = filter_partitions(disk, func) for part in parts: node = get_partition_name(part) label = isys.readFSLabel(node) if label: labels[node] = label for dev, devices, level, numActive in DiskSet.mdList: label = isys.readFSLabel(dev) if label: labels[dev] = label return labels
def isEfiSystemPartition(part): if not part.active: return False return (part.disk.type == "gpt" and part.name == "EFI System Partition" and part.getFlag(parted.PARTITION_BOOT) and part.fileSystem.type in ("fat16", "fat32") and isys.readFSLabel(part.getDeviceNodeName()) != "ANACONDA")