diff options
author | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-03-07 10:25:55 +0100 |
---|---|---|
committer | lupoDharkael <izhe@hotmail.es> | 2024-03-08 13:03:33 +0100 |
commit | f5501aac91704da4e9b6d7a67633b9e52b48bef7 (patch) | |
tree | 37971800428cdb4360fca06e12dd9c89dd5798cc /src/utils/boot.py | |
parent | 4d4171e45958a50f4317a5add8fdba297e0f3a83 (diff) |
utils: implement linux distro id detection
The OS probe logic must be able to check a distro programmatically,
add get_linux_distro_id to return an id whitout versioning.
Ensure the availability of 'ubuntu' when we need to ensure certain
features are only used with a supported system.
Diffstat (limited to 'src/utils/boot.py')
-rw-r--r-- | src/utils/boot.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/utils/boot.py b/src/utils/boot.py index 15dac7d..07a29ba 100644 --- a/src/utils/boot.py +++ b/src/utils/boot.py @@ -12,7 +12,7 @@ import os import shlex import subprocess -from src.utils.probe import OSFamily, get_os_family +from src.utils.probe import OSFamily, get_os_family, get_linux_distro_id, os_probe from src.utils.disk import get_partition_device, get_efi_partition from src.utils.uefi import * from src.utils.fs import * @@ -23,6 +23,10 @@ def _boot_bios_legacy(disk, part, mountpoint): def _boot_bios_linux(disk, part, mountpoint): logging.info(f'Booting Linux system') + + if not get_linux_distro_id(mountpoint) == 'ubuntu': + raise NotImplementedError(f'{os_probe(mountpoint)} detected, only Ubuntu is supported for legacy BIOS boot') + _boot_bios_legacy(disk, part, mountpoint) def _boot_bios_windows(disk, part, mountpoint): |