From: Avi Kivity <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>
diff --git a/scripts/make-release b/scripts/make-release
new file mode 100755
index 0000000..246b851
--- /dev/null
+++ b/scripts/make-release
@@ -0,0 +1,82 @@
+#!/bin/bash -e
+
+usage() {
+ echo "usage: $0 [--upload] [--formal] commit [name]"
+ exit 1
+}
+
+[[ -f ~/.kvmreleaserc ]] && . ~/.kvmreleaserc
+
+upload=
+formal=
+
+releasedir=~/sf-release
+[[ -z "$TMP" ]] && TMP="/tmp"
+tmpdir="$TMP/kvm-kmod-make-release.$$"
+while [[ "$1" = -* ]]; do
+ opt="$1"
+ shift
+ case "$opt" in
+ --upload)
+ upload="yes"
+ ;;
+ --formal)
+ formal="yes"
+ ;;
+ *)
+ usage
+ ;;
+ esac
+done
+
+commit="$1"
+name="$2"
+
+if [[ -z "$commit" ]]; then
+ usage
+fi
+
+if [[ -z "$name" ]]; then
+ name="$commit"
+fi
+
+tarball="$releasedir/$name.tar.gz"
+
+cd "$(dirname "$0")"/..
+LINUX="$(readlink -f "linux-2.6")"
+
+kvm_git="$(readlink -f .git)"
+linux_git="$(readlink -f "$LINUX/.git")"
+
+mkdir -p "$tmpdir/$name"
+mkdir -p "$tmpdir/$name/linux-2.6"
+
+files=("arch/*/kvm/*" "virt/kvm" "include/linux/kvm*"
+ "arch/*/include/asm/kvm*" "arch/x86/include/asm/virtext.h"
+ "arch/x86/include/asm/vmx.h" "arch/x86/include/asm/svm.h"
+ )
+
+git --git-dir="$kvm_git" --work-tree="$tmpdir/$name" checkout "$commit" .
+lcommit=($(git --git-dir="$kvm_git" ls-tree "$commit" linux-2.6))
+lcommit="${lcommit[2]}"
+git --git-dir="$linux_git" --work-tree="$tmpdir/$name/linux-2.6" \
+ checkout "$lcommit" "${fil...@]}"
+
+cd "$tmpdir/$name"
+
+make -f sync.mak ARCH_DIR=x86 KVM_VERSION="$name"
+make -f sync.mak ARCH_DIR=ia64 KVM_VERSION="$name"
+
+rm -rf "$tmpdir/$name/linux-2.6"
+
+if [[ -n "$formal" ]]; then
+ echo "$name" > "$tmpdir/$name/KVM_VERSION"
+fi
+
+tar czf "$tarball" -C "$tmpdir" "$name"
+
+rm -rf "$tmpdir"
+
+if [[ -n "$upload" ]]; then
+ rsync --progress -h "$tarball" [email protected]:uploads/
+fi
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html