From e172345dc1608e313ae8d952f3323df21c1e55b2 Mon Sep 17 00:00:00 2001 From: Anthony PERARD Date: Fri, 18 Aug 2023 11:55:11 +0100 Subject: [PATCH] Disable persistent net generator on Bookworm MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This schema doesn't work. Even if the udev rule is there, the name of the different NIC are different from one boot to the next. On a machine (sabro*) with 3 different NIC, the name of each interface is basically random and could take on of three name, "eth[0-2]". net.ifnames=0 does still mean that we have "eth*" names, but the generated file "75-persistent-net-generator" doesn't seems to name the interfaces as expected. The new predictable network interface names schema seems to work well enough. The names are still the same after rebooting into Xen, at least on the few machine tested so far. But, we will change to a "mac" name policy in a follow-up commit. Signed-off-by: Anthony PERARD Acked-by: Roger Pau Monné --- Osstest/Debian.pm | 12 +++++++----- ts-host-install | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm index cf5a3bd..102b024 100644 --- a/Osstest/Debian.pm +++ b/Osstest/Debian.pm @@ -87,10 +87,12 @@ sub debian_boot_setup ($$$$$;$) { $kopt .= ' '.$targkopt; } - # https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/ - # In fact these are anything but predictable. We use the scheme - # from Debian jessie and earlier, persistent-net-generator etc. - $kopt .= ' net.ifnames=0'; + if ($ho->{Suite} =~ m/stretch|buster/) { + # https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/ + # In fact these are anything but predictable. We use the scheme + # from Debian jessie and earlier, persistent-net-generator etc. + $kopt .= ' net.ifnames=0'; + } foreach my $hook ($hooks ? @$hooks : ()) { my $bo_hook= $hook->{EditBootOptions}; @@ -800,7 +802,7 @@ sub debian_overlays ($$) { # network device names', is the default; but it is anything but # predictable, so we disable it. Instead, we restore the # 75-persistent-net-generator mechanism from jessie and earlier. - $maybe->("overlay-persistent-net") if $ho->{Suite} !~ m/wheezy|jessie/; + $maybe->("overlay-persistent-net") if $ho->{Suite} =~ m/stretch|buster/; $maybe->("overlay-$suite"); $maybe->($c{OverlayLocal}, 'overlay-local.tar'); diff --git a/ts-host-install b/ts-host-install index 17a1bf7..8848103 100755 --- a/ts-host-install +++ b/ts-host-install @@ -214,7 +214,7 @@ sub setup_netboot_firstboot($) { system qw(rm -rf --),"$initrd_overlay.d"; mkdir "$initrd_overlay.d" or die "$initrd_overlay.d: $!"; - if ($ho->{Suite} !~ m/wheezy|jessie/) { + if ($ho->{Suite} =~ m/stretch|buster/) { my @cmd = (qw(cp -dR overlay-persistent-net/.), "$initrd_overlay.d/."); logm("using persistent-net-generator: @cmd"); -- 2.39.5