2 Commits

Author SHA1 Message Date
zj
5118eae42c fix 2026-01-13 21:14:30 +08:00
zj
845c24cf10 bootloader: Correct a logic error preventing installation on a BIOS-only system
efi_directory is always set to a value (defaults to /boot/efi) even on a BIOS/CSM/Legacy-only system.
The function is guarded elsewhere to prevent installation of a bios bootloader on UEFI.
2025-12-29 13:46:50 +08:00
2 changed files with 3 additions and 10 deletions

View File

@@ -4,7 +4,7 @@
_pkgname="calamares" _pkgname="calamares"
pkgname="$_pkgname" pkgname="$_pkgname"
pkgver=3.4.2 pkgver=3.4.2
pkgrel=1 pkgrel=2
pkgdesc="Distribution-independent installer framework" pkgdesc="Distribution-independent installer framework"
url="https://codeberg.org/Calamares/calamares" url="https://codeberg.org/Calamares/calamares"
license=("GPL-3.0-or-later") license=("GPL-3.0-or-later")
@@ -28,7 +28,7 @@ makedepends=(
_pkgsrc="$_pkgname" _pkgsrc="$_pkgname"
_pkgext="tar.gz" _pkgext="tar.gz"
source=("calamares.zip") source=("calamares.zip")
sha256sums=('9d59a1e630f7ee99b9668b8356f8ab0fe152092ca2d4f01e4c86d79819b414b8') sha256sums=('57b3b36d8cf67393ee8e81871106b2f4a5925c120173f92c6d77c8f6003f79d5')
build() { build() {
local _skip_modules=( local _skip_modules=(

View File

@@ -639,12 +639,7 @@ def run_grub_install(fw_type, partitions, efi_directory, install_hybrid_grub):
"--force"]) "--force"])
else: else:
libcalamares.utils.debug("run_grub_install------else bios 1") if libcalamares.globalstorage.value("bootLoader") is None and install_hybrid_grub:
if efi_directory is not None and not install_hybrid_grub:
libcalamares.utils.warning(_("Cannot install BIOS bootloader on UEFI installation when install_hybrid_grub is 'False'!"))
if libcalamares.globalstorage.value("bootLoader") is None:
efi_install_path = libcalamares.globalstorage.value("efiSystemPartition") efi_install_path = libcalamares.globalstorage.value("efiSystemPartition")
if efi_install_path is None or efi_install_path == "": if efi_install_path is None or efi_install_path == "":
efi_install_path = "/boot/efi" efi_install_path = "/boot/efi"
@@ -655,7 +650,6 @@ def run_grub_install(fw_type, partitions, efi_directory, install_hybrid_grub):
return return
boot_loader_install_path = "/dev/" + boot_loader_install_path.split("\n")[1] boot_loader_install_path = "/dev/" + boot_loader_install_path.split("\n")[1]
else: else:
libcalamares.utils.debug("run_grub_install------else bios 1-1 ")
boot_loader = libcalamares.globalstorage.value("bootLoader") boot_loader = libcalamares.globalstorage.value("bootLoader")
boot_loader_install_path = boot_loader["installPath"] boot_loader_install_path = boot_loader["installPath"]
libcalamares.utils.debug(f"boot_loader_install_path: {boot_loader_install_path}") libcalamares.utils.debug(f"boot_loader_install_path: {boot_loader_install_path}")
@@ -666,7 +660,6 @@ def run_grub_install(fw_type, partitions, efi_directory, install_hybrid_grub):
# boot_loader_install_path points to the physical disk to install GRUB # boot_loader_install_path points to the physical disk to install GRUB
# to. It should start with "/dev/", and be at least as long as the # to. It should start with "/dev/", and be at least as long as the
# string "/dev/sda". # string "/dev/sda".
libcalamares.utils.debug("run_grub_install------else bios 2")
if not boot_loader_install_path.startswith("/dev/") or len(boot_loader_install_path) < 8: if not boot_loader_install_path.startswith("/dev/") or len(boot_loader_install_path) < 8:
raise ValueError(f"boot_loader_install_path contains unexpected value '{boot_loader_install_path}'") raise ValueError(f"boot_loader_install_path contains unexpected value '{boot_loader_install_path}'")