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
17 . $PWD/scripts/function.sh
21 HOSTS=$STRONGSWANHOSTS
34 if [ -d ~/.uml/${host} ]
36 pid=`cat ~/.uml/${host}/pid`
37 up=`ps up $pid | wc -l`
42 cecho " * Great, ${host} is already running!"
45 BOOTING_HOSTS="$BOOTING_HOSTS ${host}"
48 UMLHOSTFS=$BUILDDIR/root-fs/${host}.img
49 [ -f $UMLHOSTFS ] || die "!! uml root file system '$UMLHOSTFS' not found"
51 cecho-n " * Starting ${host}.."
52 eval setsid $UMLKERNEL umid=${host} ubda=$UMLHOSTFS \$SWITCH_${host} mem=${MEM}M con=null con1=xterm >>$LOGFILE 2>&1 &
57 if [ -z "$BOOTING_HOSTS" ]
62 cecho " * Waiting for the uml instances to finish booting"
64 for host in $BOOTING_HOSTS
66 cecho-n " * Checking on $host.."
68 while [ $count -lt $count_max ] && [ ! -d ~/.uml/$host ]
75 if [ $count -ge $count_max ]
81 up=`uml_mconsole $host proc net/route 2> /dev/null | grep eth0 | wc -l`
83 while [ $count -lt $count_max ] && [ $up -eq 0 ]
87 up=`uml_mconsole $host proc net/route 2> /dev/null | grep eth0 | wc -l`
91 if [ $count -ge $count_max ]
101 cecho " * All uml instances are up now"