]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Networking improvements
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 20 Sep 2023 21:03:56 +0000 (23:03 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 21 Sep 2023 10:40:32 +0000 (12:40 +0200)
- ip= is also parsed by the kernel and can cause significant boot
  delays. We can avoid these delays by passing ip=none as the final
  value which doesn't affect network-generator but does disable the
  kernel auto-probing.
- Pull in network.target instead of network-online.target. This
  makes sure that systemd-networkd is started without introducing
  boot delays because we're waiting for an IP address to appear.

mkosi/config.py

index f2341464c02a005d882b7d0aad6773af8298a67f..e91da67398d27daed91eef49fac6a89f2167f262 100644 (file)
@@ -2178,13 +2178,13 @@ def load_kernel_command_line_extra(args: argparse.Namespace) -> list[str]:
         f"systemd.tty.rows.ttyS0={lines}",
         "console=ttyS0",
         # Make sure we set up networking in the VM/container.
-        "systemd.wants=network-online.target",
+        "systemd.wants=network.target",
         # Make sure we don't load vmw_vmci which messes with virtio vsock.
         "module_blacklist=vmw_vmci",
     ]
 
     if not any(s.startswith("ip=") for s in args.kernel_command_line_extra):
-        cmdline += ["ip=enp0s1:any", "ip=enp0s2:any", "ip=host0:any"]
+        cmdline += ["ip=enp0s1:any", "ip=enp0s2:any", "ip=host0:any", "ip=none"]
 
     if not any(s.startswith("loglevel=") for s in args.kernel_command_line_extra):
         cmdline += ["loglevel=4"]