Browse Source

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.
tags/0.1
Wladimir J. van der Laan 6 years ago
parent
commit
4e90888bcf
2 changed files with 6 additions and 2 deletions
  1. 1
    1
      etc/lxc.config.in
  2. 5
    1
      libexec/config-lxc

+ 1
- 1
etc/lxc.config.in View File

@@ -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

+ 5
- 1
libexec/config-lxc View File

@@ -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…
Cancel
Save