Skip to content

Commit

Permalink
Merge pull request #5409 from poncovka/master-rescue_without_root
Browse files Browse the repository at this point in the history
rescue: Don't allow to mount systems without a root device
  • Loading branch information
poncovka authored Jan 22, 2024
2 parents adb164e + a304062 commit 7060784
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pyanaconda/rescue.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,18 @@ def find_roots(self):
task_proxy = STORAGE.get_proxy(task_path)
sync_run_task(task_proxy)

# Collect existing systems.
roots = OSData.from_structure_list(
self._device_tree_proxy.GetExistingSystems()
)

# Ignore systems without a root device.
roots = [r for r in roots if r.get_root_device()]

if not roots:
self.status = RescueModeStatus.ROOT_NOT_FOUND

log.debug("These systems were found: %s", str(roots))
return roots

# TODO separate running post scripts?
Expand Down Expand Up @@ -451,7 +456,7 @@ def refresh(self, args=None):
finish_msg = exit_reboot_msg
else:
finish_msg = ""
text = TextWidget(_("You don't have any Linux partitions.\n") + finish_msg)
text = TextWidget(_("No Linux systems found.\n") + finish_msg)
else:
if self._rescue.reboot:
finish_msg = exit_reboot_msg
Expand Down

0 comments on commit 7060784

Please sign in to comment.