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
21 source $DIR/function.sh
23 [ -f $DIR/../testing.conf ] || die "Configuration file 'testing.conf' not found"
25 source $DIR/../testing.conf
29 HOSTS=$STRONGSWANHOSTS
38 #position of konsole window on the desktop
48 if [ -d ~/.uml/${host} ]
50 pid=`cat ~/.uml/${host}/pid`
51 up=`ps up $pid | wc -l`
56 cecho " * Great, ${host} is already running!"
59 BOOTING_HOSTS="$BOOTING_HOSTS ${host}"
62 UMLHOSTFS=$BUILDDIR/root-fs/gentoo-fs-${host}
63 [ -f $UMLHOSTFS ] || die "!! uml root file system '$UMLHOSTFS' not found"
65 cecho-n " * Starting ${host}.."
66 eval konsole -title ${host} --geometry "+${x0}+${y0}" -e "$UMLKERNEL \
70 mem=${MEM}M con=pty con0=fd:0,fd:1" &
78 if [ -z "$BOOTING_HOSTS" ]
83 cecho " * Waiting for the uml instances to finish booting"
85 for host in $BOOTING_HOSTS
87 cecho-n " * Checking on $host.."
89 while [ $count -lt $count_max ] && [ ! -d ~/.uml/$host ]
96 if [ $count -ge $count_max ]
102 up=`uml_mconsole $host proc net/route 2> /dev/null | grep eth0 | wc -l`
104 while [ $count -lt $count_max ] && [ $up -eq 0 ]
108 up=`uml_mconsole $host proc net/route 2> /dev/null | grep eth0 | wc -l`
112 if [ $count -ge $count_max ]
120 if [ "$host" = "alice" ]
122 eval ipv4_${host}="`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $1 }' | awk '{ print $1 }'`"
123 ssh $ipv4_alice /etc/init.d/net.eth1 stop
127 cecho " * All uml instances are up now"