Fix unmounting chroot directories

Hopefully for sure this time.
This commit is contained in:
Kron4ek 2021-05-28 16:29:17 +05:00 committed by GitHub
parent 7af5ceba68
commit cbc9cc4f87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,23 +27,26 @@ mount_chroot () {
mount --bind "${bootstrap}" "${bootstrap}"
mount -t proc /proc "${bootstrap}"/proc
mount --rbind /sys "${bootstrap}"/sys
mount --bind /sys "${bootstrap}"/sys
mount --make-rslave "${bootstrap}"/sys
mount --rbind /dev "${bootstrap}"/dev
mount --bind /dev "${bootstrap}"/dev
mount --bind /dev/pts "${bootstrap}"/dev/pts
mount --bind /dev/shm "${bootstrap}"/dev/shm
mount --make-rslave "${bootstrap}"/dev
mount --rbind /run "${bootstrap}"/run
mount --make-rslave "${bootstrap}"/run
rm -f "${bootstrap}"/etc/resolv.conf
cp /etc/resolv.conf "${bootstrap}"/etc/resolv.conf
mkdir -p "${bootstrap}"/run/shm
}
unmount_chroot () {
umount -f "${bootstrap}"/proc
umount -f "${bootstrap}"/sys
umount -f "${bootstrap}"/dev
umount -f "${bootstrap}"/run
umount -f "${bootstrap}"
umount -l "${bootstrap}"
umount "${bootstrap}"/proc
umount "${bootstrap}"/sys
umount "${bootstrap}"/dev/pts
umount "${bootstrap}"/dev/shm
umount "${bootstrap}"/dev
}
run_in_chroot () {