3 # usage: make-release commit (e.g. kvm-44)
4 # make-release snapshot
5 # make-release name kernel-commit user-commit
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)"
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"
41 (cd "$udir"; git archive
--format=tar --prefix="$name"/ "$ucommit") |
tar x
44 kernel: $(cd "$kdir"; git rev-parse "$kcommit")
45 userspace: $(cd "$udir"; git rev-parse "$ucommit")
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")
56 paths
+=(include
/linux
/"$file")
58 for arch
in "${archs[@]}"; do
59 paths
+=(arch
/"$arch"/kvm
)
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
76 /^[^\/]*\/kernel\// { x=1 }
77 /^[^\/]*\/kernel\/include/ { x=0 }
78 /^[^\/]*\/kernel\/include-compat/ { x=1 }
84 tar czf
"$tarball" "$name"
85 tar czf
"$utarball" --exclude-from=<(just_userspace
) \
86 --transform="s,$name/,$uname/," "$name"
88 --transform="s,$name/kernel/,$kname/," "$name/kernel"
90 if [[ "$name" = kvm-snapshot-
* ]]; then
91 mv "$tarball" "${snapshot_dir}"
92 elif [[ -n "$formal" ]]; then