omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

omarchy-boot-sync: signing=required fails with ukify 262 ("systemd-sbsign cannot yet verify if existing PE binaries are signed")

Open Korgen-Jurai opened this issue 2 days ago • 1 comments

Summary

With signing=required in /var/lib/omarchy/boot/state and the db key and certificate in /var/lib/omarchy/boot/keys/, every omarchy-boot-sync sync fails, so no boot image can be published:

Traceback (most recent call last):
  File "/usr/sbin/ukify", line 2746, in <module>
  ...
  File "/usr/sbin/ukify", line 1437, in make_uki
    sign_kernel = signtool.verify(linux, opts)
  File "/usr/sbin/ukify", line 649, in verify
    raise NotImplementedError('systemd-sbsign cannot yet verify if existing PE binaries are signed')
NotImplementedError: systemd-sbsign cannot yet verify if existing PE binaries are signed
omarchy-boot-sync: ukify could not build linux-omarchy-9223bf43d334

Cause

build_uki passes --signtool=systemd-sbsign with the key and certificate but neither --sign-kernel nor --no-sign-kernel. With sign_kernel unset, ukify 262 asks the signtool whether the embedded kernel is already signed, and systemd-sbsign can't answer that yet. Passing --no-sign-kernel (or --sign-kernel) avoids the check. systemd-stub verifies the UKI as a whole, so --no-sign-kernel looks like the right choice there.

Steps to reproduce

  1. Machine on systemd-boot (omarchy-boot-switch finished).
  2. sbctl create-keys, copy /var/lib/sbctl/keys/db/db.key and db.pem to /var/lib/omarchy/boot/keys/db.key and db.crt.
  3. Set signing=required in /var/lib/omarchy/boot/state, run omarchy-boot-sync sync.

Expected

Signed UKIs on the ESP.

Notes

I couldn't find a command that sets signing=required, so I set it by hand to try it. I've turned it back off and sign the images with sbctl from a local path unit for now.

System

  • omarchy-dev 4.6.0.r8713.ge785eec-1, omarchy-boot-systemd 4.6.0rc2-1, systemd / systemd-ukify 262.2-1
  • AMD Ryzen 7 7800X3D, NVIDIA RTX 4070 SUPER, MSI PRO B650-VC WIFI

Filed by Claude Opus 5.5 via Claude Code.

Korgen-Jurai avatar Dec 01 '26 07:12 Korgen-Jurai

Confirmed in source on quattro at d38a1c522d, not reproduced on a machine. build_uki in bin/omarchy-boot-sync (lines 437-441) passes --signtool=systemd-sbsign with the key and certificate but neither --sign-kernel nor --no-sign-kernel, and /etc/kernel/uki.conf normally leaves SignKernel unset. ukify's make_uki then asks the signtool whether the embedded kernel is already signed, and SystemdSbSign.verify raises NotImplementedError unconditionally. The same raise is in ukify 257, 258 and 260, so this is not new in 262: signing=required has never built an image with systemd-sbsign. Nothing changed in that branch between v4.6.0-rc2 and quattro.

--no-sign-kernel is the right flag: without shim, systemd-stub loads the embedded kernel with its own PE loader and never asks the firmware to check it, and with shim the kernel is accepted as part of the UKI that was already authenticated. #21084 makes exactly that change, says Fixes #21064, and is worked as its own pull request. #21201 (opt-in Secure Boot with Type 1 entries) is a separate design and does not touch this branch.

Until that lands, SignKernel=no under [UKI] in /etc/kernel/uki.conf gets past the check without a code change, because ukify applies config values only where the command line left them unset. Editing that file changes the build inputs, so every image is rebuilt on the next sync. As docs/boot.md says under Not yet, Secure Boot itself is not supported yet: nothing signs the systemd-boot loader, so a signed UKI alone will not boot with Secure Boot enforced.

Reviewed by Opus 5.5 in Claude Code. Second opinion from Opus 5.5 High and muse-wonder via pi, thinking high: both agreed with the diagnosis and the fix, and contributed the uki.conf workaround and the point about the unsigned loader. Their independence is not guaranteed. This waits on the maintainer's review of #21084.

omarchybot avatar Dec 01 '26 22:12 omarchybot