From 3169218ae97c7c438c8affa5627d6684894bf11f Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 28 Aug 2024 11:57:41 +0200 Subject: [PATCH] Always build ukify package Even on non-uefi architectures, ukify can be used to build UKIs for UEFI images. For example, mkosi can use it to build UKIs on s390x. To enable this use case, let's always build ukify, but with a conditional dependency on systemd-boot only on arches that support UEFI. (cherry picked from commit a67221c3f0d0b81b9b5b3230a71d09044342f1a4) Resolves: RHEL-52634 --- split-files.py | 2 +- systemd.spec | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/split-files.py b/split-files.py index 7bdd2ed..5337c1a 100644 --- a/split-files.py +++ b/split-files.py @@ -228,6 +228,6 @@ for file in files(buildroot): if [print(f'ERROR: no file names were written to {o.name}') for name, o in outputs.items() if (o.tell() == 0 and - not (no_bootloader and name in ('ukify', 'boot'))) + not (no_bootloader and name == 'boot')) ]: sys.exit(1) diff --git a/systemd.spec b/systemd.spec index eb95b43..9cf17b1 100644 --- a/systemd.spec +++ b/systemd.spec @@ -512,12 +512,16 @@ This package also provides systemd-timesyncd, a network time protocol daemon. It also contains tools to manage encrypted home areas and secrets bound to the machine, and to create or grow partitions and make file systems automatically. -%if 0%{?want_bootloader} %package ukify Summary: Tool to build Unified Kernel Images Requires: %{name} = %{version}-%{release} -Requires: systemd-boot +Requires: (systemd-boot if %{shrink:( + filesystem(x86-32) or + filesystem(x86-64) or + filesystem(aarch64) or + filesystem(riscv64) +)}) Requires: python3dist(pefile) Requires: python3dist(zstd) Requires: python3dist(cryptography) @@ -535,6 +539,7 @@ This package provides ukify, a script that combines a kernel image, an initrd, with a command line, and possibly PCR measurements and other metadata, into a Unified Kernel Image (UKI). +%if 0%{?want_bootloader} %package boot-unsigned Summary: UEFI boot manager (unsigned version) @@ -723,10 +728,8 @@ CONFIGURE_OPTS=( # For now, let's build the bootloader in the same places where we # built with gnu-efi. Later on, we might want to extend coverage, but # considering that that support is untested, let's not do this now. - # Note, ukify requires bootloader, let's also explicitly enable/disable it - # here for https://github.com/systemd/systemd/pull/24175. -Dbootloader=%[%{?want_bootloader}?"enabled":"disabled"] - -Dukify=%[%{?want_bootloader}?"enabled":"disabled"] + -Dukify=enabled # RHEL10 bootstrapping -Dstandalone-binaries=false @@ -1099,8 +1102,8 @@ getent passwd systemd-oom &>/dev/null || useradd -r -l -g systemd-oom -d / -s /s %files udev -f .file-list-udev -%if 0%{?want_bootloader} %files ukify -f .file-list-ukify +%if 0%{?want_bootloader} %files boot-unsigned -f .file-list-boot %endif