2 # starts the UML instances with a hidden screen
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
42 if [ -d ~/.uml/${host} ]
44 pid=`cat ~/.uml/${host}/pid`
45 up=`ps up $pid | wc -l`
50 cecho " * Great, ${host} is already running!"
53 BOOTING_HOSTS="$BOOTING_HOSTS ${host}"
56 UMLHOSTFS=$BUILDDIR/root-fs/gentoo-fs-${host}
57 [ -f $UMLHOSTFS ] || die "!! uml root file system '$UMLHOSTFS' not found"
59 cecho-n " * Starting ${host}.."
60 eval screen -dmS ${host} "$UMLKERNEL \
64 mem=${MEM}M con=pty con0=fd:0,fd:1"
69 if [ -z "$BOOTING_HOSTS" ]
74 cecho " * Waiting for the uml instances to finish booting"
76 for host in $BOOTING_HOSTS
78 cecho-n " * Checking on $host.."
80 while [ $count -lt $count_max ] && [ ! -d ~/.uml/$host ]
87 if [ $count -ge $count_max ]
93 up=`uml_mconsole $host proc net/route 2> /dev/null | grep eth0 | wc -l`
95 while [ $count -lt $count_max ] && [ $up -eq 0 ]
99 up=`uml_mconsole $host proc net/route 2> /dev/null | grep eth0 | wc -l`
103 if [ $count -ge $count_max ]
112 cecho " * All uml instances are up now"