From cfe08b9c7149a5dc1b70d665ce918cede8e484ba Mon Sep 17 00:00:00 2001 From: Nik Lutz Date: Wed, 18 May 2016 18:20:33 +0200 Subject: Replacing systemd-nspawn '--network-bridge=' with one config file per interface in /etc/network/interfaces.d. Signed-off-by: Daniel Baumann --- share/config/container.conf.in | 2 +- share/scripts/debconf | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/config/container.conf.in b/share/config/container.conf.in index f7d01be..5ea342a 100644 --- a/share/config/container.conf.in +++ b/share/config/container.conf.in @@ -2,6 +2,7 @@ [start] cnt.autostart=@CNT_AUTOSTART@ +cnt.network-bridge=@CNT_NETWORK_BRIDGE@ bind=@BIND@ boot=@BOOT@ capability=@CAPABILITY@ @@ -9,7 +10,6 @@ directory=@DIRECTORY@ drop-capability=@DROP_CAPABILITY@ machine=@MACHINE@ network-veth-extra=@NETWORK_VETH_EXTRA@ -network-bridge=@NETWORK_BRIDGE@ link-journal=@LINK_JOURNAL@ register=@REGISTER@ diff --git a/share/scripts/debconf b/share/scripts/debconf index bbdd65c..3bacbeb 100755 --- a/share/scripts/debconf +++ b/share/scripts/debconf @@ -902,12 +902,12 @@ Commands () fi # config (FIXME) - sed -i -e "s|^network-bridge=.*|network-bridge=${NETWORK0_BRIDGE}|" "${CONFIG}/${NAME}.conf" # maximum of 15 characters, prefix is 'veth-' HOSTNAME_SHORT="$(echo ${NAME} | cut -c-8)" HOST_INTERFACE_NAME="$(echo ${NETWORK0_VETH:-veth-${HOSTNAME_SHORT}-0})" + sed -i -e "s|^cnt.network-bridge=.*|cnt.network-bridge=${HOST_INTERFACE_NAME}:${NETWORK0_BRIDGE:-br0}|g" "${CONFIG}/${NAME}.conf" sed -i -e "s|^network-veth-extra=.*|network-veth-extra=${HOST_INTERFACE_NAME}:eth0|g" "${CONFIG}/${NAME}.conf" for NUMBER in $(seq 1 ${NETWORK_NUMBER}) @@ -925,6 +925,9 @@ Commands () CONTAINER_INTERFACE_NAME="eth${NUMBER}" sed -i -e "/^register=.*/ a network-veth-extra=${HOST_INTERFACE_NAME}:${CONTAINER_INTERFACE_NAME}" "${CONFIG}/${NAME}.conf" + + eval BRIDGE="$`echo NETWORK${NUMBER}_BRIDGE`" + sed -i -e "/^register=.*/ a cnt.network-bridge=${HOST_INTERFACE_NAME}:${BRIDGE:-br${NUMBER}}" "${CONFIG}/${NAME}.conf" done # Setting root password -- cgit v1.2.3