+apply_nic_workaround() {
+ # release specific stuff
+ case "$DEBIAN_VERSION" in
+ stretch|buster|bullseye|unstable|sid)
+ ;;
+ *)
+ echo "* Debian $DEBIAN_VERSION doesn't require NIC workaround"
+ return 0
+ ;;
+ esac
+
+ if ! mountpoint "${TARGET}" &>/dev/null ; then
+ echo "* Mounting target system"
+ mount "${INSTALL_TARGET}" "${TARGET}"
+ fi
+
+ echo "* Disabling predictable network interface names for Debian $DEBIAN_VERSION"
+ ln -s /dev/null "${TARGET}/etc/udev/rules.d/80-net-setup-link.rules"
+
+ echo "* Rebuilding initramfs to include udev configuration change"
+ chroot "${TARGET}" update-initramfs -u -k all
+}
+