Skip to content

Commit

Permalink
[storage] marks actual devices as protected/unprotected (avoids ances…
Browse files Browse the repository at this point in the history
…tors)

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
  • Loading branch information
T0MASD committed Oct 10, 2023
1 parent d1e6fea commit a5d1af2
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions pyanaconda/modules/storage/devicetree/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit a5d1af2

Please sign in to comment.