Masato Taruishi
taru****@users*****
2004年 9月 28日 (火) 00:15:45 JST
=================================================================== RCS file: demo/uml/20uml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- demo/uml/20uml 2004/07/22 12:37:01 1.4 +++ demo/uml/20uml 2004/09/27 15:15:45 1.5 @@ -35,6 +35,7 @@ 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") fi # Parsing configuration file =================================================================== RCS file: demo/uml/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- demo/uml/Makefile.am 2004/06/29 12:15:26 1.1 +++ demo/uml/Makefile.am 2004/09/27 15:15:45 1.2 @@ -10,7 +10,8 @@ templatedir = $(sysconfdir)/ultrapossum/in.d template_DATA = rootstrap.conf.in -modulelocal_SCRIPTS = map rootstrap.sh uml-run createrootfs.sh boot +modulelocal_SCRIPTS = map rootstrap.sh uml-run createrootfs.sh \ + shutdown boot runlist rootstrapmodulesdir = $(sysconfdir)/rootstrap/modules rootstrapmodules_SCRIPTS = ultrapossum @@ -19,5 +20,7 @@ update-uml \ 20uml \ rootstrap.conf.in \ - boot + boot \ + shutdown \ + runlist =================================================================== RCS file: demo/uml/boot,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- demo/uml/boot 2004/07/22 12:37:01 1.10 +++ demo/uml/boot 2004/09/27 15:15:45 1.11 @@ -27,11 +27,11 @@ fi fi -if include $1 "`screen -list | grep ultrapossum | cut -d- -f2- | awk -F' ' '{print $1;}'`" +if include $1 "`$MODULEDIR/uml/runlist`" then echo "$1 already booted" 1>&2 exit 0 fi -screen -d -m -S ultrapossum-$1 $MODULEDIR/uml/uml-run $1 su -c "linux ubd0=$root con0=fd:0,fd:1 con=pts mem=$UML_MEM eth0=tuntap,$host_if,,$host eth1=mcast,,$UML_MULTICASTADDR" $UML_USER +screen -d -m -S ultrapossum-$1 $MODULEDIR/uml/uml-run $1 su -c "linux ubd0=$root con0=fd:0,fd:1 con=pts mem=$UML_MEM eth0=tuntap,$host_if,,$host eth1=mcast,,$UML_MULTICASTADDR umid=$1 uml_dir=$UMLDIR/$1/" $UML_USER =================================================================== RCS file: demo/uml/map,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- demo/uml/map 2004/07/23 07:48:34 1.3 +++ demo/uml/map 2004/09/27 15:15:45 1.4 @@ -51,6 +51,6 @@ echo "host_if=tap$id" echo "ultrapossum_packages='$pkgs'" echo "local_gateway=$local_gateway" -echo "local_net=192.168.0.$id" +echo "local_net=$UML_LOCALNETPREFIX.$id" echo "local_host=$local_host" =================================================================== RCS file: demo/uml/rootstrap.conf.in,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- demo/uml/rootstrap.conf.in 2004/07/23 07:48:34 1.5 +++ demo/uml/rootstrap.conf.in 2004/09/27 15:15:45 1.6 @@ -119,6 +119,7 @@ ultrapossum_packages=#ULTRAPOSSUM_PACKAGES# ultrapossum_hosts=#ULTRAPOSSUM_HOSTS# ultrapossum_local_net=#ULTRAPOSSUM_LOCALNET# +ultrapossum_localnet=#UML_LOCALNETPREFIX#.0/24 ultrapossum_local_gateway=#ULTRAPOSSUM_LOCALGATEWAY# ultrapossum_local_host=#ULTRAPOSSUM_LOCALHOST# =================================================================== RCS file: demo/uml/rootstrap.sh,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- demo/uml/rootstrap.sh 2004/07/22 12:37:01 1.4 +++ demo/uml/rootstrap.sh 2004/09/27 15:15:45 1.5 @@ -24,5 +24,6 @@ -e "s/#ULTRAPOSSUM_LOCALGATEWAY#/$local_gateway/" \ -e "s/#ULTRAPOSSUM_LOCALNET#/$local_net/" \ -e "s/#ULTRAPOSSUM_LOCALHOST#/$local_host/" \ + -e "s/#UML_LOCALNETPREFIX#/$UML_LOCALNETPREFIX/" \ < $UML_ROOTSTRAP_CONF_IN =================================================================== RCS file: demo/uml/ultrapossum,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- demo/uml/ultrapossum 2004/07/23 07:48:34 1.6 +++ demo/uml/ultrapossum 2004/09/27 15:15:45 1.7 @@ -26,9 +26,9 @@ EOF else cat >> $TARGET/etc/network/interfaces <<EOF - up /sbin/iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE + up /sbin/iptables -A POSTROUTING -t nat -s $ultrapossum_localnet -j MASQUERADE up echo 1 > /proc/sys/net/ipv4/ip_forward - down /sbin/iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE + down /sbin/iptables -D POSTROUTING -t nat -s $ultrapossum_localnet -j MASQUERADE EOF cat >> $TARGET/etc/modules <<EOF ip_vs_rr @@ -42,4 +42,10 @@ echo "SLAVES=\"$SLURPDSLAVES\"" >> $TARGET/etc/ultrapossum/ultrapossum.cf echo "VIRTUALSLAVE=\"$uml\"" >> $TARGET/etc/ultrapossum/ultrapossum.cf fi + +# Ctrl-Alt-Delete hack +/bin/cp -p $TARGET/etc/inittab $TARGET/etc/inittabT +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/" =================================================================== RCS file: demo/uml/uml.cf,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- demo/uml/uml.cf 2004/07/02 10:39:09 1.2 +++ demo/uml/uml.cf 2004/09/27 15:15:45 1.3 @@ -16,3 +16,5 @@ #UML_ULTRAPOSSUM_EXTRA_PACKAGES="ultrapossum-snmp ultrapossum-slapd" +#UML_LOCALNETPREFIX="192.168.0" +