2 # starts the UML instances in a konsole (requires KDE)
4 # Copyright (C) 2004 Eric Marchionni, Patrik Rayo
5 # Zuercher Hochschule Winterthur
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>.
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
19 source $DIR/function.sh
21 [ -f $DIR/../testing.conf ] || die "Configuration file 'testing.conf' not found"
23 source $DIR/../testing.conf
27 HOSTS=$STRONGSWANHOSTS
36 #position of konsole window on the desktop
46 if [ -d ~/.uml/${host} ]
48 pid=`cat ~/.uml/${host}/pid`
49 up=`ps up $pid | wc -l`
54 cecho " * Great, ${host} is already running!"
57 BOOTING_HOSTS="$BOOTING_HOSTS ${host}"
60 UMLHOSTFS=$BUILDDIR/root-fs/gentoo-fs-${host}
61 [ -f $UMLHOSTFS ] || die "!! uml root file system '$UMLHOSTFS' not found"
63 cecho-n " * Starting ${host}.."
64 eval konsole -title ${host} --geometry "+${x0}+${y0}" -e "$UMLKERNEL \
68 mem=${MEM}M con=pty con0=fd:0,fd:1" &
76 if [ -z "$BOOTING_HOSTS" ]
81 cecho " * Waiting for the uml instances to finish booting"
83 for host in $BOOTING_HOSTS
85 cecho-n " * Checking on $host.."
87 while [ $count -lt $count_max ] && [ ! -d ~/.uml/$host ]
94 if [ $count -ge $count_max ]
100 up=`uml_mconsole $host proc net/route 2> /dev/null | grep eth0 | wc -l`
102 while [ $count -lt $count_max ] && [ $up -eq 0 ]
106 up=`uml_mconsole $host proc net/route 2> /dev/null | grep eth0 | wc -l`
110 if [ $count -ge $count_max ]
118 if [ "$host" = "alice" ]
121 eval ipv4_${host}="`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $1 }' | awk '{ print $1 }'`"
122 ssh root@$ipv4_alice /etc/init.d/net.eth1 stop
126 cecho " * All uml instances are up now"