| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 | #!/bin/bashDIR=$(dirname `readlink -f $0`). $DIR/../testing.conf. $DIR/function.shecho "Building guest kernel version $KERNELVERSION"[ -f "$KERNELCONFIG" ] || die "Kernel config $KERNELCONFIG not found"check_commands bunzip2 bzcat make wgetcd $BUILDDIRif [ ! -f "$KERNELTARBALL" ]then	url=https://cdn.kernel.org/pub/linux/kernel/v${KERNELVERSION:0:1}.x/$KERNELTARBALL	log_action "Downloading $url"	execute "wget -q $url"fiif [[ $KERNELPATCH && ! -f "$KERNELPATCH" ]]then	url=http://download.strongswan.org/uml/$KERNELPATCH	log_action "Downloading $url"	execute "wget -q $url"fiKERNELDIR=$BUILDDIR/$KERNELif [ ! -d "$KERNELDIR" ]then	log_action "Unpacking kernel"	execute "tar xJf $KERNELTARBALL"	if [ $KERNELPATCH ]	then		log_action "Applying kernel patch"		bzcat $KERNELPATCH | patch -d $KERNELDIR -p1 >>$LOGFILE 2>&1		log_status $?		[ $? -eq 0 ] || exit 1	fificd $KERNELDIRif [ ! -f .config ]then	execute "cp $KERNELCONFIG .config" 0fiecho "Creating kernel configuration, you might get prompted for new parameters"make oldconfig 2>&1 | tee -a $LOGFILElog_action "Compiling the kernel"execute "make -j5"
 |