3 DIR=$(dirname `readlink -f $0`)
7 echo "Building guest kernel version $KERNELVERSION"
9 [ -f "$KERNELCONFIG" ] || die "Kernel config $KERNELCONFIG not found"
11 check_commands bunzip2 bzcat make wget
15 if [ ! -f "$KERNELTARBALL" ]
17 url=ftp://ftp.kernel.org/pub/linux/kernel/v3.x/$KERNELTARBALL
18 log_action "Downloading $url"
19 execute "wget -q $url"
22 if [[ $KERNELPATCH && ! -f "$KERNELPATCH" ]]
24 url=http://download.strongswan.org/uml/$KERNELPATCH
25 log_action "Downloading $url"
26 execute "wget -q $url"
29 log_action "Unpacking kernel"
30 execute "tar xJf $KERNELTARBALL"
32 KERNELDIR=$BUILDDIR/$KERNEL
37 log_action "Applying kernel patch"
38 bzcat ../$KERNELPATCH | patch -p1 >>$LOGFILE 2>&1
40 [ $? -eq 0 ] || exit 1
43 execute "cp $KERNELCONFIG .config" 0
45 echo "Creating kernel configuration, you might get prompted for new parameters"
46 make oldconfig 2>&1 | tee -a $LOGFILE
48 log_action "Compiling the kernel"