]> git.ipfire.org Git - people/ms/strongswan.git/blob - testing/scripts/build-umlhostfs
- import of strongswan-2.7.0
[people/ms/strongswan.git] / testing / scripts / build-umlhostfs
1 #!/bin/bash
2 # create UML host file systems
3 #
4 # Copyright (C) 2004 Eric Marchionni, Patrik Rayo
5 # Zuercher Hochschule Winterthur
6 #
7 # This program is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by the
9 # Free Software Foundation; either version 2 of the License, or (at your
10 # option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
11 #
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 # for more details.
16 #
17 # RCSID $Id: build-umlhostfs,v 1.3 2006/03/30 21:20:27 as Exp $
18
19 DIR=`dirname $0`
20
21 source $DIR/function.sh
22
23 [ -f $DIR/../testing.conf ] || die "!! Configuration file 'testing.conf' not found."
24
25 source $DIR/../testing.conf
26
27 cd $BUILDDIR/root-fs
28
29 [ -f gentoo-fs ] || die "!! Root file system 'gentoo-fs' not found."
30
31 if [ ! -d $BUILDDIR ]
32 then
33 cecho-n " * Directory '$BUILDDIR' does not exist..creating.."
34 mkdir $BUILDDIR
35 cecho "done"
36 fi
37
38 LOGFILE=${BUILDDIR}/testing.log
39
40 if [ ! -f $LOGFILE ]
41 then
42 cecho-n " * Logfile '$LOGFILE' does not exist..creating.."
43 touch $LOGFILE
44 cecho "done"
45 fi
46
47 LOOPDIR=loop
48
49 if [ ! -d $LOOPDIR ]
50 then
51 mkdir $LOOPDIR
52 fi
53
54 cecho-n " * Creating root filesystem for.."
55
56 if [ "$#" -eq 0 ]
57 then
58 HOSTS=$STRONGSWANHOSTS
59 else
60 HOSTS=$*
61 fi
62
63 for host in $HOSTS
64 do
65 cecho-n "$host.."
66 cp gentoo-fs gentoo-fs-$host
67 mount -o loop gentoo-fs-$host $LOOPDIR
68 cp -rfp $BUILDDIR/hosts/${host}/etc $LOOPDIR
69 if [ "$host" = "winnetou" ]
70 then
71 cp -rfp $UMLTESTDIR/testing/images $LOOPDIR/var/www/localhost/htdocs
72 chroot $LOOPDIR /etc/openssl/generate-crl >> $LOGFILE 2>&1
73 fi
74 chroot $LOOPDIR /etc/init.d/depscan.sh --update >> $LOGFILE 2>&1
75 umount $LOOPDIR
76 done
77
78 cecho "done"