Files
strongswan-ext/testing/scripts/build-guestkernel
T
Martin Willi 2a75c6e487 testing: Do not overwrite kernel configuration if it already exists
This allows us to do changes to the kernel configuration using menuconfig
and friends, and update the kernel with make-testing.
2015-07-12 13:54:08 +02:00

56 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
DIR=$(dirname `readlink -f $0`)
. $DIR/../testing.conf
. $DIR/function.sh
echo "Building guest kernel version $KERNELVERSION"
[ -f "$KERNELCONFIG" ] || die "Kernel config $KERNELCONFIG not found"
check_commands bunzip2 bzcat make wget
cd $BUILDDIR
if [ ! -f "$KERNELTARBALL" ]
then
url=ftp://ftp.kernel.org/pub/linux/kernel/v${KERNELVERSION:0:1}.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
KERNELDIR=$BUILDDIR/$KERNEL
cd $KERNELDIR
if [ ! -d "$KERNELDIR" ]
then
log_action "Unpacking kernel"
execute "tar xJf $KERNELTARBALL"
if [ $KERNELPATCH ]
then
log_action "Applying kernel patch"
bzcat ../$KERNELPATCH | patch -p1 >>$LOGFILE 2>&1
log_status $?
[ $? -eq 0 ] || exit 1
fi
fi
if [ ! -f .config ]
then
execute "cp $KERNELCONFIG .config" 0
fi
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"