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

Adding a safeguard for UEFI/legacy config switch #163

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tescande
Copy link

@tescande tescande commented Aug 7, 2024

Following issue #11, this series adds checks on the current installation and existing backups to not proposed them for upgrade and/or restore if their boot mode (UEFI/legacy) differs from the installer one. To achieve this, a helper function is_rootf_uefi() is added.

This function searches for the /boot/efi mount point in the /etc/fstab
file of the mount point directory passed as parameter and returns True
if present, False otherwise.

This will allow to check that an existing installation or backup boot
mode matches with the installer boot mode.

Signed-off-by: Thierry Escande <[email protected]>
This patch checks the boot mode of an existing backups and disallows its
restoration if it differs from the installer one. This uses the new
helper function is_rootf_uefi().

Signed-off-by: Thierry Escande <[email protected]>
This patch checks that the current installation is not proposed as
upgradeable if its boot mode differs from the installer one. This uses
the helper function is_rootfs_uefi().

Signed-off-by: Thierry Escande <[email protected]>
@rosslagerwall
Copy link
Collaborator

rosslagerwall commented Aug 8, 2024

Why block changing the boot mode while upgrading? In principle, there should be no issue with it since the bootloader is reinstalled.

@tescande
Copy link
Author

tescande commented Aug 8, 2024

This is what the installer already does in partitionTargetDisk() but a few steps later. So the goal is to not propose an existing installation for upgrade if boot modes mismatch since this will fail anyway with an error message, which is confusing for users when the upgrade seems to have started.

@ydirson
Copy link
Contributor

ydirson commented Aug 8, 2024

Why block changing the boot mode while upgrading? In principle, there should be no issue with it since the bootloader is reinstalled.

Isn't there some partitioning differences with that, with BIOS installs lacking a /boot/EFI partition?

@tescande tescande changed the title [XS8] Adding a safeguard for UEFI/legacy config switch Adding a safeguard for UEFI/legacy config switch Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants