mount/umounting a chroot should not mess with resolv.conf at all

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2016-04-26 22:39:36 +02:00
parent 73cad9dee2
commit aea9747918
2 changed files with 0 additions and 14 deletions

View File

@ -41,13 +41,4 @@ mountpoint -q "${chroot}/dev/pts" \
[ -d "${chroot}/tmp" ] || mkdir -m 1777 "${chroot}/tmp"
mountpoint -q "${chroot}/tmp" \
|| mount -t tmpfs -o mode=1777,strictatime,nodev,nosuid tmpfs "${chroot}/tmp"
if [ -f "${chroot}/etc/resolv.conf" ]; then
# if file exists, bind mount over it
mountpoint -q "${chroot}/etc/resolv.conf" \
|| mount --bind -o ro /etc/resolv.conf "${chroot}/etc/resolv.conf"
else
# otherwise copy
cp /etc/resolv.conf "${chroot}/etc/resolv.conf"
fi
DONE

View File

@ -26,11 +26,6 @@ umount -l "${chroot}/dev/pts"
umount -l "${chroot}/dev"
umount -l "${chroot}/sys"
umount -l "${chroot}/proc"
if mountpoint -q "${chroot}/etc/resolv.conf"; then
umount "${chroot}/etc/resolv.conf"
else
rm -rf "${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