arch-chroot: umount /etc/resolv.conf as part of trap
This commit is contained in:
parent
f83a267672
commit
05b36e029c
@ -21,7 +21,7 @@ chrootdir=$1
|
|||||||
|
|
||||||
[[ -d $chrootdir ]] || die "Can't create chroot on non-directory %s" "$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"
|
api_fs_mount "$chrootdir" || die "failed to setup API filesystems in chroot %s" "$1"
|
||||||
mount -B /etc/resolv.conf "$chrootdir/etc/resolv.conf"
|
mount -B /etc/resolv.conf "$chrootdir/etc/resolv.conf"
|
||||||
|
Loading…
Reference in New Issue
Block a user