4 kerneldir
=/lib
/modules
/$
(uname
-r)/build
17 # don't use uname if kerneldir is set
20 if [ -z "TMPDIR" ] ; then
24 if [ ! -e kernel
/Makefile
]; then
33 --arch=ARCH architecture to compile for ($arch)
34 --cross-prefix=PREFIX prefix for cross compile
35 --prefix=PREFIX where to install things ($prefix)
36 --with-patched-kernel don't use external module
37 --with-kvm-trace Enable kvm_trace
38 --kerneldir=DIR kernel build directory ($kerneldir)
39 --qemu-cflags=CFLAGS CFLAGS to add to qemu configuration
40 --qemu-ldflags=LDFLAGS LDFLAGS to add to qemu configuration
42 Any additional option is given to qemu's configure verbatim; including:
46 .
/configure
--help |
egrep "enable-|disable-" \
47 |
grep -v user |
grep -v system |
grep -v kqemu |
grep -v kvm \
49 |
sed -e"s/ enable/enable/g" |
sed -e "s/ disable/disable/g"
53 while [[ "$1" = -* ]]; do
57 if [[ "$opt" = *=* ]]; then
70 --with-patched-kernel)
92 qemu_opts
=("${qemu_opts[@]}" "$opt${hasarg:+=$arg}")
99 libkvm_kerneldir
=$
(readlink
-f kernel
)
103 arch
=${arch/#i?86/i386}
104 target_exec
="x86_64-softmmu"
105 qemu_cflags
="$qemu_cflags -DCONFIG_X86"
108 target_exec
="ia64-softmmu"
111 target_exec
="ppcemb-softmmu"
112 qemu_cflags
="$qemu_cflags -I $PWD/libfdt"
113 qemu_ldflags
="$qemu_ldflags -L $PWD/libfdt"
120 #configure kernel module
121 [[ -n "$want_module" ]] && (cd kernel
;
123 --kerneldir="$kerneldir" \
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