4 kerneldir
=/lib
/modules
/$
(uname
-r)/build
17 # don't use uname if kerneldir is set
19 if [ -z "TMPDIR" ] ; then
23 if [ ! -e kernel
/Makefile
]; then
32 --arch=ARCH architecture to compile for ($arch)
33 --cross-prefix=PREFIX prefix for cross compile
34 --prefix=PREFIX where to install things ($prefix)
35 --with-patched-kernel don't use external module
36 --with-kvm-trace Enable kvm_trace
37 --kerneldir=DIR kernel build directory ($kerneldir)
38 --qemu-cflags=CFLAGS CFLAGS to add to qemu configuration
39 --qemu-ldflags=LDFLAGS LDFLAGS to add to qemu configuration
41 Any additional option is given to qemu's configure verbatim; including:
45 .
/configure
--help |
egrep "enable-|disable-" \
46 |
grep -v user |
grep -v system |
grep -v kqemu |
grep -v kvm \
48 |
sed -e"s/ enable/enable/g" |
sed -e "s/ disable/disable/g"
52 while [[ "$1" = -* ]]; do
56 if [[ "$opt" = *=* ]]; then
69 --with-patched-kernel)
91 qemu_opts
=("${qemu_opts[@]}" "$opt${hasarg:+=$arg}")
98 libkvm_kerneldir
=$
(readlink
-f kernel
)
102 arch
=${arch/#i?86/i386}
103 target_exec
="x86_64-softmmu"
104 qemu_cflags
="$qemu_cflags -DCONFIG_X86"
107 target_exec
="ia64-softmmu"
110 target_exec
="ppcemb-softmmu"
111 qemu_cflags
="$qemu_cflags -I $PWD/libfdt"
112 qemu_ldflags
="$qemu_ldflags -L $PWD/libfdt"
119 #configure kernel module
120 [ -e kernel
/Makefile
] && (cd kernel
;
122 --kerneldir="$kerneldir" \
124 $
([ -z ${want_module} ] && echo "--with-patched-kernel") \
125 ${cross_prefix:+"--cross-prefix=$cross_prefix"} \
126 ${kvm_trace:+"--with-kvm-trace"}
130 (cd user
; .
/configure
--prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
131 --arch="$arch" --processor="$processor" \
132 ${cross_prefix:+"--cross-prefix=$cross_prefix"})
135 (cd qemu
; .
/configure
--target-list=$target_exec \
137 --extra-cflags="-I $PWD/../libkvm $qemu_cflags" \
138 --extra-ldflags="-L $PWD/../libkvm $qemu_ldflags" \
139 --kerneldir="$libkvm_kerneldir" \
141 ${cross_prefix:+"--cross-prefix=$cross_prefix"} \
142 ${cross_prefix:+"--cpu=$arch"} "${qemu_opts[@]}"
146 cat <<EOF > config.mak
151 KERNELSOURCEDIR=$kernelsourcedir
152 LIBKVM_KERNELDIR=$libkvm_kerneldir
153 WANT_MODULE=$want_module
154 CROSS_COMPILE=$cross_prefix
157 OBJCOPY=$cross_prefix$objcopy