From: Demi Marie Obenour <demiobenour@gmail.com>
To: Alyssa Ross <hi@alyssa.is>
Cc: Spectrum OS Development <devel@spectrum-os.org>
Subject: Re: [PATCH v6 2/2] Move UKI creation to a separate derivation
Date: Fri, 28 Nov 2025 14:25:28 -0500 [thread overview]
Message-ID: <9115e3f7-1c86-4c10-b62c-1ce4810f3438@gmail.com> (raw)
In-Reply-To: <87bjkmpghj.fsf@alyssa.is>
[-- Attachment #1.1.1: Type: text/plain, Size: 4612 bytes --]
On 11/28/25 06:02, Alyssa Ross wrote:
> Demi Marie Obenour <demiobenour@gmail.com> writes:
>
>> It will be used by the update code later.
>>
>> No functional change intended, other than a trivial shell script
>> refactoring.
>>
>> Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
>> ---
>> I kept release/live/default.nix using the UKI's systemd because the old
>> code did it that way. Changing this would be better in a separate
>> commit.
>>
>> Changes since v5:
>>
>> - Create a temporary symlink named build/spectrum.efi and then run
>> $(MCOPY) -i $@ build/spectrum.efi ::/EFI/Linux, rather than copying
>> the file with its original name. The latter results in an unbootable
>> image. I do not know the reason.
>>
>> Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
>> ---
>> host/efi.nix | 40 ++++++++++++++++++++++++++++++++++++++++
>> release/live/Makefile | 17 ++++-------------
>> release/live/default.nix | 27 +++++++++++----------------
>> release/live/shell.nix | 10 ++++++++--
>> 4 files changed, 63 insertions(+), 31 deletions(-)
>>
>> diff --git a/host/efi.nix b/host/efi.nix
>> new file mode 100644
>> index 0000000000000000000000000000000000000000..ecedb6bea6bf29c7a7303dc9062fe12b5c7a9fbd
>> --- /dev/null
>> +++ b/host/efi.nix
>> @@ -0,0 +1,40 @@
>> +# SPDX-License-Identifier: MIT
>> +# SPDX-FileCopyrightText: 2021-2024 Alyssa Ross <hi@alyssa.is>
>> +# SPDX-FileCopyrightText: 2025 Demi Marie Obenour <demiobenour@gmail.com>
>> +
>> +import ../lib/call-package.nix (
>> +{ callSpectrumPackage, cryptsetup, rootfs
>> +, runCommand, stdenv, systemdUkify
>> +}:
>> +let
>> + initramfs = callSpectrumPackage ./initramfs {};
>> + kernel = "${rootfs.kernel}/${stdenv.hostPlatform.linux-kernel.target}";
>> + systemd = systemdUkify.overrideAttrs ({ mesonFlags ? [], ... }: {
>> + # The default limit is too low to build a generic aarch64 distro image:
>> + # https://github.com/systemd/systemd/pull/37417
>> + mesonFlags = mesonFlags ++ [ "-Defi-stub-extra-sections=3000" ];
>> + });
>> +in
>> +
>> +runCommand "spectrum-efi" {
>> + nativeBuildInputs = [ cryptsetup systemd ];
>> + __structuredAttrs = true;
>> + unsafeDiscardReferences = { out = true; };
>> + dontFixup = true;
>> + passthru = { inherit initramfs rootfs systemd; };
>> +} ''
>> + read -r roothash < ${rootfs}/rootfs.verity.roothash
>> + { \
>> + printf "[UKI]\nDeviceTreeAuto="
>> + if [ -d ${rootfs.kernel}/dtbs ]; then
>> + find ${rootfs.kernel}/dtbs -name '*.dtb' -print0 | tr '\0' ' '
>> + fi
>> + } | ukify build \
>> + --output "$out" \
>> + --config /dev/stdin \
>> + --linux ${kernel} \
>> + --initrd ${initramfs} \
>> + --os-release $'NAME="Spectrum"\n' \
>> + --cmdline "ro intel_iommu=on roothash=$roothash"
>> + ''
>> +) (_: {})
>> diff --git a/release/live/Makefile b/release/live/Makefile
>> index ba81c7e679429e045b24c1591a9f0b72f016cfab..b37ccce42feb3ac7e8ce4faf96a67902b55be808 100644
>> --- a/release/live/Makefile
>> +++ b/release/live/Makefile
>> @@ -19,22 +19,13 @@ $(dest): ../../scripts/format-uuid.sh ../../scripts/make-gpt.sh ../../scripts/sf
>> build/empty:
>> mkdir -p $@
>>
>> -build/spectrum.efi: $(DTBS) $(KERNEL) $(INITRAMFS) $(ROOT_FS_VERITY_ROOTHASH)
>> - { \
>> - printf "[UKI]\nDeviceTreeAuto=" && \
>> - find $(DTBS) -name '*.dtb' -print0 | tr '\0' ' ' ;\
>> - } | $(UKIFY) build \
>> - --output $@ \
>> - --config /dev/stdin \
>> - --linux $(KERNEL) \
>> - --initrd $(INITRAMFS) \
>> - --os-release $$'NAME="Spectrum"\n' \
>> - --cmdline "ro intel_iommu=on roothash=$$(cat $(ROOT_FS_VERITY_ROOTHASH))"
>> -
>> -build/boot.fat: $(SYSTEMD_BOOT_EFI) build/spectrum.efi
>> +build/boot.fat: $(SYSTEMD_BOOT_EFI) $(EFI_IMAGE) build/empty
>
> Why add a build/empty dependency? It doesn't seem to be used for
> anything any more? (Neither does the DTBS variable, actually.)
The temporary symlink bodge below. build/empty isn't needed, but
build is. DTBS can just be deleted.
>> $(TRUNCATE) -s 440401920 $@
>> $(MKFS_FAT) $@
>> $(MMD) -i $@ ::/EFI ::/EFI/BOOT ::/EFI/Linux
>> +# This symlink is necessary. Copying $(EFI_IMAGE) directly
>> +# results in an unbootable image. TODO: figure out why.
>> + ln -s $(EFI_IMAGE) build/spectrum.efi
>> $(MCOPY) -i $@ build/spectrum.efi ::/EFI/Linux
>> $(MCOPY) -i $@ $(SYSTEMD_BOOT_EFI) ::/EFI/BOOT/$(EFINAME)
>>
--
Sincerely,
Demi Marie Obenour (she/her/hers)
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 7253 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2025-11-28 19:25 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-05 22:33 [PATCH 0/2] Move verity and EFI creation to separate Nix derivations Demi Marie Obenour
2025-11-05 22:33 ` [PATCH 1/2] Create Nix derivation for building verity images Demi Marie Obenour
2025-11-06 10:20 ` Alyssa Ross
2025-11-06 10:55 ` Demi Marie Obenour
2025-11-06 11:44 ` Alyssa Ross
2025-11-07 19:24 ` Demi Marie Obenour
2025-11-13 11:32 ` Alyssa Ross
2025-11-05 22:33 ` [PATCH 2/2] Move UKI creation to a separate derivation Demi Marie Obenour
2025-11-08 4:47 ` [PATCH v2 0/2] Move verity and EFI creation to separate Nix derivations Demi Marie Obenour
2025-11-08 4:47 ` [PATCH v2 1/2] Build verity images in rootfs Nix derivation Demi Marie Obenour
2025-11-08 4:47 ` [PATCH v2 2/2] Move UKI creation to a separate derivation Demi Marie Obenour
2025-11-12 0:59 ` [PATCH v3 0/2] Move verity and EFI creation to separate Nix derivations Demi Marie Obenour
2025-11-12 0:59 ` [PATCH v3 1/2] Build verity images in rootfs Nix derivation Demi Marie Obenour
2025-11-13 11:46 ` Alyssa Ross
2025-11-13 22:33 ` Demi Marie Obenour
2025-11-14 11:53 ` Alyssa Ross
2025-11-12 0:59 ` [PATCH v3 2/2] Move UKI creation to a separate derivation Demi Marie Obenour
2025-11-13 11:57 ` Alyssa Ross
2025-11-13 22:42 ` Demi Marie Obenour
2025-11-14 11:58 ` Alyssa Ross
2025-11-19 8:15 ` [PATCH v4 0/2] Move verity and EFI creation to separate Nix derivations Demi Marie Obenour
2025-11-19 8:15 ` [PATCH v4 1/2] Build verity images in rootfs Nix derivation Demi Marie Obenour
2025-11-25 12:27 ` Alyssa Ross
2025-11-25 12:31 ` Alyssa Ross
2025-11-19 8:15 ` [PATCH v4 2/2] Move UKI creation to a separate derivation Demi Marie Obenour
2025-11-22 1:21 ` [PATCH v5 0/2] Move verity and EFI creation to separate Nix derivations Demi Marie Obenour
2025-11-22 1:21 ` [PATCH v5 1/2] Build verity images in rootfs Nix derivation Demi Marie Obenour
2025-11-25 12:34 ` Alyssa Ross
2025-11-22 1:21 ` [PATCH v5 2/2] Move UKI creation to a separate derivation Demi Marie Obenour
2025-11-25 12:41 ` Alyssa Ross
2025-11-26 19:10 ` [PATCH v6 0/2] Move verity and EFI creation to separate Nix derivations Demi Marie Obenour
2025-11-26 19:10 ` [PATCH v6 1/2] Build verity images in rootfs Nix derivation Demi Marie Obenour
2025-11-27 19:23 ` Alyssa Ross
2025-11-26 19:10 ` [PATCH v6 2/2] Move UKI creation to a separate derivation Demi Marie Obenour
2025-11-28 10:47 ` Alyssa Ross
2025-11-28 19:27 ` Demi Marie Obenour
2025-11-28 11:02 ` Alyssa Ross
2025-11-28 19:25 ` Demi Marie Obenour [this message]
2025-11-28 20:12 ` Alyssa Ross
2025-11-26 18:58 ` [PATCH v5 0/2] Move verity and EFI creation to separate Nix derivations Demi Marie Obenour
2025-11-26 18:58 ` [PATCH v5 1/2] Build verity images in rootfs Nix derivation Demi Marie Obenour
2025-11-26 18:58 ` [PATCH v5 2/2] Move UKI creation to a separate derivation Demi Marie Obenour
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9115e3f7-1c86-4c10-b62c-1ce4810f3438@gmail.com \
--to=demiobenour@gmail.com \
--cc=devel@spectrum-os.org \
--cc=hi@alyssa.is \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://spectrum-os.org/git/crosvm
https://spectrum-os.org/git/doc
https://spectrum-os.org/git/mktuntap
https://spectrum-os.org/git/nixpkgs
https://spectrum-os.org/git/spectrum
https://spectrum-os.org/git/ucspi-vsock
https://spectrum-os.org/git/www
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).