From 6d2d8535556013c93c04f7cceb1f2e00eab66d7d Mon Sep 17 00:00:00 2001 From: Eugene Blikh Date: Tue, 19 May 2026 11:47:53 +0300 Subject: [PATCH] =?UTF-8?q?patches:=20ubuntu/genimg=20=E2=80=94=20widen=20?= =?UTF-8?q?systemd-networkd=20match=20to=20Name=3Den*?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Third hunk in the ubuntu/genimg patch. Upstream only writes 25-ens3.network matching Name=ens3, but on modern noble + virtio the kernel names the interface enp0s3 instead, so DHCP never starts and the build-worker times out in 'Waiting for guest to settle'. Rename the file to 25-ethernet.network and broaden [Match] Name= to en*. --- patches/builds-images-ubuntu-genimg.patch | 32 +++++++++++++++++++---- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/patches/builds-images-ubuntu-genimg.patch b/patches/builds-images-ubuntu-genimg.patch index a4be1e220c763e0f5fe7a21adfaaae7718305a54..b598d1329f38688bca647d965611380831a0b843 100644 --- a/patches/builds-images-ubuntu-genimg.patch +++ b/patches/builds-images-ubuntu-genimg.patch @@ -1,10 +1,10 @@ From: phoebe-lab local fix -Subject: [PATCH] builds.sr.ht-images ubuntu/genimg: fix nbd settle race + host chown +Subject: [PATCH] builds.sr.ht-images ubuntu/genimg: fix nbd settle race + host chown + networkd match -Two independent fixes for the upstream `images/ubuntu/genimg` script as shipped -in the `builds.sr.ht-images` Alpine package (last verified against 0.103.12-r0). -Both bugs make image generation fail on any host that doesn't happen to satisfy -their hidden assumptions. +Three independent fixes for the upstream `images/ubuntu/genimg` script as +shipped in the `builds.sr.ht-images` Alpine package (last verified against +0.103.12-r0). All three bugs make image generation or first-boot networking +fail on any host that doesn't happen to satisfy their hidden assumptions. 1) After `qemu-nbd --connect`, the kernel hasn't picked up the device size yet, so the immediate `dd if=mbr.bin of=/dev/nbd0` fails with "No space left on @@ -17,6 +17,16 @@ their hidden assumptions. work. Routing the chown through `run_root` (the existing chroot helper used everywhere else in the file) puts it where the user actually exists. +3) `/etc/systemd/network/25-ens3.network` matches only `Name=ens3`. The kernel + actually picks the predictable name from PCI topology, and on QEMU machine + types newer than upstream's tested combo (e.g. modern noble + virtio on + i440fx slot 3) the interface comes up as `enp0s3` or similar — so the file + matches nothing, no DHCP runs, the guest has no IP, and the builds-worker + spins for 2 min `Waiting for guest to settle` before giving up. Widen the + match to any ethernet name (`Name=en*`); the image only ever has one NIC, + so there's no risk of binding the wrong one. Rename the file to drop the + stale interface-name hint. + Apply when refreshing the apk recipe tree on the image-builder host: cd /var/lib/images @@ -32,6 +42,18 @@ Apply when refreshing the apk recipe tree on the image-builder host: trap cleanup EXIT if [ "$arch" = "amd64" ] +@@ -85,9 +86,9 @@ + EOF + fi + +-cat >/mnt/etc/systemd/network/25-ens3.network </mnt/etc/systemd/network/25-ethernet.network <