Update build-umlkernel script to new log format
This commit is contained in:
committed by
Tobias Brunner
parent
fb2aab414a
commit
5828e434bd
@@ -45,7 +45,6 @@ fi
|
|||||||
#
|
#
|
||||||
if [ $ENABLE_BUILD_UMLKERNEL = "yes" ]
|
if [ $ENABLE_BUILD_UMLKERNEL = "yes" ]
|
||||||
then
|
then
|
||||||
cecho "Building uml kernel (scripts/build-umlkernel)"
|
|
||||||
$DIR/scripts/build-umlkernel
|
$DIR/scripts/build-umlkernel
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -15,107 +15,46 @@
|
|||||||
# for more details.
|
# for more details.
|
||||||
|
|
||||||
DIR=`dirname $0`
|
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'.."
|
[ -f "$KERNEL" ] || die "Kernel $KERNEL not found"
|
||||||
if [ -f "${KERNEL}" ]
|
[ -f "$KERNELCONFIG" ] || die "Kernel config $KERNELCONFIG not found"
|
||||||
then
|
|
||||||
cecho "found it"
|
if [ $UMLPATCH ]; then
|
||||||
KERNELVERSION=`basename $KERNEL .tar.bz2 | sed -e 's/linux-//'`
|
[ -f "$UMLPATCH" ] || die "Patch $UMLPATCH not found"
|
||||||
cecho " * Kernel version is $KERNELVERSION"
|
|
||||||
else
|
|
||||||
cecho "none"
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${UMLPATCH} ]
|
mkdir -p $BUILDDIR
|
||||||
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
|
|
||||||
#
|
|
||||||
|
|
||||||
if [ ! -d $BUILDDIR ]
|
|
||||||
then
|
|
||||||
cecho " * Creating directory '$BUILDDIR'"
|
|
||||||
mkdir $BUILDDIR
|
|
||||||
fi
|
|
||||||
|
|
||||||
cecho " * Changing to directory '$BUILDDIR'"
|
|
||||||
cd $BUILDDIR
|
cd $BUILDDIR
|
||||||
|
|
||||||
cecho-n " * Unpacking kernel.."
|
log_action "Unpacking kernel"
|
||||||
tar xjf $KERNEL >> $LOGFILE 2>&1
|
execute "tar xjf $KERNEL"
|
||||||
cgecho "done"
|
|
||||||
|
|
||||||
KERNELDIR=${BUILDDIR}/linux-${KERNELVERSION}
|
KERNELDIR=${BUILDDIR}/linux-${KERNELVERSION}
|
||||||
|
ln -fs linux-${KERNELVERSION} linux
|
||||||
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'"
|
|
||||||
cd $KERNELDIR
|
cd $KERNELDIR
|
||||||
|
|
||||||
if [ $UMLPATCH ]
|
if [ $UMLPATCH ]; then
|
||||||
then
|
log_action "Applying uml patch"
|
||||||
cecho-n " * Applying uml patch.."
|
bzcat $UMLPATCH | patch -p1 >> $LOGFILE 2>&1
|
||||||
bzcat $UMLPATCH | patch -p1 >> $LOGFILE 2>&1
|
log_status $?
|
||||||
cgecho "done"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#######################################################
|
execute "cp $KERNELCONFIG .config" 0
|
||||||
# copy our default .config to linux and build kernel
|
|
||||||
#
|
|
||||||
|
|
||||||
cp $KERNELCONFIG .config
|
echo "!!"
|
||||||
|
echo "!! Creating kernel configuration, you might get prompted for new parameters!"
|
||||||
cecho "!!"
|
echo "!!"
|
||||||
cecho "!! Making .config for kernel. You might be prompted for new parameters!"
|
|
||||||
cecho "!!"
|
|
||||||
make oldconfig ARCH=um 2>&1 | tee -a $LOGFILE
|
make oldconfig ARCH=um 2>&1 | tee -a $LOGFILE
|
||||||
|
|
||||||
cecho-n " * Now compiling uml kernel.."
|
log_action "Compiling the kernel"
|
||||||
make -j5 linux ARCH=um >> $LOGFILE 2>&1
|
execute "make -j5 linux ARCH=um"
|
||||||
cgecho "done"
|
|
||||||
|
|
||||||
cecho-n " * Copying uml kernel to '${BUILDDIR}/linux-uml-${KERNELVERSION}'.."
|
log_action "Copying kernel to '${BUILDDIR}/linux-uml-${KERNELVERSION}'"
|
||||||
mv linux ${BUILDDIR}/linux-uml-${KERNELVERSION}
|
execute "mv linux ${BUILDDIR}/linux-uml-${KERNELVERSION}"
|
||||||
cgecho "done"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user