Update build-umlhostfs script to new log format

This commit is contained in:
Reto Buerki
2013-01-17 15:22:10 +01:00
committed by Tobias Brunner
parent bf3ff0e585
commit 2d1577d661
2 changed files with 31 additions and 42 deletions
-1
View File
@@ -72,6 +72,5 @@ fi
# #
if [ $ENABLE_BUILD_UMLHOSTFS = "yes" ] if [ $ENABLE_BUILD_UMLHOSTFS = "yes" ]
then then
cecho "Building uml host images (scripts/build-umlhostfs)"
$DIR/scripts/build-umlhostfs $HOSTS $DIR/scripts/build-umlhostfs $HOSTS
fi fi
+31 -41
View File
@@ -14,60 +14,50 @@
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details. # for more details.
echo "Creating guest images"
DIR=`dirname $0` DIR=`dirname $0`
source $DIR/function.sh . $DIR/function.sh
[ -f $DIR/../testing.conf ] || die "!! Configuration file 'testing.conf' not found." [ `id -u` -eq 0 ] || die "You must be root to run $0"
source $DIR/../testing.conf [ -f $DIR/../testing.conf ] || die "Configuration file 'testing.conf' not found"
. $DIR/../testing.conf
cd $BUILDDIR/root-fs cd $BUILDDIR/root-fs
BASE=$BUILDDIR/base.img BASE=$BUILDDIR/base.img
[ -f $BASE ] || die "!! Base image $BASE not found." [ -f $BASE ] || die "Base image $BASE not found"
if [ ! -d $BUILDDIR ] mkdir -p $BUILDDIR
then mkdir -p $LOOPDIR
cecho-n " * Directory '$BUILDDIR' does not exist..creating.."
mkdir $BUILDDIR
cgecho "done"
fi
if [ ! -d $LOOPDIR ] if [ "$#" -eq 0 ]; then
then HOSTS=$STRONGSWANHOSTS
mkdir $LOOPDIR
fi
cecho-n " * Creating root filesystem for.."
if [ "$#" -eq 0 ]
then
HOSTS=$STRONGSWANHOSTS
else else
HOSTS=$* HOSTS=$*
fi fi
for host in $HOSTS for host in $HOSTS
do do
cecho-n "$host.." log_action "Creating guest image for $host"
cp $BASE $host.img execute "cp $BASE $host.img" 0
mount -o loop $host.img $LOOPDIR execute "mount -o loop $host.img $LOOPDIR" 0
cp -rf $BUILDDIR/hosts/${host}/etc $LOOPDIR execute "cp -rf $BUILDDIR/hosts/${host}/etc $LOOPDIR" 0
if [ "$host" = "winnetou" ] if [ "$host" = "winnetou" ]
then then
mkdir $LOOPDIR/var/log/apache2/ocsp execute "mkdir $LOOPDIR/var/log/apache2/ocsp" 0
cp -rf $UMLTESTDIR/testing/images $LOOPDIR/var/www/ execute "cp -rf $UMLTESTDIR/testing/images $LOOPDIR/var/www/" 0
chroot $LOOPDIR ln -s /etc/openssl/certs /var/www/certs execute_chroot "ln -s /etc/openssl/certs /var/www/certs" 0
chroot $LOOPDIR /etc/openssl/generate-crl >> $LOGFILE 2>&1 execute_chroot "/etc/openssl/generate-crl" 0
chroot $LOOPDIR update-rc.d apache2 defaults >> $LOGFILE 2>&1 execute_chroot "update-rc.d apache2 defaults" 0
chroot $LOOPDIR update-rc.d slapd defaults >> $LOGFILE 2>&1 execute_chroot "update-rc.d slapd defaults" 0
chroot $LOOPDIR rm -rf /var/lib/ldap/* execute_chroot "rm -rf /var/lib/ldap/*" 0
chroot $LOOPDIR slapadd -l /etc/ldap/ldif.txt -f /etc/ldap/slapd.conf >> $LOGFILE 2>&1 execute_chroot "slapadd -l /etc/ldap/ldif.txt -f /etc/ldap/slapd.conf" 0
chroot $LOOPDIR chown -R openldap:openldap /var/lib/ldap >> $LOGFILE 2>&1 execute_chroot "chown -R openldap:openldap /var/lib/ldap" 0
fi fi
sync sync
umount $LOOPDIR umount $LOOPDIR
log_status 0
done done
cgecho "done"