]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
debian: enable resolved and symlink /etc/resolv.conf 746/head
authorLuca Boccassi <luca.boccassi@microsoft.com>
Fri, 18 Jun 2021 17:28:08 +0000 (18:28 +0100)
committerLuca Boccassi <luca.boccassi@microsoft.com>
Wed, 30 Jun 2021 10:27:42 +0000 (11:27 +0100)
By default resolved is disabled, and /etc/resolv.conf is an actual file with
'nameserver 127.0.0.1'.

mkosi/__init__.py

index 48099171deb790dd51e456646e3433ff8d1e6358..67910a3c3def1093a3d87ba9916f466613d26cb3 100644 (file)
@@ -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: