From 4829a1577751fb3d7222a9038b7c8d9e99856576 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Fri, 18 Jun 2021 18:28:08 +0100 Subject: [PATCH] debian: enable resolved and symlink /etc/resolv.conf By default resolved is disabled, and /etc/resolv.conf is an actual file with 'nameserver 127.0.0.1'. --- mkosi/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 48099171d..67910a3c3 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -2348,6 +2348,12 @@ def install_debian_or_ubuntu(args: CommandLineArguments, root: str, *, do_run_bu # Debian still has pam_securetty module enabled disable_pam_securetty(root) + if args.distribution == Distribution.debian: + # The default resolv.conf points to 127.0.0.1, and resolved is disabled + os.unlink(os.path.join(root, "etc/resolv.conf")) + os.symlink("../run/systemd/resolve/resolv.conf", os.path.join(root, "etc/resolv.conf")) + run(["systemctl", "--root", root, "enable", "systemd-resolved"]) + @complete_step("Installing Debian") def install_debian(args: CommandLineArguments, root: str, do_run_build_script: bool) -> None: -- 2.47.2