From a5d1af2c2b12982e810874c80a81445badc355cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20Daba=C5=A1inskas?= Date: Tue, 10 Oct 2023 08:11:13 +0100 Subject: [PATCH] [storage] marks actual devices as protected/unprotected (avoids ancestors) As of F39, the protection of the device where live media is located was hardened. This breaks installation for users with single disks who want to boot their live media from an iso file or from a logical volume. This change skips protection/unprotection of the ancestors and works directly on the passed device --- .../modules/storage/devicetree/model.py | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/pyanaconda/modules/storage/devicetree/model.py b/pyanaconda/modules/storage/devicetree/model.py index 38aa16a6b0a..4bb7bf8b6d5 100644 --- a/pyanaconda/modules/storage/devicetree/model.py +++ b/pyanaconda/modules/storage/devicetree/model.py @@ -350,22 +350,16 @@ def protect_devices(self, protected_names): self.protected_devices = protected_names def _mark_protected_device(self, device): - """Mark a device and its ancestors as protected.""" - if not device: - return - - for d in device.ancestors: - log.debug("Marking device %s as protected.", d.name) - d.protected = True + """Mark a device as protected from teardown.""" + if device: + log.debug("Marking device %s as protected.", device.name) + device.protected = True def _mark_unprotected_device(self, device): - """Mark a device and its ancestors as unprotected.""" - if not device: - return - - for d in device.ancestors: - log.debug("Marking device %s as unprotected.", d.name) - d.protected = False + """Mark a device as unprotected from teardown.""" + if device: + log.debug("Marking device %s as unprotected.", device.name) + device.protected = False @property def usable_disks(self):