mountvirtfs 987 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/sh
  2. ########################################################################
  3. # Begin $rc_base/init.d/mountvirtfs
  4. #
  5. # Description : Mount proc, sysfs, and run
  6. #
  7. # Authors : Gerard Beekmans - gerard@linuxfromscratch.org
  8. #
  9. # Version : 00.00
  10. #
  11. # Notes :
  12. #
  13. ########################################################################
  14. . /etc/sysconfig/rc
  15. . ${rc_functions}
  16. case "${1}" in
  17. start)
  18. boot_mesg -n "Mounting virtual file systems:" ${INFO}
  19. if ! mountpoint /proc >/dev/null; then
  20. boot_mesg -n " /proc" ${NORMAL}
  21. mount -n /proc || failed=1
  22. fi
  23. if ! mountpoint /sys >/dev/null; then
  24. boot_mesg -n " /sys" ${NORMAL}
  25. mount -n /sys || failed=1
  26. fi
  27. if ! mountpoint /run >/dev/null; then
  28. boot_mesg -n " /run" ${NORMAL}
  29. mount -n /run || failed=1
  30. mkdir /run/var
  31. mkdir /run/shm
  32. fi
  33. boot_mesg "" ${NORMAL}
  34. (exit ${failed})
  35. evaluate_retval
  36. ;;
  37. *)
  38. echo "Usage: ${0} {start}"
  39. exit 1
  40. ;;
  41. esac
  42. # End $rc_base/init.d/mountvertfs