diff options
Diffstat (limited to 'share/scripts/debconf')
-rwxr-xr-x | share/scripts/debconf | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/share/scripts/debconf b/share/scripts/debconf index 28e95fd..24202b0 100755 --- a/share/scripts/debconf +++ b/share/scripts/debconf @@ -904,6 +904,29 @@ Commands () # 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|^network-veth-extra=.*|network-veth-extra=${HOST_INTERFACE_NAME}:eth0|g" "${CONFIG}/${NAME}.conf" + + for NUMBER in $(seq 1 ${NETWORK_NUMBER}) + do + eval IPV4_METHOD="$`echo NETWORK${NUMBER}_IPV4_METHOD`" + + if [ -z "${IPV4_METHOD}" ] + then + continue + fi + + eval HOST_INTERFACE_NAME="$`echo NETWORK${NUMBER}_VETH`" + + HOST_INTERFACE_NAME="$(echo ${HOST_INTERFACE_NAME:-veth-${HOSTNAME_SHORT}-${NUMBER}})" + CONTAINER_INTERFACE_NAME="eth${NUMBER}" + + sed -i -e "/^register=.*/ a network-veth-extra=${HOST_INTERFACE_NAME}:${CONTAINER_INTERFACE_NAME}" "${CONFIG}/${NAME}.conf" + done + # Setting root password echo root:${ROOT_PASSWORD} | chroot "${DIRECTORY}" chpasswd @@ -932,6 +955,8 @@ SYSTEM="${MACHINES}/${NAME}" Debconf +export NAME + # Run debconf parts for SCRIPT in /usr/share/container-tools/scripts/debconf.d/* do |