patches and low-level development discussion
 help / color / mirror / code / Atom feed
blob d2c1e5fcb35b37c7ed8a173f19b97894a36a7f0c 1504 bytes (raw)
name: vm/app/updates.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
 
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: 2023 Alyssa Ross <hi@alyssa.is>
# SPDX-FileCopyrightText: 2025 Demi Marie Obenour <demiobenour@gmail.com>

import ../../lib/call-package.nix (
{ callSpectrumPackage, config, curl, lib, src
, runCommand, systemd, writeScript
}:

let
  update-url = config.update-url;
  mountpoint = "/run/virtiofs/virtiofs0";
  sysupdate-path = "${systemd}/lib/systemd/systemd-sysupdate";
  runner = writeScript "update-run-script"
    ''
    #!/usr/bin/execlineb -P
    if { mount -toverlay -olowerdir=${mountpoint}/etc:/etc -- overlay /etc }
    envfile ${mountpoint}/etc/url-env
    importas -i update_url UPDATE_URL
    if { ${sysupdate-path} update }
    if { ${curl}/bin/curl -L --proto =http,https
       -o ${mountpoint}/updates/SHA256SUMS.gpg ''${update_url}/SHA256SUMS.gpg }
    # systemd-sysupdate recently went from needing SHA256SUMS.gpg to SHA256SUMS.sha256.asc.
    # I (Demi) have no need if this is intentional or a bug.  I also have no idea if this
    # behavior will stay unchanged in the future.  Therefore, create both files and let
    # systemd-sysupdate ignore the one it isn't interested in.
    if { ln -f ${mountpoint}/updates/SHA256SUMS.gpg ${mountpoint}/updates/SHA256SUMS.sha256.asc }
    ${curl}/bin/curl -L --proto =http,https
       -o ${mountpoint}/updates/SHA256SUMS ''${update_url}/SHA256SUMS
    '';
in

callSpectrumPackage ../make-vm.nix {} {
  providers.net = [ "sys.netvm" ];
  type = "nix";
  run = "${runner}";
}) (_: {})

debug log:

solving d2c1e5fcb35b37c7ed8a173f19b97894a36a7f0c ...
found d2c1e5fcb35b37c7ed8a173f19b97894a36a7f0c in https://inbox.spectrum-os.org/spectrum-devel/20251112-updates-v2-6-88d96bf81b79@gmail.com/

applying [1/1] https://inbox.spectrum-os.org/spectrum-devel/20251112-updates-v2-6-88d96bf81b79@gmail.com/
diff --git a/vm/app/updates.nix b/vm/app/updates.nix
new file mode 100644
index 0000000000000000000000000000000000000000..d2c1e5fcb35b37c7ed8a173f19b97894a36a7f0c

Checking patch vm/app/updates.nix...
Applied patch vm/app/updates.nix cleanly.

index at:
100644 d2c1e5fcb35b37c7ed8a173f19b97894a36a7f0c	vm/app/updates.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).