early-filesystems.sh 768 B

123456789101112131415161718192021222324252627
  1. #!/bin/sh
  2. set -e
  3. if [ "$1" = start ]; then
  4. PATH=/usr/bin:/usr/sbin:/bin:/sbin
  5. # Must have sysfs mounted for udevtrigger to function.
  6. mount -n -t sysfs sysfs /sys
  7. # Ideally devtmpfs will be mounted by kernel, we can mount here anyway:
  8. mount -n -t devtmpfs tmpfs /dev
  9. mkdir -p /dev/pts /dev/shm
  10. mount -n -t tmpfs -o nodev,nosuid tmpfs /dev/shm
  11. mount -n -t devpts -o gid=5 devpts /dev/pts
  12. # /run, and various directories within it
  13. mount -n -t tmpfs -o mode=775 tmpfs /run
  14. mkdir /run/lock /run/udev
  15. # "hidepid=1" doesn't appear to take effect on first mount of /proc,
  16. # so we mount it and then remount:
  17. mount -n -t proc -o hidepid=1 proc /proc
  18. mount -n -t proc -o remount,hidepid=1 proc /proc
  19. fi