arch-chroot: umount /etc/resolv.conf as part of trap

This commit is contained in:
Dave Reisner 2012-07-15 10:09:49 -04:00
parent f83a267672
commit 05b36e029c

View File

@ -21,7 +21,7 @@ chrootdir=$1
[[ -d $chrootdir ]] || die "Can't create chroot on non-directory %s" "$1"
trap 'api_fs_umount "$chrootdir" 2>/dev/null' EXIT
trap '{ api_fs_umount "$chrootdir"; umount "$chrootdir/etc/resolv.conf"; } 2>/dev/null' EXIT
api_fs_mount "$chrootdir" || die "failed to setup API filesystems in chroot %s" "$1"
mount -B /etc/resolv.conf "$chrootdir/etc/resolv.conf"