Resolves: rhbz#1139222
Previously, if a device had a child that was a LUKS device that child was ignored when generating ksdata. What this meant was that that device's format, which was luks, was used in generating the kickstart data.
Now, the LUKSDevice, which contains the format that should appear in the ks output is used. This means that the LUKS format is used to set some ks data, but the mountpoint and so forth are overwritten with the correct values when the format on the LUKSDevice is used to populate those values.
The --passphrase option with passphrase continues to not appear in the output anaconda-ks.cfg file.
Signed-off-by: mulhern amulhern@redhat.com
From: mulhern amulhern@redhat.com
Resolves: rhbz#1139222
Previously, if a device had a child that was a LUKS device that child was ignored when generating ksdata. What this meant was that that device's format, which was luks, was used in generating the kickstart data.
Now, the LUKSDevice, which contains the format that should appear in the ks output is used. This means that the LUKS format is used to set some ks data, but the mountpoint and so forth are overwritten with the correct values when the format on the LUKSDevice is used to populate those values.
The --passphrase option with passphrase continues to not appear in the output anaconda-ks.cfg file.
Signed-off-by: mulhern amulhern@redhat.com --- blivet/blivet.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/blivet/blivet.py b/blivet/blivet.py index dfc2213..0db833c 100644 --- a/blivet/blivet.py +++ b/blivet/blivet.py @@ -1775,6 +1775,11 @@ def updateKSData(self): if self.doAutoPart: return
+ self._updateCustomStorageKSData() + + def _updateCustomStorageKSData(self): + """ Update KSData for custom storage. """ + # custom storage ksMap = {PartitionDevice: ("PartData", "partition"), TmpFSDevice: ("PartData", "partition"), @@ -1786,6 +1791,10 @@ def updateKSData(self): # make a list of ancestors of all used devices devices = list(set(a for d in list(self.mountpoints.values()) + self.swaps for a in d.ancestors)) + + # devices which share information with their distinct raw device + complementary_devices = [d for d in devices if d.raw_device is not d] + devices.sort(key=lambda d: len(d.ancestors)) for device in devices: cls = next((c for c in ksMap if isinstance(device, c)), None) @@ -1798,6 +1807,14 @@ def updateKSData(self): cls = getattr(self.ksdata, class_attr) data = cls() # all defaults
+ complements = [d for d in complementary_devices if d.raw_device is device] + + if len(complements) > 1: + log.warning("omitting ksdata for %s, found too many (%d) complementary devices", device, len(complements)) + continue + + device = complements[0] if complements else device + device.populateKSData(data)
parent = getattr(self.ksdata, list_attr)
Previously acked: #101
Closed.
anaconda-patches@lists.fedorahosted.org