From: Reto Buerki Date: Thu, 6 Dec 2012 16:02:38 +0000 (+0100) Subject: Update build-umlkernel script to new log format X-Git-Tag: 5.0.2rc1~1^2~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5828e434bd654d42f01e6b36845fa4f2964dec22;p=thirdparty%2Fstrongswan.git Update build-umlkernel script to new log format --- diff --git a/testing/make-testing b/testing/make-testing index d09bb494d9..b5e65d3093 100755 --- a/testing/make-testing +++ b/testing/make-testing @@ -45,7 +45,6 @@ fi # if [ $ENABLE_BUILD_UMLKERNEL = "yes" ] then - cecho "Building uml kernel (scripts/build-umlkernel)" $DIR/scripts/build-umlkernel fi diff --git a/testing/scripts/build-umlkernel b/testing/scripts/build-umlkernel index 44e27c2b29..3947e4ab1a 100755 --- a/testing/scripts/build-umlkernel +++ b/testing/scripts/build-umlkernel @@ -15,107 +15,46 @@ # for more details. DIR=`dirname $0` +. $DIR/function.sh -source $DIR/function.sh +[ -f $DIR/../testing.conf ] || die "Configuration file 'testing.conf' not found" -[ -f $DIR/../testing.conf ] || die "configuration file 'testing.conf' not found" +. $DIR/../testing.conf -source $DIR/../testing.conf +echo "Building guest kernel version $KERNELVERSION" -cecho-n " * Looking for kernel at '$KERNEL'.." -if [ -f "${KERNEL}" ] -then - cecho "found it" - KERNELVERSION=`basename $KERNEL .tar.bz2 | sed -e 's/linux-//'` - cecho " * Kernel version is $KERNELVERSION" -else - cecho "none" - exit -fi - -if [ ${UMLPATCH} ] -then - cecho-n " * Looking for uml patch at '$UMLPATCH'.." - if [ -f "${UMLPATCH}" ] - then - cecho "found it" - else - cecho "none" - exit - fi -fi - -cecho-n " * Looking for kernel config at '$KERNELCONFIG'.." -if [ -f "${KERNEL}" ] -then - cecho "found it" -else - cecho "none" - exit -fi - -####################################################### -# unpack kernel and create symlink -# +[ -f "$KERNEL" ] || die "Kernel $KERNEL not found" +[ -f "$KERNELCONFIG" ] || die "Kernel config $KERNELCONFIG not found" -if [ ! -d $BUILDDIR ] -then - cecho " * Creating directory '$BUILDDIR'" - mkdir $BUILDDIR +if [ $UMLPATCH ]; then + [ -f "$UMLPATCH" ] || die "Patch $UMLPATCH not found" fi -cecho " * Changing to directory '$BUILDDIR'" +mkdir -p $BUILDDIR cd $BUILDDIR -cecho-n " * Unpacking kernel.." -tar xjf $KERNEL >> $LOGFILE 2>&1 -cgecho "done" +log_action "Unpacking kernel" +execute "tar xjf $KERNEL" KERNELDIR=${BUILDDIR}/linux-${KERNELVERSION} - -if [ -d $KERNELDIR ] -then - cecho " * Kernel directory is '$KERNELDIR'" - cecho " * Creating symlink 'linux'" - if [ -d linux ] - then - rm linux - fi - ln -s linux-${KERNELVERSION} linux -else - cecho "!! Kernel directory '$KERNELDIR' can not be found" - exit -fi - -####################################################### -# patch kernel -# - -cecho " * Changing to directory '$KERNELDIR'" +ln -fs linux-${KERNELVERSION} linux cd $KERNELDIR -if [ $UMLPATCH ] -then - cecho-n " * Applying uml patch.." - bzcat $UMLPATCH | patch -p1 >> $LOGFILE 2>&1 - cgecho "done" +if [ $UMLPATCH ]; then + log_action "Applying uml patch" + bzcat $UMLPATCH | patch -p1 >> $LOGFILE 2>&1 + log_status $? fi -####################################################### -# copy our default .config to linux and build kernel -# - -cp $KERNELCONFIG .config +execute "cp $KERNELCONFIG .config" 0 -cecho "!!" -cecho "!! Making .config for kernel. You might be prompted for new parameters!" -cecho "!!" +echo "!!" +echo "!! Creating kernel configuration, you might get prompted for new parameters!" +echo "!!" make oldconfig ARCH=um 2>&1 | tee -a $LOGFILE -cecho-n " * Now compiling uml kernel.." -make -j5 linux ARCH=um >> $LOGFILE 2>&1 -cgecho "done" +log_action "Compiling the kernel" +execute "make -j5 linux ARCH=um" -cecho-n " * Copying uml kernel to '${BUILDDIR}/linux-uml-${KERNELVERSION}'.." -mv linux ${BUILDDIR}/linux-uml-${KERNELVERSION} -cgecho "done" +log_action "Copying kernel to '${BUILDDIR}/linux-uml-${KERNELVERSION}'" +execute "mv linux ${BUILDDIR}/linux-uml-${KERNELVERSION}"