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
17 # RCSID $Id: build-umlkernel,v 1.2 2005/01/09 21:54:25 as Exp $
21 source $DIR/function.sh
23 [ -f $DIR/../testing.conf ] || die "configuration file 'testing.conf' not found"
25 source $DIR/../testing.conf
27 cecho-n " * Looking for kernel at '$KERNEL'.."
31 KERNELVERSION=`basename $KERNEL .tar.bz2 | sed -e 's/linux-//'`
32 cecho " * Kernel version is $KERNELVERSION"
40 cecho-n " * Looking for uml patch at '$UMLPATCH'.."
41 if [ -f "${UMLPATCH}" ]
50 cecho-n " * Looking for kernel config at '$KERNELCONFIG'.."
59 #######################################################
60 # unpack kernel and create symlink
65 cecho " * Creating directory '$BUILDDIR'"
69 cecho " * Changing to directory '$BUILDDIR'"
72 LOGFILE=${BUILDDIR}/testing.log
76 cecho-n " * Logfile '$LOGFILE' does not exist..creating.."
81 cecho-n " * Unpacking kernel.."
82 tar xjf $KERNEL >> $LOGFILE 2>&1
85 KERNELDIR=${BUILDDIR}/linux-${KERNELVERSION}
89 cecho " * Kernel directory is '$KERNELDIR'"
90 cecho " * Creating symlink 'linux'"
95 ln -s linux-${KERNELVERSION} linux
97 cecho "!! Kernel directory '$KERNELDIR' can not be found"
101 #######################################################
105 cecho " * Changing to directory '$KERNELDIR'"
110 cecho-n " * Applying uml patch.."
111 bzcat $UMLPATCH | patch -p1 >> $LOGFILE 2>&1
115 #######################################################
116 # copy our default .config to linux and build kernel
119 cp $KERNELCONFIG .config
122 cecho "!! Making .config for kernel. You might be prompted for new parameters!"
124 make oldconfig ARCH=um >> $LOGFILE 2>&1
126 cecho-n " * Now compiling uml kernel.."
127 make linux ARCH=um >> $LOGFILE 2>&1
130 cecho-n " * Copying uml kernel to '${BUILDDIR}/linux-uml-${KERNELVERSION}'.."
131 mv linux ${BUILDDIR}/linux-uml-${KERNELVERSION}