2 # build an UML kernel based on a vanilla kernel and UML patch
4 # Copyright (C) 2004 Eric Marchionni, Patrik Rayo
5 # Zuercher Hochschule Winterthur
7 # This program is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by the
9 # Free Software Foundation; either version 2 of the License, or (at your
10 # option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 source $DIR/function.sh
21 [ -f $DIR/../testing.conf ] || die "configuration file 'testing.conf' not found"
23 source $DIR/../testing.conf
25 cecho-n " * Looking for kernel at '$KERNEL'.."
29 KERNELVERSION=`basename $KERNEL .tar.bz2 | sed -e 's/linux-//'`
30 cecho " * Kernel version is $KERNELVERSION"
38 cecho-n " * Looking for uml patch at '$UMLPATCH'.."
39 if [ -f "${UMLPATCH}" ]
48 cecho-n " * Looking for kernel config at '$KERNELCONFIG'.."
57 #######################################################
58 # unpack kernel and create symlink
63 cecho " * Creating directory '$BUILDDIR'"
67 cecho " * Changing to directory '$BUILDDIR'"
70 LOGFILE=${BUILDDIR}/testing.log
74 cecho-n " * Logfile '$LOGFILE' does not exist..creating.."
79 cecho-n " * Unpacking kernel.."
80 tar xjf $KERNEL >> $LOGFILE 2>&1
83 KERNELDIR=${BUILDDIR}/linux-${KERNELVERSION}
87 cecho " * Kernel directory is '$KERNELDIR'"
88 cecho " * Creating symlink 'linux'"
93 ln -s linux-${KERNELVERSION} linux
95 cecho "!! Kernel directory '$KERNELDIR' can not be found"
99 #######################################################
103 cecho " * Changing to directory '$KERNELDIR'"
108 cecho-n " * Applying uml patch.."
109 bzcat $UMLPATCH | patch -p1 >> $LOGFILE 2>&1
113 #######################################################
114 # copy our default .config to linux and build kernel
117 cp $KERNELCONFIG .config
120 cecho "!! Making .config for kernel. You might be prompted for new parameters!"
122 make oldconfig ARCH=um SUBARCH=i386 2>&1 | tee -a $LOGFILE
124 cecho-n " * Now compiling uml kernel.."
125 make linux ARCH=um SUBARCH=i386 >> $LOGFILE 2>&1
128 cecho-n " * Copying uml kernel to '${BUILDDIR}/linux-uml-${KERNELVERSION}'.."
129 mv linux ${BUILDDIR}/linux-uml-${KERNELVERSION}