[Ultrapossum-cvs 277] demo/uml ...

Back to archive index

Masato Taruishi taru****@sourc*****
2004年 7月 2日 (金) 19:39:09 JST


===================================================================
RCS file: demo/uml/20uml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- demo/uml/20uml	2004/06/29 16:57:55	1.2
+++ demo/uml/20uml	2004/07/02 10:39:09	1.3
@@ -32,6 +32,7 @@
   UML_PROXY=$(ultrapossum_getconf UML_PROXY "")
   UML_ULTRAPOSSUM_APT=$(ultrapossum_getconf UML_APT_SOURCE "http://ultrapossum.org/debian/ ./")
   UML_MEM=$(ultrapossum_getconf UML_MEM "64M")
+  UML_ULTRAPOSSUM_EXTRA_PACKAGES=$(ultrapossum_getconf UML_ULTRAPOSSUM_EXTRA_PACKAGES "")
 fi
 
 # Parsing configuration file
===================================================================
RCS file: demo/uml/boot,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- demo/uml/boot	2004/06/30 09:15:15	1.4
+++ demo/uml/boot	2004/07/02 10:39:09	1.5
@@ -27,3 +27,4 @@
 fi
 
 $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" $UML_USER
+
===================================================================
RCS file: demo/uml/createrootfs.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- demo/uml/createrootfs.sh	2004/06/29 16:57:55	1.2
+++ demo/uml/createrootfs.sh	2004/07/02 10:39:09	1.3
@@ -28,5 +28,5 @@
 
 cd $UMLDIR/$1
 
-$MODULEDIR/uml/uml-run "$1" su -c "rootstrap -u mem=$UML_MEM hda" $UML_USER || ( savelog $UMLDIR/$1/hda; exit 1 )
+$MODULEDIR/uml/uml-run "$1" su -c "rootstrap -u mem=$UML_MEM hda" $UML_USER || ( savelog $UMLDIR/$1/hda; exit 1 ) 
 
===================================================================
RCS file: demo/uml/rootstrap.conf.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- demo/uml/rootstrap.conf.in	2004/06/30 09:15:16	1.2
+++ demo/uml/rootstrap.conf.in	2004/07/02 10:39:09	1.3
@@ -117,4 +117,3 @@
 ultrapossum_apt=#UML_ULTRAPOSSUM_APT#
 ultrapossum_packages=#ULTRAPOSSUM_PACKAGES#
 ultrapossum_hosts=#ULTRAPOSSUM_HOSTS#
-
===================================================================
RCS file: demo/uml/rootstrap.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- demo/uml/rootstrap.sh	2004/06/30 09:15:16	1.2
+++ demo/uml/rootstrap.sh	2004/07/02 10:39:09	1.3
@@ -18,7 +18,7 @@
 	-e "s!#UML_MIRROR#!$UML_MIRROR!" -e "s!#UML_PROXY#!$UML_PROXY!" \
 	-e "s/#UML_NAMESERVER#/$UML_NAMESERVER/" \
 	-e "s!#UML_ULTRAPOSSUM_APT#!$UML_ULTRAPOSSUM_APT!" \
-	-e "s/#ULTRAPOSSUM_PACKAGES#/$ultrapossum_packages/" \
+	-e "s/#ULTRAPOSSUM_PACKAGES#/$UML_ULTRAPOSSUM_EXTRA_PACKAGES $ultrapossum_packages/" \
 	-e "s!#ULTRAPOSSUM_HOSTS#!$UMLDIR/hosts!" \
 		< $UML_ROOTSTRAP_CONF_IN
 
===================================================================
RCS file: demo/uml/ultrapossum,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- demo/uml/ultrapossum	2004/06/30 09:15:16	1.3
+++ demo/uml/ultrapossum	2004/07/02 10:39:09	1.4
@@ -3,7 +3,11 @@
 export DEBIAN_FRONTEND=noninteractive
 export UCF_FORCE_CONFFOLD=1
 
-cp -a /tmp/host/etc/ultrapossum $TARGET/etc/ultrapossum
+cp -a /tmp/host/var/lib/ultrapossum/uml/etc $TARGET/etc/ultrapossum
+if test -f /tmp/host/var/lib/ultrapossum/uml/ssh_known_hosts; then
+  install -d $TARGET/etc/ssh/
+  cp //tmp/host/var/lib/ultrapossum/uml/ssh_known_hosts $TARGET/etc/ssh/ssh_known_hosts
+fi
 echo "deb $ultrapossum_apt" >> $TARGET/etc/apt/sources.list
 chroot $TARGET mount -t proc proc /proc
 cat /tmp/host/$ultrapossum_hosts >> $TARGET/etc/hosts
===================================================================
RCS file: demo/uml/uml-run,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- demo/uml/uml-run	2004/06/29 12:15:26	1.1
+++ demo/uml/uml-run	2004/07/02 10:39:09	1.2
@@ -11,7 +11,7 @@
   eval `ultrapossum-config term`
   exit 1
 fi
-trap "eval `ultrapossum-config term`; tunctl -d $host_if; iptables -t nat -D POSTROUTING -s $net -d ! $net -j MASQUERADE" 0
+trap "if test "x$pid" != "x"; then kill $pid; fi;  eval `ultrapossum-config term`; tunctl -d $host_if; iptables -t nat -D POSTROUTING -s $net -d ! $net -j MASQUERADE" 0
 
 tunctl -u $UML_USER -t $host_if
 ifconfig $host_if $host up
===================================================================
RCS file: demo/uml/uml.cf,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- demo/uml/uml.cf	2004/06/29 12:15:26	1.1
+++ demo/uml/uml.cf	2004/07/02 10:39:09	1.2
@@ -14,3 +14,5 @@
 
 #UML_MEM="64M"
 
+#UML_ULTRAPOSSUM_EXTRA_PACKAGES="ultrapossum-snmp ultrapossum-slapd"
+
===================================================================
RCS file: demo/uml/update-uml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- demo/uml/update-uml	2004/07/01 18:41:58	1.5
+++ demo/uml/update-uml	2004/07/02 10:39:09	1.6
@@ -41,10 +41,23 @@
       echo "`getip $h`" $h >> $UMLDIR/hosts
     fi
   done
+  if test "x$MASTER" = "x$HOST"; then
+    echo "$MASTER `cat /etc/ssh/ssh_host_rsa_key.pub`" > $UMLDIR/ssh_known_hosts
+  fi
   chown -R $UML_USER $UMLDIR/
+  echo 1 > /proc/sys/net/ipv4/ip_forward
+  /bin/cp -a $SYSCONFDIR $UMLDIR/etc
+  /bin/chown -R $UML_USER $UMLDIR/etc
+  adjustconfig
   progress "Configuring User-Mode-Linux... done"
 }
 
+# ad-hoc?
+adjustconfig() {
+  set -x
+  ultrapossum_setconf_shell "$UMLDIR/etc/module.d/server.cf" MASTER $HOST
+}
+
 # getip <hostname>
 getip() {
   ip="`gethostip -d $1`"
@@ -58,7 +71,8 @@
 }
 
 remove() {
-  /bin/rm -f $UMLDIR/hosts
+  /bin/rm -f $UMLDIR/hosts $UMLDIR/ssh_known_hosts
+  /bin/rm -rf $UMLDIR/etc
   for h in $UML_HOSTS
   do
     /bin/rm -f $UMLDIR/$h/rootstrap.conf



Ultrapossum-cvs メーリングリストの案内
Back to archive index