4 kerneldir
=/lib
/modules
/$
(uname
-r)/build
13 # don't use uname if kerneldir is set
15 # we only need depmod_version for kvm.ko install
17 if [ -z "TMPDIR" ] ; then
26 --arch=ARCH architecture to compile for ($arch)
27 --cross-prefix=PREFIX prefix for cross compile
28 --with-kvm-trace Enable kvm_trace
29 --kerneldir=DIR kernel build directory ($kerneldir)
30 --help this helpful text
35 while [[ "$1" = -* ]]; do
39 if [[ "$opt" = *=* ]]; then
49 --with-patched-kernel)
74 arch
=${arch/#i?86/i386}
82 # see if we have split build and source directories
83 if [ -d "$kerneldir/include2" ]; then
84 kernelsourcedir
=${kerneldir%/*}/source
87 if [ -n "$no_uname" -a "$want_module" ]; then
88 if [ -e "$kerneldir/.kernelrelease" ]; then
89 depmod_version
=`cat "$kerneldir/.kernelrelease"`
91 elif [ -e "$kerneldir/include/config/kernel.release" ]; then
92 depmod_version
=`cat "$kerneldir/include/config/kernel.release"`
93 elif [ -e "$kerneldir/.config" ]; then
94 depmod_version
=$
(awk '/Linux kernel version:/ { print $NF }' \
98 echo "Error: kernelversion not found"
99 echo "Please make sure your kernel is configured"
105 rm -f include
/asm include-compat
/asm
106 ln -sf asm-
"$karch" include
/asm
107 ln -sf asm-
"$karch" include-compat
/asm
109 cat <<EOF > config.mak
114 KERNELSOURCEDIR=$kernelsourcedir
115 CROSS_COMPILE=$cross_prefix
118 OBJCOPY=$cross_prefix$objcopy
120 DEPMOD_VERSION=$depmod_version
123 cat <<EOF > config.kbuild
124 EXT_CONFIG_KVM_TRACE=$kvm_trace