Masato Taruishi
taru****@users*****
2004年 9月 29日 (水) 17:52:13 JST
=================================================================== RCS file: demo/uml/20uml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- demo/uml/20uml 2004/09/27 15:15:45 1.5 +++ demo/uml/20uml 2004/09/29 08:52:13 1.6 @@ -33,9 +33,9 @@ UML_ULTRAPOSSUM_APT=$(ultrapossum_getconf UML_ULTRAPOSSUM_APT "http://ultrapossum.org/debian/ ./") UML_ULTRAMONKEY_APT=$(ultrapossum_getconf UML_ULTRAMONKEY_APT "http://www.ultramonkey.org/download/2.0.1/ sid main") UML_MEM=$(ultrapossum_getconf UML_MEM "64M") - UML_ULTRAPOSSUM_EXTRA_PACKAGES=$(ultrapossum_getconf UML_ULTRAPOSSUM_EXTRA_PACKAGES "") UML_MULTICASTADDR=$(ultrapossum_getconf UML_MULTICASTADDR "") UML_LOCALNETPREFIX=$(ultrapossum_getconf UML_LOCALNETPREFIX "192.168.0") + UML_CONFDIR=$(ultrapossum_getconf UML_CONFDIR "$SYSCONFDIR/uml") fi # Parsing configuration file =================================================================== RCS file: demo/uml/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- demo/uml/Makefile.am 2004/09/27 15:15:45 1.2 +++ demo/uml/Makefile.am 2004/09/29 08:52:13 1.3 @@ -11,16 +11,22 @@ template_DATA = rootstrap.conf.in modulelocal_SCRIPTS = map rootstrap.sh uml-run createrootfs.sh \ - shutdown boot runlist + shutdown boot runlist selections map.cf rootstrapmodulesdir = $(sysconfdir)/rootstrap/modules rootstrapmodules_SCRIPTS = ultrapossum +install-data-local: + $(mkinstalldirs) $(DESTDIR)/$(sysconfdir)/ultrapossum/uml/ + EXTRA_DIST = \ update-uml \ 20uml \ rootstrap.conf.in \ boot \ shutdown \ - runlist + runlist \ + selections \ + map.cf + =================================================================== RCS file: demo/uml/boot,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- demo/uml/boot 2004/09/27 15:15:45 1.11 +++ demo/uml/boot 2004/09/29 08:52:13 1.12 @@ -29,7 +29,6 @@ if include $1 "`$MODULEDIR/uml/runlist`" then - echo "$1 already booted" 1>&2 exit 0 fi =================================================================== RCS file: demo/uml/map,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- demo/uml/map 2004/09/29 07:29:43 1.5 +++ demo/uml/map 2004/09/29 08:52:13 1.6 @@ -33,11 +33,11 @@ id=`num` if include "$arg" "$ULTRAMONKEYNODES"; then - pkgs="ultrapossum-ultramonkey" -else - pkgs="ultrapossum" + suggests="ultrapossum-ultramonkey" +elif include "$arg" "$MASTER $SLAVES"; then + suggests="ultrapossum" if test "x$BACKUP" != "x" && include "$arg" "$MASTER $BACKUP"; then - pkgs="$pkgs ultrapossum-failover" + suggests="$suggests ultrapossum-failover" fi if include "$arg" "$SLAVES" && test "x$ULTRAMONKEYNODES" != "x"; then eval "`$0 $(echo $ULTRAMONKEYNODES | head -1)`" @@ -46,6 +46,10 @@ fi fi +if test -f "$UML_CONFDIR/$arg/map.cf"; then + . $UML_CONFDIR/$arg/map.cf +fi + n=`echo \( $id - 1 \) \* $WIDTH | bc` echo "net=$NETPREFIX.$n/$NETMASK" @@ -53,8 +57,8 @@ echo "host=$NETPREFIX.`expr $n + 1`" echo "uml=$NETPREFIX.`expr $n + 2`" echo "host_if=tap$id" -echo "ultrapossum_packages='$pkgs'" echo "local_gateway=$local_gateway" echo "local_net=$UML_LOCALNETPREFIX.$id" echo "local_host=$local_host" +echo "suggests='$suggests'" =================================================================== RCS file: demo/uml/rootstrap.conf.in,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- demo/uml/rootstrap.conf.in 2004/09/27 15:15:45 1.6 +++ demo/uml/rootstrap.conf.in 2004/09/29 08:52:13 1.7 @@ -116,7 +116,6 @@ [ultrapossum] ultrapossum_apt=#UML_ULTRAPOSSUM_APT# ultramonkey_apt=#UML_ULTRAMONKEY_APT# -ultrapossum_packages=#ULTRAPOSSUM_PACKAGES# ultrapossum_hosts=#ULTRAPOSSUM_HOSTS# ultrapossum_local_net=#ULTRAPOSSUM_LOCALNET# ultrapossum_localnet=#UML_LOCALNETPREFIX#.0/24 =================================================================== RCS file: demo/uml/rootstrap.sh,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- demo/uml/rootstrap.sh 2004/09/27 15:15:45 1.5 +++ demo/uml/rootstrap.sh 2004/09/29 08:52:13 1.6 @@ -19,7 +19,6 @@ -e "s/#UML_NAMESERVER#/$UML_NAMESERVER/" \ -e "s!#UML_ULTRAPOSSUM_APT#!$UML_ULTRAPOSSUM_APT!" \ -e "s!#UML_ULTRAMONKEY_APT#!$UML_ULTRAMONKEY_APT!" \ - -e "s/#ULTRAPOSSUM_PACKAGES#/$UML_ULTRAPOSSUM_EXTRA_PACKAGES $ultrapossum_packages/" \ -e "s!#ULTRAPOSSUM_HOSTS#!$UMLDIR/hosts!" \ -e "s/#ULTRAPOSSUM_LOCALGATEWAY#/$local_gateway/" \ -e "s/#ULTRAPOSSUM_LOCALNET#/$local_net/" \ =================================================================== RCS file: demo/uml/ultrapossum,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- demo/uml/ultrapossum 2004/09/27 16:55:05 1.8 +++ demo/uml/ultrapossum 2004/09/29 08:52:13 1.9 @@ -54,4 +54,9 @@ sed 's!^ca.*!ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -h now!' $TARGET/etc/inittab > $TARGET/etc/inittabT mv $TARGET/etc/inittabT $TARGET/etc/inittab -chroot $TARGET /bin/sh -c "apt-get update && apt-get -y -o DPkg::Options::="--force-confold" -f install $ultrapossum_packages && run-parts --arg=stop /etc/init.d/" +host=`hostname` +selections=/etc/ultrapossum/uml/$host/selections +if test -f "$TARGET/$selections"; then + chroot $TARGET /bin/sh -c "dpkg --set-selections < $selections && apt-get update && apt-get -y -o DPkg::Options::="--force-confold" dselect-upgrade && run-parts --arg=stop /etc/init.d/" +fi + =================================================================== RCS file: demo/uml/uml.cf,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- demo/uml/uml.cf 2004/09/27 15:15:45 1.3 +++ demo/uml/uml.cf 2004/09/29 08:52:13 1.4 @@ -14,7 +14,5 @@ #UML_MEM="64M" -#UML_ULTRAPOSSUM_EXTRA_PACKAGES="ultrapossum-snmp ultrapossum-slapd" - #UML_LOCALNETPREFIX="192.168.0" =================================================================== RCS file: demo/uml/update-uml,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- demo/uml/update-uml 2004/09/27 09:09:50 1.15 +++ demo/uml/update-uml 2004/09/29 08:52:13 1.16 @@ -32,6 +32,10 @@ add_startmark "##" "$id" > $tmp for h in $UML_HOSTS do + if ! test -f "$UML_CONFDIR/$h/map.cf"; then + install -d "$UML_CONFDIR/$h" + /bin/cp $MODULEDIR/uml/map.cf $UML_CONFDIR/$h/map.cf + fi eval "`$MODULEDIR/uml/map $h`" install -d $UMLDIR/$h $MODULEDIR/uml/rootstrap.sh $h > $UMLDIR/$h/rootstrap.conf @@ -41,6 +45,13 @@ echo "$uml $h" >> $UMLDIR/hosts fi echo "$uml $h" >> $tmp + if ! test -f "$UML_CONFDIR/$h/selections"; then + /bin/cp $MODULEDIR/uml/selections $UML_CONFDIR/$h/selections + for s in $suggests + do + echo "$s install" >> $UML_CONFDIR/$h/selections + done + fi done add_endmark "##" "$id" >> $tmp @@ -105,13 +116,6 @@ echo "E: No write permission to /dev/net/tun for $UML_USER" 1>&2 exit 1 fi - for h in $UML_HOSTS - do - if ! include "$h" "$MASTER $SLAVES $ULTRAMONKEYNODES"; then - echo "Unknown host: $h" 1>&2 - exit 1 - fi - done fi }