patches and low-level development discussion
 help / color / mirror / code / Atom feed
blob a2b47fd050fbf00050473a0d5a1373eb96c341b5 1465 bytes (raw)
name: host/efi.nix 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
 
# SPDX-License-Identifier: EUPL-1.2+
# SPDX-FileCopyrightText: 2021-2024 Alyssa Ross <hi@alyssa.is>
# SPDX-FileCopyrightText: 2025 Demi Marie Obenour <demiobenour@gmail.com>

import ../lib/call-package.nix (
{ bash, callSpectrumPackage, cryptsetup, runCommand
, stdenv, systemdUkify, rootfs
}:
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 bash ];
  __structuredAttrs = true;
  unsafeDiscardReferences = { out = true; };
  dontFixup = true;
  passthru = { inherit systemd; };
  env = {
    DTBS = "${rootfs.kernel}/dtbs";
    KERNEL = kernel;
    INITRAMFS = initramfs;
    ROOTFS = rootfs;
  };
} ''
  read -r roothash < "$ROOTFS/rootfs.verity.roothash"
  { \
      printf "[UKI]\nDeviceTreeAuto="
      if [ -d "$DTBS" ]; then
          find "$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"
  ''
) (_: {})

debug log:

solving a2b47fd050fbf00050473a0d5a1373eb96c341b5 ...
found a2b47fd050fbf00050473a0d5a1373eb96c341b5 in https://inbox.spectrum-os.org/spectrum-devel/20251111-refactor-verity-v3-2-575726639f9e@gmail.com/ ||
	https://inbox.spectrum-os.org/spectrum-devel/20251107-refactor-verity-v2-2-2af58b1a4a87@gmail.com/

applying [1/1] https://inbox.spectrum-os.org/spectrum-devel/20251111-refactor-verity-v3-2-575726639f9e@gmail.com/
diff --git a/host/efi.nix b/host/efi.nix
new file mode 100644
index 0000000000000000000000000000000000000000..a2b47fd050fbf00050473a0d5a1373eb96c341b5

Checking patch host/efi.nix...
Applied patch host/efi.nix cleanly.

skipping https://inbox.spectrum-os.org/spectrum-devel/20251107-refactor-verity-v2-2-2af58b1a4a87@gmail.com/ for a2b47fd050fbf00050473a0d5a1373eb96c341b5
index at:
100644 a2b47fd050fbf00050473a0d5a1373eb96c341b5	host/efi.nix

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

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).