Skip to content

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.

@rosslagerwall
Copy link
Contributor

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
tescande added 3 commits May 5, 2025 16:12
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 <thierry.escande@vates.tech>
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 <thierry.escande@vates.tech>
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 <thierry.escande@vates.tech>
@ydirson ydirson force-pushed the for-xs/boot-mode-checks branch from 8b47e8f to 296af78 Compare May 5, 2025 15:21
@ydirson
Copy link
Contributor

ydirson commented May 5, 2025

On master this has been superseded by #182, so I'm retargeting this one for xs8 only.

@tescande tescande changed the base branch from master to release/xs8 May 5, 2025 15:24
@tescande tescande changed the title Adding a safeguard for UEFI/legacy config switch [XS8] Adding a safeguard for UEFI/legacy config switch May 5, 2025
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