Skip to content

Commit

Permalink
Drop networkd not running to a warning instead of a fatal error
Browse files Browse the repository at this point in the history
Without networkd, the veth link won't come up properly on the host
but that doesn't prevent mkosi boot or mkosi qemu from working so
let's drop those messages to warnings instead of fatal errors.
  • Loading branch information
DaanDeMeyer committed Jan 21, 2021
1 parent 6954c81 commit d66e72b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mkosi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6092,10 +6092,15 @@ def has_networkd_vm_vt() -> bool:
def ensure_networkd(args: CommandLineArguments) -> None:
networkd_is_running = run(["systemctl", "is-active", "--quiet", "systemd-networkd"], check=False).returncode == 0
if not networkd_is_running:
die("--network-veth requires systemd-networkd to be running (`systemctl enable --now systemd-networkd`)")
warn(
"""
--network-veth requires systemd-networkd to be running to initialize the host interface of the
veth link (`systemctl enable --now systemd-networkd`)")
"""
)

if args.verb == "qemu" and not has_networkd_vm_vt():
die(
warn(
r"""
mkosi didn't find 80-vm-vt.network. This is one of systemd's built-in systemd-networkd config
files which configures vt-* interfaces. mkosi needs this file in order for --network-veth to work
Expand Down

0 comments on commit d66e72b

Please sign in to comment.