From: Daan De Meyer Date: Thu, 11 May 2023 11:42:21 +0000 (+0200) Subject: Use /efi as the ESP path when building the image X-Git-Tag: v15~166 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a92c6dd3952a3b9573e54dcd96f982b01e277640;p=thirdparty%2Fmkosi.git Use /efi as the ESP path when building the image We used to use /boot because kernel-install would hardcode it but since we don't use kernel-install anymore, let's use /efi instead. This way, if anyone wants to install grub, they can do so in /boot and package /boot up as an XBOOTLDR partition. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 0efa1adab..ebbbe5ccb 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -399,14 +399,14 @@ def install_boot_loader(state: MkosiState) -> None: f]) with complete_step("Installing boot loader…"): - run(["bootctl", "install", "--root", state.root], env={"SYSTEMD_ESP_PATH": "/boot"}) + run(["bootctl", "install", "--root", state.root], env={"SYSTEMD_ESP_PATH": "/efi"}) if state.config.secure_boot: assert state.config.secure_boot_key assert state.config.secure_boot_certificate with complete_step("Setting up secure boot auto-enrollment…"): - keys = state.root / "boot/loader/keys/auto" + keys = state.root / "efi/loader/keys/auto" keys.mkdir(parents=True, exist_ok=True) # sbsiglist expects a DER certificate. @@ -796,12 +796,12 @@ def install_unified_kernel(state: MkosiState, roothash: Optional[str]) -> None: boot_count = f'+{state.root.joinpath("etc/kernel/tries").read_text().strip()}' if state.config.image_version: - boot_binary = state.root / f"boot/EFI/Linux/{image_id}_{state.config.image_version}{boot_count}.efi" + boot_binary = state.root / f"efi/EFI/Linux/{image_id}_{state.config.image_version}{boot_count}.efi" elif roothash: _, _, h = roothash.partition("=") - boot_binary = state.root / f"boot/EFI/Linux/{image_id}-{kver}-{h}{boot_count}.efi" + boot_binary = state.root / f"efi/EFI/Linux/{image_id}-{kver}-{h}{boot_count}.efi" else: - boot_binary = state.root / f"boot/EFI/Linux/{image_id}-{kver}{boot_count}.efi" + boot_binary = state.root / f"efi/EFI/Linux/{image_id}-{kver}{boot_count}.efi" if state.root.joinpath("etc/kernel/cmdline").exists(): cmdline = [state.root.joinpath("etc/kernel/cmdline").read_text().strip()] @@ -821,7 +821,7 @@ def install_unified_kernel(state: MkosiState, roothash: Optional[str]) -> None: # nul terminators in argv so let's communicate the cmdline via a file instead. state.workspace.joinpath("cmdline").write_text(f"{' '.join(cmdline).strip()}\x00") - stub = state.root / f"lib/systemd/boot/efi/linux{EFI_ARCHITECTURES[state.config.architecture]}.efi.stub" + stub = state.root / f"usr/lib/systemd/boot/efi/linux{EFI_ARCHITECTURES[state.config.architecture]}.efi.stub" if not stub.exists(): die(f"sd-stub not found at /{stub.relative_to(state.root)} in the image") @@ -1539,7 +1539,7 @@ def invoke_repart(state: MkosiState, skip: Sequence[str] = [], split: bool = Fal definitions = state.workspace / "repart-definitions" if not definitions.exists(): definitions.mkdir() - bootdir = state.root.joinpath("boot/EFI/BOOT") + bootdir = state.root.joinpath("efi/EFI/BOOT") # If Bootable=auto and we have at least one UKI and a bootloader, let's generate an ESP partition. add = (state.config.bootable == ConfigFeature.enabled or @@ -1555,7 +1555,7 @@ def invoke_repart(state: MkosiState, skip: Sequence[str] = [], split: bool = Fal [Partition] Type=esp Format=vfat - CopyFiles=/boot:/ + CopyFiles=/efi:/ SizeMinBytes=512M SizeMaxBytes=512M """