mirror of
https://github.com/strongswan/strongswan.git
synced 2025-12-08 00:00:29 -05:00
Instead of extracting a downloaded Gentoo filesystem tree into a file containing a reiserfs filesystem, create an ext3 filesystem inside a sparse file, mount it and debootstrap an up-to-date Debian system. Use this image as base for all UML guest images. Also, drop support for the various consoles and use xterm unconditionally.
122 lines
2.8 KiB
Bash
Executable File
122 lines
2.8 KiB
Bash
Executable File
#!/bin/bash
|
|
# build an UML kernel based on a vanilla kernel and UML patch
|
|
#
|
|
# Copyright (C) 2004 Eric Marchionni, Patrik Rayo
|
|
# Zuercher Hochschule Winterthur
|
|
#
|
|
# This program is free software; you can redistribute it and/or modify it
|
|
# under the terms of the GNU General Public License as published by the
|
|
# Free Software Foundation; either version 2 of the License, or (at your
|
|
# option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
|
|
#
|
|
# This program is distributed in the hope that it will be useful, but
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
# for more details.
|
|
|
|
DIR=`dirname $0`
|
|
|
|
source $DIR/function.sh
|
|
|
|
[ -f $DIR/../testing.conf ] || die "configuration file 'testing.conf' not found"
|
|
|
|
source $DIR/../testing.conf
|
|
|
|
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
|
|
#
|
|
|
|
if [ ! -d $BUILDDIR ]
|
|
then
|
|
cecho " * Creating directory '$BUILDDIR'"
|
|
mkdir $BUILDDIR
|
|
fi
|
|
|
|
cecho " * Changing to directory '$BUILDDIR'"
|
|
cd $BUILDDIR
|
|
|
|
cecho-n " * Unpacking kernel.."
|
|
tar xjf $KERNEL >> $LOGFILE 2>&1
|
|
cgecho "done"
|
|
|
|
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'"
|
|
cd $KERNELDIR
|
|
|
|
if [ $UMLPATCH ]
|
|
then
|
|
cecho-n " * Applying uml patch.."
|
|
bzcat $UMLPATCH | patch -p1 >> $LOGFILE 2>&1
|
|
cgecho "done"
|
|
fi
|
|
|
|
#######################################################
|
|
# copy our default .config to linux and build kernel
|
|
#
|
|
|
|
cp $KERNELCONFIG .config
|
|
|
|
cecho "!!"
|
|
cecho "!! Making .config for kernel. You might be prompted for new parameters!"
|
|
cecho "!!"
|
|
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"
|
|
|
|
cecho-n " * Copying uml kernel to '${BUILDDIR}/linux-uml-${KERNELVERSION}'.."
|
|
mv linux ${BUILDDIR}/linux-uml-${KERNELVERSION}
|
|
cgecho "done"
|