Merge "debootstrap: make default network interface names configurable"

This commit is contained in:
Zuul 2019-06-28 06:30:45 +00:00 committed by Gerrit Code Review
commit 091a4e2c6e
3 changed files with 10 additions and 2 deletions

View file

@ -69,7 +69,14 @@ Networking
By default ``/etc/network/interfaces.d/eth[0|1]`` files will be
created and enabled with DHCP networking. If you do not wish this to
be done, set ``DIB_APT_MINIMAL_CREATE_INTERFACES`` to ``0``.
be done, set ``DIB_APT_MINIMAL_CREATE_INTERFACES`` to ``0``. If you
need different interface names than ``eth[0|1]`` set
``DIB_NETWORK_INTERFACE_NAMES`` to a space separated list of network
interface names like:
.. code-block:: bash
export DIB_NETWORK_INTERFACE_NAMES="ens3 ens4"
-------------------
Note on ARM systems

View file

@ -0,0 +1 @@
export DIB_NETWORK_INTERFACE_NAMES=${DIB_NETWORK_INTERFACE_NAMES:-eth0 eth1}

View file

@ -35,7 +35,7 @@ if [[ "${DIB_APT_MINIMAL_CREATE_INTERFACES:-1}" -eq "1" ]]; then
echo "source /etc/network/interfaces.d/*" >> /etc/network/interfaces
echo 'Network configuration set to source /etc/network/interfaces.d/*'
fi
for interface in eth0 eth1; do
for interface in ${DIB_NETWORK_INTERFACE_NAMES}; do
cat << EOF | tee /etc/network/interfaces.d/$interface
auto $interface
iface $interface inet dhcp