[Fusionforge-commits] r12432 - trunk/tests/lxc

Christian Bayle cbayle at fusionforge.org
Mon Feb 28 19:47:47 CET 2011


Author: cbayle
Date: 2011-02-28 19:47:46 +0100 (Mon, 28 Feb 2011)
New Revision: 12432

Modified:
   trunk/tests/lxc/Makefile
Log:
Some more WIP


Modified: trunk/tests/lxc/Makefile
===================================================================
--- trunk/tests/lxc/Makefile	2011-02-28 17:54:25 UTC (rev 12431)
+++ trunk/tests/lxc/Makefile	2011-02-28 18:47:46 UTC (rev 12432)
@@ -2,8 +2,9 @@
 -include config.$(shell hostname)
 
 VMROOT=/var/lib/lxc/vmdebian6
+SSHPUBKEY=~$(USERCLIENT)/.ssh/id_rsa.pub
 
-default: vmdebian6-config netstaticdeb
+default: vmdebian6-config netstaticdeb installkey
 	@echo "read the Makefile to see available targets"
 
 /cgroup:
@@ -15,10 +16,16 @@
 mount:
 	sudo mount /cgroup
 
-/var/lib/lxc/vmdebian6:
+/var/lib/lxc/vmdebian6: /usr/bin/lxc-info bridging
 	sudo mkdir $@
 	sudo LANG=C MIRROR=$(DEBMIRROR) SUITE=$(DIST) ./lxc-debian6 -p $@
 
+/usr/bin/lxc-info:
+	sudo apt-get install lxc bridge-utils
+
+bridging:
+	@grep -q '^iface br0 inet' /etc/network/interfaces || (echo "Please setup network bridging" && false)
+
 vmdebian6-config: /var/lib/lxc/vmdebian6
 	@grep -q lxc.utsname /var/lib/lxc/vmdebian6/config || \
 	(sudo sh -c "echo \"lxc.utsname = vmdebian6\" >> $(VMROOT)/config" ; \
@@ -53,3 +60,8 @@
 	sudo sh -c "echo \"	dns-nameservers $(IPDEBDNS)\" >> $(VMROOT)/rootfs/etc/network/interfaces" ; \
 	sudo sh -c "echo \"	dns-search $(IPDEBDOMAIN)\" >> $(VMROOT)/rootfs/etc/network/interfaces" ; \
 	)
+
+installkey:
+	[ -d $(VMROOT)/root/.ssh ] || sudo mkdir -p $(VMROOT)/root/.ssh
+	sudo cp $(SSHPUBKEY) $(VMROOT)/root/.ssh/authorized_keys
+	sudo cp ssh/ssh_host_* $(VMROOT)/etc/ssh/




More information about the Fusionforge-commits mailing list