kvm: qemu: fix pci_enable_capabilities to set the CAP feature in pci::status
[kvm-userspace.git] / scripts / make-release
blobdbd2ccfe10c666f4cee864669e940e3afa20916a
1 #!/bin/bash -e
3 # usage: make-release commit (e.g. kvm-44)
4 # make-release snapshot
5 # make-release name kernel-commit user-commit
7 name="$1"
8 kcommit="$2"
9 ucommit="$3"
10 formal=""
11 archs=(x86 ia64)
13 # override these in ~/.kvm-release-config
14 release_dir=~/sf-release
15 udir="$(readlink -f "$(dirname "$0")"/..)"
16 kdir="${udir}/linux-2.6"
17 upload() { rsync --progress -h "$tarball" "$ktarball" "$utarball" avik@frs.sourceforge.net:uploads/; }
19 [[ -f ~/.kvm-release-config ]] && . ~/.kvm-release-config
21 [[ "$name" = kvm-* && -z "$kcommit" ]] && formal="1"
23 [[ -z "$name" ]] && { echo no release name; exit 1; }
25 if [[ "$name" == "snapshot" ]]; then
26 name="kvm-snapshot-$(TZ=UTC date +%Y%m%d)"
27 kcommit="HEAD"
28 ucommit="HEAD"
31 [[ -z "$kcommit" ]] && kcommit="$name"
32 [[ -z "$ucommit" ]] && ucommit="$name"
34 tarball="$name.tar.gz"
35 uname="$(echo "$name" | sed s/kvm/qemu-kvm-devel/)"
36 kname="$(echo "$name" | sed s/kvm/kvm-kmod-devel/)"
37 utarball="$uname.tar.gz"
38 ktarball="$kname.tar.gz"
40 cd "${release_dir}"
41 (cd "$udir"; git archive --format=tar --prefix="$name"/ "$ucommit") | tar x
42 cd "$name"
43 cat <<EOF > SOURCES
44 kernel: $(cd "$kdir"; git rev-parse "$kcommit")
45 userspace: $(cd "$udir"; git rev-parse "$ucommit")
46 EOF
48 paths=(drivers/kvm virt/kvm)
49 files=(kvm.h kvm_host.h kvm_para.h kvm_types.h kvm_x86_emulate.h virtext.h svm.h vmx.h)
50 for file in "${files[@]}"; do
51 for arch in "${archs[@]}"; do
52 for variant in include/asm-"$arch" arch/"$arch"/include/asm; do
53 paths+=("$variant"/"$file")
54 done
55 done
56 paths+=(include/linux/"$file")
57 done
58 for arch in "${archs[@]}"; do
59 paths+=(arch/"$arch"/kvm)
60 done
62 (cd "$kdir"; git archive --format=tar --prefix=linux/ "$kcommit" "${paths[@]}") | tar x
64 touch kernel/config.kbuild
65 echo ARCH=ia64 > kernel/config.mak
66 make -C kernel sync LINUX=../linux version="$name"
67 echo ARCH=x86_64 > kernel/config.mak
68 make -C kernel sync LINUX=../linux version="$name"
69 rm -rf kernel/config.mak linux kernel/config.kbuild
70 rm -rf kernel/include/asm kernel/include-compat/asm
71 sed -i "s/kvm-devel/$name/" qemu/configure
73 just_userspace() {
74 find "$name" | awk '
75 { x=0 }
76 /^[^\/]*\/kernel\// { x=1 }
77 /^[^\/]*\/kernel\/include/ { x=0 }
78 /^[^\/]*\/kernel\/include-compat/ { x=1 }
79 x { print } '
82 cd ..
84 tar czf "$tarball" "$name"
85 tar czf "$utarball" --exclude-from=<(just_userspace) \
86 --transform="s,$name/,$uname/," "$name"
87 tar czf "$ktarball" \
88 --transform="s,$name/kernel/,$kname/," "$name/kernel"
90 if [[ "$name" = kvm-snapshot-* ]]; then
91 mv "$tarball" "${snapshot_dir}"
92 elif [[ -n "$formal" ]]; then
93 upload
96 rm -rf "$name"