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.
lxc
Wladimir J. van der Laan 10 years ago
parent 5785dfc3ae
commit 4e90888bcf

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