[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OSSTEST PATCH 27/36] ts-debian-fixup: Fix nic names for bookworm



`xen-create-image` doesn't create image for bookworm with a working
network, we need to fix the interface name.

For reference, there's a bug report upstream:
    "UnPredictableNetworkInterfaceNames 'fun' with Bookworm domU: eth0 -> enX0"
    https://github.com/xen-tools/xen-tools/issues/65

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 ts-debian-fixup | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/ts-debian-fixup b/ts-debian-fixup
index 810b3aba..4cf5f980 100755
--- a/ts-debian-fixup
+++ b/ts-debian-fixup
@@ -142,6 +142,20 @@ sub filesystems () {
 END
 }
 
+sub fix_networking () {
+    return if debian_guest_suite($gho) !~ m/bookworm/;
+
+    # `xen-create-image` doesn't setup network in a way that work with 
bookworm.
+    # The guest boots with "enX0" interface name, but it only try to setup 
"eth0".
+    # https://github.com/xen-tools/xen-tools/issues/65
+    target_editfile_root($ho, $mountpoint."/etc/network/interfaces", sub {
+        while (<::EI>) {
+            s/\beth0\b/enX0/g;
+            print ::EO or die $!;
+        }
+    });
+}
+
 sub unmount () {
     guest_umount_lv($ho, $gho);
 }
@@ -243,6 +257,7 @@ target_cmd_root($ho, debian_dhcp_rofs_fix($ho, 
$mountpoint));
 console();
 randomseed();
 filesystems();
+fix_networking();
 otherfixupcfg();
 writecfg();
 unmount();
-- 
Anthony PERARD




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.