From: Daan De Meyer Date: Fri, 28 Jul 2023 10:54:26 +0000 (+0200) Subject: run: Make sure we resolve relative /etc/resolv.conf symlinks properly X-Git-Tag: v15~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aab68ce7b6d85dce2b55e13530634933ca19e444;p=thirdparty%2Fmkosi.git run: Make sure we resolve relative /etc/resolv.conf symlinks properly If the symlink is relative, we should resolve it relative to /etc/resolv.conf and not / --- diff --git a/mkosi/run.py b/mkosi/run.py index 111266f9b..af2d39f8c 100644 --- a/mkosi/run.py +++ b/mkosi/run.py @@ -369,7 +369,7 @@ def chroot_cmd(root: Path, *, options: Sequence[PathString] = (), network: bool # mkdir(symlink) which obviously fails if multiple components of the dangling symlink path don't # exist yet. As a workaround, we resolve the symlink ourselves so that bubblewrap will correctly # create all missing components in the target path. - resolve = (root / resolve).readlink() + resolve = resolve.parent / (root / resolve).readlink() # If we're using the host network namespace, use the same resolver. cmdline += ["--ro-bind", "/etc/resolv.conf", Path("/") / resolve]