patches and low-level development discussion
 help / color / mirror / code / Atom feed
blob 18a91ac1eea56e9b2a941eb08244b3dee613b721 1134 bytes (raw)
name: release/update.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
 
# 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, config, runCommand, stdenv }:

let
  efi = import ../host/efi.nix {};
in
runCommand "spectrum-update-directory" {
  __structuredAttrs = true;
  unsafeDiscardReferences = { out = true; };
  dontFixup = true;
  env = { VERSION = config.version; };
} ''
  # stdenv sets -eo pipefail, but not -u
  set -u
  mkdir -- "$out"
  cd -- "$out"
  read -r roothash < ${efi.rootfs}/rootfs.verity.roothash
  if ! [[ "$roothash" =~ ^[0-9a-f]{64}$ ]]; then
    printf 'Internal error: bad root hash %q\n' "$roothash"
    exit 1
  fi
  cp -- ${efi} "Spectrum_$VERSION.efi"
  cp -- ${efi.rootfs}/rootfs.verity.superblock "Spectrum_''${VERSION}_''${roothash:32:32}.verity"
  cp -- ${efi.rootfs}/rootfs "Spectrum_''${VERSION}_''${roothash:0:32}.root"
  sha256sum -b "Spectrum_$VERSION.efi" \
    "Spectrum_''${VERSION}_''${roothash:32:32}.verity" \
    "Spectrum_''${VERSION}_''${roothash:0:32}.root" > SHA256SUMS
  ''
) (_: {})

debug log:

solving 18a91ac1eea56e9b2a941eb08244b3dee613b721 ...
found 18a91ac1eea56e9b2a941eb08244b3dee613b721 in https://inbox.spectrum-os.org/spectrum-devel/20251129-updates-v6-5-9edb87a2e509@gmail.com/ ||
	https://inbox.spectrum-os.org/spectrum-devel/20251126-updates-v4-10-40c438d2dcaf@gmail.com/ ||
	https://inbox.spectrum-os.org/spectrum-devel/20251126-updates-v5-10-fd746748febd@gmail.com/

applying [1/1] https://inbox.spectrum-os.org/spectrum-devel/20251129-updates-v6-5-9edb87a2e509@gmail.com/
diff --git a/release/update.nix b/release/update.nix
new file mode 100644
index 0000000000000000000000000000000000000000..18a91ac1eea56e9b2a941eb08244b3dee613b721

Checking patch release/update.nix...
Applied patch release/update.nix cleanly.

skipping https://inbox.spectrum-os.org/spectrum-devel/20251126-updates-v4-10-40c438d2dcaf@gmail.com/ for 18a91ac1eea56e9b2a941eb08244b3dee613b721
skipping https://inbox.spectrum-os.org/spectrum-devel/20251126-updates-v5-10-fd746748febd@gmail.com/ for 18a91ac1eea56e9b2a941eb08244b3dee613b721
index at:
100644 18a91ac1eea56e9b2a941eb08244b3dee613b721	release/update.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).