mirror of
https://github.com/Kron4ek/Conty
synced 2024-12-27 09:58:25 +01:00
Properly mount and unmount directories for chroot
This commit is contained in:
parent
334dffaa6c
commit
3e5f47f298
1 changed files with 11 additions and 4 deletions
|
@ -27,16 +27,23 @@ mount_chroot () {
|
|||
|
||||
mount --bind "${bootstrap}" "${bootstrap}"
|
||||
mount -t proc /proc "${bootstrap}"/proc
|
||||
mount --make-rslave --rbind /sys "${bootstrap}"/sys
|
||||
mount --make-rslave --rbind /dev "${bootstrap}"/dev
|
||||
mount --make-rslave --rbind /run "${bootstrap}"/run
|
||||
mount --rbind /sys "${bootstrap}"/sys
|
||||
mount --make-rslave "${bootstrap}"/sys
|
||||
mount --rbind /dev "${bootstrap}"/dev
|
||||
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
|
||||
}
|
||||
|
||||
unmount_chroot () {
|
||||
umount -Rl "${bootstrap}"
|
||||
umount -f "${bootstrap}"/proc
|
||||
umount -f "${bootstrap}"/sys
|
||||
umount -f "${bootstrap}"/dev
|
||||
umount -f "${bootstrap}"/run
|
||||
umount -f "${bootstrap}"
|
||||
}
|
||||
|
||||
run_in_chroot () {
|
||||
|
|
Loading…
Reference in a new issue