TT#37257 Do not add virtual interfaces to the list

This list is used to add all network interfaces to network.yml but
we do not need to add virtual interfaces there - they will be added
automatically from installation's configuration.

Change-Id: I3f21abc066b4f0c714b1780dcfdf4335e7506d1d
changes/63/22763/5
Mykola Malkov 7 years ago
parent a3fd9b3836
commit f29c8e641f

@ -1202,21 +1202,15 @@ EOF
# get list of available network devices
# (excl. some known-to-be-irrelevant ones, also see MT#8297)
net_devices=( $(tail -n +3 /proc/net/dev | sed -r 's/^ *([0-9a-zA-Z]+):.*$/\1/g' | \
grep -ve '^vmnet' -ve '^vboxnet' -ve '^docker' -ve '^usb' | sort -u) )
net_devices+=("${DEFAULT_INSTALL_DEV}")
net_devices+=("${INTERNAL_DEV}")
net_devices+=("${EXTERNAL_DEV}")
# avoid duplicates
NETWORK_DEVICES="$(printf "%s\n" "${net_devices[@]}" | sort -u)"
unset net_devices
NETWORK_DEVICES="$(tail -n +3 /proc/net/dev | sed -r 's/^ *([0-9a-zA-Z]+):.*$/\1/g' | \
grep -ve '^vmnet' -ve '^vboxnet' -ve '^docker' -ve '^usb' -ve '^vlan' -ve '^bond' | sort -u)"
if "$PRO_EDITION" && [[ $(imvirt) != "Physical" ]] ; then
echo "Generating udev persistent net rules."
echo "## Generated by Sipwise deployment script" > \
"${TARGET}/etc/udev/rules.d/70-persistent-net.rules"
for dev in ${NETWORK_DEVICES}; do
[[ "${dev}" =~ ^(vlan|bond|lo) ]] && continue
[[ "${dev}" =~ ^lo ]] && continue
mac=$(udevadm info -a -p "/sys/class/net/${dev}" | sed -nr 's/^ *ATTR\{address\}=="(.+)".*$/\1/p')
if [[ "${mac}" =~ ^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$ ]]; then

Loading…
Cancel
Save