From f9df3d06b5b4e5e5f00d294f555a373afd6bf99e Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Fri, 7 Dec 2012 11:33:27 +0100 Subject: Rename build-umlkernel script to build-guestkernel --- testing/scripts/build-guestkernel | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 testing/scripts/build-guestkernel (limited to 'testing/scripts/build-guestkernel') diff --git a/testing/scripts/build-guestkernel b/testing/scripts/build-guestkernel new file mode 100755 index 000000000..2fbe658a1 --- /dev/null +++ b/testing/scripts/build-guestkernel @@ -0,0 +1,46 @@ +#!/bin/bash + +. $PWD/scripts/function.sh + +echo "Building guest kernel version $KERNELVERSION" + +[ -f "$KERNELCONFIG" ] || die "Kernel config $KERNELCONFIG not found" + +mkdir -p $BUILDDIR +cd $BUILDDIR + +if [ ! -f "$KERNELTARBALL" ] +then + url=ftp://ftp.kernel.org/pub/linux/kernel/v3.x/$KERNELTARBALL + log_action "Downloading $url" + execute "wget -q $url" +fi + +if [[ $KERNELPATCH && ! -f "$KERNELPATCH" ]] +then + url=http://download.strongswan.org/uml/$KERNELPATCH + log_action "Downloading $url" + execute "wget -q $url" +fi + +log_action "Unpacking kernel" +execute "tar xjf $KERNELTARBALL" + +KERNELDIR=$BUILDDIR/$KERNEL +cd $KERNELDIR + +if [ $KERNELPATCH ] +then + log_action "Applying kernel patch" + bzcat ../$KERNELPATCH | patch -p1 >>$LOGFILE 2>&1 + log_status $? + [ $? -eq 0 ] || exit 1 +fi + +execute "cp $KERNELCONFIG .config" 0 + +echo "Creating kernel configuration, you might get prompted for new parameters" +make oldconfig 2>&1 | tee -a $LOGFILE + +log_action "Compiling the kernel" +execute "make -j5" -- cgit v1.2.3