Return to build-guestkernel CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / strongswan / testing / scripts |
1.1 ! misho 1: #!/bin/bash ! 2: ! 3: DIR=$(dirname `readlink -f $0`) ! 4: . $DIR/../testing.conf ! 5: . $DIR/function.sh ! 6: ! 7: echo "Building guest kernel version $KERNELVERSION" ! 8: ! 9: [ -f "$KERNELCONFIG" ] || die "Kernel config $KERNELCONFIG not found" ! 10: ! 11: check_commands bunzip2 bzcat make wget ! 12: ! 13: cd $BUILDDIR ! 14: ! 15: if [ ! -f "$KERNELTARBALL" ] ! 16: then ! 17: url=https://cdn.kernel.org/pub/linux/kernel/v${KERNELVERSION:0:1}.x/$KERNELTARBALL ! 18: log_action "Downloading $url" ! 19: execute "wget -q $url" ! 20: fi ! 21: ! 22: if [[ $KERNELPATCH && ! -f "$KERNELPATCH" ]] ! 23: then ! 24: url=http://download.strongswan.org/uml/$KERNELPATCH ! 25: log_action "Downloading $url" ! 26: execute "wget -q $url" ! 27: fi ! 28: ! 29: KERNELDIR=$BUILDDIR/$KERNEL ! 30: ! 31: if [ ! -d "$KERNELDIR" ] ! 32: then ! 33: log_action "Unpacking kernel" ! 34: execute "tar xJf $KERNELTARBALL" ! 35: ! 36: if [ $KERNELPATCH ] ! 37: then ! 38: log_action "Applying kernel patch" ! 39: bzcat $KERNELPATCH | patch -d $KERNELDIR -p1 >>$LOGFILE 2>&1 ! 40: log_status $? ! 41: [ $? -eq 0 ] || exit 1 ! 42: fi ! 43: fi ! 44: cd $KERNELDIR ! 45: ! 46: if [ ! -f .config ] ! 47: then ! 48: execute "cp $KERNELCONFIG .config" 0 ! 49: fi ! 50: ! 51: echo "Creating kernel configuration, you might get prompted for new parameters" ! 52: make oldconfig 2>&1 | tee -a $LOGFILE ! 53: ! 54: log_action "Compiling the kernel" ! 55: execute "make -j5"