Created
September 2, 2019 14:39
-
-
Save ngnguyen1/e03f313fa9c3f3db590fe8b35feb5953 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/sbin/openrc-run | |
depend() { | |
need localmount | |
need bootmisc | |
} | |
start() { | |
ebegin "Mounting chroot directories" | |
mount -o rbind /dev /mnt/mychroot/dev > /dev/null & | |
mount -t proc none /mnt/mychroot/proc > /dev/null & | |
mount -o bind /sys /mnt/mychroot/sys > /dev/null & | |
mount -o bind /tmp /mnt/mychroot/tmp > /dev/null & | |
eend $? "An error occurred while mounting chroot directories" | |
} | |
stop() { | |
ebegin "Unmounting chroot directories" | |
umount -f /mnt/mychroot/dev > /dev/null & | |
umount -f /mnt/mychroot/proc > /dev/null & | |
umount -f /mnt/mychroot/sys > /dev/null & | |
umount -f /mnt/mychroot/tmp > /dev/null & | |
eend $? "An error occurred while unmounting chroot directories" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment