Merge "Fallback to persistent netifs names with systemd"

This commit is contained in:
Zuul 2022-02-14 21:30:06 +00:00 committed by Gerrit Code Review
commit 354417f3e6
3 changed files with 13 additions and 0 deletions

View File

@ -64,6 +64,7 @@ elif [ "$DIB_INIT_SYSTEM" == "systemd" ]; then
install -D -g root -o root -m 0644 ${SCRIPTDIR}/dhcp-interface@.service /usr/lib/systemd/system/dhcp-interface@.service install -D -g root -o root -m 0644 ${SCRIPTDIR}/dhcp-interface@.service /usr/lib/systemd/system/dhcp-interface@.service
install -D -g root -o root -m 0644 ${SCRIPTDIR}/dhcp-all-interfaces-udev.rules /etc/udev/rules.d/99-dhcp-all-interfaces.rules install -D -g root -o root -m 0644 ${SCRIPTDIR}/dhcp-all-interfaces-udev.rules /etc/udev/rules.d/99-dhcp-all-interfaces.rules
sed -i "s/TimeoutStartSec=DIB_DHCP_TIMEOUT/TimeoutStartSec=$(( ${DIB_DHCP_TIMEOUT:-30} * 2 ))s/" /usr/lib/systemd/system/dhcp-interface@.service sed -i "s/TimeoutStartSec=DIB_DHCP_TIMEOUT/TimeoutStartSec=$(( ${DIB_DHCP_TIMEOUT:-30} * 2 ))s/" /usr/lib/systemd/system/dhcp-interface@.service
install -D -g root -o root -m 0644 ${SCRIPTDIR}/udev-net-setup-link.rules /etc/udev/rules.d/80-net-setup-link.rules
elif [ "$DIB_INIT_SYSTEM" == "sysv" ]; then elif [ "$DIB_INIT_SYSTEM" == "sysv" ]; then
install -D -g root -o root -m 0755 ${SCRIPTDIR}/dhcp-all-interfaces.init /etc/init.d/dhcp-all-interfaces install -D -g root -o root -m 0755 ${SCRIPTDIR}/dhcp-all-interfaces.init /etc/init.d/dhcp-all-interfaces
update-rc.d dhcp-all-interfaces defaults update-rc.d dhcp-all-interfaces defaults

View File

@ -0,0 +1,12 @@
---
fixes:
- |
The dhcp-all-interfaces element does not work correctly with the new
"predictable names" scheme for network interfaces.
During boot the name of the interfaces is changed from ethX to the new
scheme, for example enpXsX; this name change is not detected by udev de
facto making the udev rule of the dhcp-all-interfaces element useless;
this causes the machine booted with the image including the dhcp-all-interfaces
element to not get any ip and so being unreachable from the network.
This patch includes a workaround to fallback to the "persistent names"
scheme allowing the dhcp-all-interfaces element to work again as intended.