mountvirtfs 980 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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,lock,shm}
  31. fi
  32. boot_mesg "" ${NORMAL}
  33. (exit ${failed})
  34. evaluate_retval
  35. ;;
  36. *)
  37. echo "Usage: ${0} {start}"
  38. exit 1
  39. ;;
  40. esac
  41. # End $rc_base/init.d/mountvertfs