mount_root 588 B

1234567891011121314151617181920212223242526
  1. #!/bin/sh
  2. # Copyright (C) 2006 OpenWrt.org
  3. mount none /proc -t proc
  4. size=$(awk '/Mem:/ {l=5242880;print((s=$2/2)<l)?$2-l:s}' /proc/meminfo)
  5. mount none /tmp -t tmpfs -o size=$size
  6. if [ "$1" != "failsafe" ]; then
  7. mtd unlock filesystem
  8. mount | grep jffs2 >&-
  9. if [ $? = 0 ] ; then
  10. if [ $(cat /proc/mtd | wc -l) = 6 ]; then
  11. mtd erase filesystem
  12. jffs2root --move
  13. else
  14. mount -o remount,rw /dev/root /
  15. fi
  16. else
  17. . /bin/firstboot
  18. fi
  19. fi
  20. mount none /tmp -t tmpfs -o remount,nosuid,nodev,mode=1777
  21. mkdir -p /dev/pts
  22. mount none /dev/pts -t devpts
  23. mount -t sysfs none /sys 2>&-