blob: 6e17af430dce328589f2190033cdcf06452b9ade (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
#!/bin/bash
# build an UML kernel based on a vanilla kernel and UML patch
#
# Copyright (C) 2004 Eric Marchionni, Patrik Rayo
# Zuercher Hochschule Winterthur
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
. $PWD/scripts/function.sh
echo "Building guest kernel version $KERNELVERSION"
[ -f "$KERNEL" ] || die "Kernel $KERNEL not found"
[ -f "$KERNELCONFIG" ] || die "Kernel config $KERNELCONFIG not found"
if [ $UMLPATCH ]; then
[ -f "$UMLPATCH" ] || die "Patch $UMLPATCH not found"
fi
mkdir -p $BUILDDIR
cd $BUILDDIR
log_action "Unpacking kernel"
execute "tar xjf $KERNEL"
KERNELDIR=${BUILDDIR}/linux-${KERNELVERSION}
ln -fs linux-${KERNELVERSION} linux
cd $KERNELDIR
if [ $UMLPATCH ]; then
log_action "Applying uml patch"
bzcat $UMLPATCH | patch -p1 >> $LOGFILE 2>&1
log_status $?
fi
execute "cp $KERNELCONFIG .config" 0
echo "!!"
echo "!! Creating kernel configuration, you might get prompted for new parameters!"
echo "!!"
make oldconfig ARCH=um 2>&1 | tee -a $LOGFILE
log_action "Compiling the kernel"
execute "make -j5 linux ARCH=um"
log_action "Copying kernel to '${BUILDDIR}/linux-uml-${KERNELVERSION}'"
execute "mv linux ${BUILDDIR}/linux-uml-${KERNELVERSION}"
|