Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rescue: Don't allow to mount systems without a root device #5409

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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