summaryrefslogtreecommitdiffstats
path: root/mkosi.presets/20-final
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2023-08-07 20:17:41 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2023-08-07 21:56:55 +0200
commitb57e7522209c8bdff6e0970d0fc4a7ec92ea50fe (patch)
tree9350268262ce47478ecba8dce89782671d158b27 /mkosi.presets/20-final
parentci(lint): exclude `.in` files from ShellCheck lint (diff)
downloadsystemd-b57e7522209c8bdff6e0970d0fc4a7ec92ea50fe.tar.xz
systemd-b57e7522209c8bdff6e0970d0fc4a7ec92ea50fe.zip
mkosi: Unmount /etc/resolv.conf if it's a mountpoint
Diffstat (limited to 'mkosi.presets/20-final')
-rwxr-xr-xmkosi.presets/20-final/mkosi.postinst4
1 files changed, 3 insertions, 1 deletions
diff --git a/mkosi.presets/20-final/mkosi.postinst b/mkosi.presets/20-final/mkosi.postinst
index 3f3a78e906..663fa5c762 100755
--- a/mkosi.presets/20-final/mkosi.postinst
+++ b/mkosi.presets/20-final/mkosi.postinst
@@ -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