]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Install a more specific match when --network-veth is used (#906)
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 18 Feb 2022 10:46:26 +0000 (10:46 +0000)
committerGitHub <noreply@github.com>
Fri, 18 Feb 2022 10:46:26 +0000 (10:46 +0000)
* Install a more specific match when --network-veth is used

When doing more complicated network stuff in a QEMU VM, the network
file we install starts matching stuff it shouldn't match. Let's narrow
the match down by driver so we don't accidentally match against stuff
we don't want to match against.

Co-authored-by: Jörg Behrmann <behrmann@physik.fu-berlin.de>
NEWS.md
mkosi/__init__.py

diff --git a/NEWS.md b/NEWS.md
index 7534514181222e6cec8c0c8f3797b1fe6e440fe6..908c4b0d0afcf372e35024606f31c9915cf09ca5 100644 (file)
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,16 @@
 # mkosi Changelog
 
+## v13
+
+- The networkd config file installed by mkosi when the --network-veth option is
+  used (/etc/systemd/network/80-mkosi-network-veth.network in the image) now only matches against network interfaces using the virtio_net driver.
+  Please make sure you weren't relying on this file to configure any network
+  interfaces other than the tun/tap virtio-net interface created by mkosi when
+  booting the image in QEMU with the --network-veth option. If you were relying
+  on this config file to configure other interfaces, you'll have to re-create it
+  with the correct match and a lower initial number in the filename to make sure networkd will keep configuring your
+  interface, e.g. via the `mkosi.skeleton` or `mkosi.extra` trees or a `mkosi.postinst` script.
+
 ## v12
 
 - Fix handling of baselayout in Gentoo installations.
index 973e98dca3dba4eab19f2750d4f2f5e9eb99427b..28538f44b86c947b7d44f8a8f2aea08df1fe121f 100644 (file)
@@ -6924,6 +6924,7 @@ def setup_network_veth(args: MkosiArgs, root: Path, do_run_build_script: bool, c
                     [Match]
                     Virtualization=!container
                     Type=ether
+                    Driver=virtio_net
 
                     [Network]
                     DHCP=yes