summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-04-03 11:13:44 +0200
committerAlyssa Ross <hi@alyssa.is>2024-04-03 11:13:44 +0200
commitc469267c3006d51b541601fd96a2aa5b8313671b (patch)
treeaca4b43e9ca4a9d7f98a75c4ae3c774b81116c64
parent7b5cf9bccd3e4204a7f3219f26f1dbdacc05f5c8 (diff)
downloadspectrum-c469267c3006d51b541601fd96a2aa5b8313671b.tar
spectrum-c469267c3006d51b541601fd96a2aa5b8313671b.tar.gz
spectrum-c469267c3006d51b541601fd96a2aa5b8313671b.tar.bz2
spectrum-c469267c3006d51b541601fd96a2aa5b8313671b.tar.lz
spectrum-c469267c3006d51b541601fd96a2aa5b8313671b.tar.xz
spectrum-c469267c3006d51b541601fd96a2aa5b8313671b.tar.zst
spectrum-c469267c3006d51b541601fd96a2aa5b8313671b.zip
scripts/dist-cloud-hypervisor.sh: init
I've already been using this to generate the distributions of the last
couple of releases of the Cloud Hypervisor patchset, and it's worked
well so far.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
-rwxr-xr-xscripts/dist-cloud-hypervisor.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/dist-cloud-hypervisor.sh b/scripts/dist-cloud-hypervisor.sh
new file mode 100755
index 0000000..7553e62
--- /dev/null
+++ b/scripts/dist-cloud-hypervisor.sh
@@ -0,0 +1,21 @@
+#!/bin/sh -e
+# SPDX-License-Identifier: Apache-2.0
+# SPDX-FileCopyrightText: 2024 Alyssa Ross <hi@alyssa.is>
+
+if [ $# -gt 1 ]; then
+	echo "Usage: $0 [<patch version>]"
+	exit 1
+fi
+
+version="$(nix-instantiate --eval --json -A cloud-hypervisor.version pkgs | jq -r .)"
+name="cloud-hypervisor-$version-spectrum${2-0}-patches"
+
+dir="$(mktemp -d)"
+trap 'rm -rf -- "$dir"' EXIT
+
+mkdir -p -- "$dir/$name/LICENSES"
+cp -- LICENSES/Apache-2.0.txt LICENSES/LicenseRef-BSD-3-Clause-Google.txt \
+	"$dir/$name/LICENSES"
+cat pkgs/cloud-hypervisor/*.patch > "$dir/$name/cloud-hypervisor.patch"
+cat pkgs/cloud-hypervisor/vhost/*.patch > "$dir/$name/vhost.patch"
+tar -C "$dir" -cf "$name.tar.xz" -- "$name"