bind mount /etc/resolv.conf instead of overwriting/removing

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
remotes/origin/fix-j
Steven Armstrong 9 years ago
parent c6e4888c84
commit 1d42e4afcb
  1. 5
      cdist/conf/type/__chroot_mount/gencode-remote
  2. 4
      cdist/conf/type/__chroot_umount/gencode-remote

@ -42,7 +42,6 @@ mountpoint -q "${chroot}/dev/pts" \
mountpoint -q "${chroot}/tmp" \
|| mount -t tmpfs -o mode=1777,strictatime,nodev,nosuid tmpfs "${chroot}/tmp"
if [ ! -f "${chroot}/etc/resolv.conf" ]; then
cp /etc/resolv.conf "${chroot}/etc/"
fi
mountpoint -q "${chroot}/etc/resolv.conf" \
|| mount --bind -o ro /etc/resolv.conf "${chroot}/etc/resolv.conf"
DONE

@ -26,7 +26,9 @@ umount -l "${chroot}/dev/pts"
umount -l "${chroot}/dev"
umount -l "${chroot}/sys"
umount -l "${chroot}/proc"
rm -f "${chroot}/etc/resolv.conf"
if mountpoint -q "${chroot}/etc/resolv.conf"; then
umount "${chroot}/etc/resolv.conf"
fi
if [ -d "${chroot}/etc/resolvconf/resolv.conf.d" ]; then
# ensure /etc/resolvconf/resolv.conf.d/tail is not linked to \
# e.g. /etc/resolvconf/resolv.conf.d/original

Loading…
Cancel
Save