Last active
August 29, 2015 14:00
-
-
Save bamthomas/11221780 to your computer and use it in GitHub Desktop.
mounting host chroot pseudo filesystem
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
bindir=$(dirname $0) | |
root_dir=$bindir/root_dir | |
montePointsPourChroot() { | |
sudo echo -ne « mounting pseudo filesystems: » | |
for pseudo in dev proc sys | |
do | |
sudo mount –bind /$pseudo $root_dir/$pseudo | |
echo -ne » $pseudo » | |
done | |
echo « » | |
} | |
demontePointsPourChroot() { | |
echo -ne « unmounting pseudo filesystems: » | |
for pseudo in dev/pts proc sys dev | |
do | |
sudo umount -l $root_dir/$pseudo | |
echo -ne » $pseudo » | |
done | |
echo « » | |
} | |
montePointsPourChroot | |
echo « /root/.bashrc va lancer $root_dir/init_chroot.sh » | |
sudo su -c « chroot $root_dir /bin/bash » | |
sudo su -c « chroot $root_dir /arrete_chroot.sh » | |
demontePointsPourChroot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment