5 kerneldir
=/lib
/modules
/$
(uname
-r)/build
24 --arch=ARCH architecture to compile for ($arch)
25 --cross-prefix=PREFIX prefix for cross compile
26 --prefix=PREFIX where to install things ($prefix)
27 --with-patched-kernel don't use external module
28 --with-kvm-trace Enable kvm_trace
29 --kerneldir=DIR kernel build directory ($kerneldir)
30 --qemu-cflags=CFLAGS CFLAGS to add to qemu configuration
31 --qemu-ldflags=LDFLAGS LDFLAGS to add to qemu configuration
33 Any additional option is given to qemu's configure verbatim; including:
37 .
/configure
--help |
egrep "enable-|disable-" \
38 |
grep -v user |
grep -v system |
grep -v kqemu |
grep -v kvm \
40 |
sed -e"s/ enable/enable/g" |
sed -e "s/ disable/disable/g"
44 while [[ "$1" = -* ]]; do
48 if [[ "$opt" = *=* ]]; then
60 --with-patched-kernel)
82 qemu_opts
=("${qemu_opts[@]}" "$opt${hasarg:+=$arg}")
89 libkvm_kerneldir
=$
(readlink
-f kernel
)
93 arch
=${arch/#i?86/i386}
94 target_exec
="x86_64-softmmu"
95 qemu_cflags
="$qemu_cflags -DCONFIG_X86"
98 target_exec
="ia64-softmmu"
101 target_exec
="ppcemb-softmmu"
102 qemu_cflags
="$qemu_cflags -I $PWD/libfdt"
103 qemu_ldflags
="$qemu_ldflags -L $PWD/libfdt"
110 # see if we have split build and source directories
111 if [ -d "$kerneldir/include2" ]; then
112 kernelsourcedir
=${kerneldir%/*}/source
116 (cd user
; .
/configure
--prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
117 --arch="$arch" --processor="$processor" \
118 ${cross_prefix:+"--cross-prefix=$cross_prefix"})
121 (cd qemu
; .
/configure
--target-list=$target_exec \
123 --disable-gcc-check \
124 --extra-cflags="-I $PWD/../libkvm $qemu_cflags" \
125 --extra-ldflags="-L $PWD/../libkvm $qemu_ldflags" \
126 --kerneldir="$libkvm_kerneldir" \
128 ${cross_prefix:+"--cross-prefix=$cross_prefix"} \
129 ${cross_prefix:+"--cpu=$arch"} "${qemu_opts[@]}"
133 cat <<EOF > config.mak
138 KERNELSOURCEDIR=$kernelsourcedir
139 LIBKVM_KERNELDIR=$libkvm_kerneldir
140 WANT_MODULE=$want_module
141 CROSS_COMPILE=$cross_prefix
144 OBJCOPY=$cross_prefix$objcopy
148 cat <<EOF > kernel/config.kbuild
149 EXT_CONFIG_KVM_TRACE=$kvm_trace