summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-containers/lxc/lxc_1.0.7.bb33
1 files changed, 33 insertions, 0 deletions
diff --git a/recipes-containers/lxc/lxc_1.0.7.bb b/recipes-containers/lxc/lxc_1.0.7.bb
index b1f47391..ecad31c9 100644
--- a/recipes-containers/lxc/lxc_1.0.7.bb
+++ b/recipes-containers/lxc/lxc_1.0.7.bb
@@ -103,3 +103,36 @@ pkg_postinst_${PN}() {
103 /etc/init.d/populate-volatile.sh update 103 /etc/init.d/populate-volatile.sh update
104 fi 104 fi
105} 105}
106
107pkg_postinst_${PN}-setup() {
108 if [ "x$D" != "x" ]; then
109 exit 1
110 fi
111
112 # setup for our bridge
113 echo "lxc.network.link=lxcbr0" >> ${sysconfdir}/lxc/default.conf
114
115cat >> /etc/network/interfaces << EOF
116
117auto lxcbr0
118iface lxcbr0 inet dhcp
119 bridge_ports eth0
120 bridge_fd 0
121 bridge_maxwait 0
122EOF
123
124cat<<EOF>/etc/network/if-pre-up.d/lxcbr0
125#! /bin/sh
126
127if test "x\$IFACE" = xlxcbr0 ; then
128 brctl show |grep lxcbr0 > /dev/null 2>/dev/null
129 if [ \$? != 0 ] ; then
130 brctl addbr lxcbr0
131 brctl addif lxcbr0 eth0
132 ip addr flush eth0
133 ifconfig eth0 up
134 fi
135fi
136EOF
137chmod 755 /etc/network/if-pre-up.d/lxcbr0
138}