diff --git a/0003-ukify-omit-.osrel-section-when-os-release-is-empty.patch b/0003-ukify-omit-.osrel-section-when-os-release-is-empty.patch deleted file mode 100644 index 5f4a1dd..0000000 --- a/0003-ukify-omit-.osrel-section-when-os-release-is-empty.patch +++ /dev/null @@ -1,112 +0,0 @@ -From 75890d949f92c412c0936b8536b2e0dc8f7dfb40 Mon Sep 17 00:00:00 2001 -From: Nick Rosbrook -Date: Fri, 19 Dec 2025 11:01:49 -0500 -Subject: [PATCH] ukify: omit .osrel section when --os-release= is empty - -The primary motivation for this is to allow users of ukify to build -UKI-like objects, without having them later be detected as a UKI by -tools like kernel-install and bootctl. - -The common code used by these tools to determine if a PE binary is a UKI -checks that both .osrel and .linux sections are present. Hence, adding -a mechansim to skip .osrel provides a way to avoid being labeled a UKI. ---- - man/ukify.xml | 5 ++++- - src/ukify/test/test_ukify.py | 15 +++++++++++---- - src/ukify/ukify.py | 10 +++++++++- - 3 files changed, 24 insertions(+), 6 deletions(-) - -diff --git a/man/ukify.xml b/man/ukify.xml -index 829761642d..7462c5c92f 100644 ---- a/man/ukify.xml -+++ b/man/ukify.xml -@@ -365,7 +365,10 @@ - The os-release description (the .osrel section). The argument - may be a literal string, or @ followed by a path name. If not specified, the - os-release5 file -- will be picked up from the host system. -+ will be picked up from the host system. If explicitly set to an empty string, the ".osrel" section -+ is omitted from the UKI (this is not recommended in most cases, and causes the resulting artifact -+ to not be recognized as a UKI by other tools like kernel-install -+ and bootctl). - - - -diff --git a/src/ukify/test/test_ukify.py b/src/ukify/test/test_ukify.py -index f75ef0c891..224a38569f 100755 ---- a/src/ukify/test/test_ukify.py -+++ b/src/ukify/test/test_ukify.py -@@ -641,7 +641,7 @@ def test_efi_signing_pesign(kernel_initrd, tmp_path): - - shutil.rmtree(tmp_path) - --def test_inspect(kernel_initrd, tmp_path, capsys): -+def test_inspect(kernel_initrd, tmp_path, capsys, osrel=True): - if kernel_initrd is None: - pytest.skip('linux+initrd not found') - if not shutil.which('sbsign'): -@@ -653,7 +653,7 @@ def test_inspect(kernel_initrd, tmp_path, capsys): - - output = f'{tmp_path}/signed2.efi' - uname_arg='1.2.3' -- osrel_arg='Linux' -+ osrel_arg='Linux' if osrel else '' - cmdline_arg='ARG1 ARG2 ARG3' - - args = [ -@@ -680,8 +680,12 @@ def test_inspect(kernel_initrd, tmp_path, capsys): - - text = capsys.readouterr().out - -- expected_osrel = f'.osrel:\n size: {len(osrel_arg)}' -- assert expected_osrel in text -+ if osrel: -+ expected_osrel = f'.osrel:\n size: {len(osrel_arg)}' -+ assert expected_osrel in text -+ else: -+ assert '.osrel:' not in text -+ - expected_cmdline = f'.cmdline:\n size: {len(cmdline_arg)}' - assert expected_cmdline in text - expected_uname = f'.uname:\n size: {len(uname_arg)}' -@@ -694,6 +698,9 @@ def test_inspect(kernel_initrd, tmp_path, capsys): - - shutil.rmtree(tmp_path) - -+def test_inspect_no_osrel(kernel_initrd, tmp_path, capsys): -+ test_inspect(kernel_initrd, tmp_path, capsys, osrel=False) -+ - @pytest.mark.skipif(not slow_tests, reason='slow') - def test_pcr_signing(kernel_initrd, tmp_path): - if kernel_initrd is None: -diff --git a/src/ukify/ukify.py b/src/ukify/ukify.py -index c98f8e2a5d..b7542c7eca 100755 ---- a/src/ukify/ukify.py -+++ b/src/ukify/ukify.py -@@ -1477,6 +1477,9 @@ def make_uki(opts: UkifyConfig) -> None: - '.profile', - } - -+ if not opts.os_release: -+ to_import.remove('.osrel') -+ - for profile in opts.join_profiles: - pe = pefile.PE(profile, fast_load=True) - prev_len = len(uki.sections) -@@ -2412,7 +2415,12 @@ def finalize_options(opts: argparse.Namespace) -> None: - - opts.os_release = resolve_at_path(opts.os_release) - -- if not opts.os_release and opts.linux: -+ if opts.os_release == '': -+ # If --os-release= with an empty string was passed, treat that as -+ # explicitly disabling the .osrel section, and do not fallback to the -+ # system's os-release files. -+ pass -+ elif opts.os_release is None and opts.linux: - p = Path('/etc/os-release') - if not p.exists(): - p = Path('/usr/lib/os-release') --- -2.52.0 - diff --git a/0004-stub-Fix-NULL-pointer-deref-when-there-are-no-initrd.patch b/0004-stub-Fix-NULL-pointer-deref-when-there-are-no-initrd.patch deleted file mode 100644 index d6f362f..0000000 --- a/0004-stub-Fix-NULL-pointer-deref-when-there-are-no-initrd.patch +++ /dev/null @@ -1,51 +0,0 @@ -From e57e599e6b11039ab6484e5622b3deae20bfd678 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 12 Jan 2026 14:56:36 +0100 -Subject: [PATCH] stub: Fix NULL pointer deref when there are no initrds - -When n_all_initrds == 0, then all_initrds is unmodified from its initial -value of: - - _cleanup_free_ struct iovec *all_initrds = NULL; - -and in the else block of the "if (n_all_initrds > 1)" the NULL is -dereferenced: - - final_initrd = all_initrds[0]; - -Leading to the stub crashing due to a NULL pointer deref. - -Fix this by initializing final_initrd to all 0s and only -running the else block if (n_all_initrds == 1). ---- - src/boot/stub.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/boot/stub.c b/src/boot/stub.c -index 06ecbc7d18..65950262c6 100644 ---- a/src/boot/stub.c -+++ b/src/boot/stub.c -@@ -1302,9 +1302,9 @@ static EFI_STATUS run(EFI_HANDLE image) { - - /* Combine the initrds into one */ - _cleanup_pages_ Pages initrd_pages = {}; -- struct iovec final_initrd; -+ struct iovec final_initrd = {}; - if (n_all_initrds > 1) { -- /* There will always be a base initrd, if this counter is higher, we need to combine them */ -+ /* If there is more then 1 initrd we need to combine them */ - err = combine_initrds(all_initrds, n_all_initrds, &initrd_pages, &final_initrd.iov_len); - if (err != EFI_SUCCESS) - return err; -@@ -1313,7 +1313,7 @@ static EFI_STATUS run(EFI_HANDLE image) { - - /* Given these might be large let's free them explicitly before we pass control to Linux */ - initrds_free(&initrds); -- } else -+ } else if (n_all_initrds == 1) - final_initrd = all_initrds[0]; - - struct iovec kernel = IOVEC_MAKE( --- -2.52.0 - diff --git a/sources b/sources index af6ddf0..323604e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (systemd-259.tar.gz) = ef46b13661df43e3cfbeee1bc22f0b1eb902e8ebe39c19868c465efd08b35a199c2a2cd9d8021a6bc4d692fa0c6e0eab3f13eecd6ce24dde81d3945464a25b50 +SHA512 (systemd-259.1.tar.gz) = 7cbeca5dad6413a876809200583854ddc706b7a69deff958eb1ca1afb726cf4dec014006c10d1945c450b754811d4b95a80fe1778cb3136997f6d11b11c0560e diff --git a/systemd.spec b/systemd.spec index 113eb6f..3b20779 100644 --- a/systemd.spec +++ b/systemd.spec @@ -73,7 +73,7 @@ Url: https://systemd.io # But don't do that on OBS, otherwise the version subst fails, and will be # like 257-123-gabcd257.1 instead of 257-123-gabcd %if %{without obs} -Version: %{?version_override}%{!?version_override:259} +Version: %{?version_override}%{!?version_override:259.1} %else Version: %{?version_override}%{!?version_override:%(cat meson.version)} %endif @@ -153,11 +153,6 @@ Patch: 38769.patch # Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=2415701 Patch: 0002-machined-continue-without-resolve.hook-socket.patch -# 2 patches for https://fedoraproject.org/wiki/Changes/Automatic_DTB_selection_for_aarch64_EFI_systems -# Upstream commit: https://github.com/systemd/systemd/commit/75890d949f92c412c0936b8536b2e0dc8f7dfb40 -Patch: 0003-ukify-omit-.osrel-section-when-os-release-is-empty.patch -# Upstream PR: https://github.com/systemd/systemd/pull/40329 -Patch: 0004-stub-Fix-NULL-pointer-deref-when-there-are-no-initrd.patch %endif %ifarch %{ix86} x86_64 aarch64 riscv64