]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: Unmount /etc/resolv.conf if it's a mountpoint
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 7 Aug 2023 18:17:41 +0000 (20:17 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 7 Aug 2023 19:56:55 +0000 (20:56 +0100)
mkosi.presets/20-final/mkosi.postinst

index 3f3a78e906333372864259a00649d0af29696bb1..663fa5c762e30b98c2e3104a2702d3b53cdf8223 100755 (executable)
@@ -76,7 +76,9 @@ if command -v authselect >/dev/null; then
     fi
 fi
 
-# Let tmpfiles.d/systemd-resolve.conf handle the symlink
+# Let tmpfiles.d/systemd-resolve.conf handle the symlink. /etc/resolv.conf might be mounted over so undo that
+# if that's the case.
+mountpoint -q /etc/resolv.conf && umount /etc/resolv.conf
 rm -f /etc/resolv.conf
 
 . /usr/lib/os-release