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
45 while [[ "$1" = -* ]]; do
49 if [[ "$opt" = *=* ]]; then
62 --with-patched-kernel)
84 qemu_opts
=("${qemu_opts[@]}" "$opt${hasarg:+=$arg}")
91 libkvm_kerneldir
=$
(readlink
-f kernel
)
95 arch
=${arch/#i?86/i386}
96 target_exec
="x86_64-softmmu"
97 qemu_cflags
="$qemu_cflags -DCONFIG_X86"
100 target_exec
="ia64-softmmu"
103 target_exec
="ppcemb-softmmu"
104 qemu_cflags
="$qemu_cflags -I $PWD/libfdt"
105 qemu_ldflags
="$qemu_ldflags -L $PWD/libfdt"
112 #configure kernel module
113 [ -e kernel
/Makefile
] && (cd kernel
;
115 --kerneldir="$kerneldir" \
117 $
([ -z ${want_module} ] && echo "--with-patched-kernel") \
118 ${cross_prefix:+"--cross-prefix=$cross_prefix"} \
119 ${kvm_trace:+"--with-kvm-trace"}
123 (cd user
; .
/configure
--prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
124 --arch="$arch" --processor="$processor" \
125 ${cross_prefix:+"--cross-prefix=$cross_prefix"})
129 cat <<EOF > config.mak
134 KERNELSOURCEDIR=$kernelsourcedir
135 LIBKVM_KERNELDIR=$libkvm_kerneldir
136 WANT_MODULE=$want_module
137 CROSS_COMPILE=$cross_prefix
140 OBJCOPY=$cross_prefix$objcopy