Created
February 25, 2014 17:51
-
-
Save RobinDavid/9214151 to your computer and use it in GitHub Desktop.
script to create an nice chroot to a given folder
This file contains hidden or 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
#!/bin/bash | |
ROOT=$1 | |
mount procfs -t proc $ROOT/proc/ | |
mount sysfs -t sysfs | |
mount -o bin /dev $ROOT/dev/ | |
mount -o bin /dev/pts $ROOT/dev/pts | |
mount --bind /etc/resolv.conf $ROOT/etc/resolv.conf | |
chroot $ROOT | |
umount $ROOT/etc/resolv.conf | |
umount $ROOT/proc/ | |
umount $ROOT/sys/ | |
umount $ROOT/dev/pts/ | |
umount $ROOT/dev/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment