From aa5803e0e3368172d7674ff760983c568118df16 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Mon, 19 Nov 2012 10:43:42 +0100 Subject: testing: Switch to Debian based guest images 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. --- testing/scripts/build-umlhostfs | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) (limited to 'testing/scripts/build-umlhostfs') diff --git a/testing/scripts/build-umlhostfs b/testing/scripts/build-umlhostfs index 75feaa4ed..9c309f545 100755 --- a/testing/scripts/build-umlhostfs +++ b/testing/scripts/build-umlhostfs @@ -23,8 +23,9 @@ source $DIR/function.sh source $DIR/../testing.conf cd $BUILDDIR/root-fs +BASE=$BUILDDIR/base.img -[ -f gentoo-fs ] || die "!! Root file system 'gentoo-fs' not found." +[ -f $BASE ] || die "!! Base image $BASE not found." if [ ! -d $BUILDDIR ] then @@ -33,17 +34,6 @@ then cgecho "done" fi -LOGFILE=${BUILDDIR}/testing.log - -if [ ! -f $LOGFILE ] -then - cecho-n " * Logfile '$LOGFILE' does not exist..creating.." - touch $LOGFILE - cgecho "done" -fi - -LOOPDIR=loop - if [ ! -d $LOOPDIR ] then mkdir $LOOPDIR @@ -61,17 +51,22 @@ fi for host in $HOSTS do cecho-n "$host.." - cp gentoo-fs gentoo-fs-$host - mount -o loop gentoo-fs-$host $LOOPDIR + cp $BASE $host.img + mount -o loop $host.img $LOOPDIR cp -rf $BUILDDIR/hosts/${host}/etc $LOOPDIR if [ "$host" = "winnetou" ] then - mkdir $LOOPDIR/var/log/apache2/ocsp - cp -rf $UMLTESTDIR/testing/images $LOOPDIR/var/www/localhost/htdocs - chroot $LOOPDIR ln -s /etc/openssl/certs /var/www/localhost/htdocs/certs - chroot $LOOPDIR /etc/openssl/generate-crl >> $LOGFILE 2>&1 + mkdir $LOOPDIR/var/log/apache2/ocsp + cp -rf $UMLTESTDIR/testing/images $LOOPDIR/var/www/ + chroot $LOOPDIR ln -s /etc/openssl/certs /var/www/certs + chroot $LOOPDIR /etc/openssl/generate-crl >> $LOGFILE 2>&1 + chroot $LOOPDIR update-rc.d apache2 defaults >> $LOGFILE 2>&1 + chroot $LOOPDIR update-rc.d slapd defaults >> $LOGFILE 2>&1 + chroot $LOOPDIR rm -rf /var/lib/ldap/* + chroot $LOOPDIR slapadd -l /etc/ldap/ldif.txt -f /etc/ldap/slapd.conf >> $LOGFILE 2>&1 + chroot $LOOPDIR chown -R openldap:openldap /var/lib/ldap >> $LOGFILE 2>&1 fi - chroot $LOOPDIR /etc/init.d/depscan.sh --update >> $LOGFILE 2>&1 + sync umount $LOOPDIR done -- cgit v1.2.3 From 2d1577d661c02753ad7c9b34f993a7c340706679 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Thu, 6 Dec 2012 17:42:51 +0100 Subject: Update build-umlhostfs script to new log format --- testing/scripts/build-umlhostfs | 72 ++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 41 deletions(-) (limited to 'testing/scripts/build-umlhostfs') diff --git a/testing/scripts/build-umlhostfs b/testing/scripts/build-umlhostfs index 9c309f545..d5b347973 100755 --- a/testing/scripts/build-umlhostfs +++ b/testing/scripts/build-umlhostfs @@ -14,60 +14,50 @@ # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. +echo "Creating guest images" + 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 BASE=$BUILDDIR/base.img -[ -f $BASE ] || die "!! Base image $BASE not found." - -if [ ! -d $BUILDDIR ] -then - cecho-n " * Directory '$BUILDDIR' does not exist..creating.." - mkdir $BUILDDIR - cgecho "done" -fi - -if [ ! -d $LOOPDIR ] -then - mkdir $LOOPDIR -fi +[ -f $BASE ] || die "Base image $BASE not found" -cecho-n " * Creating root filesystem for.." +mkdir -p $BUILDDIR +mkdir -p $LOOPDIR -if [ "$#" -eq 0 ] -then - HOSTS=$STRONGSWANHOSTS +if [ "$#" -eq 0 ]; then + HOSTS=$STRONGSWANHOSTS else - HOSTS=$* + HOSTS=$* fi for host in $HOSTS do - cecho-n "$host.." - cp $BASE $host.img - mount -o loop $host.img $LOOPDIR - cp -rf $BUILDDIR/hosts/${host}/etc $LOOPDIR - if [ "$host" = "winnetou" ] - then - mkdir $LOOPDIR/var/log/apache2/ocsp - cp -rf $UMLTESTDIR/testing/images $LOOPDIR/var/www/ - chroot $LOOPDIR ln -s /etc/openssl/certs /var/www/certs - chroot $LOOPDIR /etc/openssl/generate-crl >> $LOGFILE 2>&1 - chroot $LOOPDIR update-rc.d apache2 defaults >> $LOGFILE 2>&1 - chroot $LOOPDIR update-rc.d slapd defaults >> $LOGFILE 2>&1 - chroot $LOOPDIR rm -rf /var/lib/ldap/* - chroot $LOOPDIR slapadd -l /etc/ldap/ldif.txt -f /etc/ldap/slapd.conf >> $LOGFILE 2>&1 - chroot $LOOPDIR chown -R openldap:openldap /var/lib/ldap >> $LOGFILE 2>&1 - fi - sync - umount $LOOPDIR + log_action "Creating guest image for $host" + execute "cp $BASE $host.img" 0 + execute "mount -o loop $host.img $LOOPDIR" 0 + execute "cp -rf $BUILDDIR/hosts/${host}/etc $LOOPDIR" 0 + if [ "$host" = "winnetou" ] + then + execute "mkdir $LOOPDIR/var/log/apache2/ocsp" 0 + execute "cp -rf $UMLTESTDIR/testing/images $LOOPDIR/var/www/" 0 + execute_chroot "ln -s /etc/openssl/certs /var/www/certs" 0 + execute_chroot "/etc/openssl/generate-crl" 0 + execute_chroot "update-rc.d apache2 defaults" 0 + execute_chroot "update-rc.d slapd defaults" 0 + execute_chroot "rm -rf /var/lib/ldap/*" 0 + execute_chroot "slapadd -l /etc/ldap/ldif.txt -f /etc/ldap/slapd.conf" 0 + execute_chroot "chown -R openldap:openldap /var/lib/ldap" 0 + fi + sync + umount $LOOPDIR + log_status 0 done - -cgecho "done" -- cgit v1.2.3 From 261cf0e395ec43634e49e3f431cd189d69f03edc Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Thu, 6 Dec 2012 18:26:39 +0100 Subject: Drop build-hostconfig script Use processed host configurations directly instead. --- testing/scripts/build-umlhostfs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'testing/scripts/build-umlhostfs') diff --git a/testing/scripts/build-umlhostfs b/testing/scripts/build-umlhostfs index d5b347973..ada9696c7 100755 --- a/testing/scripts/build-umlhostfs +++ b/testing/scripts/build-umlhostfs @@ -25,10 +25,12 @@ DIR=`dirname $0` [ -f $DIR/../testing.conf ] || die "Configuration file 'testing.conf' not found" . $DIR/../testing.conf -cd $BUILDDIR/root-fs BASE=$BUILDDIR/base.img +ROOTFSDIR=$BUILDDIR/root-fs +HOSTSDIR=$DIR/../hosts [ -f $BASE ] || die "Base image $BASE not found" +[ -f $HOSTDIR ] || die "Hosts directory $HOSTSDIR not found" mkdir -p $BUILDDIR mkdir -p $LOOPDIR @@ -42,9 +44,10 @@ fi for host in $HOSTS do log_action "Creating guest image for $host" - execute "cp $BASE $host.img" 0 - execute "mount -o loop $host.img $LOOPDIR" 0 - execute "cp -rf $BUILDDIR/hosts/${host}/etc $LOOPDIR" 0 + execute "cp $BASE $ROOTFSDIR/$host.img" 0 + execute "mount -o loop $ROOTFSDIR/$host.img $LOOPDIR" 0 + execute "cp -rf $HOSTSDIR/${host}/etc $LOOPDIR" 0 + execute "cp -rf $HOSTSDIR/default/etc $LOOPDIR" 0 if [ "$host" = "winnetou" ] then execute "mkdir $LOOPDIR/var/log/apache2/ocsp" 0 -- cgit v1.2.3 From 7c2ef58e86c10e0cf9846dc9211cc68c7e908f7f Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Thu, 6 Dec 2012 19:03:45 +0100 Subject: Import testing.conf file in function.sh This is needed to have access to $LOGFILE and possibly other config settings. --- testing/scripts/build-umlhostfs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'testing/scripts/build-umlhostfs') diff --git a/testing/scripts/build-umlhostfs b/testing/scripts/build-umlhostfs index ada9696c7..e5355988c 100755 --- a/testing/scripts/build-umlhostfs +++ b/testing/scripts/build-umlhostfs @@ -16,18 +16,13 @@ echo "Creating guest images" -DIR=`dirname $0` - -. $DIR/function.sh +. $PWD/scripts/function.sh [ `id -u` -eq 0 ] || die "You must be root to run $0" -[ -f $DIR/../testing.conf ] || die "Configuration file 'testing.conf' not found" -. $DIR/../testing.conf - BASE=$BUILDDIR/base.img ROOTFSDIR=$BUILDDIR/root-fs -HOSTSDIR=$DIR/../hosts +HOSTSDIR=$PWD/hosts [ -f $BASE ] || die "Base image $BASE not found" [ -f $HOSTDIR ] || die "Hosts directory $HOSTSDIR not found" -- cgit v1.2.3 From 0cc40637997984029dbcc47234b47c5da8ea0cd2 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Thu, 6 Dec 2012 19:26:48 +0100 Subject: Use do_on_exit() in build scripts for cleanup --- testing/scripts/build-umlhostfs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'testing/scripts/build-umlhostfs') diff --git a/testing/scripts/build-umlhostfs b/testing/scripts/build-umlhostfs index e5355988c..b4efc0ecb 100755 --- a/testing/scripts/build-umlhostfs +++ b/testing/scripts/build-umlhostfs @@ -36,6 +36,9 @@ else HOSTS=$* fi +# just to be sure +do_on_exit umount $LOOPDIR + for host in $HOSTS do log_action "Creating guest image for $host" @@ -56,6 +59,6 @@ do execute_chroot "chown -R openldap:openldap /var/lib/ldap" 0 fi sync - umount $LOOPDIR log_status 0 + umount $LOOPDIR done -- cgit v1.2.3 From 62a277cfaed19b4fbc4a06e48273516cce6145d7 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Fri, 7 Dec 2012 09:41:38 +0100 Subject: Move ROOTFSDIR declaration to testing.conf --- testing/scripts/build-umlhostfs | 1 - 1 file changed, 1 deletion(-) (limited to 'testing/scripts/build-umlhostfs') diff --git a/testing/scripts/build-umlhostfs b/testing/scripts/build-umlhostfs index b4efc0ecb..2ed8b504a 100755 --- a/testing/scripts/build-umlhostfs +++ b/testing/scripts/build-umlhostfs @@ -21,7 +21,6 @@ echo "Creating guest images" [ `id -u` -eq 0 ] || die "You must be root to run $0" BASE=$BUILDDIR/base.img -ROOTFSDIR=$BUILDDIR/root-fs HOSTSDIR=$PWD/hosts [ -f $BASE ] || die "Base image $BASE not found" -- cgit v1.2.3 From bf48ee33e568ee8456fa8324a39b11946f4628a6 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Fri, 7 Dec 2012 14:19:11 +0100 Subject: Rename UMLTESTDIR variable to TESTDIR --- testing/scripts/build-umlhostfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testing/scripts/build-umlhostfs') diff --git a/testing/scripts/build-umlhostfs b/testing/scripts/build-umlhostfs index 2ed8b504a..9c419ac9b 100755 --- a/testing/scripts/build-umlhostfs +++ b/testing/scripts/build-umlhostfs @@ -48,7 +48,7 @@ do if [ "$host" = "winnetou" ] then execute "mkdir $LOOPDIR/var/log/apache2/ocsp" 0 - execute "cp -rf $UMLTESTDIR/testing/images $LOOPDIR/var/www/" 0 + execute "cp -rf $TESTDIR/testing/images $LOOPDIR/var/www/" 0 execute_chroot "ln -s /etc/openssl/certs /var/www/certs" 0 execute_chroot "/etc/openssl/generate-crl" 0 execute_chroot "update-rc.d apache2 defaults" 0 -- cgit v1.2.3 From 8ed98c137321c3f92fb06b58e69aaecf4e531cdc Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Fri, 7 Dec 2012 17:54:19 +0100 Subject: Switch from raw images to qcow2 format This allows to use minimal copy-on-write clones of the base image as guest images, which in turn saves a lot of disk space. --- testing/scripts/build-umlhostfs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'testing/scripts/build-umlhostfs') diff --git a/testing/scripts/build-umlhostfs b/testing/scripts/build-umlhostfs index 9c419ac9b..1028ef266 100755 --- a/testing/scripts/build-umlhostfs +++ b/testing/scripts/build-umlhostfs @@ -1,5 +1,5 @@ #!/bin/bash -# create UML host file systems +# create specific guest images # # Copyright (C) 2004 Eric Marchionni, Patrik Rayo # Zuercher Hochschule Winterthur @@ -20,12 +20,14 @@ echo "Creating guest images" [ `id -u` -eq 0 ] || die "You must be root to run $0" -BASE=$BUILDDIR/base.img +BASE=$BUILDDIR/base.qcow2 HOSTSDIR=$PWD/hosts [ -f $BASE ] || die "Base image $BASE not found" [ -f $HOSTDIR ] || die "Hosts directory $HOSTSDIR not found" +load_qemu_nbd + mkdir -p $BUILDDIR mkdir -p $LOOPDIR @@ -41,8 +43,10 @@ do_on_exit umount $LOOPDIR for host in $HOSTS do log_action "Creating guest image for $host" - execute "cp $BASE $ROOTFSDIR/$host.img" 0 - execute "mount -o loop $ROOTFSDIR/$host.img $LOOPDIR" 0 + execute "qemu-img create -b $BASE -f qcow2 $ROOTFSDIR/$host.qcow2" 0 + execute "qemu-nbd -c $NBDEV $ROOTFSDIR/$host.qcow2" 0 + sync + execute "mount $NBDPARTITION $LOOPDIR" 0 execute "cp -rf $HOSTSDIR/${host}/etc $LOOPDIR" 0 execute "cp -rf $HOSTSDIR/default/etc $LOOPDIR" 0 if [ "$host" = "winnetou" ] @@ -58,6 +62,7 @@ do execute_chroot "chown -R openldap:openldap /var/lib/ldap" 0 fi sync + execute "umount $LOOPDIR" 0 + execute "qemu-nbd -d $NBDEV" 0 log_status 0 - umount $LOOPDIR done -- cgit v1.2.3 From b24d3ed5fc5ad891d7d210bba9b94dbe0a1468ff Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Sun, 9 Dec 2012 09:49:04 +0100 Subject: Test availability of required commands --- testing/scripts/build-umlhostfs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'testing/scripts/build-umlhostfs') diff --git a/testing/scripts/build-umlhostfs b/testing/scripts/build-umlhostfs index 1028ef266..f53410385 100755 --- a/testing/scripts/build-umlhostfs +++ b/testing/scripts/build-umlhostfs @@ -26,6 +26,8 @@ HOSTSDIR=$PWD/hosts [ -f $BASE ] || die "Base image $BASE not found" [ -f $HOSTDIR ] || die "Hosts directory $HOSTSDIR not found" +check_commands qemu-img qemu-nbd + load_qemu_nbd mkdir -p $BUILDDIR -- cgit v1.2.3 From 97265abaf0265d0cc59fb1be02e3239fca3daae3 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Sun, 9 Dec 2012 10:23:37 +0100 Subject: Inform kernel about /dev/nbd0 partition changes --- testing/scripts/build-umlhostfs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'testing/scripts/build-umlhostfs') diff --git a/testing/scripts/build-umlhostfs b/testing/scripts/build-umlhostfs index f53410385..d3cb2f651 100755 --- a/testing/scripts/build-umlhostfs +++ b/testing/scripts/build-umlhostfs @@ -26,7 +26,7 @@ HOSTSDIR=$PWD/hosts [ -f $BASE ] || die "Base image $BASE not found" [ -f $HOSTDIR ] || die "Hosts directory $HOSTSDIR not found" -check_commands qemu-img qemu-nbd +check_commands partprobe qemu-img qemu-nbd load_qemu_nbd @@ -47,7 +47,7 @@ do log_action "Creating guest image for $host" execute "qemu-img create -b $BASE -f qcow2 $ROOTFSDIR/$host.qcow2" 0 execute "qemu-nbd -c $NBDEV $ROOTFSDIR/$host.qcow2" 0 - sync + partprobe $NBDEV execute "mount $NBDPARTITION $LOOPDIR" 0 execute "cp -rf $HOSTSDIR/${host}/etc $LOOPDIR" 0 execute "cp -rf $HOSTSDIR/default/etc $LOOPDIR" 0 -- cgit v1.2.3 From 74c0839ad6e0da6f299b65ed39fe2f21fa19caf9 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Sun, 9 Dec 2012 10:50:28 +0100 Subject: Run on_exit commands in FILO order --- testing/scripts/build-umlhostfs | 1 + 1 file changed, 1 insertion(+) (limited to 'testing/scripts/build-umlhostfs') diff --git a/testing/scripts/build-umlhostfs b/testing/scripts/build-umlhostfs index d3cb2f651..ed026b6e8 100755 --- a/testing/scripts/build-umlhostfs +++ b/testing/scripts/build-umlhostfs @@ -40,6 +40,7 @@ else fi # just to be sure +do_on_exit qemu-nbd -d $NBDEV do_on_exit umount $LOOPDIR for host in $HOSTS -- cgit v1.2.3 From 258cbd40cff463f4adb57f40d3338e460c7e90f2 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Mon, 10 Dec 2012 10:05:02 +0100 Subject: Unify naming of base,root image settings --- testing/scripts/build-umlhostfs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'testing/scripts/build-umlhostfs') diff --git a/testing/scripts/build-umlhostfs b/testing/scripts/build-umlhostfs index ed026b6e8..fc2660c08 100755 --- a/testing/scripts/build-umlhostfs +++ b/testing/scripts/build-umlhostfs @@ -20,10 +20,9 @@ echo "Creating guest images" [ `id -u` -eq 0 ] || die "You must be root to run $0" -BASE=$BUILDDIR/base.qcow2 HOSTSDIR=$PWD/hosts -[ -f $BASE ] || die "Base image $BASE not found" +[ -f $ROOTIMG ] || die "Root image $ROOTIMG not found" [ -f $HOSTDIR ] || die "Hosts directory $HOSTSDIR not found" check_commands partprobe qemu-img qemu-nbd @@ -32,6 +31,7 @@ load_qemu_nbd mkdir -p $BUILDDIR mkdir -p $LOOPDIR +mkdir -p $GUESTIMGDIR if [ "$#" -eq 0 ]; then HOSTS=$STRONGSWANHOSTS @@ -46,8 +46,8 @@ do_on_exit umount $LOOPDIR for host in $HOSTS do log_action "Creating guest image for $host" - execute "qemu-img create -b $BASE -f qcow2 $ROOTFSDIR/$host.qcow2" 0 - execute "qemu-nbd -c $NBDEV $ROOTFSDIR/$host.qcow2" 0 + execute "qemu-img create -b $ROOTIMG -f $IMGEXT $GUESTIMGDIR/$host.$IMGEXT" 0 + execute "qemu-nbd -c $NBDEV $GUESTIMGDIR/$host.$IMGEXT" 0 partprobe $NBDEV execute "mount $NBDPARTITION $LOOPDIR" 0 execute "cp -rf $HOSTSDIR/${host}/etc $LOOPDIR" 0 -- cgit v1.2.3 From 44e83859e0819c86d10007380da19829e3112f51 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Mon, 10 Dec 2012 10:38:27 +0100 Subject: Rename build-umlhostfs script to build-guestimages --- testing/scripts/build-umlhostfs | 71 ----------------------------------------- 1 file changed, 71 deletions(-) delete mode 100755 testing/scripts/build-umlhostfs (limited to 'testing/scripts/build-umlhostfs') diff --git a/testing/scripts/build-umlhostfs b/testing/scripts/build-umlhostfs deleted file mode 100755 index fc2660c08..000000000 --- a/testing/scripts/build-umlhostfs +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -# create specific guest images -# -# 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 . -# -# 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. - -echo "Creating guest images" - -. $PWD/scripts/function.sh - -[ `id -u` -eq 0 ] || die "You must be root to run $0" - -HOSTSDIR=$PWD/hosts - -[ -f $ROOTIMG ] || die "Root image $ROOTIMG not found" -[ -f $HOSTDIR ] || die "Hosts directory $HOSTSDIR not found" - -check_commands partprobe qemu-img qemu-nbd - -load_qemu_nbd - -mkdir -p $BUILDDIR -mkdir -p $LOOPDIR -mkdir -p $GUESTIMGDIR - -if [ "$#" -eq 0 ]; then - HOSTS=$STRONGSWANHOSTS -else - HOSTS=$* -fi - -# just to be sure -do_on_exit qemu-nbd -d $NBDEV -do_on_exit umount $LOOPDIR - -for host in $HOSTS -do - log_action "Creating guest image for $host" - execute "qemu-img create -b $ROOTIMG -f $IMGEXT $GUESTIMGDIR/$host.$IMGEXT" 0 - execute "qemu-nbd -c $NBDEV $GUESTIMGDIR/$host.$IMGEXT" 0 - partprobe $NBDEV - execute "mount $NBDPARTITION $LOOPDIR" 0 - execute "cp -rf $HOSTSDIR/${host}/etc $LOOPDIR" 0 - execute "cp -rf $HOSTSDIR/default/etc $LOOPDIR" 0 - if [ "$host" = "winnetou" ] - then - execute "mkdir $LOOPDIR/var/log/apache2/ocsp" 0 - execute "cp -rf $TESTDIR/testing/images $LOOPDIR/var/www/" 0 - execute_chroot "ln -s /etc/openssl/certs /var/www/certs" 0 - execute_chroot "/etc/openssl/generate-crl" 0 - execute_chroot "update-rc.d apache2 defaults" 0 - execute_chroot "update-rc.d slapd defaults" 0 - execute_chroot "rm -rf /var/lib/ldap/*" 0 - execute_chroot "slapadd -l /etc/ldap/ldif.txt -f /etc/ldap/slapd.conf" 0 - execute_chroot "chown -R openldap:openldap /var/lib/ldap" 0 - fi - sync - execute "umount $LOOPDIR" 0 - execute "qemu-nbd -d $NBDEV" 0 - log_status 0 -done -- cgit v1.2.3