diff --git a/diskimage_builder/elements/dhcp-all-interfaces/install.d/50-dhcp-all-interfaces b/diskimage_builder/elements/dhcp-all-interfaces/install.d/50-dhcp-all-interfaces index e2fa33ab..2b6e4ce6 100755 --- a/diskimage_builder/elements/dhcp-all-interfaces/install.d/50-dhcp-all-interfaces +++ b/diskimage_builder/elements/dhcp-all-interfaces/install.d/50-dhcp-all-interfaces @@ -72,7 +72,6 @@ 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-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 - 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 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 diff --git a/diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interfaces-udev.rules b/diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interfaces-udev.rules index a8c3cf51..39835f1a 100644 --- a/diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interfaces-udev.rules +++ b/diskimage_builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interfaces-udev.rules @@ -1 +1 @@ -SUBSYSTEM=="net", KERNEL!="lo", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}+="dhcp-interface@$name.service" +SUBSYSTEM=="net", KERNEL!="lo", ACTION=="add|move", TAG+="systemd", ENV{SYSTEMD_WANTS}+="dhcp-interface@$name.service" diff --git a/diskimage_builder/elements/dhcp-all-interfaces/install.d/udev-net-setup-link.rules b/diskimage_builder/elements/dhcp-all-interfaces/install.d/udev-net-setup-link.rules deleted file mode 100644 index e69de29b..00000000 diff --git a/releasenotes/notes/dhcp-all-interfaces-debian-issue-2ec7f1a5186f0b16.yaml b/releasenotes/notes/dhcp-all-interfaces-debian-issue-2ec7f1a5186f0b16.yaml new file mode 100644 index 00000000..e2d46cf1 --- /dev/null +++ b/releasenotes/notes/dhcp-all-interfaces-debian-issue-2ec7f1a5186f0b16.yaml @@ -0,0 +1,20 @@ +issues: + - | + The dhcp-all-interfaces element attempts to work with "predictable + interface names". During boot the name of the interfaces is changed from + ethX to the new scheme, for example enpXsX; depending on the Linux kernel + this move may be captured by udev as an "add" or "move" event. The + dhcp-all-interfaces udev rule has been updated to match against both + possible events. If you prefer to not use predictable names your image + builds can set DIB_BOOTLOADER_DEFAULT_CMDLINE with net.ifnames=0 or mask + the default policy with `ln -s /dev/null /etc/systemd/network/99-default.link`. + This process is documented by systemd: + https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/ + + Note that this update reverts previous changes to disable predictable + interface names completely when using dhcp-all-interfaces. Predictable + device names were disabled in an effort to make dhcp-all-interfaces + function on Debian Bullseye, but this broke any users that wished to + use predictable device names. Instaed we make predictable device names + work on Debian Bullseye and allow users to disable predictable device + names should they choose to.