Bug#813141: chroot upgrade from jessie to stretch disables predictable network interface names

Ricardo Salveti rsalveti at rsalveti.net
Fri Jan 29 19:17:18 GMT 2016


Package: systemd
Version: 228-4+b1

Udev postinst (upgrade_fixes) only checks if the previous persistent
rules is available, which is not the case on a clean jessie chroot. If
you try to upgrade the chroot to stretch (when creating a rootfs image
to boot in a real device), the postinst logic will end up creating
/etc/udev/rules.d/80-net-setup-link.rules, disabling the predictable
network interface names feature.

>From udev.postinst
(https://anonscm.debian.org/cgit/pkg-systemd/systemd.git/tree/debian/udev.postinst?h=debian/228-4#n93):
upgrade_fixes() {
   ...
  # we enabled net.ifnames in 220-7 by default; don't change iface names in
  # virtualized envs (where 75-persistent-net-generator.rules didn't work)
  if dpkg --compare-versions "$2" lt-nl "220-7~" &&
     [ ! -e /etc/udev/rules.d/70-persistent-net.rules ] &&
     [ ! -e /etc/udev/rules.d/80-net-setup-link.rules ] &&
     ! grep -q net.ifnames /proc/cmdline ; then
    mkdir -p /etc/udev/rules.d
    cat <<EOF > /etc/udev/rules.d/80-net-setup-link.rules
# This machine is most likely a virtualized guest, where the old persistent
# network interface mechanism (75-persistent-net-generator.rules) did not work.
# This file disables /lib/udev/rules.d/80-net-setup-link.rules to avoid
# changing network interface names on upgrade. Please read
# /usr/share/doc/udev/README.Debian.gz about how to migrate to the currently
# supported mechanism.
EOF
  fi
  ...
}

A simple "! chrooted" there would cover this situation/



More information about the Pkg-systemd-maintainers mailing list