Separate chroot mount and unmount

This commit is contained in:
Fierelier 2022-05-10 22:52:22 +02:00
parent 03d1593d42
commit f795751c1e
2 changed files with 6 additions and 4 deletions

View File

@ -5,7 +5,4 @@ mount -o bind "/dev/pts" "$1/dev/pts"
mount -o bind "/sys" "$1/sys" mount -o bind "/sys" "$1/sys"
mount -o bind "/proc" "$1/proc" mount -o bind "/proc" "$1/proc"
chroot "$1" ${@:2} chroot "$1" ${@:2}
umount -l "$1/proc" fchroot-end "$1"
umount -l "$1/sys"
umount -l "$1/dev/pts"
umount -l "$1/dev"

5
path/fchroot-end Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
umount -l "$1/proc"
umount -l "$1/sys"
umount -l "$1/dev/pts"
umount -l "$1/dev"