iankelling.org
/
git
/
automated-distro-installer
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update to 72d79e141d3aaf430bb44f6036a2980f3f5865bd
[automated-distro-installer]
/
fai
/
config
/
scripts
/
DEBIAN
/
30-interface
diff --git
a/fai/config/scripts/DEBIAN/30-interface
b/fai/config/scripts/DEBIAN/30-interface
index 34c98e81aa5591b790912bf64a26b1dd84d4f625..4b0dcf438850ea0036fc4b790b03edfa33de7d4a 100755
(executable)
--- a/
fai/config/scripts/DEBIAN/30-interface
+++ b/
fai/config/scripts/DEBIAN/30-interface
@@
-38,9
+38,7
@@
iface_stanza() {
echo "iface $IFNAME inet $METHOD"
case "$METHOD" in
static)
echo "iface $IFNAME inet $METHOD"
case "$METHOD" in
static)
- echo " address $IPADDR"
- echo " netmask $NETMASK"
- echo " broadcast $BROADCAST"
+ echo " address $CIDR"
echo " gateway $GATEWAYS"
;;
esac
echo " gateway $GATEWAYS"
;;
esac
@@
-49,24
+47,26
@@
iface_stanza() {
newnicnames() {
# determine predictable network names only for stretch and above
newnicnames() {
# determine predictable network names only for stretch and above
+ local name
[ $do_init_tasks -eq 0 ] && return
[ -z "$NIC1" ] && return
[ $do_init_tasks -eq 0 ] && return
[ -z "$NIC1" ] && return
- ver=$($ROOTCMD dpkg-query --showformat='${Version}' --show udev)
- if dpkg --compare-versions $ver lt 220-7; then
- return
- fi
-
fields="ID_NET_NAME_FROM_DATABASE ID_NET_NAME_ONBOARD ID_NET_NAME_SLOT ID_NET_NAME_PATH"
for field in $fields; do
name=$(udevadm info /sys/class/net/$NIC1 | sed -rn "s/^E: $field=(.+)/\1/p")
if [[ $name ]]; then
NIC1=$name
fields="ID_NET_NAME_FROM_DATABASE ID_NET_NAME_ONBOARD ID_NET_NAME_SLOT ID_NET_NAME_PATH"
for field in $fields; do
name=$(udevadm info /sys/class/net/$NIC1 | sed -rn "s/^E: $field=(.+)/\1/p")
if [[ $name ]]; then
NIC1=$name
- break
+ return
fi
done
fi
done
- if [[ ! $name ]]; then
+
+ # try to get altname net dev
+ name=$(ip link show $NIC1 | awk '/altname / { print $2 }')
+ if [[ $name ]]; then
+ NIC1=$name
+ return
+ else
echo "$0: error: could not find systemd predictable network name. Using $NIC1."
fi
}
echo "$0: error: could not find systemd predictable network name. Using $NIC1."
fi
}
@@
-74,7
+74,7
@@
newnicnames() {
if [ -z "$NIC1" ]; then
echo "WARNING: \$NIC1 is not defined. Cannot add ethernet to /etc/network/interfaces."
fi
if [ -z "$NIC1" ]; then
echo "WARNING: \$NIC1 is not defined. Cannot add ethernet to /etc/network/interfaces."
fi
-CIDR=$(ip -
o -f inet addr show $NIC1 | awk '{print $4
}')
+CIDR=$(ip -
-br ad sh $NIC1|awk '{print $3
}')
newnicnames
case "$FAI_ACTION" in
newnicnames
case "$FAI_ACTION" in