瀏覽代碼

Make it possible to override bridge if for LXC

For example Ubuntu installs a bridge called `virbr0` by default for LXC.
Using this system-provided bridge avoids having to configure one
specifically before gitian building.

This commits makes it possible to override the bridge used by gitian
using the environment variable LXC_BRIDGE. The default is still to use
`br0` as before.
pull/52/head
Wladimir J. van der Laan 8 年之前
父節點
當前提交
4e90888bcf
  1. 2
      etc/lxc.config.in
  2. 6
      libexec/config-lxc

2
etc/lxc.config.in

@ -30,5 +30,5 @@ lxc.mount.entry=sysfs ROOTFS/sys sysfs defaults 0 0 @@ -30,5 +30,5 @@ lxc.mount.entry=sysfs ROOTFS/sys sysfs defaults 0 0
# the environment variables GITIAN_HOST_IP and LXC_GUEST_IP appropriately.
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.link = GUESTLINK
lxc.network.ipv4 = GUESTIP/24

6
libexec/config-lxc

@ -6,4 +6,8 @@ if [ -z "$LXC_GUEST_IP" ]; then @@ -6,4 +6,8 @@ if [ -z "$LXC_GUEST_IP" ]; then
LXC_GUEST_IP=10.0.2.5
fi
sed "s;ROOTFS;$wd/target-$LXC_SUITE-$LXC_ARCH;;s;ARCH;$LXC_ARCH;g;;s;GUESTIP;$LXC_GUEST_IP;g" < etc/lxc.config.in > var/lxc.config
if [ -z "$LXC_BRIDGE" ]; then
LXC_BRIDGE=br0
fi
sed "s;ROOTFS;$wd/target-$LXC_SUITE-$LXC_ARCH;;s;ARCH;$LXC_ARCH;g;;s;GUESTIP;$LXC_GUEST_IP;g;s;GUESTLINK;$LXC_BRIDGE;g" < etc/lxc.config.in > var/lxc.config

Loading…
取消
儲存