You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

live 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/sh
  2. test_aufs()
  3. {
  4. if [ ! -d /fll/aufs ]; then
  5. echo "No /fll/aufs directory exists ! Will exit now."
  6. exit 1
  7. fi
  8. }
  9. MountLive()
  10. {
  11. if ! ischroot ; then
  12. # mounts dev proc sys dev/pts under /fll/aufs
  13. echo " Mounting dev proc sys dev/pts under /fll/aufs and chroot there."
  14. echo " Please run exit and then live out to exit chroot."
  15. for i in dev dev/pts proc sys ; do
  16. mount --bind /$i /fll/aufs/$i
  17. done
  18. chroot /fll/aufs
  19. else
  20. echo "Please exit chroot and type live go"
  21. fi
  22. }
  23. UmountLive()
  24. {
  25. # umounts dev proc sys dev/pts from /fll/aufs
  26. if ! ischroot ; then
  27. echo " Umounting dev proc sys dev/pts from fll/aufs."
  28. for i in sys proc dev/pts dev ; do
  29. umount /fll/aufs/$i
  30. done
  31. else
  32. echo "Please exit chroot and type live out"
  33. fi
  34. }
  35. case "$1" in
  36. go)
  37. test_aufs
  38. MountLive
  39. ;;
  40. out)
  41. test_aufs
  42. UmountLive
  43. ;;
  44. *)
  45. echo "This script should be runned outside chroot"
  46. echo "Usage: live {go|out}"
  47. exit 1
  48. ;;
  49. esac