patches and low-level development discussion
 help / color / mirror / code / Atom feed
blob ecedb6bea6bf29c7a7303dc9062fe12b5c7a9fbd 1373 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
 
# 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"
  ''
) (_: {})

debug log:

solving ecedb6b ...
found ecedb6b in https://spectrum-os.org/git/spectrum

(*) 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/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock

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