mountvirtfs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/sh
  2. ########################################################################
  3. # Begin mountvirtfs
  4. #
  5. # Description : Mount proc, sysfs, and run
  6. #
  7. # Authors : Gerard Beekmans - gerard@linuxfromscratch.org
  8. # Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
  9. #
  10. # Version : LFS 7.0
  11. #
  12. ########################################################################
  13. ### BEGIN INIT INFO
  14. # Provides: mountvirtfs
  15. # Required-Start:
  16. # Should-Start:
  17. # Required-Stop:
  18. # Should-Stop:
  19. # Default-Start: S
  20. # Default-Stop:
  21. # Short-Description: Mounts /sys and /proc virtual (kernel) filesystems.
  22. # Mounts /run tmpfs.
  23. # Description: Mounts /sys and /proc virtual (kernel) filesystems.
  24. # Mounts /run tmpfs.
  25. # X-LFS-Provided-By: LFS
  26. ### END INIT INFO
  27. . /lib/boot/functions
  28. case "${1}" in
  29. start)
  30. mkdir -p /run
  31. mount -n /run || failed=1
  32. mkdir -p /run/{var,lock,shm}
  33. boot_mesg -n "Mounting virtual file systems:" ${INFO}
  34. boot_mesg -n " /run" ${NORMAL}
  35. if ! mountpoint /proc >/dev/null; then
  36. boot_mesg -n " /proc" ${NORMAL}
  37. mount -n /proc || failed=1
  38. fi
  39. if ! mountpoint /sys >/dev/null; then
  40. boot_mesg -n " /sys" ${NORMAL}
  41. mount -n /sys || failed=1
  42. fi
  43. boot_mesg "" ${NORMAL}
  44. (exit ${failed})
  45. evaluate_retval
  46. ;;
  47. *)
  48. echo "Usage: ${0} {start}"
  49. exit 1
  50. ;;
  51. esac
  52. # End mountvertfs