morpheus

suckless linux distro
git clone git://git.2f30.org/morpheus
Log | Files | Refs | Submodules | README | LICENSE

run-chroot (741B)


      1 #!/bin/sh
      2 
      3 if test "$1" != ""; then
      4 	root=$1
      5 else
      6 	root=root
      7 fi
      8 
      9 echo -n "Mounting $root/dev... "
     10 sudo mount -o bind /dev $root/dev
     11 echo "done."
     12 echo -n "Mounting $root/dev/pts... "
     13 sudo mount -o bind /dev/pts $root/dev/pts
     14 echo "done."
     15 echo -n "Mounting $root/proc... "
     16 sudo mount -t proc proc $root/proc
     17 echo "done."
     18 echo -n "Mounting $root/sys... "
     19 sudo mount -o bind /sys $root/sys
     20 echo "done."
     21 echo "Chrooting $root..."
     22 sudo chroot $root /bin/sh
     23 echo -n "Unmounting $root/dev/pts... "
     24 sudo umount $root/dev/pts
     25 echo "done."
     26 echo -n "Unmounting $root/dev... "
     27 sudo umount $root/dev
     28 echo "done."
     29 echo -n "Unmounting $root/sys... "
     30 sudo umount $root/sys
     31 echo "done."
     32 echo -n "Unmounting $root/proc... "
     33 sudo umount $root/proc
     34 echo "done."